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

pref:修改新增业务

parent 70df0174
......@@ -241,7 +241,7 @@ export default {
this.getBusinessListData();
},
methods: {
// 现在业务成功
// 新增业务成功
AddSuccess() {
this.getSiteBusinessData();
this.getBusinessListData();
......
......@@ -22,7 +22,15 @@
</a-radio-group>
</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
v-model="form.parentId"
placeholder="请选择父级业务"
......@@ -153,11 +161,13 @@ export default {
this.form = { ...data };
},
// 切换业务级别
changeIsBusiness(e) {
if (e.target.value === 0) {
this.form.parentId = 0;
}
},
// changeIsBusiness(e) {
// if (e.target.value == 0) {
// this.form.parentId = 0;
// } else {
// this.form.parentId = undefined;
// }
// },
// 重置
handleReset() {
this.$refs.formData.resetFields();
......@@ -165,10 +175,12 @@ export default {
// 确定
handleOk() {
this.$refs.formData.validate(async (valid) => {
console.log(this.form.parentId);
if (valid) {
this.confirmLoading = true;
let res = await saveBusiness({
...this.form,
parentId: this.form.parentId == undefined ? 0 : this.form.parentId,
});
let { code, msg, data } = res.data;
if (code === 1) {
......@@ -189,8 +201,6 @@ export default {
this.$message.success(msg);
this.getBusinessData();
this.$refs.formData.resetFields();
this.$parent.getSiteBusinessData();
this.$parent.getBusinessListData();
this.$emit("newBusiness");
}
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