Переглянути джерело

库存台账显示 供应商 供应商代号

yusheng 1 рік тому
батько
коміт
b307d10adc

+ 598 - 533
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -1,14 +1,36 @@
 <template>
   <div class="itemList">
     <!-- 数据表格 -->
-    <item-search @search="reload" ref="refSeavch" :type="type" @handledime="handledime"></item-search>
-    <ele-pro-table ref="table" class="table" :columns="columns" :datasource="datasource" height="calc(100vh - 325px)"
-      full-height="calc(100vh - 116px)" tool-class="ele-toolbar-form" :pageSize="20" @select="selectChange"
-      @select-all="changeSelectAll" @columns-change="handleColumnChange" :cache-key="cacheKeyUrl">
+    <item-search
+      @search="reload"
+      ref="refSeavch"
+      :type="type"
+      @handledime="handledime"
+    ></item-search>
+    <ele-pro-table
+      ref="table"
+      class="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 325px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      :pageSize="20"
+      @select="selectChange"
+      @select-all="changeSelectAll"
+      @columns-change="handleColumnChange"
+      :cache-key="cacheKeyUrl"
+    >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar="{ row }">
-        <el-button v-if="selectedDime == 3" size="small" :disabled="checkRadioData.length == 0" icon="el-icon-set-up"
-          class="ele-btn-icon" @click="allPrinting()">
+        <el-button
+          v-if="selectedDime == 3"
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-set-up"
+          class="ele-btn-icon"
+          @click="allPrinting()"
+        >
           打印条码
         </el-button>
         <!-- <el-button
@@ -39,14 +61,46 @@
       <template v-slot:batchNo="{ row }">
         <el-popover placement="right-start" width="800" trigger="hover">
           <el-table :data="row.outInBatchDetailsVOList">
-            <el-table-column width="150" property="bizNo" label="入库单号"></el-table-column>
-            <el-table-column width="100" property="bizType" label="入库场景"></el-table-column>
-            <el-table-column width="120" property="count" label="入库数量"></el-table-column>
-            <el-table-column width="80" property="measuringUnit" label="计量单位"></el-table-column>
-            <el-table-column width="100" property="packageCount" label="包装数量"></el-table-column>
-            <el-table-column width="80" property="packingUnit" label="包装单位"></el-table-column>
-            <el-table-column width="330" property="position" label="库位"></el-table-column>
-            <el-table-column width="160" property="createTime" label="入库时间"></el-table-column>
+            <el-table-column
+              width="150"
+              property="bizNo"
+              label="入库单号"
+            ></el-table-column>
+            <el-table-column
+              width="100"
+              property="bizType"
+              label="入库场景"
+            ></el-table-column>
+            <el-table-column
+              width="120"
+              property="count"
+              label="入库数量"
+            ></el-table-column>
+            <el-table-column
+              width="80"
+              property="measuringUnit"
+              label="计量单位"
+            ></el-table-column>
+            <el-table-column
+              width="100"
+              property="packageCount"
+              label="包装数量"
+            ></el-table-column>
+            <el-table-column
+              width="80"
+              property="packingUnit"
+              label="包装单位"
+            ></el-table-column>
+            <el-table-column
+              width="330"
+              property="position"
+              label="库位"
+            ></el-table-column>
+            <el-table-column
+              width="160"
+              property="createTime"
+              label="入库时间"
+            ></el-table-column>
           </el-table>
           <span slot="reference"> {{ row.batchNo }}</span>
         </el-popover>
@@ -66,21 +120,25 @@
             row.expirationDateUnit == 'year'
               ? '年'
               : row.expirationDateUnit == 'month'
-                ? '月'
-                : '日'
+              ? '月'
+              : '日'
           }}
         </span>
       </template>
       <!-- 质检状态 -->
       <template v-slot:qualityStatus="{ row }">
-        <span v-if="row.qualityResult == 0 || row.qualityResult == 1">已检</span>
+        <span v-if="row.qualityResult == 0 || row.qualityResult == 1"
+          >已检</span
+        >
         <span v-else-if="row.qualityStatus == 1">已检</span>
         <span v-else-if="row.qualityStatus == 0">未检</span>
         <span v-else>-</span>
       </template>
       <!-- 质检结果 -->
       <template v-slot:qualityResult="{ row }">
-        <span v-if="row.qualityResult == 0 || row.qualityResult == ''">合格</span>
+        <span v-if="row.qualityResult == 0 || row.qualityResult == ''"
+          >合格</span
+        >
         <span v-else-if="row.qualityResult == 1">不合格</span>
         <span v-else-if="row.qualityResult == 3">让步接收</span>
         <span v-else>-</span>
@@ -95,571 +153,578 @@
 </template>
 
 <script>
-import print from '@/components/print/indexMultiple.vue';
-import allot from './allot.vue';
-// import print from './print.vue';
-// import printSr from './printSr.vue';
-// import printTg from './printTg.vue';
-import ItemSearch from './item-search.vue';
-// import {
-//   getUserPage,
-//   removePersonnel,
-//   unbindLoginName
-// } from '@/api/system/organization';
-import {
-  pageeLedgerMain,
-  removeItem,
-  getWarehouseList
-} from '@/api/classifyManage/itemInformation';
-import barCode from '@/api/main/barCode';
-import storageApi from '@/api/warehouseManagement';
-import { getBatchDetails } from '@/api/classifyManage/index';
-import tabMixins from '@/mixins/tableColumnsMixin';
+  import print from '@/components/print/indexMultiple.vue';
+  import allot from './allot.vue';
+  // import print from './print.vue';
+  // import printSr from './printSr.vue';
+  // import printTg from './printTg.vue';
+  import ItemSearch from './item-search.vue';
+  // import {
+  //   getUserPage,
+  //   removePersonnel,
+  //   unbindLoginName
+  // } from '@/api/system/organization';
+  import {
+    pageeLedgerMain,
+    removeItem,
+    getWarehouseList
+  } from '@/api/classifyManage/itemInformation';
+  import barCode from '@/api/main/barCode';
+  import storageApi from '@/api/warehouseManagement';
+  import { getBatchDetails } from '@/api/classifyManage/index';
+  import tabMixins from '@/mixins/tableColumnsMixin';
 
-import {
-  qualityStatus, qualityResults
-} from '@/utils/dict/index';
+  import { qualityStatus, qualityResults } from '@/utils/dict/index';
 
-export default {
-  mixins: [tabMixins],
-  components: { ItemSearch, print, allot },
-  props: {
-    // 机构id
-    organizationId: [Number, String],
-    // 全部机构
-    organizationList: Array,
-    current: {
-      type: Object,
-      default: () => ({})
-    },
-    type: {
-      type: String,
-      default: ''
-    }
-  },
-  data() {
-    return {
-      qualityStatus,
-      qualityResults,
-      config: [],
-      openWindows: false,
-      newColumns: [],
-      checkRadioData: [],
-      searchForm: {
-        dimension: '1'
+  export default {
+    mixins: [tabMixins],
+    components: { ItemSearch, print, allot },
+    props: {
+      // 机构id
+      organizationId: [Number, String],
+      // 全部机构
+      organizationList: Array,
+      current: {
+        type: Object,
+        default: () => ({})
       },
-      selectedDime: '1',
-      
-      diffCacheKeyUrl: 'eos-439decaa-warehouseManagement-stockLedger-products',
-      cacheKeyUrl: 'eos-439decaa-warehouseManagement-stockLedger-products2', //默认查询key值
-      columnsVersion: 1,
-    };
-  },
-  created() {
-    this.getFieldModel();
-  },
-  computed: {
-    // 表格列配置
-    columns() {
-      // 当columnsVersion变化时会重新计算
-      const version = this.columnsVersion;
-      // selectedDime 1物品维度 2批次维度 3包装维度 4物料维度
-      let arr = [
-        this.selectedDime == 3
-          ? {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center'
-          }
-          : '',
-        {
-          columnKey: 'index',
-          type: 'index',
-          width: 50,
-          align: 'center',
-          label: '序号',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        this.selectedDime != 1
-          ? {
-            prop: 'batchNo',
-            label: '批次号',
-            align: 'center'
-          }
-          : '',
-        {
-          prop: 'categoryCode',
-          label: '物品编码',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          slot: 'categoryName',
-          prop: 'categoryName',
-          label: '物品名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 200
+      type: {
+        type: String,
+        default: ''
+      }
+    },
+    data() {
+      return {
+        qualityStatus,
+        qualityResults,
+        config: [],
+        openWindows: false,
+        newColumns: [],
+        checkRadioData: [],
+        searchForm: {
+          dimension: '1'
         },
-        this.selectedDime != 1
-          ? {
-            prop: 'inventoryCycle',
-            label: '存货周期(天)',
+        selectedDime: '1',
+
+        diffCacheKeyUrl:
+          'eos-439decaa-warehouseManagement-stockLedger-products',
+        cacheKeyUrl: 'eos-439decaa-warehouseManagement-stockLedger-products2', //默认查询key值
+        columnsVersion: 1
+      };
+    },
+    created() {
+      this.getFieldModel();
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        // 当columnsVersion变化时会重新计算
+        const version = this.columnsVersion;
+        // selectedDime 1物品维度 2批次维度 3包装维度 4物料维度
+        let arr = [
+          this.selectedDime == 3
+            ? {
+                width: 45,
+                type: 'selection',
+                columnKey: 'selection',
+                align: 'center'
+              }
+            : '',
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 50,
             align: 'center',
-            width: 120,
-            showOverflowTooltip: true
-          }
-          : '',
-        {
-          prop: 'brandNum',
-          label: '牌号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryModel',
-          label: '型号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'specification',
-          label: '规格',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        this.selectedDime == 2
-          ? {
-            prop: 'supplierName',
-            label: '供应商',
+            label: '序号',
             showOverflowTooltip: true,
-            width: 130,
-            align: 'center'
-          }
-          : '',
-        {
-          prop: 'level',
-          label: '级别',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'measureQuantity',
-          label: '计量数量',
-          sortable: 'custom',
-          showOverflowTooltip: true,
-          width: 130,
-          align: 'center'
-        },
-        // {
-        //   prop: 'supplierName',
-        //   label: '供应商',
-        //   showOverflowTooltip: true,
-        //   width: 130,
-        //   align: 'center'
-        // },
-        {
-          prop: 'measureUnit',
-          label: '计量单位',
-          align: 'center'
-        },
-        {
-          prop: 'weight',
-          label: '重量',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'weightUnit',
-          label: '重量单位',
-          showOverflowTooltip: true
-        },
-        this.selectedDime == 1 ?
+            fixed: 'left'
+          },
+          this.selectedDime != 1
+            ? {
+                prop: 'batchNo',
+                label: '批次号',
+                align: 'center'
+              }
+            : '',
           {
-            prop: 'secureInventory',
-            label: '安全库存',
+            prop: 'categoryCode',
+            label: '物品编码',
+            align: 'center',
             showOverflowTooltip: true
-          } : '',
-        this.selectedDime == 1 ?
+          },
           {
-            prop: 'minInventory',
-            label: '最小库存',
-            showOverflowTooltip: true
-          } : '',
-        this.selectedDime == 1 ?
+            slot: 'categoryName',
+            prop: 'categoryName',
+            label: '物品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          this.selectedDime != 1
+            ? {
+                prop: 'inventoryCycle',
+                label: '存货周期(天)',
+                align: 'center',
+                width: 120,
+                showOverflowTooltip: true
+              }
+            : '',
           {
-            prop: 'maxInventory',
-            label: '最大库存',
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center',
             showOverflowTooltip: true
-          } : '',
-        this.selectedDime == 3
-          ? {
-            prop: 'packageNo',
-            label: '包装编码',
+          },
+          {
+            prop: 'categoryModel',
+            label: '型号',
+            align: 'center',
             showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3
-          ? {
-            prop: 'packingQuantity',
-            label: '包装数量	',
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
             showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3
-          ? {
-            prop: 'packingUnit',
-            label: '包装单位	',
+          },
+          this.selectedDime == 2
+            ? {
+                prop: 'supplierName',
+                label: '供应商',
+                showOverflowTooltip: true,
+                width: 130,
+                align: 'center'
+              }
+            : '',
+          {
+            prop: 'level',
+            label: '级别',
             showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3
-          ? {
-            prop: 'result',
-            slot: 'result',
-            label: '质检结果',
+          },
+          {
+            prop: 'measureQuantity',
+            label: '计量数量',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            width: 130,
+            align: 'center'
+          },
+          // {
+          //   prop: 'supplierName',
+          //   label: '供应商',
+          //   showOverflowTooltip: true,
+          //   width: 130,
+          //   align: 'center'
+          // },
+          {
+            prop: 'measureUnit',
+            label: '计量单位',
+            align: 'center'
+          },
+          {
+            prop: 'weight',
+            label: '重量',
             showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3 ?
+          },
           {
-            prop: 'status',
-            slot: 'status',
-            label: '质检状态',
+            prop: 'weightUnit',
+            label: '重量单位',
             showOverflowTooltip: true
-          }
-          : '',
+          },
+          this.selectedDime == 1
+            ? {
+                prop: 'secureInventory',
+                label: '安全库存',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 1
+            ? {
+                prop: 'minInventory',
+                label: '最小库存',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 1
+            ? {
+                prop: 'maxInventory',
+                label: '最大库存',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'packageNo',
+                label: '包装编码',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'packingQuantity',
+                label: '包装数量	',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'packingUnit',
+                label: '包装单位	',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'result',
+                slot: 'result',
+                label: '质检结果',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'status',
+                slot: 'status',
+                label: '质检状态',
+                showOverflowTooltip: true
+              }
+            : '',
 
-        this.selectedDime == 3
-          ? {
-            prop: 'warehouseName',
-            label: '仓库	',
-            showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3
-          ? {
-            prop: 'areaName',
-            label: '货区	',
-            showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3
-          ? {
-            prop: 'goodsAllocationName',
-            label: '货架',
-            showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3
-          ? {
-            prop: 'goodsShelfName',
-            label: '货位',
-            showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3
-          ? {
-            prop: 'productionDate',
-            label: '生产日期',
-            showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3
-          ? {
-            prop: 'purchaseDate',
-            label: '采购日期',
-            showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3 || this.selectedDime == 4
-          ? {
-            prop: 'barcodes',
-            label: '发货条码	',
-            showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3 || this.selectedDime == 4
-          ? {
-            prop: 'clientCode',
-            label: '客户代号',
-            showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3 || this.selectedDime == 4
-          ? {
-            prop: 'engrave',
-            label: '刻码	',
-            showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3 || this.selectedDime == 4
-          ? {
-            prop: 'materielDesignation',
-            label: '物料代号',
+          this.selectedDime == 3
+            ? {
+                prop: 'warehouseName',
+                label: '仓库	',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'areaName',
+                label: '货区	',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'goodsAllocationName',
+                label: '货架',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'goodsShelfName',
+                label: '货位',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'productionDate',
+                label: '生产日期',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'purchaseDate',
+                label: '采购日期',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3 || this.selectedDime == 4
+            ? {
+                prop: 'barcodes',
+                label: '发货条码	',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3 || this.selectedDime == 4
+            ? {
+                prop: 'clientCode',
+                label: '客户代号',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3 || this.selectedDime == 4
+            ? {
+                prop: 'engrave',
+                label: '刻码	',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3 || this.selectedDime == 4
+            ? {
+                prop: 'materielDesignation',
+                label: '物料代号',
+                width: 120,
+                showOverflowTooltip: true
+              }
+            : '',
+          {
+            prop: 'supplierName',
+            label: '供应商',
             width: 120,
             showOverflowTooltip: true
-          }
-          : '',
-        this.selectedDime == 3 || this.selectedDime == 4
-          ? {
+          },
+          {
             prop: 'supplierCode',
             label: '供应商代号',
             width: 120,
-
+            showOverflowTooltip: true
+          },
+          this.selectedDime != 1
+            ? {
+                prop: 'provenance',
+                label: '产地',
+                showOverflowTooltip: true
+              }
+            : '',
+          {
+            prop: 'unitPrice',
+            label: '单价',
             showOverflowTooltip: true
           }
-          : '',
-        this.selectedDime != 1 ? {
-          prop: 'provenance',
-          label: '产地',
-          showOverflowTooltip: true
-        } : '',
-        {
-          prop: 'unitPrice',
-          label: '单价',
-          showOverflowTooltip: true
+        ];
+        if (this.selectedDime == 1) {
+          return arr.filter((item) => item != '').concat(this.newColumns);
+        } else {
+          return arr.filter((item) => item != '');
         }
-      ];
-      if (this.selectedDime == 1) {
-        return arr.filter((item) => item != '').concat(this.newColumns);
-      } else {
-        return arr.filter((item) => item != '');
-      }
-    },
-    clientEnvironmentId() {
-      return this.$store.state.user.info.clientEnvironmentId;
-    }
-  },
-  methods: {
-    getFieldModel() {
-      storageApi.fieldModel({ relevance: 't_main_category' }).then((res) => {
-        let newRes = res.map((m) => {
-          return {
-            prop: 'extField.' + m.prop,
-            label: m.label,
-            align: 'center',
-            showOverflowTooltip: true
-          };
-        });
-        this.newColumns = [...newRes];
-      });
-    },
-    // 调拨
-    showAllot() {
-      this.$refs.allotRef.open(this.checkRadioData);
-    },
-    // 全选
-    changeSelectAll(arr) {
-      console.log(arr);
-      if (arr.length != 0) {
-        this.checkRadioData = arr;
-      } else {
-        this.checkRadioData = [];
-      }
-    },
-    selectChange(selection, row) {
-      if (selection.length != 0) {
-        this.checkRadioData = selection;
-      } else {
-        this.checkRadioData = [];
+      },
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
       }
     },
-    allPrinting() {
-      if (this.checkRadioData?.length > 0) {
-        let params = this.checkRadioData.map((m) => {
-          return {
-            bizId: m.id,
-            qrcodeType: 6
-          };
+    methods: {
+      getFieldModel() {
+        storageApi.fieldModel({ relevance: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
         });
-        barCode.batchBarPrint(params).then((res) => {
-          console.log('--------res---------------');
-          console.log(res);
-          this.config = [];
-          res.map((item, index) => {
-            let obj = {
-              putType: item.putType,
-              sizeWide: item.sizeWide,
-              sizeLong: item.sizeLong,
-              value: this.checkRadioData[index].packageNo + '/6',
-              useModeList: item.useModeList
+      },
+      // 调拨
+      showAllot() {
+        this.$refs.allotRef.open(this.checkRadioData);
+      },
+      // 全选
+      changeSelectAll(arr) {
+        console.log(arr);
+        if (arr.length != 0) {
+          this.checkRadioData = arr;
+        } else {
+          this.checkRadioData = [];
+        }
+      },
+      selectChange(selection, row) {
+        if (selection.length != 0) {
+          this.checkRadioData = selection;
+        } else {
+          this.checkRadioData = [];
+        }
+      },
+      allPrinting() {
+        if (this.checkRadioData?.length > 0) {
+          let params = this.checkRadioData.map((m) => {
+            return {
+              bizId: m.id,
+              qrcodeType: 6
             };
-            obj.useModeList = obj.useModeList.sort((a, b) => {
-              return a.barAvg.substr(4) - b.barAvg.substr(4);
+          });
+          barCode.batchBarPrint(params).then((res) => {
+            console.log('--------res---------------');
+            console.log(res);
+            this.config = [];
+            res.map((item, index) => {
+              let obj = {
+                putType: item.putType,
+                sizeWide: item.sizeWide,
+                sizeLong: item.sizeLong,
+                value: this.checkRadioData[index].packageNo + '/6',
+                useModeList: item.useModeList
+              };
+              obj.useModeList = obj.useModeList.sort((a, b) => {
+                return a.barAvg.substr(4) - b.barAvg.substr(4);
+              });
+              this.config.push(obj);
             });
-            this.config.push(obj);
+            console.log('this.config--------', this.config);
+            this.openWindows = true;
           });
-          console.log('this.config--------', this.config);
-          this.openWindows = true;
-        });
-      } else {
-        return this.$message.warning('请选择要打印的数据!');
-      }
+        } else {
+          return this.$message.warning('请选择要打印的数据!');
+        }
 
-      // if (this.clientEnvironmentId == 2) {
-      //   this.$refs.printSrRef.open(this.checkRadioData);
-      // } else if (this.clientEnvironmentId == 3) {
-      //   this.$refs.printTgRef.open(this.checkRadioData);
-      // } else {
-      //   this.$refs.printRef.open(this.checkRadioData);
-      // }
-    },
-    handledime(val) {
-      console.log(val, 'val');
-      this.selectedDime = val;
-      this.reload();
+        // if (this.clientEnvironmentId == 2) {
+        //   this.$refs.printSrRef.open(this.checkRadioData);
+        // } else if (this.clientEnvironmentId == 3) {
+        //   this.$refs.printTgRef.open(this.checkRadioData);
+        // } else {
+        //   this.$refs.printRef.open(this.checkRadioData);
+        // }
+      },
+      handledime(val) {
+        console.log(val, 'val');
+        this.selectedDime = val;
+        this.reload();
 
-      //每次切换维度查询列表配置信息,固定列配置  val 1 为物品维度,2 为批次维度,3 为包装维度。如果val值发生变化。请适配之前的维度 
-      this.cacheKeyUrl = this.diffCacheKeyUrl + val
-      this.getTabColumns()
-    },
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      console.log('this.selectedDime-----------', this.selectedDime);
-      const dimension = this.$refs.refSeavch.dimension;
-      console.log('this.dimension-----------', dimension);
-      const treeId = this.$parent.$parent.$parent.current.id;
-      if (dimension == 1) {
-        // 物品维度
-        const data = storageApi.getProductList({
-          ...where,
-          ...order,
-          pageNum: page,
-          size: limit
-        });
-        return data;
-      } else if (dimension == 2) {
-        // 批次维度
-        const params = {
-          categoryLevelId: treeId,
-          ...where,
-          ...order
-        };
-        const data = storageApi.getBatchList({
-          ...params,
-          pageNum: page,
-          size: limit
-        });
-        return data;
-      } else if (dimension == 4) {
-        // 物料维度
-        const params = {
-          categoryLevelId: treeId,
-          ...where,
-          ...order
-        };
-        const data = storageApi.getMaterialList({
-          ...params,
-          pageNum: page,
-          size: limit
-        });
-        return data;
-      } else {
-        // 包装维度
-        let params = {};
-        if (this.type === 'products') {
-          params = {
+        //每次切换维度查询列表配置信息,固定列配置  val 1 为物品维度,2 为批次维度,3 为包装维度。如果val值发生变化。请适配之前的维度
+        this.cacheKeyUrl = this.diffCacheKeyUrl + val;
+        this.getTabColumns();
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        console.log('this.selectedDime-----------', this.selectedDime);
+        const dimension = this.$refs.refSeavch.dimension;
+        console.log('this.dimension-----------', dimension);
+        const treeId = this.$parent.$parent.$parent.current.id;
+        if (dimension == 1) {
+          // 物品维度
+          const data = storageApi.getProductList({
+            ...where,
+            ...order,
+            pageNum: page,
+            size: limit
+          });
+          return data;
+        } else if (dimension == 2) {
+          // 批次维度
+          const params = {
             categoryLevelId: treeId,
             ...where,
             ...order
           };
-        } else {
-          console.log('this.current----', this.current.data);
-          params = {
-            warehouseId:
-              this.current.data?.level == 0 ? this.current.data.id : '',
-            warehouseAreaId:
-              this.current.data?.level == 1 ? this.current.data.id : '',
-            warehouseAreaGoodsId:
-              this.current.data?.level == 2 ? this.current.data.id : '',
-            warehouseAreaGoodsShelvesId:
-              this.current.data?.level == 3 ? this.current.data.id : '',
+          const data = storageApi.getBatchList({
+            ...params,
+            pageNum: page,
+            size: limit
+          });
+          return data;
+        } else if (dimension == 4) {
+          // 物料维度
+          const params = {
+            categoryLevelId: treeId,
             ...where,
             ...order
           };
-        }
-        const data = storageApi.getPackingList({
-          ...params,
-          pageNum: page,
-          size: limit
-        });
-        return data;
-      }
-    },
-    /* 刷新表格 */
-    reload(where) {
-      this.$nextTick(() => {
-        console.log('this.current----', this.current);
-        let params = {};
-        if (this.type === 'products') {
-          params = {
-            ...where,
-            categoryLevelId: this.current.data?.id || this.current?.id
-          };
+          const data = storageApi.getMaterialList({
+            ...params,
+            pageNum: page,
+            size: limit
+          });
+          return data;
         } else {
-          params = {
-            ...where,
-            warehouseId:
-              this.current.data?.level == 0 ? this.current.data.id : '',
-            warehouseAreaId:
-              this.current.data?.level == 1 ? this.current.data.id : '',
-            warehouseAreaGoodsId:
-              this.current.data?.level == 2 ? this.current.data.id : ''
-          };
+          // 包装维度
+          let params = {};
+          if (this.type === 'products') {
+            params = {
+              categoryLevelId: treeId,
+              ...where,
+              ...order
+            };
+          } else {
+            console.log('this.current----', this.current.data);
+            params = {
+              warehouseId:
+                this.current.data?.level == 0 ? this.current.data.id : '',
+              warehouseAreaId:
+                this.current.data?.level == 1 ? this.current.data.id : '',
+              warehouseAreaGoodsId:
+                this.current.data?.level == 2 ? this.current.data.id : '',
+              warehouseAreaGoodsShelvesId:
+                this.current.data?.level == 3 ? this.current.data.id : '',
+              ...where,
+              ...order
+            };
+          }
+          const data = storageApi.getPackingList({
+            ...params,
+            pageNum: page,
+            size: limit
+          });
+          return data;
         }
-        this.$refs.table.reload({
-          pageNum: 1,
-          where: params
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          console.log('this.current----', this.current);
+          let params = {};
+          if (this.type === 'products') {
+            params = {
+              ...where,
+              categoryLevelId: this.current.data?.id || this.current?.id
+            };
+          } else {
+            params = {
+              ...where,
+              warehouseId:
+                this.current.data?.level == 0 ? this.current.data.id : '',
+              warehouseAreaId:
+                this.current.data?.level == 1 ? this.current.data.id : '',
+              warehouseAreaGoodsId:
+                this.current.data?.level == 2 ? this.current.data.id : ''
+            };
+          }
+          this.$refs.table.reload({
+            pageNum: 1,
+            where: params
+          });
         });
-      });
-    },
-
-    details(row) {
-      const key = Date.now();
-      this.$store.commit('stockManagement/CLEAR_BASEINFO');
-      this.$store.commit('stockManagement/CHANGE_BASEINFO', {
-        key,
-        value: row
-      });
-
-      const url =
-        this.$refs.refSeavch.dimension == 1
-          ? '/warehouseManagement/stockLedger/allBatchDetails'
-          : '/warehouseManagement/stockLedger/batchDetails';
+      },
 
-      this.$router.push({
-        path: url,
-        query: {
+      details(row) {
+        const key = Date.now();
+        this.$store.commit('stockManagement/CLEAR_BASEINFO');
+        this.$store.commit('stockManagement/CHANGE_BASEINFO', {
           key,
-          dimension: this.$refs.refSeavch.dimension,
-          // id: this.$refs.refSeavch.dimension != 3 ? row.id : row.categoryId,
-          id: row.categoryId,
-          assetId: row.assetId,
-          batchNo: row.batchNo,
-          categoryCode: row.categoryCode
-        }
-      });
-    }
-  },
+          value: row
+        });
 
-  watch: {
-    // 监听机构id变化
-    current: {
-      handler() {
-        this.reload();
+        const url =
+          this.$refs.refSeavch.dimension == 1
+            ? '/warehouseManagement/stockLedger/allBatchDetails'
+            : '/warehouseManagement/stockLedger/batchDetails';
+
+        this.$router.push({
+          path: url,
+          query: {
+            key,
+            dimension: this.$refs.refSeavch.dimension,
+            // id: this.$refs.refSeavch.dimension != 3 ? row.id : row.categoryId,
+            id: row.categoryId,
+            assetId: row.assetId,
+            batchNo: row.batchNo,
+            categoryCode: row.categoryCode
+          }
+        });
       }
     },
-    type: {
-      handler() {
-        if (this.type === 'warehouse') {
-          this.selectedDime = '3';
-        } else {
-          this.selectedDime = '1';
+
+    watch: {
+      // 监听机构id变化
+      current: {
+        handler() {
+          this.reload();
+        }
+      },
+      type: {
+        handler() {
+          if (this.type === 'warehouse') {
+            this.selectedDime = '3';
+          } else {
+            this.selectedDime = '1';
+          }
+          this.reload();
         }
-        this.reload();
       }
     }
-  }
-};
+  };
 </script>