浏览代码

增加收发货从表

lichao 3 年之前
父节点
当前提交
88c8d7d402

+ 65 - 0
src/views/basicData/customerInformation/configuration/addressOption.json

@@ -0,0 +1,65 @@
+{
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "menuWidth": 180,
+  "dialogClickModal": false,
+  "column": [
+    {
+      "label": "客户",
+      "prop": "a",
+      "index": 1,
+      "width":240,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "联系人",
+      "prop": "b",
+      "index": 2,
+      "width":200,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "电话",
+      "prop": "c",
+      "index": 3,
+      "width":200,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "地址",
+      "prop": "d",
+      "index": 4,
+      "width":350,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
+}

+ 50 - 1
src/views/basicData/customerInformation/detailsPageEdit.vue

@@ -199,6 +199,17 @@
             @row-del="rowDelBankOfDeposit"
           ></avue-crud>
         </basic-container>
+        <containerTitle title="收发货地址"></containerTitle>
+        <basic-container>
+          <avue-crud
+            :option="addressOption"
+            v-model="addressForm"
+            :data="addressData"
+            @row-save="rowSaveAddress"
+            @row-update="rowUpdateAddress"
+            @row-del="rowDelAddress"
+          ></avue-crud>
+        </basic-container>
       </el-form>
     </div>
     <flow-dialog :switchDialog="switchDialog" @onClose="onClose()">
@@ -226,6 +237,7 @@ import bankOfDeposit from "./configuration/bankOfDeposit.json";
 import flowDialog from "@/components/flow-dialog/main";
 import { customerParameter } from "@/enums/management-type";
 import { gainUser } from "@/api/basicData/customerInquiry";
+import addressOption from "./configuration/addressOption.json";
 export default {
   name: "detailsPage",
   data() {
@@ -543,7 +555,10 @@ export default {
           }
         ]
       },
-      paymentOption: []
+      paymentOption: [],
+      addressOption: addressOption,
+      addressForm: {},
+      addressData: []
     };
   },
   components: {
@@ -701,6 +716,40 @@ export default {
         }
       });
     },
+    //新增收发货地址保存触发
+    rowSaveAddress(row, done, loading) {
+      console.log(row, done, loading);
+      this.addressData.push(row);
+      done();
+    },
+    //修改收发货地址优势项目触发
+    rowUpdateAddress(row, index, done, loading) {
+      done(row);
+    },
+    //删除收发货地址优势项目触发
+    rowDelAddress(row, index, donerowDel) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        if (row.id) {
+          corpsbank(row.id).then(res => {
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.addressData.splice(index, 1);
+          });
+        } else {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.addressData.splice(index, 1);
+        }
+      });
+    },
     //修改提交触发
     editCustomer() {
       this.$refs["form"].validate(valid => {