master
qsj 2 years ago
parent d77e1b0d42
commit f1b893a32e

@ -309,9 +309,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="WEClothShow" label="膜布" prop="lining"> <el-form-item v-if="WEClothShow" label="膜布" prop="lining">
<div style="position: relative; left: 30px"> <div style="position: relative; left: 30px">
<i class="little-red-heart">*</i> <i class="little-red-heart">*</i>
</div> </div>
<el-button type="primary" @click="AddCloth()"></el-button> <el-button type="primary" @click="AddCloth()"></el-button>
</el-form-item> </el-form-item>
@ -329,15 +329,13 @@
<el-form-item label="模式名称" :prop="`liningMode${index}`"> <el-form-item label="模式名称" :prop="`liningMode${index}`">
<el-select v-model="item.modeList" multiple placeholder="请选择" <el-select v-model="item.modeList" multiple placeholder="请选择"
@change="clothmodeIdsValueChang(item)"> @change="clothmodeIdsValueChang(item)">
<el-option v-for="item in Modetions" :key="item.value" :label="item.modeName" <el-option v-for="item in Modetions" :label="item.modeName" :value="item.id">
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="带NEW标识模式名称" :prop="`liningNewMode${index}`"> <el-form-item label="带NEW标识模式名称" :prop="`liningNewMode${index}`">
<el-select v-model="item.newModeIdList" multiple placeholder="请选择"> <el-select v-model="item.newModeIdList" multiple placeholder="请选择">
<el-option v-for="item in NewOptions" :key="item.value" :label="item.modeName" <el-option v-for="(item, index) in NewOptions" :label="item.modeName" :value="item.id">
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -914,7 +912,7 @@ export default {
form: {}, form: {},
// WE200 // WE200
WEClothShow: false, WEClothShow: false,
wxLiningList: [], wxLiningList: [],
ClothOptions: [], ClothOptions: [],
Modetions: [], Modetions: [],
NewOptions: [], NewOptions: [],
@ -1137,7 +1135,7 @@ export default {
we200BluetoothConnecting: null, we200BluetoothConnecting: null,
we200BluetoothConnectingTitle: null, we200BluetoothConnectingTitle: null,
we200BluetoothConnectingContent: null, we200BluetoothConnectingContent: null,
wxLiningList: null, wxLiningList: null,
} }
/* 仪器封面 */ /* 仪器封面 */
@ -1229,6 +1227,8 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.wxLiningList = []
// debugger
this.reset() this.reset()
this.open = true this.open = true
this.title = '添加仪器列' this.title = '添加仪器列'
@ -1247,7 +1247,7 @@ export default {
} }
}) })
this.mode.modeIdsOptions = response.data this.mode.modeIdsOptions = response.data
this.Modetions = JSON.parse(JSON.stringify(response.data))
} }
}) })
listLining().then(e => { listLining().then(e => {
@ -1257,13 +1257,21 @@ export default {
label: item.name label: item.name
}) })
}) })
console.log(this.ClothOptions, '111111');
}) })
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.wxLiningList = []
this.reset() this.reset()
const id = row.id || this.ids const id = row.id || this.ids
getInstrument(id).then((response) => { getInstrument(id).then((response) => {
if (response.data.model === "WE200") {
this.WEClothShow = true
this.wxLiningList = response.data.wxLiningList
}
this.form = response.data this.form = response.data
// //
this.bannerFile = { this.bannerFile = {
@ -1381,6 +1389,7 @@ export default {
instrumentType: this.form.type, instrumentType: this.form.type,
instrumentModel: this.form.model, instrumentModel: this.form.model,
}).then((response) => { }).then((response) => {
if (response.code != 200) { if (response.code != 200) {
this.$message.error('模式获取失败') this.$message.error('模式获取失败')
} }
@ -1391,7 +1400,7 @@ export default {
} }
}) })
this.mode.modeIdsOptions = response.data this.mode.modeIdsOptions = response.data
this.Modetions = JSON.parse(JSON.stringify(response.data)); this.Modetions = JSON.parse(JSON.stringify(response.data));
} }
/* 带new标识选项回显 */ /* 带new标识选项回显 */
@ -1412,10 +1421,36 @@ export default {
} }
if (temp !== undefined && temp.length > 0) { if (temp !== undefined && temp.length > 0) {
this.newModeOptionList = temp 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)) this.NewOptions = JSON.parse(JSON.stringify(temp))
} }
} }
}) })
// IOT // IOT
@ -1427,15 +1462,17 @@ export default {
this.form.we200IotVersionUpgrade this.form.we200IotVersionUpgrade
) )
listLining().then(e => { listLining().then(e => {
e.rows.forEach(item => { e.rows.forEach(item => {
this.ClothOptions.push({ this.ClothOptions.push({
value: item.id, value: item.id,
label: item.name label: item.name
}) })
}) })
}) })
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
@ -1471,18 +1508,18 @@ export default {
this.form.nurseList = this.nurseList this.form.nurseList = this.nurseList
this.form.introduceList = this.introduceList this.form.introduceList = this.introduceList
if(this.form.model == 'WE200') { if (this.form.model == 'WE200') {
if(this.wxLiningList.length == 0) { if (this.wxLiningList.length == 0) {
this.$modal.msgError('请添加膜布'); this.$modal.msgError('请添加膜布');
return return
} }
console.log("wxLiningList => ", this.wxLiningList); console.log("wxLiningList => ", this.wxLiningList);
if(this.wxLiningList.length > 0) { if (this.wxLiningList.length > 0) {
this.form.wxLiningList = this.wxLiningList; this.form.wxLiningList = this.wxLiningList;
} }
} }
console.log(this.form); console.log(this.form);
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
@ -1757,19 +1794,19 @@ export default {
this.form.we200BluetoothConnecting = null; this.form.we200BluetoothConnecting = null;
this.form.we200BluetoothConnectingTitle = null; this.form.we200BluetoothConnectingTitle = null;
this.form.we200BluetoothConnectingContent = null; this.form.we200BluetoothConnectingContent = null;
// //
this.WEClothShow = false; this.WEClothShow = false;
this.ClothOptions = [];
// this.Modetions = []; // this.Modetions = [];
// this.NewOptions = []; // this.NewOptions = [];
this.wxLiningList = []; this.wxLiningList = [];
}, },
// //
AddCloth() { AddCloth() {
this.wxLiningList.push({ this.wxLiningList.push({
id: '', id: '',
modeList: '', modeList: '',
newModeIdList: '' newModeIdList: ''
}) })
}, },
@ -1777,9 +1814,27 @@ export default {
console.log(this.form, '查看列表'); console.log(this.form, '查看列表');
if (this.form.model === 'WE200') { if (this.form.model === 'WE200') {
this.WEClothShow = true 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 { } else {
this.WEClothShow = false this.WEClothShow = false
this.ClothOptions = [] // this.ClothOptions = []
// this.Modetions = [] // this.Modetions = []
// this.NewOptions = [] // this.NewOptions = []
this.wxLiningList = [] this.wxLiningList = []
@ -2356,10 +2411,10 @@ video {
} }
.little-red-heart { .little-red-heart {
position: absolute; position: absolute;
top: 2px; top: 2px;
left: -80px; left: -80px;
color: #ff4949; color: #ff4949;
font-size: 16px; font-size: 16px;
} }
</style> </style>

Loading…
Cancel
Save