Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
ops_2024_vue
Project overview
Project overview
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
Administrator
ops_2024_vue
Commits
dac7a2e0
You need to sign in or sign up before continuing.
Commit
dac7a2e0
authored
Apr 02, 2024
by
limengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(lmy):批量上传
parent
642db372
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
src/views/regionalSpotManage/components/list.vue
src/views/regionalSpotManage/components/list.vue
+21
-11
No files found.
src/views/regionalSpotManage/components/list.vue
View file @
dac7a2e0
<
script
lang=
"ts"
setup
>
import
{
ref
,
onMounted
}
from
'
vue
'
;
import
axios
from
'
axios
'
;
import
{
Form
,
FormItem
,
...
...
@@ -13,7 +14,7 @@
}
from
'
ant-design-vue
'
;
import
{
UploadOutlined
}
from
'
@ant-design/icons-vue
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
{
getAuthCache
}
from
'
/@/utils/auth
'
;
import
{
getAuthCache
,
getTmallabToken
}
from
'
/@/utils/auth
'
;
import
{
regionalSpotManageBrandListApi
,
regionalSpotManageGroupListApi
,
...
...
@@ -22,11 +23,11 @@
regionalSpotManageGetGhsAreaListApi
,
regionalSpotManageOpsDeleteProductApi
,
regionalSpotManageOpsEditProductApi
,
regionalSpotManageUploadOpsProductApi
,
}
from
'
/@/api/regionalSpotManage
'
;
import
addProductModal
from
'
./addProduct.vue
'
;
const
config
=
import
.
meta
.
env
;
const
userInfo
:
any
=
getAuthCache
(
'
USER__INFO__
'
);
const
Token
=
getTmallabToken
()
as
unknown
as
string
;
const
ghsCode
=
userInfo
.
supplier
.
ghsCode
;
const
ghsName
=
userInfo
.
supplier
.
ghsName
;
const
router
=
useRouter
();
...
...
@@ -357,7 +358,7 @@
// =====================批量导入 start=======================
const
productExcelList
=
ref
<
any
[]
>
([]);
const
importVisible
=
ref
(
false
);
const
impotrCheckboxValue
=
ref
([]);
const
impotrCheckboxValue
=
ref
<
any
[]
>
([]);
const
batchImport
=
()
=>
{
importVisible
.
value
=
true
;
allAreaList
.
value
.
forEach
((
v
)
=>
{
...
...
@@ -393,18 +394,27 @@
const
confirmImport
=
async
()
=>
{
if
(
!
productExcelList
.
value
.
length
)
return
message
.
error
(
'
请上传文件
'
);
if
(
!
impotrCheckboxValue
.
value
.
length
)
return
message
.
error
(
'
请选择现货区域
'
);
const
param
:
FormData
=
new
FormData
();
param
.
append
(
'
ghsCode
'
,
ghsCode
);
param
.
append
(
'
ghsName
'
,
ghsName
);
param
.
append
(
'
file
'
,
productExcelList
.
value
[
0
]);
param
.
append
(
'
areaIds
'
,
impotrCheckboxValue
.
value
as
any
);
const
data
:
FormData
=
new
FormData
();
data
.
append
(
'
ghsCode
'
,
ghsCode
);
data
.
append
(
'
ghsName
'
,
ghsName
);
data
.
append
(
'
file
'
,
productExcelList
.
value
[
0
]);
data
.
append
(
'
areaIds
'
,
impotrCheckboxValue
.
value
.
join
(
'
,
'
)
as
any
);
importLoading
.
value
=
true
;
const
res
=
await
regionalSpotManageUploadOpsProductApi
(
param
);
if
(
res
.
success
)
{
const
res
=
await
axios
.
post
(
config
.
VITE_GLOB_TMALLAB_URL
+
'
/excel/excelNew/uploadOpsProduct
'
,
data
,
{
headers
:
{
Token
:
Token
,
},
},
);
// const res = await regionalSpotManageUploadOpsProductApi(param);
if
(
res
.
data
.
success
)
{
message
.
success
(
'
批量导入成功
'
);
importCancel
();
}
else
{
message
.
error
(
res
.
message
);
message
.
error
(
res
.
data
.
message
);
}
importLoading
.
value
=
false
;
};
...
...
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