Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
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
lanbaoming
jiedao-app-operator-master
Commits
32353a17
Commit
32353a17
authored
Dec 11, 2024
by
zhengyi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre-release'
parents
c329fcba
369ce4bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
42 deletions
+87
-42
edit.vue
src/views/ecw/customer/edit.vue
+87
-42
No files found.
src/views/ecw/customer/edit.vue
View file @
32353a17
...
...
@@ -213,19 +213,27 @@
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('主营类别')"
prop=
"productTypes"
>
<el-form-item
:label=
"$t('主营类别')"
prop=
"products"
>
<div
style=
"overflow: hidden"
>
<div
style=
"margin-bottom: 10px"
v-for=
"(ITEM, INDEX) in form.products"
:key=
"INDEX"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"11
"
>
<el-select
@
change=
"change"
v-model=
"form.productTypes"
filterable
multip
le
:placeholder=
"$t('请选择产品类别')"
>
<el-col
:span=
"9
"
>
<el-select
@
change=
"change(INDEX, $event)"
v-model=
"form.products[INDEX].typeId"
filterab
le
:placeholder=
"$t('请选择产品类别')"
>
<el-option
:label=
"isChinese ? item.titleZh : item.titleEn"
:value=
"item.id"
v-for=
"item in productTypeList"
:key=
"item.id"
/>
</el-select>
</el-col>
<el-col
:span=
"11
"
>
<el-select
@
change=
"productIdsChange"
multiple
filterable
clearable
v-model=
"form
.productIds"
:placeholder=
"$t('请选择')"
>
<el-option
:label=
"`$
{isChinese ? item.typeTitleZh : item.typeTitleEn}: ${item.titleZh}`" :value="parseInt(item.id)" v-for="item in
productList" :key="item.id" />
<el-col
:span=
"9
"
>
<el-select
@
change=
"productIdsChange(INDEX, $event)"
multiple
filterable
clearable
v-model=
"form.products[INDEX]
.productIds"
:placeholder=
"$t('请选择')"
>
<el-option
:label=
"`$
{item.titleZh}`" :value="parseInt(item.id)" v-for="item in form.products[INDEX].
productList" :key="item.id" />
</el-select>
</el-col>
<el-col
:span=
"6"
>
<el-button
type=
"danger"
@
click=
"form.products.splice(INDEX, 1)"
style=
"padding: 10px"
:disabled=
"!INDEX"
><i
class=
"el-icon-minus"
></i></el-button>
<el-button
type=
"primary"
@
click=
"handleAddProduct"
style=
"padding: 10px"
v-if=
"INDEX === form.products.length - 1"
><i
class=
"el-icon-plus"
></i></el-button>
</el-col>
</el-row>
</div>
</div>
</el-form-item>
</el-col>
...
...
@@ -695,8 +703,8 @@ export default {
}
// 掉入公海时间
this
.
enterOpenSeaTime
=
this
.
form
.
estimateEnterOpenSeaTime
||
this
.
form
.
enterOpenSeaTime
||
undefined
if
(
!
this
.
form
.
customerService
||
(
this
.
form
.
customerService
!==
user
.
state
.
id
))
{
console
.
log
(
!
this
.
form
.
customerService
?
"
当前客户没有客户经理
"
:
"
与当前登录用户的客户经理不同
"
)
if
(
!
this
.
form
.
customerService
||
this
.
form
.
customerService
!==
user
.
state
.
id
)
{
console
.
log
(
!
this
.
form
.
customerService
?
"
当前客户没有客户经理
"
:
"
与当前登录用户的客户经理不同
"
)
// 当前客户没有客户经理,或者与当前登录用户的客户经理不同, 可以不校验部分必填字段
// 2024-12-03 客户-编辑,当客户所属客户经理非当前用户,保存必填校验去掉客户类别,常用提货网点,业务国家,主营类别
// 2024-12-05 客户-编辑,当客户所属客户经理非当前用户,保存必填校验去补充掉竞争对手
...
...
@@ -760,7 +768,7 @@ export default {
}
})
// 判断当前客登录用户是否为当前客户的客户经理
this
.
getProductListFn
(
[
])
this
.
getProductListFn
(
0
,
[
undefined
])
}
else
{
this
.
getZhongPao
()
// 新建客户
...
...
@@ -768,7 +776,8 @@ export default {
if
(
this
.
isCustomerServiceConfirmed
)
{
this
.
form
.
customerService
=
this
.
userId
}
this
.
getProductListFn
([])
this
.
form
.
products
.
push
({
typeId
:
undefined
,
productIds
:
[],
productList
:
[]
})
this
.
getProductListFn
(
0
,
[
undefined
])
}
getNodeList
().
then
((
r
)
=>
{
...
...
@@ -806,6 +815,13 @@ export default {
form
:
{},
// 表单校验
rules
:
{
products
:
[
{
required
:
true
,
trigger
:
"
blur
"
,
validator
:
this
.
productsValidator
}
],
name
:
[
{
required
:
true
,
...
...
@@ -906,7 +922,7 @@ export default {
// 网点
nodeList
:
[],
productTypeList
:
[],
productList
:
[]
,
productList
:
{}
,
showZhong
:
false
,
showZhong1
:
false
,
showPao
:
false
,
...
...
@@ -941,25 +957,31 @@ export default {
deleteEmail
(
row
,
index
)
{
row
.
splice
(
index
,
1
)
},
change
(
val
)
{
this
.
form
.
productIds
=
[]
this
.
getProductListFn
(
val
)
change
(
INDEX
,
val
)
{
this
.
form
.
products
[
INDEX
].
productIds
=
[]
this
.
getProductListFn
(
INDEX
,
[
val
])
this
.
$refs
[
"
form
"
].
validateField
(
"
products
"
)
},
getProductListFn
(
val
)
{
getProductList
({
typeIds
:
val
}).
then
((
r
)
=>
{
this
.
productList
=
r
.
data
getProductListFn
(
INDEX
,
val
)
{
getProductList
({
typeIds
:
!
val
[
0
]
?
[]
:
val
}).
then
((
r
)
=>
{
this
.
form
.
products
[
INDEX
].
productList
=
r
.
data
})
},
productIdsChange
(
val
)
{
console
.
log
(
val
)
let
typeIds
=
this
.
productList
.
filter
((
item
)
=>
val
.
indexOf
(
item
.
id
)
>
-
1
).
map
((
item
)
=>
item
.
typeId
)
handleAddProduct
()
{
this
.
form
.
products
.
push
({
typeId
:
undefined
,
productIds
:
[],
productList
:
[]
})
this
.
getProductListFn
(
this
.
form
.
products
.
length
-
1
,
[
undefined
])
},
productIdsChange
(
INDEX
,
val
)
{
let
typeIds
=
this
.
form
.
products
[
INDEX
].
productList
.
filter
((
item
)
=>
val
.
indexOf
(
item
.
id
)
>
-
1
).
map
((
item
)
=>
item
.
typeId
)
typeIds
=
[...
new
Set
(
typeIds
)]
console
.
log
(
typeIds
)
typeIds
.
forEach
((
item
)
=>
{
if
(
this
.
form
.
productTypes
.
indexOf
(
item
)
<
0
)
{
this
.
form
.
productTypes
.
push
(
item
)
let
typeId
=
undefined
if
(
typeIds
.
length
)
{
typeId
=
typeIds
[
0
]
}
if
(
typeId
!==
this
.
form
.
products
[
INDEX
].
typeId
)
{
this
.
form
.
products
[
INDEX
].
typeId
=
typeId
this
.
getProductListFn
(
INDEX
,
[
typeId
])
}
})
},
deleteBankData
(
index
)
{
this
.
form
.
customerBanks
.
splice
(
index
,
1
)
...
...
@@ -992,6 +1014,22 @@ export default {
this
.
customerSelect
=
res
.
data
.
list
})
},
productsValidator
(
rule
,
value
,
callback
)
{
let
r
=
this
.
form
.
products
.
some
((
item
)
=>
{
if
(
!
item
.
typeId
)
{
callback
(
new
Error
(
this
.
$t
(
"
主营类别不能为空
"
)))
return
true
}
})
let
typeIds
=
this
.
form
.
products
.
map
(
item
=>
item
.
typeId
)
if
(
new
Set
(
typeIds
).
size
!==
typeIds
.
length
)
{
callback
(
new
Error
(
this
.
$t
(
"
主营类别不能重复
"
)))
return
}
if
(
!
r
)
{
callback
()
}
},
phoneValidator
(
rule
,
value
,
callback
)
{
if
(
!
value
)
{
return
callback
(
new
Error
(
this
.
$t
(
"
请输入联系方式
"
)))
...
...
@@ -1105,6 +1143,9 @@ export default {
this
.
$modal
.
msgError
(
this
.
$t
(
"
请重新选择主要竞争对手
"
))
return
}
if
(
this
.
form
.
competitorIds
==
0
&&
!
this
.
potential
)
{
return
}
// 重货标准和泡货标准,未打开就不传,提交前清空一下
if
(
!
this
.
showZhong
)
{
...
...
@@ -1212,6 +1253,7 @@ export default {
productTypes
:
[],
pickupPoints
:
[],
productIds
:
[],
products
:
[],
memberId
:
undefined
,
birthday
:
undefined
,
balance
:
undefined
,
...
...
@@ -1279,9 +1321,12 @@ export default {
competitorIds
:
Number
(
response
.
data
.
competitorIds
),
productTypes
:
this
.
stringArrToNumberArr
(
response
.
data
.
productTypes
)
}
if
(
this
.
form
.
productType
s
.
length
)
{
this
.
getProductListFn
(
this
.
form
.
productTypes
)
if
(
!
this
.
form
.
product
s
.
length
)
{
this
.
form
.
products
.
push
({
typeId
:
undefined
,
productIds
:
[],
productList
:
[]
}
)
}
this
.
form
.
products
.
forEach
((
ITEM
,
INDEX
)
=>
{
this
.
getProductListFn
(
INDEX
,
[
ITEM
.
typeId
])
})
console
.
log
(
this
.
form
)
...
...
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