Explorar o código

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

wsx hai 10 meses
pai
achega
bc299f2a43

+ 6 - 2
src/components/Dict/DictSelection.vue

@@ -28,7 +28,7 @@
     },
     props: {
       value: {
-        type: [String, Number],
+        type: [String, Number,Array],
         default: ''
       },
       isProhibit: {
@@ -50,6 +50,10 @@
       ChinEng: {
         Boolean,
         default: false
+      }, //列表使用了多个时,防止多次请求
+      isOne: {
+        type: Boolean,
+        default: true
       }
     },
     data() {
@@ -73,7 +77,7 @@
       }
     },
     created() {
-      if (this.dictName) {
+      if (this.dictName&&this.isOne) {
         this.requestDict(this.dictName);
       }
     },

+ 3 - 2
src/enum/dict.js

@@ -18,6 +18,7 @@ export default {
   不拆物料层规格: 'material_layer',
   紧急程度: 'urgent_type',
   条码分类: 'strip_type',
-  产地:'purchase_origin',
-
+  产地: 'purchase_origin',
+  物品机型: 'product_model_key',
+  物品颜色: 'product_color_key'
 };

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

@@ -1095,6 +1095,9 @@
         }
       },
       submit(status) {
+        if (!this.tableData.name) {
+          return this.$message.error('名称不能为空!');
+        }
         if (this.tableData.length > 0) {
           let params = {
             categoryCode: this.tableData
@@ -1281,11 +1284,7 @@
             //   }
             // }
 
-            if (
-              this.params.inCargoAreaId &&
-              !this.params.inFreightId &&
-              !this.params.inShelvesId
-            ) {
+            if (!this.params.inFreightId && !this.params.inShelvesId) {
               // 只有调入库区
               for (let i = 0; i < this.selection.length; i++) {
                 console.log(this.selection[i].areaId);
@@ -1294,11 +1293,7 @@
                   return this.$message.error('所选物品库区与调入库区重复');
                 }
               }
-            } else if (
-              this.params.inCargoAreaId &&
-              this.params.inShelvesId &&
-              !this.params.inFreightId
-            ) {
+            } else if (this.params.inShelvesId && !this.params.inFreightId) {
               // 只有调入库区/货架
               for (let i = 0; i < this.selection.length; i++) {
                 if (this.selection[i].areaId == this.params.inCargoAreaId) {
@@ -1317,11 +1312,7 @@
                   // 库区不同直接录入
                 }
               }
-            } else if (
-              this.params.inCargoAreaId &&
-              this.params.inShelvesId &&
-              this.params.inFreightId
-            ) {
+            } else if (this.params.inShelvesId && this.params.inFreightId) {
               // 只有调入库区/货架/货位
               for (let i = 0; i < this.selection.length; i++) {
                 if (this.selection[i].areaId == this.params.inCargoAreaId) {

+ 39 - 3
src/views/warehouseManagement/outgoingManagement/index.vue

@@ -95,6 +95,8 @@
                 v-model="formData.factoryId"
                 clearable
                 class="w100"
+                @change="getTreeData"
+
               >
                 <el-option
                   v-for="item in factoryList"
@@ -104,6 +106,24 @@
                 ></el-option>
               </el-select> </el-form-item
           ></el-col>
+          <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+            <el-form-item label="仓库名称" prop="warehouseId">
+              <el-select
+                filterable
+                placeholder="请选择"
+                v-model="formData.warehouseId"
+                clearable
+                class="w100"
+              >
+                <el-option
+                  v-for="item in warehouseList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
           <el-col
             style="
               display: flex;
@@ -299,9 +319,10 @@
         outputSceneState,
         codeList: [],
         factoryList: [],
+        warehouseList: [],
         tableData: [],
         fromUserList: [],
-        loading:false,
+        loading: false,
         formData: {
           deptIds: '',
           categoryCode: '',
@@ -311,7 +332,8 @@
           endTime: '',
           status: '',
           factoryId: '',
-          time: []
+          time: [],
+          warehouseId: ''
         },
         total: 0,
         status: [
@@ -402,7 +424,7 @@
             showOverflowTooltip: true,
             width: 200
           },
-            {
+          {
             prop: 'storageTime',
             label: '出库时间',
             align: 'center',
@@ -440,8 +462,22 @@
       this.getUser();
       this.getTypeList();
       this.getFactoryList();
+      this.getTreeData();
     },
     methods: {
+      async getTreeData() {
+        this.formData.warehouseId = '';
+        try {
+          let res = await storageApi.getWarehouseTrees({
+            factoryId: this.formData.factoryId
+          });
+          if (res?.code === '0') {
+            this.warehouseList = res.data;
+          }
+        } catch (error) {
+          console.log(error);
+        }
+      },
       //获取工厂列表
       async getFactoryList() {
         const res = await warehouseDefinition.getFactoryarea({

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

@@ -359,6 +359,37 @@
                 >
                 </el-input>
               </template>
+              <template v-slot:modelKey="{ row, $index }">
+                <el-form-item>
+                  <DictSelection
+                    dictName="物品机型"
+                    clearable
+                    v-model="row.modelKey"
+                    :isOne="$index === 0"
+                    multiple
+                    filterable
+                    allow-create
+                    default-first-option
+                  >
+                  </DictSelection>
+                </el-form-item>
+              </template>
+              <template v-slot:colorKey="{ row, $index }">
+                <el-form-item>
+                  <DictSelection
+                    dictName="物品颜色"
+                    clearable
+                    v-model="row.colorKey"
+                    :isOne="$index === 0"
+                    multiple
+                    filterable
+                    allow-create
+                    default-first-option
+                  >
+                  </DictSelection>
+                </el-form-item>
+              </template>
+
               <template v-slot:detailProductionDate="{ row, $index }">
                 <template v-if="row.isSave">
                   {{ row.detailProductionDate }}
@@ -604,6 +635,36 @@
               {{ row.weightUnit }}
             </template>
           </el-table-column>
+          <!-- <el-table-column label="机型" prop="modelKey">
+            <template slot-scope="{ row }">
+              <DictSelection
+                dictName="物品机型"
+                clearable
+                v-model="row.modelKey"
+                :isOne="false"
+                multiple
+                filterable
+                allow-create
+                default-first-option
+              >
+              </DictSelection>
+            </template>
+          </el-table-column>
+         <el-table-column label="颜色" prop="colorKey">
+            <template slot-scope="{ row }">
+              <DictSelection
+                dictName="物品颜色"
+                clearable
+                v-model="row.colorKey"
+                :isOne="false"
+                multiple
+                filterable
+                allow-create
+                default-first-option
+              >
+              </DictSelection>
+            </template>
+          </el-table-column> -->
 
           <el-table-column label="质检结果" prop="result" width="120">
             <template slot-scope="{ row }">
@@ -1173,6 +1234,20 @@
             width: 300,
             align: 'center'
           },
+          // {
+          //   width: 200,
+          //   prop: 'modelKey',
+          //   label: '机型',
+          //   slot: 'modelKey',
+          //   align: 'center'
+          // },
+          // {
+          //   width: 200,
+          //   prop: 'colorKey',
+          //   label: '颜色',
+          //   slot: 'colorKey',
+          //   align: 'center'
+          // },
           {
             label: '采购原因',
             prop: 'purpose',
@@ -1181,6 +1256,7 @@
             width: 200,
             align: 'center'
           },
+
           {
             label: '生产日期',
             prop: 'detailProductionDate',
@@ -1460,7 +1536,7 @@
       // 小数处理,最大3位
       format3(str) {
         let value = str;
-        value = value.replace(/[^0-9.]/g, '');
+        value = value.toString().replace(/[^0-9.]/g, '');
         const parts = value.split('.');
         if (parts.length > 2) {
           value = parts[0] + '.' + parts.slice(1).join('');
@@ -1473,7 +1549,6 @@
         return value;
       },
       async computeNum(row, index, isClear) {
-        console.log('row,', row);
         row.packingQuantity = this.format3(row.packingQuantity);
 
         let data = row.packingSpecificationOption.find(
@@ -1581,6 +1656,7 @@
             const batchNo = await getCode('lot_number_code');
             console.log(res, '入库');
             let data = res.map((item, index) => {
+              delete item.extInfo;
               return {
                 ...item,
                 index,
@@ -1709,11 +1785,17 @@
             if (item.weight === null || item.weight === undefined) {
               item.weight = 0;
             }
-            if (this.formData.bizType == 4) {
-              item.packingUnit = '箱';
-            } else {
-              item.packingUnit = '';
-            }
+
+            item.packingUnit = item.measuringUnit; // 单位
+            item.packingUnitId = item.packingSpecificationOption.find(
+              (v) => v.conversionUnit == item.measuringUnit
+            )?.id; // 单位
+
+            // if (this.formData.bizType == 4) {
+            //   item.packingUnit = '箱';
+            // } else {
+            //   item.packingUnit = '';
+            // }
             return item;
           });
           console.log(this.productList, 'productList');

+ 37 - 14
src/views/warehouseManagement/stockManagement/index.vue

@@ -100,6 +100,7 @@
                 v-model="formData.factoryId"
                 clearable
                 class="w100"
+                @change="getTreeData"
               >
                 <el-option
                   v-for="item in factoryList"
@@ -110,19 +111,24 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <!-- <el-col :lg="6" :sm="8" :xs="8">
-          <el-form-item label="创建时间" prop="time">
-            <el-date-picker
-              class="w100"
-              size="small"
-              v-model="formData.time"
-              type="daterange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              value-format="yyyy-MM-dd"
-            ></el-date-picker> </el-form-item
-        ></el-col> -->
+          <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+            <el-form-item label="仓库名称" prop="warehouseId">
+              <el-select
+                filterable
+                placeholder="请选择"
+                v-model="formData.warehouseId"
+                clearable
+                class="w100"
+              >
+                <el-option
+                  v-for="item in warehouseList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
           <el-col
             style="
               display: flex;
@@ -295,6 +301,7 @@
         sceneState,
         codeList: [],
         factoryList: [],
+        warehouseList:[],
         tableData: [],
         formData: {
           deptIds: '',
@@ -305,7 +312,8 @@
           endTime: '',
           status: '',
           factoryId: '',
-          time: []
+          time: [],
+          warehouseId: ''
           // type: 1
         },
         loading: false,
@@ -454,8 +462,22 @@
     mounted() {
       this.getTypeList();
       this.getFactoryList();
+      this.getTreeData()
     },
     methods: {
+      async getTreeData() {
+         this.formData.warehouseId=''
+        try {
+          let res = await storageApi.getWarehouseTrees({
+            factoryId: this.formData.factoryId
+          });
+          if (res?.code === '0') {
+            this.warehouseList = res.data;
+          }
+        } catch (error) {
+          console.log(error);
+        }
+      },
       //获取工厂列表
       async getFactoryList() {
         const res = await warehouseDefinition.getFactoryarea({
@@ -464,6 +486,7 @@
           type: 1
         });
         this.factoryList = res.list;
+       
       },
       // 单击获取id
       cellClick(row) {

+ 6 - 4
src/views/warehouseManagement/stocktaking/work/components/disposeDialog.vue

@@ -1,11 +1,13 @@
 <template>
   <div>
-    <el-dialog
+    <ele-modal
       :title="`处理工单`"
       append-to-body
-      :visible="visibleDialog"
-      :before-close="closeWindows"
+      :visible.sync="visibleDialog"
+      @close="closeWindows"
       width="80vw"
+      :maxable="true"
+      :resizable="true"
     >
       <div class="flex_info">
         <div class="flex_right">
@@ -230,7 +232,7 @@
         <el-button type="primary" @click="onConfirm">确定</el-button>
         <el-button @click="closeWindows">关闭</el-button>
       </div>
-    </el-dialog>
+    </ele-modal>
   </div>
 </template>