From 0d4b65b968fdbf59cc9c0b0b2ca2091b4fc6c4ba Mon Sep 17 00:00:00 2001 From: songshankun <songshankun@foxmail.com> Date: 星期五, 10 十一月 2023 11:50:38 +0800 Subject: [PATCH] feat: 添加获取/设定设备配置接口,添加设备配置弹窗,生产弹窗添加根据配置决定是否允许无工艺参数生产 --- src/components/TaskControlModal.vue | 36 ++++++++++++++++++++++++++++++------ 1 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/components/TaskControlModal.vue b/src/components/TaskControlModal.vue index 537dcee..73dec7f 100644 --- a/src/components/TaskControlModal.vue +++ b/src/components/TaskControlModal.vue @@ -65,9 +65,9 @@ 宸ユ椂锛� {{ currentTaskData.Procedure.procedure.workHours || "" }} </div> <div class="title-item"> - 璁″垝鏃堕棿锛� {{ formatDate(currentTaskData.Order.startTime) || "" }} + 璁″垝鏃堕棿锛� {{ formatDate(currentTaskData.Procedure.startTime) || "" }} - - {{ formatDate(currentTaskData.Order.endTime) }} + {{ formatDate(currentTaskData.Procedure.endTime) }} </div> <div class="title-item"> @@ -93,6 +93,10 @@ > 宸ヨ壓鍙傛暟 </div> + <!-- 鏈幏鍙栧埌宸ヨ壓鍙傛暟, 涓斿綋鍓嶈澶囧厑璁稿湪娌℃湁宸ヨ壓鍙傛暟鐨勬儏鍐典笅鐢熶骇, 鍒欐彁绀�--> + <div v-if="getProcessParamsErrMsg && currentDeviceAllowNoParams" class="title-item title-item-two"> + 鏈幏鍙栧埌宸ヨ壓鍙傛暟, 璇锋墜鍔ㄨ缃垨鍦ㄤ簯绔伐鑹烘ā鍨嬩腑涓婁紶 + </div> <div class="title-item title-item-two" v-for="(item, index) in currentProcessParams" @@ -103,7 +107,7 @@ </div> </div> </div> - <div class="process-err-tip" v-if="getProcessParamsErrMsg"> + <div class="process-err-tip" v-if="getProcessParamsErrMsg && !currentDeviceAllowNoParams"> <div class="tip-icon"> <span class="el-icon-error color_error"></span> </div> @@ -170,7 +174,7 @@ </div> <div slot="footer" :class="messageError?'dialog-footer tac btn-error':'dialog-footer tac'" style="overflow: hidden"> - <template v-if="messageError || getProcessParamsErrMsg"> + <template v-if="(messageError || getProcessParamsErrMsg) && !currentDeviceAllowNoParams"> <div class="btn" v-if="messageError ==='涓嬪彂鎴愬姛锛�'||getProcessParamsErrMsg" @click="closeClick"> <img src="../../public/close-btn.png"/> </div> @@ -215,7 +219,7 @@ </template> <script> -import {getTaskInfo, sendProcessParams, startTask,} from "@/api/home"; // 浜х嚎 +import {getDeviceList, getTaskInfo, sendProcessParams, startTask,} from "@/api/home"; // 浜х嚎 import {channelNameConfig} from "@/common/constants"; export default { name: 'TaskControlModal', @@ -248,13 +252,17 @@ isLoading: false, second: 0, secondTimer: null, - channelNameConfig: channelNameConfig + channelNameConfig: channelNameConfig, + currentDeviceAllowNoParams:false, + deviceInfo:null }; }, mounted() { this.getTaskList().then(() => { const firstData = this.taskList[0] const id = firstData?.Procedure?.ID + console.log(this.taskList) + this.getDeviceInfo() if (id) { this.currentTaskIndex = this.taskList.findIndex(ele => ele.Procedure.ID === id) this.getCurrentTaskProduceParams(id) @@ -312,6 +320,7 @@ this.messageError = '' this.resParams = {}; if (newVal) { + this.getDeviceInfo() this.getTaskList().then(() => { const firstData = this.taskList[0] const id = firstData?.Procedure?.ID @@ -361,6 +370,20 @@ console.error(err) },) }, + getDeviceInfo(){ + getDeviceList().then(res=>{ + this.deviceInfo = res.data + this.currentDeviceAllowNoParams=this.getConfig(this.deviceInfo) + }).catch(err=>{ + console.error(err) + }) + }, + getConfig(deviceInfo){ + const currentDeviceInfo = deviceInfo.deviceList?.find((ele) => { + return ele.deviceID === deviceInfo.currentDeviceID + }) + return !currentDeviceInfo?.needSetProcessParams + }, /** * 鑾峰彇褰撳墠灞曠ず鐨勪换鍔$殑宸ヨ壓鍙傛暟 */ @@ -369,6 +392,7 @@ if (id) { this.currentProcessParams = [] this.getProcessParamsErrMsg = "" + startTask({id}).then((res) => { if (res.code === 200) { this.currentProcessParams = res.data.Params ?? [] -- Gitblit v1.8.0