Commit a3dc1e00 by 张权

数据迁移第一轮bug修复

1 parent 961b1abd
......@@ -228,7 +228,10 @@ export default {
size: 'small',
submit: false,
isBlock: true,
serviceObj: {
PC0005: '',
PC0007: ''
},
footerLeft: '0',
footerWidth: '0',
editCarChildRef: 'editChildRef',
......@@ -389,13 +392,15 @@ export default {
{
required: true,
validator: (rule, value, callback) => {
return value ? callback() : callback(new Error('请输入' + (this.editForm.cardType == '1' ? '身份证' : '统一社会信息代码')))
return value ? callback() : callback(new Error('请输入证件号码'))
},
trigger: 'change'
},
{
validator: (rule, value, callback) => {
return /[a-zA-Z0-9]{18}/.test(value) ? callback() : callback(new Error('请输入18位数字或字母'))
let reg = this.editForm.cardType == 1 || this.editForm.cardType == 2 ? /[a-zA-Z0-9]{18}/.test(value) : /\S\s{0,18}/.test(value)
let tip = this.editForm.cardType == 1 || this.editForm.cardType == 2 ? '请输入18位数字或字母' : '请输入证件号码'
return reg ? callback() : callback(new Error(tip))
},
trigger: 'change'
}
......@@ -426,6 +431,7 @@ export default {
this.editForm.cardType = value
var idx = this.editFormDataUser.findIndex(item => item.name == 'cardNo')
this.editFormDataUser[idx].label = this.baseData.cardTypeList.find(item => item.confId == value).confName
this.$refs.editFormRefUser.$refs.editChildRefUser.validateField('cardNo')
}
},
{
......@@ -790,13 +796,21 @@ export default {
// } else if (item?.optionList?.length == 4) {
// item.optionList.push({ value: '5', label: '5年' })
// }
const Target = item.optionList.find(item => {
return item.value == `${res.servicePeriod}`
})
if (!Target) {
tip = true
let optionObj = {
'4': { value: '4', label: '4年' },
'5': { value: '5', label: '5年' }
}
if (res.servicePeriod == '4' || res.servicePeriod == '5') {
const Target = item.optionList.find(item => {
return item.value == `${res.servicePeriod}`
})
if (this.serviceObj[el.packageCode].indexOf(res.servicePeriod) == -1) {
tip = true
}
if (!Target) {
item.optionList.push(optionObj[res.servicePeriod + ''])
}
}
console.log(Target, 78978979)
}
})
})
......@@ -805,9 +819,10 @@ export default {
}
if (tip) {
this.productModal[pack.idName]['service_period'] = ''
return this.$message.error('该卡号服务年限暂未配置,请联系运营平台人员')
this.$message.error('该卡号服务年限暂未配置,请联系运营平台人员')
} else {
this.productModal[pack.idName]['service_period'] = `${res.servicePeriod}`
}
this.productModal[pack.idName]['service_period'] = `${res.servicePeriod}`
pack.groupAttributeList.map(el => {
if (el.attributeName == 'service_period') {
this.commonPart(res.servicePeriod, pack, el)
......@@ -1089,19 +1104,25 @@ export default {
if ((item.idName == 'stolen' || item.idName == 'car') && e.attributeDesc == '服务期限') {
let serviceArr1 = { value: '4', label: '4年' }
let serviceArr2 = { value: '5', label: '5年' }
let arr = [...this.baseData.servicePeriodList]
if (item.servicePeriod && item.servicePeriod.indexOf('4') > -1) {
arr.push(serviceArr1)
}
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
arr.push(serviceArr2)
}
e.optionList = [...arr]
this.serviceObj[item.packageCode] = item.servicePeriod
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') && e.attributeDesc == '服务期限') {
e.optionList = this.baseData.servicePeriodList2
if (item.idName == 'tire' || item.idName == 'crash') {
e.optionList = this.baseData.servicePeriodList
} else {
e.optionList = this.baseData.servicePeriodList2
}
this.productModal[item.idName][e.attributeName] = '1'
e.disabled = true
} else if (e.attributeDesc == '生效日期') {
......
......@@ -28,8 +28,12 @@
</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>
<!-- <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> -->
<el-checkbox-group v-model="robberyServerList" @change="changeRobbery">
<el-checkbox label="4">4年</el-checkbox>
<el-checkbox label="5">5年</el-checkbox>
</el-checkbox-group>
</div>
</el-form-item>
<el-form-item>
......@@ -44,8 +48,12 @@
</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>
<!-- <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> -->
<el-checkbox-group @change="changeVehicle" v-model="vehicleServerList">
<el-checkbox label="4">4年</el-checkbox>
<el-checkbox label="5">5年</el-checkbox>
</el-checkbox-group>
</div>
</el-form-item>
<el-form-item>
......@@ -122,14 +130,8 @@ export default {
name: '',
data() {
return {
robberyServer:{
fourYear:false,
fiveYear:false,
},
vehicleServer:{
fourYear:false,
fiveYear:false,
},
robberyServerList:[],
vehicleServerList:[],
configTitle:'',
selectedTable: false,
tableData: [],
......@@ -306,10 +308,11 @@ export default {
if (arrs[i].cardName == 'card') {
this.againstTheft = ['盗抢卡输入']
}
if(arrs[i].servicePeriod.indexOf('4')>-1){
this.robberyServerList.push('4')
}
if(arrs[i].servicePeriod.indexOf('5')>-1){
this.robberyServer.fiveYear = true
}else if(arrs[i].servicePeriod.indexOf('4')>-1){
this.robberyServer.fourYear = true
this.robberyServerList.push('5')
}
}
if (arrs[i].packageCode == 'PC0007') {
......@@ -318,10 +321,11 @@ export default {
this.againstVehicle = ['全损卡输入']
}
this.vehicleRadio = arrs[i].templateFlag + ''
if(arrs[i].servicePeriod.indexOf('4')>-1){
this.vehicleServerList.push('4')
}
if(arrs[i].servicePeriod.indexOf('5')>-1){
this.vehicleServer.fiveYear = true
}else if(arrs[i].servicePeriod.indexOf('4')>-1){
this.vehicleServer.fourYear = true
this.vehicleServerList.push('5')
}
}
if (arrs[i].packageCode == 'PC0006') {
......@@ -350,18 +354,9 @@ 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() {
// robberyServerList:[],
// vehicleServerList:[],
// 判断组装params
let params = []
if (this.theftAll == true) {
......@@ -370,7 +365,7 @@ export default {
if (this.againstTheft.length > 0) {
theftObj.cardName = 'card'
}
theftObj.servicePeriod = this.getServerTime(this.robberyServer)
theftObj.servicePeriod = `1,2,3${this.robberyServerList.length? ','+ this.robberyServerList.join(','):''}`
params.push(theftObj)
console.log(params, 'params')
}
......@@ -381,7 +376,7 @@ export default {
vehicleObj.cardName = 'card'
}
vehicleObj.templateFlag = +this.vehicleRadio
vehicleObj.servicePeriod = this.getServerTime(this.vehicleServer)
vehicleObj.servicePeriod = `1,2,3${this.vehicleServerList.length? ','+ this.vehicleServerList.join(','):''}`
params.push(vehicleObj)
}
if (this.tyreAll == true) {
......@@ -477,11 +472,17 @@ export default {
if (this.vehicleAll == false) {
this.againstVehicle = []
this.vehicleRadio = ''
this.vehicleServerList=[]
} else {
this.againstVehicle = ['模板一新版']
this.vehicleRadio = '1'
}
},
changeVehicle(){
if(this.vehicleServerList.length>0){
this.vehicleAll = true
}
},
changeAgainstVehicle() {
if (this.againstVehicle.length > 0) {
this.vehicleAll = true
......@@ -497,6 +498,12 @@ export default {
handleTheftAllChange() {
if (this.theftAll == false) {
this.againstTheft = []
this.robberyServerList= []
}
},
changeRobbery(){
if(this.robberyServerList.length>0){
this.theftAll = true
}
},
handleTyreAllChange() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!