设备bug修复

dev
郑明梁 2 years ago
parent dcfcf4b51d
commit 7136b422c5

@ -18,7 +18,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="任务类型:" class="query-form-item">
<el-select v-model="filterQuery.type" style="width: 90%" placeholder="请选择计划级别" clearable>
<el-select v-model="filterQuery.type" style="width: 90%" placeholder="请选择任务类型" clearable>
<el-option label="巡检" :value=1></el-option>
<el-option label="养护" :value=2></el-option>
<el-option label="报修" :value=3></el-option>
@ -66,7 +66,8 @@
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" @current-change="handleDetail" highlight-current-row border>
<el-table v-loading="loading" :data="list" style="width: 100%" @current-change="handleDetail"
highlight-current-row border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="任务编号" prop="orderId"></el-table-column>
<el-table-column label="资产编码" prop="code"></el-table-column>
@ -87,9 +88,9 @@
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="startOrder(scope.row,2)"
type="text"
size="small"
@click.native.stop="startOrder(scope.row,2)"
>编辑
</el-button
>
@ -111,11 +112,11 @@
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="getList"
v-show="total>0"
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="getList"
></pagination>
</el-card>
@ -136,9 +137,8 @@
<!--</el-dialog>-->
<el-card class="el-card">
<el-table v-loading="loading" :data="delectList" style="width: 100%" border highlight-current-row>
<el-table v-loading="loading" :data="delectList" style="width: 100%" border highlight-current-row>
<el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="巡检项目编码" prop="projectCode" width="300"></el-table-column>
<el-table-column label="项目内容" prop="projectContent" width="500"></el-table-column>
@ -155,9 +155,9 @@
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="datailSelect(scope.row)"
type="text"
size="small"
@click.native.stop="datailSelect(scope.row)"
>详情
</el-button
>
@ -168,39 +168,38 @@
</el-card>
<el-dialog
title="巡检配置详情"
:visible.sync="deviceProjectSelectVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="40%"
v-if="deviceProjectSelectVisible"
title="巡检配置详情"
:visible.sync="deviceProjectSelectVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="40%"
v-if="deviceProjectSelectVisible"
>
<DeviceInspectTakeDetail
:detailQuery="detailQuery"
:closeDialog="closeDialog"
:detailQuery="detailQuery"
:closeDialog="closeDialog"
>
</DeviceInspectTakeDetail>
</el-dialog>
<el-dialog
:title="formMap[formName]"
:visible.sync="addTakeDetial"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="65%"
v-if="addTakeDetial"
:title="formMap[formName]"
:visible.sync="addTakeDetial"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="65%"
v-if="addTakeDetial"
>
<deviceInspectTakeAdd
:inspectTake="deviceInspectTake"
:type="type"
:formName="formName"
:closeDialog="closeDialogTake"
:inspectTake="deviceInspectTake"
:type="type"
:formName="formName"
:closeDialog="closeDialogTake"
>
</deviceInspectTakeAdd>
</el-dialog>
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/>
</div>
</template>
@ -216,7 +215,7 @@ import {
} from "@/api/inventory/deviceInspectTake";
import {previewImage, previewFile} from "@/api/purchase/supCompany";
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import DeviceInspectTakeDetail from "@/views/inventory/DeviceInspectTakeDetail"
import DeviceInspectTakeDetail from "@/views/inventory/DeviceInspectTakeDetail"
import deviceInspectTakeAdd from "@/views/inventory/DeviceInspectTakeAdd"
export default {
@ -228,15 +227,15 @@ export default {
deptCode: this.$store.getters.locDeptCode,
invCode: null,
code: null,
statusList: [0,1],//0稿 1
statusList: [0, 1],//0稿 1
page: 1,
limit: 20,
},
imgViewerVisible:false,
imgViewerVisible: false,
imgList: [],
BASE_URL: process.env.VUE_APP_BASE_API,
type:null,
delectList:[],
type: null,
delectList: [],
list: [],
total: 0,
deptList: [],
@ -262,7 +261,7 @@ export default {
formMap: {
add: "新增设备巡检任务",
edit: "编辑设备巡检任务",
datail:"详情"
datail: "详情"
},
deviceInspectTake: {
id: null,
@ -276,7 +275,7 @@ export default {
},
deviceProjectSelectVisible: false,
detailQuery: null,
addTakeDetial:false,
addTakeDetial: false,
showSearch: true,
actDateRange: [],
endDateRange: [],
@ -390,7 +389,7 @@ export default {
deptCode: this.$store.getters.locDeptCode,
invCode: null,
code: null,
statusList: [0,1],
statusList: [0, 1],
page: 1,
limit: 20,
};
@ -445,8 +444,19 @@ export default {
this.total = 0;
})
},
addTake(){
this.formName="add"
addTake() {
this.formName = "add"
this.deviceInspectTake = {
id: null,
code: null,
status: 0,
deptCode: null,
invCode: null,
deviceName: null,
orderId: null,
endTime: '',
startTime: '',
};
this.addTakeDetial = true;
},
deptChange() {
@ -469,19 +479,19 @@ export default {
getInvList() {
let params = {deptCode: this.filterQuery.deptCode};
findInvByUser(params)
.then((response) => {
this.invList = response.data || [];
this.getList();
})
.catch(() => {
});
.then((response) => {
this.invList = response.data || [];
this.getList();
})
.catch(() => {
});
},
startOrder(row,type) {
this.formName="edit"
startOrder(row, type) {
this.formName = "edit"
this.addTakeDetial = true;
this.deviceInspectTake = row;
if(type == 3){
this.formName="datail"
if (type == 3) {
this.formName = "datail"
}
this.type = type
},
@ -506,8 +516,8 @@ export default {
});
});
},
handleDetail(row){
this.selectDeviceInspecTakeDetail({taskOrderIdFk:row.orderId})
handleDetail(row) {
this.selectDeviceInspecTakeDetail({taskOrderIdFk: row.orderId})
},
selectDeviceInspecTakeDetail(obj) {
selectDeviceInspecTakeDetail(obj).then((res) => {
@ -527,12 +537,12 @@ export default {
closeDialog() {
this.deviceProjectSelectVisible = false;
},
closeDialogTake(){
closeDialogTake() {
this.addTakeDetial = false;
this.getList()
},
datailSelect(row){
datailSelect(row) {
this.detailQuery = row
this.deviceProjectSelectVisible = true
},
@ -567,7 +577,7 @@ export default {
},
},
components: {deviceInspectTakeAuditModify,ElImageViewer,DeviceInspectTakeDetail,deviceInspectTakeAdd},
components: {deviceInspectTakeAuditModify, ElImageViewer, DeviceInspectTakeDetail, deviceInspectTakeAdd},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();

@ -57,18 +57,6 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="8">
<el-form-item label="计划状态:" class="query-form-item">
<el-select v-model="filterQuery.planStatus" style="width: 90%" placeholder="请选择计划级别" clearable>
<el-option label="未启用" :value=1></el-option>
<el-option label="运行中" :value=2></el-option>
<el-option label="已结束" :value=3></el-option>
<el-option label="已过期" :value=4></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="开始时间:">
<el-date-picker
@ -85,6 +73,8 @@
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="结束时间:">
<el-date-picker

@ -89,16 +89,16 @@
</el-row>
<el-row>
<el-col :span="7">
<el-col :span="6">
<el-form-item label="时间频率:" prop="frequency">
<el-input v-model="inspectPlan.frequency" disabled type="number" placeholder="请选择时间频率"
style="width: 100%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="单位:" label-width="60px" prop="frequencyUnit">
<el-select v-model="inspectPlan.frequencyUnit" disabled style="width: 60%" placeholder="单位" clearable>
<el-col :span="4">
<el-form-item label="单位:" label-width="73px" prop="frequencyUnit">
<el-select v-model="inspectPlan.frequencyUnit" disabled style="width: 64%" placeholder="单位" clearable>
<el-option label="年" :value=1></el-option>
<el-option label="月" :value=2></el-option>
<el-option label="日" :value=3></el-option>

@ -137,15 +137,15 @@
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
@current-change="handleDetail" border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="计划单号" prop="orderId"></el-table-column>
<el-table-column label="部门" prop="deptName"></el-table-column>
<el-table-column label="仓库" prop="invName"></el-table-column>
<el-table-column label="设备名称" prop="deviceName"></el-table-column>
<el-table-column label="资产编码" prop="code"></el-table-column>
<el-table-column label="规格型号" prop="ggxh"></el-table-column>
<el-table-column label="批次号" prop="batchNo"></el-table-column>
<el-table-column label="开始时间" prop="startTime"></el-table-column>
<el-table-column label="结束时间" prop="endTime"></el-table-column>
<el-table-column label="计划单号" prop="orderId" width="150"></el-table-column>
<el-table-column label="部门" prop="deptName" width="150"></el-table-column>
<el-table-column label="仓库" prop="invName" width="150"></el-table-column>
<el-table-column label="设备名称" prop="deviceName" width="150"></el-table-column>
<el-table-column label="资产编码" prop="code" width="150"></el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="150"></el-table-column>
<el-table-column label="批次号" prop="batchNo" width="150"></el-table-column>
<el-table-column label="开始时间" prop="startTime" width="150"></el-table-column>
<el-table-column label="结束时间" prop="endTime" width="150"></el-table-column>
<el-table-column label="计划周期">
<template slot-scope="scope">
{{ scope.row.frequency }} {{ frequencyUnitMap[scope.row.frequencyUnit] }}
@ -168,7 +168,7 @@
<el-tag>{{ statusMap[scope.row.status] }}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button
type="text"

@ -50,7 +50,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="任务状态:" class="query-form-item">
<el-select v-model="filterQuery.status" style="width: 90%" placeholder="请选择任务级别" clearable>
<el-select v-model="filterQuery.status" style="width: 90%" placeholder="请选择任务状态" clearable>
<el-option label="未巡检" :value=2></el-option>
<el-option label="巡检中" :value=3></el-option>
<el-option label="已巡检" :value=4></el-option>

@ -2,15 +2,15 @@
<div>
<el-card style="margin: 5px;margin-top: -20px">
<el-form :model="inspectTake" ref="formRef" label-width="120px" style="margin-bottom: -15px" :rules="rules">
<el-button-group style="display: flex;margin: 0px 0 10px 85%; height: 35px" v-if="type != 3">
<el-button-group style="display: flex;margin: 0px 0 10px 75%; height: 35px" v-if="type != 3">
<el-button
type="primary"
@click.native="selectDevice()"
>选择设备
</el-button>
<el-button type="primary" @click.native="submit(type)">提交</el-button>
<el-button type="primary" v-if="inspectTake.status == 0" @click.native="submit(0)">稿</el-button>
<el-button type="primary" @click.native="submit(2)">提交</el-button>
</el-button-group>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="部门:" prop="deptCode">
@ -60,6 +60,33 @@
</el-col>
</el-row>
<el-row v-if="ischeck">
<el-col :span="10">
<el-form-item class="query-form-item" label="维修类型:" prop="repairType">
<el-select v-model="inspectTake.repairType"
:disabled="formName == 'edit' || type == 3"
placeholder="请选择维修类型" style="width: 90%" clearable>
<el-option label="自行维修" :value=1></el-option>
<el-option label="外部维修" :value=2></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="紧急程度:" prop="level">
<el-select v-model="inspectTake.level"
:disabled="formName == 'edit' || type == 3"
placeholder="请选择紧急程度" style="width: 90%" clearable>
<el-option label="正常" :value=1></el-option>
<el-option label="较急" :value=2></el-option>
<el-option label="特急" :value=3></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-row>
<el-col :span="10">
@ -81,7 +108,7 @@
<el-col :span="10">
<el-form-item label="项目类型:" prop="type">
<el-select v-model="inspectTake.type" style="width: 90%"
:disabled="formName == 'edit' || type == 3"
:disabled="formName == 'edit' || type == 3 || delectList.length > 0"
@change="repairType"
placeholder="请选择项目类型"
>
@ -95,32 +122,6 @@
</el-col>
</el-row>
<el-row v-if="ischeck">
<el-col :span="10">
<el-form-item class="query-form-item" label="维修类型:" prop="repairType">
<el-select v-model="inspectTake.repairType"
:disabled="formName == 'edit' || type == 3"
placeholder="请选择维修类型" style="width: 90%" clearable>
<el-option label="自行维修" :value=1></el-option>
<el-option label="外部维修" :value=2></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="紧急程度:" prop="level">
<el-select v-model="inspectTake.level"
:disabled="formName == 'edit' || type == 3"
placeholder="请选择紧急程度" style="width: 90%" clearable>
<el-option label="正常" :value=1></el-option>
<el-option label="较急" :value=2></el-option>
<el-option label="特急" :value=3></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="预期结束时间:" prop="expectedTime">
@ -227,7 +228,7 @@
<el-dialog
title="设备选入"
title="巡检任务选入"
:visible.sync="inspectSelectPlanSetVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
@ -422,7 +423,6 @@ export default {
if (val == 3) {
//
this.ischeck = true;
} else
this.ischeck = false;
@ -437,12 +437,28 @@ export default {
.catch(() => {
});
},
submit() {
submit(status) {
this.$refs["formRef"].validate((valid) => {
if (valid) {
if (this.formName == "add") {
this.inspectTake.status = 1
if(status == 2){
if(isBlank(this.inspectTake.inspectUser)){
return this.$message.error("巡检人不能为空");
}
if(isBlank(this.inspectTake.expectedTime)){
return this.$message.error("预期结束时间不能为空");
}
}
//
if(this.inspectTake.type == 3){
if(isBlank(this.inspectTake.repairType)){
return this.$message.error("维修类型不能为空");
}
if(isBlank(this.inspectTake.level)){
return this.$message.error("紧急程度不能为空");
}
}
if (this.formName == "add" && isBlank(this.inspectTake.id)) {
this.inspectTake.status = status
saveDeviceInspectTake(this.inspectTake,'add').then((res) => {
if (res.code === 20000) {
this.$message.success("提交成功");
@ -454,7 +470,7 @@ export default {
this.$message.error(error.message);
});
} else {
this.inspectTake.status = 2
this.inspectTake.status = status
uploadDeviceTake(this.inspectTake).then((res) => {
if (res.code === 20000) {
this.$message.success("提交成功");
@ -481,6 +497,9 @@ export default {
},
combine() {
if( this.selectRow == null){
return this.$message.error("请选择设备!");
}
this.deviceDialogVisible = false;
this.inspectTake.code = this.selectRow.code;
this.inspectTake.deviceName = this.selectRow.deviceName;
@ -515,7 +534,6 @@ export default {
});
},
setPlanFunction(row) {
if (this.inspectTake.orderId != null) { //edit
if (isBlank(row)) {
this.inputQuery = {};
@ -526,25 +544,27 @@ export default {
}
this.inspectTakeSetVisible = true;
} else { // add
this.inputQuery.status = 1;
this.inspectTake.type = this.inspectTake.type
this.inspectTake.status = 0;
let formName = isBlank(this.inspectTake.id) ? "add" : "edit";
saveDeviceInspectTake(this.inspectTake, formName).then((res) => {
if (res.code === 20000) {
this.inspectTake.id = res.data.id;
this.inspectTake.orderId = res.data.orderId;
this.inputQuery.taskOrderIdFk = this.inspectTake.orderId
this.inputQuery.projectCode = res.data.code;
this.inspectTakeSetVisible = true;
} else {
this.$message.error(res.message);
this.$refs["formRef"].validate((valid) => {
if (valid) {
this.inspectTake.type = this.inspectTake.type
this.inspectTake.status = 0;
let formName = isBlank(this.inspectTake.id) ? "add" : "edit";
saveDeviceInspectTake(this.inspectTake, formName).then((res) => {
if (res.code === 20000) {
this.inspectTake.id = res.data.id;
this.inspectTake.orderId = res.data.orderId;
this.inputQuery.taskOrderIdFk = this.inspectTake.orderId
this.inputQuery.projectCode = res.data.code;
this.inspectTakeSetVisible = true;
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
});
}
}).catch((error) => {
this.$message.error(error.message);
});
})
}
},
selectPlanFunction(row) {
@ -702,7 +722,7 @@ export default {
if (!isBlank(this.inspectTake.id)) {
this.selectDeviceInspecTakeDetail({taskOrderIdFk: this.inspectTake.orderId});
if (this.inspectTake.type == 3) {
this.ischeck = true
this.ischeck = true //
}
}
}

@ -189,7 +189,7 @@
</el-dialog>
<el-dialog
title="设备选入"
title="巡检任务选入"
:visible.sync="inspectSelectPlanSetVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"

@ -116,6 +116,9 @@ export default {
},
methods: {
onModifySubmit() {
if (isBlank(this.inputQuery.projectContent)) {
return this.$message.error("项目内容不能为空");
}
if(isBlank(this.inputQuery.id)){
addDeviceInspecTakeDetail(this.inputQuery).then((res) => {
this.deviceLoading = false;
@ -199,7 +202,7 @@ export default {
},
created() {
this.inputQuery.inspectImage = null
this.uploadUrl = this.BASE_URL + "/udiwms/upload/register/file";
this.headers = {
ADMIN_ID: store.getters.adminId,

@ -423,7 +423,7 @@ export default {
this.actDateRange = [];
this.edDateRange = [];
this.spaceList = [];
this.getList();
this.getDeptList();
},
onSubmit() {
this.filterQuery.page = 1;

@ -142,7 +142,8 @@ export default {
projectSetType: {
1: "巡检",
2: "养护"
2: "养护",
3: "报修"
},
formName: null,
deviceRepairOrder: {},
@ -254,6 +255,7 @@ export default {
this.Query = this.inputQuery
this.Query.result = this.selectQuery.remak
this.Query.projectContent = this.selectQuery.content
this.Query.projectCode = this.selectQuery.code
this.Query.status = 1
addDeviceInspecTakeDetail(this.Query).then((res) => {

Loading…
Cancel
Save