Commit 340db1c4 authored by “yiyousong”'s avatar “yiyousong”

pref:修改新增业务

parent 70df0174
...@@ -241,7 +241,7 @@ export default { ...@@ -241,7 +241,7 @@ export default {
this.getBusinessListData(); this.getBusinessListData();
}, },
methods: { methods: {
// 现在业务成功 // 新增业务成功
AddSuccess() { AddSuccess() {
this.getSiteBusinessData(); this.getSiteBusinessData();
this.getBusinessListData(); this.getBusinessListData();
......
...@@ -22,7 +22,15 @@ ...@@ -22,7 +22,15 @@
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="选择父级业务:"> <a-form-model-item
label="父级业务:"
:rules="{
required: form.isBusiness ? true : false,
message: `父级业务不能为空`,
trigger: 'change',
}"
prop="parentId"
>
<a-select <a-select
v-model="form.parentId" v-model="form.parentId"
placeholder="请选择父级业务" placeholder="请选择父级业务"
...@@ -153,11 +161,13 @@ export default { ...@@ -153,11 +161,13 @@ export default {
this.form = { ...data }; this.form = { ...data };
}, },
// 切换业务级别 // 切换业务级别
changeIsBusiness(e) { // changeIsBusiness(e) {
if (e.target.value === 0) { // if (e.target.value == 0) {
this.form.parentId = 0; // this.form.parentId = 0;
} // } else {
}, // this.form.parentId = undefined;
// }
// },
// 重置 // 重置
handleReset() { handleReset() {
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
...@@ -165,10 +175,12 @@ export default { ...@@ -165,10 +175,12 @@ export default {
// 确定 // 确定
handleOk() { handleOk() {
this.$refs.formData.validate(async (valid) => { this.$refs.formData.validate(async (valid) => {
console.log(this.form.parentId);
if (valid) { if (valid) {
this.confirmLoading = true; this.confirmLoading = true;
let res = await saveBusiness({ let res = await saveBusiness({
...this.form, ...this.form,
parentId: this.form.parentId == undefined ? 0 : this.form.parentId,
}); });
let { code, msg, data } = res.data; let { code, msg, data } = res.data;
if (code === 1) { if (code === 1) {
...@@ -189,8 +201,6 @@ export default { ...@@ -189,8 +201,6 @@ export default {
this.$message.success(msg); this.$message.success(msg);
this.getBusinessData(); this.getBusinessData();
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
this.$parent.getSiteBusinessData();
this.$parent.getBusinessListData();
this.$emit("newBusiness"); this.$emit("newBusiness");
} }
this.confirmLoading = false; this.confirmLoading = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment