Przeglądaj źródła

提交达沃特

caojunjie 3 lat temu
rodzic
commit
cda0524e33

+ 7 - 2
src/util/date.js

@@ -65,7 +65,12 @@ export function defaultDate(type) {
       dateFormat(startDate, "yyyy-MM-dd"),
       dateFormat(endDate, "yyyy-MM-dd")
     ];
-  } else {
+  }else if (type == 3){
+    return[
+      dateFormat(new Date(date.getFullYear(), date.getMonth(), 1), "yyyy-MM-dd"),
+      dateFormat(new Date((date.getMonth() + 1) === 12?date.getFullYear()+1:date.getFullYear(), (date.getMonth() + 1), 1), "yyyy-MM-dd")
+    ];
+  }else {
     return [
       dateFormat(startDate, "yyyy-MM-dd") + " 00:00:00",
       dateFormat(endDate, "yyyy-MM-dd") + " 23:59:59"
@@ -109,4 +114,4 @@ export function getCurrentDate(type = 'dateTime') {
 export function getYearDate(){
   const date = new Date();
   return date.getFullYear()
-}
+}

+ 3 - 5
src/views/approveData/index.vue

@@ -278,6 +278,7 @@ export default {
       console.log("1");
     },
     selectionChange(list) {
+      this.idList = []
       this.selectionList = list;
     },
     currentChange(val) {
@@ -299,13 +300,10 @@ export default {
     onLoad(page, params) {
       this.loading = true;
       params = this.paramsAdjustment(params);
-
-      getList(page.currentPage, page.pageSize, params)
-        .then(res => {
+      getList(page.currentPage, page.pageSize, params).then(res => {
           this.dataList = res.data.data.records;
           this.page.total = res.data.data.total;
-        })
-        .finally(() => {
+        }).finally(() => {
           this.loading = false;
         });
     },

+ 17 - 16
src/views/basicData/productInformation/detailsPageEdit.vue

@@ -457,22 +457,23 @@ export default {
     },
     //修改提交触发
     editProductInfo() {
-      let list = []
-      if(this.bankOfDepositData.length>0){
-        for (let item of this.bankOfDepositData){
-          if (item.version == 0){
-            list.push(item.version)
-          }
-        }
-      }else {
-        return this.$message.error("请上传附件!");
-      }
-      if (!(list.indexOf('0') !== -1)){
-        return this.$message.error("附件无主图,请选择其中一个文件属性为主图!");
-      }
-      if (new Set(list).size !== list.length){
-        return this.$message.error("主图重复");
-      }
+      //附件必填
+      // let list = []
+      // if(this.bankOfDepositData.length>0){
+      //   for (let item of this.bankOfDepositData){
+      //     if (item.version == 0){
+      //       list.push(item.version)
+      //     }
+      //   }
+      // }else {
+      //   return this.$message.error("请上传附件!");
+      // }
+      // if (!(list.indexOf('0') !== -1)){
+      //   return this.$message.error("附件无主图,请选择其中一个文件属性为主图!");
+      // }
+      // if (new Set(list).size !== list.length){
+      //   return this.$message.error("主图重复");
+      // }
       this.$refs["form"].validate((valid, done) => {
         done();
         //校验明细列表

+ 2 - 1
src/views/businessManagement/deliveryNotice/index.vue

@@ -153,7 +153,8 @@ export default {
     }
   },
   async created() {
-    this.search.businessDate = defaultDate(1)
+    // this.search.businessDate = defaultDate(1)
+    this.search.createTime = defaultDate(3)
     this.option = option
       // this.option = await this.getColumnData(this.getColumnName(20), option);
     gainUser().then(res => {

+ 4 - 5
src/views/businessManagement/proxyOrder/index.vue

@@ -167,16 +167,15 @@ export default {
     }
   },
   async created() {
-    this.search.businesDate = defaultDate(1)
+    // this.search.businesDate = defaultDate(1)
+    this.search.createTime = defaultDate(3)
     // this.option = option
     this.option = await this.getColumnData(this.getColumnName(14), option);
     this.getWorkDicts("payment_term").then(res => {
-      this.findObject(this.option.column, "paymentType").dicData =
-        res.data.data;
+      this.findObject(this.option.column, "paymentType").dicData = res.data.data;
     });
     this.getWorkDicts("order_status").then(res => {
-      this.findObject(this.option.column, "orderStatus").dicData =
-        res.data.data;
+      this.findObject(this.option.column, "orderStatus").dicData = res.data.data;
     });
     gainUser().then(res => {
       this.findObject(this.option.column, "createUser").dicData = res.data.data;

+ 2 - 1
src/views/businessManagement/purchaseOrder/index.vue

@@ -139,7 +139,8 @@ export default {
     }
   },
   async created() {
-    this.search.requiredArrivalDate = defaultDate(1)
+    // this.search.requiredArrivalDate = defaultDate(1)
+    this.search.createTime = defaultDate(3)
     // this.option = option
     this.option = await this.getColumnData(this.getColumnName(17), option);
     this.getWorkDicts("payment_term").then(res => {

+ 2 - 1
src/views/businessManagement/receipt/index.vue

@@ -143,7 +143,8 @@ export default {
     }
   },
   async created() {
-    this.search.businessDate = defaultDate(1)
+    // this.search.businessDate = defaultDate(1)
+    this.search.createTime = defaultDate(3)
     // this.option = option
     this.option = await this.getColumnData(this.getColumnName(23), option);
     gainUser().then(res => {

+ 34 - 34
src/views/businessManagement/salesOrder/configuration/customerContact.json

@@ -132,18 +132,48 @@
           "trigger": "blur"
         }
       ]
-    },
+    },{
+    "label": "订货数量",
+    "prop": "orderQuantity",
+    "index": 5,
+    "width":100,
+    "cell": false,
+    "slot": true,
+    "overHidden": true,
+    "rules": [
+      {
+        "required": false,
+        "message": "请输入订货数量",
+        "trigger": "blur"
+      }
+    ]
+  },{
+    "label": "发货数量",
+    "prop": "actualQuantity",
+    "index": 6,
+    "width":100,
+    "cell": false,
+    "slot": true,
+    "overHidden": true,
+    "rules": [
+      {
+        "required": false,
+        "message": "请输入发货数量",
+        "trigger": "blur"
+      }
+    ]
+  },
     {
       "label": "尺寸",
       "prop": "size",
-      "index": 5,
+      "index": 7,
       "width":150,
       "cell": false,
       "overHidden": true
     },{
       "label": "供应商",
       "prop": "corpName",
-      "index": 6,
+      "index": 8,
       "width":250,
       "cell": false,
       "slot": true,
@@ -158,7 +188,7 @@
     },{
       "label": "质量胎",
       "prop": "shopQuality",
-      "index": 7,
+      "index": 9,
       "width":140,
       "cell": false,
       "slot": true,
@@ -171,36 +201,6 @@
         }
       ]
     },{
-      "label": "订货数量",
-      "prop": "orderQuantity",
-      "index": 8,
-      "width":100,
-      "cell": false,
-      "slot": true,
-      "overHidden": true,
-      "rules": [
-        {
-          "required": false,
-          "message": "请输入订货数量",
-          "trigger": "blur"
-        }
-      ]
-    },{
-      "label": "发货数量",
-      "prop": "actualQuantity",
-      "index": 9,
-      "width":100,
-      "cell": false,
-      "slot": true,
-      "overHidden": true,
-      "rules": [
-        {
-          "required": false,
-          "message": "请输入发货数量",
-          "trigger": "blur"
-        }
-      ]
-    },{
       "label": "库存",
       "prop": "storageQuantity",
       "index": 10,

+ 30 - 20
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -2843,7 +2843,6 @@ export default {
       if (this.policyDataTwo.length > 0 || this.goodsListPolicy.length > 0 || this.buyAndGiveList.length >0) {
         buyFree = this.deepClone((this.policyDataTwo.concat(this.goodsListPolicy)).concat(this.buyAndGiveList))
       }
-      console.log(buyFree)
       for (let item in list) {
         if (this.policyData.length > 0 || this.buyAndGiveList > 0) {
           if (!list[item].specialOffer) {
@@ -2880,6 +2879,7 @@ export default {
           this.$set(buyFree[item], 'price', '0')
           this.$set(buyFree[item], 'orderQuantity',  list[item].salesVolume)
           this.$set(buyFree[item], 'itemType',  list[item].typeno)
+          this.$set(list[item], 'goodType', 0)
         }
         selectGoodsNum({
           goodsId: list[item].itemId,
@@ -2890,7 +2890,7 @@ export default {
           if (listLength != 0) {
             this.$set(buyFree[item], 'storageQuantity', res.data.data)
           }
-
+          this.$set(list[item], 'goodType', 0)
           this.$set(list[item], 'itemType',  list[item].typeno)
           this.$set(list[item], 'actualQuantity', 0)
           this.$set(list[item], 'orderQuantity', list[item].orderQuantity? list[item].orderQuantity: 0)
@@ -2918,6 +2918,7 @@ export default {
             this.$set(buyFree[item], 'integralMultiples', 0)
             this.$set(buyFree[item], 'integral', 0)
             this.$set(buyFree[item], 'shopQuality', 0)
+            this.$set(buyFree[item], 'goodType', 0)
             this.maxGoodsNum++
             delete buyFree[item].id
             delete buyFree[item].pid
@@ -3152,13 +3153,13 @@ export default {
       })
     },
     //修改提交触发
-    editCustomer(isBack = false, type,other) {
-      this.$refs["form"].validate((valid) => {
+    async editCustomer(isBack = false, type,other) {
+      this.$refs["form"].validate(async (valid) => {
         if (valid) {
-          const length = this.goodsActives === 'gift'? this.contactsData.length: this.goodsShowData.length
-          const length1 = this.goodsActives === 'goods'? this.giftData: this.goodsShowData
-          for (let i = 0;i < length;i++) {
-            const data = this.goodsActives === 'gift'? this.contactsData: this.goodsShowData;
+          const length = this.goodsActives === 'gift' ? this.contactsData.length : this.goodsShowData.length
+          const length1 = this.goodsActives === 'goods' ? this.giftData : this.goodsShowData
+          for (let i = 0; i < length; i++) {
+            const data = this.goodsActives === 'gift' ? this.contactsData : this.goodsShowData;
             if (Number(data[i].orderQuantity) > Number(data[i].storageQuantity)) {
               return this.$message.error('商品信息第' + (Number(i) + 1) + '行订货数量大于库存数量')
             }
@@ -3186,12 +3187,11 @@ export default {
           // inputMold判断是商品还是政策 商品 0 特价 1 买赠2,isSpecial 0正常 1特价
           goodsData.filter(item => item.inputMold === 1 && item.isSpecial === 1).forEach(item => specialNum += Number(item.orderQuantity));
           goodsData.filter(item => Number(item.size) >= 17).forEach(item => sizeNum += Number(item.orderQuantity));
-          this.$set(this.form, 'specialOfferOf', allNum == 0? '0.00': (specialNum / allNum * 100).toFixed(2));
-
-          this.$set(this.form, 'largeScale', allNum == 0? '0.00': (sizeNum / allNum * 100).toFixed(2));
+          this.$set(this.form, 'specialOfferOf', allNum == 0 ? '0.00' : (specialNum / allNum * 100).toFixed(2));
+          this.$set(this.form, 'largeScale', allNum == 0 ? '0.00' : (sizeNum / allNum * 100).toFixed(2));
           for (let item in this.goodsData) {
             if (Number(goodsData[item].orderQuantity) > Number(goodsData[item].storageQuantity)) {
-              return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能超过库存')
+              return this.$message.error('商品信息第' + (parseInt(item) + 1) + '行订货数量不能超过库存')
             }
           }
           this.form.orderFeesList = this.$refs.feeInfo.submitData()
@@ -3204,8 +3204,8 @@ export default {
             return this.$message.error('费用明细未有包装费')
           }
           // 产生返利、本次使用返利为空 默认为0
-          this.form.createProfit = this.form.createProfit? this.form.createProfit: 0
-          this.form.thisUsedProfit = this.form.thisUsedProfit? this.form.thisUsedProfit: 0
+          this.form.createProfit = this.form.createProfit ? this.form.createProfit : 0
+          this.form.thisUsedProfit = this.form.thisUsedProfit ? this.form.thisUsedProfit : 0
           // 计算毛利额
           this.$set(this.form, 'orderAmount', 0)
           // 成本价
@@ -3216,6 +3216,7 @@ export default {
           // 销售金额
           this.form.orderAmount = 0;
           // 计算销售金额
+          console.log(this.form.orderItemsList)
           this.form.orderItemsList.forEach(item => {
             if (item.goodType == 0) {
               if (item.purchaseAmount) {
@@ -3224,7 +3225,6 @@ export default {
               this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
             }
           })
-          this.computedCost()
           // 判断订货数量不能小于等于0
           for (let item in this.form.orderItemsList) {
             if (Number(this.form.orderItemsList[item].orderQuantity) <= 0) {
@@ -3240,9 +3240,10 @@ export default {
           // 如果有id解锁,没有跳过
           // this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
           this.saveLoading = true
+          await this.computedCost()
           typeSave(this.form).then(res => {
             // this.$set(this.detailData, 'seeDisabled', true);
-            if (!other){
+            if (!other) {
               this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
             }
             if (isBack) {
@@ -3251,7 +3252,7 @@ export default {
               this.leaveDetailsKey(this.$route.name)
             } else {
               this.saveActives = ''
-              this.queryData(res.data.data.id,false,other)
+              this.queryData(res.data.data.id, false, other)
             }
             if (type == '发货') {
               let lsit = []
@@ -3267,7 +3268,7 @@ export default {
                 this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
                 this.$router.push({
                   path: "/businessManagement/deliveryNotice/index",
-                  query: {form: JSON.stringify(res.data.data),pageType: "Generate",},
+                  query: {form: JSON.stringify(res.data.data), pageType: "Generate",},
                 });
               })
             } else if (type == '采购') {
@@ -3288,7 +3289,7 @@ export default {
                 });
               });
             } else if (type == '收费') {
-              this.beforeBillData(true,type)
+              this.beforeBillData(true, type)
               this.applySettlementDialog = true;
             }
           }).finally(() => {
@@ -3538,7 +3539,16 @@ export default {
                 cartonWeight = _.add(cartonWeight, Number(e.cartonWeight));
                 cntrVolumn = _.add(cntrVolumn, Number(e.cntrVolumn));
               })
-            }
+            }else {{
+              this.goodsShowData.forEach(e => {
+                amountSum = _.add(amountSum, Number(e.amount));
+                orderQuantitySum = _.add(orderQuantitySum, Number(e.orderQuantity));
+                actualQuantitySum = _.add(actualQuantitySum, Number(e.actualQuantity));
+                integralSum = _.add(integralSum, Number(e.integral));
+                cartonWeight = _.add(cartonWeight, Number(e.cartonWeight));
+                cntrVolumn = _.add(cntrVolumn, Number(e.cntrVolumn));
+              })
+            }}
             // 订货数量合计
             if (item.property == "orderQuantity") {
               sums[index] = orderQuantitySum ? orderQuantitySum.toFixed(0) : "0";

+ 2 - 1
src/views/businessManagement/salesOrder/index.vue

@@ -155,7 +155,8 @@ export default {
     };
   },
   async created() {
-    this.search.businesDate = defaultDate(1);
+    // this.search.businesDate = defaultDate(1);
+    this.search.createTime = defaultDate(3);
     // this.option = option
     this.option = await this.getColumnData(this.getColumnName(14), option);
     this.getWorkDicts("payment_term").then(res => {

+ 14 - 9
src/views/statisticAnalysis/salesDetails/index.vue

@@ -291,15 +291,20 @@ export default {
     editOpen(row) {
     },
     outExport() {
-      // if (!this.search.billType) {
-      //   return this.$message.error("请选择类别");
-      // }
-      // window.open(
-      //   `/api/blade-purchase-sales/exportOrder/exportProfit?${
-      //     this.website.tokenHeader
-      //   }=${getToken()}&billType=${this.search.billType}`
-      // );
-    },
+      let queryParams = this.search
+      if (queryParams.arrivalTime) {
+        queryParams.beginCreateTime = queryParams.careteTime[0]
+        queryParams.endCreateTime = queryParams.careteTime[1]
+        delete queryParams.careteTime
+      }
+      const routeData = this.$router.resolve({
+        path: '/api/blade-land/order/acct-export',      //跳转目标窗口的地址
+        query: {
+          ...queryParams    //括号内是要传递给新窗口的参数
+        }
+      })
+      window.open(routeData.href.slice(1,routeData.href.length-1)+'&'+`${this.website.tokenHeader}=${getToken()}`);
+    }
   }
 };
 </script>

+ 653 - 0
src/views/warehousing/analysis/index.vue

@@ -0,0 +1,653 @@
+<template>
+  <div class="app-container">
+    <basic-container></basic-container>
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      v-show="showSearch"
+      label-width="70px"
+      size="small"
+    >
+      <el-row>
+        <el-col :xs="12" :sm="6">
+          <el-form-item label="客户名称">
+            <el-select
+              v-model="queryParams.fCorpid"
+              clearable
+              filterable
+              placeholder="请输入客户名称"
+            >
+              <el-option
+                v-for="(item, index) in fMblnoOptions"
+                :key="index.fId"
+                :label="item.fName"
+                :value="item.fId"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="12" :sm="6">
+          <el-form-item label="提单号">
+            <el-input
+              v-model="queryParams.fMblno"
+              placeholder="请输入提单号"
+              clearable
+              style="width: 200px"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :xs="12" :sm="6">
+          <el-form-item label="仓库">
+            <el-select v-model="queryParams.fWarehouseid" placeholder="请选择仓库库区" clearable filterable>
+              <el-option
+                v-for="(item, index) in warehouseOptions"
+                :key="index.fId"
+                :label="item.fName"
+                :value="item.fId"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="12" :sm="6">
+          <el-form-item label="库管员">
+            <el-select
+              v-model="queryParams.fStorekeeper"
+              filterable
+              clearable
+              placeholder="请选择库管员"
+            >
+              <el-option
+                v-for="(item, index) in userOptions"
+                :key="index.userName"
+                :label="item.nickName"
+                :value="item.userName"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row v-show="show">
+        <el-col :xs="12" :sm="6">
+          <el-form-item label="截止日期">
+            <el-date-picker
+              v-model="queryParams.fBsdate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              clearable
+              style="width: 200px"
+              placeholder="选择日期"
+            ></el-date-picker>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <!--      列设置-->
+      <el-dialog title="提示" :visible.sync="showSetting" width="700px" v-dialogDrag append-to-body>
+        <template slot="title">
+          <div class="avue-crud__dialog__header">
+            <span class="el-dialog__title">
+            <span
+              style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
+            </span>
+          </div>
+        </template>
+        <div>配置排序列数据(拖动调整顺序)</div>
+        <div style="margin-left: 17px">
+          <el-checkbox
+            v-model="allCheck"
+            label="全选"
+            @change="allChecked"
+          ></el-checkbox>
+        </div>
+        <div style="padding: 4px; display: flex; justify-content: center">
+          <draggable
+            v-model="setRowList"
+            group="site"
+            animation="300"
+            @start="onStart"
+            @end="onEnd"
+            handle=".indraggable"
+          >
+            <transition-group>
+              <div
+                v-for="item in setRowList"
+                :key="item.surface"
+                class="listStyle"
+              >
+                <div style="width: 500px" class="indraggable">
+                  <div class="progress" :style="{ width: item.width + 'px' }">
+                    <el-checkbox
+                      :label="item.name"
+                      v-model="item.checked"
+                      :true-label="0"
+                      :false-label="1"
+                    >{{ item.name }}
+                    </el-checkbox>
+                  </div>
+                </div>
+                <el-input-number
+                  v-model.number="item.width"
+                  controls-position="right"
+                  :min="1"
+                  :max="500"
+                  size="mini"
+                ></el-input-number>
+              </div>
+            </transition-group>
+          </draggable>
+        </div>
+        <span slot="footer" class="dialog-footer">
+        <el-button @click="showSetting = false">取 消</el-button>
+        <el-button @click="delRow" type="danger">重 置</el-button>
+        <el-button type="primary" @click="save()">确 定</el-button>
+      </span>
+      </el-dialog>
+
+      <el-row :gutter="10" style="padding-bottom: 10px">
+        <el-col :span="1.5">
+          <el-button
+            type="warning"
+            icon="el-icon-download"
+            size="mini"
+            @click="handleExport"
+          >导出</el-button>
+        </el-col>
+        <div class="tabSetting">
+          <div style="margin-right: 20px">
+            <el-button
+              type="cyan"
+              icon="el-icon-search"
+              size="mini"
+              @click="handleQuery"
+            >搜索</el-button
+            >
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+            >重置</el-button
+            >
+            <el-button
+              v-show="show"
+              @click="show = !show"
+              icon="el-icon-arrow-up"
+              size="mini"
+              style="border: 1px dashed #dedddd"
+            >展开</el-button
+            >
+            <el-button
+              v-show="!show"
+              @click="show = !show"
+              icon="el-icon-arrow-down"
+              size="mini"
+              style="border: 1px dashed #dedddd"
+            >展开</el-button
+            >
+            <right-toolbar
+              :showSearch.sync="showSearch"
+              @queryTable="getList"
+            ></right-toolbar>
+            <div style="margin: 0 12px;float: right">
+              <el-button
+                icon="el-icon-setting"
+                size="mini"
+                circle
+                @click="showSetting = !showSetting"
+              ></el-button>
+            </div>
+          </div>
+        </div>
+      </el-row>
+    </el-form>
+    <el-tabs v-model="activeName" @tab-click="tabsHandle">
+      <el-tab-pane label="出库" name="outStock"></el-tab-pane>
+      <el-tab-pane label="在库" name="inStock"></el-tab-pane>
+    </el-tabs>
+    <el-table
+      ref="table"
+      v-loading="loading"
+      :data="dataList"
+      show-summary
+      :summary-method="getSum"
+      :height="tableHeight"
+      stripe
+    >
+      <el-table-column
+        type="index"
+        label="行号"
+        align="center"
+        fixed
+      />
+      <el-table-column
+        v-for="(item, index) in getRowList"
+        :key="index"
+        :label="item.name"
+        :width="item.width"
+        :prop="item.label"
+        align="center"
+        :fixed="item.fixed"
+        :show-overflow-tooltip="true"
+        sortable
+        v-if="item.show"
+      >
+        <template slot-scope="scope">
+          <span v-if="item.label == 'fBsdate'">
+            {{ scope.row.fBsdate | fBsdateFormat }}
+          </span>
+          <span v-else-if="item.label == 'fMblno'">
+            <el-link :underline="false" type="primary" v-if="activeName == 'outStock'">
+              <span @click="jumpPage(scope.row)">{{ scope.row.fMblno }}</span>
+            </el-link>
+            <span v-else>{{ scope.row.fMblno }}</span>
+          </span>
+          <span v-else-if="item.label == 'fBilltype'">
+            {{ scope.row.fBilltype | billTypeFormat(billTypeList) }}
+          </span>
+          <span v-else-if="item.label == 'fCorpid'">
+            {{ scope.row.fCorpid | fMblnoFormat(fMblnoOptions) }}
+          </span>
+          <span v-else>{{ scope.row[item.label] }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+// import { listCorps } from "@/api/basicdata/corps";
+// import { listWarehousesss } from "@/api/basicdata/warehouse";
+// import { queryClerkRoleList } from "@/api/warehouseBusiness/warehouseInStock";
+// import { getList, exportData } from "@/api/warehouseBusiness/warehouseAnalysis";
+import Cookies from "js-cookie";
+// import {addSet, resetModule, select} from '@/api/system/set';
+import draggable from "vuedraggable";
+
+export default {
+  name: "index",
+  components: {
+    draggable
+  },
+  data() {
+    return {
+      loading: false,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      total: 0,
+      dataList: [],
+      tableHeight: '300',
+      // 显示搜索条件
+      showSearch: true,
+      fMblnoOptions: [], //客户
+      warehouseOptions: [], //仓库
+      userOptions: [],
+      billTypeList: [],
+      activeName: 'outStock',
+      disabledName: 'outStock',
+      show: false,
+
+      // 设置列开关
+      showSetting: false,
+      setRowList: [],
+      getRowList: [],
+      //自定义列宽
+      allCheck: false,
+      drag: false,
+      tableDate:[
+        {
+          surface: "1",
+          label: "fBilltype",
+          name: "业务类型",
+          checked: 0,
+          width: 100,
+          show: true,
+        },
+        {
+          surface: "2",
+          label: "fCorpid",
+          name: "客户名称",
+          checked: 0,
+          width: 120,
+          show: true,
+        },
+        {
+          surface: "2",
+          label: "fName",
+          name: "品名",
+          checked: 0,
+          width: 100,
+          show: true,
+        },
+        {
+          surface: "3",
+          label: "fMblno",
+          name: "提单号",
+          checked: 0,
+          width: 130,
+          show: true,
+        },
+        {
+          surface: "4",
+          label: "fQty",
+          name: "件数",
+          checked: 0,
+          width: 80,
+          show: true,
+        },
+        {
+          surface: "5",
+          label: "fGrossweight",
+          name: "毛重",
+          checked: 0,
+          width: 120,
+          show: true,
+        },
+        {
+          surface: "6",
+          label: "fWarehouseInformation",
+          name: "仓库",
+          checked: 0,
+          width: 150,
+          show: true,
+        },
+        {
+          surface: "7",
+          label: "fOriginalbilldate",
+          name: "入库日期",
+          checked: 0,
+          width: 150,
+          show: true,
+        },
+        {
+          surface: "8",
+          label: "fBsdate",
+          name: "出库日期",
+          checked: 0,
+          width: 150,
+          show: true,
+        },
+        {
+          surface: "9",
+          label: "fStorekeeper",
+          name: "仓管员",
+          checked: 0,
+          width: 150,
+          show: true,
+        },
+        {
+          surface: "10",
+          label: "createBy",
+          name: "制单人",
+          checked: 0,
+          width: 150,
+          show: true,
+        },
+        {
+          surface: "11",
+          label: "createTime",
+          name: "制单日期",
+          checked: 0,
+          width: 150,
+          show: true,
+        },
+      ],
+    }
+  },
+  created() {
+    this.setRowList = this.tableDate;
+    this.getRowList = this.tableDate;
+    this.getDicts("data_billtype_type").then((response) => {
+      this.billTypeList = response.data;
+    });
+    listCorps({ type: 1 }).then((response) => {
+      this.fMblnoOptions = response.rows;
+    });
+    listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
+      this.warehouseOptions = response.rows;
+    });
+    queryClerkRoleList().then((response) => {
+      this.userOptions = response.data;
+    });
+    this.getList();
+    this.getRow();
+  },
+  mounted() {
+    this.$nextTick(() => {
+      // 监听浏览器高度变化,改变表格高度
+      window.onresize = () => {
+        this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 85
+      }
+    })
+  },
+  filters: {
+    fBsdateFormat(row) {
+      if (row) {
+        const dateMat = new Date(row);
+        const year = dateMat.getFullYear();
+        const month = dateMat.getMonth() + 1;
+        const day = dateMat.getDate();
+        const timeFormat = year + "-" + month + "-" + day;
+        return timeFormat;
+      }
+    },
+    billTypeFormat(row, billTypeList) {
+      let type;
+      billTypeList.map((e) => {
+        if (row == e.dictValue) {
+          type = e.dictLabel;
+        }
+      });
+      return type;
+    },
+    fMblnoFormat(row, fMblnoOptions) {
+      let name;
+      fMblnoOptions.map((e) => {
+        if (row == e.fId) {
+          name = e.fName;
+        }
+      });
+      return name;
+    },
+  },
+  methods: {
+    getList() {
+      const data = {
+        type: 2, // 1入 2出
+        ...this.queryParams
+      }
+      if (this.activeName == 'outStock') {
+        data.type = 2;
+      } else {
+        data.type = 1;
+      }
+      this.loading = true
+      getList(data).then(res => {
+        this.dataList = res.rows
+        this.total = res.total;
+      }).finally(() => {
+        this.loading = false
+      })
+      setTimeout(() => {
+        this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 85
+      }, 300)
+    },
+    // 搜索
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.queryParams.pageSize = 10;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+      }
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    //导出
+    handleExport() {
+      const type = this.activeName == 'outStock'? 2: 1
+      const query = {...this.queryParams, type}
+      this.$confirm(type == 2?"是否确认导出出库数据项?": "是否确认导出在库数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        return exportData(query)
+      }).then(res => {
+        this.download(res.msg);
+      })
+    },
+    //合计
+    getSum(param) {
+      const { columns, data } = param;
+      const sums = [];
+      var values = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = "合计";
+          return;
+        }
+        if (column.property === "fGrossweight") {
+          values = data.map((item) => Number(item["fGrossweight"]));
+        }
+        if (column.property === "fQty") {
+          values = data.map((item) => Number(item["fQty"]));
+        }
+        if (
+          column.property === "fGrossweight" ||
+          column.property === "fQty"
+        ) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          if (column.property === "fGrossweight") {
+            sums[index] = (sums[index] / 1000).toFixed(4) + "(吨)";
+          }
+          if (column.property === "fQty") {
+            // sums[index] = sums[index].toFixed(2);
+            sums[index] = sums[index];
+          }
+        }
+      });
+      return sums;
+    },
+    tabsHandle(data) {
+      if (this.disabledName == data.name) return
+      this.disabledName = data.name
+      this.tableDate.forEach(item => {
+        if (this.activeName == 'inStock') {
+          if (item.label == 'fBsdate') {
+            item.show = false
+          }
+        } else {
+          item.show = true
+        }
+      })
+      this.getList()
+      this.$nextTick(() => {
+        this.$refs.table.doLayout()
+      })
+    },
+    jumpPage(row) {
+      if (this.activeName == 'outStock') {
+        this.$router.push({
+          path: "/business/outStock",
+          query: { id: row.fId },
+        });
+      }
+    },
+
+
+    //列设置全选
+    allChecked() {
+      if (this.allCheck == true) {
+        this.setRowList.map((e) => {
+          return (e.checked = 0);
+        });
+      } else {
+        this.setRowList.map((e) => {
+          return (e.checked = 1);
+        });
+      }
+    },
+    //开始拖拽事件
+    onStart() {
+      this.drag = true;
+    },
+    //拖拽结束事件
+    onEnd() {
+      this.drag = false;
+    },
+    //重置列表
+    delRow() {
+      this.data = {
+        tableName: "仓储分析列表",
+        userId: Cookies.get("userName"),
+      };
+      resetModule(this.data).then((res) => {
+        if (res.code == 200) {
+          this.showSetting = false;
+          this.setRowList = this.tableDate;
+          console.log(this.setRowList)
+          this.getRowList = this.tableDate;
+        }
+      });
+    },
+    //保存列设置
+    save() {
+      this.showSetting = false;
+      this.data = {
+        tableName: "仓储分析列表",
+        userId: Cookies.get("userName"),
+        sysTableSetList: this.setRowList,
+      };
+      addSet(this.data).then((res) => {
+        this.getRowList = this.setRowList.filter((e) => e.checked == 0);
+      });
+    },
+    //查询列数据
+    getRow() {
+      let that = this;
+      this.data = {
+        tableName: "仓储分析列表",
+        userId: Cookies.get("userName"),
+      };
+      select(this.data).then((res) => {
+        if (res.data.length != 0) {
+          this.getRowList = res.data.filter((e) => e.checked == 0);
+          this.setRowList = res.data;
+          this.setRowList = this.setRowList.reduce((res, item) => {
+            res.push({
+              surface: item.surface,
+              label: item.label,
+              name: item.name,
+              checked: item.checked,
+              width: item.width,
+              fixed: item.fixed,
+            });
+            return res;
+          }, []);
+        }
+      });
+    },
+  },
+}
+</script>
+
+<style scoped lang="scss">
+/deep/ .el-tabs .el-tabs__content {
+  overflow-x: visible !important;
+}
+</style>

+ 2 - 2
vue.config.js

@@ -31,8 +31,8 @@ module.exports = {
     proxy: {
       '/api': {
         //本地服务接口地址
-        // target: 'http://192.168.3.163:1080',
-        // target: 'http://192.168.1.114:1080',
+        // target: 'http://192.168.3.240:1080',
+        // target: 'http://192.168.1.102:1080',
         // target: 'http://124.222.119.174:1080',
         // 打包地址.
         // target: 'http://121.37.83.47:10004',//服务器ip