From 329de8a777dbc880bc495559fc3aae51963663fb Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 17 十月 2022 17:11:47 +0800
Subject: [PATCH] 1.安灯设置静态页面实现部分

---
 src/components/DatePicker/index.vue |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/src/components/DatePicker/index.vue b/src/components/DatePicker/index.vue
index ae8f1e7..716a199 100644
--- a/src/components/DatePicker/index.vue
+++ b/src/components/DatePicker/index.vue
@@ -361,15 +361,57 @@
     dblChooseDate(date) {
       if (!this.isPastDue(date)) {
         clearTimeout(time)
-        this.dblDate = date
-        this.isDbl = true
-        this.changeTime = this.handleDatetime(date)
-        this.getCapacityPlanningOnclickSelect({
-          CaptPlanWorkShiftCode: this.defArr.find(item => item.name === this.changeTime).key,
-          captplanid: this.rowData.CaptPlanId,
-          datetime: this.handleDatetime(date)
-        })
-        this.getDblTime()
+        time = setTimeout(() => {
+          this.time = funsdates.getYearMonthDay(date)
+          if (typeof this.value === 'string') {
+            this.value = this.value.split(',')
+          }
+          // 鍙互鐐瑰嚮鐨勬棩鏈�
+          if (!this.isPastDue(date)) {
+            if ((this.value.indexOf(this.handleDatetime(date)) < 0 && this.value !== '') || this.value === '') { // 鏁扮粍娣诲姞
+              this.value.push(this.handleDatetime(date)) // 鏂板鍒癷nput閲�
+              const data = {
+                name: this.handleDatetime(date),
+                key: this.rowData.CaptPlanWorkShiftCode
+              }
+              this.defArr.push(data) // 鏂板鍒� 榛樿鏁扮粍閲�
+              this.dblDate = date
+              this.isDbl = true // 鍙充晶灞曞紑
+
+              this.changeTime = this.handleDatetime(date)
+
+              const DATA = {
+                CaptPlanWorkShiftCode: this.defArr.find(item => item.name === this.changeTime).key,
+                captplanid: this.rowData.CaptPlanId,
+                datetime: this.handleDatetime(date)
+              }
+              this.getCapacityPlanningOnclickSelect(DATA)
+              this.getDblTime()
+            } else if (this.value.indexOf(this.handleDatetime(date)) >= 0) {
+              this.dblDate = date
+              this.isDbl = true // 鍙充晶灞曞紑
+
+              this.changeTime = this.handleDatetime(date)
+
+              const DATA = {
+                CaptPlanWorkShiftCode: this.defArr.find(item => item.name === this.changeTime).key,
+                captplanid: this.rowData.CaptPlanId,
+                datetime: this.handleDatetime(date)
+              }
+              this.getCapacityPlanningOnclickSelect(DATA)
+              this.getDblTime()
+
+            //   const indexV = this.value.indexOf(this.handleDatetime(date))
+            //   this.value.splice(indexV, 1)
+            //   for (const i in this.defArr) {
+            //     if (this.defArr[i].name === this.handleDatetime(date)) {
+            //       this.defArr.splice(i, 1)
+            //     }
+            //   }
+            }
+          }
+          this.$emit('input', this.value)
+        }, 300)
       }
     },
     isDblDate(date) {

--
Gitblit v1.9.3