Browse Source

Merge branch 'dev' of git.echepei.com:caojunjie/Smart_platform_ui into dev

caojunjie 3 years ago
parent
commit
4c3ce92c79

+ 10 - 6
src/api/statisticAnalysis/salesReconciliation.js

@@ -3,7 +3,7 @@ import request from '@/router/axios';
 // 列表查询
 export const getList = (current, size, params) => {
   return request({
-    url: '/api/blade-purchase-sales/dealerOrder/orderItemStat',
+    url: '/api/blade-purchase-sales/exportOrder/orderReconciliation',
     method: 'get',
     params: {
       ...params,
@@ -12,11 +12,15 @@ export const getList = (current, size, params) => {
     }
   })
 }
-// 导出
-export function exportExcel(data) {
+// 列表查询
+export const getListDetail = (current, size, params) => {
   return request({
-    url: '/api/blade-purchase-sales/dealerOrder/orderItemStat/export',
-    method: 'post',
-    data
+    url: '/api/blade-purchase-sales/exportOrder/reconciliationDetailed',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size
+    }
   })
 }

+ 37 - 70
src/views/statisticAnalysis/salesReconciliation/index.vue

@@ -1,46 +1,21 @@
 <template>
   <div>
     <basic-container class="page-crad">
-      <avue-crud
-        ref="crud"
-        :option="option"
-        :data="dataList"
-        :page.sync="page"
-        :search.sync="search"
-        :cell-style="cellStyle"
-        @search-change="searchChange"
-        @current-change="currentChange"
-        @size-change="sizeChange"
-        @refresh-change="refreshChange"
-        @on-load="onLoad"
-        :table-loading="loading"
-        @saveColumn="saveColumn"
-        @resetColumn="resetColumn"
-        @search-criteria-switch="searchCriteriaSwitch"
-      >
+      <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
+        :cell-style="cellStyle" @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+        @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
+        @resetColumn="resetColumn" @search-criteria-switch="searchCriteriaSwitch">
         <template slot="menuLeft">
-          <el-button
-            type="info"
-            size="small"
-            @click="outExport"
-            icon="el-icon-download"
-            >导出</el-button
-          >
+          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
         </template>
         <template slot="corpNameSearch">
           <crop-select v-model="search.corpId" corpType="KH"></crop-select>
         </template>
         <template slot="storageNameSearch">
-          <warehouse-select
-            v-model="search.storageId"
-            :configuration="configurationWarehouse"
-          />
+          <warehouse-select v-model="search.storageId" :configuration="configurationWarehouse" />
         </template>
-        <template slot-scope="{ row }" slot="rankNo">
-          <span
-            style="color: #409EFF;cursor: pointer"
-            @click.stop="editOpen(row)"
-            >{{ row.rankNo }}
+        <template slot-scope="{ row }" slot="sysNo">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row)">{{ row.sysNo }}
           </span>
         </template>
       </avue-crud>
@@ -50,12 +25,10 @@
 
 <script>
 import { getToken } from "@/util/auth";
-import {
-  getList,
-  exportExcel
-} from "@/api/statisticAnalysis/salesReconciliation";
+import { getList } from "@/api/statisticAnalysis/salesReconciliation";
 import { micrometerFormat } from "@/util/validate";
 import _ from "lodash";
+import { Row } from "element-ui";
 export default {
   name: "index",
   data() {
@@ -90,7 +63,7 @@ export default {
         column: [
           {
             label: "系统编号",
-            prop: "rankNo",
+            prop: "sysNo",
             search: true,
             overHidden: true
           },
@@ -102,7 +75,7 @@ export default {
           },
           {
             label: "业务日期",
-            prop: "businesDate",
+            prop: "createTime",
             search: true,
             type: "date",
             format: "yyyy-MM-dd",
@@ -113,25 +86,25 @@ export default {
           },
           {
             label: "业务员",
-            prop: "a",
+            prop: "chargeMember",
             search: true,
             overHidden: true
           },
           {
             label: "收入",
-            prop: "b",
+            prop: "debitAmount",
             search: false,
             overHidden: true
           },
           {
             label: "成本",
-            prop: "c",
+            prop: "purchaseAmount",
             search: false,
             overHidden: true
           },
           {
             label: "利润",
-            prop: "d",
+            prop: "profit",
             search: false,
             overHidden: true
           }
@@ -197,21 +170,14 @@ export default {
       this.page.currentPage = 1;
       this.page.pageSize = val;
     },
-    onLoad(page, params) {
-      this.loading = true;
-      this.dataList.forEach(item => {
-        this.$refs.crud.toggleRowExpansion(item, false);
-      });
-      let queryParams = Object.assign({}, params);
-      if (queryParams.businesDate && queryParams.businesDate.length > 0) {
-        queryParams = {
-          ...queryParams,
-          orderStartDate: queryParams.businesDate[0] + " 00:00:00",
-          orderEndDate: queryParams.businesDate[1] + " 23:59:59"
-        };
-        delete queryParams.businesDate;
+    onLoad(page, params = {}) {
+      let data = this.deepClone(Object.assign({}, params, this.search));
+      if (data.createTime) {
+        data.beginCreateTime = data.createTime[0]
+        data.endCreateTime = data.createTime[1]
+        delete data.createTime
       }
-      getList(page.currentPage, page.pageSize, queryParams)
+      getList(page.currentPage, page.pageSize, data)
         .then(res => {
           if (res.data.data.records) {
             res.data.data.records.forEach(e => {
@@ -228,25 +194,27 @@ export default {
           this.loading = false;
         });
     },
-    editOpen() {
+    editOpen(row) {
       this.$router.push({
         path: "/statisticAnalysis/salesReconciliationDetails/index",
+        query: {
+          id: row.id
+        }
       });
     },
     outExport() {
       if (!this.search.corpId) this.$set(this.search, "corpId", "");
-      if (!this.search.storageId) this.$set(this.search, "storageId", "");
-      if (this.search.businesDate && this.search.businesDate.length > 0) {
+      if (this.search.createTime && this.search.createTime.length > 0) {
         this.search = {
           ...this.search,
-          orderStartDate: this.search.businesDate[0] + " 00:00:00",
-          orderEndDate: this.search.businesDate[1] + " 23:59:59"
+          orderStartDate: this.search.createTime[0] + " 00:00:00",
+          orderEndDate: this.search.createTime[1] + " 23:59:59"
         };
       } else {
         this.search = {
           ...this.search,
-          orderStartDate: "",
-          orderEndDate: ""
+          beginCreateTime: "",
+          endCreateTime: ""
         };
       }
       // return console.log(this.search)
@@ -257,12 +225,9 @@ export default {
       })
         .then(() => {
           window.open(
-            `/api/blade-purchase-sales/dealerOrder/orderItemStat/export?${
-              this.website.tokenHeader
-            }=${getToken()}&corpId=${this.search.corpId}&storageId=${
-              this.search.storageId
-            }&orderStartDate=${this.search.orderStartDate}&orderEndDate=${
-              this.search.orderEndDate
+            `/api/blade-purchase-sales/exportOrder/reconciliationExport?${this.website.tokenHeader
+            }=${getToken()}&corpId=${this.search.corpId}&chargeMember=${this.search.chargeMember}&sysNo=${this.search.sysNo
+            }&beginCreateTime=${this.search.beginCreateTime}&endCreateTime =${this.search.endCreateTime
             }`
           );
         })
@@ -311,9 +276,11 @@ export default {
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
 }
+
 ::v-deep .el-table__expanded-cell[class*="cell"] {
   padding: 0px;
 }
+
 .itemTable ::v-deep .el-table {
   width: 100%;
 }

+ 37 - 65
src/views/statisticAnalysis/salesReconciliationDetails/index.vue

@@ -1,40 +1,18 @@
 <template>
   <div>
     <basic-container class="page-crad">
-      <avue-crud
-        ref="crud"
-        :option="option"
-        :data="dataList"
-        :page.sync="page"
-        :search.sync="search"
-        :cell-style="cellStyle"
-        @search-change="searchChange"
-        @current-change="currentChange"
-        @size-change="sizeChange"
-        @refresh-change="refreshChange"
-        @on-load="onLoad"
-        :table-loading="loading"
-        @saveColumn="saveColumn"
-        @resetColumn="resetColumn"
-        @search-criteria-switch="searchCriteriaSwitch"
-      >
+      <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
+        :cell-style="cellStyle" @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+        @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
+        @resetColumn="resetColumn" @search-criteria-switch="searchCriteriaSwitch">
         <template slot="menuLeft">
-          <el-button
-            type="info"
-            size="small"
-            @click="outExport"
-            icon="el-icon-download"
-            >导出</el-button
-          >
+          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
         </template>
         <template slot="corpNameSearch">
           <crop-select v-model="search.corpId" corpType="KH"></crop-select>
         </template>
         <template slot="storageNameSearch">
-          <warehouse-select
-            v-model="search.storageId"
-            :configuration="configurationWarehouse"
-          />
+          <warehouse-select v-model="search.storageId" :configuration="configurationWarehouse" />
         </template>
       </avue-crud>
     </basic-container>
@@ -44,8 +22,7 @@
 <script>
 import { getToken } from "@/util/auth";
 import {
-  getList,
-  exportExcel
+  getListDetail
 } from "@/api/statisticAnalysis/salesReconciliation";
 import { micrometerFormat } from "@/util/validate";
 import _ from "lodash";
@@ -68,7 +45,7 @@ export default {
       defaultOption: {
         searchShow: true,
         align: "center",
-        searchMenuSpan: 16,
+        searchMenuSpan: 8,
         searchSpan: 8,
         border: true,
         index: true,
@@ -83,7 +60,7 @@ export default {
         column: [
           {
             label: "系统编号",
-            prop: "rankNo",
+            prop: "sysNo",
             search: true,
             overHidden: true
           },
@@ -95,7 +72,7 @@ export default {
           },
           {
             label: "业务日期",
-            prop: "businesDate",
+            prop: "createTime",
             search: true,
             type: "date",
             format: "yyyy-MM-dd",
@@ -106,13 +83,13 @@ export default {
           },
           {
             label: "业务员",
-            prop: "a",
+            prop: "chargeMember",
             search: true,
             overHidden: true
           },
           {
             label: "商品名称",
-            prop: "goodName",
+            prop: "cname",
             search: true,
             overHidden: true
           },
@@ -124,7 +101,7 @@ export default {
           },
           {
             label: "级别",
-            prop: "level",
+            prop: "specsTwo",
             search: false,
             overHidden: true
           },
@@ -154,19 +131,19 @@ export default {
           },
           {
             label: "收入",
-            prop: "b",
+            prop: "debitAmount",
             search: false,
             overHidden: true
           },
           {
             label: "成本",
-            prop: "c",
+            prop: "purchaseAmount",
             search: false,
             overHidden: true
           },
           {
             label: "利润",
-            prop: "d",
+            prop: "profit",
             search: false,
             overHidden: true
           }
@@ -233,20 +210,16 @@ export default {
       this.page.pageSize = val;
     },
     onLoad(page, params) {
-      this.loading = true;
-      this.dataList.forEach(item => {
-        this.$refs.crud.toggleRowExpansion(item, false);
-      });
-      let queryParams = Object.assign({}, params);
-      if (queryParams.businesDate && queryParams.businesDate.length > 0) {
-        queryParams = {
-          ...queryParams,
-          orderStartDate: queryParams.businesDate[0] + " 00:00:00",
-          orderEndDate: queryParams.businesDate[1] + " 23:59:59"
-        };
-        delete queryParams.businesDate;
+
+      let data = this.deepClone(Object.assign({}, params, this.search));
+      if (data.createTime) {
+        data.beginCreateTime = data.createTime[0]
+        data.endCreateTime = data.createTime[1]
+        delete data.createTime
       }
-      getList(page.currentPage, page.pageSize, queryParams)
+      data.id = this.$route.query.id
+      this.loading = true;
+      getListDetail(page.currentPage, page.pageSize, data)
         .then(res => {
           if (res.data.data.records) {
             res.data.data.records.forEach(e => {
@@ -282,34 +255,31 @@ export default {
     },
     outExport() {
       if (!this.search.corpId) this.$set(this.search, "corpId", "");
-      if (!this.search.storageId) this.$set(this.search, "storageId", "");
-      if (this.search.businesDate && this.search.businesDate.length > 0) {
+      if (this.search.createTime && this.search.createTime.length > 0) {
         this.search = {
           ...this.search,
-          orderStartDate: this.search.businesDate[0] + " 00:00:00",
-          orderEndDate: this.search.businesDate[1] + " 23:59:59"
+          orderStartDate: this.search.createTime[0] + " 00:00:00",
+          orderEndDate: this.search.createTime[1] + " 23:59:59"
         };
       } else {
         this.search = {
           ...this.search,
-          orderStartDate: "",
-          orderEndDate: ""
+          beginCreateTime: "",
+          endCreateTime: "",
+          id:this.$route.query.id
         };
       }
       // return console.log(this.search)
-      this.$confirm("是否导出销售对账信息?", "提示", {
+      this.$confirm("是否导出销售对账详情信息?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
       })
         .then(() => {
           window.open(
-            `/api/blade-purchase-sales/dealerOrder/orderItemStat/export?${
-              this.website.tokenHeader
-            }=${getToken()}&corpId=${this.search.corpId}&storageId=${
-              this.search.storageId
-            }&orderStartDate=${this.search.orderStartDate}&orderEndDate=${
-              this.search.orderEndDate
+            `/api/blade-purchase-sales/exportOrder/orderDetailedExpor?${this.website.tokenHeader
+            }=${getToken()}&corpId=${this.search.corpId}&chargeMember=${this.search.chargeMember}&cname=${this.search.cname}&sysNo=${this.search.sysNo
+            }&beginCreateTime=${this.search.beginCreateTime}&endCreateTime =${this.search.endCreateTime
             }`
           );
         })
@@ -358,9 +328,11 @@ export default {
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
 }
+
 ::v-deep .el-table__expanded-cell[class*="cell"] {
   padding: 0px;
 }
+
 .itemTable ::v-deep .el-table {
   width: 100%;
 }