Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
cloudSystem
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6071308f
authored
Apr 30, 2026
by
gyt
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix(consignmentRecall、createConsignmentRecallOrder): 导入位置改动
parent
4fa91662
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
37 deletions
src/views/consignmentManagement/consignmentRecall.vue
src/views/consignmentManagement/createConsignmentRecallOrder.vue
src/views/consignmentManagement/consignmentRecall.vue
View file @
6071308f
...
...
@@ -27,12 +27,12 @@
<div
class=
"operation-button row verCenter"
>
<el-button
type=
"primary"
@
click=
"$router.push('/createConsignmentRecallOrder')"
>
生成寄售召回单
</el-button>
<el-button
type=
"danger"
@
click=
"popupEvent(2)"
>
作废
</el-button>
<el-upload
:action=
"batchRecallUpload"
:headers=
"uploadHeaders"
:on-success=
"handleUploadSuccess"
:on-error=
"handleUploadError"
:before-upload=
"handleBeforeUpload"
accept=
".xlsx,.xls"
:show-file-list=
"false"
name=
"file"
style=
"display: inline-block; margin-left: 10px;"
>
<
!--
<
el-upload
:action=
"batchRecallUpload"
:headers=
"uploadHeaders"
:on-success=
"handleUploadSuccess"
:on-error=
"handleUploadError"
:before-upload=
"handleBeforeUpload"
accept=
".xlsx,.xls"
:show-file-list=
"false"
name=
"file"
style=
"display: inline-block; margin-left: 10px;"
>
<el-button
type=
"primary"
:loading=
"uploadLoading"
>
导入
</el-button>
</el-upload>
<a
href=
"http://cloud.liexindev.net/template/批量召回模板.xlsx"
download
style=
"text-decoration: none; margin-left: 10px;"
>
<el-button
type=
"primary"
>
下载模板
</el-button>
</a>
</a>
-->
<!--
<el-button
type=
"primary"
@
click=
"popupEvent(1)"
>
提交审核
</el-button>
<el-button
type=
"danger"
@
click=
"popupEvent(3)"
>
收货信息
</el-button>
...
...
@@ -120,10 +120,10 @@
name
:
"consignmentRecall"
,
data
()
{
return
{
batchRecallUpload
:
NODE_ENVS
+
'/api/consignmentRecall/batchRecallUpload'
,
uploadHeaders
:
{
'Authorization'
:
'Bearer '
+
Util
.
getCookie
(
'token'
)
||
''
},
//
batchRecallUpload: NODE_ENVS + '/api/consignmentRecall/batchRecallUpload',
//
uploadHeaders: {
//
'Authorization': 'Bearer ' + Util.getCookie('token') || ''
//
},
options
:
pcaTextArr
,
selectedOptions
:
[
'广东省'
,
'深圳市'
,
'龙岗区'
],
multipleSelection
:
[],
...
...
@@ -263,42 +263,42 @@
* @param file 上传的文件
* @return {boolean}
*/
handleBeforeUpload
(
file
)
{
var
isExcel
=
/
\.(
xlsx|xls
)
$/i
.
test
(
file
.
name
);
if
(
!
isExcel
)
{
this
.
$message
.
error
(
'仅支持上传 .xlsx 或 .xls 格式的文件'
);
return
false
;
}
this
.
uploadLoading
=
true
;
return
true
;
},
//
handleBeforeUpload(file) {
//
var isExcel = /\.(xlsx|xls)$/i.test(file.name);
//
if (!isExcel) {
//
this.$message.error('仅支持上传 .xlsx 或 .xls 格式的文件');
//
return false;
//
}
//
this.uploadLoading = true;
//
return true;
//
},
/**
* 导入上传成功回调
* @param res 接口返回数据
*/
handleUploadSuccess
(
res
)
{
this
.
uploadLoading
=
false
;
if
(
res
.
code
===
0
)
{
var
{
success_total
=
0
,
fail_total
=
0
,
fail_list
}
=
res
.
data
||
{};
var
failMsg
=
''
if
(
fail_list
.
length
){
failMsg
+=
`失败原因:\n`
;
failMsg
=
fail_list
.
map
(
item
=>
item
.
remark
).
join
(
';\n'
);
}
this
.
$message
.
success
(
`导入完成,成功
${
success_total
}
条,失败
${
fail_total
}
条`
);
failMsg
&&
this
.
$alert
(
failMsg
);
this
.
getData
();
}
else
{
this
.
$message
.
error
(
res
.
msg
||
'导入失败'
);
}
},
//
handleUploadSuccess(res) {
//
this.uploadLoading = false;
//
if (res.code === 0) {
//
var { success_total = 0, fail_total = 0, fail_list } = res.data || {};
//
var failMsg = ''
//
if(fail_list.length){
//
failMsg += `失败原因:\n`;
//
failMsg = fail_list.map(item => item.remark).join(';\n');
//
}
//
this.$message.success(`导入完成,成功 ${success_total} 条,失败 ${fail_total} 条`);
//
failMsg && this.$alert(failMsg);
//
this.getData();
//
} else {
//
this.$message.error(res.msg || '导入失败');
//
}
//
},
/**
* 导入上传失败回调
*/
handleUploadError
()
{
this
.
uploadLoading
=
false
;
this
.
$message
.
error
(
'导入失败,请重试'
);
},
//
handleUploadError() {
//
this.uploadLoading = false;
//
this.$message.error('导入失败,请重试');
//
},
/**
* 弹窗事件
*/
...
...
src/views/consignmentManagement/createConsignmentRecallOrder.vue
View file @
6071308f
...
...
@@ -38,6 +38,12 @@
</div>
<div
class=
"xktitle"
style=
"margin-bottom: 10px;"
>
召回库存明细
</div>
<el-button
type=
"primary"
@
click=
"add"
>
添加
</el-button>
<el-upload
:action=
"batchRecallUpload"
:headers=
"uploadHeaders"
:on-success=
"handleUploadSuccess"
:on-error=
"handleUploadError"
:before-upload=
"handleBeforeUpload"
accept=
".xlsx,.xls"
:show-file-list=
"false"
name=
"file"
style=
"display: inline-block; margin-left: 10px;"
>
<el-button
type=
"primary"
:loading=
"uploadLoading"
>
导入
</el-button>
</el-upload>
<a
href=
"http://cloud.liexindev.net/template/批量召回模板.xlsx"
download
style=
"text-decoration: none; margin-left: 10px;"
>
<el-button
type=
"primary"
>
下载模板
</el-button>
</a>
<div
style=
"margin-top: 10px;"
>
<el-table
:data=
"recall_json"
border
max-height=
"500"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
align=
"center"
fixed
></el-table-column>
...
...
@@ -125,17 +131,24 @@
<
script
>
import
Vue
from
'vue'
;
import
Menu
from
"@/components/menu.vue"
;
import
{
Autocomplete
,
Button
,
Cascader
,
DatePicker
,
Descriptions
,
DescriptionsItem
,
Dialog
,
Divider
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Form
,
FormItem
,
Input
,
InputNumber
,
Link
,
Message
,
MessageBox
,
Option
,
Pagination
,
Popover
,
Select
,
Table
,
TableColumn
,
Tag
,
Tooltip
}
from
'element-ui'
import
{
Autocomplete
,
Button
,
Cascader
,
DatePicker
,
Descriptions
,
DescriptionsItem
,
Dialog
,
Divider
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Form
,
FormItem
,
Input
,
InputNumber
,
Link
,
Message
,
MessageBox
,
Option
,
Pagination
,
Popover
,
Select
,
Table
,
TableColumn
,
Tag
,
Tooltip
,
Upload
}
from
'element-ui'
import
{
pcaTextArr
}
from
'element-china-area-data'
import
{
NODE_ENVS
}
from
"@/ajax/index"
import
Util
from
"@/tool/index.js"
Vue
.
prototype
.
$message
=
Message
Vue
.
prototype
.
$confirm
=
MessageBox
.
confirm
;
Vue
.
use
(
Button
).
use
(
Link
).
use
(
Cascader
).
use
(
Form
).
use
(
Select
).
use
(
Option
).
use
(
Input
).
use
(
InputNumber
).
use
(
FormItem
).
use
(
Dialog
).
use
(
Tooltip
).
use
(
Autocomplete
).
use
(
Popover
).
use
(
Tag
).
use
(
Divider
);
Vue
.
use
(
Button
).
use
(
Link
).
use
(
Cascader
).
use
(
Form
).
use
(
Select
).
use
(
Option
).
use
(
Input
).
use
(
InputNumber
).
use
(
FormItem
).
use
(
Dialog
).
use
(
Tooltip
).
use
(
Autocomplete
).
use
(
Popover
).
use
(
Tag
).
use
(
Divider
)
.
use
(
Upload
)
;
Vue
.
use
(
DatePicker
).
use
(
Dropdown
).
use
(
DropdownMenu
).
use
(
DropdownItem
).
use
(
TableColumn
).
use
(
Table
).
use
(
Pagination
).
use
(
Descriptions
).
use
(
DescriptionsItem
);
export
default
{
name
:
"createConsignmentRecallOrder"
,
data
()
{
return
{
batchRecallUpload
:
NODE_ENVS
+
'/api/consignmentRecall/batchRecallUpload'
,
uploadHeaders
:
{
'Authorization'
:
'Bearer '
+
Util
.
getCookie
(
'token'
)
||
''
},
uploadLoading
:
false
,
options
:
pcaTextArr
,
selectedOptions
:
[],
total
:
0
,
...
...
@@ -417,6 +430,47 @@
this
.
multipleSelection
=
val
;
},
/**
* 导入上传前校验,开启 loading
* @param file 上传的文件
* @return {boolean}
*/
handleBeforeUpload
(
file
)
{
var
isExcel
=
/
\.(
xlsx|xls
)
$/i
.
test
(
file
.
name
);
if
(
!
isExcel
)
{
this
.
$message
.
error
(
'仅支持上传 .xlsx 或 .xls 格式的文件'
);
return
false
;
}
this
.
uploadLoading
=
true
;
return
true
;
},
/**
* 导入上传成功回调
* @param res 接口返回数据
*/
handleUploadSuccess
(
res
)
{
this
.
uploadLoading
=
false
;
if
(
res
.
code
===
0
)
{
var
{
success_total
=
0
,
fail_total
=
0
,
fail_list
}
=
res
.
data
||
{};
var
failMsg
=
''
if
(
fail_list
.
length
){
failMsg
+=
`失败原因:\n`
;
failMsg
=
fail_list
.
map
(
item
=>
item
.
remark
).
join
(
';\n'
);
}
this
.
$message
.
success
(
`导入完成,成功
${
success_total
}
条,失败
${
fail_total
}
条`
);
failMsg
&&
this
.
$alert
(
failMsg
);
this
.
getData
();
}
else
{
this
.
$message
.
error
(
res
.
msg
||
'导入失败'
);
}
},
/**
* 导入上传失败回调
*/
handleUploadError
()
{
this
.
uploadLoading
=
false
;
this
.
$message
.
error
(
'导入失败,请重试'
);
},
/**
* 型号监听
* @param queryString
* @param cb
...
...
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