瀏覽代碼

包装联调

qukaidi 3 年之前
父節點
當前提交
2aa2d2d908
共有 2 個文件被更改,包括 75 次插入34 次删除
  1. 23 0
      src/api/statisticAnalysis/packFeeRecon.js
  2. 52 34
      src/views/statisticAnalysis/packFeeRecon/index.vue

+ 23 - 0
src/api/statisticAnalysis/packFeeRecon.js

@@ -0,0 +1,23 @@
+import request from '@/router/axios';
+
+// 列表查询
+export const getList = (current, size, params) => {
+    return request({
+      url: '/api/blade-purchase-sales/exportOrder/selPackingFee',
+      method: 'get',
+      params: {
+        ...params,
+        current,
+        size
+      }
+    })
+  }
+  // 导出
+  export function exportExcel(params) {
+    return request({
+      url: '/api/blade-purchase-sales/exportOrder/selPackingFeeExport',
+      method: 'get',
+      params
+    })
+  }
+  

+ 52 - 34
src/views/statisticAnalysis/packFeeRecon/index.vue

@@ -19,22 +19,21 @@
         @search-criteria-switch="searchCriteriaSwitch"
       >
         <template slot="menuLeft">
-          <el-button
+          <!-- <el-button
             type="info"
             icon="el-icon-printer"
             size="small"
             :loading="exportLoading"
             @click.stop="statement"
           >报表打印
-          </el-button>
+          </el-button> -->
+          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
         </template>
         <template slot="brandSearch">
           <el-select
             v-model="search.brand"
             filterable
             clearable
-            multiple
-            collapse-tags
           >
             <el-option
               v-for="(item, index) in brandOption"
@@ -46,18 +45,12 @@
         </template>
       </avue-crud>
     </basic-container>
-    <report-dialog
-      :switchDialog="switchDialog"
-      :searchValue="statementData"
-      :reportName="'经销商-可用库存表'"
-      @onClose="onClose()"
-    />
   </div>
 </template>
 
 <script>
 import { getToken } from "@/util/auth";
-import { getList, exportExcel } from "@/api/statisticAnalysis/salesReconciliation";
+import { getList, exportExcel } from "@/api/statisticAnalysis/packFeeRecon";
 import { micrometerFormat } from "@/util/validate";
 import _ from "lodash";
 import reportDialog from "@/components/report-dialog/main";
@@ -87,7 +80,7 @@ export default {
       defaultOption: {
         searchShow: true,
         align: "center",
-        searchSpan: 8,
+        searchMenuSpan: 8,
         border: true,
         index: true,
         addBtn: false,
@@ -95,8 +88,8 @@ export default {
         editBtn: false,
         delBtn: false,
         showSummary: true,
-        searchIcon: true,
-        searchIndex: 2,
+        // searchIcon: true,
+        // searchIndex: 2,
         menu: false,
         column: [
           {
@@ -109,28 +102,30 @@ export default {
             label: "品牌",
             prop: "brand",
             search: true,
+            searchSpan: 8,
             overHidden: true,
           },
           {
             label: "制单日期",
-            prop: "createTime",
+            prop: "careteTime",
             search: true,
             type: 'date',
             format: "yyyy-MM-dd",
             valueFormat: "yyyy-MM-dd",
             unlinkPanels: true,
             searchRange: true,
+            searchSpan: 8,
             overHidden: true,
           },
           {
             label: "数量",
-            prop: "orderQuantity",
+            prop: "quantity",
             search: false,
             overHidden: true,
           },
           {
             label: "包装费用",
-            prop: "amount",
+            prop: "feesAmount",
             search: false,
             overHidden: true,
           },
@@ -157,15 +152,6 @@ export default {
     this.getWorkDicts('brand').then(res => {
       this.brandOption = res.data.data;
     })
-    let i = 0;
-    this.option.column.forEach(item => {
-      if (item.search) i++
-    })
-    if (i % 3 !== 0){
-      const num = 3 - Number(i % 3)
-      this.option.searchMenuSpan = num * 8;
-      this.option.searchMenuPosition = "right";
-    }
   },
   methods: {
     cellStyle() {
@@ -197,20 +183,52 @@ export default {
       this.page.currentPage = 1;
       this.page.pageSize = val;
     },
+    outExport(){
+      let params = { ...this.search }
+      if (!params.brand) this.$set(params, 'brand', '');
+      if (params.createTime && params.createTime.length > 0) {
+        params = {
+          ...params,
+          beginCreateTime: params.createTime[0] + ' 00:00:00',
+          endCreateTime: params.createTime[1] + ' 23:59:59',
+        }
+      } else {
+        params = {
+          ...params,
+          beginCreateTime: '',
+          endCreateTime: '',
+        }
+      }
+      this.$confirm('是否导出数据明细?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        window.open(
+          `/api/blade-purchase-sales/exportOrder/selPackingFeeExport?${this.website.tokenHeader
+          }=${getToken()}&brand=${params.brand}&beginCreateTime=${params.beginCreateTime}&endCreateTime=${params.endCreateTime}`
+        );
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消' //
+        });
+      })
+    },
     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;
+      if (this.search.careteTime && this.search.careteTime.length > 0) {
+        params = {
+          ...params,
+          beginCreateTime: this.search.careteTime[0],
+          endCreateTime: this.search.careteTime[1]
+        };
       }
+      let queryParams = Object.assign({}, params);
+      delete queryParams.careteTime;
       getList(
         page.currentPage,
         page.pageSize,