Commit 6dacf546 by 张权

校验证件号与等待五秒跳转

1 parent 78a6b119
...@@ -185,6 +185,9 @@ export default { ...@@ -185,6 +185,9 @@ export default {
item.attContent = JSON.stringify(item.attContent) item.attContent = JSON.stringify(item.attContent)
} }
}) })
preList= preList.filter(item=>{
return item.attType !=1 || item.attContent.trim()
})
const targetItem = this.numberTypeList.find(item => { const targetItem = this.numberTypeList.find(item => {
return item.dictLabel == this.clientType return item.dictLabel == this.clientType
}) })
......
...@@ -33,13 +33,11 @@ ...@@ -33,13 +33,11 @@
<span slot="status" slot-scope="scope"> <span slot="status" slot-scope="scope">
<!-- <el-switch :value="scope.scope.status == 0" active-color="#5850ff" inactive-color="#eee" @change="changStatus(scope.scope.status, scope.scope.id)"></el-switch> <!-- <el-switch :value="scope.scope.status == 0" active-color="#5850ff" inactive-color="#eee" @change="changStatus(scope.scope.status, scope.scope.id)"></el-switch>
{{ scope.scope.status == 0 ? '启用' : '停用' }} --> {{ scope.scope.status == 0 ? '启用' : '停用' }} -->
<GLButton class="switch" mode="el-switch" fn="禁用" :value="scope.scope.status == 0" active-color="#5850ff" inactive-color="#eee" :active-text="scope.scope.status == 0 ? '启用' : '停用'" @change="changStatus(scope.scope.status, scope.scope.id)">{{ scope.scope.status == 0 ? '启用' : '停用' }}</GLButton> <GLButton v-if="userType != 2" class="switch" mode="el-switch" fn="禁用" :value="scope.scope.status == 0" active-color="#5850ff" inactive-color="#eee" :active-text="scope.scope.status == 0 ? '启用' : '停用'" @change="changStatus(scope.scope.status, scope.scope.id)">{{ scope.scope.status == 0 ? '启用' : '停用' }}</GLButton>
</span> </span>
<div class="table-btns" slot="table-btns" slot-scope="scope"> <div class="table-btns" slot="table-btns" slot-scope="scope">
<GLButton v-if="userType != 2" fn="编辑" type="text" @click="selectClientType(scope.scope.businessTypeName, scope.scope.id)">编辑</GLButton> <GLButton v-if="userType != 2" fn="编辑" type="text" @click="selectClientType(scope.scope.businessTypeName, scope.scope.id)">编辑</GLButton>
<GLButton v-if="userType != 2" fn="删除" type="text" @click="handleDel(scope.scope)">删除</GLButton> <GLButton v-if="userType != 2" fn="删除" type="text" @click="handleDel(scope.scope)">删除</GLButton>
<!-- <el-button v-if="userType != 2" fn="编辑" type="text" @click="selectClientType(scope.scope.businessTypeName, scope.scope.id)">编辑</el-button>
<el-button v-if="userType != 2" fn="删除" type="text" @click="handleDel(scope.scope)">删除</el-button> -->
</div> </div>
</GLTable> </GLTable>
<div v-if="!hasData" class="default-box"> <div v-if="!hasData" class="default-box">
......
...@@ -278,6 +278,13 @@ export default { ...@@ -278,6 +278,13 @@ export default {
return value ? callback() : callback(new Error('请输入证件号码')) return value ? callback() : callback(new Error('请输入证件号码'))
}, },
trigger: 'change' trigger: 'change'
},
{
validator: (rule, value, callback) => {
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'
} }
], ],
customerPhone: [ customerPhone: [
...@@ -287,7 +294,7 @@ export default { ...@@ -287,7 +294,7 @@ export default {
let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/ let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码')) return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
}, },
trigger: 'change' trigger: 'change'
} }
], ],
customerAddress: [{ required: true, message: '请输入联系地址', trigger: 'change' }] customerAddress: [{ required: true, message: '请输入联系地址', trigger: 'change' }]
...@@ -306,6 +313,7 @@ export default { ...@@ -306,6 +313,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')
} }
}, },
{ {
...@@ -329,7 +337,7 @@ export default { ...@@ -329,7 +337,7 @@ export default {
label: '身份证', label: '身份证',
name: 'cardNo', name: 'cardNo',
type: 'input', type: 'input',
maxlength: 30 maxlength: 18
}, },
{ {
label: '联系号码', label: '联系号码',
...@@ -375,7 +383,7 @@ export default { ...@@ -375,7 +383,7 @@ export default {
], ],
servicePeriod: [{ required: true, message: '请选择服务期限', trigger: 'change' }], servicePeriod: [{ required: true, message: '请选择服务期限', trigger: 'change' }],
effectiveDate: [{ required: true, message: '请选择生效日期', trigger: 'change' }], effectiveDate: [{ required: true, message: '请选择生效日期', trigger: 'change' }],
actualSalesPersonId: [{ required: true, message: '请输入实际销售人', trigger: 'change' }] // actualSalesPersonId: [{ required: true, message: '请输入实际销售人', trigger: 'change' }]
}, },
editFormDataOther: [ editFormDataOther: [
{ {
...@@ -1023,29 +1031,34 @@ export default { ...@@ -1023,29 +1031,34 @@ export default {
updateEquity(params) { updateEquity(params) {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: 'Loading', text: '结果处理中···',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)' background: 'rgba(0, 0, 0, 0.3)'
}) })
this.$apis.ghBeforeSale.updateEquityApi(params).then(res => { this.$apis.ghBeforeSale.updateEquityApi(params).then(res => {
loading.close()
this.submit = false this.submit = false
if (res.errId == 'A1307') { if (res.errId == 'A1307') {
loading.close()
this.whereToGo('vin') this.whereToGo('vin')
this.$message({ this.$message({
message: res.message, message: res.message,
type: 'error' type: 'error'
}) })
} else { } else {
this.$message({ // this.$message({
message: res.code=='0'?'提交成功待ERP审核':res.message, // message: res.code=='0'?'提交成功待ERP审核':res.message,
type:res.code=='0'? 'success':'error' // type:res.code=='0'? 'success':'error'
}) // })
this.$router.push({ setTimeout(()=>{
path: '/ghPreSale/equityList', loading.close()
// name: 'beforeSale', this.$router.push({
params: res path: '/ghPreSale/equityList',
}) // name: 'beforeSale',
params: res
})
},5000)
} }
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!