|
@@ -168,24 +168,14 @@
|
|
|
<!-- 添加或修改检测任务对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
- <el-form-item label="检测计划" prop="planId">
|
|
|
- <el-select v-model="form.planId" placeholder="请选择计划" clearable size="small" style="width: 100%">
|
|
|
- <el-option
|
|
|
- v-for="dict in planOperation"
|
|
|
- :key="dict.id"
|
|
|
- :label="dict.inspectionPlanName"
|
|
|
- :value="dict.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="任务名称" prop="taskName">
|
|
|
<el-input v-model="form.taskName" placeholder="请输入任务名称"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="任务编号" prop="taskCode">
|
|
|
<el-input v-model="form.taskCode" placeholder="请输入任务编号"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="任务类型" prop="planId">
|
|
|
- <el-select v-model="form.taskType" placeholder="请选择任务类型" clearable size="small" style="width: 100%">
|
|
|
+ <el-form-item label="任务类型" prop="taskType">
|
|
|
+ <el-select v-model="form.taskType" placeholder="请选择任务类型" :disabled="isEdit" clearable size="small" style="width: 100%">
|
|
|
<el-option
|
|
|
v-for="dict in taskTypeOperation"
|
|
|
:key="dict.dictValue"
|
|
@@ -194,6 +184,26 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="检测计划" prop="planId" v-if="this.form.taskType==1||this.form.taskType==null">
|
|
|
+ <el-select v-model="form.planId" placeholder="请选择计划" clearable size="small" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in planOperation"
|
|
|
+ :key="dict.id"
|
|
|
+ :label="dict.inspectionPlanName"
|
|
|
+ :value="dict.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="装置" prop="plantId" v-if="this.form.taskType==2">
|
|
|
+ <el-select v-model="form.plantId" placeholder="请选择装置" clearable size="small" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in plantOperation"
|
|
|
+ :key="dict.plantId"
|
|
|
+ :label="dict.plantName"
|
|
|
+ :value="dict.plantId"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="任务起始时间" prop="startTime">
|
|
|
<el-date-picker clearable style="width: 100%"
|
|
|
v-model="form.startTime"
|
|
@@ -239,16 +249,20 @@ import {
|
|
|
import {getAllPlan} from "@/api/task/plan";
|
|
|
import DividePoint from "@/views/task/inspection/dividePoint";
|
|
|
import PointEnter from "@/views/check/inspectionCheck/pointEnter";
|
|
|
+import {MessageBox} from "element-ui";
|
|
|
+import {getAllPlantName} from "@/api/base/plant";
|
|
|
|
|
|
export default {
|
|
|
name: "Inspection",
|
|
|
components: {PointEnter, DividePoint},
|
|
|
data() {
|
|
|
return {
|
|
|
+ isEdit:false,
|
|
|
pointVisible: false,
|
|
|
enterVisible: false,
|
|
|
taskTypeOperation: [],
|
|
|
planOperation: [],
|
|
|
+ plantOperation: [],
|
|
|
divideOperation: [],
|
|
|
// 页面高度
|
|
|
clientHeight: 300,
|
|
@@ -298,6 +312,9 @@ export default {
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
+ plantId: [
|
|
|
+ {required: true, message: '请选择装置', trigger: "blur"}
|
|
|
+ ],
|
|
|
planId: [
|
|
|
{required: true, message: '请选择计划任务', trigger: "blur"}
|
|
|
],
|
|
@@ -337,6 +354,9 @@ export default {
|
|
|
getAllPlan().then(response => {
|
|
|
this.planOperation = response.data;
|
|
|
});
|
|
|
+ getAllPlantName().then(response => {
|
|
|
+ this.plantOperation = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
openCheckPoint(row) {
|
|
@@ -419,6 +439,7 @@ export default {
|
|
|
updatedate: null
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
+ this.isEdit=false;
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
@@ -445,13 +466,14 @@ export default {
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- for (let statusKey of this.status) {
|
|
|
- if (statusKey === "1") {
|
|
|
- this.$modal.alert('已分配的任务不可修改!');
|
|
|
- return
|
|
|
- }
|
|
|
+ if (row.status != 0) {
|
|
|
+ MessageBox.alert('已分配的任务不可修改!', '注意!', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ })
|
|
|
+ return
|
|
|
}
|
|
|
this.reset();
|
|
|
+ this.isEdit=true;
|
|
|
const id = row.id || this.ids
|
|
|
getInspection(id).then(response => {
|
|
|
this.form = response.data;
|
|
@@ -470,7 +492,7 @@ export default {
|
|
|
}
|
|
|
this.reset();
|
|
|
const ids = this.ids
|
|
|
- this.$modal.confirm('是否确认分配?').then(function () {
|
|
|
+ this.$modal.confirm('是否确认分配?(若任务下无检测点则不会将其进行分配。)').then(function () {
|
|
|
return divideInspection(ids);
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
@@ -501,8 +523,23 @@ export default {
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
+ if (row.status === undefined) {
|
|
|
+ for (let i = 0; i < this.status.length; i++) {
|
|
|
+ if (this.status[i] != 0) {
|
|
|
+ MessageBox.alert('已分配的任务不可删除!', '注意!', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (row.status != 0) {
|
|
|
+ MessageBox.alert('已分配的任务不可删除!', '注意!', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除数据项?').then(function () {
|
|
|
+ this.$modal.confirm('是否确认删除数据项?(若任务下已选择密封点,则不会将该任务删除 ,请确认是否清除已选择的检测点。)').then(function () {
|
|
|
return delInspection(ids);
|
|
|
}).then(() => {
|
|
|
this.getList();
|