Parcourir la source

新加统计调拨模块

Qukatie il y a 3 jours
Parent
commit
0e893762e7

+ 22 - 0
src/api/tirePartsMall/statisticAnalysis/statisticalAllocation.js

@@ -0,0 +1,22 @@
+import request from '@/router/axios';
+
+// 出库统计列表
+export const transferDetail = (current, size, params) => {
+  return request({
+    url: '/api/blade-sales-part/statistics/transferDetail',
+    method: 'get',
+    params: {
+        ...params,
+        current,
+        size,
+      }
+  })
+}
+// 出库统计合计
+export const transferDetailSum = (params) => {
+  return request({
+    url: '/api/blade-sales-part/statistics/transferDetailSum',
+    method: 'get',
+    params: params
+  })
+}

+ 3 - 0
src/enums/column-name.js

@@ -2096,6 +2096,9 @@ const columnName = [{
 }, {
   code: 481,
   name: '库存管理L-盘点-选择库存'
+}, {
+  code: 482,
+  name: '统计分析-统计调拨-统计列表页'
 }
 ]
 export const getColumnName = (key) => {

+ 13 - 0
src/router/views/index.js

@@ -4247,4 +4247,17 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/allocationContract/index')
   }]
 },
+{
+  path: '/tirePartsMall/statisticAnalysis/statisticalAllocation/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/tirePartsMall/statisticAnalysis/statisticalAllocation/index',
+    name: '统计调拨',
+    meta: {
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/tirePartsMall/statisticAnalysis/statisticalAllocation/index')
+  }]
+},
 ]

+ 0 - 5
src/views/tirePartsMall/purchasingManagement/financingProcurement/index.vue

@@ -386,11 +386,6 @@ export default {
             dicUrl: '/api/blade-sales-part/storageDesc/listAll?cname={{key}}',
           },
           {
-            label: '订单保证金',
-            prop: "primaryBondAmount",
-            width: 100,
-            disabled: true,
-          }, {
             label: '订单数量',
             prop: "primaryGoodsTotalNum",
             overHidden: true,

+ 367 - 0
src/views/tirePartsMall/statisticAnalysis/statisticalAllocation/index.vue

@@ -0,0 +1,367 @@
+<template>
+  <div>
+    <basic-container>
+      <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"
+        @resetColumn="resetColumn('crud', 'option', 'optionBack', 482)"
+        @saveColumn="saveColumn('crud', 'option', 'optionBack', 482)"
+      >
+        <template slot="header">
+          <el-table :data="commodityData" border size="small" @header-click="cellClick" style="width: 100%" v-loading="itemloading">
+            <el-table-column v-for="(item, index) in commodityLabel" :key="index" :prop="item.prop" show-overflow-tooltip :label="item.label" />
+          </el-table>
+        </template>
+        <template slot="menuLeft">
+          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/util/auth";
+import { transferDetail, transferDetailSum } from "@/api/tirePartsMall/statisticAnalysis/statisticalAllocation";
+import _ from "lodash";
+
+export default {
+  name: "统计调拨",
+  data() {
+    return {
+      itemloading: false,
+      commodityLabel: [
+        {
+          id: 1,
+          label: "调拨数量",
+          prop: "sendNum"
+        },
+        {
+          id: 2,
+          label: "调拨数量(自有)",
+          prop: "sendNumHave"
+        },
+        {
+          id: 3,
+          label: "调拨数量(融资)",
+          prop: "sendNumFinancing"
+        }
+      ],
+      commodityData: [], // 合计数据
+      form: {},
+      search: {},
+      dataList: [],
+      loading: false,
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      option: {},
+      optionBack: {
+        height: "auto",
+        align: "center",
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        searchSpan: 6,
+        searchMenuSpan: 18,
+        searchIcon: true,
+        searchIndex: 3,
+        emptyBtnText: "清空所有条件",
+        menu: false,
+        column: [
+          {
+            label: "业务编号",
+            prop: "billno",
+            width: 100,
+            search: true,
+            overHidden: true
+          },
+          {
+            label: "商品编码",
+            prop: "code",
+            width: 100,
+            search: true,
+            overHidden: true
+          },
+          {
+            label: "商品名称",
+            prop: "goodsName",
+            width: 100,
+            search: true,
+            overHidden: true
+          },
+          {
+            label: "调出仓库",
+            prop: "storageName",
+            width: 100,
+            search: true,
+            type: "select",
+            filterable: true,
+            remote: true,
+            type: "select",
+            props: {
+              label: "cname",
+              value: "cname",
+              res: "data.records"
+            },
+            dicUrl: "/api/blade-sales-part/storageDesc/list?current=1&size=10&cname={{key}}",
+            overHidden: true
+          },
+          {
+            label: "调入仓库",
+            prop: "callInStorageName",
+            width: 100,
+            search: true,
+            type: "select",
+            filterable: true,
+            remote: true,
+            props: {
+              label: "cname",
+              value: "cname",
+              res: "data.records"
+            },
+            dicUrl: "/api/blade-sales-part/storageDesc/list?current=1&size=10&cname={{key}}",
+            overHidden: true
+          },
+          {
+            label: "批次号",
+            prop: "dot",
+            width: 100,
+            overHidden: true
+          },
+          {
+            label: "调拨数量(自有)",
+            prop: "sendNumHave",
+            width: 120,
+            overHidden: true
+          },
+          {
+            label: "调拨数量(融资)",
+            prop: "sendNumFinancing",
+            width: 120,
+            overHidden: true
+          },
+          {
+            label: "调拨时间",
+            prop: "businesDate",
+            searchProp: "businesDateList",
+            width: 120,
+            type: "date",
+            overHidden: true,
+            search: true,
+            searchRange: true,
+            unlinkPanels: true,
+            searchDefaultTime: ["00:00:00", "23:59:59"],
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd HH:mm:ss"
+          },
+          {
+            label: "品牌",
+            prop: "brandName",
+            width: 100,
+            search: true,
+            type: "select",
+            filterable: true,
+            remote: true,
+            props: {
+              label: "cname",
+              value: "cname",
+              res: "data.records"
+            },
+            dicUrl: "/api/blade-sales-part/brandDesc/list?type=PP&current=1&size=10&cname={{key}}",
+            overHidden: true
+          },
+          {
+            label: "规格型号",
+            prop: "propertyName",
+            width: 120,
+            overHidden: true
+          },
+          {
+            label: "花纹",
+            prop: "pattern",
+            width: 120,
+            overHidden: true
+          },
+          {
+            label: "库管",
+            prop: "stockClerkId",
+            width: 100,
+            search: true,
+            type: "select",
+            props: {
+              label: "realName",
+              value: "id"
+            },
+            dicUrl: "/api/blade-user/stockClerkList",
+            hide:true,
+            overHidden: true
+          },
+          {
+            label: "已出仓",
+            prop: "statusName",
+            search: true,
+            type: "select",
+            dicData: [
+              {
+                label: "录入",
+                value: "录入"
+              },
+              {
+                label: "确认调拨",
+                value: "确认调拨"
+              }
+            ],
+            overHidden: true
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            overHidden: true
+          }
+        ]
+      }
+    };
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(482), this.optionBack);
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    searchReset() {
+      this.search = this.$options.data().search;
+      this.onLoad(this.page);
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.query = params;
+      this.onLoad(this.page, params);
+      done();
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    onLoad(page, params = {}) {
+      let obj = {};
+      obj = {
+        ...Object.assign(params, this.query)
+      };
+      this.loading=true
+      transferDetail(page.currentPage, page.pageSize, obj)
+        .then(res => {
+          this.dataList = res.data.data.records;
+          this.page.total = res.data.data.total;
+          this.$nextTick(() => {
+            this.$refs.crud.doLayout();
+            this.$refs.crud.dicInit();
+          });
+          this.itemloading = true;
+          transferDetailSum(obj)
+            .then(res => {
+              this.commodityData = [res.data.data];
+            })
+            .finally(() => {
+              this.itemloading = false;
+            });
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    //自定义列保存
+    async saveColumn(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset();
+      }
+    },
+    //自定义列重置
+    async resetColumn(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset();
+      }
+    },
+    outExport() {
+      let config = { params: { ...this.search } };
+      if (config.params) {
+        for (const propName of Object.keys(config.params)) {
+          const value = config.params[propName];
+          if (value !== null && typeof value !== "undefined") {
+            if (value instanceof Array) {
+              for (const key of Object.keys(value)) {
+                let params = propName + "[" + key + "]";
+                config.params[params] = value[key];
+              }
+              delete config.params[propName];
+            }
+          }
+        }
+      }
+      const routeData = this.$router.resolve({
+        path: "/api/blade-sales-part/statistics/transferDetailExport", //跳转目标窗口的地址
+        query: {
+          ...config.params, //括号内是要传递给新窗口的参数
+          identification: this.url
+        }
+      });
+      window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
+    }
+  }
+};
+</script>
+
+<style scoped>
+.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%;
+}
+
+/deep/ .el-col-md-8 {
+  width: 24.33333%;
+}
+</style>