Browse Source

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

caojunjie 3 years ago
parent
commit
1d4c3f2fa4

+ 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
+    })
+  }
+  

+ 24 - 12
src/main.js

@@ -73,7 +73,7 @@ import {
 // 导入弹窗放大样式
 import '@/assets/css/form.css'
 // 客户调出收发货地址
-import {corpAddr} from "@/components/function/corpAddrSelect"
+import { corpAddr } from "@/components/function/corpAddrSelect"
 //获取浏览器指纹并生成ID
 import Fingerprint2 from 'fingerprintjs2'
 Vue.component('trackPlayback', trackPlayback);
@@ -139,11 +139,11 @@ iconfontVersion.forEach(ele => {
 Vue.prototype.getColumnName = getColumnName
 Vue.prototype.getColumnData = getColumnData
 Vue.prototype.saveColumnData = saveColumnData
-Vue.prototype.delColumnData=delColumnData
+Vue.prototype.delColumnData = delColumnData
 //进入详情页时,保存id和其他参数
-Vue.prototype.inDetailsKey=inDetailsKey
+Vue.prototype.inDetailsKey = inDetailsKey
 //离开详情页时,清除对应key的id和其他参数
-Vue.prototype.leaveDetailsKey=leaveDetailsKey
+Vue.prototype.leaveDetailsKey = leaveDetailsKey
 Vue.config.productionTip = false;
 Vue.prototype.corpAddr = corpAddr;
 // 业务锁
@@ -174,7 +174,7 @@ Vue.directive("input-limit", {
       flag = true;
     });
     target.addEventListener("input", e => {
-      setTimeout(function() {
+      setTimeout(function () {
         if (flag) {
           if (binding.value == 0) {
             if (wins_0.test(e.target.value)) {
@@ -203,7 +203,7 @@ Vue.directive("input-limit", {
               if (!no_int) {
                 e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
                   '$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').substring(0, e.target.value.indexOf(
-                  ".") + 2)
+                    ".") + 2)
               } else {
                 e.target.value = e.target.value.replace(wins_0, "")
               }
@@ -231,7 +231,7 @@ Vue.directive("input-limit", {
               if (!no_int) {
                 e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
                   '$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').substring(0, e.target.value.indexOf(
-                  ".") + 3)
+                    ".") + 3)
               } else {
                 e.target.value = e.target.value.replace(wins_0, "")
               }
@@ -259,7 +259,7 @@ Vue.directive("input-limit", {
               if (!no_int) {
                 e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
                   '$#$', '.').substring(0, e.target.value.indexOf(
-                  ".") + 5)
+                    ".") + 5)
               } else {
                 e.target.value = e.target.value.replace(wins_0, "")
               }
@@ -271,8 +271,20 @@ Vue.directive("input-limit", {
     })
   }
 })
-Fingerprint2.get(function(components) {
-  const values = components.map(function(component,index) {
+
+Vue.directive('debounce', { //防抖函数指令
+  inserted: function (el, binding) {
+    el.addEventListener("click", () => {
+      if (!el.disabled)
+        el.disabled = true
+      setTimeout(() => {
+        el.disabled = false
+      }, binding.value || 1000);
+    });
+  }
+})
+Fingerprint2.get(function (components) {
+  const values = components.map(function (component, index) {
     if (index === 0) {
       return component.value.replace(/\bNetType\/\w+\b/, '')
     }
@@ -280,7 +292,7 @@ Fingerprint2.get(function(components) {
   })
   // 生成最终id murmur
   const murmur = Fingerprint2.x64hash128(values.join(''), 31)
-  if(localStorage.getItem('browserID')!=murmur){
-    localStorage.setItem('browserID',murmur)
+  if (localStorage.getItem('browserID') != murmur) {
+    localStorage.setItem('browserID', murmur)
   }
 })

+ 7 - 4
src/views/businessManagement/purchaseOrder/index.vue

@@ -33,7 +33,7 @@
           {{ scope.row.createFreight == 1 ? '是' : '否' }}
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button type="text" icon="el-icon-delete" size="small" @click.stop="createPlant(scope.row, scope.index)"
+          <el-button type="text" icon="el-icon-delete" size="small" v-debounce @click.stop="createPlant(scope.row, scope.index)"
             :disabled="scope.row.status > 0 || scope.row.createFreight == 1">生成工厂发货
           </el-button>
           <!--          <el-button-->
@@ -61,7 +61,8 @@
     <el-dialog append-to-body title="账单" class="el-dialogDeep" :visible.sync="financialAccountDialog" width="70%"
       :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
       <financial-account v-if="financialAccountDialog" :billType="billType" :billData="billData"
-        :checkData="financeData" :arrList="applyPaymentList" @choceFun="choceFun" tradeType="GN" @submit="feeSubmit" :addBut="false">
+        :checkData="financeData" :arrList="applyPaymentList" @choceFun="choceFun" tradeType="GN" @submit="feeSubmit"
+        :addBut="false">
       </financial-account>
     </el-dialog>
   </div>
@@ -520,8 +521,8 @@ export default {
           price,
           unit: '条',
           remarks: item.orderRemark,
-          itemorderAmount:item.orderAmount,
-          itemId:item.id
+          itemorderAmount: item.orderAmount,
+          itemId: item.id
         }
         a.push(form)
         // item.itemsList.forEach(e => {
@@ -574,6 +575,7 @@ export default {
     },
     // 生成工厂发货
     createPlant(row, index) {
+      console.log(111)
       let ids = [];
       row.itemsList.forEach(item => {
         ids.push(item.id)
@@ -588,6 +590,7 @@ export default {
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
+          this.loading = true
           res.data.data.orgId = res.data.data.id
           res.data.data.deliveryStatus = '录入'
           res.data.data.salesCompany = res.data.data.belongToCorpId

+ 17 - 14
src/views/businessManagement/salesOrder/index.vue

@@ -79,9 +79,9 @@
           <el-button type="info" size="small" icon="el-icon-download" @click="exportHandle">库 存</el-button>
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button type="text" size="small" @click="saveSell(scope.row)"
+          <el-button type="text" size="small" v-debounce @click="saveSell(scope.row)"
             :disabled="scope.row.status < 3 || scope.row.createPurchase == 1">生成采购</el-button>
-          <el-button type="text" size="small" @click="customerReceipt(scope.row)" :disabled="
+          <el-button type="text" size="small" v-debounce @click="customerReceipt(scope.row)" :disabled="
             !scope.row.status ||
             scope.row.status < 3 ||
             scope.row.createFreight == 1
@@ -150,8 +150,8 @@ export default {
       selection: [],
       isShow: true,
       detailData: {},
-      warehouseTypeOption:[],
-      warehouseList:[]
+      warehouseTypeOption: [],
+      warehouseList: []
     };
   },
   async created() {
@@ -605,12 +605,15 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
+        this.loading = true
         saveSell(row.id).then(res => {
           if (res.data.code == 200) {
             this.$message.success("生成成功");
-            this.onLoad(this.page, this.search);
           }
-        });
+        }).finally(() => {
+          this.loading = false;
+          this.onLoad(this.page, this.search);
+        })
       });
     },
     customerReceipt(row) {
@@ -651,7 +654,7 @@ export default {
               res.data.data.totalQuantity = 0
               res.data.data.totalCost = 0
               res.data.data.billType = 'FH'
-              res.data.data.saleman=res.data.data.chargeMember
+              res.data.data.saleman = res.data.data.chargeMember
               res.data.data.orderItemsList.forEach(item => {
                 item.containerVolume = item.cntrVolumn
                 item.actualWeight = item.cartonWeight
@@ -688,17 +691,17 @@ export default {
                 delete item.updateTime
                 delete item.updateUser
               })
-              this.warehouseTypeOption.forEach((item,index)=>{
-                if(index==0){
-                  res.data.data.warehouseType=item.dictValue
+              this.warehouseTypeOption.forEach((item, index) => {
+                if (index == 0) {
+                  res.data.data.warehouseType = item.dictValue
                 }
               })
-              this.warehouseList.forEach((item,index)=>{
-                if(index==0){
-                  res.data.data.storageId=item.id
+              this.warehouseList.forEach((item, index) => {
+                if (index == 0) {
+                  res.data.data.storageId = item.id
                 }
               })
-              res.data.data.businessDate=getCurrentDate()
+              res.data.data.businessDate = getCurrentDate()
               delete res.data.data.createTime
               delete res.data.data.id
               delete res.data.data.sysNo

+ 24 - 6
src/views/dealer/sales/detail.vue

@@ -74,7 +74,7 @@
       <containerTitle title="商品信息" />
       <basic-container>
         <avue-crud ref="crud" :data="dataList" :option="tableOption" :cell-style="cellStyle" @saveColumn="saveColumn"
-          @resetColumn="resetColumn">
+          @resetColumn="resetColumn" :table-loading="goodsLoading">
           <template slot="headerSerial" slot-scope="{ column }">
             <el-button type="primary" icon="el-icon-circle-plus-outline" circle size="mini" :disabled="
               disabled || !form.storageId || confirmDisabled || checkDisabled
@@ -308,6 +308,7 @@ export default {
   },
   data() {
     return {
+      goodsLoading: false,
       orderNumber: true,
       pageLoading: false,
       btnLoading: false,
@@ -829,7 +830,10 @@ export default {
             : 0
         );
         this.$set(form, "stock", a.balanceQuantity);
-      });
+      })
+        .finally(() => {
+          this.goodsLoading = false
+        });
       return form;
     },
     getStockInfo2(data) {
@@ -862,7 +866,10 @@ export default {
       let arr = [];
       await getLotNo(data).then(res => {
         arr = res.data.data ? res.data.data : [];
-      });
+      })
+        .finally(() => {
+          this.goodsLoading = false
+        });
       return arr;
     },
     importGoods() {
@@ -874,6 +881,7 @@ export default {
           this.selectionList.forEach(e => {
             this.dataList.forEach(async (item, index) => {
               if (index == this.reData.index) {
+                this.goodsLoading = true
                 getMarketPrice({ code: e.code, isFreight: 0, isLabel: 0 }).then(
                   response => {
                     if (response.data.data.length > 0) {
@@ -941,6 +949,7 @@ export default {
               itemId: e.id
             })
           });
+          this.goodsLoading = true
           salesOrderEntry({ typeId: 1, isFreight: 0, isLabel: 0, billType: "XS", tradeType: "JXS", storageId: this.form.storageId, salesOrderEntry: goodsList }).then(res => {
             let data = res.data.data
             arr.forEach((e, index) => {
@@ -967,8 +976,12 @@ export default {
                 $cellEdit: true
               });
             });
-          })
+          }).finally(() => {
+            this.goodsLoading = false
+          });
+
         } else {
+
           let goodsList = []
           let arr = []
           arr = this.selectionList
@@ -978,7 +991,9 @@ export default {
               itemId: e.id
             })
           });
+          this.goodsLoading = true
           salesOrderEntry({ typeId: 1, isFreight: 0, isLabel: 0, billType: "XS", tradeType: "JXS", storageId: this.form.storageId, salesOrderEntry: goodsList }).then(res => {
+
             let data = res.data.data
             arr.forEach((e, index) => {
               this.dataList.push({
@@ -1003,8 +1018,11 @@ export default {
                 batch: e.batch,
                 $cellEdit: true
               });
-            });
-          })
+            })
+          }).finally(() => {
+            this.goodsLoading = false
+          });
+
         }
       }
       this.dialogVisible = false;

+ 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,