Forráskód Böngészése

新增收发货地址

lichao 3 éve
szülő
commit
cbd3858662

+ 1 - 1
src/api/basicData/customerInformation.js

@@ -120,7 +120,7 @@ export function corpsAddrDelete(data) {
   return request({
     url: '/api/blade-client/corpsAddr/remove',
     method: 'post',
-    data: {
+    params: {
       ids: data
     }
   })

+ 5 - 1
src/views/basicData/customerInformation/configuration/addressOption.json

@@ -16,8 +16,9 @@
     {
       "label": "地址",
       "prop": "addr",
-      "index": 4,
+      "index": 1,
       "width":350,
+      "overHidden": true,
       "rules": [
         {
           "required": true,
@@ -30,6 +31,7 @@
       "prop": "attn",
       "index": 2,
       "width":200,
+      "overHidden": true,
       "rules": [
         {
           "required": true,
@@ -42,6 +44,7 @@
       "prop": "tel",
       "index": 3,
       "width":200,
+      "overHidden": true,
       "rules": [
         {
           "required": true,
@@ -54,6 +57,7 @@
       "prop": "remarks",
       "index": 4,
       "width":350,
+      "overHidden": true,
       "rules": [
         {
           "required": false,

+ 70 - 0
src/views/basicData/customerManagement/companyMaterial/configuration/addressOption.json

@@ -0,0 +1,70 @@
+{
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "menuWidth": 180,
+  "dialogClickModal": false,
+  "addBtnText": "录入明细",
+  "column": [
+    {
+      "label": "地址",
+      "prop": "addr",
+      "index": 1,
+      "width":350,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "联系人",
+      "prop": "attn",
+      "index": 2,
+      "width":200,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "电话",
+      "prop": "tel",
+      "index": 3,
+      "width":200,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "备注",
+      "prop": "remarks",
+      "index": 4,
+      "width":350,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": false,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
+}

+ 52 - 3
src/views/basicData/customerManagement/companyMaterial/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()">
@@ -218,7 +229,8 @@ import {
   corpsbank,
   corpsfiles,
   corpsitem,
-  areaTypeTree
+  areaTypeTree,
+  corpsAddrDelete
 } from "@/api/basicData/customerInformation";
 import customerContact from "./configuration/customerContact.json";
 import advantageProject from "./configuration/advantageProject.json";
@@ -226,6 +238,7 @@ import bankOfDeposit from "./configuration/bankOfDeposit.json";
 import flowDialog from "@/components/flow-dialog/main";
 import { companyParameter } from "@/enums/management-type";
 import { gainUser } from "@/api/basicData/customerInquiry";
+import addressOption from "./configuration/addressOption.json";
 export default {
   name: "detailsPage",
   data() {
@@ -538,7 +551,10 @@ export default {
           }
         ]
       },
-      paymentOption: []
+      paymentOption: [],
+      addressOption: addressOption,
+      addressForm: {},
+      addressData: []
     };
   },
   components: {
@@ -750,7 +766,40 @@ export default {
     },
     onClose(val) {
       this.switchDialog = val;
-    }
+    },
+    //新增收发货地址保存触发
+    rowSaveAddress(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) {
+          corpsAddrDelete(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);
+        }
+      });
+    },
   }
 };
 </script>

+ 70 - 0
src/views/basicData/customerManagement/supplierMaterial/configuration/addressOption.json

@@ -0,0 +1,70 @@
+{
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "menuWidth": 180,
+  "dialogClickModal": false,
+  "addBtnText": "录入明细",
+  "column": [
+    {
+      "label": "地址",
+      "prop": "addr",
+      "index": 1,
+      "width":350,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "联系人",
+      "prop": "attn",
+      "index": 2,
+      "width":200,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "电话",
+      "prop": "tel",
+      "index": 3,
+      "width":200,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "备注",
+      "prop": "remarks",
+      "index": 4,
+      "width":350,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": false,
+          "message": "请输入账户名称",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
+}

+ 55 - 3
src/views/basicData/customerManagement/supplierMaterial/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()">
@@ -218,7 +229,8 @@ import {
   corpsbank,
   corpsfiles,
   corpsitem,
-  areaTypeTree
+  areaTypeTree,
+  corpsAddrDelete,
 } from "@/api/basicData/customerInformation";
 import customerContact from "./configuration/customerContact.json";
 import advantageProject from "./configuration/advantageProject.json";
@@ -226,6 +238,7 @@ import bankOfDeposit from "./configuration/bankOfDeposit.json";
 import flowDialog from "@/components/flow-dialog/main";
 import { supplierParameter } from "@/enums/management-type";
 import { gainUser } from "@/api/basicData/customerInquiry";
+import addressOption from "./configuration/addressOption.json";
 export default {
   name: "detailsPage",
   data() {
@@ -538,7 +551,10 @@ export default {
           }
         ]
       },
-      paymentOption: []
+      paymentOption: [],
+      addressOption: addressOption,
+      addressForm: {},
+      addressData: []
     };
   },
   components: {
@@ -565,9 +581,11 @@ export default {
         this.contactsData = this.form.corpsAttnList;
         this.bankOfDepositData = this.form.corpsBankList;
         this.advantageProjectData = this.form.corpsItems;
+        this.addressData = this.form.corpsAddrList.length > 0?this.form.corpsAddrList: [];
         delete this.form.corpsAttnList;
         delete this.form.corpsBankList;
         delete this.form.corpsItems;
+        delete this.form.corpsAddrList;
       });
     } else {
       //新增时根据左侧选中树结构给客户类别赋值
@@ -702,6 +720,7 @@ export default {
           this.form.corpsAttnList = this.contactsData;
           this.form.corpsBankList = this.bankOfDepositData;
           this.form.corpsItems = this.advantageProjectData;
+          this.form.corpsAddrList = this.addressData;
           if (typeof this.form.corpsTypeId == "object") {
             this.form.corpsTypeId = this.form.corpsTypeId.join(",");
           }
@@ -750,7 +769,40 @@ export default {
     },
     onClose(val) {
       this.switchDialog = val;
-    }
+    },
+    //新增收发货地址保存触发
+    rowSaveAddress(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) {
+          corpsAddrDelete(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);
+        }
+      });
+    },
   }
 };
 </script>