仪器管理-带new标识的模式

master
382696293@qq.com 2 years ago
parent 3e6cf7c010
commit 1f852e8e90

@ -225,6 +225,11 @@ public class WxInstrumentSaveReq {
*/
private List<Integer> modeIdsValue;
/**
* new
*/
private List<Integer> newModeIdList;
public Long getId() {
return id;
}
@ -528,4 +533,12 @@ public class WxInstrumentSaveReq {
public void setBluetoothConnectFailContent(String bluetoothConnectFailContent) {
this.bluetoothConnectFailContent = bluetoothConnectFailContent;
}
public List<Integer> getNewModeIdList() {
return newModeIdList;
}
public void setNewModeIdList(List<Integer> newModeIdList) {
this.newModeIdList = newModeIdList;
}
}

@ -90,6 +90,13 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
.map(WxInstrumentMode::getModeId)
.map(Long::intValue)
.collect(Collectors.toList()));
wxInstrumentSaveReq.setNewModeIdList(wxInstrumentModes.stream()
.filter(im -> im.getIsNew() == 1)
.map(WxInstrumentMode::getModeId)
.map(Long::intValue)
.collect(Collectors.toList())
);
}
return wxInstrumentSaveReq;
}
@ -183,6 +190,11 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
wxInstrumentMode.setInstrumentId(wxInstrument.getId());
wxInstrumentMode.setModeId(modeIdList.get(i).longValue());
wxInstrumentMode.setModeSort(i);
if (wxInstrumentSaveReq.getNewModeIdList() != null && wxInstrumentSaveReq.getNewModeIdList().size() > 0) {
if (wxInstrumentSaveReq.getNewModeIdList().contains(modeIdList.get(i))) {
wxInstrumentMode.setIsNew(1);
}
}
wxInstrumentMode.setStatus(Status.OK.getCode());
wxInstrumentMode.setCreateBy(SecurityUtils.getUsername());
wxInstrumentMode.setCreateTime(DateUtils.getNowDate());
@ -285,6 +297,11 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
wxInstrumentMode.setInstrumentId(wxInstrumentSaveReq.getId());
wxInstrumentMode.setModeId(modeIdList.get(i).longValue());
wxInstrumentMode.setModeSort(i);
if (wxInstrumentSaveReq.getNewModeIdList() != null && wxInstrumentSaveReq.getNewModeIdList().size() > 0) {
if (wxInstrumentSaveReq.getNewModeIdList().contains(modeIdList.get(i))) {
wxInstrumentMode.setIsNew(1);
}
}
wxInstrumentMode.setStatus(Status.OK.getCode());
wxInstrumentMode.setCreateBy(SecurityUtils.getUsername());
wxInstrumentMode.setCreateTime(DateUtils.getNowDate());

@ -470,7 +470,7 @@
</el-form-item>
<el-form-item label="模式" prop="modeIdsValue">
<template>
<el-select v-model="form.modeIdsValue" multiple placeholder="请选择模式">
<el-select v-model="form.modeIdsValue" multiple placeholder="请选择模式" @change="modeIdsValueChang">
<el-option
v-for="item in this.mode.modeIdsOptions"
:key="item.id"
@ -483,6 +483,18 @@
</el-button>
</template>
</el-form-item>
<el-form-item label="带new标识模式" prop="newModeIdList">
<template>
<el-select v-model="form.newModeIdList" multiple placeholder="请选择带new标识模式">
<el-option
v-for="item in newModeOptionList"
:key="item.id"
:label="item.modeName"
:value="item.id">
</el-option>
</el-select>
</template>
</el-form-item>
<el-form-item label="生成护理记录最短时间" prop="nursingTime">
<el-time-picker
v-model="form.nursingTime"
@ -1162,8 +1174,7 @@ export default {
instrumentId: null,
name: null,
link: null,
}
]
}]
},
/* 模式 */
mode: {
@ -1172,6 +1183,7 @@ export default {
modeIdsOptions: [],
sortMode: [],
},
newModeOptionList: [],
}
},
created() {
@ -1255,6 +1267,7 @@ export default {
nurseList: null,
introduceList: null,
modeIdsValue: [],
newModeIdList: [],
}
/* 仪器封面 */
this.bannerFile = {
@ -1317,6 +1330,7 @@ export default {
modeIdsOptions: [],
sortMode: [],
};
this.newModeOptionList = [];
this.resetForm('form')
},
/** 搜索按钮操作 */
@ -1466,7 +1480,17 @@ export default {
if (response.code != 200) {
this.$message.error('模式获取失败')
}
this.mode.modeIdsOptions = response.data
this.mode.modeIdsOptions = response.data;
/* 带new标识选项回显 */
if (this.form.modeIdsValue != null && this.form.modeIdsValue.length > 0) {
let temp = [];
for (let i = 0; i < this.form.modeIdsValue.length; i++) {
let filterModeArr = this.mode.modeIdsOptions.filter((item) => item.id == this.form.modeIdsValue[i])
temp.push(filterModeArr[0]);
}
this.newModeOptionList = temp;
}
})
})
},
@ -1944,9 +1968,6 @@ export default {
this.mode.modeSortVisible = true;
}
},
openModeIdDialog2() {
console.log(this.form.modeIdsValue);
},
handleCloseMode() {
this.mode.modeIdsValueTemp = [];
this.mode.sortMode = [];
@ -1960,6 +1981,18 @@ export default {
this.form.modeIdsValue = newSort;
this.handleCloseMode()
},
modeIdsValueChang() {
let temp = [];
if (this.form.modeIdsValue.length > 0) {
for (let i = 0; i < this.form.modeIdsValue.length; i++) {
let filterModeArr = this.mode.modeIdsOptions.filter((item) => item.id == this.form.modeIdsValue[i])
temp.push(filterModeArr[0]);
}
}
this.newModeOptionList = temp;
},
},
}
</script>

Loading…
Cancel
Save