Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sensorConsult
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
zhanglw
sensorConsult
Commits
8b70f765
Commit
8b70f765
authored
Jun 09, 2023
by
zhanglw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品更新
parent
c760d154
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1075 additions
and
39 deletions
+1075
-39
common.js
src/api/common.js
+30
-0
index.vue
src/views/backstage/customMgt/customTabulate/index.vue
+1
-1
add.vue
src/views/backstage/productMgt/productTabulate/add.vue
+25
-9
edit.vue
src/views/backstage/productMgt/productTabulate/edit.vue
+581
-0
index.vue
src/views/backstage/productMgt/productTabulate/index.vue
+36
-29
view.vue
src/views/backstage/productMgt/productTabulate/view.vue
+402
-0
No files found.
src/api/common.js
View file @
8b70f765
...
@@ -110,6 +110,12 @@ export const HttpReq = {
...
@@ -110,6 +110,12 @@ export const HttpReq = {
method
:
'
get
'
method
:
'
get
'
})
})
},
},
checkEnterpriseName
:
function
(
params
)
{
return
request
({
url
:
'
/api/bsw/product/checkEnterpriseName?
'
+
qs
.
stringify
(
params
,
{
indices
:
false
}),
method
:
'
get
'
})
},
// 添加产品详情
// 添加产品详情
addProduct
:
function
(
data
)
{
addProduct
:
function
(
data
)
{
return
request
({
return
request
({
...
@@ -120,6 +126,30 @@ export const HttpReq = {
...
@@ -120,6 +126,30 @@ export const HttpReq = {
return
res
return
res
})
})
},
},
// 更新产品详情
updateProductDetail
:
function
(
data
)
{
return
request
({
url
:
'
/api/bsw/product/updateProductDetail
'
,
method
:
'
put
'
,
data
:
data
}).
then
((
res
)
=>
{
return
res
})
},
// 查询产品列表
queryProduct
:
function
(
params
)
{
return
request
({
url
:
'
/api/bsw/product/queryProduct?
'
+
qs
.
stringify
(
params
,
{
indices
:
false
}),
method
:
'
get
'
})
},
// 查询产品详情
queryProductDetail
:
function
(
params
)
{
return
request
({
url
:
'
/api/bsw/product/queryProductDetail?
'
+
qs
.
stringify
(
params
,
{
indices
:
false
}),
method
:
'
get
'
})
},
xxx
:
null
xxx
:
null
}
}
}
}
...
...
src/views/backstage/customMgt/customTabulate/index.vue
View file @
8b70f765
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
<el-table-column
type=
"selection"
width=
"55"
/>
<el-table-column
type=
"selection"
width=
"55"
/>
<el-table-column
type=
"index"
width=
"55"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
type=
"index"
width=
"55"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
prop=
"userName"
label=
"用户名"
/>
<el-table-column
prop=
"userName"
label=
"用户名"
/>
<el-table-column
prop=
"registeredAddressProvince"
label=
"区域"
:formatter=
"(row, col
umn, cellValue)=>
{return dict.label.area_province[cellValue
]}" />
<el-table-column
prop=
"registeredAddressProvince"
label=
"区域"
:formatter=
"(row, col
, val)=>
{return dict.label.area_province[val
]}" />
<el-table-column
prop=
"enterpriseName"
label=
"企业名称"
/>
<el-table-column
prop=
"enterpriseName"
label=
"企业名称"
/>
<el-table-column
prop=
"enterpriseContactPerson"
label=
"联系人"
/>
<el-table-column
prop=
"enterpriseContactPerson"
label=
"联系人"
/>
<el-table-column
prop=
"enterpriseContactPersonPhone"
label=
"联系电话"
/>
<el-table-column
prop=
"enterpriseContactPersonPhone"
label=
"联系电话"
/>
...
...
src/views/backstage/productMgt/productTabulate/add.vue
View file @
8b70f765
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
<!-- 表单渲染 -->
<!-- 表单渲染 -->
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:before-close=
"cancelView"
:visible=
"visible"
:title=
"title"
width=
"1080px"
>
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:before-close=
"cancelView"
:visible=
"visible"
:title=
"title"
width=
"1080px"
>
<el-form
ref=
"formViewRef"
:model=
"formData"
:rules=
"rules"
:status-icon=
"true"
label-width=
"240px"
>
<el-form
ref=
"formViewRef"
:model=
"formData"
:rules=
"rules"
:status-icon=
"true"
label-width=
"240px"
>
<el-form-item
label=
"供应商名称:"
class=
"form-cell"
prop=
"
customer
Name"
>
<el-form-item
label=
"供应商名称:"
class=
"form-cell"
prop=
"
enterprise
Name"
>
<div
class=
"cell-box"
>
<div
class=
"cell-box"
>
<el-autocomplete
<el-autocomplete
v-model=
"formData.
customer
Name"
v-model=
"formData.
enterprise
Name"
class=
"cell-input"
class=
"cell-input"
:fetch-suggestions=
"querySearch"
:fetch-suggestions=
"querySearch"
placeholder=
"请输入供应商名称"
placeholder=
"请输入供应商名称"
...
@@ -213,7 +213,7 @@
...
@@ -213,7 +213,7 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"交易保障承诺:"
class=
"form-cell"
prop=
"letterOfCommitment"
>
<el-form-item
label=
"交易保障承诺:"
class=
"form-cell"
prop=
"letterOfCommitment"
>
<div
class=
"cell-box"
>
<div
class=
"cell-box"
>
<el-checkbox
v-model=
"formData.letterOfCommitment"
><em>
卖家承诺履约
诈合规
骗包赔,保障产品交易安全
</em></el-checkbox>
<el-checkbox
v-model=
"formData.letterOfCommitment"
><em>
卖家承诺履约
合规诈
骗包赔,保障产品交易安全
</em></el-checkbox>
</div>
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -258,7 +258,7 @@ export default {
...
@@ -258,7 +258,7 @@ export default {
dialogImageVisible
:
false
,
dialogImageVisible
:
false
,
visible
:
false
,
visible
:
false
,
tagTypes
:
[
''
,
'
primary
'
,
'
success
'
,
'
warning
'
,
'
danger
'
,
'
info
'
,
'
info
'
,
'
info
'
],
tagTypes
:
[
''
,
'
primary
'
,
'
success
'
,
'
warning
'
,
'
danger
'
,
'
info
'
,
'
info
'
,
'
info
'
],
title
:
'
产品信息详情
'
,
title
:
'
添加
产品信息详情
'
,
productSubTypeOpts
:
[],
productSubTypeOpts
:
[],
inputVisible
:
false
,
inputVisible
:
false
,
inputValue
:
''
,
inputValue
:
''
,
...
@@ -266,9 +266,9 @@ export default {
...
@@ -266,9 +266,9 @@ export default {
formData
:
{
formData
:
{
productId
:
null
,
productId
:
null
,
customerId
:
null
,
// 供应商id
customerId
:
null
,
// 供应商id
customer
Name
:
''
,
// 供应商名称
enterprise
Name
:
''
,
// 供应商名称
productName
:
''
,
// 产品名称
productName
:
''
,
// 产品名称
productType
:
null
,
// 产品大类
productType
:
'
1
'
,
// 产品大类
productSubType
:
null
,
// 产品小类
productSubType
:
null
,
// 产品小类
minPrice
:
null
,
// 价格区间-小
minPrice
:
null
,
// 价格区间-小
maxPrice
:
null
,
// 价格区间-大
maxPrice
:
null
,
// 价格区间-大
...
@@ -294,12 +294,12 @@ export default {
...
@@ -294,12 +294,12 @@ export default {
rank
:
'
1
'
// 产品品级
rank
:
'
1
'
// 产品品级
},
},
rules
:
{
rules
:
{
// customerName: { required: true, message: '请填写供应商名称', trigger: 'blur' },
// productName: { required: true, message: '请填写产品名称', trigger: 'blur' },
// productName: { required: true, message: '请填写产品名称', trigger: 'blur' },
// productType: { required: true, message: '请选择产品分类', trigger: 'blur' },
// productType: { required: true, message: '请选择产品分类', trigger: 'blur' },
// productPic: { required: true, message: '请上传产品图片', trigger: 'blur' },
// productPic: { required: true, message: '请上传产品图片', trigger: 'blur' },
// productDescribe: { required: true, message: '请填写产品概述', trigger: 'blur' },
// productDescribe: { required: true, message: '请填写产品概述', trigger: 'blur' },
// letterOfCommitment: { required: true, message: '请勾选交易保障承诺', trigger: 'blur' },
// letterOfCommitment: { required: true, message: '请勾选交易保障承诺', trigger: 'blur' },
enterpriseName
:
{
validator
:
this
.
checkEnterpriseName
,
trigger
:
'
blur
'
},
minPrice
:
[
minPrice
:
[
// { required: true, message: '请填写产品价格区间下限', trigger: 'blur' },
// { required: true, message: '请填写产品价格区间下限', trigger: 'blur' },
{
validator
:
checkPrice
,
trigger
:
'
blur
'
}
{
validator
:
checkPrice
,
trigger
:
'
blur
'
}
...
@@ -318,9 +318,22 @@ export default {
...
@@ -318,9 +318,22 @@ export default {
])
])
},
},
mounted
()
{
mounted
()
{
this
.
productSubTypeOpts
=
this
.
dict
[
'
product_type_1
'
]
},
},
methods
:
{
methods
:
{
checkEnterpriseName
(
rule
,
value
,
callback
)
{
this
.
$nextTick
(
_
=>
{
HttpReq
.
backstageApi
.
checkEnterpriseName
({
name
:
value
,
id
:
this
.
formData
.
customerId
}).
then
((
res
)
=>
{
if
(
res
.
data
)
{
callback
()
}
else
{
callback
(
new
Error
(
res
.
msg
))
}
})
})
},
querySearch
(
queryString
,
cb
)
{
querySearch
(
queryString
,
cb
)
{
HttpReq
.
backstageApi
.
associateQueryEnterpriseName
({
HttpReq
.
backstageApi
.
associateQueryEnterpriseName
({
name
:
queryString
name
:
queryString
...
@@ -330,6 +343,9 @@ export default {
...
@@ -330,6 +343,9 @@ export default {
},
},
handleSelect
(
item
)
{
handleSelect
(
item
)
{
this
.
formData
.
customerId
=
item
.
id
this
.
formData
.
customerId
=
item
.
id
this
.
$refs
.
formViewRef
.
validateField
(
'
enterpriseName
'
,
valid
=>
{
return
valid
})
},
},
handleClose
(
tag
)
{
handleClose
(
tag
)
{
this
.
productFeature
.
splice
(
this
.
productFeature
.
indexOf
(
tag
),
1
)
this
.
productFeature
.
splice
(
this
.
productFeature
.
indexOf
(
tag
),
1
)
...
@@ -395,7 +411,7 @@ export default {
...
@@ -395,7 +411,7 @@ export default {
this
.
$refs
.
uploadCom
.
clearFiles
()
this
.
$refs
.
uploadCom
.
clearFiles
()
this
.
$refs
.
formViewRef
.
resetFields
()
this
.
$refs
.
formViewRef
.
resetFields
()
this
.
editor
.
txt
.
clear
()
this
.
editor
.
txt
.
clear
()
this
.
productSubTypeOpts
=
[
]
this
.
productSubTypeOpts
=
this
.
dict
[
'
product_type_1
'
]
this
.
productFeature
=
[]
this
.
productFeature
=
[]
this
.
visible
=
false
this
.
visible
=
false
},
},
...
...
src/views/backstage/productMgt/productTabulate/edit.vue
0 → 100644
View file @
8b70f765
<
template
>
<!-- 表单渲染 -->
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:before-close=
"cancelView"
:visible=
"visible"
:title=
"title"
width=
"1080px"
>
<el-form
ref=
"formViewRef"
:model=
"formData"
:rules=
"rules"
:status-icon=
"true"
label-width=
"240px"
>
<el-form-item
label=
"供应商名称:"
class=
"form-cell"
prop=
"enterpriseName"
>
<div
class=
"cell-box"
>
<el-autocomplete
v-model=
"formData.enterpriseName"
class=
"cell-input"
:fetch-suggestions=
"querySearch"
placeholder=
"请输入供应商名称"
:trigger-on-focus=
"false"
@
select=
"handleSelect"
/>
</div>
</el-form-item>
<el-form-item
label=
"品级标识设置:"
class=
"form-cell"
prop=
"rank"
>
<div
class=
"cell-box"
>
<el-radio-group
v-model=
"formData.rank"
size=
"mini"
>
<el-radio
v-for=
"item in dict.product_rank"
:key=
"item.value"
:label=
"item.value"
>
{{
item
.
label
}}
</el-radio>
</el-radio-group>
</div>
</el-form-item>
<el-form-item
label=
"产品名称:"
class=
"form-cell"
prop=
"productName"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.productName"
placeholder=
"请输入产品名称"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"产品分类:"
class=
"form-cell"
style=
"margin: 0"
>
<div
class=
"cell-box"
style=
"display: flex"
>
<el-form-item
prop=
"productType"
>
<el-select
v-model=
"formData.productType"
placeholder=
"产品大类"
style=
"width: 120px"
@
change=
"changeProductType"
>
<el-option
v-for=
"item in dict.product_type"
:key=
"item.id"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item
prop=
"productSubType"
style=
"margin-left: 5px"
>
<el-select
v-model=
"formData.productSubType"
placeholder=
"产品小类"
style=
"width: 160px"
>
<el-option
v-for=
"item in productSubTypeOpts"
:key=
"item.id"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
</div>
</el-form-item>
<el-form-item
v-if=
"formData.productType&&formData.productType
<5
"
label=
"产品属性:"
class=
"form-cell"
>
<div
class=
"cell-box"
style=
"max-width: 600px"
>
<el-row>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
品牌
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeBrand"
placeholder=
"品牌"
/>
</el-col>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
消耗电流
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeConsumptionCurrent"
placeholder=
"消耗电流"
/>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
产品名
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeProductName"
placeholder=
"产品名"
/>
</el-col>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
额定功率
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeRatedPower"
placeholder=
"额定功率"
/>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
型号
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeModel"
placeholder=
"型号"
/>
</el-col>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
反应时间
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeReactionTime"
placeholder=
"反应时间"
/>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
工作电压
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeWorkingVoltage"
placeholder=
"工作电压"
/>
</el-col>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
封装
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeEncapsulation"
placeholder=
"封装"
/>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
质量保证
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeQualityAssurance"
placeholder=
"质量保证"
/>
</el-col>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
产地
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeProducingArea"
placeholder=
"产地"
/>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
数量
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeNumber"
placeholder=
"数量"
/>
</el-col>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
颜色
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeColor"
placeholder=
"颜色"
/>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
适用场景
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeApplicableScenarios"
placeholder=
"适用场景"
/>
</el-col>
<el-col
:span=
"5"
class=
"grid-content"
>
<div
class=
"grid-label"
>
批号
</div>
</el-col>
<el-col
:span=
"7"
class=
"grid-content"
>
<el-input
v-model=
"formData.attributeBatchNumber"
placeholder=
"批号"
/>
</el-col>
</el-row>
</div>
</el-form-item>
<el-form-item
label=
"产品价格区间(元):"
class=
"form-cell"
style=
"margin: 0"
>
<div
class=
"cell-box"
style=
"display: flex"
>
<el-form-item
prop=
"minPrice"
>
<el-input
v-model.number=
"formData.minPrice"
placeholder=
"价格区间下限"
class=
"cell-input"
style=
"width: 180px"
/>
</el-form-item>
<div
style=
"width: 20px;text-align: center"
>
~
</div>
<el-form-item
prop=
"maxPrice"
>
<el-input
v-model.number=
"formData.maxPrice"
placeholder=
"价格区间上限"
class=
"cell-input"
style=
"width: 180px"
/>
</el-form-item>
</div>
</el-form-item>
<el-form-item
label=
"产品特点:"
class=
"form-cell"
prop=
"productFeature"
>
<div
class=
"cell-box"
>
<el-tag
v-for=
"tag in productFeature"
:key=
"tag"
closable
size=
"small"
:type=
"tagTypes[formData.productType||0]"
:disable-transitions=
"false"
@
close=
"handleClose(tag)"
>
{{
tag
}}
</el-tag>
<el-input
v-show=
"inputVisible"
ref=
"saveTagInput"
v-model=
"inputValue"
class=
"input-new-tag"
placeholder=
"请输入特点标签文本"
@
keyup.enter.native=
"handleInputConfirm"
@
blur=
"handleInputConfirm"
/>
<el-button
v-show=
"!inputVisible && productFeature.length
<
5
"
plain
round
:type=
"tagTypes[formData.productType||0]"
class=
"button-new-tag"
icon=
"el-icon-price-tag"
@
click=
"showInput"
>
添加
</el-button>
</div>
</el-form-item>
<el-form-item
label=
"产品照片:"
class=
"form-cell"
prop=
"productPic"
>
<div
class=
"cell-box"
>
<ul
class=
"el-upload-list el-upload-list--picture-card"
style=
"float: left"
>
<li
v-for=
"(item, index) in imgList"
:key=
"index"
tabindex=
"0"
class=
"el-upload-list__item is-success"
>
<img
:src=
"imgSrcStart+'/productPic/'+item"
class=
"el-upload-list__item-thumbnail"
>
<label
class=
"el-upload-list__item-status-label"
><i
class=
"el-icon-upload-success el-icon-check"
/></label>
<span
class=
"el-upload-list__item-actions"
>
<span
class=
"el-upload-list__item-preview"
@
click=
"dialogImgUrl=item;dialogImgVisible=true"
><i
class=
"el-icon-zoom-in"
/></span>
<span
class=
"el-upload-list__item-delete"
@
click=
"handleRemoveImg(item)"
><i
class=
"el-icon-delete"
/></span>
</span>
</li>
</ul>
<el-dialog
append-to-body
:visible.sync=
"dialogImgVisible"
>
<img
width=
"100%"
:src=
"imgSrcStart+'/productPic/'+dialogImgUrl"
>
</el-dialog>
<el-upload
ref=
"uploadCom"
action=
"/api/bsw/product/uploadProductPic"
name=
"productPic"
list-type=
"picture-card"
:headers=
"uploadHeaders"
:limit=
"5"
:on-exceed=
"handleExceed"
:on-success=
"handleImported"
:on-preview=
"handlePictureCardPreview"
:on-remove=
"handleRemove"
>
<i
class=
"el-icon-plus"
/>
</el-upload>
<el-dialog
append-to-body
:visible.sync=
"dialogImageVisible"
>
<img
width=
"100%"
:src=
"dialogImageUrl"
>
</el-dialog>
</div>
<div
style=
"display: block;clear: both"
>
{{
formData
.
productPic
}}
</div>
</el-form-item>
<el-form-item
label=
"产品概述:"
class=
"form-cell"
prop=
"productDescribe"
>
<div
class=
"cell-box"
>
<div
ref=
"editor"
class=
"editor"
/>
</div>
</el-form-item>
<el-form-item
label=
"其他说明:"
class=
"form-cell"
prop=
"notes"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.notes"
type=
"textarea"
placeholder=
"请输入文本内容"
maxlength=
"1000"
:autosize=
"
{ minRows: 4, maxRows: 6}" show-word-limit resize="none" class="cell-input" />
</div>
</el-form-item>
<el-form-item
label=
"交易保障承诺:"
class=
"form-cell"
prop=
"letterOfCommitment"
>
<div
class=
"cell-box"
>
<el-checkbox
v-model=
"formData.letterOfCommitment"
><em>
卖家承诺履约合规诈骗包赔,保障产品交易安全
</em></el-checkbox>
</div>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"text"
@
click=
"cancelView"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm()"
>
保存
</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
getToken
}
from
'
@/utils/auth
'
import
{
HttpReq
}
from
'
@/api/common
'
import
{
mapGetters
}
from
'
vuex
'
import
{
upload
}
from
'
@/utils/upload
'
import
E
from
'
wangeditor
'
export
default
{
dicts
:
[
'
product_rank
'
,
'
product_type
'
,
'
product_type_1
'
,
'
product_type_2
'
,
'
product_type_3
'
,
'
product_type_4
'
,
'
product_type_5
'
,
'
product_type_6
'
,
'
product_type_7
'
],
data
()
{
const
checkPrice
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
()
}
if
(
!
Number
.
isInteger
(
value
))
{
return
callback
(
new
Error
(
'
请输入数字值
'
))
}
setTimeout
(()
=>
{
if
(
this
.
formData
.
minPrice
&&
value
<
this
.
formData
.
minPrice
)
{
return
callback
(
new
Error
(
'
区间值错误
'
))
}
if
(
this
.
formData
.
maxPrice
&&
value
>
this
.
formData
.
maxPrice
)
{
return
callback
(
new
Error
(
'
区间值错误
'
))
}
return
callback
()
},
500
)
}
return
{
uploadHeaders
:
{
'
Authorization
'
:
getToken
()
},
imgSrcStart
:
process
.
env
.
VUE_APP_BASE_API
,
editor
:
false
,
// 富文本对象
dialogImageUrl
:
''
,
dialogImageVisible
:
false
,
imgList
:
[],
dialogImgUrl
:
''
,
dialogImgVisible
:
false
,
visible
:
false
,
tagTypes
:
[
''
,
'
primary
'
,
'
success
'
,
'
warning
'
,
'
danger
'
,
'
info
'
,
'
info
'
,
'
info
'
],
title
:
'
编辑产品信息详情
'
,
productSubTypeOpts
:
[],
inputVisible
:
false
,
inputValue
:
''
,
productFeature
:
[],
// 产品特点tag列表
formData
:
{
productId
:
null
,
customerId
:
null
,
// 供应商id
enterpriseName
:
''
,
// 供应商名称
productName
:
''
,
// 产品名称
productType
:
'
1
'
,
// 产品大类
productSubType
:
null
,
// 产品小类
minPrice
:
null
,
// 价格区间-小
maxPrice
:
null
,
// 价格区间-大
productFeature
:
null
,
// 产品特点
productPic
:
''
,
// 产品图片
productDescribe
:
''
,
// 产品描述(富文本)
notes
:
null
,
// 其他说明
letterOfCommitment
:
false
,
// 交易保障承诺
attributeBrand
:
''
,
// 属性-品牌
attributeConsumptionCurrent
:
''
,
// 属性-消耗电流
attributeProductName
:
''
,
// 属性-产品名称
attributeRatedPower
:
''
,
// 属性-额定功率
attributeModel
:
''
,
// 属性-型号
attributeReactionTime
:
''
,
// 属性-反应时间
attributeWorkingVoltage
:
''
,
// 属性-工作电压
attributeEncapsulation
:
''
,
// 属性-封装
attributeQualityAssurance
:
''
,
// 属性-质量保证
attributeProducingArea
:
''
,
// 属性-产地
attributeNumber
:
''
,
// 属性-数量
attributeColor
:
''
,
// 属性-颜色
attributeApplicableScenarios
:
''
,
// 属性-品牌
attributeBatchNumber
:
''
,
// 属性-批号
rank
:
'
1
'
// 产品品级
},
rules
:
{
// productName: { required: true, message: '请填写产品名称', trigger: 'blur' },
// productType: { required: true, message: '请选择产品分类', trigger: 'blur' },
// productPic: { required: true, message: '请上传产品图片', trigger: 'blur' },
// productDescribe: { required: true, message: '请填写产品概述', trigger: 'blur' },
// letterOfCommitment: { required: true, message: '请勾选交易保障承诺', trigger: 'blur' },
enterpriseName
:
{
validator
:
this
.
checkEnterpriseName
,
trigger
:
'
blur
'
},
minPrice
:
[
// { required: true, message: '请填写产品价格区间下限', trigger: 'blur' },
{
validator
:
checkPrice
,
trigger
:
'
blur
'
}
],
maxPrice
:
[
// { required: true, message: '请填写产品价格区间上限', trigger: 'blur' },
{
validator
:
checkPrice
,
trigger
:
'
blur
'
}
]
}
}
},
computed
:
{
...
mapGetters
([
'
imagesUploadApi
'
,
'
baseApi
'
])
},
mounted
()
{
this
.
productSubTypeOpts
=
this
.
dict
[
'
product_type_1
'
]
},
methods
:
{
checkEnterpriseName
(
rule
,
value
,
callback
)
{
this
.
$nextTick
(
_
=>
{
HttpReq
.
backstageApi
.
checkEnterpriseName
({
name
:
value
,
id
:
this
.
formData
.
customerId
}).
then
((
res
)
=>
{
if
(
res
.
data
)
{
callback
()
}
else
{
callback
(
new
Error
(
res
.
msg
))
}
})
})
},
querySearch
(
queryString
,
cb
)
{
HttpReq
.
backstageApi
.
associateQueryEnterpriseName
({
name
:
queryString
}).
then
((
res
)
=>
{
cb
(
res
.
data
)
})
},
handleSelect
(
item
)
{
this
.
formData
.
customerId
=
item
.
id
this
.
$refs
.
formViewRef
.
validateField
(
'
enterpriseName
'
,
valid
=>
{
return
valid
})
},
handleClose
(
tag
)
{
this
.
productFeature
.
splice
(
this
.
productFeature
.
indexOf
(
tag
),
1
)
this
.
formData
.
productFeature
=
this
.
productFeature
.
join
(
'
;
'
)
},
showInput
()
{
this
.
inputVisible
=
true
this
.
$nextTick
(
_
=>
{
this
.
$refs
.
saveTagInput
.
$refs
.
input
.
focus
()
})
},
handleInputConfirm
()
{
const
inputValue
=
this
.
inputValue
if
(
inputValue
&&
!
this
.
productFeature
.
filter
(
item
=>
{
return
item
===
inputValue
}).
length
)
{
this
.
productFeature
.
push
(
inputValue
)
this
.
formData
.
productFeature
=
this
.
productFeature
.
join
(
'
;
'
)
}
this
.
inputValue
=
''
this
.
inputVisible
=
false
},
handleExceed
()
{
this
.
$message
({
message
:
'
超出最大上传数量限制
'
,
type
:
'
info
'
})
},
handleRemoveImg
(
item
)
{
this
.
imgList
.
splice
(
this
.
imgList
.
indexOf
(
item
),
1
)
const
arr
=
this
.
formData
.
productPic
.
split
(
'
;
'
)
arr
.
splice
(
arr
.
indexOf
(
item
),
1
)
this
.
formData
.
productPic
=
arr
.
join
(
'
;
'
)
},
handleRemove
(
file
,
fileList
)
{
HttpReq
.
backstageApi
.
deleteProductPic
({
productPic
:
file
.
response
.
productPic
}).
then
((
res
)
=>
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
success
'
,
duration
:
2500
})
const
arr
=
[]
fileList
.
forEach
(
item
=>
{
arr
.
push
(
item
.
response
.
productPic
)
})
this
.
formData
.
productPic
=
arr
.
join
(
'
;
'
)
})
},
handlePictureCardPreview
(
file
)
{
this
.
dialogImageUrl
=
file
.
url
this
.
dialogImageVisible
=
true
},
handleImported
(
response
,
file
,
fileList
)
{
this
.
$nextTick
(()
=>
{
const
arr
=
this
.
formData
.
productPic
?
this
.
formData
.
productPic
.
split
(
'
;
'
)
:
[]
arr
.
push
(
response
.
productPic
)
this
.
formData
.
productPic
=
arr
.
join
(
'
;
'
)
this
.
$notify
({
title
:
'
上传成功!
'
,
type
:
'
success
'
,
duration
:
2500
})
})
},
showView
()
{
this
.
visible
=
true
},
hideView
()
{
this
.
$refs
.
uploadCom
.
clearFiles
()
this
.
$refs
.
formViewRef
.
resetFields
()
this
.
editor
.
txt
.
clear
()
this
.
productSubTypeOpts
=
this
.
dict
[
'
product_type_1
'
]
this
.
productFeature
=
[]
this
.
visible
=
false
},
cancelView
()
{
this
.
hideView
()
},
submitForm
()
{
this
.
$refs
.
formViewRef
.
validate
(
valid
=>
{
if
(
valid
)
{
HttpReq
.
backstageApi
.
updateProductDetail
(
this
.
formData
).
then
((
res
)
=>
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
success
'
,
duration
:
2500
})
if
(
res
.
code
===
200
)
{
this
.
cancelView
()
this
.
$parent
.
loadData
()
}
})
}
else
{
this
.
$message
({
message
:
'
表单信息有误,请核对无误后提交!
'
,
type
:
'
error
'
})
}
})
},
changeProductType
()
{
this
.
formData
.
productSubType
=
null
this
.
productSubTypeOpts
=
this
.
dict
[
'
product_type_
'
+
this
.
formData
.
productType
]
},
loadData
(
productId
)
{
this
.
showView
()
if
(
this
.
editor
)
{
return
}
this
.
$nextTick
(()
=>
{
const
_this
=
this
const
editor
=
new
E
(
this
.
$refs
.
editor
)
editor
.
config
.
zIndex
=
5
editor
.
config
.
customUploadImg
=
function
(
files
,
insert
)
{
files
.
forEach
(
image
=>
{
upload
(
_this
.
imagesUploadApi
,
image
).
then
(
res
=>
{
const
data
=
res
.
data
const
url
=
_this
.
baseApi
+
'
/file/
'
+
data
.
type
+
'
/
'
+
data
.
realName
insert
(
url
)
})
})
}
editor
.
config
.
onchange
=
(
html
)
=>
{
this
.
formData
.
productDescribe
=
html
}
editor
.
create
()
this
.
editor
=
editor
// 初始化数据
HttpReq
.
backstageApi
.
queryProductDetail
({
productId
}).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
formData
=
res
.
data
if
(
this
.
formData
.
productPic
)
{
this
.
imgList
=
this
.
formData
.
productPic
.
split
(
'
;
'
)
}
if
(
this
.
formData
.
productType
)
{
this
.
productSubTypeOpts
=
this
.
dict
[
'
product_type_
'
+
this
.
formData
.
productType
]
}
if
(
this
.
formData
.
productFeature
)
{
this
.
productFeature
=
this
.
formData
.
productFeature
.
split
(
'
;
'
)
}
editor
.
txt
.
html
(
this
.
formData
.
productDescribe
)
}
else
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'
error
'
})
}
})
})
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
.grid-content
{
border
:
1px
solid
rgba
(
100
,
100
,
100
,
0
.3
);
padding
:
0
;
}
.grid-label
{
background
:
#dedede
;
padding
:
0
10px
;
}
.editor
{
text-align
:left
;
width
:
680px
;
}
::v-deep
.w-e-text-container
{
height
:
560px
!
important
;
}
.cell-box
{
min-width
:
120px
;
.cell-input
{
width
:
420px
;
}
.cell-select
{
width
:
220px
;
}
.el-tag
+
.el-tag
{
margin-left
:
10px
;
}
.button-new-tag
{
margin-left
:
10px
;
height
:
28px
;
line-height
:
24px
;
padding
:
0
8px
;
}
.input-new-tag
{
width
:
140px
;
height
:
28px
;
margin-left
:
10px
;
vertical-align
:
bottom
;
}
>>>
.el-input__inner
{
border
:
1px
solid
rgba
(
100
,
100
,
100
,
0
.1
);
border-bottom
:
1px
solid
rgba
(
100
,
100
,
100
,
0
.2
);
border-radius
:
5px
;
}
>>>
.el-input.is-disabled
.el-input__inner
{
border-radius
:
0
;
border
:
0
;
border-bottom
:
1px
solid
rgba
(
100
,
100
,
100
,
0
.4
);
background
:
white
;
cursor
:
text
;
}
>>>
.el-input.is-disabled
.el-input__icon
{
cursor
:
text
;
}
>>>
.el-icon-circle-check
{
color
:
#13ce66
;
}
//>>>.el-icon-arrow-up:before {
// content: '';
//}
}
</
style
>
src/views/backstage/productMgt/productTabulate/index.vue
View file @
8b70f765
...
@@ -2,15 +2,15 @@
...
@@ -2,15 +2,15 @@
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<!--工具栏-->
<!--工具栏-->
<div
class=
"head-container"
>
<div
class=
"head-container"
>
<el-input
v-model=
"query.
username
"
clearable
placeholder=
"请输入产品ID"
style=
"width:150px;"
/>
<el-input
v-model=
"query.
productId
"
clearable
placeholder=
"请输入产品ID"
style=
"width:150px;"
/>
<el-input
v-model=
"query.
usern
ame"
clearable
placeholder=
"请输入产品名称"
style=
"width:280px;"
/>
<el-input
v-model=
"query.
productN
ame"
clearable
placeholder=
"请输入产品名称"
style=
"width:280px;"
/>
<el-select
v-model=
"query.
area
"
clearable
placeholder=
"请选择分类"
style=
"width: 150px"
>
<el-select
v-model=
"query.
productType
"
clearable
placeholder=
"请选择分类"
style=
"width: 150px"
>
<el-option
v-for=
"item in dict.product_type"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
<el-option
v-for=
"item in dict.product_type"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-select>
<el-select
v-model=
"query.status"
clearable
placeholder=
"请选择状态"
style=
"width: 150px"
>
<el-select
v-model=
"query.status"
clearable
placeholder=
"请选择状态"
style=
"width: 150px"
>
<el-option
v-for=
"item in dict.product_status"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
<el-option
v-for=
"item in dict.product_status"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-select>
<date-range-picker
v-model=
"query.
cre
ateTime"
start-placeholder=
"最后维护开始日期"
style=
"width: 320px"
/>
<date-range-picker
v-model=
"query.
upd
ateTime"
start-placeholder=
"最后维护开始日期"
style=
"width: 320px"
/>
<el-button
type=
"success"
icon=
"el-icon-search"
@
click=
"toSearch"
>
搜索
</el-button>
<el-button
type=
"success"
icon=
"el-icon-search"
@
click=
"toSearch"
>
搜索
</el-button>
<el-button
type=
"warning"
icon=
"el-icon-refresh"
@
click=
"clearLimit"
>
重置
</el-button>
<el-button
type=
"warning"
icon=
"el-icon-refresh"
@
click=
"clearLimit"
>
重置
</el-button>
</div>
</div>
...
@@ -28,37 +28,42 @@
...
@@ -28,37 +28,42 @@
<el-table
id=
"dataTable"
ref=
"dataTable"
v-loading=
"loading"
:data=
"tableData"
tooltip-effect=
"dark"
style=
"width:auto;min-height: 70vh"
@
selection-change=
"handleSelectionChange"
>
<el-table
id=
"dataTable"
ref=
"dataTable"
v-loading=
"loading"
:data=
"tableData"
tooltip-effect=
"dark"
style=
"width:auto;min-height: 70vh"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
/>
<el-table-column
type=
"selection"
width=
"55"
/>
<el-table-column
type=
"index"
width=
"55"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
type=
"index"
width=
"55"
label=
"序号"
:index=
"indexMethod"
/>
<el-table-column
prop=
"
username"
label=
"产品ID"
width=
"14
0"
/>
<el-table-column
prop=
"
productId"
label=
"产品ID"
width=
"10
0"
/>
<el-table-column
prop=
"
area"
label=
"产品分类
"
/>
<el-table-column
prop=
"
productType"
label=
"产品分类"
width=
"140"
:formatter=
"(row, col, val)=>
{return dict.label.product_type[val]}
" />
<el-table-column
prop=
"
xxx
"
label=
"产品名称"
/>
<el-table-column
prop=
"
productName
"
label=
"产品名称"
/>
<el-table-column
label=
"状态"
width=
"100"
>
<el-table-column
label=
"状态"
width=
"100"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<div
:style=
"'color:'+textColors[scope.row.status]"
>
{{
dict
.
label
.
product_status
[
scope
.
row
.
status
]
}}
</div>
<div
:style=
"'color:'+textColors[scope.row.status]"
>
{{
dict
.
label
.
product_status
[
scope
.
row
.
status
]
}}
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"
xxx"
label=
"最后维护日期"
align=
"center"
width=
"10
0"
/>
<el-table-column
prop=
"
updateTime"
label=
"最后维护日期"
align=
"center"
width=
"18
0"
/>
<el-table-column
prop=
"xxx"
label=
"操作"
align=
"right"
width=
"200"
>
<el-table-column
label=
"操作"
align=
"right"
width=
"200"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-tooltip
v-show=
"scope.row.status==3"
content=
"审核"
><el-button
round
plain
type=
"warning"
icon=
"el-icon-s-check"
@
click=
"to
Edit(scope.row
)"
/></el-tooltip>
<el-tooltip
v-show=
"scope.row.status==3"
content=
"审核"
><el-button
round
plain
type=
"warning"
icon=
"el-icon-s-check"
@
click=
"to
View(scope.row, true
)"
/></el-tooltip>
<el-tooltip
v-show=
"scope.row.status==4"
content=
"发布"
><el-button
round
plain
type=
"success"
icon=
"el-icon-finished"
@
click=
"toEdit(scope.row)"
/></el-tooltip>
<el-tooltip
v-show=
"scope.row.status==4"
content=
"发布"
><el-button
round
plain
type=
"success"
icon=
"el-icon-finished"
@
click=
"toEdit(scope.row)"
/></el-tooltip>
<el-tooltip
v-show=
"scope.row.status==5"
content=
"下架"
><el-button
round
plain
type=
"danger"
icon=
"el-icon-download"
@
click=
"toEdit(scope.row)"
/></el-tooltip>
<el-tooltip
v-show=
"scope.row.status==5"
content=
"下架"
><el-button
round
plain
type=
"danger"
icon=
"el-icon-download"
@
click=
"toEdit(scope.row)"
/></el-tooltip>
<el-tooltip
v-show=
"scope.row.status>=4"
content=
"编辑"
><el-button
round
plain
type=
"primary"
icon=
"el-icon-edit-outline"
@
click=
"toEdit(scope.row)"
/></el-tooltip>
<el-tooltip
v-show=
"scope.row.status>=4"
content=
"编辑"
><el-button
round
plain
type=
"primary"
icon=
"el-icon-edit-outline"
@
click=
"toEdit(scope.row)"
/></el-tooltip>
<el-tooltip
content=
"查看"
><el-button
round
plain
icon=
"el-icon-view"
@
click=
"to
Edit
(scope.row)"
/></el-tooltip>
<el-tooltip
content=
"查看"
><el-button
round
plain
icon=
"el-icon-view"
@
click=
"to
View
(scope.row)"
/></el-tooltip>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!--分页组件-->
<!--分页组件-->
<el-pagination
:total=
"total"
:current-page=
"page"
:page-size=
"pageSize"
style=
"margin-top: 8px;"
layout=
"total, prev, pager, next, sizes"
@
size-change=
"sizeChange"
@
current-change=
"pageChange"
/>
<el-pagination
:total=
"total"
:current-page=
"page"
:page-size=
"pageSize"
style=
"margin-top: 8px;"
layout=
"total, prev, pager, next, sizes"
@
size-change=
"sizeChange"
@
current-change=
"pageChange"
/>
</div>
</div>
<add-view
ref=
"addView"
/>
<add-page
ref=
"addPage"
/>
<edit-page
ref=
"editPage"
/>
<view-page
ref=
"viewPage"
/>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
HttpReq
}
from
'
@/api/common
'
import
DateRangePicker
from
'
@/components/DateRangePicker
'
import
DateRangePicker
from
'
@/components/DateRangePicker
'
import
AddView
from
'
./add
'
import
addPage
from
'
./add
'
import
editPage
from
'
./edit
'
import
viewPage
from
'
./view
'
export
default
{
export
default
{
components
:
{
DateRangePicker
,
AddView
},
components
:
{
DateRangePicker
,
addPage
,
editPage
,
viewPage
},
dicts
:
[
'
product_type
'
,
'
product_status
'
],
dicts
:
[
'
product_type
'
,
'
product_status
'
],
data
()
{
data
()
{
return
{
return
{
...
@@ -88,19 +93,18 @@ export default {
...
@@ -88,19 +93,18 @@ export default {
this
.
multipleSelection
=
val
this
.
multipleSelection
=
val
},
},
loadData
()
{
loadData
()
{
var
sort
=
'
id,desc
'
// 清除参数无值的情况
var
param
=
{
...
this
.
query
}
Object
.
keys
(
this
.
query
).
length
!==
0
&&
Object
.
keys
(
this
.
query
).
forEach
(
item
=>
{
param
.
page
=
this
.
page
if
(
this
.
query
[
item
]
===
null
||
this
.
query
[
item
]
===
''
)
this
.
query
[
item
]
=
undefined
param
.
pageSize
=
this
.
pageSize
})
param
.
sort
=
sort
HttpReq
.
backstageApi
.
queryProduct
({
this
.
tableData
=
[
page
:
this
.
page
-
1
,
{
username
:
'
张三
'
,
area
:
'
火星
'
,
status
:
2
,
enabled
:
false
,
xxx
:
'
2023-05-09
'
},
pageSize
:
this
.
pageSize
,
{
username
:
'
张三
'
,
area
:
'
火星
'
,
status
:
3
,
enabled
:
false
,
xxx
:
'
2023-05-09
'
},
...
this
.
query
{
username
:
'
张三
'
,
area
:
'
火星
'
,
status
:
4
,
enabled
:
false
,
xxx
:
'
2023-05-09
'
},
}).
then
((
res
)
=>
{
{
username
:
'
李四
'
,
area
:
'
地球
'
,
status
:
5
,
enabled
:
true
,
xxx
:
'
2023-05-09
'
},
this
.
tableData
=
res
.
data
.
data
{
username
:
'
张三
'
,
area
:
'
火星
'
,
status
:
6
,
enabled
:
false
,
xxx
:
'
2023-05-09
'
}
this
.
total
=
res
.
data
.
total
]
})
this
.
total
=
2
},
},
batchOperate
(
opt
)
{
batchOperate
(
opt
)
{
if
(
!
this
.
multipleSelection
.
length
)
{
if
(
!
this
.
multipleSelection
.
length
)
{
...
@@ -127,10 +131,13 @@ export default {
...
@@ -127,10 +131,13 @@ export default {
})
})
},
},
toAdd
()
{
toAdd
()
{
this
.
$refs
.
add
View
.
loadData
()
this
.
$refs
.
add
Page
.
loadData
()
},
},
toEdit
(
item
)
{
toEdit
(
item
)
{
this
.
$refs
.
editPage
.
loadData
(
item
.
productId
)
},
toView
(
item
,
isReview
)
{
this
.
$refs
.
viewPage
.
loadData
(
item
.
productId
,
isReview
)
},
},
toSearch
()
{
toSearch
()
{
this
.
page
=
1
this
.
page
=
1
...
...
src/views/backstage/productMgt/productTabulate/view.vue
0 → 100644
View file @
8b70f765
<
template
>
<!-- 表单渲染 -->
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:before-close=
"cancelView"
:visible=
"visible"
:title=
"title"
width=
"860px"
>
<img
v-if=
"stampImgSrc"
:src=
"stampImgSrc"
class=
"stamp-review"
>
<el-form
ref=
"formViewRef"
:model=
"formData"
:status-icon=
"true"
label-width=
"240px"
>
<el-form-item
label=
"标识设置:"
class=
"form-cell"
prop=
"supplierLevel"
>
<div
class=
"cell-box"
>
<el-select
v-model=
"formData.supplierLevel"
disabled
placeholder=
"无"
class=
"cell-select"
>
<el-option
v-for=
"item in dict.supplier_rank"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</div>
</el-form-item>
<el-form-item
label=
"企业名称:"
class=
"form-cell"
prop=
"enterpriseName"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.enterpriseName"
disabled
placeholder=
"请输入企业名称"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"企业联系人:"
class=
"form-cell"
prop=
"enterpriseContactPerson"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.enterpriseContactPerson"
disabled
placeholder=
"请输入联系人"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"企业联系人手机号:"
class=
"form-cell"
prop=
"enterpriseContactPersonPhone"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.enterpriseContactPersonPhone"
disabled
placeholder=
"请输入手机号"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"企业地址:"
class=
"form-cell"
prop=
"enterpriseAddress"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.enterpriseAddress"
disabled
placeholder=
"请输入地址"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
disabled
label=
"企业邮箱:"
class=
"form-cell"
prop=
"enterpriseEmail"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.enterpriseEmail"
disabled
placeholder=
"请输入邮箱"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"营业执照:"
class=
"form-cell"
prop=
"businessLicense"
>
<div
class=
"cell-box"
>
<ul
class=
"el-upload-list el-upload-list--picture-card"
>
<li
v-for=
"(item, index) in imgList"
:key=
"index"
tabindex=
"0"
class=
"el-upload-list__item is-success"
>
<img
:src=
"imgSrcStart+'/businessLicense/'+item"
class=
"el-upload-list__item-thumbnail"
>
<label
class=
"el-upload-list__item-status-label"
><i
class=
"el-icon-upload-success el-icon-check"
/></label>
<span
class=
"el-upload-list__item-actions"
>
<span
class=
"el-upload-list__item-preview"
@
click=
"dialogImgUrl=item;dialogImgVisible=true"
><i
class=
"el-icon-zoom-in"
/></span>
</span>
</li>
</ul>
<el-dialog
append-to-body
:visible.sync=
"dialogImgVisible"
>
<img
width=
"100%"
:src=
"imgSrcStart+'/businessLicense/'+dialogImgUrl"
>
</el-dialog>
</div>
</el-form-item>
<el-form-item
label=
"统一社会信用代码:"
class=
"form-cell"
prop=
"unifiedSocialCreditCode"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.unifiedSocialCreditCode"
disabled
placeholder=
"请输入18位统一社会信用代码"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"纳税人识别号:"
class=
"form-cell"
prop=
"taxpayerIdentificationNumber"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.taxpayerIdentificationNumber"
disabled
placeholder=
"请输入纳税人识别号"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"所属行业:"
class=
"form-cell"
prop=
"industry"
>
<div
class=
"cell-box"
>
<el-select
v-model=
"formData.industry"
disabled
placeholder=
"无"
class=
"cell-select"
>
<el-option
v-for=
"item in dict.industry_type"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</div>
</el-form-item>
<el-form-item
label=
"登记机关:"
class=
"form-cell"
prop=
"registrationAuthority"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.registrationAuthority"
disabled
placeholder=
"请输入登记机关"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"法定代表人:"
class=
"form-cell"
prop=
"legalRepresentative"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.legalRepresentative"
disabled
placeholder=
"请输入法定代表人"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"经营状态:"
class=
"form-cell"
prop=
"businessStatus"
>
<div
class=
"cell-box"
>
<el-select
v-model=
"formData.businessStatus"
disabled
placeholder=
"无"
class=
"cell-select"
>
<el-option
v-for=
"item in dict.business_status"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</div>
</el-form-item>
<el-form-item
label=
"成立日期:"
class=
"form-cell"
prop=
"establishmentDate"
>
<div
class=
"cell-box"
>
<el-date-picker
v-model=
"formData.establishmentDate"
disabled
type=
"date"
clearable
placeholder=
"请选择日期"
/>
</div>
</el-form-item>
<el-form-item
label=
"经营期限(年):"
class=
"form-cell"
prop=
"operatingPeriod"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.operatingPeriod"
disabled
type=
"number"
placeholder=
"请输入数字"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"审核/年检日期:"
class=
"form-cell"
prop=
"annualInspectionDate"
>
<div
class=
"cell-box"
>
<el-date-picker
v-model=
"formData.annualInspectionDate"
disabled
type=
"date"
clearable
placeholder=
"请选择日期"
/>
</div>
</el-form-item>
<el-form-item
label=
"企业类型:"
class=
"form-cell"
prop=
"enterpriseType"
>
<div
class=
"cell-box"
>
<el-select
v-model=
"formData.enterpriseType"
disabled
placeholder=
"无"
class=
"cell-select"
>
<el-option
v-for=
"item in dict.company_type"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</div>
</el-form-item>
<el-form-item
label=
"注册资本(万元):"
class=
"form-cell"
prop=
"registeredCapital"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.registeredCapital"
disabled
type=
"number"
placeholder=
"请输入数字"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"注册地址:"
class=
"form-cell"
>
<div
class=
"cell-box"
>
<el-select
v-model=
"formData.registeredAddressProvince"
disabled
placeholder=
"省"
style=
"width: 120px"
@
change=
"findAreaByCodeAndType(formData.registeredAddressProvince,2, 'cityOpts')"
>
<el-option
v-for=
"item in provinceOpts"
:key=
"item.id"
:label=
"item.name"
:value=
"item.code"
/>
</el-select>
<el-select
v-model=
"formData.registeredAddressCity"
disabled
placeholder=
"市"
style=
"width: 160px"
@
change=
"findAreaByCodeAndType(formData.registeredAddressCity,3, 'countyOpts')"
>
<el-option
v-for=
"item in cityOpts"
:key=
"item.id"
:label=
"item.name"
:value=
"item.code"
/>
</el-select>
<el-select
v-model=
"formData.registeredAddressArea"
disabled
placeholder=
"区/县"
style=
"width: 160px"
>
<el-option
v-for=
"item in countyOpts"
:key=
"item.id"
:label=
"item.name"
:value=
"item.code"
/>
</el-select>
</div>
<div
class=
"cell-box"
>
<el-input
v-model=
"formData.registeredAddressStreet"
disabled
placeholder=
"详细地址(例如:和平路北大街106号)"
class=
"cell-input"
/>
</div>
</el-form-item>
<el-form-item
label=
"经营范围:"
class=
"form-cell"
prop=
"businessScope"
>
<div
class=
"cell-box"
>
<div
class=
"cell-textarea"
>
{{
formData
.
businessScope
}}
</div>
</div>
</el-form-item>
<el-form-item
label=
"企业介绍:"
class=
"form-cell"
prop=
"enterpriseIntroduction"
>
<div
class=
"cell-box"
>
<div
class=
"cell-textarea"
>
{{
formData
.
enterpriseIntroduction
}}
</div>
</div>
</el-form-item>
<el-form-item
label=
"主营产品介绍:"
class=
"form-cell"
prop=
"mainProductsIntroduction"
>
<div
class=
"cell-box"
>
<div
class=
"cell-textarea"
>
{{
formData
.
mainProductsIntroduction
}}
</div>
</div>
</el-form-item>
<el-form-item
label=
"业务范围:"
class=
"form-cell"
prop=
"businessScopeIntroduction"
>
<div
class=
"cell-box"
>
<div
class=
"cell-textarea"
>
{{
formData
.
businessScopeIntroduction
}}
</div>
</div>
</el-form-item>
<el-form-item
v-if=
"!isReview && formData.status!=='3'"
label=
"审核意见:"
class=
"form-cell"
>
<div
class=
"cell-box"
>
<div
class=
"cell-textarea"
>
{{
formData
.
reviewComments
}}
</div>
</div>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
style=
"text-align: center"
>
<el-button
@
click=
"cancelView"
>
关闭
</el-button>
<el-button
v-if=
"isReview"
type=
"primary"
@
click=
"submitForm(true)"
>
通过
</el-button>
<el-button
v-if=
"isReview"
type=
"primary"
@
click=
"reviewVisible=true"
>
驳回
</el-button>
</div>
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:before-close=
"cancelReview"
:visible=
"reviewVisible"
title=
"审核意见"
width=
"600px"
>
<el-form
ref=
"formReviewRef"
:model=
"formReview"
:rules=
"rules"
:status-icon=
"true"
label-width=
"120px"
>
<el-form-item
label=
"审核意见:"
class=
"form-cell"
prop=
"reviewComments"
>
<div
class=
"cell-box"
>
<el-input
v-model=
"formReview.reviewComments"
type=
"textarea"
placeholder=
"请输入审核意见"
maxlength=
"100"
:autosize=
"
{ minRows: 4, maxRows: 6}" show-word-limit resize="none" style="width: 300px" />
</div>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
style=
"text-align: center"
>
<el-button
type=
"primary"
@
click=
"submitForm(false)"
>
提交
</el-button>
</div>
</el-dialog>
</el-dialog>
</
template
>
<
script
>
import
{
getToken
}
from
'
@/utils/auth
'
import
{
HttpReq
}
from
'
@/api/common
'
import
review_pass
from
'
@/assets/images/review_pass.png
'
import
review_await
from
'
@/assets/images/review_await.png
'
import
review_failed
from
'
@/assets/images/review_failed.png
'
export
default
{
dicts
:
[
'
industry_type
'
,
'
supplier_rank
'
,
'
company_type
'
,
'
business_status
'
],
data
()
{
return
{
uploadHeaders
:
{
'
Authorization
'
:
getToken
()
},
stampImgSrc
:
''
,
imgSrcStart
:
process
.
env
.
VUE_APP_BASE_API
,
dialogImgUrl
:
''
,
dialogImgVisible
:
false
,
visible
:
false
,
title
:
'
客户信息详情
'
,
customerId
:
''
,
isReview
:
false
,
imgList
:
[],
provinceOpts
:
[],
cityOpts
:
[],
countyOpts
:
[],
formData
:
{
annualInspectionDate
:
''
,
// 审核日期
businessLicense
:
''
,
// 营业执照的照片名称
businessScope
:
''
,
// 经营范围
businessScopeIntroduction
:
''
,
// 业务范围介绍
businessStatus
:
''
,
// 经营状态
enterpriseAddress
:
''
,
// 企业地址
enterpriseContactPerson
:
''
,
// 企业联系人
enterpriseContactPersonPhone
:
''
,
// 企业联系人手机号
enterpriseEmail
:
''
,
// 企业邮箱
enterpriseIntroduction
:
''
,
// 企业介绍
enterpriseName
:
''
,
// 企业名称
enterpriseType
:
''
,
// 企业类型
establishmentDate
:
''
,
// 成立日期
industry
:
''
,
// 所属行业
legalRepresentative
:
''
,
// 法定代表人
mainProductsIntroduction
:
''
,
// 主营产品介绍
operatingPeriod
:
''
,
// 经营期限
registeredAddressArea
:
''
,
// 注册地址-区
registeredAddressCity
:
''
,
// 注册地址-市
registeredAddressProvince
:
''
,
// 注册地址-省
registeredAddressStreet
:
''
,
// 注册地址-街道
registeredCapital
:
''
,
// 注册资本
registrationAuthority
:
''
,
// 登记机关
supplierLevel
:
'
1
'
,
// 供应商级别
taxpayerIdentificationNumber
:
''
,
// 纳税人识别号
unifiedSocialCreditCode
:
''
,
// 统一社会信用代码
reviewComments
:
''
,
// 审核意见
sysUserId
:
null
},
reviewVisible
:
false
,
formReview
:
{
reviewComments
:
''
},
rules
:
{
reviewComments
:
{
required
:
true
,
message
:
'
请填写审核意见
'
,
trigger
:
'
blur
'
}
}
}
},
mounted
()
{
this
.
$nextTick
(()
=>
{
})
},
methods
:
{
showView
()
{
this
.
visible
=
true
},
hideView
()
{
this
.
$refs
.
formViewRef
.
resetFields
()
this
.
cityOpts
=
[]
this
.
countyOpts
=
[]
this
.
imgList
=
[]
this
.
visible
=
false
},
cancelView
()
{
this
.
cancelReview
()
this
.
hideView
()
},
cancelReview
()
{
if
(
this
.
$refs
.
formReviewRef
)
{
this
.
$refs
.
formReviewRef
.
resetFields
()
}
this
.
formReview
.
reviewComments
=
''
this
.
reviewVisible
=
false
},
submitForm
(
isPass
)
{
if
(
isPass
)
{
this
.
formReview
.
reviewComments
=
'
审核通过
'
HttpReq
.
backstageApi
.
reviewCustomer
({
customerId
:
this
.
customerId
,
reviewComments
:
this
.
formReview
.
reviewComments
,
type
:
1
}).
then
((
res
)
=>
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
success
'
,
duration
:
2500
})
if
(
res
.
code
===
200
)
{
this
.
cancelView
()
this
.
$parent
.
loadData
()
}
})
return
}
this
.
$refs
.
formReviewRef
.
validate
((
valid
,
obj
)
=>
{
if
(
valid
)
{
HttpReq
.
backstageApi
.
reviewCustomer
({
customerId
:
this
.
customerId
,
reviewComments
:
this
.
formReview
.
reviewComments
,
type
:
0
}).
then
((
res
)
=>
{
this
.
$notify
({
title
:
res
.
msg
,
type
:
'
success
'
,
duration
:
2500
})
if
(
res
.
code
===
200
)
{
this
.
cancelView
()
this
.
$parent
.
loadData
()
}
})
}
else
{
this
.
$message
({
message
:
'
表单信息有误,请核对无误后提交!
'
,
type
:
'
error
'
})
}
})
},
findAreaByCodeAndType
(
code
,
type
,
optsName
,
fn
)
{
HttpReq
.
backstageApi
.
findAreaByCodeAndType
({
code
,
type
}).
then
((
res
)
=>
{
this
[
optsName
]
=
res
})
},
loadData
(
customerId
,
isReview
)
{
this
.
customerId
=
customerId
this
.
isReview
=
isReview
this
.
title
=
`
${
isReview
?
'
审核
'
:
'
查看
'
}
客户信息详情`
this
.
findAreaByCodeAndType
(
0
,
1
,
'
provinceOpts
'
)
HttpReq
.
backstageApi
.
queryCustomerDetail
({
customerId
}).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
formData
=
res
.
data
if
(
this
.
formData
.
businessLicense
)
{
this
.
imgList
=
this
.
formData
.
businessLicense
.
split
(
'
;
'
)
}
switch
(
this
.
formData
.
status
)
{
case
'
1
'
:
this
.
stampImgSrc
=
review_pass
break
case
'
3
'
:
this
.
stampImgSrc
=
review_await
break
case
'
4
'
:
this
.
stampImgSrc
=
review_failed
break
default
:
this
.
stampImgSrc
=
''
}
this
.
findAreaByCodeAndType
(
this
.
formData
.
registeredAddressProvince
,
2
,
'
cityOpts
'
)
this
.
findAreaByCodeAndType
(
this
.
formData
.
registeredAddressCity
,
3
,
'
countyOpts
'
)
this
.
showView
()
}
else
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'
error
'
})
}
})
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
.stamp-review
{
border-style
:
none
;
position
:
absolute
;
right
:
15%
;
top
:
40%
;
z-index
:
99
;
}
.cell-box
{
min-width
:
120px
;
.cell-input
{
width
:
420px
;
}
.cell-select
{
width
:
220px
;
}
.cell-textarea
{
min-height
:
50px
;
color
:
#777
;
font-style
:
oblique
;
font-size
:
14px
;
text-decoration
:
underline
;
//下划线
text-underline-offset
:
5px
;
//下划线和文字间距
}
>>>
.el-input__inner
{
border
:
1px
solid
rgba
(
100
,
100
,
100
,
0
.1
);
border-bottom
:
1px
solid
rgba
(
100
,
100
,
100
,
0
.2
);
border-radius
:
5px
;
}
>>>
.el-input.is-disabled
.el-input__inner
{
border-radius
:
0
;
border
:
0
;
border-bottom
:
1px
solid
rgba
(
100
,
100
,
100
,
0
.4
);
background
:
white
;
color
:
#777
;
font-style
:
oblique
;
font-size
:
14px
;
cursor
:
text
;
}
>>>
.el-input.is-disabled
.el-input__icon
{
cursor
:
text
;
}
>>>
.el-icon-circle-check
{
color
:
#13ce66
;
}
>>>
.el-icon-arrow-up
:before
{
content
:
''
;
}
}
</
style
>
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