master
qsj 2 years ago
parent d77e1b0d42
commit f1b893a32e

@ -309,9 +309,9 @@
</el-select>
</el-form-item>
<el-form-item v-if="WEClothShow" label="膜布" prop="lining">
<div style="position: relative; left: 30px">
<i class="little-red-heart">*</i>
</div>
<div style="position: relative; left: 30px">
<i class="little-red-heart">*</i>
</div>
<el-button type="primary" @click="AddCloth()"></el-button>
</el-form-item>
@ -329,15 +329,13 @@
<el-form-item label="模式名称" :prop="`liningMode${index}`">
<el-select v-model="item.modeList" multiple placeholder="请选择"
@change="clothmodeIdsValueChang(item)">
<el-option v-for="item in Modetions" :key="item.value" :label="item.modeName"
:value="item.id">
<el-option v-for="item in Modetions" :label="item.modeName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="带NEW标识模式名称" :prop="`liningNewMode${index}`">
<el-select v-model="item.newModeIdList" multiple placeholder="请选择">
<el-option v-for="item in NewOptions" :key="item.value" :label="item.modeName"
:value="item.id">
<el-option v-for="(item, index) in NewOptions" :label="item.modeName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
@ -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;
}
</style>

Loading…
Cancel
Save