Browse Source

1. 优化

MONSTER-ygh 1 year ago
parent
commit
042ad5663f

+ 10 - 3
src/views/distribution/personnelMr/dialog/addAndEdit.vue

@@ -185,7 +185,9 @@ export default {
       const id = row.id
       getSelectById(id).then(response => {
         const obj = response.data;
-        this.getList({id:row.parentId})
+        if(row.parentId && obj.parentId != 0){
+          this.getList({id:row.parentId})
+        }
         this.$nextTick(() => {
           this.$set(this.form, 'id', obj.id);
           this.$set(this.form, 'name', obj.name);
@@ -194,7 +196,7 @@ export default {
           this.$set(this.form, 'mobile', obj.mobile);
           this.$set(this.form, 'allowWithdraw', obj.allowWithdraw);
           this.$set(this.form, 'parentName', obj.parentName);
-          this.$set(this.form, 'parentId', obj.parentId);
+          this.$set(this.form, 'parentId', obj.parentId && obj.parentId != 0 ? obj.parentId : null);
           this.$set(this.form, 'salePerson', obj.salePerson);
         });
       });
@@ -210,7 +212,10 @@ export default {
         if (valid) {
           try {
             this.loading = true;
-            const { code } = await saveAndEdit({ ...this.form });
+            const { code } = await saveAndEdit({ 
+              ...this.form,
+              parentId: this.form.parentId && this.form.parentId != 0 ? this.form.parentId : 0
+             });
             if (code === 200) {
               this.$message.success("操作成功!");
               this.$emit("getList");
@@ -235,6 +240,8 @@ export default {
       this.$set(this.form, 'contact', '');
       this.$set(this.form, 'mobile', '');
       this.$set(this.form, 'password', '');
+      this.$set(this.form, 'parentId', '');
+      this.$set(this.form, 'salePerson', '');
     },
     /**
      * 关闭弹框

+ 1 - 1
src/views/ticket/ticketMr/dialog/FreightMgrIndexMi.js

@@ -18,7 +18,7 @@ export default {
          * 取消查看可配送区域对话框
          */
         deliverableAreaDialogCancel() {
-            this.selectDeliveryAreaDialogOpe = true;
+            this.selectDeliveryAreaDialogOpen = true;
         },
         /** 关闭弹窗  */
         selectDeliveryAreaDialogCancel(){