Explorar o código

fix:5418【采购订单-收货单】有效期截至日期推算应根据用户选择的生成日期生效;如果没选则就按当前日期

mlchen hai 1 mes
pai
achega
9ff982eff6

+ 8 - 3
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -85,6 +85,7 @@
             v-model="scope.row.productionDate"
             type="date"
             placeholder="选择日期"
+            @change="setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')"
           >
           </el-date-picker>
         </el-form-item>
@@ -1235,7 +1236,11 @@
             this.form.datasource[index],
             'guaranteePeriodDeadline',
             guaranteePeriodUnitName != 'second'
-              ? this.setDay(row.guaranteePeriod, guaranteePeriodUnitName)
+              ? this.setDay(
+                  row.guaranteePeriod,
+                  guaranteePeriodUnitName,
+                  row.productionDate
+                )
               : ''
           );
         }
@@ -1249,8 +1254,8 @@
           ? 'year'
           : 'second';
       },
-      setDay(addDay, dateType = 'day') {
-        return dayjs(this.contractStartDate || new Date())
+      setDay(addDay, dateType = 'day', startDate) {
+        return dayjs(startDate || new Date())
           .add(addDay, dateType)
           .format('YYYY-MM-DD');
       },