Browse Source

经销商修改

lichao 3 years ago
parent
commit
e4e77d3ec7

+ 50 - 3
src/views/dealer/purchase/config/mainList.json

@@ -18,7 +18,22 @@
   "searchSpan": 8,
   "showSummary": true,
   "summaryText": "合计",
-  "sumColumnList": [],
+  "expand": true,
+  "expandWidth": 38,
+  "sumColumnList": [
+    {
+      "name": "orderQuantity",
+      "type": "sum"
+    },
+    {
+      "name": "debitAmount",
+      "type": "sum"
+    },
+    {
+      "name": "amount",
+      "type": "sum"
+    }
+  ],
   "column": [
     {
       "label": "采购订单号",
@@ -30,7 +45,7 @@
     },
     {
       "label": "供应商",
-      "prop": "corpId",
+      "prop": "strCorpName",
       "search": true,
       "index": 2,
       "minWidth": 80,
@@ -74,6 +89,38 @@
       "overHidden": true
     },
     {
+      "label": "收货仓库",
+      "prop": "storageName",
+      "search": true,
+      "index": 7,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "总数量",
+      "prop": "orderQuantity",
+      "search": false,
+      "index": 8,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "应付金额",
+      "prop": "debitAmount",
+      "search": false,
+      "index": 9,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "总金额",
+      "prop": "amount",
+      "search": false,
+      "index": 10,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
       "type": "select",
       "props": {
         "label": "name",
@@ -82,7 +129,7 @@
       "label": "制单人",
       "prop": "createUser",
       "search": true,
-      "index": 7,
+      "index": 11,
       "width": 100,
       "overHidden": true
     }

+ 118 - 3
src/views/dealer/purchase/index.vue

@@ -20,22 +20,40 @@
         @search-criteria-switch="searchCriteriaSwitch"
         @saveColumn="saveColumn"
         @resetColumn="resetColumn"
+        @expand-change="expandChange"
       >
         <template slot="orderNo" slot-scope="scope">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orderNo }}</span>
         </template>
-        <template slot="corpId" slot-scope="scope">
+        <template slot="strCorpName" slot-scope="scope">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.strCorpName }}</span>
         </template>
         <template slot="createUser" slot-scope="scope">
           <span>{{ scope.row.createUserName }}</span>
         </template>
-        <template slot="corpIdSearch">
+        <template slot="amount" slot-scope="scope">
+          <span>{{ scope.row.amount | decimalFormat }}</span>
+        </template>
+        <template slot="strCorpNameSearch">
           <crop-select
             v-model="search.corpId"
             corpType="GYS"
           ></crop-select>
         </template>
+        <template slot="storageNameSearch">
+          <warehouse-select
+            v-model="search.storageId"
+            :configuration="configurationWarehouse"/>
+        </template>
+        <template slot-scope="{ row }" slot="expand">
+          <avue-crud
+            :data="row.itemData"
+            :option="itemOption"
+            :table-loading="row.itemLoading"
+            :cell-style="cellStyle"
+            class="itemTable"
+          ></avue-crud>
+        </template>
         <template slot="menuLeft">
           <el-button
             type="primary"
@@ -76,7 +94,7 @@
 import option from './config/mainList.json';
 import detailPage from "./detail";
 import { gainUser } from "@/api/basicData/customerInquiry";
-import {getPurchaseList, deleteDetails} from "@/api/dealer/purchase";
+import {getPurchaseList, deleteDetails, dataDetail} from "@/api/dealer/purchase";
 
 export default {
   name: "index",
@@ -97,6 +115,82 @@ export default {
       loading: false,
       selection: [],
       detailData: {},
+      itemOption: {
+        align: "center",
+        header: false,
+        menu: false,
+        column: [
+          {
+            label: "产品编码",
+            prop: "code",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "商品名称",
+            prop: "cname",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "花纹",
+            prop: "brandItem",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "负荷指数",
+            prop: "specsOne",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "速度级别",
+            prop: "specsTwo",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "单位",
+            prop: "unit",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "数量",
+            prop: "orderQuantity",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "尺寸",
+            prop: "size",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "价格",
+            prop: "price",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "小计",
+            prop: "amount",
+            width: 138,
+            overHidden: true
+          },
+        ]
+      },
+      // 仓库配置
+      configurationWarehouse: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        clearable: true,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+      },
     }
   },
   async created() {
@@ -114,6 +208,11 @@ export default {
       this.option.searchMenuPosition = "right";
     }
   },
+  filters: {
+    decimalFormat(num) {
+      return num ? Number(num).toFixed(2) : "0.00";
+    }
+  },
   methods: {
     searchCriteriaSwitch(type) {
       if (type) {
@@ -188,6 +287,10 @@ export default {
       delete queryParams.businesDate;
       this.loading = true;
       getPurchaseList(queryParams).then(res => {
+        res.data.data.records.forEach(e => {
+          e.itemLoading = false;
+          e.itemData = [];
+        });
         this.dataList = res.data.data.records;
         this.page.total = res.data.data.total;
         this.option.height = window.innerHeight - 240;
@@ -251,6 +354,18 @@ export default {
         query: true, // 表示只是查询
       };
     },
+    expandChange(row) {
+      if (this.dataList[row.$index].itemLoading == false) {
+        this.dataList[row.$index].itemLoading = true;
+        dataDetail(row.id)
+          .then(res => {
+            this.dataList[row.$index].itemData = res.data.data.orderItemsList? res.data.data.orderItemsList: [];
+          })
+          .finally(() => {
+            this.dataList[row.$index].itemLoading = false;
+          });
+      }
+    },
   },
 }
 </script>

+ 44 - 5
src/views/dealer/sales/config/mainList.json

@@ -17,7 +17,22 @@
   "searchSpan": 8,
   "showSummary": true,
   "summaryText": "合计",
-  "sumColumnList": [],
+  "expand": true,
+  "expandWidth": 38,
+  "sumColumnList": [
+    {
+      "name": "orderQuantity",
+      "type": "sum"
+    },
+    {
+      "name": "debitAmount",
+      "type": "sum"
+    },
+    {
+      "name": "amount",
+      "type": "sum"
+    }
+  ],
   "column": [
     {
       "label": "销售订单号",
@@ -29,7 +44,7 @@
     },
     {
       "label": "客户名称",
-      "prop": "corpId",
+      "prop": "corpsName",
       "search": true,
       "index": 2,
       "minWidth": 80,
@@ -103,17 +118,41 @@
     },
     {
       "label": "发货仓库",
-      "prop": "storageId",
+      "prop": "storageName",
       "search": true,
       "index": 10,
       "minWidth": 80,
       "overHidden": true
     },
     {
+      "label": "总数量",
+      "prop": "orderQuantity",
+      "search": true,
+      "index": 11,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "总金额",
+      "prop": "amount",
+      "search": true,
+      "index": 12,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "应收金额",
+      "prop": "debitAmount",
+      "search": true,
+      "index": 13,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
       "label": "系统编号",
       "prop": "sysNo",
       "search": true,
-      "index": 11,
+      "index": 14,
       "minWidth": 80,
       "overHidden": true
     },
@@ -126,7 +165,7 @@
       "label": "制单人",
       "prop": "createUser",
       "search": true,
-      "index": 12,
+      "index": 15,
       "width": 100,
       "overHidden": true
     }

+ 113 - 5
src/views/dealer/sales/index.vue

@@ -19,30 +19,43 @@
         @search-criteria-switch="searchCriteriaSwitch"
         @saveColumn="saveColumn"
         @resetColumn="resetColumn"
+        @expand-change="expandChange"
       >
         <template slot="orderNo" slot-scope="scope">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orderNo }}</span>
         </template>
-        <template slot="corpId" slot-scope="scope">
+        <template slot="corpsName" slot-scope="scope">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpsName }}</span>
         </template>
-        <template slot="storageId" slot-scope="scope">
+        <template slot="storageName" slot-scope="scope">
           <span>{{ scope.row.storageName }}</span>
         </template>
         <template slot="createUser" slot-scope="scope">
           <span>{{ scope.row.createUserName }}</span>
         </template>
-        <template slot="storageIdSearch">
+        <template slot="amount" slot-scope="scope">
+          <span>{{ scope.row.amount | decimalFormat }}</span>
+        </template>
+        <template slot="storageNameSearch">
           <warehouse-select
             v-model="search.storageId"
             :configuration="configurationWarehouse"/>
         </template>
-        <template slot="corpIdSearch">
+        <template slot="corpsNameSearch">
           <crop-select
             v-model="search.corpId"
             corpType="KH"
           ></crop-select>
         </template>
+        <template slot-scope="{ row }" slot="expand">
+          <avue-crud
+            :data="row.itemData"
+            :option="itemOption"
+            :table-loading="row.itemLoading"
+            :cell-style="cellStyle"
+            class="itemTable"
+          ></avue-crud>
+        </template>
         <template slot="menuLeft">
           <el-button
             type="primary"
@@ -83,7 +96,7 @@
 import option from './config/mainList.json';
 import detailPage from "./detail";
 import { gainUser } from "@/api/basicData/customerInquiry";
-import {getSalesList, detail, deleteDetails} from "@/api/dealer/sales";
+import {getSalesList, dataDetail, deleteDetails} from "@/api/dealer/sales";
 
 export default {
   name: "index",
@@ -110,8 +123,82 @@ export default {
         multiple: false,
         collapseTags: false,
         placeholder: "请点击右边按钮选择",
+        clearable: true,
         dicData: [],
       },
+      itemOption: {
+        align: "center",
+        header: false,
+        menu: false,
+        column: [
+          {
+            label: "产品编码",
+            prop: "code",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "商品名称",
+            prop: "cname",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "花纹",
+            prop: "brandItem",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "负荷指数",
+            prop: "specsOne",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "速度级别",
+            prop: "specsTwo",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "单位",
+            prop: "unit",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "批次号",
+            prop: "lotNo",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "数量",
+            prop: "orderQuantity",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "尺寸",
+            prop: "size",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "价格",
+            prop: "price",
+            width: 138,
+            overHidden: true
+          },
+          {
+            label: "小计",
+            prop: "amount",
+            width: 138,
+            overHidden: true
+          },
+        ]
+      },
     }
   },
   async created() {
@@ -133,6 +220,11 @@ export default {
       this.option.searchMenuPosition = "right";
     }
   },
+  filters: {
+    decimalFormat(num) {
+      return num ? Number(num).toFixed(2) : "0.00";
+    }
+  },
   methods: {
     searchCriteriaSwitch(type) {
       if (type){
@@ -204,6 +296,10 @@ export default {
       }
       delete queryParams.businesDate;
       getSalesList(queryParams).then(res => {
+        res.data.data.records.forEach(e => {
+          e.itemLoading = false;
+          e.itemData = [];
+        });
         this.dataList = res.data.data.records;
         this.page.total = res.data.data.total;
         this.option.height = window.innerHeight - 240;
@@ -267,6 +363,18 @@ export default {
         query: true, // 表示只是查询
       };
     },
+    expandChange(row) {
+      if (this.dataList[row.$index].itemLoading == false) {
+        this.dataList[row.$index].itemLoading = true;
+        dataDetail(row.id)
+          .then(res => {
+            this.dataList[row.$index].itemData = res.data.data.orderItemsList? res.data.data.orderItemsList: [];
+          })
+          .finally(() => {
+            this.dataList[row.$index].itemLoading = false;
+          });
+      }
+    },
   },
 }
 </script>