|
|
|
@ -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,7 +544,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
this.inspectTakeSetVisible = true;
|
|
|
|
|
} else { // add
|
|
|
|
|
this.inputQuery.status = 1;
|
|
|
|
|
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";
|
|
|
|
@ -544,7 +563,8 @@ export default {
|
|
|
|
|
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 //报修字段显示
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|