Commit 73a87db0 by cen

fix: 轻改回显正确的收款方式

1 parent f485ac5c
......@@ -218,7 +218,7 @@ export default {
positionTypeList: [],
valueKey: '',
totalPrice: 0,
validateState:true,
validateState: true,
// 产品槽位配置,用于循环渲染产品组件
productSlots: {
frontGear: true,
......@@ -285,7 +285,12 @@ export default {
// 防止从补录进来4s店收款为禁用
const cell = this.formList[2].find(item => item.value == 'payeeType')
if (cell) {
cell.current = 1
// 编辑订单时,使用已有的payeeType值,新建订单时使用默认值1
if (!this.orderObj.id) {
cell.current = 1
} else {
cell.current = this.orderObj.payeeType
}
cell.radioList[1].disabled = false
}
this.getConfig()
......@@ -385,21 +390,23 @@ export default {
inputBlur(e, val) {
console.log(e, val)
this.orderObj.customer[val.value] = this.orderObj[val.value]
// VIN车架号动态校验:车架号字段,动态转换为大写
let standNoVal = this.orderObj.standNo;
if (val.value === 'standNo' && standNoVal) {
this.orderObj.standNo = formatVinInput(standNoVal)
validateVin(this.orderObj.standNo).then(result => {
console.log("validateVin",result);
let { valid } = result.data;
this.validateState = valid
// 校验成功,所有提示已在公共方法中处理
console.log('车架号校验成功:', result)
}).catch(err => {
console.log("validateVinErr",result);
})
}
// VIN车架号动态校验:车架号字段,动态转换为大写
let standNoVal = this.orderObj.standNo
if (val.value === 'standNo' && standNoVal) {
this.orderObj.standNo = formatVinInput(standNoVal)
validateVin(this.orderObj.standNo)
.then(result => {
console.log('validateVin', result)
let { valid } = result.data
this.validateState = valid
// 校验成功,所有提示已在公共方法中处理
console.log('车架号校验成功:', result)
})
.catch(err => {
console.log('validateVinErr', result)
})
}
},
// 校验必填等规则
checkRequired() {
......@@ -476,22 +483,22 @@ export default {
// 提交
async submit() {
// VIN车架号-动态校验
const carVin = this.orderObj.standNo
console.log("validateState",this.validateState);
if (carVin) {
// 前置判断
if (carVin.length !== 17) {
uni.showToast({title:'请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)',icon:'none'})
return false
}
// 根据接口校验结果判断
if (carVin.length === 17 && !this.validateState) {
uni.showToast({title:'车架号校验不匹配,请核对后重新输入',icon:'none'})
return false
}
}
// VIN车架号-动态校验
const carVin = this.orderObj.standNo
console.log('validateState', this.validateState)
if (carVin) {
// 前置判断
if (carVin.length !== 17) {
uni.showToast({ title: '请输入 17 位有效字符(支持大写 A-H/J-N/P-Z、0-9)', icon: 'none' })
return false
}
// 根据接口校验结果判断
if (carVin.length === 17 && !this.validateState) {
uni.showToast({ title: '车架号校验不匹配,请核对后重新输入', icon: 'none' })
return false
}
}
if (!(await this.checkDailyReport())) {
const { orderCreateType } = this
const obj = utils.deepClone(this.orderObj)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!