zzq
2023-09-27 8a668aeb3faa31d68dc2987204a372ad32f7b4f7
src/views/reportForm/locationReport/index.vue
@@ -1,3 +1,4 @@
<!-- 位置报表 -->
<template>
  <div class="rightContent">
    <div class="top">
@@ -54,7 +55,7 @@
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin";
import { getProductOperatonList } from "@/api/product/product";
import { getLocationData,} from "@/api/locationApi/locationApi";
import AddOverviewDialog from "@/views/overview/AddOverviewDialog";
export default {
@@ -116,7 +117,7 @@
  },
  created() {
    this.setTable();
    // this.getData();
    this.getData();
  },
  methods: {
    setTable() {
@@ -136,26 +137,14 @@
        }
      }
      this.tableList.allcol = allcol;
      this.tableList.tableInfomation = this.testArr;
    },
    setTableColumn(showcol) {
      let tableColumn = [
        /*
          product:"南方丝巢xxx",
          category:"丝绸制品/真丝睡袍",
          cost:"800.00",
          totalPrices:"0.00",
          inStore:"0.00",
          availableStore:"0.00",
          inStorage:"0.00",
          toStore:"0.00",
          forecast:"0.00",
          unit:"件"
        */
        {
          label: "位置",
          prop: "product",
          prop: "locationName",
          default: true,
          isShowColumn: true,
        },
        {
@@ -166,39 +155,44 @@
        },
        {
          label: "产品",
          prop: "cost",
          prop: "productName",
          default: true,
          isShowColumn: true,
        },
        {
          label: "产品类别",
          prop: "totalPrices",
          prop: "productTypeName",
          default: false,
          isShowColumn: showcol.includes("产品类别"),
        },
        {
          label: "在库数量",
          prop: "inStore",
          prop: "amount",
          isShowColumn: true,
          default: true,
          unit:""
        },
        {
          label: "预留数量",
          prop: "availableStore",
          sortable: true,
          default: false,
          isShowColumn: showcol.includes("预留数量"),
          isShowColumn: true,
          default: true,
          unit:""
        },
        {
          label: "单位",
          prop: "unit",
          isShowColumn: true,
          default: true,
        },
        {
          label: "价值",
          prop: "toStore",
          width: 120,
          default: false,
          isShowColumn: showcol.includes("价值"),
        },
        {
          label: "价值",
          prop: "value",
          width: 120,
          default: false,
          isShowColumn: showcol.includes("价值"),
          unit:"¥"
        },
      ];
      return tableColumn;
@@ -208,26 +202,19 @@
      this.tableList.tableColumn = this.setTableColumn(val);
    },
    // 请求数据
    // async getData() {
    //   await getProductOperatonList({
    //     productId: this.productId,
    //     page: this.pagerOptions.currPage,
    //     pageSize: this.pagerOptions.pageSize,
    //   }).then((res) => {
    //     if (res.code === 200) {
    //       const list = res.data.map((item) => {
    //         return {
    //           ...item,
    //           from: item.fromLocation.name,
    //           to: item.toLocation.name,
    //           productName: this.productName,
    //         };
    //       });
    //       this.tableList.tableInfomation = list || [];
    //       this.pagerOptions.totalCount = res.total;
    //     }
    //   });
    // },
    async getData() {
      await getLocationData({
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize,
      }).then((res) => {
        if (res.code === 200) {
          console.log(res.data,"接口请求成功")
          const list = res.data
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.total
        }
      });
    },
    // 搜索
    getList(val) {
@@ -244,6 +231,7 @@
    addBtnClick() {
      this.editConfig.visible = true;
      this.editConfig.title = "新建";
      this.getData()
    },
    // 状态
    getStatus(val) {