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
20ebfd87
You need to sign in or sign up before continuing.
Commit
20ebfd87
authored
Apr 03, 2024
by
limengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(lmy):上传优化
parent
dac7a2e0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
26 deletions
+17
-26
src/api/regionalSpotManage/index.ts
src/api/regionalSpotManage/index.ts
+5
-5
src/views/regionalSpotManage/components/list.vue
src/views/regionalSpotManage/components/list.vue
+9
-18
src/views/regionalSpotManage/index.vue
src/views/regionalSpotManage/index.vue
+3
-3
No files found.
src/api/regionalSpotManage/index.ts
View file @
20ebfd87
import
{
tmallabHttp
}
from
'
/@/utils/http/axios
'
;
import
{
tmallabHttp
}
from
'
/@/utils/http/axios
'
;
import
{
ContentTypeEnum
}
from
'
/@/enums/httpEnum
'
;
enum
Api
{
enum
Api
{
GetStatus
=
'
/system/opsProduct/IsOpsSupplier
'
,
GetStatus
=
'
/system/opsProduct/IsOpsSupplier
'
,
List
=
'
/system/opsProduct/getList
'
,
List
=
'
/system/opsProduct/getList
'
,
...
@@ -80,14 +79,15 @@ export const regionalSpotManageOpsEditProductApi = (data) =>
...
@@ -80,14 +79,15 @@ export const regionalSpotManageOpsEditProductApi = (data) =>
/**
/**
* @description: 批量上传
* @description: 批量上传
*/
*/
export
const
regionalSpotManageUploadOpsProductApi
=
(
data
)
=>
export
const
regionalSpotManageUploadOpsProductApi
=
(
data
,
file
)
=>
tmallabHttp
.
post
(
tmallabHttp
.
uploadFile
(
{
{
url
:
Api
.
UploadOpsProduct
,
url
:
Api
.
UploadOpsProduct
,
method
:
'
POST
'
,
data
,
data
,
headers
:
{
'
Content-Type
'
:
ContentTypeEnum
.
FORM_DATA
}
,
baseURL
:
import
.
meta
.
env
.
VITE_GLOB_TMALLAB_URL
,
},
},
{
errorMessageMode
:
'
message
'
},
{
file
,
data
},
);
);
/**
/**
...
...
src/views/regionalSpotManage/components/list.vue
View file @
20ebfd87
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
onMounted
}
from
'
vue
'
;
import
{
ref
,
onMounted
}
from
'
vue
'
;
import
axios
from
'
axios
'
;
import
{
import
{
Form
,
Form
,
FormItem
,
FormItem
,
...
@@ -14,7 +13,7 @@
...
@@ -14,7 +13,7 @@
}
from
'
ant-design-vue
'
;
}
from
'
ant-design-vue
'
;
import
{
UploadOutlined
}
from
'
@ant-design/icons-vue
'
;
import
{
UploadOutlined
}
from
'
@ant-design/icons-vue
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
{
getAuthCache
,
getTmallabToken
}
from
'
/@/utils/auth
'
;
import
{
getAuthCache
}
from
'
/@/utils/auth
'
;
import
{
import
{
regionalSpotManageBrandListApi
,
regionalSpotManageBrandListApi
,
regionalSpotManageGroupListApi
,
regionalSpotManageGroupListApi
,
...
@@ -23,11 +22,11 @@
...
@@ -23,11 +22,11 @@
regionalSpotManageGetGhsAreaListApi
,
regionalSpotManageGetGhsAreaListApi
,
regionalSpotManageOpsDeleteProductApi
,
regionalSpotManageOpsDeleteProductApi
,
regionalSpotManageOpsEditProductApi
,
regionalSpotManageOpsEditProductApi
,
regionalSpotManageUploadOpsProductApi
,
}
from
'
/@/api/regionalSpotManage
'
;
}
from
'
/@/api/regionalSpotManage
'
;
import
addProductModal
from
'
./addProduct.vue
'
;
import
addProductModal
from
'
./addProduct.vue
'
;
const
config
=
import
.
meta
.
env
;
const
config
=
import
.
meta
.
env
;
const
userInfo
:
any
=
getAuthCache
(
'
USER__INFO__
'
);
const
userInfo
:
any
=
getAuthCache
(
'
USER__INFO__
'
);
const
Token
=
getTmallabToken
()
as
unknown
as
string
;
const
ghsCode
=
userInfo
.
supplier
.
ghsCode
;
const
ghsCode
=
userInfo
.
supplier
.
ghsCode
;
const
ghsName
=
userInfo
.
supplier
.
ghsName
;
const
ghsName
=
userInfo
.
supplier
.
ghsName
;
const
router
=
useRouter
();
const
router
=
useRouter
();
...
@@ -394,22 +393,14 @@
...
@@ -394,22 +393,14 @@
const
confirmImport
=
async
()
=>
{
const
confirmImport
=
async
()
=>
{
if
(
!
productExcelList
.
value
.
length
)
return
message
.
error
(
'
请上传文件
'
);
if
(
!
productExcelList
.
value
.
length
)
return
message
.
error
(
'
请上传文件
'
);
if
(
!
impotrCheckboxValue
.
value
.
length
)
return
message
.
error
(
'
请选择现货区域
'
);
if
(
!
impotrCheckboxValue
.
value
.
length
)
return
message
.
error
(
'
请选择现货区域
'
);
const
data
:
FormData
=
new
FormData
();
const
param
:
FormData
=
new
FormData
();
data
.
append
(
'
ghsCode
'
,
ghsCode
);
param
.
append
(
'
ghsCode
'
,
ghsCode
);
data
.
append
(
'
ghsName
'
,
ghsName
);
param
.
append
(
'
ghsName
'
,
ghsName
);
data
.
append
(
'
file
'
,
productExcelList
.
value
[
0
]);
param
.
append
(
'
file
'
,
productExcelList
.
value
[
0
]);
data
.
append
(
'
areaIds
'
,
impotrCheckboxValue
.
value
.
join
(
'
,
'
)
as
any
);
param
.
append
(
'
areaIds
'
,
impotrCheckboxValue
.
value
.
join
(
'
,
'
)
as
any
);
importLoading
.
value
=
true
;
importLoading
.
value
=
true
;
const
res
=
await
axios
.
post
(
const
res
:
any
=
await
regionalSpotManageUploadOpsProductApi
(
param
,
productExcelList
.
value
[
0
]);
config
.
VITE_GLOB_TMALLAB_URL
+
'
/excel/excelNew/uploadOpsProduct
'
,
console
.
log
(
res
);
data
,
{
headers
:
{
Token
:
Token
,
},
},
);
// const res = await regionalSpotManageUploadOpsProductApi(param);
if
(
res
.
data
.
success
)
{
if
(
res
.
data
.
success
)
{
message
.
success
(
'
批量导入成功
'
);
message
.
success
(
'
批量导入成功
'
);
importCancel
();
importCancel
();
...
...
src/views/regionalSpotManage/index.vue
View file @
20ebfd87
...
@@ -16,12 +16,12 @@
...
@@ -16,12 +16,12 @@
<
template
>
<
template
>
<div>
<div>
<
ManageList
/
>
<
!--
<ManageList
/>
--
>
<
!--
<
a-spin
v-if=
"loading"
style=
"height: 150px; width: 100%; line-height: 150px"
/>
<a-spin
v-if=
"loading"
style=
"height: 150px; width: 100%; line-height: 150px"
/>
<ManageList
v-if=
"show && !loading"
/>
<ManageList
v-if=
"show && !loading"
/>
<div
v-if=
"!show && !loading"
class=
"status"
>
<div
v-if=
"!show && !loading"
class=
"status"
>
<img
src=
"../../assets/images/logo.png"
alt=
""
srcset=
""
/>
<img
src=
"../../assets/images/logo.png"
alt=
""
srcset=
""
/>
</div>
-->
</div>
</div>
</div>
</
template
>
</
template
>
...
...
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