|
@@ -10,7 +10,7 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="任务类型" prop="planId">
|
|
|
- <el-select v-model="form.taskType" placeholder="请选择任务类型" clearable size="small" style="width: 100%">
|
|
|
+ <el-select v-model="queryParams.taskType" @change="handleQuery" placeholder="请选择任务类型" clearable size="small" style="width: 100%">
|
|
|
<el-option
|
|
|
v-for="dict in taskTypeOperation"
|
|
|
:key="dict.dictValue"
|
|
@@ -19,16 +19,16 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="任务起始时间" prop="startTime">
|
|
|
- <el-date-picker clearable
|
|
|
+ <el-form-item label="任务起始时间" prop="startTime" label-width="100px">
|
|
|
+ <el-date-picker clearable @change="handleQuery"
|
|
|
v-model="queryParams.startTime"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="请选择任务起始时间">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="任务截止时间" prop="endTime">
|
|
|
- <el-date-picker clearable
|
|
|
+ <el-form-item label="任务截止时间" prop="endTime" label-width="100px">
|
|
|
+ <el-date-picker clearable @change="handleQuery"
|
|
|
v-model="queryParams.endTime"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
@@ -85,17 +85,18 @@
|
|
|
size="mini"
|
|
|
:disabled="multiple"
|
|
|
@click="handleDivide"
|
|
|
- v-hasPermi="['task:inspection:edit']"
|
|
|
+ v-hasPermi="['task:repairs:edit']"
|
|
|
>确认分配
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
- type="warning"
|
|
|
+ type="info"
|
|
|
plain
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
@click=""
|
|
|
+ :disabled="single"
|
|
|
v-hasPermi="['task:repair:export']"
|
|
|
>导出任务清单
|
|
|
</el-button>
|
|
@@ -104,15 +105,14 @@
|
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="repairList" @selection-change="handleSelectionChange" :height="clientHeight"
|
|
|
- border>
|
|
|
+ :cell-style="tableCellStyle" border>
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
- <el-table-column label="状态" align="center" prop="status" width="85" :formatter="divideFormat"/>
|
|
|
+ <el-table-column label="状态" align="center" prop="status" fixed="left" width="85" :formatter="divideFormat"/>
|
|
|
<el-table-column label="是否超时" align="center" prop="timeOut" fixed="left" width="85"/>
|
|
|
<el-table-column label="装置名称" align="center" prop="plantName" :show-overflow-tooltip="true" width="130"/>
|
|
|
- <el-table-column label="装置id" align="center" prop="plantId" :show-overflow-tooltip="true" width="130"/>
|
|
|
<el-table-column label="任务名称" align="center" prop="taskName" :show-overflow-tooltip="true" width="130"/>
|
|
|
<el-table-column label="任务编号" align="center" prop="taskCode" :show-overflow-tooltip="true" width="130"/>
|
|
|
- <el-table-column label="任务类型" align="center" prop="taskType" :show-overflow-tooltip="true" width="130"/>
|
|
|
+ <el-table-column label="任务类型" align="center" prop="taskType" :show-overflow-tooltip="true" width="130" :formatter="taskTypeFormat"/>
|
|
|
<el-table-column label="任务起始时间" align="center" prop="startTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
|
|
@@ -181,6 +181,16 @@
|
|
|
<el-form-item label="任务编号" prop="taskCode">
|
|
|
<el-input v-model="form.taskCode" placeholder="请输入任务编号"/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="装置" prop="plantId">
|
|
|
+ <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="planId">
|
|
|
<el-select v-model="form.taskType" placeholder="请选择任务类型" clearable size="small" style="width: 100%">
|
|
|
<el-option
|
|
@@ -223,20 +233,24 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {listRepair, getRepair, delRepair, addRepair, updateRepair} from "@/api/task/repair";
|
|
|
+import {listRepair, getRepair, delRepair, addRepair, updateRepair, divideRepair} from "@/api/task/repair";
|
|
|
import {divideInspection} from "@/api/task/inspection";
|
|
|
+import {getAllPlantName} from "@/api/base/plant";
|
|
|
|
|
|
export default {
|
|
|
name: "Repair",
|
|
|
data() {
|
|
|
return {
|
|
|
divideOperation: [],
|
|
|
+ taskTypeOperation:[],
|
|
|
+ plantOperation:[],
|
|
|
// 页面高度
|
|
|
clientHeight: 300,
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
+ divideStatus: [],
|
|
|
// 非单个禁用
|
|
|
single: true,
|
|
|
// 非多个禁用
|
|
@@ -288,11 +302,37 @@ export default {
|
|
|
this.getDicts("divide_status").then(response => {
|
|
|
this.divideOperation = response.data;
|
|
|
});
|
|
|
+ this.getDicts("repair_type").then(response => {
|
|
|
+ this.taskTypeOperation = response.data;
|
|
|
+ });
|
|
|
+ getAllPlantName().then(response => {
|
|
|
+ this.plantOperation = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
+ taskTypeFormat(row, column) {
|
|
|
+ return this.selectDictLabel(this.taskTypeOperation, row.taskType);
|
|
|
+ },
|
|
|
+ tableCellStyle({row, column, rowIndex, columnIndex}) {
|
|
|
+ if (columnIndex === 1 && row.status == 0) {
|
|
|
+ return "color:#ff0000;";
|
|
|
+ }
|
|
|
+ if (columnIndex === 1 && row.status == 1) {
|
|
|
+ return "color:#00cc00;";
|
|
|
+ }
|
|
|
+ if (columnIndex === 2 && row.timeOut === '是') {
|
|
|
+ return "color:#ff0000;";
|
|
|
+ }
|
|
|
+ if (columnIndex === 2 && row.timeOut === '否') {
|
|
|
+ return "color:#00cc00;";
|
|
|
+ }
|
|
|
+ if (columnIndex === 6) {
|
|
|
+ return "color:#00d;";
|
|
|
+ }
|
|
|
+ },
|
|
|
handleDivide() {
|
|
|
- console.log(this.status)
|
|
|
- for (const statusKey in this.status) {
|
|
|
+ console.log(this.divideStatus)
|
|
|
+ for (let statusKey of this.divideStatus) {
|
|
|
if (statusKey === "1") {
|
|
|
this.$alert('已分配的任务不可再次分配!', '注意!', {
|
|
|
confirmButtonText: '确定',
|
|
@@ -303,7 +343,7 @@ export default {
|
|
|
this.reset();
|
|
|
const ids = this.ids
|
|
|
this.$modal.confirm('是否确认分配?').then(function () {
|
|
|
- //return divideRepair(ids);
|
|
|
+ return divideRepair(ids);
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
this.$modal.msgSuccess("分配成功");
|
|
@@ -335,7 +375,7 @@ export default {
|
|
|
plantId: null,
|
|
|
taskName: null,
|
|
|
taskCode: null,
|
|
|
- taskType: null,
|
|
|
+ taskType: '1',
|
|
|
startTime: null,
|
|
|
endTime: null,
|
|
|
recipient: null,
|
|
@@ -366,6 +406,7 @@ export default {
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
+ this.divideStatus = selection.map(item => item.status)
|
|
|
this.single = selection.length !== 1
|
|
|
this.multiple = !selection.length
|
|
|
},
|