From 15a02d49c86110a9907420526d08eb3db7b550bc Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 29 三月 2023 11:22:32 +0800
Subject: [PATCH] 1.工单菜单 工单编号自动生成
---
src/views/produceManager/AutoScheduling_back2.vue | 2075 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/views/purchasesManager/purchasesList.vue | 8
src/api/produceManager.js | 8
src/views/produceManager/workOrder.vue | 7
4 files changed, 2,095 insertions(+), 3 deletions(-)
diff --git a/src/api/produceManager.js b/src/api/produceManager.js
index 723508f..24217ca 100644
--- a/src/api/produceManager.js
+++ b/src/api/produceManager.js
@@ -392,3 +392,11 @@
params: data
})
}
+
+// MES宸ュ崟鏂板銆佽幏鍙栧伐鍗曞彿
+export function AddMesOrderCodeSearch() {
+ return request({
+ url: 'ProductionManagement/AddMesOrderCodeSearch',
+ method: 'post'
+ })
+}
diff --git a/src/views/produceManager/AutoScheduling_back2.vue b/src/views/produceManager/AutoScheduling_back2.vue
new file mode 100644
index 0000000..e1d4575
--- /dev/null
+++ b/src/views/produceManager/AutoScheduling_back2.vue
@@ -0,0 +1,2075 @@
+<template>
+ <div>
+ <div class="body" :style="{height:mainHeight+'px'}">
+
+ <div class="bodyTopFormGroup" style="margin-top: 10px;padding-top: 10px">
+ <el-form
+ ref="form"
+ :model="formTop"
+ label-width="100px"
+ inline
+ style="display: flex;"
+ >
+ <div class="elForm">
+ <el-form-item label="杞﹂棿缂栫爜" style=" display: flex;">
+ <el-input v-model="formTop.workshop" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="鐢熶骇宸ュ崟鍙�" style=" display: flex;">
+ <el-input v-model="formTop.wocode" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="鐗╂枡缂栫爜" style=" display: flex;">
+ <el-input v-model="formTop.partcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="鐗╂枡鍚嶇О" style=" display: flex;">
+ <el-input v-model="formTop.partname" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ </div>
+ <div
+ class="bodySearchReset"
+ :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
+ >
+ <el-button v-waves type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
+ <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+ </div>
+ </el-form>
+ <div
+ class="bodyTopFormExpand"
+ style="height: 5px"
+ />
+ </div>
+
+ <div class="elTableDiv" style="margin-top: 0">
+ <el-table
+ ref="tableDataRef"
+ class="tableFixed"
+ :data="tableData"
+ :height="(tableHeight-400)+'px'"
+ border
+ :row-class-name="tableRowClassName"
+ :style="{width: 100+'%',height:(tableHeight-400)+'px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ @sort-change="sortChangeTop"
+ @select="handleSelect"
+ @selection-change="handleSelectionChange"
+ >
+ <!-- @row-click="getCurrentRow"-->
+
+ <!-- @selection-change="handleSelectionChange"-->
+
+ <!-- <el-table-column-->
+ <!-- width="50"-->
+ <!-- fixed-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <el-radio-->
+ <!-- v-model="radioSelectedId"-->
+ <!-- :label="row.AdvaScheId"-->
+ <!-- />-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <el-table-column
+ type="selection"
+ width="55"
+ />
+ <el-table-column
+ prop="RowNum"
+ width="50"
+ fixed
+ label="搴忓彿"
+ />
+ <el-table-column
+ prop="AdvaSchePiroQue"
+ show-tooltip-when-overflow
+ label="浼樺厛绾�"
+ width="90"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="AdvaScheWorkShop"
+ label="鐢熶骇杞﹂棿"
+ width="110"
+ show-tooltip-when-overflow
+ sortable="custom"
+ />
+ <el-table-column
+ prop="AdvaScheWorkCode"
+ label="宸ュ崟缂栧彿"
+ min-width="160"
+ show-tooltip-when-overflow
+ sortable="custom"
+ />
+ <el-table-column
+ prop="AdvaSchePartNumber"
+ label="浜у搧缂栫爜"
+ min-width="110"
+ show-tooltip-when-overflow
+ sortable="custom"
+ >
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.AdvaSchePartNumber">{{ row.AdvaSchePartNumber }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ </el-table-column>
+ <el-table-column
+ prop="AdvaSchePartName"
+ min-width="160"
+ show-tooltip-when-overflow
+ label="浜у搧鍚嶇О"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="AdvaSchePartSpec"
+ label="浜у搧瑙勬牸"
+ width="110"
+ show-tooltip-when-overflow
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.AdvaSchePartSpec">{{ row.AdvaSchePartSpec }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="AdvaScheQty"
+ label="鏁伴噺"
+ show-tooltip-when-overflow
+ width="110"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="AdvaScheEndDate"
+ label="瑕佹眰浜や粯鏃堕棿"
+ sortable="custom"
+ show-tooltip-when-overflow
+ width="160"
+ />
+ <el-table-column
+ prop="AdvaScheStus"
+ label="鎺掔▼鐘舵��"
+ show-tooltip-when-overflow
+ width="110"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.AdvaScheStus==='NOSCHED'">寰呮帓绋�</div>
+ <div v-if="row.AdvaScheStus==='SCHED'">宸叉帓绋�</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="AdvaScheBotProcName"
+ label="鎺掔▼宸ュ簭"
+ show-tooltip-when-overflow
+ width="110"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="AdvaSchePCStartDate"
+ label="璁″垝鎺掔▼鏃堕棿"
+ width="200"
+ sortable="custom"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.AdvaSchePCStartDate">{{ row.AdvaSchePCStartDate }} ~ {{ row.AdvaSchePCEndDate }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+
+ </el-table>
+ </div>
+ <!--鍒嗛〉-->
+ <pagination
+ :total="totalTop"
+ :page.sync="formTop.page"
+ :limit.sync="formTop.rows"
+ align="right"
+ layout="total,prev, pager, next,sizes"
+ popper-class="select_bottom"
+ @pagination="getAdvancedSchedulingSearch"
+ />
+
+ <!-- 鑷姩鎺掔▼閮ㄥ垎鐨勪唬鐮�-->
+ <div class="autoScheduling">
+
+ <div class="bodyTopFormGroup">
+ <el-form
+ ref="form"
+ :model="formBottom"
+ inline
+ label-width="100px"
+ style="display: flex;"
+ >
+ <div class="elForm">
+ <el-form-item label="鎺掔▼鏃ユ湡" style=" display: flex;">
+ <el-date-picker
+ v-model="formBottom.scheDate"
+ :disabled="radioSelectedId===''"
+ type="daterange"
+ range-separator="~"
+ format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ size="small"
+ :picker-options="pickerOptions1"
+ :clearable="false"
+ @change="dateChange"
+ />
+ </el-form-item>
+ <el-form-item label="鎺掔▼鏂瑰紡" style=" display: flex;">
+ <el-select
+ v-model="formBottom.types"
+ :disabled="radioSelectedId===''"
+ style="width:120px"
+ @change="typesChange"
+ >
+ <el-option value="N" label="璁惧浼樺厛" />
+ <el-option value="Y" label="鏃堕棿浼樺厛" />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鏃堕棿鍒诲害(鍒嗛挓)" label-width="110" style=" display: flex;">
+ <el-select v-model.number="formBottom.scale" :disabled="radioSelectedId===''" style="width: 120px;">
+ <el-option v-for="item in scaleList" :key="item" :value="item" :label="item" />
+ </el-select>
+
+ </el-form-item>
+ <el-form-item label="鎹㈠瀷鏃堕棿(鍒嗛挓)" label-width="110" style=" display: flex;">
+ <el-input
+ id="scale"
+ v-model="formBottom.times"
+ :disabled="radioSelectedId===''"
+ type="number"
+ style="display:inline-block;width:80px;"
+ @change="no_zero"
+ />
+ </el-form-item>
+ <el-form-item label="棰勬帓杩涘害" style=" display: flex;">
+ <span>
+ <span style="text-decoration:underline;">{{ formBottom.canArrangeNumber }}</span> /
+ <span style="text-decoration:underline">{{ formBottom.needArrangeNumber }}</span>
+ </span>
+ </el-form-item>
+ </div>
+ <div
+ class="bodySearchReset"
+ :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
+ >
+ <el-button
+ v-waves
+ :disabled="radioSelectedId===''"
+ type="primary"
+ icon="el-icon-document-remove"
+ @click="prepareArrange"
+ >棰勬帓
+ </el-button>
+ <el-button
+ v-waves
+ type="primary"
+ :disabled="radioSelectedId===''"
+ icon="el-icon-document-checked"
+ @click="prepareSubmit"
+ >鎻愪氦
+ </el-button>
+ </div>
+ </el-form>
+ <div class="colorDescription">
+ <div class="colorDescriptionItem"><i
+ class="el-icon-s-opportunity"
+ style="margin-right: 5px;color: rgba(5, 185, 100, 0.5)"
+ />浜ц兘
+ </div>
+ <div class="colorDescriptionItem"><i
+ class="el-icon-s-opportunity"
+ style="margin-right: 5px;color: rgba(5, 185, 100, 1)"
+ />宸叉帓
+ </div>
+ <div class="colorDescriptionItem"><i
+ class="el-icon-s-opportunity"
+ style="margin-right: 5px;color:rgba(128,0,128,0.7)"
+ />棰勬帓
+ </div>
+ <!-- <div class="colorDescriptionItem"><i class="el-icon-s-opportunity" style="margin-right: 5px;color: #a7a7a7" />澶辨晥浜ц兘</div>-->
+ </div>
+ <div
+ class="bodyTopFormExpand"
+ style="height: 5px"
+ />
+ </div>
+
+ <div class="container" style="margin: 10px;">
+ <v-gantt-chart
+ :start-time="time_data[0]"
+ :end-time="time_data[1]"
+ :cell-width="cellWidth"
+ :cell-height="cellHeight"
+ :title-height="titleHeight"
+ :scale="formBottom.scale"
+ :title-width="titleWidth"
+ show-current-time
+ :hide-header="hideHeader"
+ :data-key="dataKey"
+ :array-keys="arrayKeys"
+
+ :datas="schedulingData"
+ >
+ <!-- 鏆傛椂鐢ㄤ笉鍒�-->
+ <!-- :time-lines="timeLines"-->
+ <!-- @scrollLeft="scrollLeftA"-->
+ <!-- :scroll-to-postion="positionA"-->
+ <template slot="block" slot-scope="{data,item}">
+ <Scheduling
+ :data="data"
+ :cell-height="cellHeight"
+ :item="item"
+ />
+ <!-- 鏆傛椂鐢ㄤ笉鍒�-->
+ <!-- :update-time-lines="updateTimeLines"-->
+ <!-- :current-time="currentTime"-->
+ </template>
+ <template slot="left" slot-scope="{data}">
+ <div class="name">
+ <div class="carId">
+ <el-checkbox
+ v-model="data.status"
+ style="margin-right:5px;"
+ @change="checkboxSingle(data)"
+ />
+ {{ data.id }} {{ data.name }}
+ </div>
+ <div class="speed">
+ <!-- <el-tooltip class="item" effect="dark" content="鏌ョ湅" placement="top">-->
+ <!-- <el-button v-waves 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="ganttCheckboxAll"
+ class="box_style"
+ :disabled="radioSelectedId===''"
+ @change="checkboxAll()"
+ />
+ <input
+ v-model.number="cellWidth"
+ type="range"
+ min="20"
+ max="100"
+ class="box_styles"
+ :disabled="radioSelectedId===''"
+ >
+ </template>
+ </v-gantt-chart>
+ </div>
+ </div>
+
+ </div>
+
+ </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+import Scheduling from '@/components/Scheduling'
+import dayjs from 'dayjs'
+import {
+ AdvancedSchedulingSearch,
+ OnclickAdvancedSchedulingDevice,
+ SubmitAlreadyScheduling
+} from '@/api/produceManager'
+import { handleDatetime, handleDatetime2 } from '@/utils/global'
+import waves from '@/directive/waves'
+
+export default {
+ name: 'Zzjg',
+ components: {
+ Pagination, Scheduling
+ },
+ directives: { waves },
+ data() {
+ return {
+ mouseHoverType: 'mouseout',
+ isExpandForm: false,
+ mainHeight: 0,
+ tableHeight: 0,
+ radioSelectedId: '', // 琛ㄥ崟鍗曢�夋
+ formTop: {
+ workshop: '', // 杞﹂棿缂栫爜
+ wocode: '', // 鐢熶骇宸ュ崟鍙�
+ partcode: '', // 鐗╂枡缂栫爜
+ partname: '', // 鐗╂枡鍚嶇О
+ prop: 'AdvaScheWorkCode', // 鎺掑簭瀛楁
+ order: 'desc', // 鎺掑簭瀛楁
+ page: 1, // 绗嚑椤�
+ rows: 20 // 姣忛〉澶氬皯鏉�
+ },
+ totalTop: 10,
+ tableData: [],
+ multipleSelection: [],
+ /*
+ 鎺掔▼閮ㄥ垎鐨勫睘鎬�
+ * */
+ show: false,
+ pickerOptions1: {
+ disabledDate(time) {
+ return time.getTime() <= Date.now() - 24 * 60 * 60 * 1000
+ }
+ },
+
+ ganttCheckboxAll: true, // 鐢樼壒鍥惧乏渚у閫夋鏄惁閫変腑鎴栬�呭彇娑�
+ ganttLeftArrId: [], // 鐢樼壒鍥惧乏渚х殑鏁扮粍id
+ cl_name: '', // 浜у搧鍚嶇О
+ cl_code: '', // 浜у搧缂栫爜
+ work_order: '', // 宸ュ崟缂栧彿
+ AdvaScheUom: '', // 浜у搧鍗曚綅
+ time_data: [[handleDatetime(new Date()) + ' 00:00:00'], [handleDatetime(new Date()) + ' 00:00:00']], // 鐢樼壒鍥惧垵濮嬫覆鏌撶殑鏃堕棿鑼冨洿
+ forms: { // 鐐瑰嚮琛岃幏鍙栦俊鎭� 璇锋眰鎺ュ彛 鐨勬暟鎹璞�
+ wocode: '', // 宸ュ崟缂栧彿
+ wkshpcode: '', // 杞﹂棿缂栫爜
+ partcode: '', // 鐗╂枡缂栫爜
+ botproccode: '', // 鐡堕宸ュ簭缂栫爜(棣栭亾宸ュ簭)
+ startdate: '', // 寮�濮嬫棩鏈�
+ enddate: ''// 缁撴潫鏃ユ湡
+ },
+ formBottom: { // 搴曢儴琛ㄥ崟鐨� 鏁版嵁瀵硅薄
+ scheDate: [handleDatetime(new Date()), handleDatetime(new Date())], // 鎺掔▼鏃ユ湡
+ types: 'N', // 鎺掔▼鏂瑰紡
+ scale: 60, // 鏃堕棿鍒诲害
+ times: 0, // 鎹㈠瀷鏃堕棿
+ canArrangeNumber: 0, // 鍙帓鏁伴噺
+ needArrangeNumber: 0// 闇�鎺掓暟閲�
+ },
+ schedulingData: [], // 鎺掔▼鐨勬渶缁堟暟鎹�
+ timeTopTempData: [], // 鏃堕棿浼樺厛鐨勪复鏃舵暟鎹�
+ eqpTopTempData: [], // 璁惧浼樺厛鐨勪复鏃舵暟鎹�
+
+ formUpdate: {
+ WorkCode: '',
+ BotProceCode: '',
+ json: []
+ },
+ // currentTime: dayjs(),
+ cellWidth: 50,
+ cellHeight: 30,
+ titleHeight: 40,
+ titleWidth: 250,
+ dataKey: 'id',
+ // timeList: `0,30,60,120,240,480`.split(',').map(n => parseInt(n)),
+ scaleList: `30,60,240,360`.split(',').map(n => parseInt(n)),
+ hideHeader: false,
+ arrayKeys: ['gtArray', 'error'],
+
+ rowCheckBoxValue: {}// 鐐瑰嚮checkbox妗� 閫変腑鐨勫唴瀹�
+
+ }
+ },
+
+ created() {
+ const loading = this.$loading({
+ lock: true,
+ text: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ spinner: 'el-icon-loading',
+ customClass: 'osloading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+ setTimeout(() => {
+ if (this.getAdvancedSchedulingSearch()) {
+ loading.close()
+ }
+ }, 3000)
+
+ // this.getAdvancedSchedulingSearch()
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+ },
+ methods: {
+ async getAdvancedSchedulingSearch() {
+ const res = await AdvancedSchedulingSearch(this.formTop)
+ this.tableData = res.data
+ this.totalTop = res.count
+
+ return true
+ },
+ // 鎺掑簭鏀瑰彉鏃�
+ sortChangeTop({ column, prop, order }) {
+ if (order === 'descending') {
+ order = 'desc'
+ } else if (order === 'ascending') {
+ order = 'asc'
+ } else {
+ order = 'desc'
+ }
+ this.formTop.order = order
+ this.formTop.prop = prop
+ this.getAdvancedSchedulingSearch()
+ },
+ // 鏌ヨ
+ search() {
+ this.getAdvancedSchedulingSearch()
+ },
+ // 閲嶇疆
+ reset() {
+ this.formTop.workshop = ''
+ this.formTop.wocode = ''
+ this.formTop.partcode = ''
+ this.formTop.partname = ''
+ this.getAdvancedSchedulingSearch()
+
+ this.schedulingData = [] // 鎺掔▼鏁版嵁缃┖
+ },
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 255
+ this.$refs.tableDataRef.doLayout()
+ })
+ },
+ tableRowClassName({ row, rowIndex }) {
+ return 'custom-row'
+ },
+ /*
+ 鎺掔▼閮ㄥ垎鐨勬柟娉�
+ */
+ // 纭繚鎹㈠瀷鏃堕棿涓洪潪璐熸暟
+ no_zero() {
+ if (this.formBottom.times < 0) {
+ this.formBottom.times = 0
+ }
+ },
+ // 鎺掔▼鏂瑰紡鏀瑰彉
+ typesChange() {
+ this.getOnclickAdvancedSchedulingDevice()
+ },
+ // 鎺掔▼鏃ユ湡鍊兼敼鍙樻椂
+ dateChange() {
+ this.time_data[0] = this.formBottom.scheDate[0] + ' 00:00'
+ this.time_data[1] = this.formBottom.scheDate[1] + ' 23:59'
+ this.forms.startdate = this.formBottom.scheDate[0]
+ this.forms.enddate = this.formBottom.scheDate[1]
+ this.getOnclickAdvancedSchedulingDevice()
+ },
+ // 宸ヤ綅鍒楄〃澶嶉�夋鎿嶄綔 (鍏ㄩ�夈�佸叏涓嶉��)
+ checkboxAll() {
+ if (this.ganttCheckboxAll) {
+ this.ganttLeftArrId = []
+ this.getOnclickAdvancedSchedulingDevice()
+ } else {
+ for (const i in this.schedulingData) {
+ this.schedulingData[i].status = false
+ this.schedulingData[i].gtArray = []
+ }
+ for (const i in this.timeTopTempData) {
+ this.timeTopTempData[i].gtArray = []
+ }
+ }
+ // this.prepareArrange()
+ },
+ // 鐢樼壒鍥惧乏渚heckbox鍊奸�変腑鎴栬�呭彇娑堟椂
+ checkboxSingle(val) {
+ if (!val.status) {
+ for (const i in this.timeTopTempData) {
+ const new_arr = []
+ for (const j in this.timeTopTempData[i].gtArray) {
+ if (this.timeTopTempData[i].gtArray[j].id === val.id) {
+ } else {
+ new_arr.push(this.timeTopTempData[i].gtArray[j])
+ }
+ }
+ this.timeTopTempData[i].gtArray = new_arr
+ }
+ } else {
+ this.ganttLeftArrId = []
+ for (const i in this.schedulingData) {
+ if (!this.schedulingData[i].status) {
+ this.ganttLeftArrId.push(this.schedulingData[i].id)
+ }
+ }
+ this.getOnclickAdvancedSchedulingDevice()
+ }
+
+ if (!val.status) {
+ for (const i in this.schedulingData) {
+ if (!this.schedulingData[i].status) {
+ this.schedulingData[i].gtArray = []
+ }
+ }
+ } else {
+ this.ganttLeftArrId = []
+ for (const i in this.schedulingData) {
+ if (!this.schedulingData[i].status) {
+ this.ganttLeftArrId.push(this.schedulingData[i].id)
+ }
+ }
+ this.getOnclickAdvancedSchedulingDevice()
+ }
+ for (const i in this.schedulingData) {
+ const arr = []
+ for (const j in this.schedulingData[i].gtArray) {
+ if (this.schedulingData[i].gtArray[j].type !== 'schedule') {
+ arr.push(this.schedulingData[i].gtArray[j])
+ }
+ }
+ this.schedulingData[i].gtArray = arr
+ }
+ this.formBottom.canArrangeNumber = 0
+ // this.prepareArrange()
+ },
+ // 鐐瑰嚮甯﹀嚭鏁版嵁
+ async getOnclickAdvancedSchedulingDevice() {
+ console.log(this.forms, 21)
+ // debugger
+ const res = await OnclickAdvancedSchedulingDevice(this.forms)
+ if (res.rus.Message) {
+ this.$message.error(res.rus.Message)
+ }
+
+ const data = res.rows // 鎷垮埌寰呮帓鏁版嵁 瀵规暟鎹繘琛屾敼閫�
+ const cont = res.Cont // 鎷垮埌宸叉帓鏁版嵁 瀵规暟鎹繘琛屾敼閫�
+
+ this.formBottom.canArrangeNumber = 0
+
+ // 灏嗕簲涓椂闂存杩涜璧嬪��
+ data.forEach(item => {
+ item.children.forEach(it => {
+ if (it.OneStartDate !== '') {
+ it.OneStartDate = it.OneStartDate.split('~')
+ it.OneStartDate[0] = item.YearDate + ' ' + it.OneStartDate[0] + ':00'
+ it.OneStartDate[1] = item.YearDate + ' ' + it.OneStartDate[1] + ':00'
+ }
+
+ if (it.TwoStartDate !== '') {
+ it.TwoStartDate = it.TwoStartDate.split('~')
+ it.TwoStartDate[0] = item.YearDate + ' ' + it.TwoStartDate[0] + ':00'
+ it.TwoStartDate[1] = item.YearDate + ' ' + it.TwoStartDate[1] + ':00'
+ }
+ if (it.ThreeStartDate !== '') {
+ it.ThreeStartDate = it.ThreeStartDate.split('~')
+ it.ThreeStartDate[0] = item.YearDate + ' ' + it.ThreeStartDate[0] + ':00'
+ it.ThreeStartDate[1] = item.YearDate + ' ' + it.ThreeStartDate[1] + ':00'
+ }
+ if (it.FourStartDate !== '') {
+ it.FourStartDate = it.FourStartDate.split('~')
+ it.FourStartDate[0] = item.YearDate + ' ' + it.FourStartDate[0] + ':00'
+ it.FourStartDate[1] = item.YearDate + ' ' + it.FourStartDate[1] + ':00'
+ }
+ if (it.FiveStartDate !== '') {
+ it.FiveStartDate = it.FiveStartDate.split('~')
+ it.FiveStartDate[0] = item.YearDate + ' ' + it.FiveStartDate[0] + ':00'
+ it.FiveStartDate[1] = item.YearDate + ' ' + it.FiveStartDate[1] + ':00'
+ }
+ })
+ })
+
+ // 鏋勫缓 鎸夎澶囦紭鍏堟帓绋嬬殑 鏁版嵁鏍煎紡 schedulingData
+ const list = [] // 涓存椂list 鏆傚瓨
+ data[0].children.forEach(item => {
+ 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 = item.AdvaDevicNumber
+ obj.name = item.AdvaDevicName
+ obj.AdvaDevicRhythm = item.AdvaDevicRhythm
+ list.push(obj)
+ })
+
+ // 缁勫悎鏂扮殑缁撴瀯 娴呯豢鑹茶儗鏅潯
+ const newList = []
+ for (const i in data) {
+ for (const j in data[i].children) {
+ if (data[i].children[j].OneStartDate !== '') {
+ const data1 = {
+ id: '',
+ start: '',
+ end: '',
+ mod: ''
+ }
+ data1.id = data[i].children[j].AdvaDevicNumber
+ data1.start = data[i].children[j].OneStartDate[0]
+ data1.end = data[i].children[j].OneStartDate[1]
+ // AdvaDevicCropMob 绋煎姩鐜� AdvaDevicRhythm 鐢熶骇鑺傛媿
+ data1.mod = (data[i].children[j].AdvaDevicCropMob * 1) / 100 // 绋煎姩鐜�
+ newList.push(data1)
+ }
+ if (data[i].children[j].TwoStartDate !== '') {
+ const data2 = {
+ id: '',
+ start: '',
+ end: '',
+ mod: ''
+ }
+ data2.id = data[i].children[j].AdvaDevicNumber
+ data2.start = data[i].children[j].TwoStartDate[0]
+ data2.end = data[i].children[j].TwoStartDate[1]
+ data2.mod = (data[i].children[j].AdvaDevicCropMob * 1) / 100
+ newList.push(data2)
+ }
+ if (data[i].children[j].ThreeStartDate !== '') {
+ const data3 = {
+ id: '',
+ start: '',
+ end: '',
+ mod: ''
+ }
+ data3.id = data[i].children[j].AdvaDevicNumber
+ data3.start = data[i].children[j].ThreeStartDate[0]
+ data3.end = data[i].children[j].ThreeStartDate[1]
+ data3.mod = (data[i].children[j].AdvaDevicCropMob * 1) / 100
+ newList.push(data3)
+ }
+ if (data[i].children[j].FourStartDate !== '') {
+ const data4 = {
+ id: '',
+ start: '',
+ end: '',
+ mod: ''
+ }
+ data4.id = data[i].children[j].AdvaDevicNumber
+ data4.start = data[i].children[j].FourStartDate[0]
+ data4.end = data[i].children[j].FourStartDate[1]
+ data4.mod = (data[i].children[j].AdvaDevicCropMob * 1) / 100
+ newList.push(data4)
+ }
+ if (data[i].children[j].FiveStartDate !== '') {
+ const data5 = {
+ id: '',
+ start: '',
+ end: '',
+ mod: ''
+ }
+ data5.id = data[i].children[j].AdvaDevicNumber
+ data5.start = data[i].children[j].FiveStartDate[0]
+ data5.end = data[i].children[j].FiveStartDate[1]
+ data5.mod = (data[i].children[j].AdvaDevicCropMob * 1) / 100
+ newList.push(data5)
+ }
+ }
+ }
+
+ for (const i in list) {
+ this.pushItem(newList, list[i].id, list[i].gtArray)
+ }
+
+ // this.schedulingData = list
+
+ // 褰撴帓绋嬫暟缁勪负绌虹殑鏃跺��
+ // if (this.schedulingData.length === 0) {
+ // this.schedulingData.push(list[0])
+ // } else {
+ // 鍒ゆ柇褰撳墠鐐瑰嚮琛岀殑鏁版嵁璇锋眰鎺ュ彛鏁版嵁 鏄惁宸茬粡鍦ㄦ帓绋嬫暟缁勫唴
+ const flag = this.schedulingData.map(i => i.id).includes(list[0].id)
+
+ if (!flag || this.schedulingData.length === 0) { // 褰撲笉鍦ㄦ帓绋嬫暟缁勫唴鏃� 鐩存帴push鎺掔▼鏁扮粍鍗冲彲
+ this.schedulingData.push(list[0])
+ } else { // 褰撳凡缁忓湪鎺掔▼鏁扮粍鍐呮椂 搴旇鍒ゆ柇鏃堕棿鍙栧苟闆�
+ console.log(list, 9)
+ const index = this.schedulingData.findIndex(i => i.id === list[0].id)
+ const tempGtArray = [...new Set(this.schedulingData[index].gtArray.concat(list[0].gtArray))]
+ // 鏁扮粍涓璞$浉鍚岀殑鍘婚噸
+ this.schedulingData[index].gtArray = tempGtArray.filter((currentValue, currentIndex, selfArr) => {
+ return selfArr.findIndex(item => item.start === currentValue.start) === currentIndex
+ })
+ // this.schedulingData[index].gtArray = tempGtArray
+ // console.log(tempGtArray, 10)
+ // console.log(this.schedulingData[index].gtArray, 11)
+ }
+ // }
+
+ console.log(this.schedulingData, 6)
+ // console.log(JSON.stringify(this.schedulingData))
+
+ // this.schedulingData = [
+ // {
+ // 'id': 'SB001',
+ // 'name': '璁惧001',
+ // 'AdvaDevicRhythm': '10.0',
+ // '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': [{
+ // 'start': '2023-03-25 0:00:00',
+ // 'end': '2023-03-25 11:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-25 13:00:00',
+ // 'end': '2023-03-25 18:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-26 06:00:00',
+ // 'end': '2023-03-26 11:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-26 14:00:00',
+ // 'end': '2023-03-26 20:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-26 21:30:00',
+ // 'end': '2023-03-26 23:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-27 05:30:00',
+ // 'end': '2023-03-27 17:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-28 08:00:00',
+ // 'end': '2023-03-28 11:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-28 13:00:00',
+ // 'end': '2023-03-28 18:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-29 08:00:00',
+ // 'end': '2023-03-29 11:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-29 13:00:00',
+ // 'end': '2023-03-29 18:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-30 08:00:00',
+ // 'end': '2023-03-30 11:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-30 13:00:00',
+ // 'end': '2023-03-30 18:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-31 08:00:00',
+ // 'end': '2023-03-31 11:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }, {
+ // 'start': '2023-03-31 13:00:00',
+ // 'end': '2023-03-31 18:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }]
+ // }]
+
+ if (cont !== '') {
+ for (const i in cont) {
+ for (const j in this.schedulingData) {
+ if (this.schedulingData[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: cont[i].part_code,
+ AdvaScheUom: cont[i].uom_name, // 鍗曚綅
+ work_order: cont[i].wo_code,
+ start: cont[i].time_start,
+ end: cont[i].time_end,
+ // type: cont[i].status === 'S' ? 'h_schedule' : 'bm_schedule'
+ type: 'h_schedule'
+ }
+ this.schedulingData[j].gtArray.unshift(data)
+ }
+ }
+ }
+ }
+
+ if (this.ganttLeftArrId !== '') {
+ for (const j in this.schedulingData) {
+ if (this.ganttLeftArrId.indexOf(this.schedulingData[j].id) >= 0) {
+ this.schedulingData[j].gtArray = []
+ this.schedulingData[j].status = false
+ }
+ }
+ }
+
+ // 璁惧浼樺厛鐨勬暟鎹牸寮�
+ this.eqpTopTempData = []
+ 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.eqpTopTempData.push(obj)
+ }
+
+ // 鏇存敼鏍煎紡
+ this.timeTopTempData = []
+
+ // 鏋勫缓鎸夋椂闂翠紭鍏堢殑鎺掔▼鏁版嵁鏍煎紡 timeTopTempData
+ 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.timeTopTempData.push(time)
+ // console.log(this.timeTopTempData)
+ }
+
+ if (cont !== '') {
+ for (const i in cont) {
+ for (const j in this.timeTopTempData) {
+ const data = {
+ id: cont[i].eqp_code,
+ date: cont[i].time_start.split(' ')[0],
+ number: cont[i].alloc_qty,
+ cl_name: cont[i].part_name,
+ cl_code: cont[i].part_code,
+ AdvaScheUom: cont[i].uom_name, // 鍗曚綅
+ work_order: cont[i].wo_code,
+ start: cont[i].time_start,
+ end: cont[i].time_end,
+ type: 'h_schedule'
+ }
+ if (this.timeTopTempData[j].date === data.date) {
+ this.timeTopTempData[j].gtArray.unshift(data)
+ }
+ }
+ }
+ }
+
+ console.log(this.eqpTopTempData, 7)
+ console.log(this.timeTopTempData, 8)
+
+ this.$forceUpdate()
+ },
+ // 鎹㈠瀷鏃堕棿
+ MinutesTest(time) {
+ const t = new Date(time)
+ t.setMinutes(t.getMinutes() + this.formBottom.times * 1)
+ const now =
+ t.getFullYear() +
+ '-' +
+ (t.getMonth() + 1).toString().padStart(2, '0') +
+ '-' +
+ t.getDate().toString().padStart(2, '0') +
+ ' ' +
+ t.getHours().toString().padStart(2, '0') +
+ ':' +
+ t.getMinutes().toString().padStart(2, '0') +
+ ':' +
+ t.getSeconds().toString().padStart(2, '0')
+ return now
+ },
+ // 鎻掑叆浜ц兘鏃堕棿娈�
+ pushItem(newList, id, arr) {
+ for (const i in newList) {
+ if (newList[i].id === id) {
+ const data = {
+ start: newList[i].start,
+ end: newList[i].end,
+ id: newList[i].id,
+ mod: newList[i].mod,
+ type: 'capacity'
+ }
+ arr.push(data)
+ }
+ }
+ },
+ // 琛岀偣鍑讳簨浠�
+ getCurrentRow(row) {
+ console.log(row, 3)
+ // 鍒ゆ柇鏄惁宸插瓨鍦ㄩ�変腑鐨� multipleSelection 鏁扮粍閲岄潰
+ // const index = this.multipleSelection.findIndex(i => i.AdvaScheWorkCode === row.AdvaScheWorkCode)
+ // this.$refs.tableDataRef.toggleRowSelection(row, index === -1)
+
+ this.radioSelectedId = row.AdvaScheId // 鎺掔▼id璧嬪�肩粰閫変腑琛宨d
+
+ // this.formBottom.needArrangeNumber += row.AdvaScheQty * 1 - row.AdvaScheYPQty * 1 // 闇�鎺掓暟閲� = 鏈帓绋嬫暟閲� - 宸叉帓绋嬫暟閲�
+
+ // console.log(this.multipleSelection, 'multipleSelection')
+ // 鑾峰彇棰勬帓杩涘害鍊煎拰鏈�澶х殑瑕佹眰浜や粯鏃ユ湡
+ this.formBottom.needArrangeNumber = 0
+ let maxPayDate = handleDatetime(new Date())
+ console.log(maxPayDate, 'maxPayDate')
+ if (this.multipleSelection.length > 0) {
+ console.log('鐜嬭�佸悏')
+ this.multipleSelection.forEach(i => {
+ this.formBottom.needArrangeNumber += i.AdvaScheQty * 1 - i.AdvaScheYPQty * 1
+ if (new Date(i.AdvaScheEndDate).getTime() > new Date(maxPayDate).getTime()) {
+ maxPayDate = i.AdvaScheEndDate
+ }
+ })
+ } else {
+ console.log('鍔犲瀹濓紒')
+ this.formBottom.needArrangeNumber = 0
+ // maxPayDate = row.AdvaScheEndDate
+ this.radioSelectedId = ''
+ }
+
+ this.formBottom.scheDate = [] // 鎺掔▼鏃ユ湡缃┖
+ this.cl_name = row.AdvaSchePartName // 浜у搧鍚嶇О
+ this.cl_code = row.AdvaSchePartNumber // 浜у搧缂栫爜
+ this.AdvaScheUom = row.AdvaScheUom // 浜у搧鍗曚綅
+ this.work_order = row.AdvaScheWorkCode // 宸ュ崟缂栧彿
+
+ this.formBottom.scheDate.push(handleDatetime(new Date())) // 褰撳墠鏃ユ湡锛堜粖澶╋級
+ this.formBottom.scheDate.push(maxPayDate) // 瑕佹眰浜や粯鏃堕棿
+
+ if (this.formBottom.scheDate !== '') {
+ this.time_data[0] = this.formBottom.scheDate[0] + ' 00:00' // 鎺掔▼寮�濮嬫椂闂�
+ this.time_data[1] = this.formBottom.scheDate[1] + ' 23:59' // 鎺掔▼缁撴潫鏃堕棿
+ }
+ this.forms.wocode = row.AdvaScheWorkCode // 宸ュ崟缂栧彿
+ this.forms.wkshpcode = row.AdvaScheWorkShopid // 杞﹂棿缂栫爜
+ this.forms.partcode = row.AdvaSchePartNumber // 浜у搧缂栫爜
+ this.forms.botproccode = row.AdvaScheBotProcid // 宸ヨ壓璺嚎缂栫爜
+ this.forms.startdate = handleDatetime(new Date()) // 褰撳墠鏃ユ湡锛堜粖澶╋級
+ this.forms.enddate = row.AdvaScheEndDate // 瑕佹眰浜や粯鏃堕棿
+
+ this.getOnclickAdvancedSchedulingDevice()
+ this.formUpdate.WorkCode = row.AdvaScheWorkCode // 宸ュ崟缂栧彿
+ this.formUpdate.BotProceCode = row.AdvaScheBotProcid // 宸ヨ壓璺嚎缂栫爜
+ },
+
+ // 鎺掔▼閲嶆帓浜嬩欢
+ resetScheduling() {
+ console.log(this.multipleSelection, 16)
+ console.log(this.schedulingData, 16)
+
+ // this.multipleSelection.forEach(i => {
+ // this.getCurrentRow(i) // 杩欓噷閬嶅巻璇锋眰鏃讹紝鍙傛暟娌″彉
+ // })
+
+ // this.getCurrentRow(this.multipleSelection[0])
+ // this.getCurrentRow(this.multipleSelection[1])
+ },
+ // checkbox 鐐瑰嚮鏀瑰彉浜嬩欢
+ handleSelectionChange(val, isCarry) {
+ console.log(val, 2)
+ this.multipleSelection = val
+
+ // if (isCarry) {
+ // // this.multipleSelection.push(val)
+ // this.getCurrentRow(val)
+ // } else {
+ // this.multipleSelection = val
+ // }
+
+ const index = this.multipleSelection.findIndex(i => i.AdvaScheId === this.rowCheckBoxValue.AdvaScheId)
+ if (index !== -1) { // 璇存槑checkbox鏄粠 鏈�変腑鍒伴�変腑鐘舵��
+ this.getCurrentRow(this.rowCheckBoxValue)
+ } else { // 璇存槑checkbox 鏄粠閫変腑鍒版湭閫変腑,鎺掔▼鐨勪骇鑳藉簲璇ヤ粠褰撳墠涓幓闄ゅ幓锛堣繘琛岄噸鎺掞級
+ console.log(this.schedulingData, 88)
+ this.resetScheduling()
+ // const ind = this.schedulingData.findIndex(i => i.id === this.rowCheckBoxValue.AdvaScheId)
+ }
+
+ if (val.length === 0) {
+ this.schedulingData = [] // 鎺掔▼鏁版嵁缃┖
+ this.radioSelectedId = ''
+ }
+
+ console.log('鎵ц浜嗭紒')
+ },
+ // checkbox 鐐瑰嚮浜嬩欢
+ handleSelect(selection, row) {
+ console.log(selection, row, 1)
+ // console.log('鎵ц浜� handleSelect 鎵ц椤哄簭涓�1 ')
+ // this.multipleSelection = selection
+
+ this.rowCheckBoxValue = row
+
+ // this.getCurrentRow(row)
+ // this.handleSelectionChange(row, true)
+ },
+
+ // 鎻愪氦鎺掔▼
+ async prepareSubmit() {
+ if (this.formBottom.canArrangeNumber !== this.formBottom.needArrangeNumber) {
+ this.$message.error('鏁伴噺鏈帓瀹岋紝璇疯缃骇鑳芥椂闂达紒')
+ } else {
+ const list = [] // 鎻愪氦鏁扮粍
+ for (const i in this.schedulingData) {
+ const arr = []
+ for (const j in this.schedulingData[i].gtArray) {
+ if (this.schedulingData[i].gtArray[j].type === 'schedule') {
+ arr.push(this.schedulingData[i].gtArray[j])
+ }
+ }
+ if (arr !== '') {
+ for (const i in arr) {
+ const data = {
+ AlreDevicNumber: '',
+ AlreStartDate: '',
+ AlreEndDate: '',
+ AlreQty: ''
+ }
+ data.AlreDevicNumber = arr[i].id
+ data.AlreStartDate = arr[i].start
+ data.AlreEndDate = arr[i].end
+ data.AlreQty = arr[i].number
+ list.push(data)
+ }
+ }
+ }
+ // 鎺掔▼鐩稿悓璁惧鑾峰彇寮�濮嬫椂闂� 缁撴潫鏃堕棿 鏁伴噺鐨勬�诲拰
+ // 杩囨护
+ let update = []
+ for (const i in list) {
+ if (list[i].AlreStartDate !== '') {
+ update.push(list[i])
+ }
+ }
+
+ update = JSON.stringify(update)
+ this.formUpdate.json = update
+ if (list === '') {
+ this.$message.error('璇峰厛棰勬帓')
+ return false
+ }
+
+ const formData = new FormData()
+ formData.append('wocode', this.formUpdate.WorkCode)
+ formData.append('botprocecode', this.formUpdate.BotProceCode)
+ formData.append('json', this.formUpdate.json)
+
+ const res = await SubmitAlreadyScheduling(formData)
+
+ if (res.code === '200') {
+ this.$message.success(res.Message)
+ }
+
+ this.formBottom.needArrangeNumber = 0
+ this.formBottom.canArrangeNumber = 0
+ await this.getOnclickAdvancedSchedulingDevice()
+ await this.getAdvancedSchedulingSearch()
+ }
+ },
+ // 鏃堕棿/璁惧浼樺厛鎺掔▼
+ prepareArrange() {
+ const timestamp = new Date().toLocaleDateString()
+
+ if (new Date(this.formBottom.scheDate[1]) < new Date(timestamp)) {
+ this.$message.error('鎺掔▼鏃ユ湡涓嶅彲浠ュ皬浜庡綋鍓嶆椂闂�!')
+ return false
+ }
+ this.filterAlreadyScheduleEqp()// 鎵嬪姩杩囨护鎵�鏈夎澶囧凡鎺掔▼
+
+ // 璁惧浼樺厛鎴栬�呮椂闂翠紭鍏� 瀵规暟鎹繘琛岀殑鏍煎紡杞崲
+ if (this.schedulingData !== '' && this.formBottom.types === 'N') { // 璁惧浼樺厛
+ this.eqpDataTransition()
+ this.editLastValue(this.schedulingData)
+ } else if (this.timeTopTempData !== '' && this.formBottom.types === 'Y') { // 鏃堕棿浼樺厛
+ this.filterAlreadyScheduleTime() // 鎵嬪姩杩囨护鎵�鏈夋椂闂村凡鎺掔▼
+ this.timeDataTransition()
+ this.dataTransition()
+ this.editLastValue(this.schedulingData)
+ }
+ },
+ // 鎵嬪姩杩囨护鎵�鏈夋椂闂村凡鎺掔▼
+ filterAlreadyScheduleTime() {
+ this.timeTopTempData.forEach(item => {
+ if (item.gtArray && item.gtArray.length > 0) {
+ item.gtArray = item.gtArray.filter(it => it.type !== 'schedule')
+ }
+ })
+ },
+ // 鎵嬪姩杩囨护鎵�鏈夎澶囧凡鎺掔▼
+ filterAlreadyScheduleEqp() {
+ this.schedulingData.forEach(item => {
+ if (item.gtArray && item.gtArray.length > 0) {
+ item.gtArray = item.gtArray.filter(it => it.type !== 'schedule')
+ }
+ })
+ },
+ // 缁欐帓绋嬫渶鍚庝竴涓慨鏀规暟閲�
+ editLastValue(arr) {
+ this.formBottom.canArrangeNumber = 0 // 鐪熷疄宸叉帓鏁伴噺
+ let num = 0 // 鍙栨暣宸叉帓鏁伴噺
+ const arr_num = [] // 宸叉帓鏁版嵁
+ let need_num = 0
+ for (const i in arr) {
+ for (const j in arr[i].gtArray) {
+ if (arr[i].gtArray[j].type === 'schedule') {
+ arr_num.unshift(arr[i].gtArray[j])
+ }
+ }
+ }
+
+ for (const n in arr_num) {
+ this.formBottom.canArrangeNumber += arr_num[n].real_number
+ num += arr_num[n].number * 1
+ }
+
+ this.formBottom.canArrangeNumber = Math.ceil(this.formBottom.canArrangeNumber)
+ const y10 = this.formBottom.needArrangeNumber - this.formBottom.canArrangeNumber
+ if (y10 <= 10) {
+ this.formBottom.canArrangeNumber = this.formBottom.needArrangeNumber
+ need_num = this.formBottom.needArrangeNumber - num
+ } else {
+ }
+ for (const i in this.schedulingData) {
+ for (const j in this.schedulingData[i].gtArray) {
+ if (
+ this.schedulingData[i].gtArray[j].type === 'schedule' &&
+ this.schedulingData[i].gtArray[j].end_num
+ ) {
+ this.schedulingData[i].gtArray[j].number =
+ this.schedulingData[i].gtArray[j].number * 1 + need_num
+ }
+ }
+ }
+ },
+ // 璁惧浼樺厛 鏁版嵁鏍煎紡杞崲
+ eqpDataTransition() {
+ let needNumber = this.formBottom.needArrangeNumber // 闇�鎺掓暟閲�
+ let flag1 = 0
+
+ for (const i in this.schedulingData) {
+ let end_arr = [] // 宸叉帓绋嬬殑鏁扮粍
+ let need_arr = [] // 寰呮帓绋嬬殑鏁扮粍
+
+ let capacity_arr = [] // 瑕佹帓绋嬬殑鏁扮粍
+ this.schedulingData[i].gtArray.sort((a, b) => new Date(a.end).getTime() - new Date(b.end).getTime())
+
+ end_arr = JSON.parse(JSON.stringify(this.schedulingData[i].gtArray.filter(item => item.type === 'h_schedule'))) // 宸叉帓绋嬫暟缁�
+ need_arr = JSON.parse(JSON.stringify(this.schedulingData[i].gtArray.filter(item => item.type === 'capacity'))) // 瀹归噺
+ // console.log(need_arr, 5)
+ // console.log(JSON.stringify(need_arr))
+
+ // need_arr = [
+ // {
+ // 'start': '2023-03-25 08:00:00',
+ // 'end': '2023-03-25 11:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-25 13:00:00',
+ // 'end': '2023-03-25 18:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-26 06:00:00',
+ // 'end': '2023-03-26 11:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-26 14:00:00',
+ // 'end': '2023-03-26 20:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-26 21:30:00',
+ // 'end': '2023-03-26 23:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-27 05:30:00',
+ // 'end': '2023-03-27 17:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-28 08:00:00',
+ // 'end': '2023-03-28 11:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-28 13:00:00',
+ // 'end': '2023-03-28 18:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-29 08:00:00',
+ // 'end': '2023-03-29 11:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-29 13:00:00',
+ // 'end': '2023-03-29 18:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-30 08:00:00',
+ // 'end': '2023-03-30 11:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-30 13:00:00',
+ // 'end': '2023-03-30 18:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-31 08:00:00',
+ // 'end': '2023-03-31 11:30:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // },
+ // {
+ // 'start': '2023-03-31 13:00:00',
+ // 'end': '2023-03-31 18:00:00',
+ // 'id': 'SB001',
+ // 'mod': 0.3,
+ // 'type': 'capacity'
+ // }
+ // ]
+ if (end_arr && end_arr.length > 0) {
+ capacity_arr = need_arr.map(item => {
+ // 鎺掗櫎鎺夊凡缁忔帓绋嬬殑瀛樺湪hshedule锛宻tart锛宔nd閮界浉绛夌殑鎯呭喌
+ const schedule = end_arr.filter(it => {
+ return new Date(item.start).getTime() <= new Date(it.start).getTime() &&
+ new Date(item.end).getTime() >= new Date(it.end).getTime()
+ })
+
+ if (schedule && schedule.length > 0) {
+ item.start = this.MinutesTest(schedule[schedule.length - 1]['end'])
+ }
+
+ const schedule1 = end_arr.filter(schedule => {
+ return new Date(item.start).getTime() === new Date(schedule.start).getTime() &&
+ new Date(item.end).getTime() === new Date(schedule.end).getTime()
+ })
+ if (schedule1 && schedule1.length > 0) {
+ item.capacity = false
+ }
+
+ return item
+ }).filter(item => item.capacity !== false)
+ } else {
+ capacity_arr = need_arr
+ }
+
+ const id_obj = {
+ id: '',
+ start_time: ''
+ }
+ if (end_arr != '') {
+ (id_obj.id = end_arr[0].id), (id_obj.start_time = end_arr[0].end)
+ }
+
+ capacity_arr = this.filterOutTime(capacity_arr) // 杩囨护鎺夊綋鍓嶆椂闂翠箣鍓嶇殑涓嶈兘鎺掔▼
+
+ for (const w in capacity_arr) {
+ let end_time = ''
+ let mistiming = ''
+ const data = {
+ id: capacity_arr[w].id,
+ start: '',
+ end: '',
+ type: 'schedule',
+ cl_name: this.cl_name,
+ cl_code: this.cl_code,
+ work_order: this.work_order,
+ AdvaScheUom: this.AdvaScheUom,
+ number: 0,
+ real_number: 0
+ }
+ if (
+ id_obj.start_time !== '' &&
+ flag1 === 0 &&
+ new Date(id_obj.start_time).getTime() >= new Date(capacity_arr[w].start).getTime()
+ ) {
+ data.start = this.MinutesTest(id_obj.start_time)
+ flag1 = 1
+ } else {
+ data.start = capacity_arr[w].start
+ }
+ let nowTime = (this.schedulingData[i].AdvaDevicRhythm * needNumber) / capacity_arr[w].mod
+ end_time = this.formSeconds(nowTime, data.start, capacity_arr[w].mod) // 鎬诲叡鐨勭粨鏉熸椂闂�
+ data.end = end_time
+ mistiming = this.compareTime(
+ end_time,
+ capacity_arr[w].end,
+ capacity_arr[w].mod
+ ) // 鎬诲叡鐨勭粨鏉熸椂闂�-褰撳墠鐨勭粨鏉熸椂闂� = 鍓╀笅澶氫箙鏃堕棿
+ if (mistiming >= 0) {
+ data.number =
+ ((new Date(data.end) - new Date(data.start)) *
+ capacity_arr[w].mod) /
+ this.schedulingData[i].AdvaDevicRhythm /
+ 1000
+ data.real_number =
+ ((new Date(data.end) - new Date(data.start)) *
+ capacity_arr[w].mod) /
+ this.schedulingData[i].AdvaDevicRhythm /
+ 1000
+ data.number = data.number.toFixed(0)
+ data.end_num = true
+ if (new Date(data.start) >= new Date(data.end)) {
+ } else {
+ this.schedulingData[i].gtArray.push(data)
+ }
+ return false
+ } else {
+ data.end = capacity_arr[w].end
+
+ if (new Date(data.end).getTime() < new Date(data.start)) {
+ continue // 鍥犱负寮�濮嬫椂闂存瘮缁撴潫鏃堕棿澶� 闇�瑕佽烦杩囧悗闈㈡楠�
+ }
+
+ // 杩欓噷闄や互涓�鍗冩槸鍥犱负 new Date() 寰楀埌鐨勬槸姣 姣杞寲涓虹鏄崈杩涘埗
+ // 涓�娈垫椂闂存鍐呯殑鐢熶骇閲�=涓よ�呮椂闂村樊锛堟绉掞級/1000 / 鐢熶骇鑺傛媿 * 绋煎姩鐜�
+ data.number =
+ ((new Date(data.end) - new Date(data.start)) *
+ capacity_arr[w].mod) /
+ this.schedulingData[i].AdvaDevicRhythm /
+ 1000
+
+ data.real_number =
+ ((new Date(data.end) - new Date(data.start)) *
+ capacity_arr[w].mod) /
+ this.schedulingData[i].AdvaDevicRhythm /
+ 1000
+
+ data.number = data.number.toFixed(0)
+
+ nowTime = (needNumber - data.real_number) * this.schedulingData[i].AdvaDevicRhythm
+ needNumber = needNumber - data.real_number
+ if (new Date(data.start) >= new Date(data.end)) {
+
+ } else {
+ this.schedulingData[i].gtArray.push(data)
+ }
+ }
+ }
+ }
+ },
+ // 鏃堕棿浼樺厛 鏁版嵁鏍煎紡杞崲
+ timeDataTransition() {
+ // 鎺掗櫎鏈嬀閫夐」
+ for (const i in this.timeTopTempData) {
+ const newArr = []
+ for (const j in this.timeTopTempData[i].gtArray) {
+ if (this.ganttLeftArrId.indexOf(this.timeTopTempData[i].gtArray[j].id) < 0) {
+ newArr.push(this.timeTopTempData[i].gtArray[j])
+ }
+ }
+ this.timeTopTempData[i].gtArray = newArr
+ }
+ let needNumber = this.formBottom.needArrangeNumber // 闇�鎺掓暟閲�
+
+ // 閲岄潰閫昏緫瑕佹悶娓呮 寰堥噸瑕�
+ for (const i in this.timeTopTempData) {
+ let end_arr = []
+ let need_arr = [] // 鎺掔▼鐨勬暟缁�
+
+ let capacity_arr = [] // 瑕佹帓绋嬬殑鏁扮粍
+
+ this.timeTopTempData[i].gtArray.sort((a, b) => new Date(a.end).getTime() - new Date(b.end).getTime())
+
+ end_arr = JSON.parse(JSON.stringify(this.timeTopTempData[i].gtArray.filter(item => item.type === 'h_schedule'))) // 宸叉帓绋嬫暟鎹�
+ need_arr = JSON.parse(JSON.stringify(this.timeTopTempData[i].gtArray.filter(item => item.type === 'capacity'))) // 瀹归噺
+
+ capacity_arr = JSON.parse(JSON.stringify(need_arr)) // 瀹归噺
+
+ // 鑾峰彇鍙帓绋嬬殑鏃堕棿 浠ヤ究鎺ョ潃寰�鍚庢帓绋� 閬嶅巻缁撴潫瑕佸緱鍒扮殑鏄� 褰撳墠鏃ユ湡鍙帓瀹归噺
+ end_arr.forEach((item, index) => { // 宸叉帓绋嬬殑鏁扮粍
+ capacity_arr.forEach((it, ind) => { // 瀹归噺锛堟棩浜ц兘锛�
+ if (item.id === it.id &&
+ new Date(item.start).getTime() >= new Date(it.start).getTime() &&
+ new Date(item.end).getTime() === new Date(it.end).getTime() // new Date(item.end).getTime() <= new Date(it.end).getTime()
+ ) {
+ capacity_arr.splice(ind, 1)
+ }
+ })
+ })
+
+ // continue:琛ㄧず璺冲嚭鏈寰幆锛屼篃灏辨槸涓嶆墽琛屾湰娆″惊鐜痗ontinue涔嬪悗鐨勬搷浣�
+ // break:琛ㄧず璺冲嚭褰撳墠鐨勫惊鐜紝閽堝鏁翠釜寰幆浣撶粓姝㈠悗缁殑閬嶅巻锛�
+ if (!capacity_arr || capacity_arr.length === 0) {
+ continue
+ }
+
+ const schedule_arr = end_arr.filter(item => {
+ const remain = need_arr.some(it => {
+ return (new Date(item.start).getTime() >= new Date(it.start).getTime() &&
+ new Date(item.end).getTime() < new Date(it.end).getTime())
+ })
+
+ return remain
+ })
+
+ // 涓嬮潰閫昏緫寰堥噸瑕�
+ if (schedule_arr && schedule_arr.length > 0) {
+ const scheduleCan = schedule_arr.map(item => {
+ const temp = need_arr.filter(it => {
+ if (it.id === item.id) {
+ return (new Date(item.start).getTime() >= new Date(it.start).getTime() &&
+ new Date(item.end).getTime() < new Date(it.end).getTime())
+ // ||
+ // (new Date(item.start).getTime() > new Date(it.start).getTime() &&
+ // new Date(item.end).getTime() < new Date(it.end).getTime())
+ }
+ })[0]
+
+ temp.start = this.MinutesTest(item.end)
+
+ return temp
+ })
+
+ const newSchedule = JSON.parse(JSON.stringify(scheduleCan))
+
+ capacity_arr.forEach(item => {
+ newSchedule.forEach(it => {
+ if (item.id === it.id && new Date(item.start).getTime() < new Date(it.start).getTime()) {
+ item.start = it.start
+ }
+ })
+ })
+ }
+
+ const id_obj = {}
+ if (end_arr != '') {
+ (id_obj.id = end_arr[0].id), (id_obj.start_time = end_arr[0].end)
+ }
+
+ capacity_arr = this.filterOutTime(capacity_arr) // 杩囨护鎺夊綋鍓嶆椂闂翠箣鍓嶇殑涓嶈兘鎺掔▼
+
+ for (const w in capacity_arr) {
+ const data = {
+ id: capacity_arr[w].id,
+ start: '',
+ end: '',
+ type: 'schedule',
+ cl_name: this.cl_name,
+ cl_code: this.cl_code,
+ work_order: this.work_order,
+ AdvaScheUom: this.AdvaScheUom, // 鍗曚綅
+ number: 0,
+ real_number: 0
+ }
+
+ if (
+ id_obj &&
+ new Date(id_obj.start_time).getTime() >=
+ new Date(capacity_arr[w].start).getTime()
+ ) {
+ if (data.id === id_obj.id) {
+ data.start = this.MinutesTest(id_obj.start_time)
+ } else {
+ data.start = capacity_arr[w].start
+ }
+ } else {
+ data.start = capacity_arr[w].start
+ }
+
+ let nowTime = (capacity_arr[w].rhythm * needNumber) / capacity_arr[w].mod
+
+ const end_time = this.formSeconds(nowTime, data.start)
+
+ data.end = end_time
+ const mistiming = this.compareTime(end_time, capacity_arr[w].end)
+ if (mistiming >= 0) {
+ data.number = ((new Date(data.end) - new Date(data.start)) * capacity_arr[w].mod) / capacity_arr[w].rhythm / 1000
+ data.real_number = ((new Date(data.end) - new Date(data.start)) * capacity_arr[w].mod) / capacity_arr[w].rhythm / 1000
+ data.number = data.number.toFixed(0)
+ data.end_num = true
+
+ if (new Date(data.start) >= new Date(data.end)) {
+
+ } else {
+ this.timeTopTempData[i].gtArray.push(data)
+ }
+
+ return false
+ } else {
+ data.end = capacity_arr[w].end
+ data.number = ((new Date(data.end) - new Date(data.start)) * capacity_arr[w].mod) / capacity_arr[w].rhythm / 1000
+ data.real_number = ((new Date(data.end) - new Date(data.start)) * capacity_arr[w].mod) / capacity_arr[w].rhythm / 1000
+ data.number = data.number.toFixed(0)
+ nowTime = (needNumber - data.real_number) * capacity_arr[w].rhythm
+ needNumber = needNumber - data.real_number
+
+ if (new Date(data.start) >= new Date(data.end)) {
+ } else {
+ this.timeTopTempData[i].gtArray.push(data)
+ }
+ }
+ }
+ }
+ },
+ // 杩囨护鎺夊綋鍓嶆椂闂翠箣鍓嶇殑涓嶈兘鎺掔▼
+ filterOutTime(capacity_arr) {
+ // 杩欓噷瑕佸皢瀹归噺鍜屽綋鍓嶆椂闂村仛瀵规瘮 鍋氭椂闂村鐞� 濡傛灉鍦ㄥ綋鍓嶆椂闂翠箣鍓嶇殑涓嶈兘鎺掔▼
+ capacity_arr.forEach((item, index) => {
+ // 褰撳墠鏃堕棿 澶т簬绛変簬寮�濮嬫椂闂� 涓斿皬浜庣瓑浜庣粨鏉熸椂闂�
+ if (new Date(item.start).getTime() <= new Date(handleDatetime2(new Date())).getTime() && new Date(item.end).getTime() >= new Date(handleDatetime2(new Date())).getTime()) {
+ item.start = handleDatetime2(new Date())
+ }
+ // 褰撳墠鏃堕棿姣斿紑濮嬫椂闂村ぇ 姣旂粨鏉熸椂闂翠篃澶�
+ if (new Date(item.start).getTime() < new Date(handleDatetime2(new Date())).getTime() && new Date(item.end).getTime() < new Date(handleDatetime2(new Date())).getTime()) {
+ item.capacity = false
+ }
+ })
+
+ return capacity_arr.filter(item => item.capacity !== false)
+ },
+
+ // 鏃堕棿浼樺厛 缁欒澶囪浆鎹㈡牸寮�
+ dataTransition() {
+ this.schedulingData = []
+ const data = this.timeTopTempData
+
+ const all = []
+ const list = this.eqpTopTempData
+ for (const i in data) {
+ for (const j in data[i].gtArray) {
+ all.push(data[i].gtArray[j])
+ }
+ }
+
+ for (const i in list) {
+ list[i].gtArray = []
+ this.pushTimes(all, list[i].id, list[i].gtArray)
+ }
+
+ for (const n in list) {
+ if (list[n].gtArray.length === 0) {
+ list[n].status = false
+ }
+ }
+
+ this.schedulingData = list
+ },
+ // 鎻掑叆浜ц兘鏃堕棿娈�
+ pushTimes(newList, id, arr) {
+ for (const i in newList) {
+ if (newList[i].id === id) {
+ arr.push(newList[i])
+ }
+ }
+ },
+ // 鎺掔▼鏂规硶
+ formSeconds(s1, start, mod) {
+ const nowData = new Date(start)
+ // 绠楀嚭褰撳墠鎺掔▼鐨勭粨鏉熸椂闂�
+ return this.transitionTime(
+ new Date(nowData.setSeconds(nowData.getSeconds() + s1))
+ )
+ },
+ // 杞寲鏍囧噯鏃堕棿
+ transitionTime(time) {
+ const d = new Date(time)
+ return (
+ d.getFullYear() +
+ '-' +
+ (d.getMonth() + 1).toString().padStart(2, '0') +
+ '-' +
+ d.getDate().toString().padStart(2, '0') +
+ ' ' +
+ d.getHours().toString().padStart(2, '0') +
+ ':' +
+ d.getMinutes().toString().padStart(2, '0') +
+ ':' +
+ d.getSeconds().toString().padStart(2, '0')
+ )
+ },
+ // 鏃堕棿姣旇緝
+ compareTime(d1, d2, mod) {
+ // d1 鎺掗櫎缁撴潫鏃堕棿 d2 褰撳墠浜ц兘缁撴潫鏃堕棿
+ const time1 = new Date(d1)
+ const time2 = new Date(d2)
+ return parseInt(time2 - time1) / 1000
+ }
+ }
+}
+</script>
+<!--鎺掔▼閮ㄥ垎鐨勬牱寮�-->
+<style scoped>
+body {
+ font-size: 12px;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.box_style {
+ position: relative;
+ top: 40px;
+ left: -91px;
+}
+
+.box_styles {
+ position: relative;
+ top: 40px;
+ left: 0;
+}
+
+/*鑷姩鎺掔▼閮ㄥ垎*/
+.autoScheduling {
+ display: flex;
+ flex-direction: column;
+ /*padding: 0 10px;*/
+ /* height: calc(100vh - 100px); */
+ /*background-color: #f8f8fa;*/
+ background-color: #fff;
+ margin-top: 20px;
+ height: 490px;
+}
+
+.colorDescription {
+ display: flex;
+ padding: 5px 30px 0;
+}
+
+.colorDescriptionItem {
+ display: flex;
+ margin-right: 20px;
+}
+
+label {
+ margin-left: 10px;
+}
+
+input {
+ width: 40px;
+ height: 20px;
+ vertical-align: middle;
+}
+
+input[type="range"] {
+ width: 100px;
+}
+
+.container {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+}
+
+.tc {
+ text-align: center;
+}
+
+.name {
+ display: flex;
+ box-sizing: border-box;
+ overflow: hidden;
+ height: 100%;
+ width: 100%;
+ padding: 0 5px 0 0;
+ border-radius: 8px 0 0 8px;
+ align-items: center;
+}
+
+.carId {
+ flex: 1;
+}
+
+.tc {
+ color: #909399;
+ font-size: 14px;
+}
+</style>
+
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+.elTableDiv {
+ ::v-deep .el-radio__label {
+ display: none;
+ }
+}
+
+::v-deep .el-button--text {
+ font-size: 14px;
+ cursor: pointer;
+}
+
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
+ color: $main_color;
+ cursor: pointer;
+}
+
+.el-icon-edit-outline {
+ margin-right: 15px;
+}
+
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+ height: 34px;
+ display: flex;
+ align-items: center;
+ padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+ //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+ background-color: #f8f8fa;
+ border: none;
+}
+
+::v-deep .el-input__inner {
+ height: 34px;
+ line-height: 34px;
+ //color: #a7a7a7;
+}
+
+::v-deep .el-dialog__body {
+ padding: 20px 100px !important;
+}
+
+::v-deep .dialogVisibleRoles .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+ display: flex;
+ justify-content: flex-end;
+}
+
+::v-deep .el-table .caret-wrapper {
+ transform: scale(0.8);
+}
+
+::v-deep .cell {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+::v-deep .el-table::before {
+ height: 0;
+}
+
+::v-deep .el-table__body-wrapper {
+ background-color: #f8f8fa;
+}
+
+::v-deep .el-table__body .el-table__row.hover-row td {
+ background-color: #eaecef;
+}
+
+::v-deep .el-form--inline .el-form-item__label {
+ color: #a7a7a7;
+}
+
+.body ::v-deep .el-divider {
+ border: 1px solid #eee;
+ width: 99%;
+ margin: 10px auto;
+}
+
+.body ::v-deep .el-form-item {
+ margin-bottom: 0;
+}
+
+.userDialogVisible ::v-deep .el-form-item {
+ margin-bottom: 0;
+}
+
+::v-deep .el-select__caret {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.tableFixed {
+ ::v-deep .el-table__fixed-right {
+ height: 100% !important;
+ }
+
+ ::v-deep .el-table__fixed {
+ height: 100% !important;
+ }
+
+}
+
+::v-deep .gantt-header-title {
+ background-color: #fff;
+ //border-left: 1px solid #eee !important;
+ //border-bottom: 1px solid #eee !important;
+}
+
+</style>
+<style>
+
+.el-table .custom-row {
+ background: #f8f8fa;
+}
+
+</style>
+
+<!--<style>-->
+<!--input[type=range]:focus {-->
+<!-- display: none;-->
+<!--}-->
+
+<!--input[type=range] {-->
+<!-- -webkit-appearance: none;-->
+<!-- width: 500px;-->
+<!-- border-radius: 10px;-->
+<!-- /*杩欎釜灞炴�ц缃娇濉厖杩涘害鏉℃椂鐨勫浘褰负鍦嗚*/-->
+<!--}-->
+
+<!--input[type=range]::-webkit-slider-runnable-track {-->
+<!-- height: 20px;-->
+<!-- border-radius: 10px;-->
+<!-- /*灏嗚建閬撹涓哄渾瑙掔殑*/-->
+<!-- /* box-shadow: 0 1px 1px #def3f8, inset 0 .125em .125em #0d1112; */-->
+<!-- border: solid 1px red;-->
+<!--}-->
+
+<!--input[type=range]::-webkit-slider-thumb {-->
+<!-- -webkit-appearance: none;-->
+<!-- height: 30px;-->
+<!-- width: 120px;-->
+<!-- margin-top: -5px;-->
+<!-- /*浣挎粦鍧楄秴鍑鸿建閬撻儴鍒嗙殑鍋忕Щ閲忕浉绛�*/-->
+<!-- background: #ffffff;-->
+<!-- /* border-radius: 50%; */-->
+<!-- /*澶栬璁剧疆涓哄渾褰�*/-->
+<!-- border: solid 0.125em rgba(205, 224, 230, 0.5);-->
+<!-- /*璁剧疆杈规*/-->
+<!-- /* box-shadow: 0 .125em .125em #3b4547; */-->
+<!-- /*娣诲姞搴曢儴闃村奖*/-->
+<!--}-->
+<!--</style>-->
diff --git a/src/views/produceManager/workOrder.vue b/src/views/produceManager/workOrder.vue
index 226974e..8ce8230 100644
--- a/src/views/produceManager/workOrder.vue
+++ b/src/views/produceManager/workOrder.vue
@@ -497,7 +497,8 @@
</el-form-item>
<el-form-item label="宸ュ崟缂栧彿" prop="mesordercode">
- <el-input v-model="dialogForm.mesordercode" :disabled="operation!=='add'" style="width: 200px" />
+ <!-- <el-input v-model="dialogForm.mesordercode" :disabled="operation!=='add'" style="width: 200px" />-->
+ <el-input v-model="dialogForm.mesordercode" disabled style="width: 200px" />
</el-form-item>
<div style="display: flex">
<el-form-item label="宸ュ崟绫诲瀷" prop="mesorderstus">
@@ -1772,7 +1773,7 @@
ClosedMesOrder,
DeleteMesOrder, MesBadOrderSearch, JobCreationSonAddVison,
MesOrderSearch, PartSelectRoute, RouteSelectWkshop, SearchWorkStep, SelectRouteOrWkshop,
- SelectRouteStep
+ SelectRouteStep, AddMesOrderCodeSearch
} from '@/api/produceManager'
import { InventoryFileAssociationRoute, PartSelect, SaveInventoryFile } from '@/api/makeModel'
import { handleDatetime, handleDatetime2, validateCode } from '@/utils/global'
@@ -2130,6 +2131,8 @@
},
// 鏂板鎸夐挳
async add(operation) {
+ const { data: res } = await AddMesOrderCodeSearch()
+ this.dialogForm.mesordercode = res
this.operation = operation
this.dialogVisible = true
this.dialogForm.planstartdate = handleDatetime(new Date())
diff --git a/src/views/purchasesManager/purchasesList.vue b/src/views/purchasesManager/purchasesList.vue
index af02b42..17ff06d 100644
--- a/src/views/purchasesManager/purchasesList.vue
+++ b/src/views/purchasesManager/purchasesList.vue
@@ -171,7 +171,11 @@
label="璁㈠崟鐘舵��"
width="110"
sortable="custom"
- />
+ >
+ <template slot-scope="{row}">
+ <div>{{ mesorderstusArr.find(i=>i.value===row.status).label }}</div>
+ </template>
+ </el-table-column>
<el-table-column
prop="orderdate"
label="鍗曟嵁鏃ユ湡"
@@ -312,6 +316,7 @@
<div class="elTableDiv">
<el-table
+ ref="tableDataRef2"
:data="tableDataDetail"
border
height="210px"
@@ -656,6 +661,7 @@
}
this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
this.$refs.tableDataRef.doLayout()
+ this.$refs.tableDataRef2.doLayout()
})
},
tableRowClassName({ row, rowIndex }) {
--
Gitblit v1.9.3