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
dfb9d7b6
Commit
dfb9d7b6
authored
Dec 10, 2024
by
zs嵩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6
parent
225acd64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
35 deletions
+51
-35
edit.vue
src/views/ecw/customer/edit.vue
+51
-35
No files found.
src/views/ecw/customer/edit.vue
View file @
dfb9d7b6
...
...
@@ -213,18 +213,21 @@
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('主营类别')"
prop=
"productTypes"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"1
1
"
>
<el-select
@
change=
"change
"
v-model=
"form.productTypes"
filterable
multip
le
:placeholder=
"$t('请选择产品类别')"
>
<el-form-item
:label=
"$t('主营类别')"
>
<el-row
:gutter=
"10"
v-for=
"(ITEM, INDEX) in form.products"
:key=
"INDEX"
>
<el-col
:span=
"1
0
"
>
<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=
"1
1
"
>
<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=
"1
0
"
>
<el-select
@
change=
"productIdsChange
(INDEX, $event)"
multiple
filterable
clearable
v-model=
"form.products[INDEX]
.productIds"
:placeholder=
"$t('请选择')"
>
<el-option
:label=
"`$
{isChinese ? item.typeTitleZh : item.typeTitleEn}: ${item.titleZh}`" :value="parseInt(item.id)" v-for="item in
form.products[INDEX].
productList" :key="item.id" />
</el-select>
</el-col>
<el-col
:span=
"2"
>
<el-button
size=
"small"
type=
"default"
@
click=
"handleAddProduct"
>
+
</el-button>
</el-col>
</el-row>
</el-form-item>
</el-col>
...
...
@@ -614,7 +617,7 @@ import { getDictDatas, DICT_TYPE } from "@/utils/dict"
import
upload
from
"
@/components/ImageUpload
"
import
{
createCustomer
,
getCustomer
,
getCustomerList
,
getCustomerPage
,
memberUserList
,
updateCustomer
,
userMemberUserList
,
getCustomerLines
,
fillupCustomeInfo
,
getServiceNetwork
,
addCompetitor
,
competitorListAll
}
from
"
@/api/ecw/customer
"
import
{
getNodeList
}
from
"
@/api/ecw/node
"
import
user
from
"
@/store/modules/user
"
import
user
from
"
@/store/modules/user
"
import
{
getProductTypeList
}
from
"
@/api/ecw/productType
"
import
{
getProductList
}
from
"
@/api/ecw/product
"
import
{
getTradeCityList
}
from
"
@/api/ecw/region
"
...
...
@@ -695,8 +698,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 客户-编辑,当客户所属客户经理非当前用户,保存必填校验去补充掉竞争对手
...
...
@@ -709,36 +712,36 @@ export default {
trigger
:
"
blur
"
}
],
country
:
[{
required
:
true
,
message
:
this
.
$t
(
"
国家不能为空
"
),
trigger
:
"
blur
"
}],
level
:
[
country
:
[{
required
:
true
,
message
:
this
.
$t
(
"
国家不能为空
"
),
trigger
:
"
blur
"
}],
level
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
客户等级不能为空
"
),
trigger
:
"
blur
"
}
],
createTime
:
[
createTime
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
创建时间不能为空
"
),
trigger
:
"
blur
"
}
],
source
:
[
source
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
客户来源不能为空
"
),
trigger
:
"
blur
"
}
],
customerService
:
[
customerService
:
[
{
required
:
this
.
customerId
===
"
0
"
,
message
:
this
.
$t
(
"
客户经理不能为空
"
),
trigger
:
"
blur
"
}
],
status
:
[
status
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
客户状态不能为空
"
),
...
...
@@ -760,7 +763,7 @@ export default {
}
})
// 判断当前客登录用户是否为当前客户的客户经理
this
.
getProductListFn
(
[
])
this
.
getProductListFn
(
0
,
[
undefined
])
}
else
{
this
.
getZhongPao
()
// 新建客户
...
...
@@ -768,7 +771,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
)
=>
{
...
...
@@ -906,7 +910,7 @@ export default {
// 网点
nodeList
:
[],
productTypeList
:
[],
productList
:
[]
,
productList
:
{}
,
showZhong
:
false
,
showZhong1
:
false
,
showPao
:
false
,
...
...
@@ -941,25 +945,33 @@ export default {
deleteEmail
(
row
,
index
)
{
row
.
splice
(
index
,
1
)
},
change
(
val
)
{
change
(
INDEX
,
val
)
{
this
.
form
.
productIds
=
[]
this
.
getProductListFn
(
val
)
this
.
getProductListFn
(
INDEX
,
[
val
]
)
},
getProductListFn
(
val
)
{
getProductList
({
typeIds
:
val
}).
then
((
r
)
=>
{
this
.
productList
=
r
.
data
getProductListFn
(
INDEX
,
val
)
{
console
.
log
(
INDEX
,
val
,
11111111111111
)
getProductList
({
typeIds
:
!
val
[
0
]
?
[]
:
val
}).
then
((
r
)
=>
{
console
.
log
(
r
,
2222
)
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
)
...
...
@@ -1212,6 +1224,7 @@ export default {
productTypes
:
[],
pickupPoints
:
[],
productIds
:
[],
products
:
[],
memberId
:
undefined
,
birthday
:
undefined
,
balance
:
undefined
,
...
...
@@ -1279,9 +1292,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