From 8f2c2c2f255d5262f8ed10cfdd73c0ce304a436a Mon Sep 17 00:00:00 2001 From: hejunjie Date: Mon, 22 Jul 2024 12:01:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=B0=B4=E9=97=B8?= =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B32=E6=AC=A1=E6=8F=90=E6=B5=8B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintenance/maintenancePlan/index.vue | 25 +++++++++++++------ .../maintenancePlanAccept/index.vue | 25 ++++++++++++++++--- .../maintenancePlanAudit/index.vue | 25 ++++++++++++++++--- .../maintenance/maintenanceRecords/index.vue | 24 +++++++++++++----- .../enginerring/inspectionPlan/index.vue | 6 ++--- .../enginerring/inspectionRecords/index.vue | 10 ++++---- .../inspectionRouteManage/index.vue | 8 +++--- .../maintenance/maintenancePlan/index.vue | 24 +++++++++++++----- .../maintenancePlanAccept/index.vue | 25 ++++++++++++++++--- .../maintenancePlanAudit/index.vue | 25 ++++++++++++++++--- .../maintenance/maintenanceRecords/index.vue | 24 +++++++++++++----- 11 files changed, 168 insertions(+), 53 deletions(-) diff --git a/src/views/dike/runManage/maintenance/maintenancePlan/index.vue b/src/views/dike/runManage/maintenance/maintenancePlan/index.vue index 499da06..0d41b42 100644 --- a/src/views/dike/runManage/maintenance/maintenancePlan/index.vue +++ b/src/views/dike/runManage/maintenance/maintenancePlan/index.vue @@ -15,7 +15,6 @@ import { getAreasData } from "@/api/areas/index"; import { reqCountMixins } from "@/mixins/reqCount"; import { paginationMixins } from "@/mixins/commonPagination"; - export default { name: "InspectionItems", components: { @@ -32,12 +31,24 @@ export default { name: "", planDateArr: [], }, - pickerOption: { - disabledDate(time) {//只能选择5年数据 + choiceDate: '', + pickerOption: { // 设置不能选择的日期 + onPick: ({ maxDate, minDate }) => { + this.choiceDate = minDate.getTime() + if (maxDate) { + this.choiceDate = ''; + } + }, + disabledDate: (time) => {//只能选择5年数据 let curDate = (new Date()).getTime(); let three = 5 * 12 * 30 * 24 * 3600 * 1000; - let threeMonths = curDate - three; - return time.getTime() > Date.now() || time.getTime() < threeMonths; + let min = curDate + three; + let max = curDate - three; + if (this.choiceDate) { + return time.getTime() < max || time.getTime() > min; + } else { + return false; + } } }, currentRow: {}, @@ -429,7 +440,7 @@ export default { > { + this.choiceDate = minDate.getTime() + if (maxDate) { + this.choiceDate = ''; + } + }, + disabledDate: (time) => {//只能选择5年数据 let curDate = (new Date()).getTime(); let three = 5 * 12 * 30 * 24 * 3600 * 1000; - let threeMonths = curDate - three; - return time.getTime() > Date.now() || time.getTime() < threeMonths; + let min = curDate + three; + let max = curDate - three; + if (this.choiceDate) { + return time.getTime() < max || time.getTime() > min; + } else { + return false; + } } }, dialog: { @@ -432,6 +444,11 @@ export default { + diff --git a/src/views/sluice/runManage/maintenance/maintenancePlan/index.vue b/src/views/sluice/runManage/maintenance/maintenancePlan/index.vue index 0e929c8..dcb7edf 100644 --- a/src/views/sluice/runManage/maintenance/maintenancePlan/index.vue +++ b/src/views/sluice/runManage/maintenance/maintenancePlan/index.vue @@ -31,12 +31,24 @@ export default { name: "", planDateArr: [], }, - pickerOption: { - disabledDate(time) {//只能选择5年数据 + choiceDate: '', + pickerOption: { // 设置不能选择的日期 + onPick: ({ maxDate, minDate }) => { + this.choiceDate = minDate.getTime() + if (maxDate) { + this.choiceDate = ''; + } + }, + disabledDate: (time) => {//只能选择5年数据 let curDate = (new Date()).getTime(); let three = 5 * 12 * 30 * 24 * 3600 * 1000; - let threeMonths = curDate - three; - return time.getTime() > Date.now() || time.getTime() < threeMonths; + let min = curDate + three; + let max = curDate - three; + if (this.choiceDate) { + return time.getTime() < max || time.getTime() > min; + } else { + return false; + } } }, currentRow: {}, @@ -424,7 +436,7 @@ export default { > { + this.choiceDate = minDate.getTime() + if (maxDate) { + this.choiceDate = ''; + } + }, + disabledDate: (time) => {//只能选择5年数据 let curDate = (new Date()).getTime(); let three = 5 * 12 * 30 * 24 * 3600 * 1000; - let threeMonths = curDate - three; - return time.getTime() > Date.now() || time.getTime() < threeMonths; + let min = curDate + three; + let max = curDate - three; + if (this.choiceDate) { + return time.getTime() < max || time.getTime() > min; + } else { + return false; + } } }, dialog: { @@ -425,6 +437,11 @@ export default { +