Преглед изворни кода

添加入库供货商选择和显示

huang_an пре 1 година
родитељ
комит
0574f060d1

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

@@ -177,5 +177,13 @@ export default {
       return res.data.data;
     }
     return Promise.reject(new Error(res.data.message));
+  },
+  // 通过物品id获取供货商列表
+  contactQueryByCategoryIdsAPI: async (data) => {
+    const res = await request.post('/eom/contact/queryByCategoryIds', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
   }
 };

+ 2 - 2
src/views/bpm/handleTask/components/inoutBound/detailDialog.vue

@@ -192,8 +192,8 @@
     },
     created() {
       // this.requestDict('类型用途');
-      this.getInboundTypeMapping();
-      this._getInfo();
+      // this.getInboundTypeMapping();
+      // this._getInfo();
     },
     methods: {
       wrapHandleScroll() {

+ 6 - 0
src/views/bpm/stockManagement/details.vue

@@ -234,6 +234,12 @@
               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"

+ 6 - 0
src/views/bpm/stockManagement/details1112.vue

@@ -255,6 +255,12 @@
               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"

+ 6 - 0
src/views/bpm/stockManagement/quality.vue

@@ -238,6 +238,12 @@
               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"

+ 51 - 0
src/views/bpm/stockManagement/storage.vue

@@ -396,6 +396,29 @@
                   }}
                 </template>
               </el-table-column>
+              <el-table-column
+                label="供应商"
+                align="center"
+                prop="supplierId"
+                width="200"
+                :show-overflow-tooltip="true"
+              >
+                <template slot-scope="{ row, $index }">
+                  <el-select
+                    @change="selectSupplier($event, row)"
+                    v-model="row.supplierId"
+                    placeholder="请选择"
+                  >
+                    <el-option
+                      v-for="item in row.supplierListOptions"
+                      :label="item.name"
+                      :value="item.id"
+                      :key="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                </template>
+              </el-table-column>
               <el-table-column
                 label="仓库"
                 align="center"
@@ -1004,6 +1027,12 @@
       this.getNowFormatDate();
     },
     methods: {
+      selectSupplier(val, row) {
+        row.supplierId = val;
+        row.supplierName = row.supplierListOptions.filter(
+          (item) => item.id == val
+        )[0].name;
+      },
       // 获取动态表头
       getFieldModel() {
         storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
@@ -1036,6 +1065,9 @@
           });
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
             const batchNo = await getCode('lot_number_code');
+            const supplierList = await storageApi.contactQueryByCategoryIdsAPI({
+              categoryIds: res.map((item) => item.id)
+            });
             this.productList = res.map((item, index) => {
               let filtersItem = this.saleProductList.filter(
                 (detailItem) => detailItem.productCode == item.code
@@ -1056,6 +1088,11 @@
                 specification: item.specification, // 规格
                 brandNum: item.brandNum, // 牌号
                 batchNo: batchNo, // 批次号
+                supplierListOptions: supplierList[item.id], // 供应商列表
+                supplierId: '', // 供应商id
+                supplierName: '', // 供应商名称
+                approvalNumber: item.approvalNumber, // 批准文号
+                packingSpecification: item.packingSpecification, // 包装规格
                 minPackingQuantity: minPackingQuantity, // 最小包装单元数量
                 packingQuantity: packingQuantity, // 包装数量
                 packingUnit: item.packingUnit, // 包装单位
@@ -1093,6 +1130,9 @@
               warehouseIds.push(this.form.warehouseId);
               warehouseNames.push(this.form.warehouseName);
             }
+            const supplierList = await storageApi.contactQueryByCategoryIdsAPI({
+              categoryIds: res.map((item) => item.id)
+            });
             this.productList = res.map((item, index) => {
               return {
                 index: this.productList.length + index,
@@ -1103,6 +1143,11 @@
                 specification: item.specification, // 规格
                 brandNum: item.brandNum, // 牌号
                 batchNo: batchNo, // 批次号
+                supplierListOptions: supplierList[item.id], // 供应商列表
+                supplierId: '', // 供应商id
+                supplierName: '', // 供应商名称
+                approvalNumber: item.approvalNumber, // 批准文号
+                packingSpecification: item.packingSpecification, // 包装规格
                 minPackingQuantity: 1, // 最小包装单元数量
                 packingQuantity: this.form.totalCount, // 包装数量
                 packingUnit: item.packingUnit, // 包装单位
@@ -1670,6 +1715,9 @@
       // 添加物品明细
       async addGoods(data) {
         const batchNo = await getCode('lot_number_code');
+        const supplierList = await storageApi.contactQueryByCategoryIdsAPI({
+          categoryIds: data.map((item) => item.id)
+        });
         let productList = data.map((item, index) => {
           return {
             index: this.productList.length + index,
@@ -1680,6 +1728,9 @@
             specification: item.specification, // 规格
             brandNum: item.brandNum, // 牌号
             batchNo: batchNo, // 批次号
+            supplierListOptions: supplierList[item.id], // 供应商列表
+            supplierId: '', // 供应商id
+            supplierName: '', // 供应商名称
             approvalNumber: item.approvalNumber, // 批准文号
             packingSpecification: item.packingSpecification, // 包装规格
             minPackingQuantity: '', // 最小包装单元数量