Commit 3f4072c3 by 张权

数据迁移优化

1 parent fe480935
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="适用类型:" prop="packageCode"> <el-form-item label="适用类型:" prop="packageCode">
<el-select v-model="addDialogForm.packageCode" placeholder="请选择" size="small"> <el-select @change="changePgCode" v-model="addDialogForm.packageCode" placeholder="请选择" size="small">
<el-option v-for="(item, index) in dialogTypeOptions" :key="index" :label="item.label" :value="item.value"></el-option> <el-option v-for="(item, index) in dialogTypeOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -194,9 +194,34 @@ export default { ...@@ -194,9 +194,34 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
changePgCode(e){
let arr = [ {
value: '1',
label: '1年'
},
{
value: '2',
label: '2年'
},
{
value: '3',
label: '3年'
}]
if(e=='PC0005' || e=='PC0007'){
this.dialogYearOptions = [ ...arr, {
value: '4',
label: '4年'
},
{
value: '5',
label: '5年'
}]
}else{
this.dialogYearOptions = [...arr]
}
},
//批量下载 //批量下载
download(e) { download(e) {
console.log(e, '111111111111')
this.$apis.addWorryFree.downLoads({ id: e.id }).then(res => { this.$apis.addWorryFree.downLoads({ id: e.id }).then(res => {
let tempaa = utils.getExplorer() let tempaa = utils.getExplorer()
if (tempaa == 'QQ') { if (tempaa == 'QQ') {
......
...@@ -607,6 +607,10 @@ export default { ...@@ -607,6 +607,10 @@ export default {
{ {
confId: 5, confId: 5,
confName: '个人(军官)' confName: '个人(军官)'
},
{
confId: 7,
confName: '外国人'
} }
], ],
cardTypeList: [ cardTypeList: [
...@@ -629,6 +633,10 @@ export default { ...@@ -629,6 +633,10 @@ export default {
{ {
confId: 5, confId: 5,
confName: '军官证' confName: '军官证'
},
{
confId: 7,
confName: '护照'
} }
], ],
servicePeriodList: [ servicePeriodList: [
...@@ -768,6 +776,25 @@ export default { ...@@ -768,6 +776,25 @@ export default {
// 卡号获取期限 // 卡号获取期限
getDateList(seqNo, pack, attr) { getDateList(seqNo, pack, attr) {
this.$apis.beforeSale.dateBycarNo({ seqNo }).then(res => { this.$apis.beforeSale.dateBycarNo({ seqNo }).then(res => {
if (res != null) {
if (pack.packageCode == 'PC0007' || pack.packageCode == 'PC0005') {
this.productList.map(el => {
if (el.packageCode == pack.packageCode) {
el.groupAttributeList.map(ele => {
ele.attributeList.map(item => {
if (item.attributeDesc == '服务期限') {
if (item?.optionList?.length < 4) {
item.optionList.push({ value: '4', label: '4年' })
item.optionList.push({ value: '5', label: '5年' })
} else if (item?.optionList?.length == 4) {
item.optionList.push({ value: '5', label: '5年' })
}
}
})
})
}
})
}
this.productModal[pack.idName]['service_period'] = `${res.servicePeriod}` this.productModal[pack.idName]['service_period'] = `${res.servicePeriod}`
pack.groupAttributeList.map(el => { pack.groupAttributeList.map(el => {
if (el.attributeName == 'service_period') { if (el.attributeName == 'service_period') {
...@@ -776,6 +803,7 @@ export default { ...@@ -776,6 +803,7 @@ export default {
return el return el
} }
}) })
}
}) })
}, },
// 切换套餐---赋默认值 // 切换套餐---赋默认值
...@@ -1047,7 +1075,15 @@ export default { ...@@ -1047,7 +1075,15 @@ export default {
item.groupAttributeList.map(ele => { item.groupAttributeList.map(ele => {
ele.attributeList.map(e => { ele.attributeList.map(e => {
if ((item.idName == 'stolen' || item.idName == 'car') && e.attributeDesc == '服务期限') { if ((item.idName == 'stolen' || item.idName == 'car') && e.attributeDesc == '服务期限') {
let serviceArr1 = { value: '4', label: '4年' }
let serviceArr2 = { value: '5', label: '5年' }
if (item.servicePeriod && item.servicePeriod.indexOf('5') > -1) {
e.optionList = [...this.baseData.servicePeriodList, serviceArr1, serviceArr2]
} else if (item.servicePeriod && item.servicePeriod.indexOf('4') > -1) {
e.optionList = [...this.baseData.servicePeriodList, serviceArr1]
} else {
e.optionList = this.baseData.servicePeriodList e.optionList = this.baseData.servicePeriodList
}
this.productModal[item.idName][e.attributeName] = '1' this.productModal[item.idName][e.attributeName] = '1'
} else if (e.attributeDesc == '购车类型') { } else if (e.attributeDesc == '购车类型') {
e.optionList = this.baseData.buyCarTypeList e.optionList = this.baseData.buyCarTypeList
...@@ -1166,8 +1202,8 @@ export default { ...@@ -1166,8 +1202,8 @@ export default {
}) })
}, },
getPackageList() { getPackageList() {
let contractNo = this.routeInfo.contractNo==-1? '': this.routeInfo.contractNo let contractNo = this.routeInfo.contractNo == -1 ? '' : this.routeInfo.contractNo
this.$apis.beforeSale.getPackageListApi({contractNo}).then(res => { this.$apis.beforeSale.getPackageListApi({ contractNo }).then(res => {
this.toTestProductData(res) this.toTestProductData(res)
}) })
}, },
......
<template> <template>
<div class="equity-wrap container"> <div class="equity-wrap container">
<div class="equity-wrap contain" style="padding: 0; margin-bottom: 0"> <div class="equity-wrap contain" style="padding: 0; margin-bottom: 0">
<div class="top">{{configTitle}}配置</div> <div class="top">{{ configTitle }}配置</div>
</div> </div>
<div class="equity-wrap contain" style="padding-left: 72px"> <div class="equity-wrap contain" style="padding-left: 72px">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="left" size="medium" class="detailForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="left" size="medium" class="detailForm">
...@@ -26,6 +26,11 @@ ...@@ -26,6 +26,11 @@
<el-checkbox-group v-model="againstTheft" @change="handleCheckedTheftsChange"> <el-checkbox-group v-model="againstTheft" @change="handleCheckedTheftsChange">
<el-checkbox v-for="theft in thefts" :label="theft" :key="theft">{{ theft }}</el-checkbox> <el-checkbox v-for="theft in thefts" :label="theft" :key="theft">{{ theft }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<div>服务期限</div>
<div style="margin-left: 20px;">
<el-checkbox @change="setLimitTime('robberyServer', 'fiveYear', $event)" v-model="robberyServer.fourYear">4年</el-checkbox>
<el-checkbox @change="setLimitTime('robberyServer', 'fourYear', $event)" v-model="robberyServer.fiveYear">5年</el-checkbox>
</div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-checkbox v-model="vehicleAll" @change="changeVehicleAll">整车全损无忧</el-checkbox> <el-checkbox v-model="vehicleAll" @change="changeVehicleAll">整车全损无忧</el-checkbox>
...@@ -37,6 +42,11 @@ ...@@ -37,6 +42,11 @@
<el-radio label="1">模板一新版</el-radio> <el-radio label="1">模板一新版</el-radio>
<el-radio label="2">模板二旧版</el-radio> <el-radio label="2">模板二旧版</el-radio>
</el-radio-group> </el-radio-group>
<div>服务期限</div>
<div style="margin-left: 20px;">
<el-checkbox @change="setLimitTime('vehicleServer', 'fiveYear', $event)" v-model="vehicleServer.fourYear">4年</el-checkbox>
<el-checkbox @change="setLimitTime('vehicleServer', 'fourYear', $event)" v-model="vehicleServer.fiveYear">5年</el-checkbox>
</div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-checkbox v-model="tyreAll" @change="handleTyreAllChange">轮胎无忧</el-checkbox> <el-checkbox v-model="tyreAll" @change="handleTyreAllChange">轮胎无忧</el-checkbox>
...@@ -112,6 +122,14 @@ export default { ...@@ -112,6 +122,14 @@ export default {
name: '', name: '',
data() { data() {
return { return {
robberyServer:{
fourYear:false,
fiveYear:false,
},
vehicleServer:{
fourYear:false,
fiveYear:false,
},
configTitle:'', configTitle:'',
selectedTable: false, selectedTable: false,
tableData: [], tableData: [],
...@@ -214,6 +232,11 @@ export default { ...@@ -214,6 +232,11 @@ export default {
// this.showGh = false // this.showGh = false
// } // }
}, },
setLimitTime(name,str,e){
if(this[name][str] && e){
this[name][str] = false
}
},
handleRelateStoreClose() { handleRelateStoreClose() {
this.relateStoreVisible = false this.relateStoreVisible = false
}, },
...@@ -283,6 +306,11 @@ export default { ...@@ -283,6 +306,11 @@ export default {
if (arrs[i].cardName == 'card') { if (arrs[i].cardName == 'card') {
this.againstTheft = ['盗抢卡输入'] this.againstTheft = ['盗抢卡输入']
} }
if(arrs[i].servicePeriod.indexOf('5')>-1){
this.robberyServer.fiveYear = true
}else if(arrs[i].servicePeriod.indexOf('4')>-1){
this.robberyServer.fourYear = true
}
} }
if (arrs[i].packageCode == 'PC0007') { if (arrs[i].packageCode == 'PC0007') {
this.vehicleAll = true this.vehicleAll = true
...@@ -290,7 +318,11 @@ export default { ...@@ -290,7 +318,11 @@ export default {
this.againstVehicle = ['全损卡输入'] this.againstVehicle = ['全损卡输入']
} }
this.vehicleRadio = arrs[i].templateFlag + '' this.vehicleRadio = arrs[i].templateFlag + ''
console.log(this.vehicleRadio, 'vehicleradio') if(arrs[i].servicePeriod.indexOf('5')>-1){
this.vehicleServer.fiveYear = true
}else if(arrs[i].servicePeriod.indexOf('4')>-1){
this.vehicleServer.fourYear = true
}
} }
if (arrs[i].packageCode == 'PC0006') { if (arrs[i].packageCode == 'PC0006') {
this.tyreAll = true this.tyreAll = true
...@@ -318,6 +350,17 @@ export default { ...@@ -318,6 +350,17 @@ export default {
} }
}) })
}, },
getServerTime(obj){
let {fourYear,fiveYear} = obj
let str = '1,2,3'
if(fourYear){
str = '1,2,3,4'
}
if(fiveYear) {
str = '1,2,3,4,5'
}
return str
},
onSubmit() { onSubmit() {
// 判断组装params // 判断组装params
let params = [] let params = []
...@@ -327,6 +370,7 @@ export default { ...@@ -327,6 +370,7 @@ export default {
if (this.againstTheft.length > 0) { if (this.againstTheft.length > 0) {
theftObj.cardName = 'card' theftObj.cardName = 'card'
} }
theftObj.servicePeriod = this.getServerTime(this.robberyServer)
params.push(theftObj) params.push(theftObj)
console.log(params, 'params') console.log(params, 'params')
} }
...@@ -337,6 +381,7 @@ export default { ...@@ -337,6 +381,7 @@ export default {
vehicleObj.cardName = 'card' vehicleObj.cardName = 'card'
} }
vehicleObj.templateFlag = +this.vehicleRadio vehicleObj.templateFlag = +this.vehicleRadio
vehicleObj.servicePeriod = this.getServerTime(this.vehicleServer)
params.push(vehicleObj) params.push(vehicleObj)
} }
if (this.tyreAll == true) { if (this.tyreAll == true) {
...@@ -345,6 +390,7 @@ export default { ...@@ -345,6 +390,7 @@ export default {
if (this.againstTyre.length > 0) { if (this.againstTyre.length > 0) {
tyreObj.cardName = 'card' tyreObj.cardName = 'card'
} }
tyreObj.servicePeriod = '1'
params.push(tyreObj) params.push(tyreObj)
} }
if (this.collisionAll == true) { if (this.collisionAll == true) {
...@@ -354,21 +400,25 @@ export default { ...@@ -354,21 +400,25 @@ export default {
collisionObj.cardName = 'card' collisionObj.cardName = 'card'
} }
collisionObj.planId = +this.collisionRadio collisionObj.planId = +this.collisionRadio
collisionObj.servicePeriod = '1'
params.push(collisionObj) params.push(collisionObj)
} }
if (this.honorable == true) { if (this.honorable == true) {
let honorableObj = {} let honorableObj = {}
honorableObj.packageCode = 'PC0009' honorableObj.packageCode = 'PC0009'
honorableObj.servicePeriod = '1'
params.push(honorableObj) params.push(honorableObj)
} }
if (this.carefree == true) { if (this.carefree == true) {
let carefreeObj = {} let carefreeObj = {}
carefreeObj.packageCode = 'PC0011' carefreeObj.packageCode = 'PC0011'
carefreeObj.servicePeriod = '1'
params.push(carefreeObj) params.push(carefreeObj)
} }
if (this.first == true) { if (this.first == true) {
let firstObj = {} let firstObj = {}
firstObj.packageCode = 'PC0010' firstObj.packageCode = 'PC0010'
firstObj.servicePeriod = '1'
params.push(firstObj) params.push(firstObj)
} }
let targetParams = { let targetParams = {
...@@ -590,7 +640,7 @@ export default { ...@@ -590,7 +640,7 @@ export default {
} }
} }
.special-config{ .special-config {
margin-bottom: 0!important; margin-bottom: 0 !important;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!