From 67d7bea4cec55d2b995fe5e1726a8c636aac10e2 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Tue, 25 Jun 2024 15:52:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=87=BA=E5=8E=82=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=99=9A=E4=BA=8E=E9=87=87=E8=B4=AD=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E4=B8=8E=E5=88=B0=E8=B4=A7=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toolsAcceptance/component/addTools.vue | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) 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', '') + }) + }, }, }