Przeglądaj źródła

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wms into dev

yusheng 7 miesięcy temu
rodzic
commit
d9e31a0b96

+ 2 - 1
src/enum/dict.js

@@ -20,5 +20,6 @@ export default {
   条码分类: 'strip_type',
   产地: 'purchase_origin',
   物品机型: 'product_model_key',
-  物品颜色: 'product_color_key'
+  物品颜色: 'product_color_key',
+  流程实例的结果: 'bpm_process_instance_result',
 };

+ 6 - 0
src/utils/dict/warehouse.js

@@ -241,6 +241,12 @@ export const allocationType = [
     label: '库外调拨'
   }
 ];
+// 列表维度
+export const dimensionType = [
+  { code: 1, label: '物品维度' },
+  { code: 2, label: '批次维度' },
+  { code: 3, label: '包装维度' }
+]
 export const allocationStatusDict = [
   {
     code: 1,

+ 62 - 34
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -80,7 +80,7 @@
                 <el-form-item
                   label-width="65px"
                   label="调出仓库:"
-                  prop="warehouseId"
+                  prop="outWarehouseId"
                 >
                   <template>
                     <el-select
@@ -130,7 +130,7 @@
                 <el-form-item
                   label-width="65px"
                   label="调出货架:"
-                  prop="warehouseId"
+                  prop="outShelvesId"
                 >
                   <template>
                     <el-select
@@ -154,7 +154,7 @@
                 <el-form-item
                   label-width="65px"
                   label="调出货位:"
-                  prop="warehouseId"
+                  prop="outFreightId"
                 >
                   <template>
                     <el-select
@@ -281,7 +281,7 @@
                 <el-form-item
                   label-width="65px"
                   label="调入仓库:"
-                  prop="warehouseId"
+                  prop="inWarehouseId"
                 >
                   <template>
                     <el-select
@@ -307,7 +307,7 @@
                 <el-form-item
                   label-width="65px"
                   label="调入库区:"
-                  prop="outCargoAreaId"
+                  prop="inCargoAreaId"
                 >
                   <template>
                     <el-select
@@ -331,7 +331,7 @@
                 <el-form-item
                   label-width="65px"
                   label="调入货架:"
-                  prop="warehouseId"
+                  prop="inShelvesId"
                 >
                   <template>
                     <el-select
@@ -355,7 +355,7 @@
                 <el-form-item
                   label-width="65px"
                   label="调入货位:"
-                  prop="warehouseId"
+                  prop="inFreightId"
                 >
                   <template>
                     <el-select
@@ -431,7 +431,7 @@
         selection: [],
         tableData: [],
         productList: [],
-        allocateId: 1,
+        allocateId: 2,
         currentPullAreaId: '',
         currentPullAreaName: '',
         currentTuneAreaId: '',
@@ -715,13 +715,20 @@
             minWidth: 130,
             showOverflowTooltip: true,
           },
-          {
+          // {
+          //   prop: 'batchNo',
+          //   label: '批次号',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   minWidth: 110
+          // },
+          ...(this.dimension != '1' ? [{
             prop: 'batchNo',
             label: '批次号',
             align: 'center',
+            minWidth: 130,
             showOverflowTooltip: true,
-            minWidth: 110
-          },
+          }] : []),
           this.dimension == 3 ? {
             prop: 'packageNo',
             label: '包装编码',
@@ -779,18 +786,18 @@
             align: 'center',
             showOverflowTooltip: true,
           },
-          {
-            prop: 'weight',
-            label: '重量',
-            align: 'center',
-            showOverflowTooltip: true,
-          },
-          {
-            prop: 'weightUnit',
-            label: '重量单位',
-            align: 'center',
-            showOverflowTooltip: true,
-          },
+          // {
+          //   prop: 'weight',
+          //   label: '重量',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          // },
+          // {
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          // },
           {
             label: '操作',
             align: 'center',
@@ -807,6 +814,8 @@
     },
     async created() {
       const code = await getCode('transfer_no');
+      const name = await getCode('inventory_allocation_name');
+      this.params.name = name;
       this.params.code = code;
       // this.getTreeData();
       await this.getFactoryList();
@@ -817,9 +826,10 @@
       } else {
         if(this.factoryList.find(item => item.id == this.userInfo.factoryId)?.id) {
           this.factoryId = this.userInfo.factoryId;
-          if(this.allocateId == 1) {
-            this.params.targetFactoriesId = this.factoryId
-          }
+          this.params.targetFactoriesId = this.factoryId
+          // if(this.allocateId == 1) {
+          //   this.params.targetFactoriesId = this.factoryId
+          // }
          this.getTreeData(this.factoryId) 
         }
       }
@@ -986,13 +996,36 @@
         this.getTreeData();
       },
       targetFactoryChange() {
-        this.reset();
-        this.getTreeData();
+        // this.reset();
+        // this.getTreeData();
       },
       search() {
         return new Promise((resolve, reject) => {
           // 重置错误标志
           this.searchState.hasError = false;
+
+          if(!this.params.targetFactoriesId){
+            this.searchState.hasError = true;
+            const errorMsg = '调入工厂不能为空';
+            this.$message.error(errorMsg);
+            return reject(new Error(errorMsg));
+          }
+
+          if(!this.params.inWarehouseId){
+            this.searchState.hasError = true;
+            const errorMsg = '调入仓库不能为空';
+            this.$message.error(errorMsg);
+            return reject(new Error(errorMsg));
+          }
+
+          // 检查是否存在quantity小于等于0或无效的项
+          if(this.tableData.some((item) => !item.quantity || item.quantity <= 0)) {
+            this.searchState.hasError = true;
+            const errorMsg = '调拨数量不能为0';
+            this.$message.error(errorMsg);
+            return reject(new Error(errorMsg));
+          }
+
           if (this.allocateId == 1) {
             // 库内调拨
             if (this.params.inFreightId && this.params.outFreightId) {
@@ -1371,11 +1404,6 @@
         this.selectionIds = this.selectionIds.filter((item) => item != row.id);
         this.selection = this.selection.filter((item) => item.id != row.id);
         this.$refs.table.setSelectedRowKeys(this.selectionIds);
-        console.log('this.$refs.table.getSelectedRowKeys()~~~~', this.$refs.table);
-        
-        
-        console.log('selectionIds~~~~', this.selectionIds);
-        console.log('selection~~~~', this.selection);
         this.$forceUpdate()
       },
       config() {
@@ -1390,7 +1418,7 @@
       submit(status) {
         if (!this.params.name) {
           return this.$message.error('名称不能为空!');
-        }
+        } 
         
         // 提交前通过search方法校验数据
         this.search().then(() => {

+ 13 - 1
src/views/warehouseManagement/inventoryAllocation/details.vue

@@ -39,6 +39,14 @@
                 }}</span>
               </el-form-item>
             </el-col>
+            <el-col :span="8">
+              <el-form-item label="列表维度">
+                <span>{{
+                  dimensionType.filter((item) => item.code == infoData.inventoryDimension)[0]
+                    ?.label
+                }}</span>
+              </el-form-item>
+            </el-col>
             <el-col :span="8">
               <el-form-item label="调出库">
                 <span>{{ infoData.sourceWarehouse }}</span>
@@ -145,16 +153,19 @@
               :show-overflow-tooltip="true"
             ></el-table-column>
             <el-table-column
+              v-if="infoData.inventoryDimension == 3"
               label="包装编码"
               prop="packageNo"
               :show-overflow-tooltip="true"
             ></el-table-column>
             <el-table-column
+              v-if="infoData.inventoryDimension == 3"
               label="包装数量"
               prop="packingQuantity"
               :show-overflow-tooltip="true"
             ></el-table-column>
             <el-table-column
+              v-if="infoData.inventoryDimension == 3"
               label="包装单位"
               prop="packingUnit"
               :show-overflow-tooltip="true"
@@ -219,7 +230,7 @@
   } from '@/api/bpm/index';
   // import { getDetail } from '@/api/stockManagement/inventoryAllocation'
   import PageHeader from '@/components/PageHeader';
-  import { allocationType } from '@/utils/dict/warehouse';
+  import { allocationType, dimensionType } from '@/utils/dict/warehouse';
   import { useDictLabelFilter } from '@/utils/dict';
   import StatusStep from '@/components/StatusStep/index.vue';
 
@@ -228,6 +239,7 @@
     data() {
       return {
         allocationType,
+        dimensionType,
         auditStatus: [
           { code: 0, label: '未提交', class: 'danger-text' },
           { code: 1, label: '审核中', class: 'primary-text' },

+ 10 - 0
src/views/warehouseManagement/stockManagement/details.vue

@@ -205,6 +205,16 @@
               prop="packingUnit"
             >
             </el-table-column>
+            <el-table-column
+              label="允许拆包"
+              prop="isUnpack"
+              width="100"
+              align="center"
+            >
+              <template slot-scope="{ row }">
+                {{ row.isUnpack == 1 ? '是' : '否' }}
+              </template>
+            </el-table-column>
             <el-table-column
               label="计量数量"
               prop="measureQuantity"