Ver Fonte

物品层 添加失效时间

yusheng há 11 meses atrás
pai
commit
bc2679cfea

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

@@ -537,6 +537,73 @@
                   </el-input>
                 </template>
               </el-table-column>
+              <el-table-column
+                align="center"
+                label="生产日期"
+                prop="detailProductionDate"
+                width="220"
+              >
+                <template slot-scope="{ row, $index }">
+                  <template v-if="row.isSave">
+                    {{ row.detailProductionDate }}
+                  </template>
+                  <el-date-picker
+                    v-else
+                    :disabled="row.isPack"
+                    size="small"
+                    v-model="row.detailProductionDate"
+                    type="datetime"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    placeholder="选择日期"
+                  >
+                  </el-date-picker
+                ></template>
+              </el-table-column>
+
+              <el-table-column
+                align="center"
+                label="采购日期"
+                prop="detailPurchaseDate"
+                width="220"
+              >
+                <template slot-scope="{ row, $index }">
+                  <template v-if="row.isSave">
+                    {{ row.detailPurchaseDate }}
+                  </template>
+                  <el-date-picker
+                    v-else
+                    :disabled="row.isPack"
+                    size="small"
+                    v-model="row.detailPurchaseDate"
+                    type="datetime"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    placeholder="选择日期"
+                  >
+                  </el-date-picker
+                ></template>
+              </el-table-column>
+              <el-table-column
+                align="center"
+                label="失效日期"
+                prop="detailExpireDate"
+                width="220"
+              >
+                <template slot-scope="{ row, $index }">
+                  <template v-if="row.isSave">
+                    {{ row.detailExpireDate }}
+                  </template>
+                  <el-date-picker
+                    v-else
+                    :disabled="row.isPack"
+                    size="small"
+                    v-model="row.detailExpireDate"
+                    type="datetime"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    placeholder="选择日期"
+                  >
+                  </el-date-picker
+                ></template>
+              </el-table-column>
               <el-table-column
                 label="操作"
                 width="200"
@@ -572,10 +639,20 @@
             <el-button
               style="margin-left: 20px"
               type="text"
-              @click="dateSetting"
-              >批量设置{{
-                curDateType === 'productionDate' ? '生产日期' : '采购日期'
-              }}</el-button
+              @click="dateSetting('productionDate')"
+              >批量设置生产日期</el-button
+            >
+            <el-button
+              style="margin-left: 20px"
+              type="text"
+              @click="dateSetting('purchaseDate')"
+              >批量设置采购日期</el-button
+            >
+            <el-button
+              style="margin-left: 20px"
+              type="text"
+              @click="dateSetting('expireDate')"
+              >批量设置失效日期</el-button
             >
           </div>
         </header-title>
@@ -760,29 +837,60 @@
               <span>{{ qualityStatus[row.status] }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="生产日期" prop="" width="220">
-            <template slot="header" slot-scope="scope">
-              <el-select filterable v-model="curDateType">
-                <el-option value="productionDate" label="生产日期"></el-option>
-                <el-option value="purchaseDate" label="采购日期"></el-option>
-              </el-select>
-            </template>
-            <template slot-scope="{ row }">
-              <template v-if="formData.bizType == 5">
-                {{ row[curDateType] }}
-              </template>
-              <el-date-picker
-                v-else
-                :disabled="row.isPack"
-                size="small"
-                v-model="row[curDateType]"
-                type="datetime"
-                value-format="yyyy-MM-dd HH:mm:ss"
-                placeholder="选择日期"
-              >
-              </el-date-picker>
+          <template v-if="formData.bizType == 5">
+            <el-table-column
+              label="生产日期"
+              prop="productionDate"
+              width="220"
+            ></el-table-column>
+            <el-table-column
+              label="采购日期"
+              prop="purchaseDate"
+              width="220"
+            ></el-table-column>
+          </template>
+          <template v-else>
+            <el-table-column label="生产日期" prop="productionDate" width="220">
+              <template slot-scope="{ row, $index }">
+                <el-date-picker
+                  :disabled="row.isPack"
+                  size="small"
+                  v-model="row.productionDate"
+                  type="datetime"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  placeholder="选择日期"
+                >
+                </el-date-picker
+              ></template>
+            </el-table-column>
+
+            <el-table-column label="采购日期" prop="purchaseDate" width="220">
+              <template slot-scope="{ row, $index }">
+                <el-date-picker
+                  :disabled="row.isPack"
+                  size="small"
+                  v-model="row.purchaseDate"
+                  type="datetime"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  placeholder="选择日期"
+                >
+                </el-date-picker
+              ></template>
+            </el-table-column>
+            <el-table-column label="失效日期" prop="expireDate" width="220">
+              <template slot-scope="{ row, $index }">
+                <el-date-picker
+                  :disabled="row.isPack"
+                  size="small"
+                  v-model="row.expireDate"
+                  type="datetime"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  placeholder="选择日期"
+                >
+                </el-date-picker
+              ></template>
+            </el-table-column>
             </template>
-          </el-table-column>
           <!-- <el-table-column label="操作" width="120" fixed="right">
             <template slot-scope="{ row, $index }">
               <el-button type="text" @click="wrapDelete(row, $index)">
@@ -2041,7 +2149,7 @@
                       outInIds: res.data
                     });
                   } else {
-                    await storageApi.submitTwo({ outInIds:res.data});
+                    await storageApi.submitTwo({ outInIds: res.data });
                   }
                   this.$message.success('入库成功');
                 } else {
@@ -2673,16 +2781,17 @@
         console.log('计量单位----', row.measureUnit);
         let packingList = [];
         let obj = this.getNowDate();
-        let productionDate = '';
-        let purchaseDate = '';
+        let productionDate = row.detailProductionDate || '';
+        let purchaseDate = row.detailPurchaseDate || '';
+        let expireDate = row.detailExpireDate || '';
         if (this.formData.bizType == '1') {
           // 生产入库
           productionDate = `${obj.year}-${obj.month}-${obj.strDate} ${obj.hour}:${obj.minute}:${obj.second}`;
-          this.curDateType = 'productionDate';
+          // this.curDateType = 'productionDate';
         } else if (this.formData.bizType == '2') {
           // 采购入库
           purchaseDate = `${obj.year}-${obj.month}-${obj.strDate} ${obj.hour}:${obj.minute}:${obj.second}`;
-          this.curDateType = 'purchaseDate';
+          // this.curDateType = 'purchaseDate';
         }
 
         // 判断单位和计量单位是否为不拆物料层规格
@@ -2930,15 +3039,20 @@
               isUnpack: row.isUnpack, // 是否允许拆包
               productionDate: productionDate, // 生产日期
               purchaseDate: purchaseDate, // 采购时间
+              expireDate:expireDate,
               result: 1, // 结果(1合格 2不合格)
               status: 2 // 状态(0=未质检 1待检 2已检)
             };
-            console.log(row.packingSpecificationOption[1],'row.packingSpecificationOption[1]')
+            console.log(
+              row.packingSpecificationOption[1],
+              'row.packingSpecificationOption[1]'
+            );
             if (row.isUnpack) {
               // 第二层条件: packingBoolen
               if (packingBoolen) {
                 // 空值保护: 确保 filterArr[0] 存在
-                item.packingUnit = row.packingSpecificationOption[1].conversionUnit;
+                item.packingUnit =
+                  row.packingSpecificationOption[1].conversionUnit;
               } else {
                 // 第三层条件: measureBoolen
                 if (measureBoolen) {
@@ -2948,7 +3062,8 @@
                     row.packingSpecificationOption?.[0];
                   item.packingUnit = option?.conversionUnit;
                 } else {
-                  item.packingUnit = row.packingSpecificationOption[1].conversionUnit;
+                  item.packingUnit =
+                    row.packingSpecificationOption[1].conversionUnit;
                 }
               }
             }
@@ -3268,10 +3383,11 @@
         return materialList;
       },
       // 设置时间
-      dateSetting() {
+      dateSetting(curDateType) {
         if (!this.packingListSelected.length) {
           return this.$message.error(`请选择${this.title}明细!`);
         }
+        this.curDateType=curDateType
         this.dateVisible = true;
       },
       // 选择包装列表

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

@@ -162,6 +162,24 @@
             </el-table-column>
             <el-table-column label="仓库" prop="warehouseName" :show-overflow-tooltip="true">
             </el-table-column>
+            <el-table-column
+              label="生产日期"
+              prop="detailProductionDate"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="采购日期"
+              prop="detailPurchaseDate"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="失效日期"
+              prop="detailExpireDate"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
             <el-table-column v-if="infoData.verifyStatus == 2" label="操作" width="200" fixed="right" align="center">
               <template slot-scope="{ row, $index }">
                 <el-button v-if="isUpper(row)" type="text" @click="shelvesWarehouse(row, $index, '产品')">下架</el-button>
@@ -171,6 +189,7 @@
           </el-table>
         </div>
         <div class="mt20">
+          <!-- {{ this.packingList }} -->
           <header-title :title="`包装明细`" size="16px">
             <el-button v-for="item in mergeOptions" size="mini" type="primary" @click="openMergeDialog(item)">合并成{{
               item.conversionUnit }}</el-button>
@@ -232,6 +251,13 @@
             <el-table-column label="生产日期" prop="productionDate" :show-overflow-tooltip="true">
             </el-table-column>
             <el-table-column label="采购日期" prop="purchaseDate" :show-overflow-tooltip="true">
+            </el-table-column>
+            <el-table-column
+              label="失效日期"
+              prop="expireDate"
+              :show-overflow-tooltip="true"
+            >
+    
             </el-table-column>
             <el-table-column v-if="infoData.verifyStatus == 2" label="操作" width="200" fixed="right" align="center">
               <template slot-scope="{ row, $index }">
@@ -766,6 +792,7 @@ export default {
         })
         .then((data) => {
           this.total = data.count;
+          console.log(data.list,'data.list')
           this.packingList = data.list;
         });
     }