loulijun2021
2022-10-17 a33b64b8a7ad977cd7a78733426f1a7a4a3df4b8
1.产能规划日历部分优化
已修改1个文件
46 ■■■■ 文件已修改
src/components/DatePicker/index.vue 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/DatePicker/index.vue
@@ -42,7 +42,9 @@
                :disabled="!isDblDate(visibleDays[(i-1)*7+(j-1)])"
              >
                <div class="pop_style">{{ callbackTxt(visibleDays[(i - 1) * 7 + (j - 1)]) }}</div>
                <!--                <div class="pop_style">123</div>-->
                <span
                  slot="reference"
                  :class="[{select:isSelect(visibleDays[(i-1)*7+(j-1)])},
@@ -244,11 +246,10 @@
        }
      }
      for (const i in this.projectDef) {
        if (this.projectDef[i].CapSetupCode === code) {
          name = this.projectDef[i].CapSetupName
        if (this.projectDef[i].code === code) {
          name = this.projectDef[i].name
        }
      }
      return name
    },
    getHeight() {
@@ -260,7 +261,7 @@
      }
      const e = event || window.event
      // console.log(e.clientY, 7)
      const nowHeigth = e.clientY
      if (nowHeigth >= 500) {
        this.topStyle = true
@@ -303,7 +304,7 @@
      this.getCapacityPlanningCalendar()
      this.getHeight()
      this.CapacityPlanningSetupSearch()
      this.getCapacityPlanningSetupSearch()
      this.CapacityPlanningSearch()
    },
    blur() {
@@ -331,14 +332,13 @@
      clearTimeout(time) // 首先清除计时器
      time = setTimeout(() => {
        this.time = funsdates.getYearMonthDay(date)
        // const timeDate = ''
        if (typeof this.value === 'string') {
          this.value = this.value.split(',')
        }
        this.isDbl = false
        // 可以点击的日期
        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)) // 新增到input里
            const data = {
              name: this.handleDatetime(date),
@@ -347,9 +347,6 @@
            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)) {
@@ -367,9 +364,8 @@
        this.dblDate = date
        this.isDbl = true
        this.changeTime = this.handleDatetime(date)
        this.CapacityPlanningOnclickSelect({
          CaptPlanWorkShiftCode: this.rowData.CaptPlanWorkShiftCode,
        this.getCapacityPlanningOnclickSelect({
          CaptPlanWorkShiftCode: this.defArr.find(item => item.name === this.changeTime).key,
          captplanid: this.rowData.CaptPlanId,
          datetime: this.handleDatetime(date)
        })
@@ -438,7 +434,7 @@
    //         }
    // },
    // 双击请求数据
    CapacityPlanningOnclickSelect(data) {
    getCapacityPlanningOnclickSelect(data) {
      CapacityPlanningOnclickSelect(data).then((res) => {
        this.projectList = res.data
@@ -482,16 +478,16 @@
    closeCapacityPlanningCalendar() {
      CapacityPlanningCalendar({ captplanid: this.rowData.CaptPlanId }).then((res) => {
        const nameList = []
        for (const i in res.List) {
          nameList.push(res.List[i].name)
          if (res.List[i].key === '') {
            res.List[i].key = this.rowData.CaptPlanWorkShiftCode
        for (const i in res.data) {
          nameList.push(res.data[i].name)
          if (res.data[i].key === '') {
            res.data[i].key = this.rowData.CaptPlanWorkShiftCode
          }
        }
        for (const i in this.defArr) {
          for (const j in res.List) {
            if (this.defArr[i].name === this.changeTime && res.List[j].name === this.changeTime) {
              this.defArr[i].key = res.List[j].key
          for (const j in res.data) {
            if (this.defArr[i].name === this.changeTime && res.data[j].name === this.changeTime) {
              this.defArr[i].key = res.data[j].key
            } else if (this.defArr[i].name === this.changeTime && nameList.indexOf(this.changeTime) === -1) {
              this.defArr[i].key = this.rowData.CaptPlanWorkShiftCode
            }
@@ -505,9 +501,9 @@
        this.closeCapacityPlanningCalendar()
      }, 300)
    },
    CapacityPlanningSetupSearch() {
    getCapacityPlanningSetupSearch() {
      CapacityPlanningSetupSearch(this.form).then((res) => {
        this.projectDef = res.rows
        this.projectDef = res.data
      })
    }