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 @@
</el-row>
<el-row>
<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-select>
</el-form-item>
......@@ -194,9 +194,34 @@ export default {
},
mounted() {},
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) {
console.log(e, '111111111111')
this.$apis.addWorryFree.downLoads({ id: e.id }).then(res => {
let tempaa = utils.getExplorer()
if (tempaa == 'QQ') {
......
......@@ -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')
}
},
{
......@@ -607,6 +613,10 @@ export default {
{
confId: 5,
confName: '个人(军官)'
},
{
confId: 7,
confName: '外国人'
}
],
cardTypeList: [
......@@ -629,6 +639,10 @@ export default {
{
confId: 5,
confName: '军官证'
},
{
confId: 7,
confName: '护照'
}
],
servicePeriodList: [
......@@ -768,14 +782,55 @@ export default {
// 卡号获取期限
getDateList(seqNo, pack, attr) {
this.$apis.beforeSale.dateBycarNo({ seqNo }).then(res => {
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
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}`
}
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 {
item.groupAttributeList.map(ele => {
ele.attributeList.map(e => {
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'
} 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 == '生效日期') {
......@@ -1166,8 +1235,8 @@ export default {
})
},
getPackageList() {
let contractNo = this.routeInfo.contractNo==-1? '': this.routeInfo.contractNo
this.$apis.beforeSale.getPackageListApi({contractNo}).then(res => {
let contractNo = this.routeInfo.contractNo == -1 ? '' : this.routeInfo.contractNo
this.$apis.beforeSale.getPackageListApi({ contractNo }).then(res => {
this.toTestProductData(res)
})
},
......
......@@ -57,7 +57,7 @@
</el-row>
<el-row>
<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-select>
</el-form-item>
......@@ -84,7 +84,7 @@
</div>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
function date_format(date) {
var date2 = new Date(date)
var YY = date2.getFullYear() + '-'
......@@ -203,6 +203,14 @@ export default {
{
value: '3',
label: '3年'
},
{
value: '4',
label: '4年'
},
{
value: '5',
label: '5年'
}
],
dialogEditOptions: [
......@@ -330,6 +338,32 @@ export default {
this.getTotal()
},
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() {
return new Promise((resolve, reject) => {
var reg = /^[+]{0,1}(\d+)$/g
......@@ -354,19 +388,29 @@ export default {
// 详情table搜索
detailSelect(e) {
if (e == 'reset') {
this.detailForm = {}
this.detailForm = {
seqNo: '',
batchType: '',
packageCode: '',
servicePeriod: '',
actualPrice: '',
status: ''
}
// this.detailForm = {}
this.$refs.detailTable.refreshTable()
this.detailForm.batchType = ''
this.detailForm.packageCode = ''
this.detailForm.status = ''
this.detailForm.servicePeriod = ''
// this.detailForm.batchType = ''
// this.detailForm.packageCode = ''
// this.detailForm.status = ''
// this.detailForm.servicePeriod = ''
} else if (e == 'select') {
this.$refs.detailTable.refreshTable()
}
},
modify(e) {
this.changePgCode(e.packageCode)
let obj = JSON.parse(JSON.stringify(e))
this.detailDialog = true
obj.servicePeriod = obj.servicePeriod +''
this.detailDialogForm = obj
if (obj.batchType == '1') {
this.detailDialogForm.batchType = '尊享版'
......@@ -500,4 +544,4 @@ export default {
/deep/ .el-pagination {
margin-top: 20px;
}
</style>
\ 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!