From 99a010f21d278498bafd248217c584e101db2d8f Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 01 九月 2022 17:27:17 +0800
Subject: [PATCH] 1.自动扫码回车功能接入

---
 src/views/sbgl/byjl.vue |  821 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 819 insertions(+), 2 deletions(-)

diff --git a/src/views/sbgl/byjl.vue b/src/views/sbgl/byjl.vue
index 34f4bdb..1def61d 100644
--- a/src/views/sbgl/byjl.vue
+++ b/src/views/sbgl/byjl.vue
@@ -1,8 +1,825 @@
-<template />
+<template>
+  <div>
+    <el-tabs>
+      <el-row style="margin-bottom:20px">
+        <!-- <el-col :span="2">
+       <el-input v-model="form.Seach"  @keyup.enter.native="SeachKey" placeholder="璇疯緭鍏ュ叧閿瘝" size="small"></el-input>
+        </el-col>-->
+        <el-col :span="7" :offset="1">
+          <span class="t_size" style="margin-left:7px">鎺掔▼鏃ユ湡</span>
+          <el-date-picker
+            v-model="value1"
+            type="daterange"
+            range-separator="~"
+            format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd"
+            start-placeholder="寮�濮嬫棩鏈�"
+            end-placeholder="缁撴潫鏃ユ湡"
+            size="small"
+            :picker-options="pickerOptions1"
+          />
+        </el-col>
+
+        <el-col :span="3">
+          <span class="t_size">鎺掔▼鏂瑰紡</span>
+          <el-select v-model="types" size="small" style="width:120px" @change="changeTypes">
+            <el-option value="N" label="璁惧浼樺厛" />
+            <el-option value="Y" label="鏃堕棿浼樺厛" />
+          </el-select>
+        </el-col>
+
+        <el-col :span="3" :offset="1">
+          <div style="height:32px;">
+            <span class="t_size">鏃堕棿鍒诲害</span>
+            <select id="scale" v-model.number="scale">
+              <option v-for="i in scaleList" :key="i">{{ i }}</option>
+            </select>
+            <span class="t_size">鍒嗛挓</span>
+          </div>
+        </el-col>
+
+        <el-col :span="3">
+          <div style="height:32px;">
+            <span class="t_size">鎹㈠瀷鏃堕棿</span>
+            <el-input
+              id="scale"
+              v-model="times"
+              type="number"
+              size="mini"
+              style="display:inline-block;width:80px;"
+              @change="no_zero"
+            />
+            <span class="t_size">鍒嗛挓</span>
+          </div>
+        </el-col>
+
+        <el-col :span="3">
+          <div style="height:32px;line-height: 28px;">
+            <span class="t_size">棰勬帓杩涘害</span>
+            <span>
+              <span style="text-decoration:underline;">{{ real_num }}</span> /
+              <span style="text-decoration:underline">{{ meter }}</span>
+            </span>
+          </div>
+        </el-col>
+
+        <el-col :span="3">
+          <el-button
+            type="primary"
+            size="mini"
+            icon="el-icon-document-remove"
+            style="margin-left:20px;"
+          >棰勬帓
+            <!--            @click="click_schedule"-->
+
+          </el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            icon="el-icon-document-checked"
+          >鎻愪氦
+            <!--            @click="click_yes"-->
+
+          </el-button>
+          <p />
+        </el-col>
+      </el-row>
+      <el-row />
+    </el-tabs>
+    <div class="container">
+      <v-gantt-chart
+        :start-time="time_data[0]"
+        :end-time="time_data[1]"
+        :cell-width="cellWidth"
+        :cell-height="cellHeight"
+        :time-lines="timeLines"
+        :title-height="titleHeight"
+        :scale="scale"
+        :title-width="titleWidth"
+        show-current-time
+        :hide-header="hideHeader"
+        :data-key="dataKey"
+        :array-keys="arrayKeys"
+        :scroll-to-postion="positionA"
+        :datas="bm_data"
+      >
+        <!--        @scrollLeft="scrollLeftA"-->
+
+        <template slot="block" slot-scope="{data,item}">
+          <Test
+            :data="data"
+            :update-time-lines="updateTimeLines"
+            :cell-height="cellHeight"
+            :current-time="currentTime"
+            :item="item"
+          />
+        </template>
+        <template slot="left" slot-scope="{data}">
+          <div class="name">
+            <div class="carId">
+              <el-checkbox
+                v-model="data.status"
+                style="margin-right:5px;"
+              />
+              <!--              @change="click_box(data)"-->
+
+              {{ data.id }} {{ data.name }}
+            </div>
+            <div class="speed">
+              <el-tooltip class="item" effect="dark" content="鏌ョ湅" placement="top">
+                <el-button type="text" size="mini">
+                  <!--                  @click="look(data)"-->
+                  <i class="el-icon-document size i-color" />
+                </el-button>
+              </el-tooltip>
+            </div>
+          </div>
+        </template>
+        <template slot="title">
+          <span class="tc">宸ヤ綅鍒楄〃</span>
+
+          <el-checkbox v-model="all_status" class="box_style" @change="changeLift()" />
+          <input v-model.number="cellWidth" type="range" min="20" max="100" class="box_styles">
+        </template>
+      </v-gantt-chart>
+    </div>
+  </div>
+</template>
 
 <script>
+import dayjs from 'dayjs'
+import { mockDatas } from '@/views/sbgl/index1'
+
 export default {
-  name: 'Byjl'
+  name: 'Byjl',
+  data() {
+    return {
+      show: true,
+      pickerOptions1: {
+        disabledDate(time) {
+          return time.getTime() <= Date.now() - 24 * 60 * 60 * 1000
+        }
+      },
+      real_num: 0,
+      keep_data: [],
+      all_status: true,
+      look_data: [],
+      look_total: 0,
+      cl_name: '',
+      cl_code: '',
+      work_order: '',
+      false_arr: [],
+      ckeckVal: true,
+      AdvaScheUom: '',
+      list: [],
+      form: {
+        WorkShop: '',
+        PartNumber: '',
+        PartName: '',
+        rows: 10,
+        page: 1
+      },
+      showDialog: false,
+      time_data: [],
+      forms: {
+        WorkCode: '',
+        WorkShop: '',
+        PartNumber: '',
+        BotProceCode: '',
+        StartTime: '',
+        EndTime: ''
+      },
+      click_one: 0,
+      datasC: [],
+      radio: '',
+      value1: '',
+      types: 'N',
+      no: false,
+      total: 0,
+      mn_data: [],
+      bm_data: [],
+      facility_data: [],
+      end_start: '',
+      timeLines: [
+        {
+          time: dayjs()
+            .add(2, 'hour')
+            .toString()
+        },
+        {
+          time: dayjs()
+            .add(5, 'hour')
+            .toString(),
+          color: '#747e80'
+        }
+      ],
+      formUpdata: {
+        WorkCode: '',
+        BotProceCode: '',
+        json: []
+      },
+      currentTime: dayjs(),
+      startTime: dayjs()
+        .subtract(5, 'hour')
+        .toString(),
+      endTime: dayjs()
+        .add(2, 'day')
+        .add(2, 'hour')
+        .toString(),
+      cellWidth: 50,
+      cellHeight: 30,
+      titleHeight: 40,
+      titleWidth: 250,
+      scale: 60,
+      datasNum: 100,
+      // datasA: [],
+      // datasB: mockDatas(100),
+      dataKey: 'id',
+      times: 0,
+      timeList: timeList,
+      scaleList: scaleList,
+      scrollToTime: dayjs()
+        .add(1, 'day')
+        .toString(),
+      scrollToPostion: { x: 10000, y: 10000 },
+      hideHeader: false,
+      arrayKeys: ['gtArray', 'error'],
+      scrollToY: 0,
+      positionB: {},
+      positionA: {},
+      meter: 0, // 鑺傛媿
+      title_list: [],
+      imp_id: '',
+      submit_flag: false,
+      search_from: {
+        page: 1,
+        rows: 10,
+        WorkTime: '',
+        BotProceName: ''
+      },
+      testValue: {
+        'rus': {
+          'statusCode': '',
+          'message': '',
+          'MOD_S': '',
+          'MAR_S': '',
+          'EQP_S': '',
+          'CUT_S': '',
+          'FIXT_S': '',
+          'HouseNumber': '',
+          'navTabId': '',
+          'dialogid': '',
+          'rel': '',
+          'dt': null,
+          'list': {},
+          'callbackType': '',
+          'forwardUrl': ''
+        },
+        'rows': [
+          {
+            'YearDate': '2022-09-01',
+            'children': [
+              {
+                'AdvaDevicNumber': 'LKFDL_SC-PC029',
+                'AdvaDevicName': '閲戦紟鏁版帶杞﹀簥029',
+                'AdvaDevicCropMob': '78',
+                'AdvaDevicRhythm': '10',
+                'OneStartDate': '08:00~11:30',
+                'TwoStartDate': '12:30~17:00',
+                'ThreeStartDate': '',
+                'FourStartDate': '',
+                'FiveStartDate': ''
+              }
+            ]
+          },
+          {
+            'YearDate': '2022-09-02',
+            'children': [
+              {
+                'AdvaDevicNumber': 'LKFDL_SC-PC029',
+                'AdvaDevicName': '閲戦紟鏁版帶杞﹀簥029',
+                'AdvaDevicCropMob': '78',
+                'AdvaDevicRhythm': '10',
+                'OneStartDate': '08:00~11:30',
+                'TwoStartDate': '12:30~17:00',
+                'ThreeStartDate': '',
+                'FourStartDate': '',
+                'FiveStartDate': ''
+              }
+            ]
+          },
+          {
+            'YearDate': '2022-09-03',
+            'children': [
+              {
+                'AdvaDevicNumber': 'LKFDL_SC-PC029',
+                'AdvaDevicName': '閲戦紟鏁版帶杞﹀簥029',
+                'AdvaDevicCropMob': '78',
+                'AdvaDevicRhythm': '10',
+                'OneStartDate': '08:00~11:30',
+                'TwoStartDate': '12:30~17:00',
+                'ThreeStartDate': '',
+                'FourStartDate': '',
+                'FiveStartDate': ''
+              }
+            ]
+          },
+          {
+            'YearDate': '2022-09-04',
+            'children': [
+              {
+                'AdvaDevicNumber': 'LKFDL_SC-PC029',
+                'AdvaDevicName': '閲戦紟鏁版帶杞﹀簥029',
+                'AdvaDevicCropMob': '78',
+                'AdvaDevicRhythm': '10',
+                'OneStartDate': '08:00~11:30',
+                'TwoStartDate': '12:30~17:00',
+                'ThreeStartDate': '',
+                'FourStartDate': '',
+                'FiveStartDate': ''
+              }
+            ]
+          },
+          {
+            'YearDate': '2022-09-05',
+            'children': [
+              {
+                'AdvaDevicNumber': 'LKFDL_SC-PC029',
+                'AdvaDevicName': '閲戦紟鏁版帶杞﹀簥029',
+                'AdvaDevicCropMob': '78',
+                'AdvaDevicRhythm': '10',
+                'OneStartDate': '08:00~11:30',
+                'TwoStartDate': '12:30~17:00',
+                'ThreeStartDate': '',
+                'FourStartDate': '',
+                'FiveStartDate': ''
+              }
+            ]
+          },
+          {
+            'YearDate': '2022-09-06',
+            'children': [
+              {
+                'AdvaDevicNumber': 'LKFDL_SC-PC029',
+                'AdvaDevicName': '閲戦紟鏁版帶杞﹀簥029',
+                'AdvaDevicCropMob': '78',
+                'AdvaDevicRhythm': '10',
+                'OneStartDate': '08:00~11:30',
+                'TwoStartDate': '12:30~17:00',
+                'ThreeStartDate': '',
+                'FourStartDate': '',
+                'FiveStartDate': ''
+              }
+            ]
+          }
+        ],
+        'Cont': null
+      }
+    }
+  },
+  mounted() {
+    this.OnclickAdvancedSchedulingDevice()
+  },
+  methods: {
+    OnclickAdvancedSchedulingDevice() {
+      this.facility_top()
+
+      // automaticScheduling
+      //   .OnclickAdvancedSchedulingDevice(this.forms)
+      //   .then(res => {
+      const res = this.testValue
+      // if (res.rus.message) {
+      //   this.$message({
+      //     showClose: true,
+      //     type: 'error',
+      //     message: res.rus.message
+      //   })
+      // }
+      this.submit_flag = false
+      const list = []
+      this.time_all = res
+      const cont = res.Cont
+      this.real_num = 0
+      for (const i in this.time_all.rows[0].children) {
+        const obj = {
+          id: '',
+          name: '',
+          AdvaDevicRhythm: '',
+          status: true,
+          colorPair: {
+            dark: 'rgb(83, 186, 241,0.8)',
+            light: 'rgb(83, 186, 241,0.1)',
+            light_capacity: 'rgb(209,239,237,0.8)',
+            h_schedule: ' rgb(100,255,192,0.8)',
+            scheduleing: 'rgb(20,182,231,0.8)'
+          },
+          gtArray: []
+        }
+        obj.id = this.time_all.rows[0].children[i].AdvaDevicNumber
+        obj.name = this.time_all.rows[0].children[i].AdvaDevicName
+        obj.AdvaDevicRhythm = this.time_all.rows[0].children[
+          i
+        ].AdvaDevicRhythm
+        list.push(obj)
+      }
+      console.log(list, 1)
+      for (const i in this.time_all.rows) {
+        for (const j in this.time_all.rows[i].children) {
+          if (this.time_all.rows[i].children[j].OneStartDate != '') {
+            this.time_all.rows[i].children[
+              j
+            ].OneStartDate = this.time_all.rows[i].children[
+              j
+            ].OneStartDate.split('~')
+            this.time_all.rows[i].children[j].OneStartDate[0] =
+              this.time_all.rows[i].YearDate +
+              ' ' +
+              this.time_all.rows[i].children[j].OneStartDate[0]
+            this.time_all.rows[i].children[j].OneStartDate[1] =
+              this.time_all.rows[i].YearDate +
+              ' ' +
+              this.time_all.rows[i].children[j].OneStartDate[1]
+          }
+          if (this.time_all.rows[i].children[j].TwoStartDate != '') {
+            this.time_all.rows[i].children[
+              j
+            ].TwoStartDate = this.time_all.rows[i].children[
+              j
+            ].TwoStartDate.split('~')
+            this.time_all.rows[i].children[j].TwoStartDate[0] =
+              this.time_all.rows[i].YearDate +
+              ' ' +
+              this.time_all.rows[i].children[j].TwoStartDate[0]
+            this.time_all.rows[i].children[j].TwoStartDate[1] =
+              this.time_all.rows[i].YearDate +
+              ' ' +
+              this.time_all.rows[i].children[j].TwoStartDate[1]
+          }
+          if (this.time_all.rows[i].children[j].ThreeStartDate != '') {
+            this.time_all.rows[i].children[
+              j
+            ].ThreeStartDate = this.time_all.rows[i].children[
+              j
+            ].ThreeStartDate.split('~')
+            this.time_all.rows[i].children[j].ThreeStartDate[0] =
+              this.time_all.rows[i].YearDate +
+              ' ' +
+              this.time_all.rows[i].children[j].ThreeStartDate[0]
+            this.time_all.rows[i].children[j].ThreeStartDate[1] =
+              this.time_all.rows[i].YearDate +
+              ' ' +
+              this.time_all.rows[i].children[j].ThreeStartDate[1]
+          }
+          if (this.time_all.rows[i].children[j].FourStartDate != '') {
+            this.time_all.rows[i].children[
+              j
+            ].FourStartDate = this.time_all.rows[i].children[
+              j
+            ].FourStartDate.split('~')
+            this.time_all.rows[i].children[j].FourStartDate[0] =
+              this.time_all.rows[i].YearDate +
+              ' ' +
+              this.time_all.rows[i].children[j].FourStartDate[0]
+            this.time_all.rows[i].children[j].FourStartDate[1] =
+              this.time_all.rows[i].YearDate +
+              ' ' +
+              this.time_all.rows[i].children[j].FourStartDate[1]
+          }
+          if (this.time_all.rows[i].children[j].FiveStartDate != '') {
+            this.time_all.rows[i].children[
+              j
+            ].FiveStartDate = this.time_all.rows[i].children[
+              j
+            ].FiveStartDate.split('~')
+            this.time_all.rows[i].children[j].FiveStartDate[0] =
+              this.time_all.rows[i].YearDate +
+              ' ' +
+              this.time_all.rows[i].children[j].FiveStartDate[0]
+            this.time_all.rows[i].children[j].FiveStartDate[1] =
+              this.time_all.rows[i].YearDate +
+              ' ' +
+              this.time_all.rows[i].children[j].FiveStartDate[1]
+          }
+        }
+      }
+      // 缁勫悎鏂扮殑缁撴瀯
+      const newList = []
+      for (const i in this.time_all.rows) {
+        for (const j in this.time_all.rows[i].children) {
+          if (this.time_all.rows[i].children[j].OneStartDate != '') {
+            const data1 = {
+              id: '',
+              start: '',
+              end: '',
+              mod: ''
+            }
+            data1.id = this.time_all.rows[i].children[j].AdvaDevicNumber
+            data1.start = this.time_all.rows[i].children[j].OneStartDate[0]
+            data1.end = this.time_all.rows[i].children[j].OneStartDate[1]
+            data1.mod =
+              (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) /
+              100
+            newList.push(data1)
+          }
+          if (this.time_all.rows[i].children[j].TwoStartDate != '') {
+            const data2 = {
+              id: '',
+              start: '',
+              end: '',
+              mod: ''
+            }
+            data2.id = this.time_all.rows[i].children[j].AdvaDevicNumber
+            data2.start = this.time_all.rows[i].children[j].TwoStartDate[0]
+            data2.end = this.time_all.rows[i].children[j].TwoStartDate[1]
+            data2.mod =
+              (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) /
+              100
+            newList.push(data2)
+          }
+          if (this.time_all.rows[i].children[j].ThreeStartDate != '') {
+            const data3 = {
+              id: '',
+              start: '',
+              end: '',
+              mod: ''
+            }
+            data3.id = this.time_all.rows[i].children[j].AdvaDevicNumber
+            data3.start = this.time_all.rows[i].children[
+              j
+            ].ThreeStartDate[0]
+            data3.end = this.time_all.rows[i].children[j].ThreeStartDate[1]
+            data3.mod =
+              (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) /
+              100
+            newList.push(data3)
+          }
+          if (this.time_all.rows[i].children[j].FourStartDate != '') {
+            const data4 = {
+              id: '',
+              start: '',
+              end: '',
+              mod: ''
+            }
+            data4.id = this.time_all.rows[i].children[j].AdvaDevicNumber
+            data4.start = this.time_all.rows[i].children[
+              j
+            ].FourStartDate[0]
+            data4.end = this.time_all.rows[i].children[j].FourStartDate[1]
+            data4.mod =
+              (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) /
+              100
+            newList.push(data4)
+          }
+          if (this.time_all.rows[i].children[j].FiveStartDate != '') {
+            const data5 = {
+              id: '',
+              start: '',
+              end: '',
+              mod: ''
+            }
+            data5.id = this.time_all.rows[i].children[j].AdvaDevicNumber
+            data5.start = this.time_all.rows[i].children[
+              j
+            ].FiveStartDate[0]
+            data5.end = this.time_all.rows[i].children[j].FiveStartDate[1]
+            data5.mod =
+              (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) /
+              100
+            newList.push(data5)
+          }
+        }
+      }
+      for (const i in list) {
+        this.pushTiem(newList, list[i].id, list[i].gtArray)
+      }
+      this.bm_data = list
+      const _this = this
+      if (cont != '') {
+        for (const i in cont) {
+          for (const j in this.bm_data) {
+            if (this.bm_data[j].id == cont[i].EQP_CODE) {
+              const data = {
+                id: cont[i].EQP_CODE,
+                number: cont[i].ALLOC_QTY,
+                cl_name: cont[i].PART_NAME,
+                cl_code: this.cl_code,
+                work_order: cont[i].WO_CODE,
+                STATUS: _this.AdvaScheUom,
+                start: cont[i].TIME_START,
+                end: cont[i].TIME_END,
+                type: cont[i].STATUS == 'S' ? 'h_schedule' : 'bm_schedule'
+              }
+
+              this.bm_data[j].flag = 'isCont'
+
+              this.bm_data[j].gtArray.unshift(data)
+            }
+          }
+        }
+      }
+
+      if (this.false_arr != '') {
+        for (const j in this.bm_data) {
+          if (this.false_arr.indexOf(this.bm_data[j].id) >= 0) {
+            this.bm_data[j].gtArray = []
+            this.bm_data[j].status = false
+          }
+        }
+      }
+      // })
+    },
+    // 璁惧浼樺厛
+    facility_top() {
+      // automaticScheduling
+      //   .OnclickAdvancedSchedulingDevice(this.forms)
+      //   .then(res => {
+      const res = this.testValue
+      this.show = true
+      const data = res.rows
+      const cont = res.Cont
+      this.title_list = []
+      for (const i in data[0].children) {
+        const obj = {
+          id: '',
+          name: '',
+          status: true,
+          AdvaDevicRhythm: '',
+          // mod:'',
+          colorPair: {
+            dark: 'rgb(83, 186, 241,0.8)',
+            light: 'rgb(83, 186, 241,0.1)',
+            light_capacity: 'rgb(209,239,237,0.8)',
+            h_schedule: ' rgb(100,255,192,0.8)',
+            scheduleing: 'rgb(20,182,231,0.8)'
+          },
+          gtArray: []
+        }
+        obj.id = data[0].children[i].AdvaDevicNumber
+        obj.name = data[0].children[i].AdvaDevicName
+        obj.AdvaDevicRhythm = data[0].children[i].AdvaDevicRhythm
+        // obj.mod =data[0].children[i].AdvaDevicCropMob *1
+
+        this.title_list.push(obj)
+      }
+      for (const i in data) {
+        for (const j in data[i].children) {
+          if (data[i].children[j].OneStartDate != '') {
+            data[i].children[j].OneStartDate = data[i].children[
+              j
+            ].OneStartDate.split('~')
+            data[i].children[j].OneStartDate[0] =
+              data[i].YearDate + ' ' + data[i].children[j].OneStartDate[0]
+            data[i].children[j].OneStartDate[1] =
+              data[i].YearDate + ' ' + data[i].children[j].OneStartDate[1]
+          }
+          if (data[i].children[j].TwoStartDate != '') {
+            data[i].children[j].TwoStartDate = data[i].children[
+              j
+            ].TwoStartDate.split('~')
+            data[i].children[j].TwoStartDate[0] =
+              data[i].YearDate + ' ' + data[i].children[j].TwoStartDate[0]
+            data[i].children[j].TwoStartDate[1] =
+              data[i].YearDate + ' ' + data[i].children[j].TwoStartDate[1]
+          }
+          if (data[i].children[j].ThreeStartDate != '') {
+            data[i].children[j].ThreeStartDate = data[i].children[
+              j
+            ].ThreeStartDate.split('~')
+            data[i].children[j].ThreeStartDate[0] =
+              data[i].YearDate +
+              ' ' +
+              data[i].children[j].ThreeStartDate[0]
+            data[i].children[j].ThreeStartDate[1] =
+              data[i].YearDate +
+              ' ' +
+              data[i].children[j].ThreeStartDate[1]
+          }
+          if (data[i].children[j].FourStartDate != '') {
+            data[i].children[j].FourStartDate = data[i].children[
+              j
+            ].FourStartDate.split('~')
+            data[i].children[j].FourStartDate[0] =
+              data[i].YearDate + ' ' + data[i].children[j].FourStartDate[0]
+            data[i].children[j].FourStartDate[1] =
+              data[i].YearDate + ' ' + data[i].children[j].FourStartDate[1]
+          }
+          if (data[i].children[j].FiveStartDate != '') {
+            data[i].children[j].FiveStartDate = data[i].children[
+              j
+            ].FiveStartDate.split('~')
+            data[i].children[j].FiveStartDate[0] =
+              data[i].YearDate + ' ' + data[i].children[j].FiveStartDate[0]
+            data[i].children[j].FiveStartDate[1] =
+              data[i].YearDate + ' ' + data[i].children[j].FiveStartDate[1]
+          }
+        }
+      }
+      // 鏇存敼鏍煎紡
+      this.facility_data = []
+
+      for (const i in data) {
+        const time = {
+          date: data[i].YearDate,
+          AdvaDevicRhythm: '',
+          gtArray: []
+        }
+        if (data[i].children != '') {
+          time.AdvaDevicRhythm = data[i].children[0].AdvaDevicRhythm
+        }
+        for (const j in data[i].children) {
+          if (data[i].children[j].OneStartDate != '') {
+            const icu1 = {
+              name: data[i].children[j].AdvaDevicName,
+              id: data[i].children[j].AdvaDevicNumber,
+              type: 'capacity',
+              rhythm: data[i].children[j].AdvaDevicRhythm,
+              start: data[i].children[j].OneStartDate[0],
+              end: data[i].children[j].OneStartDate[1],
+              mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100
+            }
+            time.gtArray.push(icu1)
+          }
+          if (data[i].children[j].TwoStartDate != '') {
+            const icu2 = {
+              name: data[i].children[j].AdvaDevicName,
+              id: data[i].children[j].AdvaDevicNumber,
+              type: 'capacity',
+              rhythm: data[i].children[j].AdvaDevicRhythm,
+              start: data[i].children[j].TwoStartDate[0],
+              end: data[i].children[j].TwoStartDate[1],
+              mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100
+            }
+            time.gtArray.push(icu2)
+          }
+          if (data[i].children[j].ThreeStartDate != '') {
+            const icu3 = {
+              name: data[i].children[j].AdvaDevicName,
+              id: data[i].children[j].AdvaDevicNumber,
+              type: 'capacity',
+              rhythm: data[i].children[j].AdvaDevicRhythm,
+              start: data[i].children[j].ThreeStartDate[0],
+              end: data[i].children[j].ThreeStartDate[1],
+              mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100
+            }
+            time.gtArray.push(icu3)
+          }
+          if (data[i].children[j].FourStartDate != '') {
+            const icu4 = {
+              name: data[i].children[j].AdvaDevicName,
+              id: data[i].children[j].AdvaDevicNumber,
+              type: 'capacity',
+              rhythm: data[i].children[j].AdvaDevicRhythm,
+              start: data[i].children[j].FourStartDate[0],
+              end: data[i].children[j].FourStartDate[1],
+              mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100
+            }
+            time.gtArray.push(icu4)
+          }
+          if (data[i].children[j].FiveStartDate != '') {
+            const icu5 = {
+              name: data[i].children[j].AdvaDevicName,
+              id: data[i].children[j].AdvaDevicNumber,
+              type: 'capacity',
+              rhythm: data[i].children[j].AdvaDevicRhythm,
+              start: data[i].children[j].FiveStartDate[0],
+              end: data[i].children[j].FiveStartDate[1],
+              mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100
+            }
+            time.gtArray.push(icu5)
+          }
+        }
+
+        this.facility_data.push(time)
+      }
+
+      if (cont != '') {
+        for (const i in cont) {
+          const date_time = cont[i].TIME_START.split(' ')
+          const cont_date = date_time[0]
+          for (const j in this.facility_data) {
+            const data = {
+              id: cont[i].EQP_CODE,
+              date: cont_date,
+              number: cont[i].ALLOC_QTY,
+              cl_name: cont[i].PART_NAME,
+              cl_code: this.cl_code,
+              work_order: cont[i].WO_CODE,
+              start: cont[i].TIME_START,
+              end: cont[i].TIME_END,
+              type: 'h_schedule'
+            }
+            if (this.facility_data[j].date == data.date) {
+              this.facility_data[j].gtArray.unshift(data)
+            }
+          }
+        }
+      }
+      //   })
+    },
+    updateTimeLines() {
+
+    }
+  }
 }
 </script>
 

--
Gitblit v1.9.3