From f1b893a32eae6144a444ddc4a09047419f9b3619 Mon Sep 17 00:00:00 2001 From: qsj <731458905@qq.com> Date: Thu, 28 Mar 2024 15:16:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/instrument/index.vue | 147 ++++++++++++------ 1 file changed, 101 insertions(+), 46 deletions(-) diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index e937261..ef9cae6 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -309,9 +309,9 @@ -
- * -
+
+ * +
添加膜布
@@ -329,15 +329,13 @@ - + - + @@ -914,7 +912,7 @@ export default { form: {}, // WE200膜布 WEClothShow: false, - wxLiningList: [], + wxLiningList: [], ClothOptions: [], Modetions: [], NewOptions: [], @@ -1137,7 +1135,7 @@ export default { we200BluetoothConnecting: null, we200BluetoothConnectingTitle: null, we200BluetoothConnectingContent: null, - wxLiningList: null, + wxLiningList: null, } /* 仪器封面 */ @@ -1229,6 +1227,8 @@ export default { }, /** 新增按钮操作 */ handleAdd() { + this.wxLiningList = [] + // debugger this.reset() this.open = true this.title = '添加仪器列' @@ -1247,7 +1247,7 @@ export default { } }) this.mode.modeIdsOptions = response.data - this.Modetions = JSON.parse(JSON.stringify(response.data)) + } }) listLining().then(e => { @@ -1257,13 +1257,21 @@ export default { label: item.name }) }) + console.log(this.ClothOptions, '111111'); }) }, /** 修改按钮操作 */ handleUpdate(row) { + this.wxLiningList = [] this.reset() const id = row.id || this.ids getInstrument(id).then((response) => { + + if (response.data.model === "WE200") { + this.WEClothShow = true + + this.wxLiningList = response.data.wxLiningList + } this.form = response.data // 仪器封面回显 this.bannerFile = { @@ -1381,6 +1389,7 @@ export default { instrumentType: this.form.type, instrumentModel: this.form.model, }).then((response) => { + if (response.code != 200) { this.$message.error('模式获取失败') } @@ -1391,7 +1400,7 @@ export default { } }) this.mode.modeIdsOptions = response.data - this.Modetions = JSON.parse(JSON.stringify(response.data)); + this.Modetions = JSON.parse(JSON.stringify(response.data)); } /* 带new标识选项回显 */ @@ -1412,10 +1421,36 @@ export default { } if (temp !== undefined && temp.length > 0) { this.newModeOptionList = temp - console.log(temp, '查看你'); + + this.NewOptions = JSON.parse(JSON.stringify(temp)) + } + } + + /* 带new标识选项回显 */ + if ( + this.wxLiningList[0].modeList != null && + this.wxLiningList[0].modeList.length > 0 + ) { + let temp = [] + + for (let i = 0; i < this.wxLiningList[0].modeList.length; i++) { + let filterModeArr = this.Modetions.filter( + (item) => + item !== undefined && this.wxLiningList[0].modeList[i] === item.id + ) + if (filterModeArr !== undefined && filterModeArr.length > 0) { + temp.push(filterModeArr[0]) + } + } + if (temp !== undefined && temp.length > 0) { + // this.newModeOptionList = temp + this.NewOptions = JSON.parse(JSON.stringify(temp)) + } } + + }) // IOT版本升级介绍 @@ -1427,15 +1462,17 @@ export default { this.form.we200IotVersionUpgrade ) - listLining().then(e => { - e.rows.forEach(item => { - this.ClothOptions.push({ - value: item.id, - label: item.name - }) - }) - }) + listLining().then(e => { + e.rows.forEach(item => { + this.ClothOptions.push({ + value: item.id, + label: item.name + }) + }) + }) }) + + }, /** 提交按钮 */ submitForm() { @@ -1471,18 +1508,18 @@ export default { this.form.nurseList = this.nurseList this.form.introduceList = this.introduceList - if(this.form.model == 'WE200') { - if(this.wxLiningList.length == 0) { - this.$modal.msgError('请添加膜布'); - return - } - - console.log("wxLiningList => ", this.wxLiningList); - if(this.wxLiningList.length > 0) { - this.form.wxLiningList = this.wxLiningList; - } - } - console.log(this.form); + if (this.form.model == 'WE200') { + if (this.wxLiningList.length == 0) { + this.$modal.msgError('请添加膜布'); + return + } + + console.log("wxLiningList => ", this.wxLiningList); + if (this.wxLiningList.length > 0) { + this.form.wxLiningList = this.wxLiningList; + } + } + console.log(this.form); this.$refs['form'].validate((valid) => { if (valid) { if (this.form.id != null) { @@ -1757,19 +1794,19 @@ export default { this.form.we200BluetoothConnecting = null; this.form.we200BluetoothConnectingTitle = null; this.form.we200BluetoothConnectingContent = null; - // 仪器类型切换,关闭膜布选项 - this.WEClothShow = false; - this.ClothOptions = []; - // this.Modetions = []; - // this.NewOptions = []; - this.wxLiningList = []; + // 仪器类型切换,关闭膜布选项 + this.WEClothShow = false; + + // this.Modetions = []; + // this.NewOptions = []; + this.wxLiningList = []; }, // 添加膜布 AddCloth() { this.wxLiningList.push({ id: '', - modeList: '', - newModeIdList: '' + modeList: '', + newModeIdList: '' }) }, @@ -1777,9 +1814,27 @@ export default { console.log(this.form, '查看列表'); if (this.form.model === 'WE200') { this.WEClothShow = true + this.wxLiningList = [] + listAllMode({ + instrumentType: this.form.type, + instrumentModel: this.form.model + }).then((response) => { + if (response.code != 200) { + this.$message.error('模式获取失败') + } + if (response.data.length > 0) { + response.data.map((item) => { + if (item.modeDesc != null) { + item.modeName = item.modeName + "(" + item.modeDesc + ")"; + } + }) + this.Modetions = response.data + + } + }) } else { this.WEClothShow = false - this.ClothOptions = [] + // this.ClothOptions = [] // this.Modetions = [] // this.NewOptions = [] this.wxLiningList = [] @@ -2356,10 +2411,10 @@ video { } .little-red-heart { - position: absolute; - top: 2px; - left: -80px; - color: #ff4949; - font-size: 16px; + position: absolute; + top: 2px; + left: -80px; + color: #ff4949; + font-size: 16px; }