Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
3c488e25
Commit
3c488e25
authored
Sep 14, 2022
by
季圣华
Browse files
优化供应商、客户、会员导入的界面展示方式
parent
ba502da3
Changes
12
Hide whitespace changes
Inline
Side-by-side
jshERP-web/public/doc/customer_template.xls
View file @
3c488e25
No preview for this file type
jshERP-web/public/doc/member_template.xls
View file @
3c488e25
No preview for this file type
jshERP-web/public/doc/vendor_template.xls
View file @
3c488e25
No preview for this file type
jshERP-web/src/
views/material/modules/Material
ImportModal.vue
→
jshERP-web/src/
components/tools/
Import
File
Modal.vue
View file @
3c488e25
...
...
@@ -14,15 +14,15 @@
<a-row
class=
"form-row"
:gutter=
"24"
>
<a-col
:md=
"24"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"第一步:"
>
<a
target=
"_blank"
href=
"
/doc/goods_
template
.xls
"
><b>
商品Excel模板[下载]
</b></a>
<p>
注意
:模板中的第一行请勿删除
</p>
<a
target=
"_blank"
:
href=
"template
Url
"
><b>
{{templateName}}
</b></a>
<p>
提示
:模板中的第一行请勿删除
</p>
</a-form-item>
</a-col>
</a-row>
<a-row
class=
"form-row"
:gutter=
"24"
>
<a-col
:md=
"24"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"第二步:"
>
<a-upload
name=
"file"
:showUploadList=
"false"
:multiple=
"false"
:headers=
"tokenHeader"
:action=
"importExcelUrl"
@
change=
"handle
Material
ImportExcel"
>
<a-upload
name=
"file"
:showUploadList=
"false"
:multiple=
"false"
:headers=
"tokenHeader"
:action=
"importExcelUrl"
@
change=
"handleImportExcel"
>
<a-button
type=
"primary"
icon=
"import"
>
导入
</a-button>
</a-upload>
</a-form-item>
...
...
@@ -33,10 +33,10 @@
</template>
<
script
>
import
{
ACCESS_TOKEN
}
from
"
@/store/mutation-types
"
import
Vue
from
'
vue
'
import
{
JeecgListMixin
}
from
'
@/mixins/JeecgListMixin
'
export
default
{
name
:
'
MaterialImportModal
'
,
name
:
'
ImportFileModal
'
,
mixins
:[
JeecgListMixin
],
data
()
{
return
{
title
:
""
,
...
...
@@ -52,9 +52,10 @@
},
confirmLoading
:
false
,
disableMixinCreated
:
true
,
tokenHeader
:
{
'
X-Access-Token
'
:
Vue
.
ls
.
get
(
ACCESS_TOKEN
)},
templateUrl
:
''
,
templateName
:
''
,
url
:
{
importExcelUrl
:
"
/material/importExcel
"
,
importExcelUrl
:
''
,
}
}
},
...
...
@@ -66,36 +67,12 @@
}
},
methods
:
{
init
()
{
this
.
model
=
Object
.
assign
({},
''
)
initModal
(
apiUrl
,
templateUrl
,
templateName
)
{
this
.
url
.
importExcelUrl
=
apiUrl
this
.
templateUrl
=
templateUrl
this
.
templateName
=
templateName
this
.
visible
=
true
},
/* 导入 */
handleMaterialImportExcel
(
info
){
this
.
loading
=
true
if
(
info
.
file
.
status
!==
'
uploading
'
)
{
console
.
log
(
info
.
file
,
info
.
fileList
);
}
if
(
info
.
file
.
status
===
'
done
'
)
{
if
(
info
.
file
.
response
)
{
// this.$message.success(`${info.file.name} 文件上传成功`);
if
(
info
.
file
.
response
.
code
===
200
)
{
this
.
$message
.
success
(
info
.
file
.
response
.
data
||
`
${
info
.
file
.
name
}
文件上传成功`
)
}
else
{
this
.
$message
.
warning
(
info
.
file
.
response
.
data
)
}
this
.
$emit
(
'
ok
'
)
this
.
visible
=
false
;
this
.
loading
=
false
}
else
{
this
.
$message
.
error
(
`
${
info
.
file
.
name
}
${
info
.
file
.
response
.
data
}
.`
);
this
.
loading
=
false
}
}
else
if
(
info
.
file
.
status
===
'
error
'
)
{
this
.
$message
.
error
(
`文件上传失败:
${
info
.
file
.
msg
}
`
)
this
.
loading
=
false
}
},
close
()
{
this
.
$emit
(
'
close
'
);
this
.
visible
=
false
;
...
...
jshERP-web/src/mixins/JeecgListMixin.js
View file @
3c488e25
...
...
@@ -323,8 +323,9 @@ export const JeecgListMixin = {
}
else
{
this
.
$message
.
warning
(
info
.
file
.
response
.
data
)
}
this
.
loadData
()
this
.
loading
=
false
this
.
visible
=
false
this
.
$emit
(
'
ok
'
)
}
else
{
this
.
$message
.
error
(
`
${
info
.
file
.
name
}
${
info
.
file
.
response
.
data
}
.`
);
this
.
loading
=
false
...
...
jshERP-web/src/views/material/MaterialList.vue
View file @
3c488e25
...
...
@@ -154,7 +154,7 @@
<!-- table区域-end -->
<!-- 表单区域 -->
<material-modal
ref=
"modalForm"
@
ok=
"modalFormOk"
></material-modal>
<
material-
import-modal
ref=
"modalImportForm"
@
ok=
"modalFormOk"
></
material-
import-modal>
<import-
file-
modal
ref=
"modalImportForm"
@
ok=
"modalFormOk"
></import-
file-
modal>
<batch-set-info-modal
ref=
"batchSetInfoModalForm"
@
ok=
"modalFormOk"
></batch-set-info-modal>
</a-card>
</a-col>
...
...
@@ -162,7 +162,7 @@
</template>
<
script
>
import
MaterialModal
from
'
./modules/MaterialModal
'
import
Material
ImportModal
from
'
./modules/Material
ImportModal
'
import
Import
File
Modal
from
'
@/components/tools/
Import
File
Modal
'
import
BatchSetInfoModal
from
'
./modules/BatchSetInfoModal
'
import
{
queryMaterialCategoryTreeList
}
from
'
@/api/api
'
import
{
postAction
}
from
'
@/api/manage
'
...
...
@@ -177,7 +177,7 @@
mixins
:[
JeecgListMixin
],
components
:
{
MaterialModal
,
Material
ImportModal
,
Import
File
Modal
,
BatchSetInfoModal
,
JEllipsis
,
JDate
...
...
@@ -371,7 +371,10 @@
}
},
handleImportXls
()
{
this
.
$refs
.
modalImportForm
.
init
();
let
importExcelUrl
=
this
.
url
.
importExcelUrl
let
templateUrl
=
'
/doc/goods_template.xls
'
let
templateName
=
'
商品Excel模板[下载]
'
this
.
$refs
.
modalImportForm
.
initModal
(
importExcelUrl
,
templateUrl
,
templateName
);
this
.
$refs
.
modalImportForm
.
title
=
"
商品导入
"
;
},
searchReset
()
{
...
...
jshERP-web/src/views/system/CustomerList.vue
View file @
3c488e25
...
...
@@ -35,14 +35,7 @@
<!-- 操作按钮区域 -->
<div
class=
"table-operator"
style=
"margin-top: 5px"
>
<a-button
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"handleAdd"
type=
"primary"
icon=
"plus"
>
新增
</a-button>
<a-upload
v-if=
"btnEnableList.indexOf(1)>-1"
name=
"file"
:showUploadList=
"false"
:multiple=
"false"
:headers=
"tokenHeader"
:action=
"importExcelUrl"
@
change=
"handleImportExcel"
>
<a-popover
title=
"导入注意点"
>
<template
slot=
"content"
>
<p><a
target=
"_blank"
href=
"/doc/customer_template.xls"
><b>
客户Excel模板下载
</b></a></p>
</
template
>
<a-button
type=
"primary"
icon=
"import"
>
导入
</a-button>
</a-popover>
</a-upload>
<a-button
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"handleImportXls()"
type=
"primary"
icon=
"import"
>
导入
</a-button>
<a-button
type=
"primary"
icon=
"download"
@
click=
"handleExportXls('客户信息')"
>
导出
</a-button>
<a-dropdown>
<a-menu
slot=
"overlay"
>
...
...
@@ -86,6 +79,7 @@
<!-- table区域-end -->
<!-- 表单区域 -->
<customer-modal
ref=
"modalForm"
@
ok=
"modalFormOk"
></customer-modal>
<import-file-modal
ref=
"modalImportForm"
@
ok=
"modalFormOk"
></import-file-modal>
</a-card>
</a-col>
</a-row>
...
...
@@ -93,14 +87,15 @@
<!-- BY cao_yu_li -->
<
script
>
import
CustomerModal
from
'
./modules/CustomerModal
'
import
ImportFileModal
from
'
@/components/tools/ImportFileModal
'
import
{
JeecgListMixin
}
from
'
@/mixins/JeecgListMixin
'
import
{
openDownloadDialog
,
sheet2blob
}
from
"
@/utils/util
"
import
JDate
from
'
@/components/jeecg/JDate
'
export
default
{
name
:
"
CustomerList
"
,
mixins
:[
JeecgListMixin
],
components
:
{
CustomerModal
,
ImportFileModal
,
JDate
},
data
()
{
...
...
@@ -176,6 +171,13 @@
}
this
.
loadData
(
1
);
},
handleImportXls
()
{
let
importExcelUrl
=
this
.
url
.
importExcelUrl
let
templateUrl
=
'
/doc/customer_template.xls
'
let
templateName
=
'
客户Excel模板[下载]
'
this
.
$refs
.
modalImportForm
.
initModal
(
importExcelUrl
,
templateUrl
,
templateName
);
this
.
$refs
.
modalImportForm
.
title
=
"
客户导入
"
;
},
handleEdit
:
function
(
record
)
{
this
.
$refs
.
modalForm
.
edit
(
record
);
this
.
$refs
.
modalForm
.
title
=
"
编辑
"
;
...
...
jshERP-web/src/views/system/MemberList.vue
View file @
3c488e25
...
...
@@ -34,14 +34,7 @@
<!-- 操作按钮区域 -->
<div
class=
"table-operator"
style=
"margin-top: 5px"
>
<a-button
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"handleAdd"
type=
"primary"
icon=
"plus"
>
新增
</a-button>
<a-upload
v-if=
"btnEnableList.indexOf(1)>-1"
name=
"file"
:showUploadList=
"false"
:multiple=
"false"
:headers=
"tokenHeader"
:action=
"importExcelUrl"
@
change=
"handleImportExcel"
>
<a-popover
title=
"导入注意点"
>
<template
slot=
"content"
>
<p><a
target=
"_blank"
href=
"/doc/member_template.xls"
><b>
会员Excel模板下载
</b></a></p>
</
template
>
<a-button
type=
"primary"
icon=
"import"
>
导入
</a-button>
</a-popover>
</a-upload>
<a-button
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"handleImportXls()"
type=
"primary"
icon=
"import"
>
导入
</a-button>
<a-button
type=
"primary"
icon=
"download"
@
click=
"handleExportXls('会员信息')"
>
导出
</a-button>
<a-dropdown>
<a-menu
slot=
"overlay"
>
...
...
@@ -85,6 +78,7 @@
<!-- table区域-end -->
<!-- 表单区域 -->
<member-modal
ref=
"modalForm"
@
ok=
"modalFormOk"
></member-modal>
<import-file-modal
ref=
"modalImportForm"
@
ok=
"modalFormOk"
></import-file-modal>
</a-card>
</a-col>
</a-row>
...
...
@@ -92,14 +86,15 @@
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<
script
>
import
MemberModal
from
'
./modules/MemberModal
'
import
ImportFileModal
from
'
@/components/tools/ImportFileModal
'
import
{
JeecgListMixin
}
from
'
@/mixins/JeecgListMixin
'
import
{
openDownloadDialog
,
sheet2blob
}
from
"
@/utils/util
"
import
JDate
from
'
@/components/jeecg/JDate
'
export
default
{
name
:
"
MemberList
"
,
mixins
:[
JeecgListMixin
],
components
:
{
MemberModal
,
ImportFileModal
,
JDate
},
data
()
{
...
...
@@ -173,6 +168,13 @@
}
this
.
loadData
(
1
);
},
handleImportXls
()
{
let
importExcelUrl
=
this
.
url
.
importExcelUrl
let
templateUrl
=
'
/doc/member_template.xls
'
let
templateName
=
'
会员Excel模板[下载]
'
this
.
$refs
.
modalImportForm
.
initModal
(
importExcelUrl
,
templateUrl
,
templateName
);
this
.
$refs
.
modalImportForm
.
title
=
"
会员导入
"
;
},
handleEdit
:
function
(
record
)
{
this
.
$refs
.
modalForm
.
edit
(
record
);
this
.
$refs
.
modalForm
.
title
=
"
编辑
"
;
...
...
jshERP-web/src/views/system/VendorList.vue
View file @
3c488e25
...
...
@@ -33,15 +33,8 @@
</div>
<!-- 操作按钮区域 -->
<div
class=
"table-operator"
style=
"margin-top: 5px"
>
<a-button
v-if=
"btnEnableList.indexOf(1)>-1"
type=
"primary"
icon=
"plus"
@
click=
"handleAdd"
>
新增
</a-button>
<a-upload
v-if=
"btnEnableList.indexOf(1)>-1"
name=
"file"
:showUploadList=
"false"
:multiple=
"false"
:headers=
"tokenHeader"
:action=
"importExcelUrl"
@
change=
"handleImportExcel"
>
<a-popover
title=
"导入注意点"
>
<template
slot=
"content"
>
<p><a
target=
"_blank"
href=
"/doc/vendor_template.xls"
><b>
供应商Excel模板下载
</b></a></p>
</
template
>
<a-button
type=
"primary"
icon=
"import"
>
导入
</a-button>
</a-popover>
</a-upload>
<a-button
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"handleAdd"
type=
"primary"
icon=
"plus"
>
新增
</a-button>
<a-button
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"handleImportXls()"
type=
"primary"
icon=
"import"
>
导入
</a-button>
<a-button
type=
"primary"
icon=
"download"
@
click=
"handleExportXls('供应商信息')"
>
导出
</a-button>
<a-dropdown>
<a-menu
slot=
"overlay"
>
...
...
@@ -85,6 +78,7 @@
<!-- table区域-end -->
<!-- 表单区域 -->
<vendor-modal
ref=
"modalForm"
@
ok=
"modalFormOk"
></vendor-modal>
<import-file-modal
ref=
"modalImportForm"
@
ok=
"modalFormOk"
></import-file-modal>
</a-card>
</a-col>
</a-row>
...
...
@@ -92,14 +86,15 @@
<!-- b y 7 5 2 7 1 8 9 2 0 -->
<
script
>
import
VendorModal
from
'
./modules/VendorModal
'
import
ImportFileModal
from
'
@/components/tools/ImportFileModal
'
import
{
JeecgListMixin
}
from
'
@/mixins/JeecgListMixin
'
import
{
openDownloadDialog
,
sheet2blob
}
from
"
@/utils/util
"
import
JDate
from
'
@/components/jeecg/JDate
'
export
default
{
name
:
"
VendorList
"
,
mixins
:[
JeecgListMixin
],
components
:
{
VendorModal
,
ImportFileModal
,
JDate
},
data
()
{
...
...
@@ -175,6 +170,13 @@
}
this
.
loadData
(
1
);
},
handleImportXls
()
{
let
importExcelUrl
=
this
.
url
.
importExcelUrl
let
templateUrl
=
'
/doc/vendor_template.xls
'
let
templateName
=
'
供应商Excel模板[下载]
'
this
.
$refs
.
modalImportForm
.
initModal
(
importExcelUrl
,
templateUrl
,
templateName
);
this
.
$refs
.
modalImportForm
.
title
=
"
供应商导入
"
;
},
handleEdit
:
function
(
record
)
{
this
.
$refs
.
modalForm
.
edit
(
record
);
this
.
$refs
.
modalForm
.
title
=
"
编辑
"
;
...
...
jshERP-web/src/views/system/modules/CustomerModal.vue
View file @
3c488e25
...
...
@@ -139,8 +139,8 @@
this
.
model
=
Object
.
assign
({},
record
);
this
.
visible
=
true
;
this
.
$nextTick
(()
=>
{
this
.
form
.
setFieldsValue
(
pick
(
this
.
model
,
'
supplier
'
,
'
contacts
'
,
'
telephone
'
,
'
email
'
,
'
telephone
'
,
'
phoneNum
'
,
'
fax
'
,
'
beginNeedGet
'
,
'
beginNeedPay
'
,
'
allNeedGet
'
,
'
allNeedPay
'
,
'
taxNum
'
,
'
taxRate
'
,
this
.
form
.
setFieldsValue
(
pick
(
this
.
model
,
'
supplier
'
,
'
contacts
'
,
'
telephone
'
,
'
email
'
,
'
phoneNum
'
,
'
fax
'
,
'
beginNeedGet
'
,
'
allNeedGet
'
,
'
taxNum
'
,
'
taxRate
'
,
'
bankName
'
,
'
accountNumber
'
,
'
address
'
,
'
sort
'
,
'
description
'
))
autoJumpNextInput
(
'
customerModal
'
)
});
...
...
jshERP-web/src/views/system/modules/MemberModal.vue
View file @
3c488e25
...
...
@@ -99,7 +99,7 @@
this
.
model
=
Object
.
assign
({},
record
);
this
.
visible
=
true
;
this
.
$nextTick
(()
=>
{
this
.
form
.
setFieldsValue
(
pick
(
this
.
model
,
'
supplier
'
,
'
contacts
'
,
'
telephone
'
,
'
email
'
,
'
telephone
'
,
this
.
form
.
setFieldsValue
(
pick
(
this
.
model
,
'
supplier
'
,
'
contacts
'
,
'
telephone
'
,
'
email
'
,
'
phoneNum
'
,
'
sort
'
,
'
description
'
))
autoJumpNextInput
(
'
memberModal
'
)
});
...
...
jshERP-web/src/views/system/modules/VendorModal.vue
View file @
3c488e25
...
...
@@ -139,8 +139,8 @@
this
.
model
=
Object
.
assign
({},
record
);
this
.
visible
=
true
;
this
.
$nextTick
(()
=>
{
this
.
form
.
setFieldsValue
(
pick
(
this
.
model
,
'
supplier
'
,
'
contacts
'
,
'
telephone
'
,
'
email
'
,
'
telephone
'
,
'
phoneNum
'
,
'
fax
'
,
'
beginNeed
Get
'
,
'
beginNeedPay
'
,
'
allNeedGet
'
,
'
allNeedPay
'
,
'
taxNum
'
,
'
taxRate
'
,
this
.
form
.
setFieldsValue
(
pick
(
this
.
model
,
'
supplier
'
,
'
contacts
'
,
'
telephone
'
,
'
email
'
,
'
phoneNum
'
,
'
fax
'
,
'
beginNeed
Pay
'
,
'
allNeedPay
'
,
'
taxNum
'
,
'
taxRate
'
,
'
bankName
'
,
'
accountNumber
'
,
'
address
'
,
'
sort
'
,
'
description
'
))
autoJumpNextInput
(
'
vendorModal
'
)
});
...
...
Write
Preview
Supports
Markdown
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