Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
merchant-manage-ui
Commits
ddfa33ce
Commit
ddfa33ce
authored
Nov 09, 2023
by
guang.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改导入功能
parent
79adc898
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
20 deletions
+29
-20
SearchForm.jsx
...s/GoodsManage/SupplyPriceUpdate/components/SearchForm.jsx
+26
-5
staticdata.js
src/pages/GoodsManage/SupplyPriceUpdate/staticdata.js
+0
-13
service.js
src/pages/GoodsManage/service.js
+3
-2
No files found.
src/pages/GoodsManage/SupplyPriceUpdate/components/SearchForm.jsx
View file @
ddfa33ce
...
...
@@ -4,8 +4,7 @@ import { SwapRightOutlined } from '@ant-design/icons';
import
{
connect
}
from
'
dva
'
;
import
styles
from
'
../../style.less
'
;
import
{
stateList
}
from
'
../../staticdata
'
;
import
{
uploadConfig
}
from
'
../staticdata
'
;
import
{
apiDownBiddingTemplate
}
from
'
../../service
'
;
import
{
apiDownBiddingTemplate
,
apiUploadGoodsFile
}
from
'
../../service
'
;
const
FormItem
=
Form
.
Item
;
const
{
Option
}
=
Select
;
...
...
@@ -18,6 +17,7 @@ class goodsManage extends Component {
state
=
{
productType
:
null
,
loading
:
false
,
};
componentDidMount
()
{
...
...
@@ -38,7 +38,6 @@ class goodsManage extends Component {
onDownload
=
()
=>
{
const
form
=
this
.
formRef
.
current
;
const
values
=
form
.
getFieldsValue
();
console
.
log
(
'
values :>>
'
,
values
);
apiDownBiddingTemplate
(
values
);
};
...
...
@@ -95,6 +94,28 @@ class goodsManage extends Component {
});
};
// 上传文件设置
uploadConfig
=
()
=>
{
const
that
=
this
;
return
{
name
:
'
file
'
,
async
customRequest
(
info
)
{
that
.
setState
({
loading
:
true
,
});
const
result
=
await
apiUploadGoodsFile
(
info
.
file
);
if
(
result
.
businessCode
===
'
0000
'
)
{
notification
.
success
({
message
:
'
导入成功
'
});
}
that
.
setState
({
loading
:
false
,
});
},
accept
:
'
.xlsx
'
,
showUploadList
:
false
,
};
};
render
()
{
const
{
treeData
}
=
this
.
props
;
const
selectW
=
{
width
:
250
};
...
...
@@ -177,8 +198,8 @@ class goodsManage extends Component {
<
Button
onClick=
{
()
=>
this
.
onReset
()
}
className=
{
styles
.
button
}
>
重置
</
Button
>
<
Upload
{
...
uploadConfig
}
>
<
Button
type=
"primary"
ghost
className=
{
styles
.
button
}
>
<
Upload
{
...
this
.
uploadConfig
()
}
>
<
Button
type=
"primary"
loading=
{
this
.
state
.
loading
}
ghost
className=
{
styles
.
button
}
>
导入
</
Button
>
</
Upload
>
...
...
src/pages/GoodsManage/SupplyPriceUpdate/staticdata.js
View file @
ddfa33ce
...
...
@@ -2,7 +2,6 @@ import React from 'react';
import
{
Input
,
Form
,
InputNumber
,
Button
,
notification
}
from
'
antd
'
;
import
{
isIntegerNotMust
,
isCheckPriceTwoDecimal
}
from
'
@/utils/validator
'
;
import
styles
from
'
./style.less
'
;
import
{
apiUploadGoodsFile
}
from
'
../service
'
;
export
function
column
(
specArr
=
[])
{
return
[
...
...
@@ -144,15 +143,3 @@ export function columnManage() {
},
];
}
export
const
uploadConfig
=
{
name
:
'
file
'
,
async
customRequest
(
info
)
{
const
result
=
await
apiUploadGoodsFile
(
info
.
file
);
if
(
result
.
businessCode
===
'
0000
'
)
{
notification
.
success
({
message
:
'
导入成功
'
});
}
},
accept
:
'
.xlsx
'
,
showUploadList
:
false
,
};
src/pages/GoodsManage/service.js
View file @
ddfa33ce
...
...
@@ -426,12 +426,13 @@ export async function apiBiddingList(params) {
/**
* 导入竞价商品信息
* yApi:
* yApi:
http://yapi.quantgroups.com/project/389/interface/api/45896
* * */
export
async
function
apiUploadGoodsFile
(
file
)
{
const
params
=
new
FormData
();
params
.
append
(
'
file
'
,
file
);
const
data
=
await
request
.
post
(
'
/api/merchants/orders/deliveries/batches/import
'
,
{
params
.
append
(
'
type
'
,
6
);
const
data
=
await
request
.
post
(
'
/api/merchants/importFile/excel
'
,
{
data
:
params
,
prefix
:
goodsApi
,
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment