huang_an 1 год назад
Родитель
Сommit
1717eb2505

+ 18 - 0
src/api/classifyManage/index.js

@@ -99,3 +99,21 @@ export async function getProductList(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 查询当前用户备品备件仓库
+export async function getListByUserId() {
+  const res = await request.get(`/wms/warehouse/getListByUserId`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取产品维度列表
+export async function quantityDelivery(data) {
+  const res = await request.post(`wms/outin/quantityDelivery`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 79 - 15
src/views/warehouseManagement/components/AssetsDialog.vue

@@ -56,7 +56,7 @@
                 <el-option label="物料维度" value="4"> </el-option>
                 <el-option label="包装维度" value="3"> </el-option>
                 <el-option label="批次维度" value="2"> </el-option>
-                <!-- <el-option label="物品维度" value="1"> </el-option> -->
+                <el-option label="物品维度" value="1"> </el-option>
               </el-select>
             </template>
           </el-form-item>
@@ -160,6 +160,7 @@
       </el-aside>
       <el-main>
         <el-table
+          v-if="isShowTable"
           ref="multipleTable"
           :data="tableData"
           tooltip-effect="dark"
@@ -207,6 +208,31 @@
               <template v-else>{{ row[item.prop] }}</template>
             </template></el-table-column
           >
+          <el-table-column
+            v-if="dimension == 1"
+            label="出库数量"
+            type="index"
+            width="100"
+          >
+            <template slot-scope="{ row }">
+              <el-input
+                type="text"
+                placeholder="请输入"
+                v-model="row.outboundNum"
+                @input="handleInput(row, $event)"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="availableCountBase"
+            label="计量库存数量"
+            width="120"
+          ></el-table-column>
+          <el-table-column
+            prop="measuringUnit"
+            label="计量单位"
+            width="90"
+          ></el-table-column>
           <el-table-column
             prop="manualBatchNo"
             label="批号"
@@ -269,16 +295,6 @@
             v-if="dimension != 4"
             width="90"
           ></el-table-column>
-          <el-table-column
-            prop="availableCountBase"
-            label="计量库存数量"
-            width="120"
-          ></el-table-column>
-          <el-table-column
-            prop="measuringUnit"
-            label="计量单位"
-            width="90"
-          ></el-table-column>
           <el-table-column
             v-if="dimension == 4"
             prop="weight"
@@ -361,7 +377,12 @@
   import outin from '@/api/warehouseManagement/outin';
   import { login } from '@/api/login';
   import { getWarehouseList } from '@/api/classifyManage/itemInformation';
-  import { getBatchDetails, getDetailById } from '@/api/classifyManage';
+  import {
+    getBatchDetails,
+    getDetailById,
+    getListByUserId,
+    quantityDelivery
+  } from '@/api/classifyManage';
   export default {
     components: { AssetTree },
     props: {
@@ -383,6 +404,7 @@
 
     data() {
       return {
+        isShowTable: true,
         qualityResultOption: [
           {
             value: 0,
@@ -423,16 +445,28 @@
         selectionList: [],
         materialType: '',
         warehouseList: [],
-        dimension: '4'
+        dimension: '1',
+        isSpareParts: false
       };
     },
     created() {},
     methods: {
+      handleInput(row, value) {
+        if (row.outboundNum <= row.availableCountBase) {
+          return (row.outboundNum = value.replace(/^(0+)|[^\d]+/g, ''));
+        } else {
+          row.outboundNum = row.availableCountBase;
+        }
+      },
       changeDimensionHandler(e) {
+        this.isShowTable = false;
         // this.$refs.multipleTable.clearSelection();
         // this.selectionList = [];
         this.pages.pageNum = 1;
         this.changeDimension(e);
+        this.$nextTick(() => {
+          this.isShowTable = true;
+        });
       },
       async changeDimension(e, is) {
         // await this.$refs.multipleTable.clearSelection();
@@ -449,6 +483,12 @@
           ...this.searchForm,
           dimension: e
         };
+        if (this.isSpareParts) {
+          let data = await getListByUserId();
+          if (data.length > 0) {
+            params.warehouseIds = data.map((item) => item.id).join(',');
+          }
+        }
         if (this.materialType) {
           params.categoryLevelId = this.materialType;
         }
@@ -526,7 +566,8 @@
           return false;
         }
       },
-      open() {
+      open(boolen) {
+        this.isSpareParts = !!boolen;
         this.visible = true;
         this.$nextTick(() => {
           this.$refs.treeList.getTreeData();
@@ -590,13 +631,36 @@
           this.$message.error('请至少选择一条数据!');
           return;
         }
-        const data = await this.handleExit(this.selectionList);
+        if (this.dimension == 1) {
+          let boolen = this.selectionList.every((item) => item.outboundNum > 0);
+          if (!boolen) {
+            this.$message.error('请输入出库数量!');
+            return;
+          }
+        }
+        let data = null;
+        if (this.dimension == 1) {
+          let params = this.selectionList.map((item) => {
+            return {
+              code: item.assetCode,
+              demandQuantity: item.outboundNum
+            };
+          });
+          data = {
+            realTimeInventoryVOList: await quantityDelivery({
+              orderDTOList: params
+            })
+          };
+        } else {
+          data = await this.handleExit(this.selectionList);
+        }
         let arr = [];
         if (this.dimension == 4) {
           arr = this.selectionList.map((item) => {
             return { ...item, assetName: item.name };
           });
         }
+        console.log('data-------------------', data);
         this.$emit('detailData', { ...data, wlList: arr }, this.dimension);
 
         // this.$emit('selectTableData', this.selectionList);

+ 18 - 0
src/views/warehouseManagement/outgoingManagement/add.vue

@@ -301,6 +301,7 @@
                     }}
                   </template>
                 </el-table-column>
+
                 <el-table-column label="包装数量" prop="availableCountBase">
                   <template slot-scope="{ row }">
                     {{ row.packingCountBase }}{{ row.minUnit }}
@@ -319,6 +320,16 @@
                   label="重量单位"
                   prop="weightUnit"
                 ></el-table-column>
+                <el-table-column
+                  v-if="clientEnvironmentId == 4"
+                  label="用途"
+                  prop="purpose"
+                  width="200"
+                >
+                  <template slot-scope="{ row }">
+                    <el-input placeholder="请输入" v-model="row.purpose" />
+                  </template>
+                </el-table-column>
                 <el-table-column
                   label="仓库"
                   width="300"
@@ -795,6 +806,13 @@
             // obj.fromId=
             obj.fromType = obj.type;
             this.saveLoading = true;
+            let purposeList = {};
+            this.warehousingMaterialList.map((item) => {
+              purposeList[item.id] = item.purpose;
+            });
+            this.wlParams.realTimeInventoryNewPOList.forEach((item) => {
+              item.purpose = purposeList[item.id];
+            });
             obj = { ...obj, ...this.wlParams };
             if (this.dimension == 4) {
               obj.num = this.materialObj.wlList.length;

+ 24 - 3
src/views/warehouseManagement/outgoingManagement/details.vue

@@ -98,7 +98,7 @@
               </el-col>
               <el-col :span="8">
                 <el-form-item label="领料人">
-                  <span>{{ infoData.fromUser }}</span>
+                  <span>{{ userName ? userName : infoData.fromUser }}</span>
                 </el-form-item>
               </el-col>
               <el-col :span="16">
@@ -192,6 +192,11 @@
                     {{ row.price ? row.price : '-' }}元/{{ row.measuringUnit }}
                   </template>
                 </el-table-column>
+                <el-table-column
+                  v-if="clientEnvironmentId == 4"
+                  label="用途"
+                  prop="purpose"
+                ></el-table-column>
                 <el-table-column
                   label="金额"
                   prop="totalMoney"
@@ -455,7 +460,8 @@
         ],
         stepsTitle: '已完成',
         stepsStatus: 'success',
-        active: 0
+        active: 0,
+        userName: ''
       };
     },
     watch: {
@@ -499,6 +505,19 @@
       this.requestDict('类型用途');
     },
     methods: {
+      async getUserByGroupId() {
+        let res = await warehouseDefinition.getUserPage({
+          groupId: this.infoData.verifyDeptCode,
+          size: 9999,
+          page: 1
+        });
+        let filterUserList = res.list.filter(
+          (item) => item.id == this.infoData.fromUser
+        );
+        if (filterUserList.length > 0) {
+          this.userName = filterUserList[0].name;
+        }
+      },
       async getCodeList() {
         const { data } = await allCategoryLevel();
         this.codeList = data.map((item) => {
@@ -537,8 +556,10 @@
           ...res,
           assetType: res.extInfo.assetType,
           fromUserPhone: res.fromUserPhone,
-          verifyDeptName: res.extInfo.verifyDeptName
+          verifyDeptName: res.extInfo.verifyDeptName,
+          verifyDeptCode: res.extInfo.verifyDeptCode
         };
+        this.getUserByGroupId();
         if (res) {
           // this.warehousingMaterialList = res.warehouseLedgerInfos.map(
           //   (item) => {

+ 58 - 2
src/views/warehouseManagement/sparePartsOutbound/add.vue

@@ -310,6 +310,11 @@
                   label="重量单位"
                   prop="weightUnit"
                 ></el-table-column>
+                <el-table-column label="用途" prop="purpose" width="200">
+                  <template slot-scope="{ row }">
+                    <el-input placeholder="请输入" v-model="row.purpose" />
+                  </template>
+                </el-table-column>
                 <el-table-column
                   label="仓库"
                   width="300"
@@ -727,7 +732,7 @@
               ite.outInMaterialDetailsAddPOList = ite.materialDetailsVOList;
             });
           });
-        } else {
+        } else if (dimension == 2) {
           //   else if (dimension == 2) {
           //   this.batchDetailsVOList = data.wlList;
           //   this.selectionList = data.wlList;
@@ -751,6 +756,50 @@
               // weight: 0
             };
           });
+          //物料维度数据
+          let meteArr = [];
+          for (const item of packArr) {
+            if (item.materialDetailsVOList.length != 0) {
+              for (const iterator of item.materialDetailsVOList) {
+                meteArr.push({
+                  ...iterator
+                });
+              }
+            }
+          }
+          this.materialCodeReqList = meteArr;
+          //再次打开选择上
+          this.selectionList = list;
+          //send数据
+          this.wlParams = { realTimeInventoryNewPOList: list };
+          this.wlParams.realTimeInventoryNewPOList.forEach((item) => {
+            item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
+            item.inventoryDetailsNewPOList.forEach((ite) => {
+              // ite.weight = 0;
+              ite.outInMaterialDetailsAddPOList = ite.materialDetailsVOList;
+            });
+          });
+        } else {
+          const list = data.realTimeInventoryVOList;
+          //获取包装维度
+          let packArr = [];
+          for (const item of list) {
+            if (item.inventoryDetailsVOList.length != 0) {
+              for (const iterator of item.inventoryDetailsVOList) {
+                packArr.push({ ...iterator, batchNo: iterator.batchNum });
+              }
+            }
+          }
+          console.log('packArr-----------------');
+          console.log(packArr);
+          this.batchDetailsVOList = packArr.map((item) => {
+            return {
+              ...item,
+              packingCountBase: dimension == 3 ? 1 : item.packingCountBase
+              // weight: 0
+            };
+          });
+
           //物料维度数据
           let meteArr = [];
           for (const item of packArr) {
@@ -788,6 +837,13 @@
             // obj.fromId=
             obj.fromType = obj.type;
             this.saveLoading = true;
+            let purposeList = {};
+            this.warehousingMaterialList.map((item) => {
+              purposeList[item.id] = item.purpose;
+            });
+            this.wlParams.realTimeInventoryNewPOList.forEach((item) => {
+              item.purpose = purposeList[item.id];
+            });
             obj = { ...obj, ...this.wlParams };
             if (this.dimension == 4) {
               obj.num = this.materialObj.wlList.length;
@@ -1289,7 +1345,7 @@
         if (!this.formData.bizType && this.formData.bizType !== 0)
           return this.$message.error('请选择出库场景');
 
-        this.$refs.assetsDialogRef.open();
+        this.$refs.assetsDialogRef.open(true);
       },
       handleChange(data) {
         this.title = data?.dictValue;

+ 20 - 3
src/views/warehouseManagement/sparePartsOutbound/details.vue

@@ -98,7 +98,7 @@
               </el-col>
               <el-col :span="8">
                 <el-form-item label="领料人">
-                  <span>{{ infoData.fromUser }}</span>
+                  <span>{{ userName ? userName : infoData.fromUser }}</span>
                 </el-form-item>
               </el-col>
               <el-col :span="16">
@@ -192,6 +192,7 @@
                     {{ row.price ? row.price : '-' }}元/{{ row.measuringUnit }}
                   </template>
                 </el-table-column>
+                <el-table-column label="用途" prop="purpose"></el-table-column>
                 <el-table-column
                   label="金额"
                   prop="totalMoney"
@@ -455,7 +456,8 @@
         ],
         stepsTitle: '已完成',
         stepsStatus: 'success',
-        active: 0
+        active: 0,
+        userName: ''
       };
     },
     watch: {
@@ -499,6 +501,19 @@
       this.requestDict('类型用途');
     },
     methods: {
+      async getUserByGroupId() {
+        let res = await warehouseDefinition.getUserPage({
+          groupId: this.infoData.verifyDeptCode,
+          size: 9999,
+          page: 1
+        });
+        let filterUserList = res.list.filter(
+          (item) => item.id == this.infoData.fromUser
+        );
+        if (filterUserList.length > 0) {
+          this.userName = filterUserList[0].name;
+        }
+      },
       async getCodeList() {
         const { data } = await allCategoryLevel();
         this.codeList = data.map((item) => {
@@ -537,8 +552,10 @@
           ...res,
           assetType: res.extInfo.assetType,
           fromUserPhone: res.fromUserPhone,
-          verifyDeptName: res.extInfo.verifyDeptName
+          verifyDeptName: res.extInfo.verifyDeptName,
+          verifyDeptCode: res.extInfo.verifyDeptCode
         };
+        this.getUserByGroupId();
         if (res) {
           // this.warehousingMaterialList = res.warehouseLedgerInfos.map(
           //   (item) => {

+ 16 - 4
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -196,7 +196,7 @@
         switch (this.selectedDime) {
           // 物品维度
           case '1':
-            return [
+            let arr = [
               {
                 columnKey: 'index',
                 type: 'index',
@@ -302,6 +302,18 @@
                 fixed: 'right'
               }
             ];
+            // 1本地 2索尔 3碳谷 4601
+            if (this.clientEnvironmentId == 4) {
+              arr.splice(10, 0, {
+                slot: 'purpose',
+                prop: 'purpose',
+                label: '采购用途',
+                showOverflowTooltip: true
+              });
+              return arr;
+            } else {
+              return arr;
+            }
           // 批次维度
           case '2':
             arr = [
@@ -431,7 +443,7 @@
                 fixed: 'right'
               }
             ];
-            // 1本地 2索尔 3碳谷
+            // 1本地 2索尔 3碳谷 4601
             if (this.clientEnvironmentId != 2) {
               arr.splice(1, 0, {
                 slot: 'batchNo',
@@ -597,7 +609,7 @@
                 fixed: 'right'
               }
             ];
-            // 1本地 2索尔 3碳谷
+            // 1本地 2索尔 3碳谷 4601
             if (this.clientEnvironmentId != 2) {
               arr.splice(1, 0, {
                 slot: 'batchNo',
@@ -748,7 +760,7 @@
                 fixed: 'right'
               }
             ];
-            // 1本地 2索尔 3碳谷
+            // 1本地 2索尔 3碳谷 4601
             if (this.clientEnvironmentId != 2) {
               arr.splice(1, 0, {
                 slot: 'batchNo',

+ 35 - 7
src/views/warehouseManagement/stockManagement/add.vue

@@ -521,7 +521,6 @@
                   </el-form-item>
                 </template>
               </el-table-column>
-
               <el-table-column
                 label="最小包装单元"
                 align="center"
@@ -759,6 +758,25 @@
                   }}
                 </template>
               </el-table-column>
+              <el-table-column
+                v-if="clientEnvironmentId == 4"
+                label="采购原因"
+                align="center"
+                width="200"
+                prop="purpose"
+                :show-overflow-tooltip="true"
+              >
+                <template slot-scope="{ row, $index }">
+                  <el-input
+                    :ref="'purpose' + $index"
+                    @keyup.native="
+                      moveFocus($event, $index, 'purpose', '产品', row)
+                    "
+                    v-model="row.purpose"
+                  >
+                  </el-input>
+                </template>
+              </el-table-column>
               <el-table-column
                 label="货位"
                 prop="warehouseName"
@@ -1476,12 +1494,22 @@
         switch (type) {
           case '产品':
             listLength = this.warehousingMaterialList.length;
-            keyfield = [
-              'manualBatchNo',
-              'minPackingCount',
-              'outInNum',
-              'univalence'
-            ];
+            if (this.clientEnvironmentId == 4) {
+              keyfield = [
+                'manualBatchNo',
+                'minPackingCount',
+                'outInNum',
+                'univalence',
+                'purpose'
+              ];
+            } else {
+              keyfield = [
+                'manualBatchNo',
+                'minPackingCount',
+                'outInNum',
+                'univalence'
+              ];
+            }
             break;
           case '包装':
             listLength = this.materialCodeReqList.length;

+ 21 - 2
src/views/warehouseManagement/stockManagement/add_export.vue

@@ -223,7 +223,6 @@
                 align="center"
               >
               </el-table-column>
-
               <el-table-column
                 label="最小包装单元"
                 align="center"
@@ -403,6 +402,13 @@
                   }}
                 </template>
               </el-table-column>
+              <el-table-column
+                label="采购原因"
+                align="center"
+                width="200"
+                prop="purpose"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
               <el-table-column
                 label="货位"
                 prop="warehouseName"
@@ -972,6 +978,14 @@
         let nameList = xlsxData.map((item) => {
           return item['物品名称'];
         });
+        let codeList = xlsxData.map((item) => {
+          return item['sap物料码'];
+        });
+        let functionType = {};
+        xlsxData.map((item) => {
+          functionType[item['sap物料码']] = item['用处'];
+        });
+        console.log(functionType);
         this.formData.extInfo.assetType = '6'; //备品备件
         this.selectEquiType = '6';
         this.title = '备品备件';
@@ -980,6 +994,7 @@
           .getListByNameOrModeType({
             modelTypeList,
             nameList,
+            codeList,
             categoryLevelId: '6'
           })
           .then(async (data) => {
@@ -1002,7 +1017,7 @@
                 let filterArray = xlsxData.filter(
                   (xlsxItem) =>
                     xlsxItem['物品名称'] == item.assetName &&
-                    xlsxItem['型号'] == item.modelType
+                    xlsxItem['sap物料码'] == item.assetCode
                 );
                 if (filterArray.length > 0) {
                   item.minPackingCount = 1;
@@ -1010,9 +1025,11 @@
                 }
                 // 添加固定货位
                 item.houseList = [{}];
+                item.purpose = functionType[item.assetCode];
                 return { ...item };
               }
             );
+            console.log(this.warehousingMaterialList);
             // 物品批量保存
             await this.listSaveArrs();
             // 分拆包装
@@ -1052,6 +1069,7 @@
             listLength = this.warehousingMaterialList.length;
             keyfield = [
               'manualBatchNo',
+              'purpose',
               'minPackingCount',
               'outInNum',
               'univalence'
@@ -2480,6 +2498,7 @@
 
             let arr = this.warehousingMaterialList.map((item) => {
               return {
+                purpose: item.purpose,
                 netWeight: item.netWeight > 0 ? item.netWeight : 0,
                 num: item.num > 0 ? item.num : 0,
                 manualBatchNo: item.manualBatchNo,

+ 8 - 1
src/views/warehouseManagement/stockManagement/details.vue

@@ -291,7 +291,14 @@
                     {{ row.totalMoney ? row.totalMoney : 0 }}
                   </template>
                 </el-table-column>
-
+                <el-table-column
+                  v-if="clientEnvironmentId == 4"
+                  label="采购原因"
+                  align="center"
+                  width="200"
+                  prop="purpose"
+                  :show-overflow-tooltip="true"
+                ></el-table-column>
                 <el-table-column
                   label="货位"
                   prop="warehouseName"

+ 4 - 7
src/views/warehouseManagement/warehouseDefinition/add.vue

@@ -1040,11 +1040,12 @@
           : [];
       },
       checkVolume() {
+        console.log(this.areaForm);
         let falg = true;
         let warehouseAreasSaveList = this.areaForm.warehouseAreasSaveList.map(
           (item) => {
             return {
-              id: item.id,
+              id: item.code,
               volumu:
                 item.extInfo[0].areaHigh *
                 item.extInfo[0].areaLength *
@@ -1056,7 +1057,7 @@
         let areaGoodsshelvesList = this.areaForm.areaGoodsshelvesList.map(
           (item) => {
             return {
-              id: item.warehouseAreaId,
+              id: item.reservoirAreaCode,
               volumu:
                 item.extInfo[0].areaHigh *
                 item.extInfo[0].areaLength *
@@ -1064,7 +1065,6 @@
             };
           }
         );
-
         warehouseAreasSaveList.forEach((item) => {
           let arr = areaGoodsshelvesList.filter((it) => it.id == item.id);
           let num = arr.reduce((val, it) => val + it.volumu, 0);
@@ -1602,12 +1602,9 @@
         }
 
         let obj = {};
-        console.log('-------------------------------------------------------');
-        console.log(this.areaForm.allocationReqList);
-        console.log(this.areaForm.areaGoodsshelvesList);
         for (const item of this.areaForm.allocationReqList) {
           const area = this.areaForm.areaGoodsshelvesList.find((itm) => {
-            return itm.code === item.goodsShelvesCode;
+            return itm.reservoirAreaCode === item.code;
           });
 
           const id = `${