Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-services
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4085da70
authored
Aug 07, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'SAAS+V4.25.0' into 'DJ_master'
合并0804版本:Saas+v4.25.0 See merge request
!29
2 parents
79e22257
ed3eb6b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
273 additions
and
312 deletions
src/views/beforeSale/editEquity.vue
src/views/beforeSale/editEquity.vue
View file @
4085da7
...
...
@@ -46,7 +46,7 @@
<!-- 自选权益 -->
<div
v-if=
"equityRadio == '1'"
class=
"auto_widget"
>
<el-checkbox-group
v-model=
"curSelectPro"
:disabled=
"disabled"
>
<el-checkbox-group
v-model=
"curSelectPro"
:disabled=
"disabled
|| dataSourceDisable
"
>
<div
v-for=
"(item, index) in productList"
:key=
"index"
class=
"product_wrapper"
>
<div
style=
"padding-left: 73px"
>
<!-- <el-checkbox @change="changeCheckBox($event, item, index)" :disabled="item.disabled" :label="errGlassName&&item.idName=='glass'?item.packageName+`(${errGlassName})`:item.packageName"> -->
...
...
@@ -70,7 +70,7 @@
</div>
<div
class=
"arrt_pannel"
>
<template
v-if=
"attr.attributeType == 'input'"
>
<el-input
class=
"arrt_pannel"
:disabled=
"disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)"
@
input=
"getCurChangeInput($event, item, attr, index, attrindex,1)"
v-model=
"productModal[item.idName][attr.attributeName]"
size=
"small"
:maxlength=
"attr.maxLength"
clearable
:placeholder=
"'请输入' + attr.attributeDesc"
></el-input>
<el-input
class=
"arrt_pannel"
:disabled=
"disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)"
@
input=
"getCurChangeInput($event, item, attr, index, attrindex,
1)"
v-model=
"productModal[item.idName][attr.attributeName]"
size=
"small"
:maxlength=
"attr.maxLength"
clearable
:placeholder=
"'请输入' + attr.attributeDesc"
></el-input>
</
template
>
<
template
v-if=
"attr.attributeType == 'select'"
>
<el-select
class=
"arrt_pannel"
:disabled=
"disabled || attr.disabled"
size=
"small"
@
change=
"getCurChangeSelect($event, item, attr)"
v-model=
"productModal[item.idName][attr.attributeName]"
clearable
:placeholder=
"'请选择' + attr.attributeDesc"
>
...
...
@@ -113,74 +113,44 @@
<!-- 定制权益 -->
<div
v-if=
"equityRadio == '2'"
class=
"auto_widget"
>
<el-
radio-group
v-model=
"curSelectCustomPro"
:disabled=
"disabled
"
>
<el-
checkbox-group
v-model=
"curSelectCustomPro"
:disabled=
"disabled || dataSourceDisable
"
>
<div
v-for=
"(item, index) in customProductList"
:key=
"index"
class=
"product_wrapper"
>
<div
style=
"padding-left: 73px"
>
<el-radio
@
change=
"changeRaido($event, item)"
:disabled=
"item.disabled"
:label=
"item.packageName"
></el-radio>
<el-checkbox
@
change=
"changeRaido($event, item, index)"
:label=
"item.packageName"
:disabled=
"item.disabled"
>
<div>
{{ item.packageName }}
</div>
</el-checkbox>
<p
class=
"h20_title product_intro"
>
包括服务项目:{{ item.serviceItems }}
</p>
</div>
<div
v-if=
"curSelectCustomPro == item.packageName"
:key=
"indexs"
class=
"child_wrap custom-made"
>
<div
class=
"child_wrap_pannel"
v-for=
"(attr, attrindex) in item.groupAttributeList"
:key=
"attrindex"
>
<div
class=
"attr_wrapper flex_sc"
>
<div
class=
"attr_label h13_title"
>
<span
v-if=
"attr.required == 1"
style=
"color: red"
>
*
</span>
{{ attr.attributeDesc }}
</div>
<div
class=
"arrt_pannel"
>
<
template
v-if=
"attr.attributeType == 'input'"
>
<el-input
class=
"arrt_pannel"
:disabled=
"disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)"
@
input=
"getCurChangeInput($event, item, attr,index, attrindex,2)"
v-model=
"productModal[item.idName][attr.attributeName]"
size=
"small"
:maxlength=
"attr.maxLength"
clearable
:placeholder=
"'请输入' + attr.attributeDesc"
></el-input>
</
template
>
<
template
v-if=
"attr.attributeType == 'select'"
>
<el-select
class=
"arrt_pannel"
:disabled=
"disabled || attr.disabled"
size=
"small"
@
change=
"getCurChangeSelect($event, item, attr)"
v-model=
"productModal[item.idName][attr.attributeName]"
clearable
:placeholder=
"'请选择' + attr.attributeDesc"
>
<el-option
v-for=
"option in attr.optionList"
:key=
"option.value"
:label=
"option.label"
:value=
"option.value"
></el-option>
</el-select>
</
template
>
<
template
v-if=
"attr.attributeType == 'datePicker'"
>
<el-date-picker
class=
"arrt_pannel"
:picker-options=
"attr.attributeName == 'additional_date' ? pickerOptions2 : pickerOptions"
:disabled=
"disabled || attr.disabled"
@
change=
"getCurChangeDate($event, item, attr)"
v-model=
"productModal[item.idName][attr.attributeName]"
size=
"small"
type=
"date"
:placeholder=
"'请选择' + attr.attributeDesc"
></el-date-picker>
</
template
>
<div
class=
"customer-form"
>
<
template
v-for=
"(ele, indexs) in curSelectCustomPro"
>
<div
v-if=
"ele == item.packageName"
:key=
"indexs"
class=
"child_wrap"
>
<div
class=
"child_wrap_pannel"
v-for=
"(attr, attrindex) in item.groupAttributeList"
:key=
"attrindex"
>
<div
class=
"attr_wrapper flex_sc"
>
<div
class=
"attr_label h13_title"
>
<span
v-if=
"attr.required == 1"
style=
"color: red"
>
*
</span>
{{
attr
.
attributeDesc
}}
</div>
<div
class=
"arrt_pannel"
>
<template
v-if=
"attr.attributeType == 'input'"
>
<el-input
class=
"arrt_pannel"
:disabled=
"disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)"
@
input=
"getCurChangeInput($event, item, attr, index, attrindex, 2)"
v-model=
"productModal[item.idName][attr.attributeName]"
size=
"small"
:maxlength=
"attr.maxLength"
clearable
:placeholder=
"'请输入' + attr.attributeDesc"
></el-input>
</
template
>
<
template
v-if=
"attr.attributeType == 'select'"
>
<el-select
class=
"arrt_pannel"
:disabled=
"disabled || attr.disabled"
size=
"small"
@
change=
"getCurChangeSelect($event, item, attr)"
v-model=
"productModal[item.idName][attr.attributeName]"
clearable
:placeholder=
"'请选择' + attr.attributeDesc"
>
<el-option
v-for=
"option in attr.optionList"
:key=
"option.value"
:label=
"option.label"
:value=
"option.value"
></el-option>
</el-select>
</
template
>
<
template
v-if=
"attr.attributeType == 'datePicker'"
>
<el-date-picker
class=
"arrt_pannel"
:picker-options=
"attr.attributeName == 'additional_date' ? pickerOptions2 : pickerOptions"
:disabled=
"disabled || attr.disabled"
@
change=
"getCurChangeDate($event, item, attr)"
v-model=
"productModal[item.idName][attr.attributeName]"
size=
"small"
type=
"date"
:placeholder=
"'请选择' + attr.attributeDesc"
></el-date-picker>
</
template
>
</div>
</div>
</div>
</div>
</
div
>
</
template
>
</div>
</div>
</el-
radio
-group>
</el-
checkbox
-group>
</div>
<!-- <div v-if="equityRadio == '2'" class="auto_widget">
<glsx-combi-form class="edit-form-container" :isEdit="true" defaultWidth="320px" :formObj="editForm" :formData="editFormDataPro">
<template slot="packageCode" slot-scope="scope">
<el-radio-group class="package-code-box" v-model="editForm[scope.scope.name]" :disabled="scope.scope.isDisabled" @change="scope.scope.handleRadioChange">
<el-radio class="package-code" v-for="subItem in scope.scope.optionList" :key="subItem[scope.scope.optionId]" :label="subItem[scope.scope.optionId]">
<span class="package-title">{{ subItem[scope.scope.optionLabel] }}</span>
<div class="radio-add-block" @click.stop.prevent="e => handleCancelBubble(e)">
<p class="package-subtitle">{{ subItem.serviceItems }}</p>
<div v-if="editForm.packageCode == subItem[scope.scope.optionId]">
<glsx-combi-form class="edit-form-container" ref="editFormRefPro" :isEdit="true" defaultWidth="320px" formRef="editChildRefPro" :isBlock="isBlock" :formObj="editFormPro" :formData="subItem.editFormData" :formRules="editRulePro">
<template slot="table" slot-scope="scope">
<table class="table-style">
<tbody>
<tr>
<td v-for="(m, n) in scope.scope.attributeList" :key="n" :style="{ width: 100 / scope.scope.attributeList.length + '%' }">{{ m.attributeDesc }}</td>
</tr>
<tr v-for="(m, n) in scope.scope.tableList" :key="n">
<td v-for="(i, j) in m" :key="j" :style="{ width: 100 / scope.scope.attributeList.length + '%' }">
<el-input :disabled="i.isDisabled" :class="{ 'border-red': !editFormPro[i.name] }" placeholder="请输入" v-model="editFormPro[i.name]" :maxlength="i.maxlength">
<el-popover v-show="!editFormPro[i.name]" slot="suffix" placement="top" title="" width="90" trigger="hover" :content="i.attributeDesc + '是必填项'">
<i class="el-icon-warning color-red" slot="reference"></i>
</el-popover>
</el-input>
</td>
</tr>
</tbody>
</table>
</template>
</glsx-combi-form>
</div>
</div>
</el-radio>
</el-radio-group>
</template>
</glsx-combi-form>
</div> -->
</div>
<!-- 其他信息 -->
...
...
@@ -196,9 +166,7 @@
</div>
<!-- 底部固定按钮 -->
<!-- <div style="height: 78px"></div> -->
<div
class=
"fixed_bottom"
>
<!-- <div class="ma_top"></div> -->
<div
class=
"flex_cc ma_bot"
>
<el-button
class=
"btn-three"
plain
v-if=
"![3, 5].includes(routeInfo.addOrEdit)"
@
click=
"handleReset"
>
重置
</el-button>
<div
class=
"mar-10"
></div>
...
...
@@ -486,21 +454,8 @@ export default {
packageList
:
[],
editRulePro
:
{},
editFormPro
:
{},
// editFormDataPro: [
// {
// label: '',
// name: 'packageCode',
// optionList: [],
// optionId: 'packageCode',
// optionLabel: 'packageName',
// addHtml: 'packageCode',
// handleRadioChange: val => {
// this.packageAttr()
// }
// }
// ],
curSelectPro
:
[],
curSelectCustomPro
:
''
,
curSelectCustomPro
:
[]
,
editProductObj
:
{},
productList
:
[],
customProductList
:
[],
...
...
@@ -509,7 +464,6 @@ export default {
crash
:
{},
stolen
:
{},
tire
:
{},
vip
:
{},
glass
:
{}
},
// 其他信息
...
...
@@ -714,7 +668,8 @@ export default {
pickerOptions2
:
{},
hotline
:
''
,
compensationNameDisable
:
false
,
errGlassName
:
''
errGlassName
:
''
,
dataSourceDisable
:
false
}
},
...
...
@@ -902,7 +857,7 @@ export default {
// }
}
else
{
this
.
errGlassName
=
''
if
(
this
.
vailIndex
!=
undefined
)
this
.
$set
(
this
.
productList
[
this
.
vailIndex
],
'disabled'
,
false
)
if
(
this
.
vailIndex
!=
undefined
)
this
.
$set
(
this
.
productList
[
this
.
vailIndex
],
'disabled'
,
false
)
if
(
this
.
vail_sale_price_index
)
this
.
$set
(
this
.
productList
[
this
.
vailIndex
].
groupAttributeList
[
this
.
vail_sale_price_index
],
'disabled'
,
false
)
}
}
else
{
...
...
@@ -911,18 +866,18 @@ export default {
}
},
// 轮胎玻璃提单参数处理
vaildGlassParams
(){
if
(
this
.
equityRadio
==
1
&&
this
.
tempAttributeList
.
length
&&
this
.
packageCodeList
.
length
&&
this
.
errGlassName
)
{
if
(
this
.
packageCodeList
.
indexOf
(
this
.
vailGlassCode
)
!=-
1
)
{
vaildGlassParams
()
{
if
(
this
.
equityRadio
==
1
&&
this
.
tempAttributeList
.
length
&&
this
.
packageCodeList
.
length
&&
this
.
errGlassName
)
{
if
(
this
.
packageCodeList
.
indexOf
(
this
.
vailGlassCode
)
!=
-
1
)
{
let
arr1
=
[]
let
arr2
=
[]
this
.
tempAttributeList
.
forEach
(
ele
=>
{
if
(
ele
.
packageCode
!=
this
.
vailGlassCode
)
{
this
.
tempAttributeList
.
forEach
(
ele
=>
{
if
(
ele
.
packageCode
!=
this
.
vailGlassCode
)
{
arr1
.
push
(
ele
)
}
})
this
.
packageCodeList
.
forEach
(
ele
=>
{
if
(
ele
!=
this
.
vailGlassCode
)
{
this
.
packageCodeList
.
forEach
(
ele
=>
{
if
(
ele
!=
this
.
vailGlassCode
)
{
arr2
.
push
(
ele
)
}
})
...
...
@@ -966,10 +921,12 @@ export default {
},
changeRaido
(
e
,
item
)
{
if
(
e
)
{
this
.
checkCodeList
=
[]
this
.
autoPackageCodeList
=
[]
//
this.checkCodeList = []
//
this.autoPackageCodeList = []
this
.
checkCodeList
.
push
(
item
.
packageCode
)
this
.
autoPackageCodeList
.
push
(
item
.
packageCode
)
this
.
checkCodeList
=
Array
.
from
(
new
Set
(
this
.
checkCodeList
))
this
.
autoPackageCodeList
=
Array
.
from
(
new
Set
(
this
.
autoPackageCodeList
))
for
(
let
key
in
this
.
productModal
[
item
.
idName
])
{
item
.
groupAttributeList
.
forEach
(
attr
=>
{
if
(
attr
.
attributeName
==
key
)
{
...
...
@@ -981,7 +938,17 @@ export default {
attributeGroup
:
'planId'
,
attributeName
:
'planId'
}
this
.
commonPart
(
this
.
productModal
[
'vip'
][
'planId'
],
item
,
customAttr
)
this
.
commonPart
(
this
.
productModal
[
`vip
${
item
.
packageCode
}
`
][
'planId'
],
item
,
customAttr
)
}
else
{
this
.
checkCodeList
=
this
.
checkCodeList
.
filter
(
t
=>
t
!=
item
.
packageCode
)
this
.
autoPackageCodeList
=
this
.
autoPackageCodeList
.
filter
(
t
=>
t
!=
item
.
packageCode
)
for
(
let
key
in
this
.
productModal
[
item
.
idName
])
{
item
.
groupAttributeList
.
forEach
(
attr
=>
{
if
(
attr
.
attributeName
==
key
)
{
this
.
commonPart
(
this
.
productModal
[
item
.
idName
][
key
],
item
,
attr
)
}
})
}
}
},
// 获取店铺信息
...
...
@@ -1027,7 +994,7 @@ export default {
this
.
compensationNameDisable
=
false
},
// 自选权益产品套餐处理参数---输入框
getCurChangeInput
(
e
,
pack
,
attr
,
faIndex
,
childIndex
,
radio
)
{
getCurChangeInput
(
e
,
pack
,
attr
,
faIndex
,
childIndex
,
radio
)
{
if
(
!
e
)
{
return
}
...
...
@@ -1040,8 +1007,8 @@ export default {
}
}
if
(
attr
.
attributeName
==
'card'
)
{
let
_tempArr
=
radio
==
2
?
this
.
customProductList
[
faIndex
]:
this
.
productList
[
faIndex
]
_tempArr
.
groupAttributeList
.
map
(
el
=>
{
let
_tempArr
=
radio
==
2
?
this
.
customProductList
[
faIndex
]
:
this
.
productList
[
faIndex
]
_tempArr
.
groupAttributeList
.
map
(
el
=>
{
if
(
el
.
attributeName
==
'service_period'
)
{
el
.
disabled
=
true
return
el
...
...
@@ -1075,7 +1042,6 @@ export default {
}
else
{
this
.
tempAttributeList
.
push
(
temp
)
}
// this.packageCodeList.push(pack.packageCode)
this
.
handleProductArrParam
(
this
.
tempAttributeList
,
this
.
packageCodeList
)
}
else
{
let
flag
=
this
.
autoAttriButeList
.
findIndex
(
val
=>
{
...
...
@@ -1086,14 +1052,35 @@ export default {
}
else
{
this
.
autoAttriButeList
.
push
(
temp
)
}
// this.autoPackageCodeList.push(pack.packageCode)
this
.
handleProductArrParam
(
this
.
autoAttriButeList
,
this
.
autoPackageCodeList
)
}
},
objSort
(
obj
)
{
let
newObj
=
{}
//遍历对象,并将key进行排序
Object
.
keys
(
obj
)
.
sort
()
.
map
(
key
=>
{
newObj
[
key
]
=
obj
[
key
]
})
//将排序好的数组转成字符串
return
JSON
.
stringify
(
newObj
)
},
unique
(
arr
)
{
let
set
=
new
Set
()
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
let
str
=
this
.
objSort
(
arr
[
i
])
set
.
add
(
str
)
}
//将数组中的字符串转回对象
arr
=
[...
set
].
map
(
item
=>
{
return
JSON
.
parse
(
item
)
})
return
arr
},
// 处理数据结构对比后台所需的参数
handleProductArrParam
(
arr
,
codearr
)
{
let
newArr
=
[]
let
newArr
=
[]
,
filterList
=
[]
const
codeList
=
Array
.
from
(
new
Set
(
codearr
))
this
.
checkCodeList
=
codeList
let
blackArr
=
[]
...
...
@@ -1101,12 +1088,18 @@ export default {
blackArr
.
push
([])
}
const
newParaArr
=
[]
codeList
.
forEach
((
item
,
index
)
=>
{
let
attrStr
=
`attributes[
${
index
}
].packageCode`
let
obj
=
{
[
attrStr
]:
item
}
newArr
.
push
(
obj
)
if
(
arr
.
length
)
{
filterList
=
this
.
unique
(
arr
)
}
arr
=
filterList
arr
.
forEach
(
el
=>
{
arr
.
forEach
(
els
=>
{
if
(
el
.
packageCode
==
els
.
packageCode
){
if
(
el
.
contractNo
){
els
.
contractNo
=
el
.
contractNo
}
}
})
})
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
codeList
.
length
;
j
++
)
{
...
...
@@ -1122,6 +1115,14 @@ export default {
}
}
blackArr
[
j
].
push
(
obj
)
// 2023 7月底版本 多商品
let
attrStr
=
`attributes[
${
j
}
].packageCode`
let
contractNoStr
=
`attributes[
${
j
}
].contractNo`
let
temp
=
{
[
attrStr
]:
codeList
[
j
],
[
contractNoStr
]:
arr
[
i
].
contractNo
}
newArr
.
push
(
temp
)
}
}
}
...
...
@@ -1147,6 +1148,7 @@ export default {
this
.
formatProduct
=
Object
.
assign
(
this
.
formatProduct
,
item
)
})
}
else
{
this
.
autoFormatProduct
=
{}
concactArr
.
forEach
(
item
=>
{
this
.
autoFormatProduct
=
Object
.
assign
(
this
.
autoFormatProduct
,
item
)
})
...
...
@@ -1175,17 +1177,20 @@ export default {
// 获取产品的数据
toGetProductData
(
arr
)
{
arr
.
forEach
(
item
=>
{
if
(
item
.
packageType
==
1
){
//定制权益
item
.
idName
=
'vip'
}
else
{
// 自选权益
if
(
item
.
packageName
.
includes
(
'整车全损'
))
{
if
(
item
.
packageType
==
1
)
{
//定制权益
item
.
idName
=
`vip
${
item
.
packageCode
}
`
this
.
$set
(
this
.
productModal
,
item
.
idName
,
{})
this
.
productModal
[
item
.
idName
][
'planId'
]
=
item
.
planId
}
else
{
// 自选权益
if
(
item
.
packageName
.
includes
(
'整车全损'
))
{
item
.
idName
=
'car'
}
else
if
(
item
.
packageName
.
includes
(
'轮胎'
))
{
item
.
idName
=
'tire'
}
else
if
(
item
.
packageName
.
includes
(
'碰撞'
))
{
item
.
idName
=
'crash'
this
.
productModal
[
item
.
idName
][
'planId'
]
=
item
.
planId
this
.
productModal
[
'vip'
][
'planId'
]
=
item
.
planId
this
.
getCase
(
item
.
planId
)
}
else
if
(
item
.
packageName
.
includes
(
'盗抢'
))
{
item
.
idName
=
'stolen'
...
...
@@ -1195,24 +1200,6 @@ export default {
item
.
idName
=
'glass'
}
}
// if (item.packageName.includes('整车全损')) {
// item.idName = 'car'
// } else if (item.packageName.includes('轮胎')) {
// item.idName = 'tire'
// } else if (item.packageName.includes('碰撞')) {
// item.idName = 'crash'
// this.productModal[item.idName]['planId'] = item.planId
// this.productModal['vip']['planId'] = item.planId
// this.getCase(item.planId)
// } else if (item.packageName.includes('盗抢')) {
// item.idName = 'stolen'
// } else if (item.packageType == 1) {
// item.idName = 'vip'
// } else if (item.packageName.includes('玻璃')) {
// this.vailGlassName = item.packageName // 备用
// this.vailGlassCode = item.packageCode
// item.idName = 'glass'
// }
item
.
disabled
=
false
item
.
serviceItems
=
item
.
serviceItemsList
.
length
?
item
.
serviceItemsList
.
map
(
k
=>
k
.
serviceName
).
join
(
','
)
:
''
let
newArr
=
[]
...
...
@@ -1230,31 +1217,35 @@ export default {
}
e
.
optionList
=
[...
arr
]
this
.
serviceObj
[
item
.
packageCode
]
=
item
.
servicePeriod
this
.
productModal
[
item
.
idName
][
e
.
attributeName
]
=
'1'
// this.productModal[item.idName][e.attributeName] = '1'
this
.
$set
(
this
.
productModal
[
item
.
idName
],
`
${
e
.
attributeName
}
`
,
'1'
)
}
else
if
(
e
.
attributeDesc
==
'购车类型'
)
{
e
.
optionList
=
this
.
baseData
.
buyCarTypeList
this
.
productModal
[
item
.
idName
][
e
.
attributeName
]
=
'0'
}
else
if
((
item
.
idName
==
'tire'
||
item
.
idName
==
'crash'
||
item
.
idName
==
'vip'
||
item
.
idName
==
'glass'
)
&&
e
.
attributeDesc
==
'服务期限'
)
{
// this.productModal[item.idName][e.attributeName] = '0'
this
.
$set
(
this
.
productModal
[
item
.
idName
],
`
${
e
.
attributeName
}
`
,
'0'
)
}
else
if
((
item
.
idName
==
'tire'
||
item
.
idName
==
'crash'
||
item
.
idName
==
`vip
${
item
.
packageCode
}
`
||
item
.
idName
==
'glass'
)
&&
e
.
attributeDesc
==
'服务期限'
)
{
if
(
item
.
idName
==
'tire'
||
item
.
idName
==
'crash'
)
{
e
.
optionList
=
this
.
baseData
.
servicePeriodList
}
else
{
e
.
optionList
=
this
.
baseData
.
servicePeriodList2
}
e
.
disabled
=
true
// v3.1.2--新版的定制权益-服务期限--改为1,2,3年---旧版的依然是一年
let
isOld
=
item
.
packageName
.
includes
(
'尊享版'
)
||
item
.
packageName
.
includes
(
'舒享版'
)
||
item
.
packageName
.
includes
(
'优享版'
)
if
(
item
.
idName
==
'vip'
&&
!
isOld
)
{
e
.
disabled
=
false
e
.
optionList
=
this
.
baseData
.
servicePeriodList
// v3.1.2--新版的定制权益-服务期限--改为1,2,3年---旧版的依然是一年
let
isOld
=
item
.
packageName
.
includes
(
'尊享版'
)
||
item
.
packageName
.
includes
(
'舒享版'
)
||
item
.
packageName
.
includes
(
'优享版'
)
if
(
item
.
idName
==
`vip
${
item
.
packageCode
}
`
&&
!
isOld
)
{
e
.
disabled
=
false
e
.
optionList
=
this
.
baseData
.
servicePeriodList
}
this
.
productModal
[
item
.
idName
][
e
.
attributeName
]
=
'1'
//
this.productModal[item.idName][e.attributeName] = '1'
this
.
$set
(
this
.
productModal
[
item
.
idName
],
`
${
e
.
attributeName
}
`
,
'1'
)
}
else
if
(
e
.
attributeDesc
==
'生效日期'
)
{
let
nextDay
=
new
Date
().
getTime
()
+
24
*
60
*
60
*
1000
this
.
productModal
[
item
.
idName
][
e
.
attributeName
]
=
utils
.
dateFormat
(
nextDay
)
// this.productModal[item.idName][e.attributeName] = utils.dateFormat(nextDay)
this
.
$set
(
this
.
productModal
[
item
.
idName
],
`
${
e
.
attributeName
}
`
,
utils
.
dateFormat
(
nextDay
))
if
(
item
.
idName
==
'glass'
)
{
let
tAdd2
=
new
Date
().
getTime
()
+
24
*
60
*
60
*
1000
*
2
this
.
productModal
[
item
.
idName
][
e
.
attributeName
]
=
utils
.
dateFormat
(
tAdd2
)
// this.productModal[item.idName][e.attributeName] = utils.dateFormat(tAdd2)
this
.
$set
(
this
.
productModal
[
item
.
idName
],
`
${
e
.
attributeName
}
`
,
utils
.
dateFormat
(
tAdd2
))
e
.
disabled
=
true
}
}
...
...
@@ -1315,7 +1306,7 @@ export default {
})
},
getInfo
(
productArrData
)
{
this
.
$apis
.
beforeSale
.
getEquityApi
({
contractNo
:
this
.
routeInfo
.
contractNo
}).
then
(
res
=>
{
this
.
$apis
.
beforeSale
.
getEquityApi
({
contractNo
:
this
.
routeInfo
.
contractNo
,
repeatedFlag
:
this
.
routeInfo
.
addOrEdit
==
4
?
1
:
0
}).
then
(
res
=>
{
this
.
editForm
=
{
...
res
}
...
...
@@ -1356,6 +1347,7 @@ export default {
if
([
2
,
4
].
includes
(
this
.
routeInfo
.
addOrEdit
))
{
this
.
editForm
.
effectiveDate
=
new
Date
(
new
Date
().
setDate
(
new
Date
().
getDate
()
+
1
))
}
this
.
dataSourceDisable
=
res
.
dataSource
==
'car'
this
.
editForm
.
packageCode
&&
this
.
packageAttr
(
true
,
productArrData
,
res
)
const
spaItem
=
this
.
baseData
.
agreeList
.
find
(
item
=>
item
.
id
==
this
.
editForm
.
specialAppointId
)
if
(
spaItem
)
{
...
...
@@ -1400,140 +1392,160 @@ export default {
}
},
packageAttr
(
recovery
=
false
,
productArrData
,
detailInfo
)
{
var
targetItem
=
productArrData
.
find
(
item
=>
item
.
packageCode
==
this
.
editForm
.
packageCode
)
if
(
targetItem
.
packageType
==
1
)
{
this
.
equityRadio
=
2
this
.
curSelectCustomPro
=
targetItem
.
packageName
this
.
editForm
.
attributeList
.
forEach
(
item
=>
{
if
(
item
.
attributeName
.
includes
(
'price'
))
{
item
.
attributeValue
=
item
.
attributeValue
/
100
}
if
(
item
.
attributeName
==
'tireScale'
&&
item
.
sort
==
1
)
{
item
.
attributeName
=
'afterTireScale'
}
if
(
item
.
attributeName
==
'buy_car_type'
&&
item
.
attributeValue
==
1
)
{
this
.
compensationNameDisable
=
true
}
this
.
productModal
.
vip
[
item
.
attributeName
]
=
item
.
attributeValue
})
if
(
this
.
routeInfo
.
addOrEdit
==
3
)
{
this
.
leftDisable
=
true
this
.
customProductList
.
map
(
item
=>
{
item
.
disabled
=
true
item
.
groupAttributeList
.
map
(
ele
=>
{
if
(
ele
.
attributeName
==
'service_period'
)
{
ele
.
disabled
=
true
}
if
(
ele
.
attributeName
==
'card'
)
{
ele
.
disabled
=
true
}
if
(
ele
.
attributeName
==
'effective_date'
)
{
ele
.
disabled
=
true
}
})
return
item
})
// 2023 7月底版本 改版
let
attrList
=
[],
packCode
=
[]
detailInfo
.
attributes
.
forEach
(
item
=>
{
let
targetItem
=
productArrData
.
find
(
k
=>
k
.
packageCode
==
item
.
packageCode
)
const
defalutAttr
=
this
.
handleDefaultValue
(
targetItem
,
item
.
attributeDTOList
)
if
(
defalutAttr
.
length
)
{
item
.
attributeDTOList
=
[...
item
.
attributeDTOList
,
...
defalutAttr
]
}
}
else
{
this
.
equityRadio
=
1
this
.
curSelectPro
=
[
targetItem
.
packageName
]
this
.
editForm
.
attributeList
.
forEach
(
item
=>
{
if
(
item
.
attributeName
.
includes
(
'price'
))
{
item
.
attributeValue
=
item
.
attributeValue
/
100
}
else
if
(
item
.
attributeName
==
'planId'
)
{
this
.
getCase
(
parseInt
(
item
.
attributeValue
))
if
(
targetItem
.
packageType
==
1
)
{
this
.
equityRadio
=
2
this
.
curSelectCustomPro
.
push
(
targetItem
.
packageName
)
this
.
curSelectCustomPro
=
Array
.
from
(
new
Set
(
this
.
curSelectCustomPro
))
item
.
attributeDTOList
.
forEach
(
a
=>
{
if
(
a
.
attributeName
.
includes
(
'price'
))
{
a
.
attributeValue
=
a
.
attributeValue
/
100
}
if
(
a
.
attributeName
==
'tireScale'
&&
a
.
sort
==
1
)
{
a
.
attributeName
=
'afterTireScale'
}
if
(
a
.
attributeName
==
'buy_car_type'
&&
a
.
attributeValue
==
1
)
{
this
.
compensationNameDisable
=
true
}
this
.
productModal
[
`vip
${
item
.
packageCode
}
`
][
a
.
attributeName
]
=
a
.
attributeValue
})
if
(
this
.
routeInfo
.
addOrEdit
==
3
||
this
.
routeInfo
.
addOrEdit
==
4
)
{
this
.
leftDisable
=
true
this
.
customProductList
.
map
(
c
=>
{
c
.
disabled
=
true
c
.
groupAttributeList
.
map
(
ele
=>
{
if
(
ele
.
attributeName
==
'service_period'
&&
(
this
.
routeInfo
.
addOrEdit
>
2
))
{
ele
.
disabled
=
true
}
if
(
ele
.
attributeName
==
'card'
)
{
ele
.
disabled
=
true
}
if
(
ele
.
attributeName
==
'effective_date'
&&
this
.
routeInfo
.
addOrEdit
==
3
)
{
ele
.
disabled
=
true
}
})
return
c
})
}
if
(
item
.
attributeName
==
'tireScale'
&&
item
.
sort
==
1
)
{
item
.
attributeName
=
'afterTireScale'
if
(
this
.
routeInfo
.
addOrEdit
==
2
)
{
this
.
customProductList
.
map
(
c
=>
{
c
.
disabled
=
true
c
.
groupAttributeList
.
map
(
ele
=>
{
if
(
ele
.
attributeName
==
'service_period'
&&
this
.
dataSourceDisable
)
{
ele
.
disabled
=
true
this
.
leftDisable
=
true
}
})
return
c
})
}
if
(
item
.
attributeName
==
'buy_car_type'
&&
item
.
attributeValue
==
1
)
{
this
.
compensationNameDisable
=
true
}
else
{
this
.
equityRadio
=
1
this
.
curSelectPro
.
push
(
targetItem
.
packageName
)
this
.
curSelectPro
=
Array
.
from
(
new
Set
(
this
.
curSelectPro
))
item
.
attributeDTOList
.
forEach
(
b
=>
{
if
(
b
.
attributeName
.
includes
(
'price'
))
{
b
.
attributeValue
=
b
.
attributeValue
/
100
}
else
if
(
b
.
attributeName
==
'planId'
)
{
this
.
getCase
(
parseInt
(
b
.
attributeValue
))
}
if
(
b
.
attributeName
==
'tireScale'
&&
b
.
sort
==
1
)
{
b
.
attributeName
=
'afterTireScale'
}
if
(
b
.
attributeName
==
'buy_car_type'
&&
b
.
attributeValue
==
1
)
{
this
.
compensationNameDisable
=
true
}
this
.
productModal
[
targetItem
.
idName
][
b
.
attributeName
]
=
b
.
attributeValue
})
if
(
this
.
routeInfo
.
addOrEdit
==
3
||
this
.
routeInfo
.
addOrEdit
==
4
)
{
this
.
rightDisable
=
true
this
.
productList
.
map
(
d
=>
{
d
.
disabled
=
true
d
.
groupAttributeList
.
map
(
elee
=>
{
if
(
elee
.
attributeName
==
'service_period'
&&
(
this
.
routeInfo
.
addOrEdit
>
2
))
{
elee
.
disabled
=
true
}
if
(
elee
.
attributeName
==
'card'
)
{
elee
.
disabled
=
true
}
if
(
elee
.
attributeName
==
'effective_date'
&&
this
.
routeInfo
.
addOrEdit
==
3
)
{
elee
.
disabled
=
true
}
if
(
elee
.
attributeName
==
'buy_car_type'
&&
elee
.
attributeValue
==
1
)
{
elee
.
disabled
=
true
}
})
return
d
})
}
this
.
productModal
[
targetItem
.
idName
][
item
.
attributeName
]
=
item
.
attributeValue
})
if
(
this
.
routeInfo
.
addOrEdit
==
3
)
{
this
.
rightDisable
=
true
this
.
productList
.
map
(
item
=>
{
item
.
disabled
=
true
item
.
groupAttributeList
.
map
(
ele
=>
{
if
(
ele
.
attributeName
==
'service_period'
)
{
ele
.
disabled
=
true
}
if
(
ele
.
attributeName
==
'card'
)
{
ele
.
disabled
=
true
}
if
(
ele
.
attributeName
==
'effective_date'
)
{
ele
.
disabled
=
true
}
if
(
ele
.
attributeName
==
'buy_car_type'
&&
ele
.
attributeValue
==
1
)
{
ele
.
disabled
=
true
}
if
(
this
.
routeInfo
.
addOrEdit
==
2
)
{
this
.
productList
.
map
(
c
=>
{
c
.
disabled
=
true
c
.
groupAttributeList
.
map
(
ele
=>
{
if
(
ele
.
attributeName
==
'service_period'
&&
this
.
dataSourceDisable
)
{
ele
.
disabled
=
true
this
.
rightDisable
=
true
}
})
return
c
})
}
}
return
item
packCode
.
push
(
item
.
packageCode
)
item
.
attributeDTOList
.
forEach
(
el
=>
{
attrList
.
push
({
...
el
,
packageCode
:
item
.
packageCode
,
contractNo
:
item
.
contractNo
})
}
}
// this.packageToPrice()
// var tempObj = this.$common.utils.deepClone(this.editFormPro)
let
attrList
=
[]
detailInfo
.
attributeList
.
forEach
(
item
=>
{
attrList
.
push
({
...
item
,
packageCode
:
detailInfo
.
packageCode
})
})
if
(
this
.
equityRadio
==
1
)
{
this
.
tempAttributeList
=
attrList
this
.
packageCodeList
=
[
detailInfo
.
packageCode
]
this
.
packageCodeList
=
packCode
}
else
{
this
.
autoAttriButeList
=
attrList
this
.
autoPackageCodeList
=
[
detailInfo
.
packageCode
]
}
this
.
checkCodeList
=
[
detailInfo
.
packageCode
]
this
.
handleProductArrParam
(
attrList
,
[
detailInfo
.
packageCode
])
// this.editRulePro = {}
// this.editFormPro = {}
// var attrName = ''
// targetItem &&
// targetItem.groupAttributeList.forEach(item => {
// if (item.attributeList.length == 1) {
// attrName = item.attributeList[0].attributeName
// this.$set(this.editFormPro, attrName, tempObj.hasOwnProperty(attrName) ? tempObj[attrName] : '')
// if (item.attributeList[0].required == 1) {
// this.editRulePro[item.attributeList[0].attributeName] = [
// {
// required: true,
// message: '请输入' + item.attributeList[0].attributeDesc,
// trigger: 'change'
// }
// ]
// }
// } else {
// for (var i = 0; i < item.num; i++) {
// item.attributeList.forEach(k => {
// attrName = k.attributeName
// this.$set(this.editFormPro, attrName + i, tempObj.hasOwnProperty(attrName + i) ? tempObj[attrName + i] : '')
// })
// }
// }
// })
// if (recovery) {
// this.recoveryEditFormPro()
// }
this
.
autoPackageCodeList
=
packCode
}
this
.
checkCodeList
=
packCode
this
.
handleProductArrParam
(
attrList
,
packCode
)
},
recoveryEditFormPro
()
{
this
.
editForm
.
attributeList
.
length
&&
this
.
editForm
.
attributeList
.
forEach
((
item
,
idx
)
=>
{
let
hashObj
=
{}
this
.
editForm
.
attributeList
.
map
(
i
=>
i
.
attributeName
)
.
forEach
((
i
,
subIdx
)
=>
{
Object
.
keys
(
hashObj
).
includes
(
i
)
?
(
hashObj
[
i
]
=
hashObj
[
i
]
+
1
)
:
(
hashObj
[
i
]
=
1
)
})
this
.
$set
(
this
.
editFormPro
,
hashObj
[
item
.
attributeName
]
!=
1
?
item
.
attributeName
+
item
.
sort
:
item
.
attributeName
,
item
.
attributeValue
)
// 处理默认值赋值
handleDefaultValue
(
targetItem
,
attributeDTOList
)
{
const
currentPackageValue
=
this
.
productModal
[
targetItem
.
idName
]
const
groupAttributeList
=
targetItem
.
groupAttributeList
let
tempArr
=
[],
result
=
[]
for
(
let
key
in
currentPackageValue
)
{
for
(
let
i
=
0
;
i
<
groupAttributeList
.
length
;
i
++
)
{
if
(
key
===
groupAttributeList
[
i
].
attributeName
)
{
let
obj
=
{
attributeGroup
:
key
,
attributeName
:
key
,
attributeValue
:
currentPackageValue
[
key
],
sort
:
0
}
tempArr
.
push
(
obj
)
}
}
}
tempArr
.
forEach
(
el
=>
{
attributeDTOList
.
forEach
(
item
=>
{
if
(
item
.
attributeName
!==
el
.
attributeName
)
{
result
.
push
(
el
)
}
})
})
return
result
},
autoGenerate
(
arr1
,
arr2
)
{
const
tempList
=
arr1
.
concat
(
arr2
)
...
...
@@ -1541,59 +1553,6 @@ export default {
return
}
this
.
routeInfo
.
addOrEdit
!=
'1'
?
this
.
getInfo
(
tempList
)
:
''
// var tempList = []
// this.packageList.forEach(item => {
// tempList = []
// item.groupAttributeList.forEach((k, idx) => {
// if (k.attributeList.length == 1) {
// tempList.push({
// label: k.attributeList[0].attributeDesc,
// name: k.attributeList[0].attributeName,
// type: k.attributeList[0].attributeType,
// isDisabled: this.disabled || this.successDisable,
// maxlength: k.attributeList[0].maxLength
// })
// if (k.attributeList[0].attributeType == 'datePicker') {
// tempList[idx].dateType = 'date'
// ;(tempList[idx].valueFormat = 'yyyy-MM-dd'), (tempList[idx].pickerOptions = 'beforeRangePickerOptions')
// }
// } else {
// var tableList = []
// for (var i = 0; i < k.num; i++) {
// tableList[i] = []
// k.attributeList.forEach((j, index) => {
// tableList[i].push({
// groupName: j.groupName,
// attributeDesc: j.attributeDesc,
// attributeName: j.attributeName,
// name: j.attributeName + i,
// sort: i,
// attributeGroup: j.attributeGroup,
// maxlength: j.maxLength,
// required: j.required,
// attributeType: j.attributeType,
// isDisabled: this.disabled || this.successDisable
// })
// })
// }
// tempList.push({
// label: '',
// name: '',
// addHtml: 'table',
// attributeList: k.attributeList,
// tableList: tableList
// })
// }
// })
// this.editFormDataPro[0].optionList.push({
// packageCode: item.packageCode,
// packageName: item.packageName,
// serviceItems: item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : '',
// serviceItemsList: item.serviceItemsList,
// groupAttributeList: item.groupAttributeList,
// editFormData: this.$common.utils.deepClone(tempList)
// })
// })
},
getOptionsList
(
formName
,
hasAll
=
true
,
refreshSigle
)
{
if
(
refreshSigle
)
{
...
...
@@ -1753,6 +1712,7 @@ export default {
}
this
.
submit
=
true
var
params
=
this
.
getParams
()
delete
params
.
attributes
params
.
operationType
=
0
if
(
this
.
routeInfo
.
addOrEdit
==
'2'
)
{
params
.
contractNo
=
this
.
routeInfo
.
contractNo
...
...
@@ -1769,6 +1729,7 @@ export default {
if
(
!
params
.
sn
)
{
delete
params
.
sn
}
params
.
dataSource
=
this
.
editForm
.
dataSource
||
''
this
.
$apis
.
beforeSale
.
updateEquityApi
(
params
).
then
(
res
=>
{
this
.
submit
=
false
...
...
@@ -1840,6 +1801,7 @@ export default {
return
true
}
var
params
=
this
.
getParams
()
delete
params
.
attributes
params
.
operationType
=
1
if
([
2
,
3
,
4
].
includes
(
this
.
routeInfo
.
addOrEdit
))
{
if
(
this
.
routeInfo
.
addOrEdit
==
4
&&
this
.
editForm
.
orderStatus
!=
3
)
{
...
...
@@ -1911,7 +1873,6 @@ export default {
crash
:
{},
stolen
:
{},
tire
:
{},
vip
:
{},
glass
:
{}
}
this
.
customProductList
=
[]
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment