feat: 设备管理优化-0512-增加移除类型

演示数据2.0
chenhc 1 year ago
parent d228e1d9e7
commit b39d16f0dc

@ -195,6 +195,14 @@
<deptSelect class="width-full" :value.sync="createData.deptCode"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="移除类型: " prop="destroyType" v-if="createData.type == deviceChangeType.DESTROY.key" >
<el-select v-model="createData.destroyType" style="width: 85%" placeholder="请选择移除类型" clearable="true" >
<el-option key=1 label="报废" :value=1> </el-option>
<el-option key=2 label="销毁" :value=2> </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">

@ -36,6 +36,7 @@ let createData = {
type: deviceChangeType.CHANGE.key,
toDeptCode: null,
deptCode: null,
destroyType: null,
name: null,
remark: null,
items: []
@ -148,7 +149,7 @@ export default {
} else if (this.type == deviceChangeType.CHANGE) {
this.createTitle = "设备变更";
} else if (this.type == deviceChangeType.DESTROY) {
this.createTitle = "设备报废";
this.createTitle = "设备移除";
}
this.getList()
@ -183,31 +184,6 @@ export default {
});
},
saveCache() {
// let data = window.localStorage.getItem(this.cacheKey)
// if (data == null) {
// data = {
// createActive: this.createActive,
// createData: this.createData,
// itemList: this.itemList
// }
// window.localStorage.setItem(this.cacheKey, JSON.stringify(data))
// this.showCreateDialog = false
// } else {
// this.$confirm("检测到已经挂起了一单,如继续挂起将会覆盖之前的单,是否继续", "提示", {
// confirmButtonText: "继续",
// cancelButtonText: "取消",
// type: "warning",
// }).then(() => {
// data = {
// createActive: this.createActive,
// createData: this.createData,
// itemList: this.itemList
// }
// window.localStorage.setItem(this.cacheKey, JSON.stringify(data))
// this.showCreateDialog = false
// })
// }
this.createData.items = this.itemList
let loading = this.$loading({
@ -248,7 +224,20 @@ export default {
})
return
}
} else {
} else if (this.createData.type == deviceChangeType.CHANGE.key){
let index = this.itemList.findIndex(i => !i.deviceCode && !i.productId);
if (index != -1) {
this.$confirm(`请先移除空行,第${index + 1}`, "提示", {
confirmButtonText: "确定",
type: "error",
})
return
}
}else if (this.createData.type == deviceChangeType.DESTROY.key){
if (this.createData.destroyType == null){
this.$message.warning("请选择移除类型后在立即提交")
return
}
let index = this.itemList.findIndex(i => !i.deviceCode && !i.productId);
if (index != -1) {
this.$confirm(`请先移除空行,第${index + 1}`, "提示", {

@ -1,4 +1,4 @@
import {deviceAllPage, deviceLogs, detailPage, genDeviceQR,detailByDeptCodePage} from "@/api/dev/deviceInfoApi";
import {deviceDetailInfo,deviceAllPage, deviceLogs, detailPage, genDeviceQR,detailByDeptCodePage} from "@/api/dev/deviceInfoApi";
import {deviceChangeStatus, deviceChangeType, deviceStatus} from "@/utils/enum";
import {downloadBase64Image} from "@/utils";
import deptDeviceDetail from "@/views/dev/DeptDeviceDetail.vue";
@ -144,7 +144,7 @@ export default {
this.loading = false
return
}
detailByDeptCodePage(this.query).then(res => {
deviceDetailInfo(this.query).then(res => {
this.loading = false
if (res.code != 20000) {
this.$message.error(res.message)

Loading…
Cancel
Save