bug
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-03 11:00:47
|
||||
* @LastEditTime: 2023-11-22 10:27:43
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -77,8 +77,8 @@ export default {
|
||||
remark: undefined
|
||||
},
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
|
||||
code: [{ required: true, message: "供应商编号不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "供应商名称不能为空", trigger: "blur" }],
|
||||
contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
|
||||
telephone: [
|
||||
{ required: false, trigger: "blur", message: "手机号不能为空" },
|
||||
@@ -87,10 +87,12 @@ export default {
|
||||
if (value) {
|
||||
if (/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(value) === false) {
|
||||
callback(new Error("手机号格式错误"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}, trigger: "blur"
|
||||
}
|
||||
]
|
||||
@@ -98,6 +100,31 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {}
|
||||
methods: {
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
console.log('你好', this.dataForm)
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user