代办事项审核bug修复

This commit is contained in:
2023-08-23 19:12:01 +08:00
parent 14f07eabad
commit d1477ec8b0
2 changed files with 25 additions and 23 deletions

View File

@ -104,7 +104,10 @@ export default {
this.states=e
},
async submitBtn(){
let res = await saveDriver({
if(!(this.driverName && this.driverPhone && this.identityCardNumber && this.drivingModel && this.states)){
this.$toast('必填字段未填写')
}else{
await saveDriver({
driverId:this.id ? this.id : '',
driverName:this.driverName ,
driverPhone:this.driverPhone,
@ -113,31 +116,30 @@ export default {
states:Number(this.states),
createTime:timeFormat(new Date())
})
if(res.code === 200){
if(this.id){
this.$toast('修改成功')
if(this.id){
this.$toast('修改成功')
}else{
this.$toast('添加成功')
}
setTimeout(()=>{
this.$router.back();
},2000)
}else{
this.$toast('添加成功')
}
setTimeout(()=>{
this.$router.back();
},2000)
}
},
cancelBtn(){//取消
this.$router.back()
},
validatePhoneNumber() {
const phoneNumberRegex = /^1[0-9]{10}$/;
if (!phoneNumberRegex.test(this.driverPhone)) {
this.phoneNumberError = true;
this.phoneNumberErrorMessage = '电话号码格式不正确请输入有效的11位手机号码。';
} else {
this.phoneNumberError = false;
this.phoneNumberErrorMessage = '';
}
}
// validatePhoneNumber() {
// const phoneNumberRegex = /^1[0-9]{10}$/;
// if (!phoneNumberRegex.test(this.driverPhone)) {
// this.phoneNumberError = true;
// this.phoneNumberErrorMessage = '电话号码格式不正确请输入有效的11位手机号码。';
// } else {
// this.phoneNumberError = false;
// this.phoneNumberErrorMessage = '';
// }
// }
},
components:{
TwoCommonBtn,

View File

@ -14,8 +14,8 @@
<div class="time">{{ item.toDoTime }} &nbsp;&nbsp;{{ item.userName }}</div>
</div>
<div class="right">
<button class="nopass" @click="toDoAudit(item ,2)">不通过</button>
<button class="pass" @click="toDoAudit(item ,1)">通过</button>
<button class="nopass" @click="todoAudit(item ,2)">不通过</button>
<button class="pass" @click="todoAudit(item ,1)">通过</button>
</div>
</li>
</ul>
@ -46,7 +46,7 @@ export default {
this.show = false
}
},
async toDoAudit(item,type) {
async todoAudit(item,type) {
await toDoAudit({
toDoId: item.toDoId,
toDoType: item.toDoType.code,