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,14 +782,55 @@ export default { ...@@ -768,14 +782,55 @@ export default {
// 卡号获取期限 // 卡号获取期限
getDateList(seqNo, pack, attr) { getDateList(seqNo, pack, attr) {
this.$apis.beforeSale.dateBycarNo({ seqNo }).then(res => { this.$apis.beforeSale.dateBycarNo({ seqNo }).then(res => {
this.productModal[pack.idName]['service_period'] = `${res.servicePeriod}` if (res != null) {
pack.groupAttributeList.map(el => { let tip = false
if (el.attributeName == 'service_period') { if (pack.packageCode == 'PC0007' || pack.packageCode == 'PC0005') {
this.commonPart(res.servicePeriod, pack, el) this.productList.map(el => {
el.disabled = true if (el.packageCode == pack.packageCode) {
return el 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}`
}
pack.groupAttributeList.map(el => {
if (el.attributeName == 'service_period') {
this.commonPart(res.servicePeriod, pack, el)
el.disabled = true
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 == '服务期限') {
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' 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)
}) })
}, },
......
...@@ -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 = '尊享版'
...@@ -500,4 +544,4 @@ export default { ...@@ -500,4 +544,4 @@ export default {
/deep/ .el-pagination { /deep/ .el-pagination {
margin-top: 20px; margin-top: 20px;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!