diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue index 5fe98a6a..a296fd04 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue @@ -30,6 +30,14 @@ value-format="yyyy-MM-dd" type="date" placeholder="出厂日期" + :picker-options="{ + // 设置当前时间为 采购日期的前一天 + disabledDate: time => { + const currentDate = new Date(maForm.purchaseTime || new Date()) + currentDate.setDate(currentDate.getDate() - 1) + return time.getTime() > currentDate.getTime() + } + }" @change="changeTime" > @@ -67,6 +75,7 @@ value-format="yyyy-MM-dd" type="date" placeholder="请选择采购日期" + @change="changeTimePurchase" > @@ -74,9 +83,16 @@ v-model="maForm.arrivalTime" style="width: 240px" value-format="yyyy-MM-dd" - :picker-options="pickerOptions" type="date" placeholder="请选择到货日期" + :picker-options="{ + // 设置当前时间为 采购日期的前一天 + disabledDate: time => { + const currentDate = new Date(maForm.purchaseTime || new Date()) + currentDate.setDate(currentDate.getDate()) + return time.getTime() < currentDate.getTime() + } + }" > @@ -202,6 +218,14 @@ type="date" range-separator="-" placeholder="出厂日期" + :picker-options="{ + // 设置当前时间为 采购日期的前一天 + disabledDate: time => { + const currentDate = new Date(maForm.purchaseTime || new Date()) + currentDate.setDate(currentDate.getDate() - 1) + return time.getTime() > currentDate.getTime() + } + }" > @@ -703,6 +727,13 @@ export default { // ...this.queryParams // }, `role_${new Date().getTime()}.xlsx`) }, + // 采购日期变化 + changeTimePurchase() { + this.queryParams.productionTime = '' + this.equipmentList.forEach((item) => { + this.$set(item, 'productionTime', '') + }) + }, }, }