master
382696293@qq.com 2 years ago
parent d41b7aaf59
commit bea41eb564

@ -448,7 +448,7 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
for (int i = 0; i < newModeIdList.size(); i++) { for (int i = 0; i < newModeIdList.size(); i++) {
WxInstrumentMode wxInstrumentMode = new WxInstrumentMode(); WxInstrumentMode wxInstrumentMode = new WxInstrumentMode();
wxInstrumentMode.setInstrumentId(wxInstrument.getId()); wxInstrumentMode.setInstrumentId(wxInstrument.getId());
wxInstrumentMode.setModeId(modeIdList.get(i).longValue()); wxInstrumentMode.setModeId(newModeIdList.get(i).longValue());
wxInstrumentMode.setModeSort(i); wxInstrumentMode.setModeSort(i);
wxInstrumentMode.setIsNew(1); wxInstrumentMode.setIsNew(1);
wxInstrumentMode.setLiningId(liningId); wxInstrumentMode.setLiningId(liningId);

@ -308,31 +308,34 @@
:value="dict.value"></el-option> :value="dict.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="FrClothShow" label="膜布"> <el-form-item v-if="WEClothShow" label="膜布">
<div style="position: relative; left: 30px">
<i class="little-red-heart">*</i>
</div>
<el-button type="primary" @click="AddCloth()"></el-button> <el-button type="primary" @click="AddCloth()"></el-button>
</el-form-item> </el-form-item>
<div v-for="(item, index) in AddFrCloth" :key="index"> <div v-for="(item, index) in wxLiningList" :key="index">
<el-form-item label="膜布组"> <el-form-item label="膜布组">
</el-form-item> </el-form-item>
<el-form-item label="膜布名称"> <el-form-item label="膜布名称">
<el-select v-model="item.clothName" multiple placeholder="请选择"> <el-select v-model="item.id" placeholder="请选择">
<el-option v-for="item in ClothOptions" :key="item.value" :label="item.label" <el-option v-for="item in ClothOptions" :key="item.value" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="模式名称"> <el-form-item label="模式名称">
<el-select v-model="item.modeName" 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" :key="item.value" :label="item.modeName"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item>modeIdsValue </el-form-item>
<el-form-item label="带NEW标识模式名称"> <el-form-item label="带NEW标识模式名称">
<el-select v-model="item.NEWname" 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 in NewOptions" :key="item.value" :label="item.modeName"
:value="item.id"> :value="item.id">
</el-option> </el-option>
@ -345,7 +348,7 @@
inactive-color="#DCDCDC"> inactive-color="#DCDCDC">
</el-switch> </el-switch>
</el-form-item> </el-form-item>
<el-form-item label="模式" prop="modeIdsValue"> <el-form-item v-if="!WEClothShow" label="模式" prop="modeIdsValue">
<template> <template>
<el-select v-model="form.modeIdsValue" multiple placeholder="请选择模式" @change="modeIdsValueChang"> <el-select v-model="form.modeIdsValue" multiple placeholder="请选择模式" @change="modeIdsValueChang">
<el-option v-for="item in this.mode.modeIdsOptions" :key="item.id" :label="item.modeName" <el-option v-for="item in this.mode.modeIdsOptions" :key="item.id" :label="item.modeName"
@ -359,7 +362,7 @@
</el-button> </el-button>
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="带NEW标识模式" prop="newModeIdList"> <el-form-item v-if="!WEClothShow" label="带NEW标识模式" prop="newModeIdList">
<template> <template>
<el-select v-model="form.newModeIdList" multiple placeholder="请选择带new标识模式"> <el-select v-model="form.newModeIdList" multiple placeholder="请选择带new标识模式">
<el-option v-for="item in newModeOptionList" :key="item.id" :label="item.modeName" <el-option v-for="item in newModeOptionList" :key="item.id" :label="item.modeName"
@ -755,9 +758,10 @@ import { listLining } from "@/api/system/lining";
import { upload } from '@/api/upload' import { upload } from '@/api/upload'
import draggable from 'vuedraggable' import draggable from 'vuedraggable'
import log from "@/views/monitor/job/log.vue";
let validateArrayNotEmpty = (rule, value, callback) => { let validateArrayNotEmpty = (rule, value, callback) => {
console.log(rule, value, callback, '查看'); console.log(rule, value, callback, '查看');
if (this.AddFrCloth.length === 0) { if (this.wxLiningList.length === 0) {
callback(new Error('数组不能为空')); callback(new Error('数组不能为空'));
} else { } else {
callback(); callback();
@ -908,9 +912,9 @@ export default {
}, },
// //
form: {}, form: {},
// FR200 // WE200
FrClothShow: false, WEClothShow: false,
AddFrCloth: [], wxLiningList: [],
ClothOptions: [], ClothOptions: [],
Modetions: [], Modetions: [],
NewOptions: [], NewOptions: [],
@ -1133,6 +1137,7 @@ export default {
we200BluetoothConnecting: null, we200BluetoothConnecting: null,
we200BluetoothConnectingTitle: null, we200BluetoothConnectingTitle: null,
we200BluetoothConnectingContent: null, we200BluetoothConnectingContent: null,
wxLiningList: null,
} }
/* 仪器封面 */ /* 仪器封面 */
@ -1224,7 +1229,6 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset() this.reset()
this.open = true this.open = true
this.title = '添加仪器列' this.title = '添加仪器列'
@ -1236,36 +1240,30 @@ export default {
if (response.code != 200) { if (response.code != 200) {
this.$message.error('模式获取失败') this.$message.error('模式获取失败')
} }
if (response.data.length > 0) { if (response.data.length > 0) {
response.data.map((item) => { response.data.map((item) => {
if (item.modeDesc != null) { if (item.modeDesc != null) {
item.modeName = item.modeName + "" + item.modeDesc + ""; item.modeName = item.modeName + "" + item.modeDesc + "";
} }
}) })
console.log(response.data, 'response.dataresponse.data');
this.Modetions = JSON.parse(JSON.stringify(response.data))
this.mode.modeIdsOptions = response.data this.mode.modeIdsOptions = response.data
this.Modetions = JSON.parse(JSON.stringify(response.data))
} }
}) })
listLining().then(e => { listLining().then(e => {
e.rows.forEach(item => { e.rows.forEach(item => {
this.ClothOptions.push({ this.ClothOptions.push({
value: item.name, value: item.id,
label: item.name label: item.name
}) })
}) })
}) })
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset() this.reset()
const id = row.id || this.ids const id = row.id || this.ids
getInstrument(id).then((response) => { getInstrument(id).then((response) => {
this.form = response.data this.form = response.data
// //
this.bannerFile = { this.bannerFile = {
@ -1393,6 +1391,7 @@ export default {
} }
}) })
this.mode.modeIdsOptions = response.data this.mode.modeIdsOptions = response.data
this.Modetions = JSON.parse(JSON.stringify(response.data));
} }
/* 带new标识选项回显 */ /* 带new标识选项回显 */
@ -1427,6 +1426,15 @@ export default {
this.form.we200IotVersionUpgrade = decodeURIComponent( this.form.we200IotVersionUpgrade = decodeURIComponent(
this.form.we200IotVersionUpgrade this.form.we200IotVersionUpgrade
) )
listLining().then(e => {
e.rows.forEach(item => {
this.ClothOptions.push({
value: item.id,
label: item.name
})
})
})
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -1462,6 +1470,19 @@ 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.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) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
@ -1739,24 +1760,23 @@ export default {
}, },
// //
AddCloth() { AddCloth() {
console.log('添加膜布'); this.wxLiningList.push({
this.AddFrCloth.push({ id: '',
clothName: '', modeList: '',
modeName: '', newModeIdList: ''
NEWname: ''
}) })
}, },
modelChange() { modelChange() {
console.log(this.form, '查看列表'); console.log(this.form, '查看列表');
if (this.form.model === 'FR200') { if (this.form.model === 'WE200') {
this.FrClothShow = true this.WEClothShow = true
} else { } else {
this.FrClothShow = false this.WEClothShow = false
this.ClothOptions = [] this.ClothOptions = []
this.Modetions = [] this.Modetions = []
this.NewOptions = [] this.NewOptions = []
this.AddFrCloth = [] this.wxLiningList = []
} }
/* 模式选项 */ /* 模式选项 */
@ -2173,19 +2193,16 @@ export default {
}, },
clothmodeIdsValueChang(e) { clothmodeIdsValueChang(e) {
let temp = [] let temp = []
if (e.modeName.length > 0) { if (e.modeList.length > 0) {
for (let i = 0; i < e.modeName.length; i++) { for (let i = 0; i < e.modeList.length; i++) {
let filterModeArr = this.Modetions.filter( let filterModeArr = this.Modetions.filter(
(item) => item.id == e.modeName[i] (item) => item.id == e.modeList[i]
) )
temp.push(filterModeArr[0]) temp.push(filterModeArr[0])
} }
} }
this.NewOptions = temp this.NewOptions = temp
}, },
// //
handleBeforeUpload(file) { handleBeforeUpload(file) {
@ -2331,4 +2348,12 @@ video {
left: -184px; left: -184px;
color: #faad14; color: #faad14;
} }
.little-red-heart {
position: absolute;
top: 2px;
left: -80px;
color: #ff4949;
font-size: 16px;
}
</style> </style>

Loading…
Cancel
Save