Commit e20ad8f9 by 前端

Merge branch 'zq_feat_v2.3.2' into 'master'

Zq feat v2.3.2

See merge request !11
2 parents 8548db03 ff6b4329
...@@ -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') {
......
...@@ -228,7 +228,10 @@ export default { ...@@ -228,7 +228,10 @@ export default {
size: 'small', size: 'small',
submit: false, submit: false,
isBlock: true, isBlock: true,
serviceObj: {
PC0005: '',
PC0007: ''
},
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editCarChildRef: 'editChildRef', editCarChildRef: 'editChildRef',
...@@ -389,13 +392,15 @@ export default { ...@@ -389,13 +392,15 @@ export default {
{ {
required: true, required: true,
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
return value ? callback() : callback(new Error('请输入' + (this.editForm.cardType == '1' ? '身份证' : '统一社会信息代码'))) return value ? callback() : callback(new Error('请输入证件号码'))
}, },
trigger: 'change' trigger: 'change'
}, },
{ {
validator: (rule, value, callback) => { 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' trigger: 'change'
} }
...@@ -426,6 +431,7 @@ export default { ...@@ -426,6 +431,7 @@ export default {
this.editForm.cardType = value this.editForm.cardType = value
var idx = this.editFormDataUser.findIndex(item => item.name == 'cardNo') var idx = this.editFormDataUser.findIndex(item => item.name == 'cardNo')
this.editFormDataUser[idx].label = this.baseData.cardTypeList.find(item => item.confId == value).confName this.editFormDataUser[idx].label = this.baseData.cardTypeList.find(item => item.confId == value).confName
this.$refs.editFormRefUser.$refs.editChildRefUser.validateField('cardNo')
} }
}, },
{ {
...@@ -607,6 +613,10 @@ export default { ...@@ -607,6 +613,10 @@ export default {
{ {
confId: 5, confId: 5,
confName: '个人(军官)' confName: '个人(军官)'
},
{
confId: 7,
confName: '外国人'
} }
], ],
cardTypeList: [ cardTypeList: [
...@@ -629,6 +639,10 @@ export default { ...@@ -629,6 +639,10 @@ export default {
{ {
confId: 5, confId: 5,
confName: '军官证' confName: '军官证'
},
{
confId: 7,
confName: '护照'
} }
], ],
servicePeriodList: [ servicePeriodList: [
...@@ -768,7 +782,47 @@ export default { ...@@ -768,7 +782,47 @@ 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) {
let tip = false
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年' })
// }
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 + ''])
}
}
}
})
})
}
})
}
if (tip) {
this.productModal[pack.idName]['service_period'] = ''
this.$message.error('该卡号服务年限暂未配置,请联系运营平台人员')
} else {
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') {
this.commonPart(res.servicePeriod, pack, el) this.commonPart(res.servicePeriod, pack, el)
...@@ -776,6 +830,7 @@ export default { ...@@ -776,6 +830,7 @@ export default {
return el return el
} }
}) })
}
}) })
}, },
// 切换套餐---赋默认值 // 切换套餐---赋默认值
...@@ -1047,13 +1102,27 @@ export default { ...@@ -1047,13 +1102,27 @@ 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 == '服务期限') {
e.optionList = this.baseData.servicePeriodList 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) {
arr.push(serviceArr2)
}
e.optionList = [...arr]
this.serviceObj[item.packageCode] = item.servicePeriod
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
this.productModal[item.idName][e.attributeName] = '0' this.productModal[item.idName][e.attributeName] = '0'
} else if ((item.idName == 'tire' || item.idName == 'crash' || item.idName == 'vip') && e.attributeDesc == '服务期限') { } else if ((item.idName == 'tire' || item.idName == 'crash' || item.idName == 'vip') && e.attributeDesc == '服务期限') {
if (item.idName == 'tire' || item.idName == 'crash') {
e.optionList = this.baseData.servicePeriodList
} else {
e.optionList = this.baseData.servicePeriodList2 e.optionList = this.baseData.servicePeriodList2
}
this.productModal[item.idName][e.attributeName] = '1' this.productModal[item.idName][e.attributeName] = '1'
e.disabled = true e.disabled = true
} else if (e.attributeDesc == '生效日期') { } else if (e.attributeDesc == '生效日期') {
...@@ -1166,8 +1235,8 @@ export default { ...@@ -1166,8 +1235,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,15 @@ ...@@ -26,6 +26,15 @@
<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> -->
<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>
<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 +46,15 @@ ...@@ -37,6 +46,15 @@
<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> -->
<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>
<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 +130,8 @@ export default { ...@@ -112,6 +130,8 @@ export default {
name: '', name: '',
data() { data() {
return { return {
robberyServerList:[],
vehicleServerList:[],
configTitle:'', configTitle:'',
selectedTable: false, selectedTable: false,
tableData: [], tableData: [],
...@@ -214,6 +234,11 @@ export default { ...@@ -214,6 +234,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 +308,12 @@ export default { ...@@ -283,6 +308,12 @@ export default {
if (arrs[i].cardName == 'card') { if (arrs[i].cardName == 'card') {
this.againstTheft = ['盗抢卡输入'] this.againstTheft = ['盗抢卡输入']
} }
if(arrs[i].servicePeriod.indexOf('4')>-1){
this.robberyServerList.push('4')
}
if(arrs[i].servicePeriod.indexOf('5')>-1){
this.robberyServerList.push('5')
}
} }
if (arrs[i].packageCode == 'PC0007') { if (arrs[i].packageCode == 'PC0007') {
this.vehicleAll = true this.vehicleAll = true
...@@ -290,7 +321,12 @@ export default { ...@@ -290,7 +321,12 @@ 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('4')>-1){
this.vehicleServerList.push('4')
}
if(arrs[i].servicePeriod.indexOf('5')>-1){
this.vehicleServerList.push('5')
}
} }
if (arrs[i].packageCode == 'PC0006') { if (arrs[i].packageCode == 'PC0006') {
this.tyreAll = true this.tyreAll = true
...@@ -319,6 +355,8 @@ export default { ...@@ -319,6 +355,8 @@ export default {
}) })
}, },
onSubmit() { onSubmit() {
// robberyServerList:[],
// vehicleServerList:[],
// 判断组装params // 判断组装params
let params = [] let params = []
if (this.theftAll == true) { if (this.theftAll == true) {
...@@ -327,6 +365,7 @@ export default { ...@@ -327,6 +365,7 @@ export default {
if (this.againstTheft.length > 0) { if (this.againstTheft.length > 0) {
theftObj.cardName = 'card' theftObj.cardName = 'card'
} }
theftObj.servicePeriod = `1,2,3${this.robberyServerList.length? ','+ this.robberyServerList.join(','):''}`
params.push(theftObj) params.push(theftObj)
console.log(params, 'params') console.log(params, 'params')
} }
...@@ -337,6 +376,7 @@ export default { ...@@ -337,6 +376,7 @@ export default {
vehicleObj.cardName = 'card' vehicleObj.cardName = 'card'
} }
vehicleObj.templateFlag = +this.vehicleRadio vehicleObj.templateFlag = +this.vehicleRadio
vehicleObj.servicePeriod = `1,2,3${this.vehicleServerList.length? ','+ this.vehicleServerList.join(','):''}`
params.push(vehicleObj) params.push(vehicleObj)
} }
if (this.tyreAll == true) { if (this.tyreAll == true) {
...@@ -345,6 +385,7 @@ export default { ...@@ -345,6 +385,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 +395,25 @@ export default { ...@@ -354,21 +395,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 = {
...@@ -427,11 +472,17 @@ export default { ...@@ -427,11 +472,17 @@ export default {
if (this.vehicleAll == false) { if (this.vehicleAll == false) {
this.againstVehicle = [] this.againstVehicle = []
this.vehicleRadio = '' this.vehicleRadio = ''
this.vehicleServerList=[]
} else { } else {
this.againstVehicle = ['模板一新版'] this.againstVehicle = ['模板一新版']
this.vehicleRadio = '1' this.vehicleRadio = '1'
} }
}, },
changeVehicle(){
if(this.vehicleServerList.length>0){
this.vehicleAll = true
}
},
changeAgainstVehicle() { changeAgainstVehicle() {
if (this.againstVehicle.length > 0) { if (this.againstVehicle.length > 0) {
this.vehicleAll = true this.vehicleAll = true
...@@ -447,6 +498,12 @@ export default { ...@@ -447,6 +498,12 @@ export default {
handleTheftAllChange() { handleTheftAllChange() {
if (this.theftAll == false) { if (this.theftAll == false) {
this.againstTheft = [] this.againstTheft = []
this.robberyServerList= []
}
},
changeRobbery(){
if(this.robberyServerList.length>0){
this.theftAll = true
} }
}, },
handleTyreAllChange() { handleTyreAllChange() {
...@@ -590,7 +647,7 @@ export default { ...@@ -590,7 +647,7 @@ export default {
} }
} }
.special-config{ .special-config {
margin-bottom: 0!important; margin-bottom: 0 !important;
} }
</style> </style>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,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="detailDialogForm.packageCode" placeholder="请选择" size="small"> <el-select @change="changePgCode" v-model="detailDialogForm.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>
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
function date_format(date) { function date_format(date) {
var date2 = new Date(date) var date2 = new Date(date)
var YY = date2.getFullYear() + '-' var YY = date2.getFullYear() + '-'
...@@ -203,6 +203,14 @@ export default { ...@@ -203,6 +203,14 @@ export default {
{ {
value: '3', value: '3',
label: '3年' label: '3年'
},
{
value: '4',
label: '4年'
},
{
value: '5',
label: '5年'
} }
], ],
dialogEditOptions: [ dialogEditOptions: [
...@@ -330,6 +338,32 @@ export default { ...@@ -330,6 +338,32 @@ export default {
this.getTotal() this.getTotal()
}, },
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]
}
},
check() { check() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
var reg = /^[+]{0,1}(\d+)$/g var reg = /^[+]{0,1}(\d+)$/g
...@@ -354,19 +388,29 @@ export default { ...@@ -354,19 +388,29 @@ export default {
// 详情table搜索 // 详情table搜索
detailSelect(e) { detailSelect(e) {
if (e == 'reset') { if (e == 'reset') {
this.detailForm = {} this.detailForm = {
seqNo: '',
batchType: '',
packageCode: '',
servicePeriod: '',
actualPrice: '',
status: ''
}
// this.detailForm = {}
this.$refs.detailTable.refreshTable() this.$refs.detailTable.refreshTable()
this.detailForm.batchType = '' // this.detailForm.batchType = ''
this.detailForm.packageCode = '' // this.detailForm.packageCode = ''
this.detailForm.status = '' // this.detailForm.status = ''
this.detailForm.servicePeriod = '' // this.detailForm.servicePeriod = ''
} else if (e == 'select') { } else if (e == 'select') {
this.$refs.detailTable.refreshTable() this.$refs.detailTable.refreshTable()
} }
}, },
modify(e) { modify(e) {
this.changePgCode(e.packageCode)
let obj = JSON.parse(JSON.stringify(e)) let obj = JSON.parse(JSON.stringify(e))
this.detailDialog = true this.detailDialog = true
obj.servicePeriod = obj.servicePeriod +''
this.detailDialogForm = obj this.detailDialogForm = obj
if (obj.batchType == '1') { if (obj.batchType == '1') {
this.detailDialogForm.batchType = '尊享版' this.detailDialogForm.batchType = '尊享版'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!