From d3129c5d9af88192c43e7d2a529adf68f7433d9e Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 17 十月 2022 09:11:34 +0800
Subject: [PATCH] 1.产能规划日历部分实现

---
 src/components/DatePicker/index.vue |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/components/DatePicker/index.vue b/src/components/DatePicker/index.vue
index 53eb8eb..b9a67bb 100644
--- a/src/components/DatePicker/index.vue
+++ b/src/components/DatePicker/index.vue
@@ -127,6 +127,7 @@
   CapacityPlanningOnclickSelect,
   CapacityPlanningSetupSearch
 } from '@/api/scgl'
+
 var time = null
 export default {
   directives: {
@@ -168,6 +169,7 @@
       type: Function,
       default: null
     }
+
   },
 
   data() {
@@ -198,6 +200,7 @@
         page: 1
       },
       projectDef: []
+
     }
   },
   computed: {
@@ -218,7 +221,8 @@
       return `${year}-${month + 1}-${day}`
     }
   },
-  mounted() {},
+  mounted() {
+  },
   methods: {
     getDblTime() {
       const { year, month, day } = funsdates.getYearMonthDay(this.dblDate)
@@ -297,7 +301,7 @@
     focus() {
       this.isVisible = true
 
-      this.CapacityPlanningCalendar()
+      this.getCapacityPlanningCalendar()
       this.getHeight()
       this.CapacityPlanningSetupSearch()
       this.CapacityPlanningSearch()
@@ -332,6 +336,9 @@
         // 鍙互鐐瑰嚮鐨勬棩鏈�
         if (!this.isPastDue(date)) {
           if ((this.value.indexOf(this.handleDatetime(date)) < 0 && this.value !== '') || this.value === '') { // 鏁扮粍娣诲姞
+            if (typeof this.value === 'string') {
+              this.value = this.value.split(',')
+            }
             this.value.push(this.handleDatetime(date)) // 鏂板鍒癷nput閲�
             const data = {
               name: this.handleDatetime(date),
@@ -340,6 +347,9 @@
             this.defArr.push(data) // 鏂板鍒� 榛樿鏁扮粍閲�
           } else if (this.value.indexOf(this.handleDatetime(date)) >= 0) { // 鏁扮粍鍑忓幓
             const indexV = this.value.indexOf(this.handleDatetime(date))
+            if (typeof this.value === 'string') {
+              this.value = this.value.split(',')
+            }
             this.value.splice(indexV, 1)
             for (const i in this.defArr) {
               if (this.defArr[i].name === this.handleDatetime(date)) {
@@ -358,7 +368,11 @@
         this.isDbl = true
         this.changeTime = this.handleDatetime(date)
 
-        this.CapacityPlanningOnclickSelect({ CaptPlanWorkShiftCode: this.rowData.CaptPlanWorkShiftCode, captplanid: this.rowData.CaptPlanId, datetime: this.handleDatetime(date) })
+        this.CapacityPlanningOnclickSelect({
+          CaptPlanWorkShiftCode: this.rowData.CaptPlanWorkShiftCode,
+          captplanid: this.rowData.CaptPlanId,
+          datetime: this.handleDatetime(date)
+        })
         this.getDblTime()
       }
     },
@@ -460,15 +474,9 @@
         }
       })
     },
-    CapacityPlanningCalendar() {
-      // const temp = JSON.parse(this.rowData)
+    getCapacityPlanningCalendar() {
       CapacityPlanningCalendar({ captplanid: this.rowData.CaptPlanId }).then((res) => {
-        for (const i in res.List) {
-          if (res.List[i].key === '') {
-            res.List[i].key = this.rowData.CaptPlanWorkShiftCode
-          }
-        }
-        this.defArr = res.List
+        this.defArr = res.data
       })
     },
     closeCapacityPlanningCalendar() {

--
Gitblit v1.9.3