浏览代码

新增拣货管理

huang_an 1 年之前
父节点
当前提交
202da82f3f

+ 75 - 0
src/api/warehouseManagement/index.js

@@ -354,5 +354,80 @@ export default {
       return res.data.data;
     }
     return Promise.reject(new Error(res.data.message));
+  },
+  // 拆包
+  takeApartPackage: async (data) => {
+    const res = await request.post(
+      '/wms/outInDetailRecordTwo/takeApartPackage',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 打包
+  combinePackage: async (data) => {
+    const res = await request.post(
+      '/wms/outInDetailRecordTwo/combinePackage',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 保存拣货单
+  savePickgoods: async (data) => {
+    const res = await request.post('/wms/pickgoods/save', data);
+    console.log(res);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 修改拣货单
+  updatePickgoods: async (data) => {
+    const res = await request.post('/wms/pickgoods/update', data);
+    console.log(res);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 拣货列表
+  getPickgoodsList: async (data) => {
+    const res = await request.get(`/wms/pickgoods/page`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取拣货详情
+  getPickgoodsDetails: async (id) => {
+    const res = await request.get(`/wms/pickgoods/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 删除入库详情
+  deletePickgoods: async (data) => {
+    const res = await request.delete('/wms/pickgoods/delete', { data });
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 拣货出库
+  pickGoodsOutIn: async (data) => {
+    const res = await request.post('/wms/outintwo/pickGoodsOutIn', data);
+    console.log(res);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
   }
 };

+ 15 - 0
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -214,6 +214,7 @@
           </el-form>
           <el-table
             ref="table"
+            :height="530"
             :data="productList"
             row-key="id"
             @selection-change="selecctedRow"
@@ -483,6 +484,7 @@
           <el-table
             ref="detailTable"
             :data="tableData"
+            :height="575"
             tooltip-effect="dark"
             border
           >
@@ -658,7 +660,20 @@
         this.getEditInfo();
       }
     },
+    watch: {
+      productList() {
+        this.doLayout();
+      }
+    },
     methods: {
+      doLayout() {
+        let that = this;
+        this.$nextTick(() => {
+          console.log('操作了!!');
+          console.log('that.$refs.table------', that.$refs.table);
+          that.$refs.table.doLayout();
+        });
+      },
       async getEditInfo() {
         const dataList = await storageApi.getAllotDetailList({
           applyId: this.$route.query.id

+ 5 - 19
src/views/warehouseManagement/outgoingManagement/details.vue

@@ -168,26 +168,17 @@
             >
             </el-table-column>
             <el-table-column
-              label="最小包装单元"
+              label="包装数量"
+              prop="packingQuantity"
               align="center"
-              width="120"
-              prop="minPackingQuantity"
             >
-              <template slot-scope="{ row, $index }">
-                {{ row.minPackingQuantity }} {{ row.measureUnit }} /{{
-                  row.packingUnit
-                }}
-              </template>
             </el-table-column>
-
             <el-table-column
-              label="包装数量"
-              prop="packingQuantity"
+              label="包装单位"
               align="center"
+              width="120"
+              prop="packingUnit"
             >
-              <template slot-scope="{ row, $index }">
-                {{ row.packingQuantity }} {{ row.packingUnit }}
-              </template>
             </el-table-column>
             <el-table-column
               label="计量数量"
@@ -197,11 +188,6 @@
             >
             </el-table-column>
             <el-table-column label="计量单位" prop="measureUnit" align="center">
-              <template slot-scope="{ row, $index }">
-                <template>
-                  {{ row.measureUnit }}
-                </template>
-              </template>
             </el-table-column>
             <el-table-column
               label="重量"

+ 869 - 0
src/views/warehouseManagement/outgoingManagement/details_2.vue

@@ -0,0 +1,869 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <div class="page-title">
+        <PageHeader title="出库单详情"> </PageHeader>
+      </div>
+      <div class="stepsStatus">
+        <el-steps :active="active" align-center>
+          <el-step title="创建"></el-step>
+          <el-step title="待审核"></el-step>
+          <el-step :title="stepsTitle" :status="stepsStatus"></el-step>
+        </el-steps>
+      </div>
+      <div>
+        <div class="content-detail">
+          <header-title title="基本信息" size="16px"></header-title>
+          <div class="mt20">
+            <el-form label-width="110px">
+              <el-col :span="8">
+                <el-form-item label="出库单号">
+                  <span>{{ infoData.bizNo }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="出库物品类型">
+                  <span>{{ handleAssetType(infoData.extInfo.assetType) }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="出库场景">
+                  <span>{{ getSceneState(infoData.bizType) }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="关联订单:">
+                  <span>{{ extInfo.documentSource }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8" v-if="infoData.bizType == 3">
+                <el-form-item label="客户名称">
+                  <span>{{ infoData.clientName }}</span>
+                </el-form-item> </el-col
+              ><el-col :span="8" v-if="infoData.bizType == 3">
+                <el-form-item label="客户联系人">
+                  <span>{{ infoData.clientUser }}</span>
+                </el-form-item> </el-col
+              ><el-col :span="8" v-if="infoData.bizType == 3">
+                <el-form-item label="客户电话">
+                  <span>{{ infoData.clientPhone }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item
+                  :label="infoData.bizType == 4 ? '领料单' : '来源单据'"
+                >
+                  <span>{{ infoData.bizNo }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="领料人联系方式">
+                  <span>{{ infoData.fromUserPhone }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="出库登记人">
+                  <span>{{ infoData.extInfo?.createUserName }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="权属部门">
+                  <span>{{ infoData.extInfo?.deptName }}</span>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="8">
+                <el-form-item label="创建时间">
+                  <span>{{ infoData.createTime }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="出库时间">
+                  <span>{{ infoData.createTime }}</span>
+                </el-form-item>
+              </el-col> -->
+              <el-col :span="8">
+                <el-form-item label="状态:">
+                  <span>{{ stepsTitle }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="领料人部门">
+                  <span>{{ infoData.extInfo.verifyDeptName }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="领料人">
+                  <span>{{ infoData.fromUser }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label="备注">
+                  <span>{{ infoData.remark }}</span>
+                </el-form-item>
+              </el-col>
+            </el-form>
+          </div>
+        </div>
+        <div class="content-detail mt20">
+          <header-title title="产品信息" size="16px"></header-title>
+          <el-table
+            ref="productListTable"
+            :data="productList"
+            border
+            tooltip-effect="dark"
+            :max-height="300"
+            :header-cell-style="rowClass"
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="categoryCode"
+              align="center"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              align="center"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              v-if="clientEnvironmentId == 4"
+              label="级别"
+              prop="level"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              label="型号"
+              align="center"
+              prop="categoryModel"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="规格"
+              align="center"
+              prop="specification"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="牌号"
+              align="center"
+              prop="brandNum"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              v-for="(item, index) in newColumns"
+              :label="item.label"
+              :align="item.align"
+              :prop="item.prop"
+              :show-overflow-tooltip="item.showOverflowTooltip"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="最小包装单元"
+              align="center"
+              width="120"
+              prop="minPackingQuantity"
+            >
+              <template slot-scope="{ row, $index }">
+                {{ row.minPackingQuantity }} {{ row.measureUnit }} /{{
+                  row.packingUnit
+                }}
+              </template>
+            </el-table-column>
+
+            <el-table-column
+              label="包装数量"
+              prop="packingQuantity"
+              align="center"
+            >
+              <template slot-scope="{ row, $index }">
+                {{ row.packingQuantity }} {{ row.packingUnit }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+              width="100"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column label="计量单位" prop="measureUnit" align="center">
+              <template slot-scope="{ row, $index }">
+                <template>
+                  {{ row.measureUnit }}
+                </template>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="重量"
+              prop="weight"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column label="单价" prop="price" align="center">
+              <template slot-scope="{ row }">
+                <template>
+                  {{ row.price ? row.price : '-' + '元' }}/{{ row.measureUnit }}
+                </template>
+              </template>
+            </el-table-column>
+
+            <el-table-column
+              label="金额"
+              align="center"
+              prop="contentImage"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row, $index }">
+                {{ row.totalMoney ? row.totalMoney : 0 }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              v-if="clientEnvironmentId == 4"
+              label="采购原因"
+              align="center"
+              prop="purpose"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="仓库"
+              prop="warehouseName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+          </el-table>
+        </div>
+        <div class="mt20">
+          <header-title :title="`包装明细`" size="16px"></header-title>
+          <el-table
+            ref="showPackingListTable"
+            :data="showPackingList"
+            tooltip-effect="dark"
+            :max-height="300"
+            border
+            :row-class-name="tableRowClassName"
+            :header-cell-style="rowClass"
+            v-el-table-infinite-scroll="pickingHandleScroll"
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="发货条码"
+              prop="barcodes"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装编码"
+              prop="packageNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="packingQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装单位"
+              prop="packingUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measureUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="物料代号"
+              prop="materielDesignation"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="客户代号"
+              prop="clientCode"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="刻码"
+              prop="engrave"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量"
+              prop="weight"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="质检结果"
+              prop="result"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row }">
+                <span>{{ qualityResults[row.result] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="质检状态"
+              prop="status"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row }">
+                <span>{{ qualityStatus[row.status] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="生产日期"
+              prop="productionDate"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="采购日期"
+              prop="purchaseDate"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+          </el-table>
+        </div>
+        <div class="mt20">
+          <header-title :title="`物料明细`" size="16px"> </header-title>
+          <el-table
+            ref="multipleTable"
+            :data="showMaterialList"
+            tooltip-effect="dark"
+            :max-height="300"
+            :row-class-name="tableRowClassName"
+            :header-cell-style="rowClass"
+            border
+            style="width: 100%"
+            stripe
+            height="300px"
+            v-el-table-infinite-scroll="materielHandleScroll"
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column label="批次号" prop="batchNo"></el-table-column>
+            <el-table-column
+              label="物料编码"
+              prop="materialCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="发货条码"
+              prop="barcodes"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measureUnit"
+            ></el-table-column>
+            <el-table-column label="物料代号" prop="materielDesignation">
+            </el-table-column>
+            <el-table-column label="客户代号" prop="clientCode">
+            </el-table-column>
+            <el-table-column label="刻码" prop="engrave"> </el-table-column>
+            <el-table-column width="100" label="重量" prop="weight">
+            </el-table-column>
+            <el-table-column label="重量单位" prop="weightUnit">
+            </el-table-column>
+            <el-table-column label="质检结果" prop="result" width="120">
+              <template slot-scope="{ row }">
+                <span>{{ qualityResults[row.result] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="质检状态" prop="status" width="120">
+              <template slot-scope="{ row }">
+                <span>{{ qualityStatus[row.status] }}</span>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import elTableInfiniteScroll from 'el-table-infinite-scroll';
+  import { getFile } from '@/api/system/file/index.js';
+  import PageHeader from '@/components/PageHeader';
+  import storageApi from '@/api/warehouseManagement';
+  import { allCategoryLevel } from '@/api/classifyManage';
+  import { useDictLabel, outputSceneState } from '@/utils/dict/index';
+  import { mapGetters, mapActions } from 'vuex';
+  export default {
+    components: { PageHeader },
+    directives: {
+      'el-table-infinite-scroll': elTableInfiniteScroll
+    },
+    data() {
+      return {
+        newColumns: [], // 动态表头
+        qualityStatus: {
+          0: '未质检',
+          1: '已质检'
+        }, // 质检状态 0未检 1已检
+        qualityResults: {
+          1: '合格',
+          2: '不合格'
+        }, // 质检结果 1合格 2不合格
+        productList: [], // 产品列表
+        showPackingList: [], // 展示的包装列表
+        packingList: [], // 包装列表
+        showMaterialList: [], // 展示物料列表
+        materialList: [], // 物料列表
+        extInfo: {}, // 扩展信息
+        pageSize: 20,
+        pickingPageNum: 1,
+        materielPageNum: 1,
+        codeList: [],
+        infoData: {},
+        stepsTitle: '已完成',
+        stepsStatus: 'success',
+        active: 0
+      };
+    },
+    watch: {
+      'infoData.verifyStatus': {
+        immediate: true,
+        handler(val) {
+          if (val == 0) {
+            this.active = 1;
+            this.stepsTitle = '未审核';
+            this.stepsStatus = 'wait';
+          } else if (val == 1) {
+            this.active = 2;
+            this.stepsTitle = '审核中';
+            this.stepsStatus = 'process';
+          } else if (val == 2) {
+            this.active = 2;
+            this.stepsTitle = '审核通过';
+            this.stepsStatus = 'success';
+          } else if (val == 3) {
+            this.active = 2;
+            this.stepsTitle = '驳回';
+            this.stepsStatus = 'error';
+          }
+        }
+      },
+      packingList: {
+        handler(newVal) {
+          console.log('包装列表', newVal);
+          console.log('当前包装列表加载页数', this.pickingPageNum);
+          this.showPackingList = newVal.slice(
+            0,
+            this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
+          );
+        },
+        deep: true
+      },
+      materialList: {
+        handler(newVal) {
+          console.log('物料列表', newVal);
+          console.log('当前物料列表加载页数', this.materielPageNum);
+          this.showMaterialList = newVal.slice(
+            0,
+            this.pageSize *
+              (this.materielPageNum > 0 ? this.materielPageNum : 1)
+          );
+        },
+        deep: true
+      }
+    },
+    computed: {
+      ...mapGetters(['getDictValue']),
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    created() {
+      this.getFieldModel();
+      this.requestDict('类型用途');
+      this.getAllCategoryType();
+      this._getInfo();
+    },
+    methods: {
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: '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];
+        });
+      },
+      pickingHandleScroll() {
+        console.log('---------pickingHandleScroll------------');
+        if (this.showPackingList.length < this.packingList.length) {
+          if (this.packingList.length > this.pageSize) {
+            this.pickingPageNum += 1;
+          }
+          this.pickingFetchData();
+        }
+      },
+      pickingFetchData() {
+        const start = (this.pickingPageNum - 1) * this.pageSize;
+        const end = start + this.pageSize;
+        this.showPackingList = this.showPackingList.concat(
+          this.packingList.slice(start, end)
+        );
+      },
+      materielHandleScroll() {
+        console.log('---------materielHandleScroll------------');
+        if (this.showMaterialList.length < this.materialList.length) {
+          if (this.materialList.length > this.pageSize) {
+            this.materielPageNum += 1;
+          }
+          this.materielFetchData();
+        }
+      },
+      materielFetchData() {
+        const start = (this.materielPageNum - 1) * this.pageSize;
+        const end = start + this.pageSize;
+        this.showMaterialList = this.showMaterialList.concat(
+          this.materialList.slice(start, end)
+        );
+        console.log(this.showMaterialList);
+      },
+      ...mapActions('dict', ['requestDict']),
+      getSceneState: useDictLabel(outputSceneState),
+      handleAssetType(r) {
+        const code = this.codeList.find((item) => item.dictCode == r);
+        return code?.dictValue;
+      },
+      tableRowClassName({ row, rowIndex }) {
+        console.log(row);
+        if (row.result == 2) {
+          return 'warning-row';
+        } else {
+          return '';
+        }
+      },
+      rowClass({ row, column, rowIndex, columnIndex }) {
+        if (rowIndex === 1) {
+          return {
+            display: 'none',
+            background: '#EEEEEE'
+          };
+        }
+        return { background: '#0000' };
+      },
+      async getAllCategoryType() {
+        const { data } = await allCategoryLevel();
+        this.codeList = data.map((item) => {
+          return { dictCode: item.id, dictValue: item.name };
+        });
+      },
+      async _getInfo() {
+        const res = await storageApi.getInboundDetailsById(
+          this.$route.query.id
+        );
+        console.log('===', res);
+        this.infoData = res;
+        this.extInfo = res.extInfo;
+        this.productList = res.outInDetailList.map(
+          (productItem, productIndex) => {
+            return {
+              ...productItem,
+              outInDetailRecordRequestList:
+                productItem.outInDetailRecordRequestList.map((packingItem) => {
+                  return {
+                    ...packingItem,
+                    categoryName: productItem.categoryName,
+                    categoryCode: productItem.categoryCode,
+                    materialDetailList: packingItem.materialDetailList.map(
+                      (materialItem) => {
+                        return {
+                          ...materialItem,
+                          categoryName: productItem.categoryName,
+                          categoryCode: productItem.categoryCode
+                        };
+                      }
+                    )
+                  };
+                })
+            };
+          }
+        );
+        // 获取包装维度数据
+        const arr = [];
+        for (const key in this.productList) {
+          for (const k in this.productList[key].outInDetailRecordRequestList) {
+            arr.push({
+              ...this.productList[key].outInDetailRecordRequestList[k]
+            });
+          }
+        }
+        this.packingList = arr;
+        // 获取物料维度数据
+        let iArr = [];
+        arr.forEach((item) => {
+          item.materialDetailList.forEach((ele) => {
+            iArr.push({ ...ele });
+          });
+        });
+        this.materialList = iArr;
+        console.log(this.packingList);
+        console.log(this.materialList);
+        this.pickingFetchData();
+        this.materielFetchData();
+      },
+      download(row) {
+        if (row.storePath) {
+          getFile({ objectName: row.storePath }, row.name);
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .stepsStatus {
+    width: 40%;
+    margin: 0 auto;
+  }
+  .p20 {
+    padding: 20px;
+  }
+  .flex {
+    display: flex;
+  }
+  .title {
+    justify-content: space-between;
+    border-bottom: 1px solid #ccc;
+    padding-bottom: 5px;
+    span {
+      font-size: 16px;
+    }
+    .col {
+      padding-left: 40px;
+      font-size: 14px;
+      color: #aaaaaa;
+    }
+  }
+  .degree {
+    margin-right: 10px;
+    padding: 0px 15px;
+    color: #fff;
+    font-size: 13px;
+    line-height: 23px;
+    border-radius: 23px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    span {
+      width: 5px;
+      height: 5px;
+      border-radius: 100%;
+      margin-right: 6px;
+      background-color: #fff;
+    }
+  }
+  .red {
+    background-color: rgb(163, 0, 20);
+  }
+  .blue {
+    background-color: #1989fa;
+  }
+  .createdInfo {
+    justify-content: space-around;
+    margin-top: 10px;
+    font-size: 14px;
+    .col {
+      color: #6e6e6e;
+      padding-right: 10px;
+    }
+  }
+  .mt40 {
+    margin-top: 40px;
+  }
+
+  .custSteps {
+    margin-top: 20px;
+    margin-left: 70px;
+    .box {
+      width: 158px;
+      border: 1px solid #ccc;
+      padding: 10px;
+      flex-direction: row;
+      flex-wrap: wrap;
+      // justify-content: space-between;
+      font-size: 12px;
+      color: #9e9e9e;
+      .x {
+        width: 20px;
+        height: 15px;
+        margin-right: 5px;
+      }
+      .q {
+        background-color: #d0e4d5;
+      }
+      .b {
+        background-color: #1989fa;
+      }
+      .g {
+        background-color: #157a2c;
+      }
+      .r {
+        background-color: #a30014;
+      }
+      .a {
+        align-items: center;
+        margin-bottom: 10px;
+      }
+      .mr10 {
+        margin-right: 10px;
+      }
+      .mb0 {
+        margin-bottom: 0;
+      }
+    }
+    .stepsInfo {
+      // flex: 1;
+      width: 483px;
+    }
+  }
+  .mt20 {
+    margin-top: 20px;
+  }
+  .content-detail {
+    overflow: hidden;
+  }
+  .executor {
+    font-size: 14px;
+    .col {
+      color: #6e6e6e;
+      padding-right: 10px;
+    }
+  }
+  .result {
+    justify-content: space-around;
+  }
+  .mr20 {
+    margin-right: 20px;
+  }
+  .details {
+    font-size: 14px;
+    margin-bottom: 10px;
+  }
+
+  .customSteps {
+    margin-top: 40px;
+    font-size: 14px;
+    margin-left: 80px;
+    .time {
+      font-size: 12px;
+      color: #6e6e6e;
+      margin-right: 20px;
+      position: relative;
+      &::after {
+        content: '';
+        width: 1px;
+        height: 100%;
+        background-color: #157a2c;
+        position: absolute;
+        right: -26px;
+      }
+    }
+    .flex:last-child {
+      .time {
+        &::after {
+          display: none;
+        }
+      }
+    }
+    .round {
+      margin-right: 20px;
+      width: 10px;
+      height: 10px;
+      border-radius: 100%;
+      background-color: #157a2c;
+      position: relative;
+      span {
+        position: absolute;
+        top: 50%;
+        left: 50%;
+        width: 4px;
+        height: 4px;
+        background-color: #fff;
+        border-radius: 100%;
+        transform: translate(-2px, -2px);
+      }
+    }
+    .text {
+      .info {
+        margin-top: 10px;
+        width: 955px;
+        background-color: #f0f3f3;
+        overflow: hidden;
+        padding: 10px;
+        margin-bottom: 10px;
+      }
+    }
+  }
+</style>

+ 869 - 0
src/views/warehouseManagement/outgoingManagement/details_3.vue

@@ -0,0 +1,869 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <div class="page-title">
+        <PageHeader title="出库单详情"> </PageHeader>
+      </div>
+      <div class="stepsStatus">
+        <el-steps :active="active" align-center>
+          <el-step title="创建"></el-step>
+          <el-step title="待审核"></el-step>
+          <el-step :title="stepsTitle" :status="stepsStatus"></el-step>
+        </el-steps>
+      </div>
+      <div>
+        <div class="content-detail">
+          <header-title title="基本信息" size="16px"></header-title>
+          <div class="mt20">
+            <el-form label-width="110px">
+              <el-col :span="8">
+                <el-form-item label="出库单号">
+                  <span>{{ infoData.bizNo }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="出库物品类型">
+                  <span>{{ handleAssetType(infoData.extInfo.assetType) }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="出库场景">
+                  <span>{{ getSceneState(infoData.bizType) }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="关联订单:">
+                  <span>{{ extInfo.documentSource }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8" v-if="infoData.bizType == 3">
+                <el-form-item label="客户名称">
+                  <span>{{ infoData.clientName }}</span>
+                </el-form-item> </el-col
+              ><el-col :span="8" v-if="infoData.bizType == 3">
+                <el-form-item label="客户联系人">
+                  <span>{{ infoData.clientUser }}</span>
+                </el-form-item> </el-col
+              ><el-col :span="8" v-if="infoData.bizType == 3">
+                <el-form-item label="客户电话">
+                  <span>{{ infoData.clientPhone }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item
+                  :label="infoData.bizType == 4 ? '领料单' : '来源单据'"
+                >
+                  <span>{{ infoData.bizNo }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="领料人联系方式">
+                  <span>{{ infoData.fromUserPhone }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="出库登记人">
+                  <span>{{ infoData.extInfo?.createUserName }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="权属部门">
+                  <span>{{ infoData.extInfo?.deptName }}</span>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="8">
+                <el-form-item label="创建时间">
+                  <span>{{ infoData.createTime }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="出库时间">
+                  <span>{{ infoData.createTime }}</span>
+                </el-form-item>
+              </el-col> -->
+              <el-col :span="8">
+                <el-form-item label="状态:">
+                  <span>{{ stepsTitle }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="领料人部门">
+                  <span>{{ infoData.extInfo.verifyDeptName }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="领料人">
+                  <span>{{ infoData.fromUser }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label="备注">
+                  <span>{{ infoData.remark }}</span>
+                </el-form-item>
+              </el-col>
+            </el-form>
+          </div>
+        </div>
+        <div class="content-detail mt20">
+          <header-title title="产品信息" size="16px"></header-title>
+          <el-table
+            ref="productListTable"
+            :data="productList"
+            border
+            tooltip-effect="dark"
+            :max-height="300"
+            :header-cell-style="rowClass"
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="categoryCode"
+              align="center"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              align="center"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              v-if="clientEnvironmentId == 4"
+              label="级别"
+              prop="level"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              label="型号"
+              align="center"
+              prop="categoryModel"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="规格"
+              align="center"
+              prop="specification"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="牌号"
+              align="center"
+              prop="brandNum"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              v-for="(item, index) in newColumns"
+              :label="item.label"
+              :align="item.align"
+              :prop="item.prop"
+              :show-overflow-tooltip="item.showOverflowTooltip"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="最小包装单元"
+              align="center"
+              width="120"
+              prop="minPackingQuantity"
+            >
+              <template slot-scope="{ row, $index }">
+                {{ row.minPackingQuantity }} {{ row.measureUnit }} /{{
+                  row.packingUnit
+                }}
+              </template>
+            </el-table-column>
+
+            <el-table-column
+              label="包装数量"
+              prop="packingQuantity"
+              align="center"
+            >
+              <template slot-scope="{ row, $index }">
+                {{ row.packingQuantity }} {{ row.packingUnit }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+              width="100"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column label="计量单位" prop="measureUnit" align="center">
+              <template slot-scope="{ row, $index }">
+                <template>
+                  {{ row.measureUnit }}
+                </template>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="重量"
+              prop="weight"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column label="单价" prop="price" align="center">
+              <template slot-scope="{ row }">
+                <template>
+                  {{ row.price ? row.price : '-' + '元' }}/{{ row.measureUnit }}
+                </template>
+              </template>
+            </el-table-column>
+
+            <el-table-column
+              label="金额"
+              align="center"
+              prop="contentImage"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row, $index }">
+                {{ row.totalMoney ? row.totalMoney : 0 }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              v-if="clientEnvironmentId == 4"
+              label="采购原因"
+              align="center"
+              prop="purpose"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="仓库"
+              prop="warehouseName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+          </el-table>
+        </div>
+        <div class="mt20">
+          <header-title :title="`包装明细`" size="16px"></header-title>
+          <el-table
+            ref="showPackingListTable"
+            :data="showPackingList"
+            tooltip-effect="dark"
+            :max-height="300"
+            border
+            :row-class-name="tableRowClassName"
+            :header-cell-style="rowClass"
+            v-el-table-infinite-scroll="pickingHandleScroll"
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="发货条码"
+              prop="barcodes"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装编码"
+              prop="packageNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="packingQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装单位"
+              prop="packingUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measureUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="物料代号"
+              prop="materielDesignation"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="客户代号"
+              prop="clientCode"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="刻码"
+              prop="engrave"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量"
+              prop="weight"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="质检结果"
+              prop="result"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row }">
+                <span>{{ qualityResults[row.result] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="质检状态"
+              prop="status"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row }">
+                <span>{{ qualityStatus[row.status] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="生产日期"
+              prop="productionDate"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="采购日期"
+              prop="purchaseDate"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+          </el-table>
+        </div>
+        <div class="mt20">
+          <header-title :title="`物料明细`" size="16px"> </header-title>
+          <el-table
+            ref="multipleTable"
+            :data="showMaterialList"
+            tooltip-effect="dark"
+            :max-height="300"
+            :row-class-name="tableRowClassName"
+            :header-cell-style="rowClass"
+            border
+            style="width: 100%"
+            stripe
+            height="300px"
+            v-el-table-infinite-scroll="materielHandleScroll"
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column label="批次号" prop="batchNo"></el-table-column>
+            <el-table-column
+              label="物料编码"
+              prop="materialCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="发货条码"
+              prop="barcodes"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measureUnit"
+            ></el-table-column>
+            <el-table-column label="物料代号" prop="materielDesignation">
+            </el-table-column>
+            <el-table-column label="客户代号" prop="clientCode">
+            </el-table-column>
+            <el-table-column label="刻码" prop="engrave"> </el-table-column>
+            <el-table-column width="100" label="重量" prop="weight">
+            </el-table-column>
+            <el-table-column label="重量单位" prop="weightUnit">
+            </el-table-column>
+            <el-table-column label="质检结果" prop="result" width="120">
+              <template slot-scope="{ row }">
+                <span>{{ qualityResults[row.result] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="质检状态" prop="status" width="120">
+              <template slot-scope="{ row }">
+                <span>{{ qualityStatus[row.status] }}</span>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import elTableInfiniteScroll from 'el-table-infinite-scroll';
+  import { getFile } from '@/api/system/file/index.js';
+  import PageHeader from '@/components/PageHeader';
+  import storageApi from '@/api/warehouseManagement';
+  import { allCategoryLevel } from '@/api/classifyManage';
+  import { useDictLabel, outputSceneState } from '@/utils/dict/index';
+  import { mapGetters, mapActions } from 'vuex';
+  export default {
+    components: { PageHeader },
+    directives: {
+      'el-table-infinite-scroll': elTableInfiniteScroll
+    },
+    data() {
+      return {
+        newColumns: [], // 动态表头
+        qualityStatus: {
+          0: '未质检',
+          1: '已质检'
+        }, // 质检状态 0未检 1已检
+        qualityResults: {
+          1: '合格',
+          2: '不合格'
+        }, // 质检结果 1合格 2不合格
+        productList: [], // 产品列表
+        showPackingList: [], // 展示的包装列表
+        packingList: [], // 包装列表
+        showMaterialList: [], // 展示物料列表
+        materialList: [], // 物料列表
+        extInfo: {}, // 扩展信息
+        pageSize: 20,
+        pickingPageNum: 1,
+        materielPageNum: 1,
+        codeList: [],
+        infoData: {},
+        stepsTitle: '已完成',
+        stepsStatus: 'success',
+        active: 0
+      };
+    },
+    watch: {
+      'infoData.verifyStatus': {
+        immediate: true,
+        handler(val) {
+          if (val == 0) {
+            this.active = 1;
+            this.stepsTitle = '未审核';
+            this.stepsStatus = 'wait';
+          } else if (val == 1) {
+            this.active = 2;
+            this.stepsTitle = '审核中';
+            this.stepsStatus = 'process';
+          } else if (val == 2) {
+            this.active = 2;
+            this.stepsTitle = '审核通过';
+            this.stepsStatus = 'success';
+          } else if (val == 3) {
+            this.active = 2;
+            this.stepsTitle = '驳回';
+            this.stepsStatus = 'error';
+          }
+        }
+      },
+      packingList: {
+        handler(newVal) {
+          console.log('包装列表', newVal);
+          console.log('当前包装列表加载页数', this.pickingPageNum);
+          this.showPackingList = newVal.slice(
+            0,
+            this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
+          );
+        },
+        deep: true
+      },
+      materialList: {
+        handler(newVal) {
+          console.log('物料列表', newVal);
+          console.log('当前物料列表加载页数', this.materielPageNum);
+          this.showMaterialList = newVal.slice(
+            0,
+            this.pageSize *
+              (this.materielPageNum > 0 ? this.materielPageNum : 1)
+          );
+        },
+        deep: true
+      }
+    },
+    computed: {
+      ...mapGetters(['getDictValue']),
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    created() {
+      this.getFieldModel();
+      this.requestDict('类型用途');
+      this.getAllCategoryType();
+      this._getInfo();
+    },
+    methods: {
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: '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];
+        });
+      },
+      pickingHandleScroll() {
+        console.log('---------pickingHandleScroll------------');
+        if (this.showPackingList.length < this.packingList.length) {
+          if (this.packingList.length > this.pageSize) {
+            this.pickingPageNum += 1;
+          }
+          this.pickingFetchData();
+        }
+      },
+      pickingFetchData() {
+        const start = (this.pickingPageNum - 1) * this.pageSize;
+        const end = start + this.pageSize;
+        this.showPackingList = this.showPackingList.concat(
+          this.packingList.slice(start, end)
+        );
+      },
+      materielHandleScroll() {
+        console.log('---------materielHandleScroll------------');
+        if (this.showMaterialList.length < this.materialList.length) {
+          if (this.materialList.length > this.pageSize) {
+            this.materielPageNum += 1;
+          }
+          this.materielFetchData();
+        }
+      },
+      materielFetchData() {
+        const start = (this.materielPageNum - 1) * this.pageSize;
+        const end = start + this.pageSize;
+        this.showMaterialList = this.showMaterialList.concat(
+          this.materialList.slice(start, end)
+        );
+        console.log(this.showMaterialList);
+      },
+      ...mapActions('dict', ['requestDict']),
+      getSceneState: useDictLabel(outputSceneState),
+      handleAssetType(r) {
+        const code = this.codeList.find((item) => item.dictCode == r);
+        return code?.dictValue;
+      },
+      tableRowClassName({ row, rowIndex }) {
+        console.log(row);
+        if (row.result == 2) {
+          return 'warning-row';
+        } else {
+          return '';
+        }
+      },
+      rowClass({ row, column, rowIndex, columnIndex }) {
+        if (rowIndex === 1) {
+          return {
+            display: 'none',
+            background: '#EEEEEE'
+          };
+        }
+        return { background: '#0000' };
+      },
+      async getAllCategoryType() {
+        const { data } = await allCategoryLevel();
+        this.codeList = data.map((item) => {
+          return { dictCode: item.id, dictValue: item.name };
+        });
+      },
+      async _getInfo() {
+        const res = await storageApi.getInboundDetailsById(
+          this.$route.query.id
+        );
+        console.log('===', res);
+        this.infoData = res;
+        this.extInfo = res.extInfo;
+        this.productList = res.outInDetailList.map(
+          (productItem, productIndex) => {
+            return {
+              ...productItem,
+              outInDetailRecordRequestList:
+                productItem.outInDetailRecordRequestList.map((packingItem) => {
+                  return {
+                    ...packingItem,
+                    categoryName: productItem.categoryName,
+                    categoryCode: productItem.categoryCode,
+                    materialDetailList: packingItem.materialDetailList.map(
+                      (materialItem) => {
+                        return {
+                          ...materialItem,
+                          categoryName: productItem.categoryName,
+                          categoryCode: productItem.categoryCode
+                        };
+                      }
+                    )
+                  };
+                })
+            };
+          }
+        );
+        // 获取包装维度数据
+        const arr = [];
+        for (const key in this.productList) {
+          for (const k in this.productList[key].outInDetailRecordRequestList) {
+            arr.push({
+              ...this.productList[key].outInDetailRecordRequestList[k]
+            });
+          }
+        }
+        this.packingList = arr;
+        // 获取物料维度数据
+        let iArr = [];
+        arr.forEach((item) => {
+          item.materialDetailList.forEach((ele) => {
+            iArr.push({ ...ele });
+          });
+        });
+        this.materialList = iArr;
+        console.log(this.packingList);
+        console.log(this.materialList);
+        this.pickingFetchData();
+        this.materielFetchData();
+      },
+      download(row) {
+        if (row.storePath) {
+          getFile({ objectName: row.storePath }, row.name);
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .stepsStatus {
+    width: 40%;
+    margin: 0 auto;
+  }
+  .p20 {
+    padding: 20px;
+  }
+  .flex {
+    display: flex;
+  }
+  .title {
+    justify-content: space-between;
+    border-bottom: 1px solid #ccc;
+    padding-bottom: 5px;
+    span {
+      font-size: 16px;
+    }
+    .col {
+      padding-left: 40px;
+      font-size: 14px;
+      color: #aaaaaa;
+    }
+  }
+  .degree {
+    margin-right: 10px;
+    padding: 0px 15px;
+    color: #fff;
+    font-size: 13px;
+    line-height: 23px;
+    border-radius: 23px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    span {
+      width: 5px;
+      height: 5px;
+      border-radius: 100%;
+      margin-right: 6px;
+      background-color: #fff;
+    }
+  }
+  .red {
+    background-color: rgb(163, 0, 20);
+  }
+  .blue {
+    background-color: #1989fa;
+  }
+  .createdInfo {
+    justify-content: space-around;
+    margin-top: 10px;
+    font-size: 14px;
+    .col {
+      color: #6e6e6e;
+      padding-right: 10px;
+    }
+  }
+  .mt40 {
+    margin-top: 40px;
+  }
+
+  .custSteps {
+    margin-top: 20px;
+    margin-left: 70px;
+    .box {
+      width: 158px;
+      border: 1px solid #ccc;
+      padding: 10px;
+      flex-direction: row;
+      flex-wrap: wrap;
+      // justify-content: space-between;
+      font-size: 12px;
+      color: #9e9e9e;
+      .x {
+        width: 20px;
+        height: 15px;
+        margin-right: 5px;
+      }
+      .q {
+        background-color: #d0e4d5;
+      }
+      .b {
+        background-color: #1989fa;
+      }
+      .g {
+        background-color: #157a2c;
+      }
+      .r {
+        background-color: #a30014;
+      }
+      .a {
+        align-items: center;
+        margin-bottom: 10px;
+      }
+      .mr10 {
+        margin-right: 10px;
+      }
+      .mb0 {
+        margin-bottom: 0;
+      }
+    }
+    .stepsInfo {
+      // flex: 1;
+      width: 483px;
+    }
+  }
+  .mt20 {
+    margin-top: 20px;
+  }
+  .content-detail {
+    overflow: hidden;
+  }
+  .executor {
+    font-size: 14px;
+    .col {
+      color: #6e6e6e;
+      padding-right: 10px;
+    }
+  }
+  .result {
+    justify-content: space-around;
+  }
+  .mr20 {
+    margin-right: 20px;
+  }
+  .details {
+    font-size: 14px;
+    margin-bottom: 10px;
+  }
+
+  .customSteps {
+    margin-top: 40px;
+    font-size: 14px;
+    margin-left: 80px;
+    .time {
+      font-size: 12px;
+      color: #6e6e6e;
+      margin-right: 20px;
+      position: relative;
+      &::after {
+        content: '';
+        width: 1px;
+        height: 100%;
+        background-color: #157a2c;
+        position: absolute;
+        right: -26px;
+      }
+    }
+    .flex:last-child {
+      .time {
+        &::after {
+          display: none;
+        }
+      }
+    }
+    .round {
+      margin-right: 20px;
+      width: 10px;
+      height: 10px;
+      border-radius: 100%;
+      background-color: #157a2c;
+      position: relative;
+      span {
+        position: absolute;
+        top: 50%;
+        left: 50%;
+        width: 4px;
+        height: 4px;
+        background-color: #fff;
+        border-radius: 100%;
+        transform: translate(-2px, -2px);
+      }
+    }
+    .text {
+      .info {
+        margin-top: 10px;
+        width: 955px;
+        background-color: #f0f3f3;
+        overflow: hidden;
+        padding: 10px;
+        margin-bottom: 10px;
+      }
+    }
+  }
+</style>

文件差异内容过多而无法显示
+ 668 - 118
src/views/warehouseManagement/picking/add.vue


+ 680 - 0
src/views/warehouseManagement/picking/components/disassembleDialog.vue

@@ -0,0 +1,680 @@
+<template>
+  <div>
+    <el-dialog
+      :title="typeName"
+      :visible.sync="dialogVisible"
+      width="90%"
+      :before-close="handleClose"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+    >
+      <div class="productBox">
+        <div class="productsList">
+          <header-title title="库存台账"></header-title>
+          <div class="control_btn">
+            <div
+              ><span>包装规格:</span>
+              <template v-for="item in packingSpecificationOption">
+                <el-tag v-if="item.sort > 0"
+                  >{{ item.packageCell }}{{ item.packageUnit }}/{{
+                    item.conversionUnit
+                  }}</el-tag
+                >
+              </template>
+            </div>
+            <div>
+              <el-select
+                v-if="typeName == '拆包'"
+                style="margin-right: 10px"
+                v-model="selectValue"
+                :placeholder="`请选择${typeName}维度`"
+              >
+                <template v-for="item in selectList">
+                  <el-option
+                    :label="item.packageUnit"
+                    :value="item.packageUnit"
+                    :key="item.packageUnit"
+                  >
+                  </el-option>
+                </template>
+              </el-select>
+              <el-select
+                v-else
+                style="margin-right: 10px"
+                v-model="selectValue"
+                :placeholder="`请选择${typeName}维度`"
+              >
+                <template v-for="item in selectList">
+                  <el-option
+                    :label="item.conversionUnit"
+                    :value="item.conversionUnit"
+                    :key="item.conversionUnit"
+                  >
+                  </el-option>
+                </template>
+              </el-select>
+              <el-button type="primary" @click="merge">{{
+                typeName
+              }}</el-button>
+            </div>
+          </div>
+          <el-table
+            ref="table"
+            :height="600"
+            :data="productList"
+            row-key="id"
+            @selection-change="selecctedRow"
+            tooltip-effect="dark"
+            border
+          >
+            <el-table-column
+              fixed="left"
+              align="center"
+              width="50"
+              :reserve-selection="true"
+              :selectable="checkSelectable"
+              type="selection"
+            ></el-table-column>
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="物品编码"
+              prop="categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="物品名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="牌号"
+              prop="brandNum"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="型号"
+              prop="categoryModel"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="规格"
+              prop="specification"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="包装编码"
+              prop="packageNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="packingQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装单位"
+              prop="packingUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measureUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="重量"
+              prop="weight"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="仓库"
+              prop="warehouseName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+          </el-table>
+        </div>
+        <div class="allocateDetails">
+          <header-title :title="`${typeName}明细`"></header-title>
+          <div class="control_btn">
+            <div></div>
+            <div>
+              <el-button type="primary" @click="clearTable">清空</el-button>
+            </div>
+          </div>
+          <el-table
+            :height="600"
+            ref="detailTable"
+            :data="tableData"
+            tooltip-effect="dark"
+            border
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="物品编码"
+              prop="categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="物品名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="牌号"
+              prop="brandNum"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="型号"
+              prop="categoryModel"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="规格"
+              prop="specification"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="包装编码"
+              prop="packageNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="packingQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装单位"
+              prop="packingUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measureUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="重量"
+              prop="weight"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="仓库"
+              prop="warehouseName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="handleMine">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import { mapActions, mapGetters } from 'vuex';
+  import storageApi from '@/api/warehouseManagement';
+  import { getCode } from '@/api/codeManagement/index.js';
+  export default {
+    data() {
+      return {
+        typeName: '',
+        productList: [],
+        tableData: [],
+        dialogVisible: false,
+        selectionIds: [],
+        selection: [],
+        isSplit: false,
+        selectValue: '',
+        packingSpecificationOption: []
+      };
+    },
+    computed: {
+      ...mapGetters(['dict', 'getDict']),
+      selectList() {
+        if (this.isSplit) {
+          // 计量单位为KG类的情况
+          return this.packingSpecificationOption.filter(
+            (item) => item.sort > 1
+          );
+        } else {
+          return this.packingSpecificationOption.filter(
+            (item) => item.sort > 0
+          );
+        }
+      }
+    },
+    methods: {
+      ...mapActions('dict', ['requestDict']),
+      clearTable() {
+        this.tableData = [];
+        this.selection = [];
+        this.selectionIds = [];
+        this.$refs.table.clearSelection();
+      },
+      async merge() {
+        if (!this.selectValue) {
+          return this.$message.error(`请选择${this.typeName}维度`);
+        }
+        if (this.selection.length > 0) {
+          console.log(this.selection);
+          console.log(this.selectionIds);
+          let boolen = this.selection.every((item) =>
+            this.selectionIds.includes(item.id)
+          );
+          if (this.selection.length > 0 && !boolen) {
+            this.selection = this.selection.filter(
+              (item) => !this.selectionIds.includes(item.id)
+            );
+
+            console.log('this.selection---------', this.selection);
+            console.log('this.selectionIds---', this.selectionIds);
+            if (this.typeName == '拆包') {
+              // 拆包
+              let packageUnitList = this.selection.map(
+                (item) => item.packingUnit
+              );
+              let currentIndex = this.selectList.findIndex(
+                (item) => item.packageUnit == this.selectValue
+              );
+              let split = packageUnitList.every((item) => {
+                return (
+                  this.selectList.findIndex((ite) => ite.packageUnit == item) >
+                    currentIndex ||
+                  this.selectList.findIndex(
+                    (ite) => ite.conversionUnit == item
+                  ) ==
+                    this.selectList.length - 1
+                );
+              });
+              if (split) {
+                console.log('允许拆分');
+                this.selection.map(async (item, index) => {
+                  console.log('item---', item);
+                  console.log('this.selectList--', this.selectList);
+                  let targetIndex = this.selectList.findIndex(
+                    (ite) => ite.conversionUnit == item.packingUnit
+                  );
+                  console.log('targetIndex--', targetIndex);
+                  console.log('currentIndex--', currentIndex);
+                  let num = item.packingQuantity;
+                  for (let i = targetIndex; i >= currentIndex; i--) {
+                    num = num * this.selectList[i].packageCell;
+                  }
+                  console.log(num);
+                  let { data } = await storageApi.getAssetNum([
+                    {
+                      assetCode: item.categoryCode + index,
+                      batchNum: item.batchNo,
+                      num: num
+                    }
+                  ]);
+                  console.log('data----------', data);
+                  for (let i = 0; i < num; i++) {
+                    this.tableData.push({
+                      ...item,
+                      packingQuantity: 1,
+                      packageNo: data[i].onlyCode,
+                      packingUnit: this.selectValue,
+                      measureQuantity: this.$math.format(
+                        item.measureQuantity / num,
+                        14
+                      ),
+                      weight: this.$math.format(item.weight / num, 14)
+                    });
+                  }
+                });
+              } else {
+                return this.$message.error('请检查所选的包装单位是否正确');
+              }
+              // // 获取包装维度
+              // let packingSpecification =
+              //   await storageApi.getCategoryPackageDisposition({
+              //     categoryIds: this.selection.map((item) => item.categoryId)
+              //   });
+              // let packingSpecificationOption = this.selection.map((item) => {
+              //   return packingSpecification
+              //     .filter((ite) => item.categoryId == ite.categoryId)
+              //     .sort((a, b) => a.sort - b.sort);
+              // });
+              // let isBoolen = this.selection.every(
+              //   (item, index) =>
+              //     item.packingUnit !==
+              //     packingSpecificationOption[index][0].packageUnit
+              // );
+              // if (isBoolen) {
+              //   let list = this.selection.map((item, index) => {
+              //     let splitIndex = packingSpecificationOption[index].findIndex(
+              //       (ite) =>
+              //         ite.conversionUnit != ite.packageUnit &&
+              //         item.packingUnit == ite.conversionUnit
+              //     );
+              //     // 计算最小计量数量和数量
+              //     let measureQuantity = 1;
+              //     let reduceIndex = splitIndex;
+              //     for (; reduceIndex > 0; reduceIndex--) {
+              //       measureQuantity = this.$math.format(
+              //         measureQuantity *
+              //           packingSpecificationOption[index][reduceIndex - 1]
+              //             .packageCell,
+              //         14
+              //       );
+              //     }
+              //     return {
+              //       ...item,
+              //       packingQuantity: 1,
+              //       packingUnit:
+              //         packingSpecificationOption[index][splitIndex].packageUnit,
+              //       num: packingSpecificationOption[index][splitIndex]
+              //         .packageCell,
+              //       measureUnit:
+              //         packingSpecificationOption[index][1].packageUnit,
+              //       measureQuantity,
+              //       weight: this.$math.format(
+              //         item.weight /
+              //           packingSpecificationOption[index][splitIndex]
+              //             .packageCell,
+              //         14
+              //       )
+              //     };
+              //   });
+              //   list.forEach((item) => {
+              //     for (let i = 0; i < item.num; i++) {
+              //       this.tableData.push({ ...item });
+              //     }
+              //   });
+              //   console.log(list);
+              // } else {
+              //   return this.$message.error(
+              //     `请选择需要正确${this.typeName}选项`
+              //   );
+              // }
+              // console.log(
+              //   'packingSpecificationOption-----',
+              //   packingSpecificationOption
+              // );
+            } else {
+              // 打包
+              let packageUnitList = this.selection.map(
+                (item) => item.packingUnit
+              );
+              let currentIndex = this.selectList.findIndex(
+                (item) => item.conversionUnit == this.selectValue
+              );
+              let split = packageUnitList.every((item) => {
+                return (
+                  this.selectList.findIndex(
+                    (ite) => ite.conversionUnit == item
+                  ) ==
+                  currentIndex - 1
+                );
+              });
+              if (split) {
+                if (
+                  this.selection.length ===
+                  this.selectList[currentIndex].packageCell
+                ) {
+                  console.log('开始合并');
+                  let { data } = await storageApi.getAssetNum([
+                    {
+                      assetCode: this.selection[0].categoryCode + '0',
+                      batchNum: this.selection[0].batchNo,
+                      num: 1
+                    }
+                  ]);
+                  this.tableData.push({
+                    ...this.selection[0],
+                    packingQuantity: 1,
+                    ids: this.selection.map((item) => item.id),
+                    packageNo: data[0].onlyCode,
+                    packingUnit: this.selectValue,
+                    measureQuantity: this.selection.reduce(
+                      (a, b) =>
+                        this.$math.format(
+                          Number(a) + Number(b.measureQuantity),
+                          14
+                        ),
+                      0
+                    ),
+                    weight: this.selection.reduce(
+                      (a, b) =>
+                        this.$math.format(Number(a) + Number(b.weight), 14),
+                      0
+                    )
+                  });
+                } else {
+                  return this.$message.error('请按照包装规格数量进行打包');
+                }
+              } else {
+                return this.$message.error('请检查所选的包装单位是否正确');
+              }
+              // let isBoolen = this.selection.every(
+              //   (item) =>
+              //     item.categoryId == this.selection[0].categoryId &&
+              //     item.packingUnit == this.selection[0].packingUnit
+              // );
+              // if (isBoolen) {
+              //   let packingSpecification =
+              //     await storageApi.getCategoryPackageDisposition({
+              //       categoryIds: [this.selection[0].categoryId]
+              //     });
+              //   let packingSpecificationOption = packingSpecification.sort(
+              //     (a, b) => a.sort - b.sort
+              //   );
+              //   let splitIndex = packingSpecificationOption.findIndex(
+              //     (ite) =>
+              //       ite.conversionUnit != ite.packageUnit &&
+              //       this.selection[0].packingUnit == ite.packageUnit
+              //   );
+              //   console.log(packingSpecificationOption);
+              //   console.log(splitIndex);
+              //   if (splitIndex < 0) {
+              //     return this.$message.error(
+              //       '已经为最大包装维度,不能进行打包'
+              //     );
+              //   }
+              //   if (
+              //     this.selection.length <=
+              //     packingSpecificationOption[splitIndex].packageCell
+              //   ) {
+              //     this.tableData.push({
+              //       ...this.selection[0],
+              //       packingQuantity: 1,
+              //       packingUnit:
+              //         packingSpecificationOption[splitIndex].conversionUnit,
+              //       measureQuantity: this.selection.reduce(
+              //         (a, b) =>
+              //           this.$math.format(
+              //             Number(a) + Number(b.measureQuantity),
+              //             14
+              //           ),
+              //         0
+              //       ),
+              //       weight: this.selection.reduce(
+              //         (a, b) =>
+              //           this.$math.format(Number(a) + Number(b.weight), 14),
+              //         0
+              //       )
+              //     });
+              //   } else {
+              //     return this.$message.error('打包数量超出最大包装数量');
+              //   }
+              // } else {
+              //   return this.$message.error(
+              //     `请选择需要正确${this.typeName}选项`
+              //   );
+              // }
+            }
+            this.selectionIds = this.selectionIds.concat(
+              this.selection.map((item) => item.id)
+            );
+            console.log('this.selectionIds----', this.selectionIds);
+          } else {
+            this.$message.error('请选择正确的行');
+          }
+        } else {
+          this.$message.error(`请选择需要${this.typeName}物品`);
+        }
+      },
+      selecctedRow(val) {
+        this.selection = val;
+      },
+      checkSelectable(row) {
+        return !this.selectionIds.includes(row.id);
+      },
+      async handleMine() {
+        if (this.tableData.length > 0) {
+          if (this.typeName == '拆包') {
+            console.log('拆包');
+            let params = this.selectionIds.map((item) => {
+              return {
+                id: item,
+                packingLists: this.tableData.filter((ite) => ite.id == item)
+              };
+            });
+            try {
+              await storageApi.takeApartPackage(params);
+              this.dialogVisible = false;
+              this.$emit('flushed');
+            } catch (error) {
+              return this.$message.error('拆包失败');
+            }
+          } else {
+            console.log('打包');
+            let params = this.tableData.map((item) => {
+              return {
+                ids: item.ids,
+                packingInfo: item
+              };
+            });
+            try {
+              await storageApi.combinePackage(params);
+              this.dialogVisible = false;
+              this.$emit('flushed');
+            } catch (error) {
+              return this.$message.error('打包失败');
+            }
+          }
+        } else {
+          return this.$message.error(`请选择需要${this.typeName}的物品`);
+        }
+      },
+      async open(data, typeName) {
+        await this.requestDict('不拆物料层规格');
+        // 获取包装规格
+        let packingSpecification =
+          await storageApi.getCategoryPackageDisposition({
+            categoryIds: data.map((item) => item.categoryId)
+          });
+        this.packingSpecificationOption = packingSpecification.sort(
+          (a, b) => a.sort - b.sort
+        );
+        console.log(data[0].measureUnit);
+        console.log(this.dict);
+        this.isSplit = !!this.getDict('不拆物料层规格', data[0].measureUnit)
+          .dictValue;
+        console.log(this.isSplit);
+        this.productList = data;
+        this.typeName = typeName;
+        this.dialogVisible = true;
+        this.$nextTick(() => {
+          this.tableData = [];
+          this.selectValue = '';
+          this.selectionIds = [];
+          this.selection = [];
+          this.$refs.table.clearSelection();
+        });
+      },
+      handleClose() {
+        this.dialogVisible = false;
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .productBox {
+    height: 600px;
+    display: flex;
+    flex: 3;
+    > div {
+      flex: 1;
+      overflow: hidden;
+    }
+  }
+  .productsList {
+    margin-right: 10px;
+    display: flex;
+    flex-direction: column;
+    :deep(.el-table) {
+      flex: 1;
+      display: flex;
+      flex-direction: column;
+      .el-table__body-wrapper {
+        flex: 1;
+      }
+    }
+  }
+  .allocateDetails {
+    display: flex;
+    flex-direction: column;
+    :deep(.el-table) {
+      flex: 1;
+      display: flex;
+      flex-direction: column;
+      .el-table__body-wrapper {
+        flex: 1;
+      }
+    }
+  }
+  .control_btn {
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    margin-bottom: 10px;
+    > div:first-child {
+      flex: 1;
+    }
+  }
+</style>

+ 22 - 29
src/views/warehouseManagement/picking/components/inventory-search.vue

@@ -27,7 +27,7 @@
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="仓库" prop="sourceWarehouse">
+        <el-form-item label="仓库" prop="warehouseId">
           <el-select
             filterable
             placeholder="请选择"
@@ -45,19 +45,19 @@
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="物品名称:">
+        <el-form-item label="拣货名称:">
           <el-input
             clearable
-            v-model="where.categoryName"
+            v-model="where.name"
             placeholder="请输入物品名称"
           />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="物品编码:">
+        <el-form-item label="拣货编码:">
           <el-input
             clearable
-            v-model="where.categoryCode"
+            v-model="where.code"
             placeholder="请输入物品编码"
           />
         </el-form-item>
@@ -95,38 +95,30 @@
     data() {
       // 默认表单数据
       const defaultWhere = {
-        name: '',
-        allotCode: '',
-        type: '',
-        status: '',
         factoryId: '',
-        categoryName: '',
-        categoryCode: '',
-        targetWarehouse: '',
-        sourceWarehouse: ''
+        name: '',
+        code: '',
+        warehouseId: ''
       };
       return {
         // 表单数据
-        where: { ...defaultWhere },
+        where: {
+          factoryId: '',
+          name: '',
+          code: '',
+          warehouseId: ''
+        },
+        defaultWhere: {
+          factoryId: '',
+          name: '',
+          code: '',
+          warehouseId: ''
+        },
         treeLoading: false,
         allocationType,
         treeData: [],
         factoryList: [],
-        warehouseList: [],
-        stutusOptions: [
-          {
-            value: 0,
-            label: '未提交'
-          },
-          {
-            value: 1,
-            label: '审核中'
-          },
-          {
-            value: 2,
-            label: '已完成'
-          }
-        ]
+        warehouseList: []
       };
     },
     computed: {
@@ -171,6 +163,7 @@
       },
       /*  重置 */
       reset() {
+        this.warehouseList = [];
         this.where = { ...this.defaultWhere };
         this.search();
       }

+ 198 - 0
src/views/warehouseManagement/picking/components/outboundRequisitionDialog.vue

@@ -0,0 +1,198 @@
+<template>
+  <div>
+    <el-dialog
+      :title="`选择${type == 1 ? '入库' : '出库'}申请单`"
+      :visible.sync="dialogVisible"
+      width="90%"
+      :before-close="handleClose"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+    >
+      <div class="main">
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          @cell-click="cellClick"
+          cache-key="workOrderTable"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:action="{ row }">
+            <el-radio class="radio" v-model="currentId" :label="row.id"
+              ><i></i
+            ></el-radio>
+          </template>
+          <template v-slot:totalCount="{ row }">
+            {{ row.totalCount }} {{ row.measuringUnit }}
+          </template>
+
+          <template v-slot:totalPackage="{ row }">
+            {{ row.totalPackage }}
+          </template>
+
+          <template v-slot:totalWeight="{ row }">
+            {{ row.totalWeight }} {{ row.weightUnit }}
+          </template>
+
+          <template v-slot:status="{ row }">
+            <span>
+              {{ statusFormatter(row.status) }}
+            </span>
+          </template>
+        </ele-pro-table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="handleMine">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import { outputSceneState, sceneState } from '@/utils/dict/index';
+  import storageApi from '@/api/warehouseManagement';
+  import { getCode } from '@/api/codeManagement/index.js';
+  export default {
+    props: {
+      // 1入库 2出库
+      type: {
+        type: String,
+        default: '1'
+      }
+    },
+    data() {
+      return {
+        outputSceneState,
+        sceneState,
+        dialogVisible: false,
+        currentRow: {},
+        currentId: '',
+        statusOpt: [
+          { label: '待处理', value: 0 },
+          { label: '已处理', value: 1 },
+          { label: '已撤销', value: 2 }
+        ]
+      };
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            align: 'center',
+            minWidth: 100
+          },
+          {
+            prop: 'categoryNames',
+            label: '名称',
+            align: 'center'
+          },
+          { label: '型号', prop: 'modelType', width: '150' },
+          { label: '规格', prop: 'specification', width: '150' },
+          { label: '牌号', prop: 'brandNum', width: '100' },
+          {
+            prop: 'sourceType',
+            label: '出入库类型',
+            align: 'center',
+            formatter: (row, column, cellValue) => {
+              console.log(row);
+              switch (this.type) {
+                case '1':
+                  // 入库
+                  return this.sceneState.filter(
+                    (item) => item.code == row.sourceType
+                  )[0].label;
+                case '2':
+                  // 出库
+                  return this.outputSceneState.filter(
+                    (item) => item.code == row.sourceType
+                  )[0].label;
+              }
+            }
+          },
+          {
+            prop: 'approvalUserName',
+            label: '审核人',
+            align: 'center'
+          },
+          {
+            prop: 'createUserName',
+            label: '申请人',
+            align: 'center'
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            slot: 'status',
+            label: '状态',
+            align: 'center'
+          }
+        ];
+      }
+    },
+    methods: {
+      handleMine() {
+        if (!this.currentId) {
+          return this.$message.warning(
+            `请选择${this.type == 1 ? '入库' : '出库'}申请单`
+          );
+        }
+
+        storageApi
+          .getApplystoragedetail({ applyId: this.currentId })
+          .then(async (res) => {
+            this.$emit('detailData', res, this.currentRow.code);
+            this.dialogVisible = false;
+          });
+      },
+      // 单击获取id
+      cellClick(row) {
+        this.currentRow = row;
+        this.currentId = row.id;
+      },
+      statusFormatter(status) {
+        const obj = this.statusOpt.find((i) => i.value == status);
+        return obj && obj.label;
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return storageApi.getinboundRequestsList({
+          pageNum: page,
+          size: limit,
+          status: 0,
+          type: this.type,
+          ...where
+        });
+      },
+      open() {
+        this.dialogVisible = true;
+      },
+      handleClose() {
+        this.dialogVisible = false;
+      }
+    }
+  };
+</script>

+ 64 - 67
src/views/warehouseManagement/picking/index.vue

@@ -14,9 +14,14 @@
             >新建</el-button
           >
         </template>
+        <!-- <template v-slot:code="{ row }">
+          <el-link type="primary" @click="goDetail(row)">{{
+            row.code
+          }}</el-link>
+        </template> -->
         <template v-slot:action="{ row }">
           <el-link
-            v-if="row.status == 0 && row.type == 2"
+            v-if="row.status == 0"
             type="primary"
             :underline="false"
             icon="el-icon-view"
@@ -33,23 +38,23 @@
           >
             修改
           </el-link>
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-view"
-            @click="goDetail(row)"
-          >
-            详情
-          </el-link>
-          <el-link
+          <el-popconfirm
             v-if="row.status == 0"
-            type="primary"
-            :underline="false"
-            icon="el-icon-delete"
-            @click="deleted(row)"
+            style="margin-left: 10px"
+            confirm-button-text="确认"
+            cancel-button-text="取消"
+            title="是否确认删除?"
+            @confirm="deleted(row)"
           >
-            删除
-          </el-link>
+            <el-link
+              slot="reference"
+              type="primary"
+              :underline="false"
+              icon="el-icon-delete"
+            >
+              删除
+            </el-link>
+          </el-popconfirm>
         </template>
       </ele-pro-table>
     </el-card>
@@ -87,68 +92,50 @@
           },
           {
             prop: 'name',
-            label: '调拨名称',
+            label: '拣货名称',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'allotCode',
-            label: '调拨单号',
+            prop: 'code',
+            slot: 'code',
+            label: '拣货编码',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'type',
-            label: '调拨类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110,
-            formatter: (row, column, cellValue) => {
-              return this.allocationType.filter(
-                (item) => item.code == row.type
-              )[0].label;
-            }
-          },
-          {
-            prop: 'categoryName',
-            label: '物品名称',
+            prop: 'sourceNo',
+            label: '领料单号',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'categoryCode',
-            label: '物品编码',
+            prop: 'outInNo',
+            label: '出库单号',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'sourceWarehouse',
-            label: '来源仓库',
+            prop: 'warehouseName',
+            label: '仓库名称',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'targetWarehouse',
-            label: '目标仓库',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'allotName',
-            label: '调拨人',
+            prop: 'createName',
+            label: '拣货人',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
             prop: 'createTime',
-            label: '调拨时间',
+            label: '创建时间',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
@@ -159,7 +146,7 @@
             align: 'center',
             showOverflowTooltip: true,
             formatter: (row, column, cellValue) => {
-              return this.stutusOptions[row.status];
+              return ['拣货中', '拣货完成', '已出库'][row.status];
             }
           },
           {
@@ -179,7 +166,7 @@
     methods: {
       // 删除
       async deleted(row) {
-        const data = await storageApi.deleteAllot([row.id]);
+        const data = await storageApi.deletePickgoods([row.id]);
         if (data.code == '0') {
           this.$message.success('删除成功!');
           this.reload();
@@ -187,36 +174,46 @@
       },
       // 提交
       submit(row) {
-        storageApi
-          .submitAllot({
-            id: row.id,
-            enterVerifyUserId: row.sourceWarehouseUserId,
-            outVerifyUserId: row.targetWarehouseUserId
-          })
-          .then(() => {
-            this.$message({
-              type: 'success',
-              message: '提交成功'
+        if (row.info.length === row.list.length) {
+          storageApi
+            .updatePickgoods({
+              id: row.id,
+              code: row.code,
+              name: row.name,
+              sourceNo: row.sourceNo,
+              warehouseId: row.info[0].warehouseId,
+              warehouseName: row.info[0].warehouseName,
+              status: 2, // 出库
+              info: row.info
+            })
+            .then(() => {
+              this.$message({
+                type: 'success',
+                message: '提交成功'
+              });
+              this.reload();
             });
-            this.reload();
-          });
+        } else {
+          this.$message.error('请完善当前拣货单的库存信息');
+        }
       },
       // 修改
       edit(row) {
         this.$router.push({
-          path: '/warehouseManagement/inventoryAllocation/add',
-          query: { isEdit: true, id: row.id }
+          path: '/warehouseManagement/picking/add',
+          query: { type: '修改', id: row.id }
         });
       },
       // 新建
       add() {
         this.$router.push({
-          path: '/warehouseManagement/picking/add'
+          path: '/warehouseManagement/picking/add',
+          query: { type: '新增' }
         });
       },
       /* 表格数据源 */
       datasource({ page, limit, where }) {
-        return storageApi.getAllotApplyPage({
+        return storageApi.getPickgoodsList({
           pageNum: page,
           size: limit,
           ...where
@@ -229,8 +226,8 @@
       // 详情
       goDetail(row) {
         this.$router.push({
-          path: '/warehouseManagement/inventoryAllocation/details',
-          query: { id: row.id }
+          path: '/warehouseManagement/picking/add',
+          query: { type: '详情', id: row.id }
         });
       }
     }

+ 21 - 3
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -22,7 +22,7 @@
       <!-- 表头工具栏 -->
       <template v-slot:toolbar="{ row }">
         <el-button
-          v-if="selectedDime == 3 || selectedDime == 4"
+          v-if="selectedDime == 3"
           size="small"
           :disabled="checkRadioData.length == 0"
           icon="el-icon-set-up"
@@ -31,7 +31,7 @@
         >
           打印条码
         </el-button>
-        <el-button
+        <!-- <el-button
           v-if="selectedDime == 2 || selectedDime == 3"
           size="small"
           :disabled="checkRadioData.length == 0"
@@ -40,7 +40,7 @@
           @click="showAllot()"
         >
           调拨
-        </el-button>
+        </el-button> -->
       </template>
       <!-- 批次号 -->
       <template v-slot:batchNo="{ row }">
@@ -197,6 +197,14 @@
       columns() {
         // selectedDime 1物品维度 2批次维度 3包装维度 4物料维度
         let arr = [
+          this.selectedDime == 3
+            ? {
+                width: 45,
+                type: 'selection',
+                columnKey: 'selection',
+                align: 'center'
+              }
+            : '',
           {
             columnKey: 'index',
             type: 'index',
@@ -218,6 +226,15 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          this.selectedDime == 3
+            ? {
+                prop: 'inventoryCycle',
+                label: '存货周期(天)',
+                align: 'center',
+                width: 120,
+                showOverflowTooltip: true
+              }
+            : '',
           {
             prop: 'brandNum',
             label: '牌号',
@@ -320,6 +337,7 @@
                 showOverflowTooltip: true
               }
             : '',
+
           this.selectedDime == 3
             ? {
                 prop: 'warehouseName',

+ 5 - 8
src/views/warehouseManagement/stockLedger/components/print.vue

@@ -38,18 +38,18 @@
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block; width: 100px">编码:</span>
             <span style="color: #000">{{
-              dimension == 3 ? item.packagingCode : item.no
+              dimension == 3 ? item.packageNo : item.no
             }}</span>
           </div>
 
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block; width: 100px">名称:</span>
-            <span style="color: #000">{{ item.name }}</span>
+            <span style="color: #000">{{ item.categoryName }}</span>
           </div>
 
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block; width: 100px">型号:</span>
-            <span style="color: #000">{{ item.modelType }}</span>
+            <span style="color: #000">{{ item.categoryModel }}</span>
           </div>
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block; width: 100px">规格:</span>
@@ -59,10 +59,6 @@
             <span style="display: inline-block; width: 100px">牌号:</span>
             <span style="color: #000">{{ item.brandNum }}</span>
           </div>
-          <div style="text-align: left; font-size: 20px">
-            <span style="display: inline-block; width: 100px">物料代号:</span>
-            <span style="color: #000">{{ item.materielCode }}</span>
-          </div>
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block; width: 100px">客户代号:</span>
             <span style="color: #000">{{ item.clientCode }}</span>
@@ -119,12 +115,13 @@
         this.codeList.forEach((item) => {
           let code = '';
           if (this.dimension == 3) {
-            code = item.packagingCode;
+            code = item.packageNo;
           } else {
             code = item.no;
           }
           QRCode.toDataURL(code)
             .then((url) => {
+              console.log(url);
               item.qrcode = url;
               this.$forceUpdate();
             })

+ 4 - 9
src/views/warehouseManagement/stockLedger/components/printSr.vue

@@ -44,18 +44,18 @@
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block">编码:</span>
             <span style="color: #000">{{
-              dimension == 3 ? item.packagingCode : item.no
+              dimension == 3 ? item.packageNo : item.no
             }}</span>
           </div>
 
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block">名称:</span>
-            <span style="color: #000">{{ item.name }}</span>
+            <span style="color: #000">{{ item.categoryName }}</span>
           </div>
 
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block">型号:</span>
-            <span style="color: #000">{{ item.modelType }}</span>
+            <span style="color: #000">{{ item.categoryModel }}</span>
           </div>
 
           <div style="text-align: left; font-size: 20px">
@@ -68,11 +68,6 @@
             <span style="color: #000">{{ item.brandNum }}</span>
           </div>
 
-          <div style="text-align: left; font-size: 20px">
-            <span style="display: inline-block">物料代号:</span>
-            <span style="color: #000">{{ item.materielCode }}</span>
-          </div>
-
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block">客户代号:</span>
             <span style="color: #000">{{ item.clientCode }}</span>
@@ -124,7 +119,7 @@
         this.codeList.forEach((item) => {
           let code = '';
           if (this.dimension == 3) {
-            code = item.packagingCode;
+            code = item.packageNo;
           } else {
             code = item.no;
           }

+ 4 - 9
src/views/warehouseManagement/stockLedger/components/printTg.vue

@@ -38,18 +38,18 @@
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block">编码:</span>
             <span style="color: #000">{{
-              dimension == 3 ? item.packagingCode : item.no
+              dimension == 3 ? item.packageNo : item.no
             }}</span>
           </div>
 
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block">名称:</span>
-            <span style="color: #000">{{ item.name }}</span>
+            <span style="color: #000">{{ item.categoryName }}</span>
           </div>
 
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block">型号:</span>
-            <span style="color: #000">{{ item.modelType }}</span>
+            <span style="color: #000">{{ item.categoryModel }}</span>
           </div>
 
           <div style="text-align: left; font-size: 20px">
@@ -62,11 +62,6 @@
             <span style="color: #000">{{ item.brandNum }}</span>
           </div>
 
-          <div style="text-align: left; font-size: 20px">
-            <span style="display: inline-block">物料代号:</span>
-            <span style="color: #000">{{ item.materielCode }}</span>
-          </div>
-
           <div style="text-align: left; font-size: 20px">
             <span style="display: inline-block">客户代号:</span>
             <span style="color: #000">{{ item.clientCode }}</span>
@@ -118,7 +113,7 @@
         this.codeList.forEach((item) => {
           let code = '';
           if (this.dimension == 3) {
-            code = item.packagingCode;
+            code = item.packageNo;
           } else {
             code = item.no;
           }

+ 140 - 102
src/views/warehouseManagement/stockManagement/add.vue

@@ -1109,45 +1109,48 @@
                   warehouseIds: [productItem.warehouseId], // 仓库Id
                   warehouseNames: [productItem.warehouseName], // 仓库名称
                   outInDetailRecordRequestList:
-                    productItem.outInDetailRecordRequestList.map(
-                      (packingItem, packingIndex) => {
-                        return {
-                          ...packingItem,
-                          index:
-                            this.productList.length +
-                            productIndex +
-                            '-' +
-                            packingIndex, // 包装索引
-                          batchNo: batchNo, // 批次号
-                          parentIndex: this.productList.length + productIndex, // 物品索引
-                          categoryName: productItem.categoryName,
-                          categoryCode: productItem.categoryCode,
-                          materialDetailList:
-                            packingItem.materialDetailList.map(
-                              (materialItem, materialIndex) => {
-                                return {
-                                  ...materialItem,
-                                  index:
-                                    this.productList.length +
-                                    productIndex +
-                                    '-' +
-                                    packingIndex +
-                                    '——' +
-                                    materialIndex, // 包装索引
-                                  parentIndex:
-                                    this.productList.length +
-                                    productIndex +
-                                    '-' +
-                                    packingIndex, // 物品索引
-                                  batchNo: batchNo, // 批次号
-                                  categoryName: productItem.categoryName,
-                                  categoryCode: productItem.categoryCode
-                                };
-                              }
-                            )
-                        };
-                      }
-                    )
+                    productItem.outInDetailRecordRequestList?.length > 0
+                      ? productItem.outInDetailRecordRequestList.map(
+                          (packingItem, packingIndex) => {
+                            return {
+                              ...packingItem,
+                              index:
+                                this.productList.length +
+                                productIndex +
+                                '-' +
+                                packingIndex, // 包装索引
+                              batchNo: batchNo, // 批次号
+                              parentIndex:
+                                this.productList.length + productIndex, // 物品索引
+                              categoryName: productItem.categoryName,
+                              categoryCode: productItem.categoryCode,
+                              materialDetailList:
+                                packingItem.materialDetailList.map(
+                                  (materialItem, materialIndex) => {
+                                    return {
+                                      ...materialItem,
+                                      index:
+                                        this.productList.length +
+                                        productIndex +
+                                        '-' +
+                                        packingIndex +
+                                        '——' +
+                                        materialIndex, // 包装索引
+                                      parentIndex:
+                                        this.productList.length +
+                                        productIndex +
+                                        '-' +
+                                        packingIndex, // 物品索引
+                                      batchNo: batchNo, // 批次号
+                                      categoryName: productItem.categoryName,
+                                      categoryCode: productItem.categoryCode
+                                    };
+                                  }
+                                )
+                            };
+                          }
+                        )
+                      : []
                 };
               }
             );
@@ -1241,57 +1244,90 @@
         }
       },
       async outboundRequisitionSelection(data, dimension, query) {
+        console.log('data-----------', data);
         this.formData.sourceBizNo = query.sourceBizNo;
         this.formData.bizType = query.bizType;
         this.formData.extInfo.assetType = query.assetType.split(',');
         const batchNo = await getCode('lot_number_code');
+        // 获取包装规格
+        let packingSpecification =
+          await storageApi.getCategoryPackageDisposition({
+            categoryIds: data.map((item) => item.categoryId)
+          });
+        this.packingSpecificationOption = data.map((item) => {
+          return packingSpecification
+            .filter((ite) => item.categoryId == ite.categoryId)
+            .sort((a, b) => a.sort - b.sort);
+        });
+        console.log(
+          'this.packingSpecificationOption-----------',
+          this.packingSpecificationOption
+        );
         this.productList = data.map((productItem, productIndex) => {
+          // 显示规格
+          let packingSpecificationLabel = this.packingSpecificationOption[
+            productIndex
+          ]
+            .map((item) => {
+              if (item.sort > 0) {
+                return `${item.packageCell}${item.packageUnit}/${item.conversionUnit}`;
+              }
+            })
+            .filter((item) => !!item);
           return {
             ...productItem,
             index: this.productList.length + productIndex,
-            isSave: true,
+            isSave:
+              productItem.outInDetailRecordRequestList?.length > 0
+                ? true
+                : false,
             batchNo: batchNo, // 批次号
             warehouseIds: [productItem.warehouseId], // 仓库Id
             warehouseNames: [productItem.warehouseName], // 仓库名称
+            packingSpecificationOption:
+              this.packingSpecificationOption[productIndex], // 包装规格选项
+            packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
             outInDetailRecordRequestList:
-              productItem.outInDetailRecordRequestList.map(
-                (packingItem, packingIndex) => {
-                  return {
-                    ...packingItem,
-                    index:
-                      this.productList.length +
-                      productIndex +
-                      '-' +
-                      packingIndex, // 包装索引
-                    batchNo: batchNo, // 批次号
-                    parentIndex: this.productList.length + productIndex, // 物品索引
-                    categoryName: productItem.categoryName,
-                    categoryCode: productItem.categoryCode,
-                    materialDetailList: packingItem.materialDetailList.map(
-                      (materialItem, materialIndex) => {
-                        return {
-                          ...materialItem,
-                          index:
-                            this.productList.length +
-                            productIndex +
-                            '-' +
-                            packingIndex +
-                            '——' +
-                            materialIndex, // 包装索引
-                          parentIndex:
-                            this.productList.length +
-                            productIndex +
-                            '-' +
-                            packingIndex, // 物品索引
-                          batchNo: batchNo, // 批次号
-                          categoryName: productItem.categoryName,
-                          categoryCode: productItem.categoryCode
-                        };
-                      }
-                    )
-                  };
-                }
-              )
+              productItem.outInDetailRecordRequestList?.length > 0
+                ? productItem.outInDetailRecordRequestList.map(
+                    (packingItem, packingIndex) => {
+                      return {
+                        ...packingItem,
+                        index:
+                          this.productList.length +
+                          productIndex +
+                          '-' +
+                          packingIndex, // 包装索引
+                        batchNo: batchNo, // 批次号
+                        parentIndex: this.productList.length + productIndex, // 物品索引
+                        categoryName: productItem.categoryName,
+                        categoryCode: productItem.categoryCode,
+                        materialDetailList: packingItem.materialDetailList.map(
+                          (materialItem, materialIndex) => {
+                            return {
+                              ...materialItem,
+                              index:
+                                this.productList.length +
+                                productIndex +
+                                '-' +
+                                packingIndex +
+                                '——' +
+                                materialIndex, // 包装索引
+                              parentIndex:
+                                this.productList.length +
+                                productIndex +
+                                '-' +
+                                packingIndex, // 物品索引
+                              batchNo: batchNo, // 批次号
+                              categoryName: productItem.categoryName,
+                              categoryCode: productItem.categoryCode
+                            };
+                          }
+                        )
+                      };
+                    }
+                  )
+                : []
           };
         });
         console.log('this.productList-----------', this.productList);
@@ -2211,6 +2247,7 @@
               (item) => item.assetCode
             );
             let { data } = await storageApi.getAssetNum(filterPackingCodePrams);
+            console.log('data-----11111111111111111---', data);
             let packingCodeList = [];
             packingCodePrams.forEach((item, index) => {
               packingCodeList[index] = data.filter(
@@ -2268,28 +2305,28 @@
       listEdit(row) {
         console.log(row);
         this.$set(row, 'isSave', false);
-        // 重新计算重量
-        const totals = Number(
-          this.$math.format(row.minPackingQuantity * row.packingQuantity, 14)
-        );
-        if (row.measureUnit == row.weightUnit) {
-          row.weight = Number(
-            this.$math.format(
-              row.minPackingQuantity *
-                1 *
-                Number(row.packingQuantity).toFixed(2),
-              14
-            )
-          );
-        } else {
-          row.weight = Number(
-            this.$math.format(
-              totals *
-                (row.netWeight > 0 ? Number(row.netWeight).toFixed(2) : 0),
-              14
-            )
-          );
-        }
+        // // 重新计算重量
+        // const totals = Number(
+        //   this.$math.format(row.minPackingQuantity * row.packingQuantity, 14)
+        // );
+        // if (row.measureUnit == row.weightUnit) {
+        //   row.weight = Number(
+        //     this.$math.format(
+        //       row.minPackingQuantity *
+        //         1 *
+        //         Number(row.packingQuantity).toFixed(2),
+        //       14
+        //     )
+        //   );
+        // } else {
+        //   row.weight = Number(
+        //     this.$math.format(
+        //       totals *
+        //         (row.netWeight > 0 ? Number(row.netWeight).toFixed(2) : 0),
+        //       14
+        //     )
+        //   );
+        // }
         console.log(row);
         this.deletePackingAndMaterial(row);
       },
@@ -2706,7 +2743,7 @@
             // 计量单位为不为KG类,重新统计计算
             let inBoolen = !!this.getDict(
               '不拆物料层规格',
-              item.packingSpecificationOption[1].packageUnit
+              item.packingSpecificationOption[0].packageUnit
             ).dictValue;
             let startIndex = item.packingSpecificationOption.findIndex(
               (ite) => {
@@ -2744,7 +2781,8 @@
           this.packingList.splice(productIndex, 0, ...packingList);
         } else {
           let packingIndex = this.packingList.findLastIndex(
-            (item) => item.parentIndex === productIndex - 1
+            (item) =>
+              item.parentIndex == this.productList[productIndex - 1].index
           );
           this.packingList.splice(packingIndex + 1, 0, ...packingList);
         }

+ 9 - 1
src/views/warehouseManagement/stockManagement/add_3.vue

@@ -2038,6 +2038,7 @@
           'this.packingSpecificationOption-------',
           this.packingSpecificationOption
         );
+        console.log('this.productList.length------', this.productList.length);
         let productList = data.map((item, index) => {
           // 显示规格
           let packingSpecificationLabel = this.packingSpecificationOption[index]
@@ -2048,7 +2049,12 @@
             })
             .filter((item) => !!item);
           return {
-            index: this.productList.length + index,
+            index:
+              this.productList.length - 1 > -1
+                ? this.productList[this.productList.length - 1].index +
+                  index +
+                  1
+                : this.productList.length + index,
             categoryId: item.id, // 物品id
             categoryName: item.name, // 物品名称
             categoryCode: item.code, // 物品编码
@@ -2289,6 +2295,8 @@
       },
       // 根据产品信息删除包装和物料
       deletePackingAndMaterial(row) {
+        console.log('row--------', row);
+        console.log('packingList------', this.packingList);
         // 删除包装(去掉不相同的包装)
         this.packingList = this.packingList.filter(
           (item) => item.parentIndex !== row.index

+ 6 - 29
src/views/warehouseManagement/stockManagement/details.vue

@@ -163,27 +163,19 @@
               :show-overflow-tooltip="true"
             >
             </el-table-column>
+
             <el-table-column
-              label="最小包装单元"
+              label="包装数量"
+              prop="packingQuantity"
               align="center"
-              width="120"
-              prop="minPackingQuantity"
             >
-              <template slot-scope="{ row, $index }">
-                {{ row.minPackingQuantity }} {{ row.measureUnit }} /{{
-                  row.packingUnit
-                }}
-              </template>
             </el-table-column>
-
             <el-table-column
-              label="包装数量"
-              prop="packingQuantity"
+              label="包装单位"
               align="center"
+              width="120"
+              prop="packingUnit"
             >
-              <template slot-scope="{ row, $index }">
-                {{ row.packingQuantity }} {{ row.packingUnit }}
-              </template>
             </el-table-column>
             <el-table-column
               label="计量数量"
@@ -191,23 +183,8 @@
               width="100"
               align="center"
             >
-              <template slot-scope="{ row, $index }">
-                <template>
-                  {{
-                    $math.format(
-                      row.minPackingQuantity * row.packingQuantity,
-                      14
-                    )
-                  }}
-                </template>
-              </template>
             </el-table-column>
             <el-table-column label="计量单位" prop="measureUnit" align="center">
-              <template slot-scope="{ row, $index }">
-                <template>
-                  {{ row.measureUnit }}
-                </template>
-              </template>
             </el-table-column>
             <el-table-column
               label="重量"

+ 1155 - 0
src/views/warehouseManagement/stockManagement/details_3 copy.vue

@@ -0,0 +1,1155 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <div class="page-title">
+        <PageHeader title="入库单详情"></PageHeader>
+      </div>
+      <div>
+        <div class="stepsStatus">
+          <el-steps :active="active" align-center>
+            <el-step title="创建"></el-step>
+            <el-step title="待审核"></el-step>
+            <el-step :title="stepsTitle" :status="stepsStatus"></el-step>
+          </el-steps>
+        </div>
+        <div class="content-detail">
+          <header-title title="基本信息" size="16px"></header-title>
+          <div class="mt20">
+            <el-form label-width="120px">
+              <el-col :span="8">
+                <el-form-item label="入库单:">
+                  <span>{{ infoData.bizNo }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="入库物品类型:">
+                  <span>{{ handleAssetType(extInfo.assetType) }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="入库场景:">
+                  <span>{{ getSceneState(infoData.bizType) }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="关联订单:">
+                  <span>{{ extInfo.documentSource }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="权属部门:">
+                  <span>{{ extInfo.deptName }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="入库登记人:">
+                  <span>{{ extInfo.createUserName }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="入库时间:">
+                  <span>{{ infoData.createTime }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="状态:">
+                  <span>{{ stepsTitle }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="审核人:">
+                  <span>{{ infoData.verifyName }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8" v-if="infoData.bizType == 2">
+                <el-form-item label="客户:">
+                  <span>{{ infoData.clientName }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8" v-if="infoData.bizType == 2">
+                <el-form-item label="供应商:">
+                  <span>{{ extInfo.supplierName }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="送货人:">
+                  <span>{{ infoData.fromUser }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="送货人联系方式:">
+                  <span>{{ extInfo.deliveryPhone }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="附件:">
+                  <el-link
+                    type="primary"
+                    v-for="item in infoData.qualityFile"
+                    @click="download(item)"
+                    :key="item.name"
+                    >{{ item.name }}</el-link
+                  >
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="备注:">
+                  <span>{{ infoData.remark }}</span>
+                </el-form-item>
+              </el-col>
+            </el-form>
+          </div>
+        </div>
+        <div class="content-detail mt20">
+          <header-title title="产品信息" size="16px"> </header-title>
+          <el-table
+            ref="productListTable"
+            :data="productList"
+            tooltip-effect="dark"
+            border
+            :max-height="300"
+            :header-cell-style="rowClass"
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="categoryCode"
+              align="center"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              align="center"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              v-if="clientEnvironmentId == 4"
+              label="级别"
+              prop="level"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              label="型号"
+              align="center"
+              prop="categoryModel"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="规格"
+              align="center"
+              prop="specification"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="牌号"
+              align="center"
+              prop="brandNum"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              v-for="(item, index) in newColumns"
+              :label="item.label"
+              :align="item.align"
+              :prop="item.prop"
+              :show-overflow-tooltip="item.showOverflowTooltip"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="packingQuantity"
+              align="center"
+            >
+              <template slot-scope="{ row, $index }">
+                {{ row.packingQuantity }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="包装单位"
+              align="center"
+              width="120"
+              prop="packingUnit"
+            >
+            </el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+              width="100"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column label="计量单位" prop="measureUnit" align="center">
+            </el-table-column>
+            <el-table-column
+              label="重量"
+              prop="weight"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column label="单价" prop="price" align="center">
+              <template slot-scope="{ row }">
+                <template>
+                  {{ row.price ? row.price : '-' + '元' }}/{{ row.measureUnit }}
+                </template>
+              </template>
+            </el-table-column>
+
+            <el-table-column
+              label="金额"
+              align="center"
+              prop="contentImage"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row, $index }">
+                {{ row.totalMoney ? row.totalMoney : 0 }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              v-if="clientEnvironmentId == 4"
+              label="采购原因"
+              align="center"
+              prop="purpose"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="供应商"
+              prop="supplierName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="仓库"
+              prop="warehouseName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              v-if="infoData.verifyStatus == 2"
+              label="操作"
+              width="200"
+              fixed="right"
+              align="center"
+            >
+              <template slot-scope="{ row, $index }">
+                <el-button
+                  v-if="isUpper(row)"
+                  type="text"
+                  @click="shelvesWarehouse($index, '产品')"
+                  >下架</el-button
+                >
+                <el-button
+                  v-else
+                  type="text"
+                  @click="handleWareHouse(row, $index, '产品')"
+                  >上架</el-button
+                >
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div class="mt20">
+          <header-title :title="`包装明细`" size="16px">
+            <el-button
+              v-for="item in mergeOptions"
+              size="mini"
+              type="primary"
+              @click="openMergeDialog(item)"
+              >合并成{{ item.conversionUnit }}</el-button
+            >
+            <el-button
+              v-for="item in splitOptions"
+              size="mini"
+              type="primary"
+              @click="openSplitDialog(item)"
+              >拆分到{{ item.packageUnit }}</el-button
+            >
+          </header-title>
+          <el-table
+            ref="showPackingListTable"
+            :data="packingList"
+            tooltip-effect="dark"
+            :max-height="300"
+            border
+            :row-class-name="tableRowClassName"
+            :header-cell-style="rowClass"
+            @selection-change="productSplit"
+          >
+            <el-table-column
+              v-if="infoData.verifyStatus == 2"
+              key="selection"
+              label="选择"
+              type="selection"
+              width="55"
+              align="center"
+              fixed="left"
+            >
+            </el-table-column>
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="发货条码"
+              prop="barcodes"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装编码"
+              prop="packageNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="packingQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装单位"
+              prop="packingUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measureUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="物料代号"
+              prop="materielDesignation"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="客户代号"
+              prop="clientCode"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="刻码"
+              prop="engrave"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量"
+              prop="weight"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="质检结果"
+              prop="result"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row }">
+                <span>{{ qualityResults[row.result] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="质检状态"
+              prop="status"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row }">
+                <span>{{ qualityStatus[row.status] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="仓库"
+              prop="warehouseName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="货区"
+              prop="areaName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="货架"
+              prop="goodsShelfName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="货位"
+              prop="goodsAllocationName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="生产日期"
+              prop="productionDate"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="采购日期"
+              prop="purchaseDate"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              v-if="infoData.verifyStatus == 2"
+              label="操作"
+              width="200"
+              fixed="right"
+              align="center"
+            >
+              <template slot-scope="{ row, $index }">
+                <el-button
+                  v-if="row.areaId"
+                  type="text"
+                  @click="shelvesWarehouse($index, '包装')"
+                  >下架</el-button
+                >
+                <el-button
+                  v-else
+                  type="text"
+                  @click="handleWareHouse(row, $index, '包装')"
+                  >上架</el-button
+                >
+              </template>
+            </el-table-column>
+          </el-table>
+          <el-pagination
+            background
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            :page-sizes="[10, 10, 20, 30]"
+            :page-size.sync="pages.size"
+            :current-page.sync="pages.pageNum"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
+          >
+          </el-pagination>
+        </div>
+      </div>
+    </el-card>
+    <WareHouseDailog
+      ref="wareHouseDailogRef"
+      @houseData="houseData"
+    ></WareHouseDailog>
+    <mergeDetails
+      ref="mergeDetailsRef"
+      @refresh="getPackingList"
+    ></mergeDetails>
+    <splitDetails ref="splitDetailsRef"></splitDetails>
+  </div>
+</template>
+
+<script>
+  import mergeDetails from './mergeDetails.vue';
+  import splitDetails from './splitDetails.vue';
+  import WareHouseDailog from '../components/warehouseShelvesDialog.vue';
+  import elTableInfiniteScroll from 'el-table-infinite-scroll';
+  import { getFile } from '@/api/system/file/index.js';
+  import PageHeader from '@/components/PageHeader';
+  import storageApi from '@/api/warehouseManagement';
+  import { getCode } from '@/api/codeManagement/index.js';
+  import { allCategoryLevel } from '@/api/classifyManage';
+  import { useDictLabel, sceneState } from '@/utils/dict/index';
+  import { mapGetters, mapActions } from 'vuex';
+  export default {
+    components: { PageHeader, WareHouseDailog, mergeDetails, splitDetails },
+    directives: {
+      'el-table-infinite-scroll': elTableInfiniteScroll
+    },
+    data() {
+      return {
+        total: 0,
+        pages: { pageNum: 1, size: 10 },
+        oldSelectionList: [],
+        selectionList: [],
+        mergeOptions: [],
+        splitOptions: [],
+        currentId: '',
+        newColumns: [], // 动态表头
+        qualityStatus: {
+          0: '未质检',
+          1: '已质检'
+        }, // 质检状态 0未检 1已检
+        qualityResults: {
+          1: '合格',
+          2: '不合格'
+        }, // 质检结果 1合格 2不合格
+        productList: [], // 产品列表
+        showPackingList: [], // 展示的包装列表
+        packingList: [], // 包装列表
+        showMaterialList: [], // 展示物料列表
+        materialList: [], // 物料列表
+        extInfo: {}, // 扩展信息
+        pageSize: 20,
+        pickingPageNum: 1,
+        materielPageNum: 1,
+        codeList: [],
+        infoData: {},
+        stepsTitle: '已完成',
+        stepsStatus: 'success',
+        active: 0,
+        verifyStatus: ''
+      };
+    },
+    watch: {
+      'infoData.verifyStatus': {
+        immediate: true,
+        handler(val) {
+          if (val == 0) {
+            this.active = 1;
+            this.stepsTitle = '未审核';
+            this.stepsStatus = 'wait';
+          } else if (val == 1) {
+            this.active = 2;
+            this.stepsTitle = '审核中';
+            this.stepsStatus = 'process';
+          } else if (val == 2) {
+            this.active = 2;
+            this.stepsTitle = '审核通过';
+            this.stepsStatus = 'success';
+          } else if (val == 3) {
+            this.active = 2;
+            this.stepsTitle = '驳回';
+            this.stepsStatus = 'error';
+          }
+        }
+      },
+      packingList: {
+        handler(newVal) {
+          console.log('包装列表', newVal);
+          console.log('当前包装列表加载页数', this.pickingPageNum);
+          this.showPackingList = newVal.slice(
+            0,
+            this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
+          );
+        },
+        deep: true
+      },
+      materialList: {
+        handler(newVal) {
+          console.log('物料列表', newVal);
+          console.log('当前物料列表加载页数', this.materielPageNum);
+          this.showMaterialList = newVal.slice(
+            0,
+            this.pageSize *
+              (this.materielPageNum > 0 ? this.materielPageNum : 1)
+          );
+        },
+        deep: true
+      }
+    },
+    computed: {
+      ...mapGetters(['getDictValue']),
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    created() {
+      this.getFieldModel();
+      this.requestDict('类型用途');
+      this.requestDict('不拆物料层规格');
+      this.getAllCategoryType();
+      this._getInfo();
+      this.verifyStatus = this.$route.query.verifyStatus;
+    },
+    methods: {
+      openMergeDialog(dimensionRow) {
+        this.$refs.mergeDetailsRef.open(dimensionRow, this.selectionList);
+      },
+      openSplitDialog(dimensionRow) {
+        this.$refs.splitDetailsRef.open(dimensionRow, this.selectionList);
+      },
+      productSplit(selectionList) {
+        console.log(selectionList);
+        let isUnification = selectionList.every(
+          (item) =>
+            item.packingUnit == selectionList[0].packingUnit &&
+            item.categoryId == selectionList[0].categoryId
+        );
+        if (isUnification) {
+          if (selectionList.length > 0) {
+            this.selectionList = selectionList;
+            this.oldSelectionList = selectionList;
+            if (this.mergeOptions.length == 0) {
+              storageApi
+                .getCategoryPackageDisposition({
+                  categoryIds: [this.selectionList[0].categoryId]
+                })
+                .then((data) => {
+                  console.log(data);
+                  console.log(this.selectionList[0]);
+                  // 形成合并按钮
+                  let mergeIndex = data.findIndex(
+                    (item) =>
+                      item.packageUnit == this.selectionList[0].packingUnit &&
+                      item.packageUnit != item.conversionUnit
+                  );
+                  console.log(mergeIndex);
+                  this.mergeOptions = data.filter(
+                    (item) => item.sort == data[mergeIndex].sort
+                  );
+                  // 形成拆分按钮
+                  let splitIndex = data.findIndex(
+                    (item) =>
+                      item.conversionUnit ==
+                        this.selectionList[0].packingUnit &&
+                      item.packageUnit != item.conversionUnit
+                  );
+                  this.splitOptions = data.filter(
+                    (item) => item.sort == data[splitIndex].sort
+                  );
+                });
+            }
+          } else {
+            this.mergeOptions = [];
+            this.splitOptions = [];
+          }
+        } else {
+          this.$message.error('请选择相同物品和包装装单位');
+          this.$refs.showPackingListTable.clearSelection();
+        }
+        console.log(isUnification);
+      },
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: '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];
+        });
+      },
+      isUpper(row) {
+        console.log('this.packingList------', this.packingList);
+        let filterPackingList = this.packingList.filter((packingItem) => {
+          return packingItem.parentIndex === row.index;
+        });
+        console.log(row);
+        console.log(this.packingList);
+        console.log(filterPackingList);
+        let boolen = filterPackingList.every((item) => {
+          return item.areaId && item.goodsShelfId && item.goodsAllocationId;
+        });
+        return boolen;
+      },
+      formDataData() {
+        // 处理包装数据
+        this.packingList = this.packingList.map((packingItem) => {
+          return {
+            ...packingItem,
+            materialDetailList: this.materialList.filter(
+              (item) => item.parentIndex === packingItem.index
+            )
+          };
+        });
+        // 处理产品数据
+        this.productList = this.productList.map((productItem) => {
+          return {
+            ...productItem,
+            outInDetailRecordRequestList: this.packingList.filter(
+              (item) => item.parentIndex === productItem.index
+            )
+          };
+        });
+        this.infoData.outInDetailList = this.productList;
+      },
+      houseData(argum, idx, type) {
+        console.log('-argum-------------------', argum);
+        switch (type) {
+          case '产品':
+            this.packingList.forEach((item) => {
+              if (item.parentIndex === this.productList[idx].index) {
+                this.$set(item, 'areaId', argum[0].areaId);
+                this.$set(item, 'areaName', argum[0].areaName);
+                this.$set(item, 'goodsShelfId', argum[0].shelfId);
+                this.$set(item, 'goodsShelfName', argum[0].shelfCode);
+                this.$set(item, 'goodsAllocationId', argum[0].cargoSpaceId);
+                this.$set(item, 'goodsAllocationName', argum[0].cargoSpaceCode);
+              }
+            });
+            break;
+          case '包装':
+            this.$set(this.packingList[idx], 'areaId', argum[0].areaId);
+            this.$set(this.packingList[idx], 'areaName', argum[0].areaName);
+            this.$set(this.packingList[idx], 'goodsShelfId', argum[0].shelfId);
+            this.$set(
+              this.packingList[idx],
+              'goodsShelfName',
+              argum[0].shelfCode
+            );
+            this.$set(
+              this.packingList[idx],
+              'goodsAllocationId',
+              argum[0].cargoSpaceId
+            );
+            this.$set(
+              this.packingList[idx],
+              'goodsAllocationName',
+              argum[0].cargoSpaceCode
+            );
+            break;
+        }
+        this.formDataData();
+        storageApi
+          .upperLowerShelves(this.infoData)
+          .then((data) => {
+            console.log(data);
+            this._getInfo();
+            this.$message.success('上架成功');
+          })
+          .catch(() => {
+            this.$message.error('上架失败');
+          });
+      },
+      handleWareHouse(row, idx, type) {
+        this.$refs.wareHouseDailogRef.open(row, idx, type);
+      },
+      shelvesWarehouse(idx, type) {
+        switch (type) {
+          case '产品':
+            this.packingList.forEach((item) => {
+              if (item.parentIndex === this.productList[idx].index) {
+                this.$set(item, 'areaId', '');
+                this.$set(item, 'areaName', '');
+                this.$set(item, 'goodsShelfId', '');
+                this.$set(item, 'goodsShelfName', '');
+                this.$set(item, 'goodsAllocationId', '');
+                this.$set(item, 'goodsAllocationName', '');
+              }
+            });
+            break;
+          case '包装':
+            this.$set(this.packingList[idx], 'areaId', '');
+            this.$set(this.packingList[idx], 'areaName', '');
+            this.$set(this.packingList[idx], 'goodsShelfId', '');
+            this.$set(this.packingList[idx], 'goodsShelfName', '');
+            this.$set(this.packingList[idx], 'goodsAllocationId', '');
+            this.$set(this.packingList[idx], 'goodsAllocationName', '');
+            break;
+        }
+        this.formDataData();
+        storageApi
+          .upperLowerShelves(this.infoData)
+          .then((data) => {
+            console.log(data);
+            this._getInfo();
+            this.$message.success('下架成功');
+          })
+          .catch(() => {
+            this.$message.error('下架失败');
+          });
+      },
+      pickingHandleScroll() {
+        console.log('---------pickingHandleScroll------------');
+        if (this.showPackingList.length < this.packingList.length) {
+          if (this.packingList.length > this.pageSize) {
+            this.pickingPageNum += 1;
+          }
+          this.pickingFetchData();
+        }
+      },
+      pickingFetchData() {
+        const start = (this.pickingPageNum - 1) * this.pageSize;
+        const end = start + this.pageSize;
+        this.showPackingList = this.showPackingList.concat(
+          this.packingList.slice(start, end)
+        );
+      },
+      materielHandleScroll() {
+        console.log('---------materielHandleScroll------------');
+        if (this.showMaterialList.length < this.materialList.length) {
+          if (this.materialList.length > this.pageSize) {
+            this.materielPageNum += 1;
+          }
+          this.materielFetchData();
+        }
+      },
+      materielFetchData() {
+        const start = (this.materielPageNum - 1) * this.pageSize;
+        const end = start + this.pageSize;
+        this.showMaterialList = this.showMaterialList.concat(
+          this.materialList.slice(start, end)
+        );
+        console.log(this.showMaterialList);
+      },
+      ...mapActions('dict', ['requestDict']),
+      getSceneState: useDictLabel(sceneState),
+      handleAssetType(r) {
+        const code = this.codeList.find((item) => item.dictCode == r);
+        return code?.dictValue;
+      },
+      tableRowClassName({ row, rowIndex }) {
+        if (row.result == 2) {
+          return 'warning-row';
+        } else {
+          return '';
+        }
+      },
+      goBack() {
+        this.$router.go(-1);
+      },
+      rowClass({ row, column, rowIndex, columnIndex }) {
+        if (rowIndex === 1) {
+          return {
+            display: 'none',
+            background: '#EEEEEE'
+          };
+        }
+        return { background: '#0000' };
+      },
+      async getAllCategoryType() {
+        const { data } = await allCategoryLevel();
+        this.codeList = data.map((item) => {
+          return { dictCode: item.id, dictValue: item.name };
+        });
+      },
+      async _getInfo() {
+        const res = await storageApi.getInboundDetailsById(
+          this.$route.query.id
+        );
+        console.log('===', res);
+        this.infoData = res;
+        this.extInfo = res.extInfo;
+        this.productList = res.outInDetailList.map(
+          (productItem, productIndex) => {
+            return {
+              ...productItem,
+              index: this.productList.length + productIndex,
+              outInDetailRecordRequestList:
+                productItem.outInDetailRecordRequestList.map(
+                  (packingItem, packingIndex) => {
+                    return {
+                      ...packingItem,
+                      index:
+                        this.productList.length +
+                        productIndex +
+                        '-' +
+                        packingIndex, // 包装索引
+                      parentIndex: this.productList.length + productIndex, // 物品索引
+                      categoryName: productItem.categoryName,
+                      categoryCode: productItem.categoryCode,
+                      materialDetailList: packingItem.materialDetailList.map(
+                        (materialItem, materialIndex) => {
+                          return {
+                            ...materialItem,
+                            index:
+                              this.productList.length +
+                              productIndex +
+                              '-' +
+                              packingIndex +
+                              '——' +
+                              materialIndex, // 包装索引
+                            parentIndex:
+                              this.productList.length +
+                              productIndex +
+                              '-' +
+                              packingIndex, // 物品索引
+                            categoryName: productItem.categoryName,
+                            categoryCode: productItem.categoryCode
+                          };
+                        }
+                      )
+                    };
+                  }
+                )
+            };
+          }
+        );
+        this.getPackingList();
+        // // 获取包装维度数据
+        // const arr = [];
+        // for (const key in this.productList) {
+        //   for (const k in this.productList[key].outInDetailRecordRequestList) {
+        //     arr.push({
+        //       ...this.productList[key].outInDetailRecordRequestList[k]
+        //     });
+        //   }
+        // }
+        // this.packingList = arr;
+        // // 获取物料维度数据
+        // let iArr = [];
+        // arr.forEach((item) => {
+        //   item.materialDetailList.forEach((ele) => {
+        //     iArr.push({ ...ele });
+        //   });
+        // });
+        // this.materialList = iArr;
+        // console.log(this.packingList);
+        // console.log(this.materialList);
+        // this.pickingFetchData();
+        // this.materielFetchData();
+      },
+      download(row) {
+        if (row.storePath) {
+          getFile({ objectName: row.storePath }, row.name);
+        }
+      },
+      handleCurrentChange(e) {
+        this.getPackingList();
+      },
+      handleSizeChange(e) {
+        this.pages.pageNum = 1;
+        this.getPackingList();
+      },
+      getPackingList() {
+        storageApi
+          .getOutInRecordsPage({
+            ...this.pages,
+            outInId: this.$route.query.id
+          })
+          .then((data) => {
+            this.total = data.count;
+            this.packingList = data.list;
+          });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep .warning-row {
+    color: red;
+  }
+  ::v-deep .page-title {
+    border-bottom: none;
+  }
+  ::v-deep .page-title-div {
+    width: 100%;
+  }
+  .stepsStatus {
+    width: 40%;
+    margin: 0 auto;
+  }
+  .el-form-item {
+    margin-bottom: 10px;
+  }
+  .p20 {
+    padding: 20px;
+  }
+  .flex {
+    display: flex;
+  }
+  .title {
+    justify-content: space-between;
+    border-bottom: 1px solid #ccc;
+    padding-bottom: 5px;
+    span {
+      font-size: 16px;
+    }
+    .col {
+      padding-left: 40px;
+      font-size: 14px;
+      color: #aaaaaa;
+    }
+  }
+  .degree {
+    margin-right: 10px;
+    padding: 0px 15px;
+    color: #fff;
+    font-size: 13px;
+    line-height: 23px;
+    border-radius: 23px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    span {
+      width: 5px;
+      height: 5px;
+      border-radius: 100%;
+      margin-right: 6px;
+      background-color: #fff;
+    }
+  }
+  .red {
+    background-color: rgb(163, 0, 20);
+  }
+  .blue {
+    background-color: #1989fa;
+  }
+  .createdInfo {
+    justify-content: space-around;
+    margin-top: 10px;
+    font-size: 14px;
+    .col {
+      color: #6e6e6e;
+      padding-right: 10px;
+    }
+  }
+  .mt40 {
+    margin-top: 40px;
+  }
+
+  .custSteps {
+    margin-top: 20px;
+    margin-left: 70px;
+    .box {
+      width: 158px;
+      border: 1px solid #ccc;
+      padding: 10px;
+      flex-direction: row;
+      flex-wrap: wrap;
+      // justify-content: space-between;
+      font-size: 12px;
+      color: #9e9e9e;
+      .x {
+        width: 20px;
+        height: 15px;
+        margin-right: 5px;
+      }
+      .q {
+        background-color: #d0e4d5;
+      }
+      .b {
+        background-color: #1989fa;
+      }
+      .g {
+        background-color: #157a2c;
+      }
+      .r {
+        background-color: #a30014;
+      }
+      .a {
+        align-items: center;
+        margin-bottom: 10px;
+      }
+      .mr10 {
+        margin-right: 10px;
+      }
+      .mb0 {
+        margin-bottom: 0;
+      }
+    }
+    .stepsInfo {
+      // flex: 1;
+      width: 483px;
+    }
+  }
+  .mt20 {
+    margin-top: 20px;
+  }
+  .content-detail {
+    overflow: hidden;
+  }
+  .executor {
+    font-size: 14px;
+    .col {
+      color: #6e6e6e;
+      padding-right: 10px;
+    }
+  }
+  .result {
+    justify-content: space-around;
+  }
+  .mr20 {
+    margin-right: 20px;
+  }
+  .details {
+    font-size: 14px;
+    margin-bottom: 10px;
+  }
+
+  .customSteps {
+    margin-top: 40px;
+    font-size: 14px;
+    margin-left: 80px;
+    .time {
+      font-size: 12px;
+      color: #6e6e6e;
+      margin-right: 20px;
+      position: relative;
+      &::after {
+        content: '';
+        width: 1px;
+        height: 100%;
+        background-color: #157a2c;
+        position: absolute;
+        right: -26px;
+      }
+    }
+    .flex:last-child {
+      .time {
+        &::after {
+          display: none;
+        }
+      }
+    }
+    .round {
+      margin-right: 20px;
+      width: 10px;
+      height: 10px;
+      border-radius: 100%;
+      background-color: #157a2c;
+      position: relative;
+      span {
+        position: absolute;
+        top: 50%;
+        left: 50%;
+        width: 4px;
+        height: 4px;
+        background-color: #fff;
+        border-radius: 100%;
+        transform: translate(-2px, -2px);
+      }
+    }
+    .text {
+      .info {
+        margin-top: 10px;
+        width: 955px;
+        background-color: #f0f3f3;
+        overflow: hidden;
+        padding: 10px;
+        margin-bottom: 10px;
+      }
+    }
+  }
+  .switch_left li {
+    border-right: 1px solid rgba(222, 222, 222, 1);
+    border-left: 1px solid rgba(222, 222, 222, 1);
+  }
+</style>

+ 2 - 2
src/views/warehouseManagement/stocktaking/reportLoss/components/addReportDialog.vue

@@ -95,7 +95,7 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <div v-if="addForm.status == 1" style="height: 300px">
+      <div v-if="addForm.status != 0" style="height: 300px">
         <HeaderTitle title="流程图" size="16px"></HeaderTitle>
         <my-process-viewer
           key="designer"
@@ -461,7 +461,7 @@
                 this.getUserList({ groupId: this.addForm.executeGroupId });
               }
               this.productList = res.info;
-              if (this.addForm.status == 1) {
+              if (this.addForm.status != 0) {
                 this.getDetail(res.flowableId);
               }
             });

部分文件因为文件数量过多而无法显示