Przeglądaj źródła

出库单添加供应商名称代号;添加可重复添加处理;

yijing 1 rok temu
rodzic
commit
b404bd70f6

+ 272 - 437
src/views/bpm/outgoingManagement/components/AssetsDialog.vue

@@ -1,21 +1,11 @@
 <template>
-  <el-dialog
-    :visible.sync="visible"
-    title="物品信息"
-    width="80vw"
-    :append-to-body="true"
-  >
+  <el-dialog :visible.sync="visible" title="物品信息" width="80vw" :append-to-body="true">
     <el-form :model="searchForm" label-width="100px">
       <el-row>
         <el-col :span="6">
           <el-form-item label="列表维度:" prop="dimension">
             <template>
-              <el-select
-                style="width: 100%"
-                @change="changeDimensionHandler"
-                v-model="dimension"
-                placeholder="请选择"
-              >
+              <el-select style="width: 100%" @change="changeDimensionHandler" v-model="dimension" placeholder="请选择">
                 <el-option label="物料维度" value="4"> </el-option>
                 <el-option label="包装维度" value="3"> </el-option>
                 <el-option label="批次维度" value="2"> </el-option>
@@ -26,74 +16,42 @@
         </el-col>
         <el-col :span="6">
           <el-form-item label="关键字:">
-            <el-input
-              type="text"
-              placeholder="请输入关键字"
-              v-model="searchForm.keyWord"
-            ></el-input>
+            <el-input type="text" placeholder="请输入关键字" v-model="searchForm.keyWord"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="物品编码:">
-            <el-input
-              type="text"
-              placeholder="搜索物品编码"
-              v-model="searchForm.categoryCode"
-            ></el-input>
+            <el-input type="text" placeholder="搜索物品编码" v-model="searchForm.categoryCode"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="物品名称:">
-            <el-input
-              type="text"
-              placeholder="搜索物品名称"
-              v-model="searchForm.categoryName"
-            ></el-input>
+            <el-input type="text" placeholder="搜索物品名称" v-model="searchForm.categoryName"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="批次号:">
-            <el-input
-              type="text"
-              placeholder="搜索批次号"
-              v-model="searchForm.batchNo"
-            ></el-input>
+            <el-input type="text" placeholder="搜索批次号" v-model="searchForm.batchNo"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="刻码">
-            <el-input
-              type="text"
-              placeholder="搜索物品刻码"
-              v-model="searchForm.engrave"
-            ></el-input>
+            <el-input type="text" placeholder="搜索物品刻码" v-model="searchForm.engrave"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="发货码">
-            <el-input
-              type="text"
-              placeholder="搜索发货码"
-              v-model="searchForm.barcodes"
-            ></el-input>
+            <el-input type="text" placeholder="搜索发货码" v-model="searchForm.barcodes"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="批次号">
-            <el-input
-              type="text"
-              placeholder="搜索批号"
-              v-model="searchForm.batchNo"
-            ></el-input>
+            <el-input type="text" placeholder="搜索批号" v-model="searchForm.batchNo"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="牌号">
-            <el-input
-              type="text"
-              placeholder="搜索牌号"
-              v-model="searchForm.brandNum"
-            ></el-input>
+            <el-input type="text" placeholder="搜索牌号" v-model="searchForm.brandNum"></el-input>
           </el-form-item>
         </el-col>
         <el-col style="text-align: right">
@@ -104,188 +62,62 @@
     </el-form>
     <el-container class="assets-dialog">
       <el-aside width="200px" class="wrapper-assets">
-        <AssetTree
-          ref="treeList"
-          :treeIds="treeIds"
-          @handleNodeClick="handleNodeClick"
-        />
+        <AssetTree ref="treeList" :treeIds="treeIds" @handleNodeClick="handleNodeClick" />
       </el-aside>
       <el-main>
-        <el-table
-          ref="multipleTable"
-          :data="tableData"
-          tooltip-effect="dark"
-          height="50vh"
-          border
-          row-key="id"
-          style="width: 100%"
-          :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
-          @selection-change="handleSelectionChange"
-        >
-          <el-table-column
-            type="selection"
-            :reserve-selection="true"
-            width="55"
-            align="center"
-            fixed="left"
-          >
+        <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" height="50vh" border row-key="id"
+          style="width: 100%" :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+          @selection-change="handleSelectionChange">
+          <el-table-column type="selection" :reserve-selection="true" width="55" align="center" fixed="left">
           </el-table-column>
           <el-table-column label="序号" type="index" width="50" fixed="left">
           </el-table-column>
-          <el-table-column
-            prop="categoryCode"
-            label="物品编码"
-            min-width="120"
-            fixed="left"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            prop="categoryName"
-            width="200"
-            label="物品名称"
-            fixed="left"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            prop="brandNum"
-            label="牌号"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            prop="categoryModel"
-            label="型号"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            prop="specification"
-            label="规格"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <template v-if="dimension == 1">
-            <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>
-          </template>
-          <el-table-column
-            v-if="dimension == 1"
-            label="出库数量"
-            type="index"
-            width="100"
-          >
+          <el-table-column prop="categoryCode" label="物品编码" min-width="120" fixed="left"
+            :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column prop="categoryName" width="200" label="物品名称" fixed="left"
+            :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column v-if="dimension != 4" label="出库数量" type="index" width="100">
             <template slot-scope="{ row }">
-              <el-input
-                type="text"
-                placeholder="请输入"
-                v-model="row.outboundNum"
-                @input="handleInput(row, $event)"
-                :class="{ password: errorVerify(row) }"
-              ></el-input>
+              <el-input type="text" placeholder="请输入" v-model="row.outboundNum" @input="handleInput(row, $event)"
+                :class="{ password: errorVerify(row) }" :disabled="dimension == '3'"></el-input>
             </template>
           </el-table-column>
-          <el-table-column
-            v-else
-            prop="batchNo"
-            key="batchNo"
-            label="批次号"
-            min-width="80"
-          ></el-table-column>
+          <el-table-column prop="brandNum" label="牌号" :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column prop="categoryModel" label="型号" :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column prop="specification" label="规格" :show-overflow-tooltip="true"></el-table-column>
+          <template v-if="dimension == 1">
+            <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>
+          </template>
+          <el-table-column v-else prop="batchNo" key="batchNo" label="批次号" min-width="80"></el-table-column>
           <el-table-column prop="level" label="级别"></el-table-column>
-          <el-table-column
-            prop="measureQuantity"
-            label="计量数量"
-            width="120"
-          ></el-table-column>
-          <el-table-column
-            prop="measureUnit"
-            label="计量单位"
-            width="90"
-          ></el-table-column>
-          <el-table-column
-            prop="weight"
-            label="重量"
-            min-width="120"
-          ></el-table-column>
-          <el-table-column
-            prop="weightUnit"
-            label="重量单位"
-            min-width="120"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 3"
-            prop="packageNo"
-            label="包装编码"
-            min-width="120"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 3"
-            prop="packingQuantity"
-            label="包装数量"
-            min-width="120"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 3"
-            prop="packingUnit"
-            label="单位"
-            min-width="120"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 3 || dimension == 4"
-            label="发货条码"
-            prop="barcodes"
-            width="80"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 4"
-            prop="no"
-            label="物料编码"
-            min-width="120"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 3 || dimension == 4"
-            prop="materielDesignation"
-            label="物料代号"
-            min-width="100"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 3 || dimension == 4"
-            prop="clientCode"
-            label="客户代号"
-            min-width="100"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 3 || dimension == 4"
-            prop="engrave"
-            label="刻码"
-            min-width="120"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 3 || dimension == 4"
-            prop="warehouseName"
-            label="仓库"
-            min-width="200"
-            :show-overflow-tooltip="true"
-          ></el-table-column>
+          <el-table-column prop="measureQuantity" label="计量数量" width="120"></el-table-column>
+          <el-table-column prop="measureUnit" label="计量单位" width="90"></el-table-column>
+          <el-table-column prop="weight" label="重量" min-width="120"></el-table-column>
+          <el-table-column prop="weightUnit" label="重量单位" min-width="120"></el-table-column>
+          <el-table-column v-if="dimension == 3" prop="packageNo" label="包装编码" min-width="120"
+            :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column v-if="dimension == 3" prop="packingQuantity" label="包装数量" min-width="120"
+            :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column v-if="dimension == 3" prop="packingUnit" label="单位" min-width="120"
+            :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column v-if="dimension == 3 || dimension == 4" label="发货条码" prop="barcodes" width="80"
+            :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column v-if="dimension == 4" prop="no" label="物料编码" min-width="120"
+            :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column v-if="dimension == 3 || dimension == 4" prop="materielDesignation" label="物料代号"
+            min-width="100"></el-table-column>
+          <el-table-column v-if="dimension == 3 || dimension == 4" prop="clientCode" label="客户代号"
+            min-width="100"></el-table-column>
+          <el-table-column v-if="dimension == 3 || dimension == 4" prop="engrave" label="刻码"
+            min-width="120"></el-table-column>
+          <el-table-column v-if="dimension == 3 || dimension == 4" prop="warehouseName" label="仓库" min-width="200"
+            :show-overflow-tooltip="true"></el-table-column>
         </el-table>
         <div style="text-align: right; padding: 10px">
-          <el-pagination
-            background
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="total"
-            :page-sizes="[5, 10, 20, 50]"
-            :page-size.sync="searchForm.size"
-            :current-page.sync="searchForm.pageNum"
-            @current-change="handleCurrentChange"
-            @size-change="handleSizeChange"
-          >
+          <el-pagination background layout="total, sizes, prev, pager, next, jumper" :total="total"
+            :page-sizes="[5, 10, 20, 50]" :page-size.sync="searchForm.size" :current-page.sync="searchForm.pageNum"
+            @current-change="handleCurrentChange" @size-change="handleSizeChange">
           </el-pagination>
         </div>
       </el-main>
@@ -299,235 +131,238 @@
 </template>
 
 <script>
-  import storageApi from '@/api/warehouseManagement';
-  import AssetTree from '../../stockManagement/components/assetTree.vue';
-  import { getDetailById, quantityDelivery } from '@/api/classifyManage';
-  export default {
-    components: { AssetTree },
-    props: {
-      treeIds: { type: Array, default: () => [] }
-    },
-    data() {
-      return {
-        newColumns: [], // 动态表头
-        isShowTable: true,
-        qualityResultOption: [
-          {
-            value: 0,
-            label: '合格'
-          },
-          {
-            value: 1,
-            label: '不合格'
-          }
-        ],
-        qualityStatusOption: [
-          {
-            value: 1,
-            label: '已质检'
-          },
-          {
-            value: 0,
-            label: '未质检'
-          }
-        ],
-        visible: false,
-        tableData: [],
-        total: 0,
-        categoryLevelId: '',
-        searchForm: {
-          keyWord: '',
-          categoryCode: '',
-          categoryName: '',
-          batchNo: '',
-          brandNum: '',
-          engrave: '',
-          barcodes: '',
-          batchNo: '',
-          categoryLevelId: '',
-          pageNum: 1,
-          size: 20
+import storageApi from '@/api/warehouseManagement';
+import AssetTree from '../../stockManagement/components/assetTree.vue';
+import { getDetailById, quantityDelivery } from '@/api/classifyManage';
+export default {
+  components: { AssetTree },
+  props: {
+    treeIds: { type: Array, default: () => [] }
+  },
+  data() {
+    return {
+      newColumns: [], // 动态表头
+      isShowTable: true,
+      qualityResultOption: [
+        {
+          value: 0,
+          label: '合格'
         },
-        selectionList: [],
-        materialType: '',
-        warehouseList: [],
-        dimension: '3'
-      };
+        {
+          value: 1,
+          label: '不合格'
+        }
+      ],
+      qualityStatusOption: [
+        {
+          value: 1,
+          label: '已质检'
+        },
+        {
+          value: 0,
+          label: '未质检'
+        }
+      ],
+      visible: false,
+      tableData: [],
+      total: 0,
+      categoryLevelId: '',
+      searchForm: {
+        keyWord: '',
+        categoryCode: '',
+        categoryName: '',
+        batchNo: '',
+        brandNum: '',
+        engrave: '',
+        barcodes: '',
+        batchNo: '',
+        categoryLevelId: '',
+        pageNum: 1,
+        size: 20
+      },
+      selectionList: [],
+      materialType: '',
+      warehouseList: [],
+      dimension: '3'
+    };
+  },
+  created() {
+    this.getFieldModel();
+  },
+  watch: {
+    tableData(val) {
+      this.doLayout();
+    }
+  },
+  methods: {
+    errorVerify(row) {
+      return (
+        !row.outboundNu &&
+        this.selectionList.some((item) => item.id == row.id)
+      );
+    },
+    doLayout() {
+      let that = this;
+      this.$nextTick(() => {
+        that.$refs.multipleTable.doLayout();
+      });
     },
-    created() {
-      this.getFieldModel();
+    // 获取动态表头
+    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];
+      });
     },
-    watch: {
-      tableData(val) {
-        this.doLayout();
+    // 出库数量限制
+    handleInput(row, value) {
+      if (row.outboundNum <= row.measureQuantity) {
+        return (row.outboundNum = value.replace(/^(0+)|[^\d]+/g, ''));
+      } else {
+        row.outboundNum = row.measureQuantity;
       }
     },
-    methods: {
-      errorVerify(row) {
-        return (
-          !row.outboundNu &&
-          this.selectionList.some((item) => item.id == row.id)
-        );
-      },
-      doLayout() {
-        let that = this;
-        this.$nextTick(() => {
-          that.$refs.multipleTable.doLayout();
-        });
-      },
-      // 获取动态表头
-      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];
-        });
-      },
-      // 出库数量限制
-      handleInput(row, value) {
-        if (row.outboundNum <= row.measureQuantity) {
-          return (row.outboundNum = value.replace(/^(0+)|[^\d]+/g, ''));
-        } else {
-          row.outboundNum = row.measureQuantity;
-        }
-      },
-      // 切换维度
-      changeDimensionHandler(e) {
-        this.searchForm.pageNum = 1;
-        this.selectionList = [];
-        this.$refs.multipleTable.clearSelection();
-        this.changeDimension(e);
-      },
-      async changeDimension(e) {
-        this.dimension = e;
-        if (this.dimension == 1) {
-          // 物品维度
-          const data = await storageApi.getProductList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
-        } else if (this.dimension == 2) {
-          // 批次维度
-          const data = await storageApi.getBatchList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
-        } else if (this.dimension == 4) {
-          // 物料维度
-          const data = await storageApi.getMaterialList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
-        } else {
-          // 包装维度
-          const data = await storageApi.getPackingList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
+    // 切换维度
+    changeDimensionHandler(e) {
+      this.searchForm.pageNum = 1;
+      this.selectionList = [];
+      this.$refs.multipleTable.clearSelection();
+      this.changeDimension(e);
+    },
+    async changeDimension(e) {
+      this.dimension = e;
+      if (this.dimension == 1) {
+        // 物品维度
+        const data = await storageApi.getProductList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      } else if (this.dimension == 2) {
+        // 批次维度
+        const data = await storageApi.getBatchList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      } else if (this.dimension == 4) {
+        // 物料维度
+        const data = await storageApi.getMaterialList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      } else {
+        // 包装维度
+        const data = await storageApi.getPackingList(this.searchForm);
+        for (let i = 0; i < data.list.length; i++) {
+          data.list[i].outboundNum = data.list[i].packingQuantity;
         }
-      },
-      open() {
-        this.visible = true;
-        this.$nextTick(() => {
-          this.$refs.treeList.getTreeData().then((data) => {
-            this.handleNodeClick(data);
-          });
+        this.tableData = data.list;
+        this.total = data.count;
+      }
+    },
+    open() {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.treeList.getTreeData().then((data) => {
+          this.handleNodeClick(data);
         });
-      },
-      async confirm() {
-        if (!this.selectionList.length) {
-          this.$message.error('请至少选择一条数据!');
+      });
+    },
+    async confirm() {
+      if (!this.selectionList.length) {
+        this.$message.error('请至少选择一条数据!');
+        return;
+      }
+      if (this.dimension == 1) {
+        let boolen = this.selectionList.every((item) => item.outboundNum > 0);
+        if (!boolen) {
+          this.$message.error('请输入出库数量!');
           return;
         }
-        if (this.dimension == 1) {
-          let boolen = this.selectionList.every((item) => item.outboundNum > 0);
-          if (!boolen) {
-            this.$message.error('请输入出库数量!');
-            return;
-          }
-        }
-        console.log(this.selectionList);
-        let data = null;
-        if (this.dimension != 1) {
-          data = await storageApi.getHierarchyList({
-            ids: this.selectionList.map((item) => item.id).join(','),
-            type: this.dimension
-          });
-        } else {
-          data = await storageApi.getHierarchyFifo({
-            type: this.dimension,
-            builders: this.selectionList.map((item) => {
-              return {
-                categoryId: item.categoryId,
-                num: item.outboundNum
-              };
-            })
-          });
-        }
-        console.log('data-------------------', data);
-        this.$emit('detailData', data, this.dimension);
-        this.cancel();
-      },
-      cancel() {
-        this.selectionList = [];
-        this.$refs.multipleTable.clearSelection();
-        this.visible = false;
-      },
-      handleSelectionChange(val) {
-        this.selectionList = val;
-      },
-      handleNodeClick(data) {
-        console.log(data);
-        this.categoryLevelId = data.id;
-        this.searchForm.categoryLevelId = data.id;
-        this.doSearch();
-      },
-      handleCurrentChange() {
-        this.changeDimension(this.dimension);
-      },
-      reset() {
-        this.searchForm = {
-          categoryCode: '',
-          categoryName: '',
-          batchNo: '',
-          brandNum: '',
-          engrave: '',
-          barcodes: '',
-          batchNo: '',
-          categoryLevelId: this.categoryLevelId,
-          pageNum: 1,
-          size: 20
-        };
-        this.doSearch();
-      },
-      doSearch() {
-        this.searchForm.pageNum = 1;
-        this.changeDimension(this.dimension);
-      },
-      handleSizeChange() {
-        this.searchForm.pageNum = 1;
-        this.changeDimension(this.dimension, 'page');
       }
+      console.log(this.selectionList);
+      let data = null;
+      if (this.dimension != 1) {
+        data = await storageApi.getHierarchyList({
+          ids: this.selectionList.map((item) => item.id).join(','),
+          type: this.dimension
+        });
+      } else {
+        data = await storageApi.getHierarchyFifo({
+          type: this.dimension,
+          builders: this.selectionList.map((item) => {
+            return {
+              categoryId: item.categoryId,
+              num: item.outboundNum
+            };
+          })
+        });
+      }
+      console.log('data-------------------', data);
+      this.$emit('detailData', data, this.dimension);
+      this.cancel();
+    },
+    cancel() {
+      this.selectionList = [];
+      this.$refs.multipleTable.clearSelection();
+      this.visible = false;
+    },
+    handleSelectionChange(val) {
+      this.selectionList = val;
+    },
+    handleNodeClick(data) {
+      console.log(data);
+      this.categoryLevelId = data.id;
+      this.searchForm.categoryLevelId = data.id;
+      this.doSearch();
+    },
+    handleCurrentChange() {
+      this.changeDimension(this.dimension);
+    },
+    reset() {
+      this.searchForm = {
+        categoryCode: '',
+        categoryName: '',
+        batchNo: '',
+        brandNum: '',
+        engrave: '',
+        barcodes: '',
+        batchNo: '',
+        categoryLevelId: this.categoryLevelId,
+        pageNum: 1,
+        size: 20
+      };
+      this.doSearch();
+    },
+    doSearch() {
+      this.searchForm.pageNum = 1;
+      this.changeDimension(this.dimension);
+    },
+    handleSizeChange() {
+      this.searchForm.pageNum = 1;
+      this.changeDimension(this.dimension, 'page');
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .el-dialog__wrapper {
-    ::v-deep .el-aside {
-      background-color: #fff !important;
-      border: 1px solid #ccc;
-    }
+.el-dialog__wrapper {
+  ::v-deep .el-aside {
+    background-color: #fff !important;
+    border: 1px solid #ccc;
   }
+}
 
-  .wrapper-assets {
-    max-height: 53vh;
-    overflow: auto;
-  }
+.wrapper-assets {
+  max-height: 53vh;
+  overflow: auto;
+}
 
-  ::v-deep .password .el-input__inner {
-    border-color: red !important;
-  }
+::v-deep .password .el-input__inner {
+  border-color: red !important;
+}
 </style>

+ 76 - 15
src/views/bpm/outgoingManagement/outbound.vue

@@ -165,7 +165,7 @@
                 </template>
               </el-table-column>
 
-              <el-table-column label="金额" align="center" prop="contentImage" :show-overflow-tooltip="true">
+              <el-table-column label="金额" align="center" prop="totalMoney" :show-overflow-tooltip="true">
                 <template slot-scope="{ row, $index }">
                   {{ row.totalMoney ? row.totalMoney : 0 }}
                 </template>
@@ -174,6 +174,10 @@
                 :show-overflow-tooltip="true"></el-table-column>
               <el-table-column label="仓库" prop="warehouseName" :show-overflow-tooltip="true">
               </el-table-column>
+              <el-table-column prop="supplierName" label="供应商" min-width="200"
+                :show-overflow-tooltip="true"></el-table-column>
+              <el-table-column prop="supplierCode" label="供应商代号" min-width="200"
+                :show-overflow-tooltip="true"></el-table-column>
             </el-table>
           </div>
           <header-title class="mt20" title="包装清单"></header-title>
@@ -216,6 +220,10 @@
               </el-table-column>
               <el-table-column label="采购日期" prop="purchaseDate" :show-overflow-tooltip="true">
               </el-table-column>
+              <el-table-column prop="supplierName" label="供应商" min-width="200"
+                :show-overflow-tooltip="true"></el-table-column>
+              <el-table-column prop="supplierCode" label="供应商代号" min-width="200"
+                :show-overflow-tooltip="true"></el-table-column>
             </el-table>
           </div>
         </div>
@@ -450,6 +458,10 @@ export default {
     },
     detailData(data, dimension) {
       this.dimension = dimension;
+
+      const mergedData = [...(this.formData.outInDetailList || []), ...data];
+      this.formData.outInDetailList = mergedData;
+
       this.productList = data.map((productItem) => {
         return {
           ...productItem,
@@ -457,26 +469,21 @@ export default {
             productItem.outInDetailRecordRequestList.map((packingItem) => {
               return {
                 ...packingItem,
-                workOrderId:
-                  this.type === '自选领用出库'
-                    ? this.form.detailList[0].workOrderId
-                    : '',
-                pickOrderId:
-                  this.type === '自选领用出库'
-                    ? this.form.detailList[0].pickOrderId
-                    : '',
-                taskId:
-                  this.type === '自选领用出库'
-                    ? this.form.detailList[0].taskId
-                    : '',
+                workOrderId: this.type === '自选领用出库' ? this.form.detailList[0].workOrderId : '',
+                pickOrderId: this.type === '自选领用出库' ? this.form.detailList[0].pickOrderId : '',
+                taskId: this.type === '自选领用出库' ? this.form.detailList[0].taskId : '',
                 categoryName: productItem.categoryName,
                 categoryCode: productItem.categoryCode,
+                supplierCode: productItem.supplierCode,
+                supplierName: productItem.supplierName,
                 materialDetailList: packingItem.materialDetailList.map(
                   (materialItem) => {
                     return {
                       ...materialItem,
                       categoryName: productItem.categoryName,
-                      categoryCode: productItem.categoryCode
+                      categoryCode: productItem.categoryCode,
+                      supplierCode: productItem.supplierCode,
+                      supplierName: productItem.supplierName,
                     };
                   }
                 )
@@ -484,6 +491,36 @@ export default {
             })
         };
       });
+
+
+      const newProducts = mergedData.map((productItem) => ({
+        ...productItem,
+        outInDetailRecordRequestList: productItem.outInDetailRecordRequestList.map((packingItem) => ({
+          ...packingItem,
+          categoryName: productItem.categoryName,
+          categoryCode: productItem.categoryCode,
+          supplierCode: productItem.supplierCode,
+          supplierName: productItem.supplierName,
+          workOrderId: this.type === '自选领用出库' ? this.form.detailList[0].workOrderId : '',
+          pickOrderId: this.type === '自选领用出库' ? this.form.detailList[0].pickOrderId : '',
+          taskId: this.type === '自选领用出库' ? this.form.detailList[0].taskId : '',
+          materialDetailList: packingItem.materialDetailList.map((materialItem) => ({
+            ...materialItem,
+            categoryName: productItem.categoryName,
+            categoryCode: productItem.categoryCode,
+            supplierCode: productItem.supplierCode,
+            supplierName: productItem.supplierName,
+          }))
+        }))
+      }));
+
+      // 去重合并产品列表和新产品列表
+      const uniqueProducts = [...new Map([...this.productList, ...newProducts]
+        .map(item => [item.id, item])).values()];
+      this.productList = uniqueProducts;
+      // 排序
+      this.productList.sort((a, b) => a.categoryCode - b.categoryCode);
+
       // 获取包装维度数据
       const arr = [];
       for (const key in this.productList) {
@@ -494,6 +531,18 @@ export default {
         }
       }
       this.packingList = arr;
+
+      const newPacking = [];
+      newProducts.forEach(item => {
+        newPacking.push(...item.outInDetailRecordRequestList);
+      });
+      //去重
+      const newPackingList = [...new Map([...this.packingList, ...newPacking]
+        .map(item => [item.id, item])).values()];
+      this.packingList = newPackingList
+
+      this.packingList.sort((a, b) => a.categoryCode - b.categoryCode);
+
       // 获取物料维度数据
       let iArr = [];
       arr.forEach((item) => {
@@ -502,6 +551,18 @@ export default {
         });
       });
       this.materialList = iArr;
+
+      const newMaterial = [];
+      newPacking.forEach(item => {
+        newMaterial.push(...item.materialDetailList);
+      });
+      this.materialList = [...this.materialList, ...newMaterial];
+      // 触发分页更新
+      this.pickingPageNum = 1;
+      this.materielPageNum = 1;
+      this.pickingFetchData();
+      this.materielFetchData();
+
       this.formData.outInDetailList = this.productList;
     },
     async getReturnStorage() {
@@ -650,7 +711,7 @@ export default {
 
       if (this.detailList?.length > 0) {
         // 获取领料人列表
-        
+
         if (this.form.executorDeptId) {
           this.getStaffList({ id: this.form.executorDeptId }).then(() => {
             // 获取领料人和领料部门