Browse Source

客户商品 导入

qinbai 3 years ago
parent
commit
2e23cfa573

+ 6 - 0
src/page/index/tags.vue

@@ -133,6 +133,12 @@
             if(tag.label=="进口发货单"){
             this.$store.commit("GO_OUT_DETAIL");
           }
+          if(tag.label=="进口收货单"){
+            this.$store.commit("TAKE_OUT_DETAIL");
+          }
+          if(tag.label=="付款管理"){
+            this.$store.commit("PAY_OUT_DETAIL");
+          }
           this.$store.commit("DEL_TAG", tag);
           if (tag.value === this.tag.value) {
             tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个

+ 2 - 0
src/store/getters.js

@@ -27,6 +27,8 @@ const getters = {
   flowRoutes: state => state.dict.flowRoutes,
   inStatus: state => state.ifdetail.inStatus,
   goStatus: state => state.ifdetail.goStatus,
+  takeStatus: state => state.ifdetail.takeStatus,
   outStatus: state => state.ifdetail.outStatus,
+  payStatus: state => state.ifdetail.payStatus,
 }
 export default getters

+ 23 - 3
src/store/modules/ifdetail.js

@@ -1,8 +1,10 @@
 const ifdetail = {
   state: {
     inStatus: false, //国内
-    goStatus: false, //进口
-    outStatus: false //出口
+    goStatus: false, //进口发货单
+    takeStatus: false, //进口发货单
+    outStatus: false, //出口
+    payStatus: false //付款
   },
   actions: {},
   mutations: {
@@ -15,7 +17,7 @@ const ifdetail = {
     IN_OUT_DETAIL(state) {
       state.inStatus = false;
     },
-    //进口状态
+    //进口发货单状态
     // 进入详情页
     GO_IN_DETAIL(state) {
       state.goStatus = true;
@@ -24,6 +26,15 @@ const ifdetail = {
     GO_OUT_DETAIL(state) {
       state.goStatus = false;
     },
+    //进口收货单状态
+    // 进入详情页
+    TAKE_IN_DETAIL(state) {
+      state.takeStatus = true;
+    },
+    //退出详情页
+    TAKE_OUT_DETAIL(state) {
+      state.takeStatus = false;
+    },
     //出口状态
     // 进入详情页
     OUT_IN__DETAIL(state) {
@@ -32,6 +43,15 @@ const ifdetail = {
     //退出详情页
     OUT_OUT_DETAIL(state) {
       state.outStatus = false;
+    },
+    //付款管理
+    // 进入详情payment
+    PAY_IN_DETAIL(state) {
+      state.payStatus = true;
+    },
+    //退出详情页
+    PAY_OUT_DETAIL(state) {
+      state.payStatus = false;
     }
   }
 

+ 17 - 18
src/views/basicData/commodityType/index.vue

@@ -30,17 +30,10 @@
             <el-button
               type="primary"
               size="small"
-              icon="el-icon-plus"
+              icon="el-icon-bottom"
               @click="commodityImport()"
             >导入
             </el-button>
-            <el-button
-              type="success"
-              icon="el-icon-upload2"
-              size="small"
-              @click="derivation()"
-            >下载模板
-            </el-button>
           </template>
           <template slot-scope="scope" slot="menu">
             <el-button
@@ -148,7 +141,13 @@
                    append-to-body
                    :visible.sync="excelBox"
                    width="555px">
-          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"/>
+          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
+            <template slot="excelTemplate">
+              <el-button type="primary" @click="derivation">
+                点击下载<i class="el-icon-download el-icon--right"></i>
+              </el-button>
+            </template>
+          </avue-form>
         </el-dialog>
       </basic-container>
     </el-col>
@@ -336,10 +335,15 @@ export default {
             span: 24,
             propsHttp: {
               res: 'data',
-              // url:'link'
             },
             tip: '请上传 .xls,.xlsx 标准格式文件',
-            action: "/api/blade-client/goodsdesc/import-desc?typeId="+this.treeDeptId+"",
+            action: "",
+          },
+          {
+            label: '模板下载',
+            prop: 'excelTemplate',
+            formslot: true,
+            span: 24,
           }
         ]
       }
@@ -397,13 +401,7 @@ export default {
       }
     },
     derivation() {
-      this.$confirm("是否下载模板?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        window.open(`/api/blade-client/goodsdesc/export-template?${this.website.tokenHeader}=${getToken()}`);
-      });
+      window.open(`/api/blade-client/goodsdesc/export-template?${this.website.tokenHeader}=${getToken()}`);
     },
     uploadAfter(res, done, loading, column) {
       window.console.log(column);
@@ -608,6 +606,7 @@ export default {
       getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
         const data = res.data.data;
         this.data = data.records;
+        this.page.total = res.data.data.total
         this.loading = false;
         this.selectionClear();
       });

+ 114 - 107
src/views/basicData/customerInformation/configuration/mainList.json

@@ -1,111 +1,118 @@
 {
-    "lazy": true,
-    "tip": false,
-    "simplePage": true,
-    "searchShow": true,
-    "searchMenuSpan": 6,
-    "dialogWidth": "60%",
-    "tree": true,
-    "border": true,
-    "index": true,
-    "selection": true,
-    "viewBtn": false,
-    "editBtn": false,
-    "delBtn": false,
-    "menuWidth": 300,
-    "dialogClickModal": false,
-    "column":[
+  "headerAlign": "center",
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "menuWidth": 220,
+  "dialogClickModal": false,
+  "column":[
+    {
+      "label": "客户编码",
+      "prop": "code",
+      "search": true,
+      "index": 1,
+      "width":120,
+      "rules": [
         {
-            "label": "客户编码",
-            "prop": "code",
-            "search": true,
-            "index": 1,
-            "width":100,
-            "rules": [
-                {
-                    "required": true,
-                    "message": "请输入菜单名称",
-                    "trigger": "blur"
-                }
-            ]
-        },{
-            "label": "客户全称",
-            "prop": "cname",
-            "search": true,
-            "index": 2,
-            "width":100,
-            "rules": [
-                {
-                    "required": true,
-                    "message": "请输入菜单名称",
-                    "trigger": "blur"
-                }
-            ]
-        },{
-            "label": "区域",
-            "prop": "belongtoarea",
-            "search": true,
-            "index": 4,
-            "width":100,
-            "rules": [
-                {
-                    "required": true,
-                    "message": "请输入菜单名称",
-                    "trigger": "blur"
-                }
-            ]
-        },{
-            "label": "所属公司",
-            "prop": "belongtocompany",
-            "search": true,
-            "index": 5,
-            "width":100,
-            "rules": [
-                {
-                    "required": true,
-                    "message": "请输入菜单名称",
-                    "trigger": "blur"
-                }
-            ]
-        },{
-            "label": "联系人",
-            "prop": "attn",
-            "search": true,
-            "index": 6,
-            "width":100,
-            "rules": [
-                {
-                    "required": true,
-                    "message": "请输入菜单名称",
-                    "trigger": "blur"
-                }
-            ]
-        },{
-            "label": "代理品牌",
-            "prop": "goodtypes",
-            "search": true,
-            "index": 7,
-            "width":100,
-            "rules": [
-                {
-                    "required": true,
-                    "message": "请输入菜单名称",
-                    "trigger": "blur"
-                }
-            ]
-        },{
-            "label": "客户等级 ",
-            "prop": "creditLevel",
-            "search": true,
-            "index": 8,
-            "width":100,
-            "rules": [
-                {
-                    "required": true,
-                    "message": "请输入菜单名称",
-                    "trigger": "blur"
-                }
-            ]
+          "required": true,
+          "message": "请输入菜单名称",
+          "trigger": "blur"
         }
-    ]
+      ]
+    },{
+      "label": "客户全称",
+      "prop": "cname",
+      "search": true,
+      "index": 2,
+      "width":150,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入菜单名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "区域",
+      "prop": "belongtoarea",
+      "search": true,
+      "index": 4,
+      "width":120,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入菜单名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "所属公司",
+      "prop": "belongtocompany",
+      "search": true,
+      "index": 5,
+      "width":150,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入菜单名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "联系人",
+      "prop": "attn",
+      "search": true,
+      "index": 6,
+      "width":130,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入菜单名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "代理品牌",
+      "prop": "goodtypes",
+      "search": true,
+      "index": 7,
+      "width":120,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入菜单名称",
+          "trigger": "blur"
+        }
+      ]
+    },{
+      "label": "企业类型",
+      "prop": "companytype",
+      "index": 8,
+      "width":130
+    },{
+      "label": "客户等级 ",
+      "prop": "creditLevel",
+      "search": true,
+      "hide": true,
+      "index": 8,
+      "width":100,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入菜单名称",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
 }

+ 15 - 14
src/views/basicData/customerInformation/detailsPageEdit.vue

@@ -48,6 +48,7 @@
                   leaf-only
                   multiple
                   style="width: 100%;"
+                  size="small"
                   :props="{ label: 'title' }"
                   v-model="form[item.prop]"
                   placeholder="请选择内容"
@@ -161,7 +162,7 @@
       @onClose="onClose()"
     >
     <template slot="content">
-      
+
     </template>
     </flow-dialog>
   </div>
@@ -409,8 +410,8 @@ export default {
             ]
           },
           {
-            label: "代理品牌",
-            prop: "goodtypes",
+            label: "客户名称",
+            prop: "cname",
             rules: [
               {
                 required: true,
@@ -420,8 +421,8 @@ export default {
             ]
           },
           {
-            label: "所属公司",
-            prop: "belongtocompany",
+            label: "客户类别",
+            prop: "corpsTypeId",
             rules: [
               {
                 required: true,
@@ -431,33 +432,33 @@ export default {
             ]
           },
           {
-            label: "客户名称",
-            prop: "cname",
+            label: "企业类型",
+            prop: "companytype",
             rules: [
               {
-                required: true,
+                required: false,
                 message: " ",
                 trigger: "blur"
               }
             ]
           },
           {
-            label: "客户类别",
-            prop: "corpsTypeId",
+            label: "代理品牌",
+            prop: "goodtypes",
             rules: [
               {
-                required: true,
+                required: false,
                 message: " ",
                 trigger: "blur"
               }
             ]
           },
           {
-            label: "企业类型",
-            prop: "companytype",
+            label: "所属公司",
+            prop: "belongtocompany",
             rules: [
               {
-                required: true,
+                required: false,
                 message: " ",
                 trigger: "blur"
               }

+ 11 - 8
src/views/basicData/customerInformation/index.vue

@@ -79,16 +79,19 @@
           :switchDialog="switchDialog"
           @onClose="onClose()"
         ></report-dialog>
-        <el-dialog title="导入商品"
+        <el-dialog title="导入客户"
                    append-to-body
                    :visible.sync="excelBox"
-                   width="555px">
-          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"/>
-          <template slot="excelTemplate">
-            <el-button type="primary" @click="derivation">
-              点击下载<i class="el-icon-download el-icon--right"></i>
-            </el-button>
-          </template>
+                   width="555px"
+                   v-dialog-drag
+        >
+          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
+            <template slot="excelTemplate">
+              <el-button type="primary" @click="derivation">
+                点击下载<i class="el-icon-download el-icon--right"></i>
+              </el-button>
+            </template>
+          </avue-form>
         </el-dialog>
       </basic-container>
     </el-col>

+ 2 - 0
src/views/financialManagement/payment.vue

@@ -104,6 +104,7 @@
           status: 1
         };
         this.show = false;
+        this.$store.commit("PAY_IN_DETAIL");
       },
       //编辑打开
       editOpen(row, status){
@@ -112,6 +113,7 @@
           status: status
         };
         this.show = false;
+        this.$store.commit("PAY_IN_DETAIL");
       },
       rowDel(row, index, done) {
         if(row.id){

+ 2 - 0
src/views/importTrade/receipt/index.vue

@@ -160,6 +160,7 @@ export default {
         status: status
       };
       this.show = false;
+      this.$store.commit("TAKE_IN_DETAIL");
     },
     //新增跳转页面
     beforeOpen(row, status) {
@@ -168,6 +169,7 @@ export default {
         status: status
       };
       this.show = false;
+      this.$store.commit("TAKE_IN_DETAIL");
     },
     editOpen(row, status) {
       this.detailData = {

+ 55 - 39
src/views/purchase/contract/detailsPage.vue

@@ -602,7 +602,7 @@ export default {
       let id = this.detailData.id.replace(/\"/g, "")
       detailListData(id).then(res => {
         this.form = res.data.data;
-        this.oldForm = res.data.data;
+        this.oldForm = Object.assign({},res.data.data);
         this.configuration.dicData = this.form.corpsName
         this.pConfiguration.dicData = this.form.purchaserName
         if(res.data.data.itemsVOList){
@@ -683,7 +683,7 @@ export default {
               this.$message.success("操作成功!")
               detailListData(this.form.id).then(res => {
                 this.form = res.data.data;
-                this.oldForm = res.data.data;
+                this.oldForm = Object.assign({},res.data.data);
                 this.configuration.dicData = this.form.corpsName
                 this.pConfiguration.dicData = this.form.purchaserName
                 if(res.data.data.itemsVOList){
@@ -726,25 +726,51 @@ export default {
             type: 'warning'
           }).then(() => {
             this.editCustomer();
+            return
           })
         }else {
           list.push(this.selectContact[item].$index)
         }
       }
-      const params = {
-        id:this.form.id,
-        orderItemIds:list
-      }
-      if(type){
-        this.$router.push({
-          path: "/financialManagement/payment",
-          query: {params: params},
-        });
-      }else{
-        this.$router.push({
-          path: "/importTrade/receipt/index",
-          query: {params: params},
-        });
+        const params = {
+          id:this.form.id,
+          orderItemIds:list
+        }
+        if(type){
+          //进入付款管理
+          if(this.$store.getters.goStatus){
+            this.$alert("付款页面已存在,请保存付款页面再进行操作", "温馨提示", {
+              confirmButtonText: "确定",
+              type: 'warning',
+              callback: action => {
+                console.log(action)
+              }
+            });
+          }else{
+            this.$router.$avueRouter.closeTag('/financialManagement/payment');
+            this.$router.push({
+              path: "/financialManagement/payment",
+              query: {params: params},
+            });
+          }
+        }else{
+          //进入收货单
+          if(this.$store.getters.goStatus){
+            this.$alert("收货单页面已存在,请保存收货单再进行操作", "温馨提示", {
+              confirmButtonText: "确定",
+              type: 'warning',
+              callback: action => {
+                console.log(action)
+              }
+            });
+          }else{
+            //关闭一下存在的列表页
+            this.$router.$avueRouter.closeTag('/importTrade/receipt/index');
+            this.$router.push({
+              path: "/importTrade/receipt/index",
+              query: {params: params},
+            });
+          }
       }
     },
     //选择货物品种
@@ -1031,30 +1057,20 @@ export default {
       this.dialogCost = !this.dialogCost
       this.choiceData = false
     },
-    // 发货
-    sendHandle() {
-      this.$message.success('发货成功')
-    },
     backToList() {
-      console.log(this.form)
-      console.log(this.oldForm)
-      console.log(contrastObj(this.form,this.oldForm))
-      // console.log(contrastList(this.contactsData,this.oldContactsData))
-      // console.log(contrastList(this.orderFeesList,this.oldFeesList))
-      // console.log(contrastList(this.orderFilesList,this.oldFilesList))
-      // if(contrastObj(this.form,this.oldForm) || contrastList(this.contactsData,this.oldContactsData)
-      // || contrastList(this.orderFeesList,this.oldFeesList) || contrastList(this.orderFilesList,this.oldFilesList)
-      // ){
-      //   this.$confirm("是否保存当前页面?", "提示", {
-      //     confirmButtonText: "保存",
-      //     cancelButtonText: "取消",
-      //     type: "warning",
-      //   }).then(() => {
-      //     this.editCustomer(true)
-      //   })
-      // }else{
-      //   this.$emit("goBack");
-      // }
+      if(contrastObj(this.form,this.oldForm) || contrastList(this.contactsData,this.oldContactsData)
+      || contrastList(this.orderFeesList,this.oldFeesList) || contrastList(this.orderFilesList,this.oldFilesList)
+      ){
+        this.$confirm("是否保存当前页面?", "提示", {
+          confirmButtonText: "保存",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(() => {
+          this.editCustomer(true)
+        })
+      }else{
+        this.$emit("goBack");
+      }
     },
   }
 }