Merge branch 'master' into zjw
# Conflicts: # imt-ui/src/views/system/alarm/alarmdata/index.vue
This commit is contained in:
commit
f6e771085a
@ -106,8 +106,14 @@ public class EquipAlarmDataController {
|
||||
|
||||
@GetMapping("/isSubmitOrder/{alarmId}")
|
||||
@Operation(summary = "判断报警是否已经提交工单")
|
||||
public CommonResult<Boolean> isSubmitOrder(@PathVariable("alarmId") String alarmId){
|
||||
public CommonResult<String> isSubmitOrder(@PathVariable("alarmId") String alarmId){
|
||||
return success(equipAlarmDataService.isSubmitOrder(alarmId));
|
||||
}
|
||||
|
||||
@GetMapping("/isSubmitPatrolPlan/{alarmId}")
|
||||
@Operation(summary = "判断报警是否已经提交点检方案")
|
||||
public CommonResult<Boolean> isSubmitPatrolPlan(@PathVariable("alarmId") String alarmId){
|
||||
return success(equipAlarmDataService.isSubmitPatrolPlan(alarmId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,7 @@
|
||||
package com.inspur.module.system.controller.maintenance;
|
||||
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecordsPageReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.*;
|
||||
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
|
||||
import com.inspur.module.system.service.maintenance.MaintenanceOrderService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -110,9 +107,9 @@ public class MaintenanceOrderController {
|
||||
|
||||
@Operation(summary = "提交审批")
|
||||
@PreAuthorize("@ss.hasPermission('imt:remote-maintenance-order:submitApprove')")
|
||||
@GetMapping("/submitApprove/{id}")
|
||||
public Boolean submitApprove(@PathVariable("id") String id){
|
||||
return maintenanceOrderService.submitApprove(id);
|
||||
@PostMapping("/submitApprove")
|
||||
public Boolean submitApprove(@Valid @RequestBody MaintenanceSubmitApproveVO vo){
|
||||
return maintenanceOrderService.submitApprove(vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据设备id获取故障次数")
|
||||
@ -121,4 +118,10 @@ public class MaintenanceOrderController {
|
||||
return success(maintenanceOrderService.getMaintenanceCountByEquipId(equipId));
|
||||
}
|
||||
|
||||
@Operation(summary = "提交点检方案")
|
||||
@PostMapping("/submitPatrolPlan")
|
||||
public CommonResult<Boolean> submitPatrolPlan(@Valid @RequestBody MaintenanceSubmitPatrolPlanVO vo){
|
||||
return success(maintenanceOrderService.submitPatrolPlan(vo));
|
||||
}
|
||||
|
||||
}
|
@ -96,4 +96,6 @@ public class MaintenanceOrderRespVO {
|
||||
@Schema(description = "报告id")
|
||||
private String reportId;
|
||||
|
||||
@Schema(description = "点检方案")
|
||||
private String patrolPlan;
|
||||
}
|
@ -67,4 +67,7 @@ public class MaintenanceOrderSaveReqVO {
|
||||
@Schema(description = "报警id")
|
||||
private String alarmId;
|
||||
|
||||
@Schema(description = "点检方案")
|
||||
private String patrolPlan;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.inspur.module.system.controller.maintenance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author xusd
|
||||
* @Date 2024/9/19 17:51
|
||||
**/
|
||||
@Data
|
||||
public class MaintenanceSubmitApproveVO {
|
||||
|
||||
@Schema(description = "维修工单id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "维修工单id不能为空")
|
||||
private String maintenanceOrderId;
|
||||
|
||||
@Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}")
|
||||
private Map<String, List<Long>> startUserSelectAssignees;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.inspur.module.system.controller.maintenance.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 提交点检方案
|
||||
*
|
||||
* @Author xusd
|
||||
* @Date 2024/9/29 9:51
|
||||
**/
|
||||
@Data
|
||||
public class MaintenanceSubmitPatrolPlanVO {
|
||||
|
||||
/**
|
||||
* 维修工单id
|
||||
*/
|
||||
@NotBlank(message = "维修工单id不能为空")
|
||||
private String maintenanceOrderId;
|
||||
|
||||
/**
|
||||
* 点检方案
|
||||
*/
|
||||
@NotBlank(message = "点检方案不能为空")
|
||||
private String patrolPlan;
|
||||
|
||||
}
|
@ -85,6 +85,10 @@ public class MaintenanceOrderDO extends BaseDO {
|
||||
* 报警id
|
||||
*/
|
||||
private String alarmId;
|
||||
/**
|
||||
* 点检方案
|
||||
*/
|
||||
private String patrolPlan;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String equipNo;
|
||||
|
@ -74,7 +74,17 @@ public interface EquipAlarmDataService {
|
||||
* @Author xusd
|
||||
* @Date 16:44 2024/9/14
|
||||
* @param alarmId 报警id
|
||||
* @return java.lang.String
|
||||
*/
|
||||
String isSubmitOrder(String alarmId);
|
||||
|
||||
/**
|
||||
* 判断报警是否已经提交点检方案
|
||||
*
|
||||
* @Author xusd
|
||||
* @Date 9:16 2024/10/8
|
||||
* @param alarmId 报警id
|
||||
* @return java.lang.Boolean
|
||||
*/
|
||||
Boolean isSubmitOrder(String alarmId);
|
||||
Boolean isSubmitPatrolPlan(String alarmId);
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
package com.inspur.module.system.service.alarm;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.inspur.framework.tenant.core.aop.TenantIgnore;
|
||||
@ -105,9 +108,21 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService {
|
||||
|
||||
@Override
|
||||
@TenantIgnore
|
||||
public Boolean isSubmitOrder(String alarmId) {
|
||||
MaintenanceOrderDO maintenanceOrderDO = maintenanceOrderMapper.selectOne(MaintenanceOrderDO::getAlarmId, alarmId);
|
||||
return Objects.nonNull(maintenanceOrderDO);
|
||||
public String isSubmitOrder(String alarmId) {
|
||||
List<MaintenanceOrderDO> list = maintenanceOrderMapper.selectList(new LambdaQueryWrapper<MaintenanceOrderDO>()
|
||||
.eq(MaintenanceOrderDO::getAlarmId, alarmId)
|
||||
.eq(MaintenanceOrderDO::getStatus,-1)
|
||||
.orderByDesc(MaintenanceOrderDO::getCreateTime));
|
||||
if (CollUtil.isNotEmpty(list)){
|
||||
return list.get(0).getMaintenanceOrderId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isSubmitPatrolPlan(String alarmId) {
|
||||
List<MaintenanceOrderDO> list = maintenanceOrderMapper.selectList(new LambdaQueryWrapper<MaintenanceOrderDO>()
|
||||
.eq(MaintenanceOrderDO::getAlarmId, alarmId));
|
||||
return !CollUtil.isEmpty(list);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,7 @@
|
||||
package com.inspur.module.system.service.maintenance;
|
||||
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecordsPageReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.*;
|
||||
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
|
||||
|
||||
import javax.validation.*;
|
||||
@ -98,10 +95,10 @@ public interface MaintenanceOrderService {
|
||||
*
|
||||
* @Author xusd
|
||||
* @Date 18:19 2024/9/12
|
||||
* @param id
|
||||
* @param vo
|
||||
* @return java.lang.Boolean
|
||||
*/
|
||||
Boolean submitApprove(String id);
|
||||
Boolean submitApprove(MaintenanceSubmitApproveVO vo);
|
||||
|
||||
/**
|
||||
* 根据设备id获取故障次数
|
||||
@ -112,4 +109,14 @@ public interface MaintenanceOrderService {
|
||||
* @return java.lang.Long
|
||||
*/
|
||||
Long getMaintenanceCountByEquipId(String equipId);
|
||||
|
||||
/**
|
||||
* 提交点检方案
|
||||
*
|
||||
* @Author xusd
|
||||
* @Date 9:55 2024/9/29
|
||||
* @param vo vo
|
||||
* @return java.lang.Boolean
|
||||
*/
|
||||
Boolean submitPatrolPlan(MaintenanceSubmitPatrolPlanVO vo);
|
||||
}
|
@ -12,10 +12,7 @@ import com.inspur.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentSelectionVO;
|
||||
import com.inspur.module.system.controller.equip.vo.EquipSelectionVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecordsPageReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.*;
|
||||
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
|
||||
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceReportDO;
|
||||
import com.inspur.module.system.dal.dataobject.user.AdminUserDO;
|
||||
@ -237,20 +234,19 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean submitApprove(String id) {
|
||||
public Boolean submitApprove(MaintenanceSubmitApproveVO vo) {
|
||||
// 发起 BPM 流程
|
||||
// Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
// processInstanceVariables.put("day", day);
|
||||
Map<String, List<Long>> startUserSelectAssignees = new HashMap<>();
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(getLoginUserId(),
|
||||
new BpmProcessInstanceCreateReqDTO()
|
||||
.setProcessDefinitionKey(PROCESS_KEY)
|
||||
// .setVariables(processInstanceVariables)
|
||||
.setBusinessKey(String.valueOf(id))
|
||||
.setStartUserSelectAssignees(startUserSelectAssignees));
|
||||
.setBusinessKey(vo.getMaintenanceOrderId())
|
||||
.setStartUserSelectAssignees(vo.getStartUserSelectAssignees()));
|
||||
// 将工作流的编号、状态、审批状态,更新到 业务表 中
|
||||
return maintenanceOrderMapper.updateById(new MaintenanceOrderDO()
|
||||
.setMaintenanceOrderId(id)
|
||||
.setMaintenanceOrderId(vo.getMaintenanceOrderId())
|
||||
.setProcessInstanceId(processInstanceId)
|
||||
.setStatus(1)
|
||||
.setApproveStatus(1)) > 0;
|
||||
@ -260,4 +256,9 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
|
||||
public Long getMaintenanceCountByEquipId(String equipId) {
|
||||
return maintenanceOrderMapper.selectCount(MaintenanceOrderDO::getEquipId,equipId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean submitPatrolPlan(MaintenanceSubmitPatrolPlanVO vo) {
|
||||
return maintenanceOrderMapper.updateById(new MaintenanceOrderDO().setMaintenanceOrderId(vo.getMaintenanceOrderId()).setPatrolPlan(vo.getPatrolPlan())) > 0;
|
||||
}
|
||||
}
|
@ -67,3 +67,11 @@ export function isSubmitOrder(alarmId) {
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 判断报警是否已经提交点检方案
|
||||
export function isSubmitPatrolPlan(alarmId) {
|
||||
return request({
|
||||
url: "/imt/equip-alarm-data/isSubmitPatrolPlan/" + alarmId,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
@ -70,10 +70,11 @@ export function getRemoteMaintenanceOrderRecord(id) {
|
||||
}
|
||||
|
||||
// 提交审批
|
||||
export function submitMaintenanceApprove(id) {
|
||||
export function submitMaintenanceApprove(data) {
|
||||
return request({
|
||||
url: '/maintenance/submitApprove/' + id,
|
||||
method: 'get'
|
||||
url: '/maintenance/submitApprove',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -33,10 +33,45 @@
|
||||
<span class="el-icon-document">申请信息【{{ selectProcessInstance.name }}】</span>
|
||||
<el-button style="float: right;" type="primary" @click="selectProcessInstance = undefined">选择其它流程</el-button>
|
||||
</div>
|
||||
<el-col :span="16" :offset="6">
|
||||
<el-col :span="16" :offset="6" style="margin-top: 20px">
|
||||
<div>
|
||||
<parser :key="new Date().getTime()" :form-conf="detailForm" @submit="submitForm" />
|
||||
</div>
|
||||
<div>
|
||||
<template>
|
||||
<el-col :span="24">
|
||||
<el-card class="mb-10px">
|
||||
<template>指定审批人</template>
|
||||
<el-form
|
||||
:model="startUserSelectAssignees"
|
||||
:rules="startUserSelectAssigneesFormRules"
|
||||
ref="startUserSelectAssigneesFormRef"
|
||||
>
|
||||
<el-form-item
|
||||
v-for="userTask in startUserSelectTasks"
|
||||
:key="userTask.id"
|
||||
:label="`任务【${userTask.name}】`"
|
||||
:prop="userTask.id"
|
||||
>
|
||||
<el-select
|
||||
v-model="startUserSelectAssignees[userTask.id]"
|
||||
multiple
|
||||
placeholder="请选择审批人"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userList"
|
||||
:key="user.id"
|
||||
:label="user.nickname"
|
||||
:value="user.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</template>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
@ -61,6 +96,7 @@ import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import {decodeFields} from "@/utils/formGenerator";
|
||||
import Parser from '@/components/parser/Parser'
|
||||
import {createProcessInstance} from "@/api/bpm/processInstance";
|
||||
import {listSimpleUsers} from '@/api/system/user'
|
||||
import {getModel} from "@/api/bpm/model";
|
||||
|
||||
// 流程实例的发起
|
||||
@ -71,6 +107,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
test:[],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 表格数据
|
||||
@ -95,6 +132,9 @@ export default {
|
||||
|
||||
// 数据字典
|
||||
categoryDictDatas: getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY),
|
||||
startUserSelectAssigneesFormRules:{},
|
||||
startUserSelectTasks:[],
|
||||
userList:[],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -123,24 +163,49 @@ export default {
|
||||
},
|
||||
/** 处理选择流程的按钮操作 **/
|
||||
handleSelect(row) {
|
||||
console.log("row",row);
|
||||
// 设置选择的流程
|
||||
this.selectProcessInstance = row;
|
||||
console.log(row)
|
||||
this.startUserSelectAssignees = {}
|
||||
console.log("row",row)
|
||||
// 流程表单
|
||||
if (row.formId) {
|
||||
// 设置对应的表单
|
||||
this.detailForm = {
|
||||
...JSON.parse(row.formConf),
|
||||
fields: decodeFields(row.formFields)
|
||||
}
|
||||
|
||||
if (row.formType === 10) {
|
||||
// 加载流程图
|
||||
getProcessDefinitionBpmnXML(row.id).then(response => {
|
||||
getProcessDefinitionBpmnXML(row.id).then(async response => {
|
||||
console.log("response.data", response.data)
|
||||
this.bpmnXML = response.data.bpmnXml;
|
||||
this.startUserSelectTasks = response.data.startUserSelectTasks;
|
||||
// 设置指定审批人
|
||||
if (this.startUserSelectTasks.length > 0) {
|
||||
console.log("this.startUserSelectTasks",this.startUserSelectTasks)
|
||||
// this.detailForm.formRules.push({
|
||||
// type: 'startUserSelect',
|
||||
// props: {
|
||||
// title: '指定审批人'
|
||||
// }
|
||||
// })
|
||||
// 设置校验规则
|
||||
for (const userTask of this.startUserSelectTasks) {
|
||||
this.$set(this.startUserSelectAssignees, userTask.id, []);
|
||||
this.$set(this.startUserSelectAssigneesFormRules, userTask.id, [{required: true, message: '请选择审批人', trigger: 'change'}]);
|
||||
}
|
||||
// 加载用户列表
|
||||
await listSimpleUsers().then(res=>{
|
||||
this.userList = res.data;
|
||||
console.log("this.userList",this.userList);
|
||||
})
|
||||
}
|
||||
console.log("this.startUserSelectAssigneesFormRules",this.startUserSelectAssigneesFormRules)
|
||||
// 设置对应的表单
|
||||
this.detailForm = {
|
||||
...JSON.parse(row.formConf),
|
||||
fields: decodeFields(row.formFields),
|
||||
formRules: this.startUserSelectAssigneesFormRules,
|
||||
}
|
||||
console.log("this.detailForm",this.detailForm)
|
||||
})
|
||||
} else if (row.formCustomCreatePath) {
|
||||
this.$router.push({ path: row.formCustomCreatePath});
|
||||
// 这里暂时无需加载流程图,因为跳出到另外个 Tab;
|
||||
this.$router.push({ path: row.formCustomCreatePath, query: { id: row.id}});
|
||||
}
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
@ -364,7 +364,14 @@
|
||||
>
|
||||
<div class="repair-info">
|
||||
<el-button
|
||||
v-if="!showOrderSubmit"
|
||||
v-if="!showPatrolPlanSubmit"
|
||||
type="success"
|
||||
@click="handelPatrolPlan"
|
||||
>
|
||||
点检方案提交</el-button>
|
||||
<el-button
|
||||
<el-button
|
||||
v-if="maintenanceOrderId !== null"
|
||||
type="success"
|
||||
@click="handelMaintanence"
|
||||
>
|
||||
@ -513,7 +520,9 @@
|
||||
style="height:500px"
|
||||
></div>
|
||||
</el-dialog>
|
||||
<alarm-submit-maintenance-order-form ref="submitOrderForm" />
|
||||
<alarm-submit-maintenance-order-form ref="submitOrderForm"/>
|
||||
<alarm-submit-maintenance-patrol-plan-form ref="submitPatrolPlanForm"/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -526,6 +535,10 @@ import { getFieldList } from "@/api/data/query.js";
|
||||
import { getAlarmRules } from "@/api/system/alarm/alarmrules";
|
||||
import AlarmSubmitMaintenanceOrderForm from "@/views/system/maintenance/maintenanceInfo/alarmSubmitMaintenanceOrderForm.vue";
|
||||
import { getGatewayCardTree } from "@/api/system/gatewayinfo/card";
|
||||
import AlarmSubmitMaintenanceOrderForm
|
||||
from "@/views/system/maintenance/maintenanceInfo/alarmSubmitMaintenanceOrderForm.vue";
|
||||
import AlarmSubmitMaintenancePatrolPlanForm
|
||||
from "@/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue";
|
||||
var _ = require("lodash");
|
||||
export default {
|
||||
name: "AlarmData",
|
||||
@ -609,18 +622,32 @@ export default {
|
||||
datetimeRange: [],
|
||||
showOrderSubmit: false,
|
||||
cardOptions: [],
|
||||
maintenanceOrderId: null,
|
||||
showPatrolPlanSubmit: true,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getThrList();
|
||||
this.getTreList();
|
||||
this.getIsSubmitOrder();
|
||||
this.showSubmitButton();
|
||||
this.customerName = this.$route.query.customerName;
|
||||
this.modelName = this.$route.query.modelName;
|
||||
this.equipNo = this.$route.query.equipNo;
|
||||
this.alarmLevel = this.$route.query.alarmLevel;
|
||||
},
|
||||
methods: {
|
||||
//判断显示维修工单提交还是显示点检方案提交
|
||||
showSubmitButton(){
|
||||
EquipAlarmDataApi.isSubmitPatrolPlan(this.$route.query.equipAlarmId).then(res=>{
|
||||
this.showPatrolPlanSubmit = res.data;
|
||||
console.log("this.showPatrolPlanSubmit",this.showPatrolPlanSubmit);
|
||||
if (res.data){
|
||||
EquipAlarmDataApi.isSubmitOrder(this.$route.query.equipAlarmId).then(res=>{
|
||||
this.maintenanceOrderId = res.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
cardChange(e) {
|
||||
// console.log("选择:", e);
|
||||
// console.log("绑定:", this.dataQueryParams.nameKey);
|
||||
@ -631,13 +658,6 @@ export default {
|
||||
datetimeChange() {
|
||||
this.datetimeRange = this.formatTimeRange(this.datetimeRange);
|
||||
},
|
||||
getIsSubmitOrder() {
|
||||
EquipAlarmDataApi.isSubmitOrder(this.$route.query.equipAlarmId).then(
|
||||
(res) => {
|
||||
this.showOrderSubmit = res.data;
|
||||
}
|
||||
);
|
||||
},
|
||||
async handleAlarmDataQuery(row) {
|
||||
//需要row提供匹配数据名称和单位等信息
|
||||
this.loading = true;
|
||||
@ -679,8 +699,7 @@ export default {
|
||||
this.detailLoading = false;
|
||||
},
|
||||
/**报警趋势 */
|
||||
async handleAlarmTrend(row) {
|
||||
// console.log("row:", row);
|
||||
handleAlarmTrend(row) {
|
||||
if (_.endsWith(row.nameKey, "_diff")) {
|
||||
row.nameKey = row.nameKey.substr(0, row.nameKey.length - 5);
|
||||
}
|
||||
@ -746,6 +765,9 @@ export default {
|
||||
handelMaintanence() {
|
||||
this.$refs.submitOrderForm.open(this.$route.query.equipAlarmId);
|
||||
},
|
||||
handelPatrolPlan() {
|
||||
this.$refs.submitPatrolPlanForm.open(this.$route.query.equipAlarmId)
|
||||
},
|
||||
/**echart表初始化 */
|
||||
initchart(xData, yData, name, unit) {
|
||||
let p = new Promise((resolve) => {
|
||||
@ -787,9 +809,8 @@ export default {
|
||||
color: "#4E5969", //设置文字颜色
|
||||
},
|
||||
formatter: (prams) => {
|
||||
console.log("prams:", prams);
|
||||
let name = _.get(prams, [0, "name"]);
|
||||
let value = parseFloat(_.get(prams, [0, "value"])).toFixed(2);
|
||||
let name = parseFloat(_.get(prams, [0, "name"])).toFixed(2);
|
||||
let value = parseFloat(_.get(prams, [0, "value"])).toFixed(4);
|
||||
return (
|
||||
"<span style='color:#6D85CE'>" +
|
||||
`(${name}` +
|
||||
|
@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
|
||||
<el-card class="box-card">
|
||||
<div slot="header"><span>报警信息</span></div>
|
||||
<el-form ref="alarmForm" :model="alarmFormData" v-loading="alarmFormLoading" label-width="160px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床设备编号:" prop="equipNo">
|
||||
{{alarmFormData.equipNo}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备型号:" prop="modelName">
|
||||
{{alarmFormData.modelName}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床组件名称:" prop="componentName">
|
||||
{{alarmFormData.componentName}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床客户名称:" prop="customerName">
|
||||
{{alarmFormData.customerName}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床分析状态:" prop="equipAnalyseStatus">
|
||||
<dict-tag :type="DICT_TYPE.TREND_ANALY_STATUS" :value="alarmFormData.equipAnalyseStatus"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报警等级:" prop="alarmLevel">
|
||||
<dict-tag :type="DICT_TYPE.ALARM_LEVEL" :value="alarmFormData.alarmLevel"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="首次报警时间:" prop="firstAlarmTime">
|
||||
{{ parseTime(alarmFormData.firstAlarmTime) }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最新报警时间:" prop="latestAlarmTime">
|
||||
{{ parseTime(alarmFormData.latestAlarmTime) }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报警类型:" prop="alarmType">
|
||||
<dict-tag :type="DICT_TYPE.ALARM_TYPE" :value="alarmFormData.alarmType"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 20px">
|
||||
<div slot="header"><span>维修工单信息</span></div>
|
||||
<el-form ref="submitForm" :model="submitFormData" v-loading="submitFormLoading" :rules="submitFormRules" label-width="100px">
|
||||
<el-form-item label="点检方案" prop="patrolPlan">
|
||||
<el-input v-model="submitFormData.patrolPlan" :rows="4" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
<div style="text-align: right">
|
||||
<el-button type="primary" @click="submitOrder" >提 交</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import {getSubmitOrderDetails} from '@/api/system/alarm/equipalarmdata'
|
||||
import {parseTime} from "../../../../utils/ruoyi";
|
||||
import * as MaintenanceOrderApi from "@/api/system/maintenance/maintenance";
|
||||
|
||||
export default {
|
||||
name: "alarmSubmitMaintenanceOrderForm",
|
||||
data() {
|
||||
return {
|
||||
dialogTitle: "维修工单提交",
|
||||
dialogVisible: false,
|
||||
alarmFormData:{},
|
||||
alarmFormLoading:false,
|
||||
submitFormData:{},
|
||||
submitFormLoading:false,
|
||||
submitFormRules:{
|
||||
patrolPlan: [{ required: true, message: '点检方案不能为空', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
open(id) {
|
||||
this.alarmFormData = {};
|
||||
this.submitFormData = {};
|
||||
console.log(id);
|
||||
//获取详情
|
||||
getSubmitOrderDetails(id).then(res=>{
|
||||
console.log(res);
|
||||
if (res.data == null){
|
||||
this.$modal.msgError("未获取到设备报警信息");
|
||||
return;
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
this.alarmFormLoading = true
|
||||
this.alarmFormData = res.data;
|
||||
this.alarmFormLoading = false
|
||||
})
|
||||
},
|
||||
async submitOrder(){
|
||||
this.submitFormLoading = true;
|
||||
await this.$refs.submitForm.validate();
|
||||
console.log(this.alarmFormData);
|
||||
this.submitFormData.equipId = this.alarmFormData.equipId;
|
||||
this.submitFormData.componentId = this.alarmFormData.componentId;
|
||||
this.submitFormData.customerId = this.alarmFormData.customerId;
|
||||
this.submitFormData.alarmId = this.alarmFormData.equipAlarmId;
|
||||
this.submitFormData.status = -1;
|
||||
await MaintenanceOrderApi.createRemoteMaintenanceOrder(this.submitFormData)
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
this.dialogVisible = false;
|
||||
this.submitFormLoading = false;
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
@ -5,7 +5,7 @@
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="160px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床设备" prop="equipId">
|
||||
<el-form-item label="机床设备:" prop="equipId">
|
||||
<el-cascader
|
||||
v-model="cascaderValue"
|
||||
:options="equipCascader"
|
||||
@ -15,7 +15,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床组件" prop="componentId">
|
||||
<el-form-item label="机床组件:" prop="componentId">
|
||||
<el-select v-model="formData.componentId" placeholder="请选择机床组件">
|
||||
<el-option v-for="item in componentSelection"
|
||||
:key="item.componentId" :label="item.componentName" :value="item.componentId"/>
|
||||
@ -25,7 +25,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床客户信息" prop="customerId">
|
||||
<el-form-item label="机床客户信息:" prop="customerId">
|
||||
<el-select v-model="formData.customerId" placeholder="请选择机床客户信息">
|
||||
<el-option v-for="item in customerSelection"
|
||||
:key="item.customerId" :label="item.customerName" :value="item.customerId"/>
|
||||
@ -33,7 +33,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="故障类型" prop="faultType">
|
||||
<el-form-item label="故障类型:" prop="faultType">
|
||||
<el-select v-model="formData.faultType" placeholder="请选择故障类型">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.FAULT_TYPE)"
|
||||
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>
|
||||
@ -43,7 +43,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-form-item label="优先级:" prop="priority">
|
||||
<el-select v-model="formData.priority" placeholder="请选择优先级">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.MAINTENANCE_PRIORITY)"
|
||||
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>
|
||||
@ -51,9 +51,12 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="故障描述" prop="description">
|
||||
<el-form-item label="故障描述:" prop="description">
|
||||
<el-input v-model="formData.description" :rows="4" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="id" label="点检方案:" prop="patrolPlan">
|
||||
{{formData.patrolPlan}}
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||
@ -77,6 +80,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: null,
|
||||
userList:[],
|
||||
cascaderValue:[],
|
||||
equipCascader:[],
|
||||
@ -173,6 +177,7 @@ export default {
|
||||
},
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.id = id;
|
||||
this.dialogVisible = true;
|
||||
this.reset();
|
||||
// 修改时,设置数据
|
||||
|
@ -105,6 +105,7 @@ export default {
|
||||
name: "alarmSubmitMaintenanceOrderForm",
|
||||
data() {
|
||||
return {
|
||||
orderId: null,
|
||||
dialogTitle: "维修工单提交",
|
||||
dialogVisible: false,
|
||||
alarmFormData:{},
|
||||
@ -119,12 +120,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
open(id) {
|
||||
open(alarmId,orderId) {
|
||||
this.orderId = orderId;
|
||||
this.alarmFormData = {};
|
||||
this.submitFormData = {};
|
||||
console.log(id);
|
||||
console.log(alarmId);
|
||||
//获取详情
|
||||
getSubmitOrderDetails(id).then(res=>{
|
||||
getSubmitOrderDetails(alarmId).then(res=>{
|
||||
console.log(res);
|
||||
if (res.data == null){
|
||||
this.$modal.msgError("未获取到设备报警信息");
|
||||
@ -140,12 +142,13 @@ export default {
|
||||
this.submitFormLoading = true;
|
||||
await this.$refs.submitForm.validate();
|
||||
console.log(this.alarmFormData);
|
||||
this.submitFormData.maintenanceOrderId = this.orderId;
|
||||
this.submitFormData.equipId = this.alarmFormData.equipId;
|
||||
this.submitFormData.componentId = this.alarmFormData.componentId;
|
||||
this.submitFormData.customerId = this.alarmFormData.customerId;
|
||||
this.submitFormData.alarmId = this.alarmFormData.equipAlarmId;
|
||||
this.submitFormData.status = 0;
|
||||
await MaintenanceOrderApi.createRemoteMaintenanceOrder(this.submitFormData)
|
||||
await MaintenanceOrderApi.updateRemoteMaintenanceOrder(this.submitFormData)
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
this.dialogVisible = false;
|
||||
this.submitFormLoading = false;
|
||||
|
@ -79,7 +79,36 @@
|
||||
<!-- <el-input v-model="formData.processInstanceId" placeholder="请输入流程实例编号"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-card class="mb-10px" v-if="this.startUserSelectTasks.length > 0">
|
||||
<template>指定审批人</template>
|
||||
<el-form
|
||||
:model="startUserSelectAssignees"
|
||||
:rules="startUserSelectAssigneesFormRules"
|
||||
ref="startUserSelectAssigneesFormRef"
|
||||
>
|
||||
<el-form-item
|
||||
v-for="userTask in startUserSelectTasks"
|
||||
:key="userTask.id"
|
||||
:label="`任务【${userTask.name}】`"
|
||||
:prop="userTask.id"
|
||||
>
|
||||
<el-select
|
||||
v-model="startUserSelectAssignees[userTask.id]"
|
||||
multiple
|
||||
placeholder="请选择审批人"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userList"
|
||||
:key="user.id"
|
||||
:label="user.nickname"
|
||||
:value="user.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center;margin-top: 20px">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">提 交</el-button>
|
||||
<!-- <el-button @click="dialogVisible = false">取 消</el-button>-->
|
||||
</div>
|
||||
@ -92,12 +121,17 @@ import {getEquipCascader} from "@/api/system/equip/equipInfo";
|
||||
import {getComponentSelection} from "@/api/system/equip/componentInfo";
|
||||
import {getCustomerSelection} from "@/api/system/baseData/customerInfo";
|
||||
import {listSimpleUsers} from "@/api/system/user";
|
||||
import {getProcessDefinitionBpmnXML} from "@/api/bpm/definition";
|
||||
import {decodeFields} from "@/utils/formGenerator";
|
||||
|
||||
|
||||
export default {
|
||||
name: "RemoteMaintenanceOrderForm",
|
||||
data() {
|
||||
return {
|
||||
startUserSelectAssignees:{},
|
||||
startUserSelectAssigneesFormRules:{},
|
||||
startUserSelectTasks:[],
|
||||
userList:[],
|
||||
cascaderValue:[],
|
||||
equipCascader:[],
|
||||
@ -129,17 +163,18 @@ export default {
|
||||
// 表单校验
|
||||
// 表单校验
|
||||
formRules: {
|
||||
equipId: [{ required: true, message: '机床设备不能为空', trigger: 'blur' }],
|
||||
componentId: [{ required: true, message: '机床组件不能为空', trigger: 'blur' }],
|
||||
faultType: [{ required: true, message: '故障类型不能为空', trigger: 'blur' }],
|
||||
description: [{ required: true, message: '故障描述不能为空', trigger: 'blur' }],
|
||||
priority: [{ required: true, message: '优先级不能为空', trigger: 'blur' }],
|
||||
equipId: [{ required: true, message: '机床设备不能为空', trigger: 'change' }],
|
||||
componentId: [{ required: true, message: '机床组件不能为空', trigger: 'change' }],
|
||||
faultType: [{ required: true, message: '故障类型不能为空', trigger: 'change' }],
|
||||
description: [{ required: true, message: '故障描述不能为空', trigger: 'change' }],
|
||||
priority: [{ required: true, message: '优先级不能为空', trigger: 'change' }],
|
||||
customerId: [{ required: true, message: '机床客户信息不能为空', trigger: 'blur' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initSelection();
|
||||
this.getApproverForm();
|
||||
},
|
||||
methods: {
|
||||
//回显(多级)
|
||||
@ -211,13 +246,37 @@ export default {
|
||||
}
|
||||
this.dialogTitle = "新增远程维修工单";
|
||||
},
|
||||
getApproverForm(){
|
||||
// 加载流程图
|
||||
getProcessDefinitionBpmnXML(this.$route.query.id).then(async response => {
|
||||
console.log("response.data", response.data)
|
||||
this.bpmnXML = response.data.bpmnXml;
|
||||
this.startUserSelectTasks = response.data.startUserSelectTasks;
|
||||
// 设置指定审批人
|
||||
if (this.startUserSelectTasks.length > 0) {
|
||||
console.log("this.startUserSelectTasks",this.startUserSelectTasks)
|
||||
// 设置校验规则
|
||||
for (const userTask of this.startUserSelectTasks) {
|
||||
this.$set(this.startUserSelectAssignees, userTask.id, []);
|
||||
this.$set(this.startUserSelectAssigneesFormRules, userTask.id, [{required: true, message: '请选择审批人', trigger: 'change'}]);
|
||||
}
|
||||
}
|
||||
console.log("this.startUserSelectAssigneesFormRules",this.startUserSelectAssigneesFormRules)
|
||||
console.log("this.startUserSelectAssignees",this.startUserSelectAssignees);
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
async submitForm() {
|
||||
console.log("this.startUserSelectAssignees",this.startUserSelectAssignees);
|
||||
console.log(this.formData)
|
||||
// 校验主表
|
||||
await this.$refs["formRef"].validate();
|
||||
if (this.startUserSelectTasks.length > 0){
|
||||
await this.$refs["startUserSelectAssigneesFormRef"].validate();
|
||||
}
|
||||
this.formData.status = 1;
|
||||
console.log(this.formData)
|
||||
this.formData.startUserSelectAssignees = this.startUserSelectAssignees;
|
||||
await RemoteMaintenanceOrderApi.createRemoteMaintenanceOrder(this.formData)
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
this.$tab.closeOpenPage({ path: "/maintenance/remote-maintenance-order" });
|
||||
|
@ -37,6 +37,16 @@
|
||||
<dict-tag :type="DICT_TYPE.MAINTENANCE_PRIORITY" :value="formData.priority" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="点检方案:" prop="patrolPlan">
|
||||
{{formData.patrolPlan}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.alarmId" label="报警详情:" prop="alarmId">
|
||||
<el-button type="text" @click="goAlarmDetails(formData.alarmId)">查看报警详情</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
|
||||
<!-- 维修报告 -->
|
||||
@ -83,7 +93,7 @@ import {getEquipCascader} from "@/api/system/equip/equipInfo";
|
||||
import {getComponentSelection} from "@/api/system/equip/componentInfo";
|
||||
import {getCustomerSelection} from "@/api/system/baseData/customerInfo";
|
||||
import {listSimpleUsers} from "@/api/system/user";
|
||||
import {getProcessInstance} from "@/api/bpm/processInstance";
|
||||
import {getEquipAlarmData} from "@/api/system/alarm/equipalarmdata";
|
||||
|
||||
|
||||
export default {
|
||||
@ -144,13 +154,18 @@ export default {
|
||||
this.initFromData();
|
||||
},
|
||||
methods: {
|
||||
test(){
|
||||
this.disabled = true;
|
||||
this.evaluateDisabled = true;
|
||||
},
|
||||
test1(){
|
||||
this.disabled = false;
|
||||
this.evaluateDisabled = false;
|
||||
goAlarmDetails(alarmId){
|
||||
getEquipAlarmData(alarmId).then(res=>{
|
||||
console.log("res===》",res);
|
||||
if (res.data == null){
|
||||
this.$message.error("未查询到报警数据");
|
||||
}else {
|
||||
this.$router.push({
|
||||
path: '/alarm/alarmdata',
|
||||
query: {equipAlarmId: alarmId, customerName: res.data.customerName, modelName: res.data.modelName, equipNo:res.data.equipNo, alarmLevel: res.data.alarmLevel,}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
updateDisabled(status){
|
||||
console.log(status)
|
||||
|
@ -92,6 +92,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="维修人" align="center" prop="executorName"/>
|
||||
<el-table-column label="点检方案" align="center" prop="patrolPlan"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
@ -107,7 +108,7 @@
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.status !== 0" size="mini" type="text" icon="el-icon-coordinate" @click="openApproveRecord(scope.row.processInstanceId)">审批记录
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.status === 0" size="mini" type="text" icon="el-icon-s-promotion" @click="submitApprove(scope.row)"
|
||||
<el-button v-if="scope.row.status === 0" size="mini" type="text" icon="el-icon-s-promotion" @click="openSubmitApprove(scope.row)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:submitApprove']">提交审批
|
||||
</el-button>
|
||||
</template>
|
||||
@ -119,6 +120,105 @@
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<RemoteMaintenanceOrderForm ref="formRef" @success="getList"/>
|
||||
<approve-record ref="approve" />
|
||||
|
||||
<!-- 指定审批人弹窗 -->
|
||||
<el-dialog title="选择指定审批人" :visible.sync="submitApproveOpen" append-to-body>
|
||||
<el-form
|
||||
:model="submitApproveForm"
|
||||
:rules="startUserSelectAssigneesFormRules"
|
||||
ref="submitApproveForm"
|
||||
>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="维修工单:" prop="maintenanceOrderNo">
|
||||
{{ submitApproveForm.maintenanceOrderNo }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床设备:" prop="equipName">
|
||||
{{ submitApproveForm.equipNo }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床组件:" prop="componentName">
|
||||
{{ submitApproveForm.componentName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床客户信息:" prop="customerName">
|
||||
{{ submitApproveForm.customerName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="故障类型:" prop="faultType">
|
||||
<dict-tag :type="DICT_TYPE.FAULT_TYPE" :value="submitApproveForm.faultType"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="故障描述:" prop="description">
|
||||
{{ submitApproveForm.description }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item label="优先级:" prop="priority">
|
||||
<dict-tag :type="DICT_TYPE.MAINTENANCE_PRIORITY" :value="submitApproveForm.priority"/>
|
||||
</el-form-item>
|
||||
<!-- <el-card class="mb-10px">-->
|
||||
<!-- <template>指定审批人</template>-->
|
||||
<!-- <el-form-item-->
|
||||
<!-- v-for="userTask in startUserSelectTasks"-->
|
||||
<!-- :key="userTask.id"-->
|
||||
<!-- :label="`任务【${userTask.name}】`"-->
|
||||
<!-- :prop="userTask.id"-->
|
||||
<!-- >-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="startUserSelectAssignees[userTask.id]"-->
|
||||
<!-- multiple-->
|
||||
<!-- placeholder="请选择审批人"-->
|
||||
<!-- style="width: 100%"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="user in userList"-->
|
||||
<!-- :key="user.id"-->
|
||||
<!-- :label="user.nickname"-->
|
||||
<!-- :value="user.id"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-card>-->
|
||||
</el-form>
|
||||
<el-card class="mb-10px" v-if="this.startUserSelectTasks.length > 0">
|
||||
<template>指定审批人</template>
|
||||
<el-form
|
||||
:model="startUserSelectAssignees"
|
||||
:rules="startUserSelectAssigneesFormRules"
|
||||
ref="startUserSelectAssigneesFormRef"
|
||||
>
|
||||
<el-form-item
|
||||
v-for="userTask in startUserSelectTasks"
|
||||
:key="userTask.id"
|
||||
:label="`任务【${userTask.name}】`"
|
||||
:prop="userTask.id"
|
||||
>
|
||||
<el-select
|
||||
v-model="startUserSelectAssignees[userTask.id]"
|
||||
multiple
|
||||
placeholder="请选择审批人"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userList"
|
||||
:key="user.id"
|
||||
:label="user.nickname"
|
||||
:value="user.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: right;">
|
||||
<el-button type="primary" @click="submitApprove(submitApproveForm.maintenanceOrderId)" v-hasPermi="['imt:remote-maintenance-order:submitApprove']">提 交</el-button>
|
||||
<el-button @click="closeSubmitApprove">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -130,6 +230,8 @@ import {getCustomerSelection} from '@/api/system/baseData/customerInfo'
|
||||
import RemoteMaintenanceOrderForm from './RemoteMaintenanceOrderForm.vue';
|
||||
import {DICT_TYPE} from "@/utils/dict";
|
||||
import ApproveRecord from "@/views/bpm/processInstance/approveRecord.vue";
|
||||
import {getProcessDefinitionBpmnXML} from "@/api/bpm/definition";
|
||||
import {listSimpleUsers} from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
name: "RemoteMaintenanceOrder",
|
||||
@ -144,6 +246,12 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
submitApproveForm:{},
|
||||
startUserSelectAssignees:{},
|
||||
startUserSelectAssigneesFormRules:{},
|
||||
startUserSelectTasks:[],
|
||||
userList:[],
|
||||
submitApproveOpen: false,
|
||||
cascaderValue:[],
|
||||
equipCascader:[],
|
||||
componentSelection:[],
|
||||
@ -180,14 +288,55 @@ export default {
|
||||
this.initSelection();
|
||||
},
|
||||
methods: {
|
||||
submitApprove(row){
|
||||
closeSubmitApprove(){
|
||||
this.submitApproveOpen = false;
|
||||
this.$refs.startUserSelectAssigneesFormRef.resetFields();
|
||||
},
|
||||
openSubmitApprove(row){
|
||||
const maintenanceOrderId = row.maintenanceOrderId;
|
||||
this.$modal.confirm('是否确认提交维修工单编号为"' + row.maintenanceOrderNo + '"的数据项?').then(()=>{
|
||||
console.log(maintenanceOrderId);
|
||||
// 加载流程图实体
|
||||
getProcessDefinitionBpmnXML(null,"maintenance_approve").then(async response => {
|
||||
console.log("response.data", response.data)
|
||||
this.bpmnXML = response.data.bpmnXml;
|
||||
this.startUserSelectTasks = response.data.startUserSelectTasks;
|
||||
// 设置指定审批人
|
||||
if (this.startUserSelectTasks.length > 0) {
|
||||
this.submitApproveOpen = true;
|
||||
RemoteMaintenanceOrderApi.getRemoteMaintenanceOrderRecord(maintenanceOrderId).then(res=>{
|
||||
console.log("res.data",res.data);
|
||||
this.submitApproveForm = res.data;
|
||||
})
|
||||
listSimpleUsers().then(res=>{
|
||||
this.userList = res.data;
|
||||
})
|
||||
console.log("this.startUserSelectTasks",this.startUserSelectTasks)
|
||||
// 设置校验规则
|
||||
for (const userTask of this.startUserSelectTasks) {
|
||||
this.$set(this.startUserSelectAssignees, userTask.id, []);
|
||||
this.$set(this.startUserSelectAssigneesFormRules, userTask.id, [{required: true, message: '请选择审批人', trigger: 'change'}]);
|
||||
}
|
||||
}else {
|
||||
this.$modal.confirm('是否确认提交维修工单编号为"' + row.maintenanceOrderNo + '"的数据项?').then(()=>{
|
||||
this.submitApprove(row.maintenanceOrderId);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
async submitApprove(maintenanceOrderId){
|
||||
console.log(maintenanceOrderId);
|
||||
if (this.startUserSelectTasks.length > 0) {
|
||||
await this.$refs.startUserSelectAssigneesFormRef.validate();
|
||||
}
|
||||
const data = {
|
||||
maintenanceOrderId:maintenanceOrderId,
|
||||
startUserSelectAssignees: this.startUserSelectAssignees
|
||||
}
|
||||
await RemoteMaintenanceOrderApi.submitMaintenanceApprove(data).then(res=>{
|
||||
this.loading = true;
|
||||
RemoteMaintenanceOrderApi.submitMaintenanceApprove(maintenanceOrderId).then(res=>{
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("提交审批成功");
|
||||
})
|
||||
this.$modal.msgSuccess("提交审批成功");
|
||||
this.submitApproveOpen = false;
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
openApproveRecord(approveId){
|
||||
|
Loading…
Reference in New Issue
Block a user