维修工单新增时推送用户消息功能;维修工单新增时表单功能优化修改:设备树反馈更新
This commit is contained in:
parent
55c8a8edcb
commit
6677b3b0b8
@ -0,0 +1,28 @@
|
||||
package com.inspur.module.system.constant;
|
||||
|
||||
/**
|
||||
* @Author zhangjunwen
|
||||
* @create 2024/10/30
|
||||
*/
|
||||
public class NoticeType {
|
||||
/**
|
||||
* 通知
|
||||
*/
|
||||
public static final Integer NOTICE = 1;
|
||||
|
||||
/**
|
||||
* 公告
|
||||
*/
|
||||
public static final Integer BULLETIN = 2;
|
||||
|
||||
/**
|
||||
* 维修工单通知
|
||||
*/
|
||||
public static final Integer MAINTENANCE_ORDER = 3;
|
||||
|
||||
/**
|
||||
* 点检工单通知
|
||||
*/
|
||||
public static final Integer INSPECTION_ORDER = 4;
|
||||
|
||||
}
|
@ -28,5 +28,8 @@ public class NoticeRespVO {
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "租户编号")
|
||||
private Integer tenantId;
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "工单编号")
|
||||
private String orderId;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.inspur.module.system.controller.admin.notice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@ -9,6 +10,7 @@ import javax.validation.constraints.Size;
|
||||
|
||||
@Schema(description = "管理后台 - 通知公告创建/修改 Request VO")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class NoticeSaveReqVO {
|
||||
|
||||
@Schema(description = "岗位公告编号", example = "1024")
|
||||
@ -30,5 +32,8 @@ public class NoticeSaveReqVO {
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "租户编号")
|
||||
private Integer tenantId;
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "工单编号")
|
||||
private String orderId;
|
||||
}
|
||||
|
@ -57,4 +57,7 @@ public class NotifyMessageRespVO {
|
||||
|
||||
@Schema(description = "租户编号")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "工单编号")
|
||||
private String orderId;
|
||||
}
|
||||
|
@ -117,8 +117,8 @@ public class ComponentInfoController {
|
||||
@GetMapping("/selection")
|
||||
@Operation(summary = "机床组件信息下拉")
|
||||
@PreAuthorize("@ss.hasPermission('imt:component-info:query')")
|
||||
public List<ComponentSelectionVO> selection(){
|
||||
return componentInfoService.selection();
|
||||
public List<ComponentSelectionVO> selection(String equipId){
|
||||
return componentInfoService.selection(equipId);
|
||||
}
|
||||
|
||||
}
|
@ -86,7 +86,7 @@ public class EquipInfoController {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('imt:equip-info:query')")
|
||||
public CommonResult<EquipInfoRespVO> getEquipInfo(@RequestParam("id") String id) {
|
||||
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(id);//
|
||||
EquipInfoDetailsDTO equipInfo = equipInfoService.getEquipInfo(id);
|
||||
return success(BeanUtils.toBean(equipInfo, EquipInfoRespVO.class));
|
||||
}
|
||||
|
||||
|
@ -46,5 +46,9 @@ public class NoticeDO extends BaseDO {
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
private Integer tenantId;
|
||||
private Long tenantId;
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
private String orderId;
|
||||
}
|
||||
|
@ -115,5 +115,10 @@ public class NotifyMessageDO extends BaseDO {
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
private Integer tenantId;
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 工单ID
|
||||
*/
|
||||
private String orderId;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.inspur.module.system.dal.mysql.equip;
|
||||
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.framework.common.util.object.BeanUtils;
|
||||
import com.inspur.framework.common.util.string.StrUtils;
|
||||
import com.inspur.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.inspur.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentInfoPageReqVO;
|
||||
@ -9,7 +10,9 @@ import com.inspur.module.system.controller.equip.vo.ComponentSelectionVO;
|
||||
import com.inspur.module.system.dal.dataobject.equip.ComponentInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 机床组件信息 Mapper
|
||||
@ -29,8 +32,13 @@ public interface ComponentInfoMapper extends BaseMapperX<ComponentInfoDO> {
|
||||
.orderByDesc(ComponentInfoDO::getCreateTime));
|
||||
}
|
||||
|
||||
default List<ComponentSelectionVO> selection(){
|
||||
List<ComponentInfoDO> componentInfoDOS = selectList();
|
||||
default List<ComponentSelectionVO> selection(String equipId){
|
||||
List<ComponentInfoDO> componentInfoDOS;
|
||||
if (equipId != null && !"".equals(equipId.trim())) {
|
||||
componentInfoDOS = selectList("equip_id", equipId);
|
||||
}else {
|
||||
componentInfoDOS = selectList();
|
||||
}
|
||||
return BeanUtils.toBean(componentInfoDOS, ComponentSelectionVO.class);
|
||||
}
|
||||
}
|
@ -61,5 +61,5 @@ public interface ComponentInfoService {
|
||||
* @Date 11:20 2024/9/4
|
||||
* @return java.util.List<com.inspur.module.system.controller.equip.vo.ComponentSelectionVO>
|
||||
*/
|
||||
List<ComponentSelectionVO> selection();
|
||||
List<ComponentSelectionVO> selection(String equipId);
|
||||
}
|
@ -96,7 +96,7 @@ public class ComponentInfoServiceImpl implements ComponentInfoService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComponentSelectionVO> selection() {
|
||||
return componentInfoMapper.selection();
|
||||
public List<ComponentSelectionVO> selection(String equipId) {
|
||||
return componentInfoMapper.selection(equipId);
|
||||
}
|
||||
}
|
@ -9,9 +9,12 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.inspur.framework.common.enums.CommonStatusEnum;
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.framework.common.util.spring.SpringUtils;
|
||||
import com.inspur.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.inspur.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.inspur.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import com.inspur.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.inspur.module.system.constant.NoticeType;
|
||||
import com.inspur.module.system.controller.admin.notice.vo.NoticeSaveReqVO;
|
||||
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;
|
||||
@ -23,6 +26,7 @@ import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO;
|
||||
import com.inspur.module.system.dal.dataobject.inspection.InspectionInfoDO;
|
||||
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.notify.NotifyMessageDO;
|
||||
import com.inspur.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper;
|
||||
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderRecordMapper;
|
||||
@ -33,6 +37,8 @@ import com.inspur.module.system.service.equip.ComponentInfoService;
|
||||
import com.inspur.module.system.service.equip.EquipInfoService;
|
||||
import com.inspur.module.system.service.inspection.InspectionInfoService;
|
||||
import com.inspur.module.system.service.inspection.InspectionInfoServiceImpl;
|
||||
import com.inspur.module.system.service.notice.NoticeService;
|
||||
import com.inspur.module.system.service.notify.NotifyMessageService;
|
||||
import com.inspur.module.system.service.user.AdminUserService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.task.api.Task;
|
||||
@ -90,6 +96,9 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
|
||||
@Resource
|
||||
private AlarmDataService alarmDataService;
|
||||
|
||||
@Resource
|
||||
private NotifyMessageService notifyMessageService;
|
||||
|
||||
/**
|
||||
* OA 请假对应的流程定义 KEY
|
||||
*/
|
||||
@ -145,6 +154,19 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
|
||||
// 将工作流的编号,更新到 业务表 中
|
||||
maintenanceOrderMapper.updateById(new MaintenanceOrderDO().setMaintenanceOrderId(remoteMaintenanceOrder.getMaintenanceOrderId()).setProcessInstanceId(processInstanceId));
|
||||
}
|
||||
//消息推送
|
||||
// NoticeSaveReqVO noticeSaveReqVO = new NoticeSaveReqVO(null, "维修工单", NoticeType.MAINTENANCE_ORDER,"您有一个新的维修工单,请及时处理!", 0, remoteMaintenanceOrder.getTenantId(), remoteMaintenanceOrder.getMaintenanceOrderId());
|
||||
// noticeService.createNotice(noticeSaveReqVO);
|
||||
NotifyMessageDO noticeMessageDO = new NotifyMessageDO();
|
||||
noticeMessageDO.setOrderId(remoteMaintenanceOrder.getMaintenanceOrderId());
|
||||
noticeMessageDO.setTitle("新增维修工单通知");
|
||||
noticeMessageDO.setContent("您有一个新的维修工单,请及时处理!");
|
||||
noticeMessageDO.setType(NoticeType.MAINTENANCE_ORDER);
|
||||
noticeMessageDO.setReadStatus(false);
|
||||
noticeMessageDO.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
noticeMessageDO.setTemplateNickname(SecurityFrameworkUtils.getLoginUserNickname());
|
||||
noticeMessageDO.setTenantId(remoteMaintenanceOrder.getTenantId());
|
||||
notifyMessageService.createNotifyMessage(noticeMessageDO);
|
||||
// 返回
|
||||
return remoteMaintenanceOrder.getMaintenanceOrderId();
|
||||
}
|
||||
@ -203,7 +225,7 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
|
||||
if (CollUtil.isNotEmpty(list)){
|
||||
List<EquipSelectionVO> equipList = equipInfoService.selection();
|
||||
Map<String, String> equipMap = equipList.stream().collect(Collectors.toMap(EquipSelectionVO::getEquipId, EquipSelectionVO::getEquipNo));
|
||||
List<ComponentSelectionVO> componentList = componentInfoService.selection();
|
||||
List<ComponentSelectionVO> componentList = componentInfoService.selection(null);
|
||||
Map<String, String> componentMap = componentList.stream().collect(Collectors.toMap(ComponentSelectionVO::getComponentId, ComponentSelectionVO::getComponentName));
|
||||
List<CustomerInfoSelectionVO> customerList = customerInfoService.selection(true);
|
||||
Map<String, String> customerMap = customerList.stream().collect(Collectors.toMap(CustomerInfoSelectionVO::getCustomerId, CustomerInfoSelectionVO::getCustomerName));
|
||||
@ -248,7 +270,7 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
|
||||
if (CollUtil.isNotEmpty(list)){
|
||||
List<EquipSelectionVO> equipList = equipInfoService.selection();
|
||||
Map<String, String> equipMap = equipList.stream().collect(Collectors.toMap(EquipSelectionVO::getEquipId, EquipSelectionVO::getEquipNo));
|
||||
List<ComponentSelectionVO> componentList = componentInfoService.selection();
|
||||
List<ComponentSelectionVO> componentList = componentInfoService.selection(null);
|
||||
Map<String, String> componentMap = componentList.stream().collect(Collectors.toMap(ComponentSelectionVO::getComponentId, ComponentSelectionVO::getComponentName));
|
||||
List<CustomerInfoSelectionVO> customerList = customerInfoService.selection(true);
|
||||
Map<String, String> customerMap = customerList.stream().collect(Collectors.toMap(CustomerInfoSelectionVO::getCustomerId, CustomerInfoSelectionVO::getCustomerName));
|
||||
@ -272,7 +294,7 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
|
||||
MaintenanceOrderRespVO vo = BeanUtils.toBean(remoteMaintenanceOrder, MaintenanceOrderRespVO.class);
|
||||
List<EquipSelectionVO> equipList = equipInfoService.selection();
|
||||
Map<String, String> equipMap = equipList.stream().collect(Collectors.toMap(EquipSelectionVO::getEquipId, EquipSelectionVO::getEquipNo));
|
||||
List<ComponentSelectionVO> componentList = componentInfoService.selection();
|
||||
List<ComponentSelectionVO> componentList = componentInfoService.selection(null);
|
||||
Map<String, String> componentMap = componentList.stream().collect(Collectors.toMap(ComponentSelectionVO::getComponentId, ComponentSelectionVO::getComponentName));
|
||||
List<CustomerInfoSelectionVO> customerList = customerInfoService.selection(true);
|
||||
Map<String, String> customerMap = customerList.stream().collect(Collectors.toMap(CustomerInfoSelectionVO::getCustomerId, CustomerInfoSelectionVO::getCustomerName));
|
||||
|
@ -1,61 +1,62 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 创建机床组件信息
|
||||
export function createComponentInfo(data) {
|
||||
return request({
|
||||
url: '/equip/component/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
url: "/equip/component/create",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新机床组件信息
|
||||
export function updateComponentInfo(data) {
|
||||
return request({
|
||||
url: '/equip/component/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
url: "/equip/component/update",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除机床组件信息
|
||||
export function deleteComponentInfo(id) {
|
||||
return request({
|
||||
url: '/equip/component/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
url: "/equip/component/delete?id=" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
// 获得机床组件信息
|
||||
export function getComponentInfo(id) {
|
||||
return request({
|
||||
url: '/equip/component/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/equip/component/get?id=" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 获得机床组件信息分页
|
||||
export function getComponentInfoPage(params) {
|
||||
return request({
|
||||
url: '/equip/component/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
url: "/equip/component/page",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
// 导出机床组件信息 Excel
|
||||
export function exportComponentInfoExcel(params) {
|
||||
return request({
|
||||
url: '/equip/component/export-excel',
|
||||
method: 'get',
|
||||
url: "/equip/component/export-excel",
|
||||
method: "get",
|
||||
params,
|
||||
responseType: 'blob'
|
||||
})
|
||||
responseType: "blob",
|
||||
});
|
||||
}
|
||||
|
||||
// 机床组件下拉
|
||||
export function getComponentSelection() {
|
||||
export function getComponentSelection(params) {
|
||||
return request({
|
||||
url: '/equip/component/selection',
|
||||
method: 'get'
|
||||
})
|
||||
url: "/equip/component/selection",
|
||||
method: "get",
|
||||
params: params,
|
||||
});
|
||||
}
|
||||
|
@ -275,6 +275,7 @@ export default {
|
||||
}
|
||||
},
|
||||
leftChildNodes() {
|
||||
console.log("treeNode:", this.node);
|
||||
if (this.tree.store.onlyBothTree) {
|
||||
if (this.isLeftChildNode) {
|
||||
return this.node.childNodes;
|
||||
|
@ -47,6 +47,7 @@
|
||||
default-expand-all
|
||||
:isClickInput="true"
|
||||
:current-lable-class-name="renderCurrentClass"
|
||||
:render-content="renderContent"
|
||||
@node-click="nodeClick"
|
||||
@comment-submitted="handleCommentSubmitted"
|
||||
>
|
||||
@ -150,6 +151,45 @@ export default {
|
||||
this.eventBus.$off("inputCompleted");
|
||||
},
|
||||
methods: {
|
||||
renderContent(h, node) {
|
||||
// console.log("h:", h);
|
||||
// console.log("node:", node);
|
||||
|
||||
const title = h("div", { class: "title" }, [node.data.inspectionName]);
|
||||
|
||||
// 创建“反馈:”前缀
|
||||
const feedbackPrefix = h(
|
||||
"span",
|
||||
{
|
||||
style: { color: "blue", fontWeight: "bold" }, // 使用内联样式
|
||||
class: "feedback-prefix",
|
||||
},
|
||||
["反馈:"]
|
||||
);
|
||||
|
||||
// 创建反馈内容
|
||||
const feedbackText = h(
|
||||
"span",
|
||||
{
|
||||
style: {
|
||||
whiteSpace: "nowrap",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
},
|
||||
domProps: { title: `反馈:${node.data.inspectionName}` },
|
||||
},
|
||||
[node.data.inspectionName]
|
||||
);
|
||||
|
||||
// 将前缀和内容组合在一起
|
||||
const feedback = h("div", { class: "feedback" }, [
|
||||
feedbackPrefix,
|
||||
feedbackText,
|
||||
]);
|
||||
|
||||
// 返回整个节点的内容
|
||||
return h("div", { class: "node-content" }, [title, h("hr"), feedback]);
|
||||
},
|
||||
handleGlobalInputCompleted({ node, inputValue }) {
|
||||
// 在这里处理全局的输入值
|
||||
console.log("全局节点信息:", node);
|
||||
@ -258,4 +298,25 @@ export default {
|
||||
background: #1989fa;
|
||||
color: #fff;
|
||||
}
|
||||
.node-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.title {
|
||||
/* 标题样式 */
|
||||
}
|
||||
|
||||
.feedback {
|
||||
/* 反馈文本样式 */
|
||||
cursor: help; /* 鼠标移到上面时变为帮助图标 */
|
||||
}
|
||||
|
||||
/* 分割线样式 */
|
||||
.node-content hr {
|
||||
margin: 4px 0; /* 调整间距 */
|
||||
border: none;
|
||||
height: 1px;
|
||||
background-color: #ccc; /* 线的颜色 */
|
||||
}
|
||||
</style>
|
||||
|
@ -1,65 +1,142 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="160px">
|
||||
<el-dialog
|
||||
:title="dialogTitle"
|
||||
:visible.sync="dialogVisible"
|
||||
width="45%"
|
||||
v-dialogDrag
|
||||
append-to-body
|
||||
>
|
||||
<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"
|
||||
:props="{ value: 'id',label: 'name',children: 'children'}"
|
||||
clearable
|
||||
@change="cascaderChange"></el-cascader>
|
||||
@change="cascaderChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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"/>
|
||||
<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"
|
||||
/>
|
||||
</el-select> -->
|
||||
<span>{{customerName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="机床组件:"
|
||||
prop="componentId"
|
||||
>
|
||||
<el-select
|
||||
v-model="formData.componentId"
|
||||
:disabled="!this.formData.equipId"
|
||||
placeholder="请选择机床组件"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in componentSelection"
|
||||
:key="item.componentId"
|
||||
:label="item.componentName"
|
||||
:value="item.componentId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<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"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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)"/>
|
||||
<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)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<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)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="故障描述:" prop="description">
|
||||
<el-input v-model="formData.description" :rows="4" type="textarea" placeholder="请输入内容"/>
|
||||
<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">
|
||||
<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>
|
||||
<div
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitForm"
|
||||
:disabled="formLoading"
|
||||
>确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -67,12 +144,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as MaintenanceOrderApi from '@/api/system/maintenance/maintenance';
|
||||
import Editor from '@/components/Editor';
|
||||
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 * as MaintenanceOrderApi from "@/api/system/maintenance/maintenance";
|
||||
import Editor from "@/components/Editor";
|
||||
import { getEquipCascader, getEquipInfo } 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";
|
||||
export default {
|
||||
name: "MaintenanceOrderForm",
|
||||
components: {
|
||||
@ -81,11 +158,11 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
id: null,
|
||||
userList:[],
|
||||
cascaderValue:[],
|
||||
equipCascader:[],
|
||||
componentSelection:[],
|
||||
customerSelection:[],
|
||||
userList: [],
|
||||
cascaderValue: [],
|
||||
equipCascader: [],
|
||||
componentSelection: [],
|
||||
customerSelection: [],
|
||||
// 弹出层标题
|
||||
dialogTitle: "",
|
||||
// 是否显示弹出层
|
||||
@ -112,13 +189,26 @@ 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' }],
|
||||
customerId: [{ required: true, message: '机床客户信息不能为空', trigger: 'blur' }],
|
||||
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" },
|
||||
],
|
||||
customerId: [
|
||||
{ required: true, message: "机床客户信息不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
customerName: "请先选择设备",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -149,31 +239,37 @@ export default {
|
||||
}
|
||||
return childrenEach(treeData, depth);
|
||||
},
|
||||
cascaderChange(value){
|
||||
if (value.length > 0){
|
||||
async cascaderChange(value) {
|
||||
if (value.length > 0) {
|
||||
this.formData.equipId = value[1];
|
||||
}else {
|
||||
const res = await getEquipInfo(value[1]);
|
||||
this.customerName = res.data.customerName;
|
||||
this.formData.customerId = res.data.customerId;
|
||||
this.getComponentSelectionByEquipId(value[1]);
|
||||
} else {
|
||||
this.formData.equipId = null;
|
||||
}
|
||||
},
|
||||
initSelection(){
|
||||
getEquipCascader().then(res=>{
|
||||
res.forEach(item=>{
|
||||
if (item.children == null){
|
||||
item.disabled = true;
|
||||
}
|
||||
})
|
||||
this.equipCascader = res;
|
||||
});
|
||||
getComponentSelection().then(res=>{
|
||||
getComponentSelectionByEquipId(equipId) {
|
||||
getComponentSelection({ equipId: equipId }).then((res) => {
|
||||
this.componentSelection = res;
|
||||
});
|
||||
getCustomerSelection().then(res=>{
|
||||
this.customerSelection = res;
|
||||
},
|
||||
initSelection() {
|
||||
getEquipCascader().then((res) => {
|
||||
res.forEach((item) => {
|
||||
if (item.children == null) {
|
||||
item.disabled = true;
|
||||
}
|
||||
});
|
||||
this.equipCascader = res;
|
||||
});
|
||||
listSimpleUsers().then(res=>{
|
||||
// getCustomerSelection().then((res) => {
|
||||
// this.customerSelection = res;
|
||||
// });
|
||||
listSimpleUsers().then((res) => {
|
||||
this.userList = res.data;
|
||||
})
|
||||
});
|
||||
},
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
@ -184,14 +280,19 @@ export default {
|
||||
if (id) {
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const res = await MaintenanceOrderApi.getRemoteMaintenanceOrderRecord(id);
|
||||
const res = await MaintenanceOrderApi.getRemoteMaintenanceOrderRecord(
|
||||
id
|
||||
);
|
||||
this.formData = res.data;
|
||||
this.cascaderValue = this.changeDetSelect(this.formData.equipId,this.equipCascader);
|
||||
this.cascaderValue = this.changeDetSelect(
|
||||
this.formData.equipId,
|
||||
this.equipCascader
|
||||
);
|
||||
this.dialogTitle = "修改维修工单";
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
this.dialogTitle = "新增维修工单";
|
||||
}
|
||||
},
|
||||
@ -208,14 +309,14 @@ export default {
|
||||
await MaintenanceOrderApi.updateRemoteMaintenanceOrder(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
this.$emit("success");
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
await MaintenanceOrderApi.createRemoteMaintenanceOrder(data);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
this.$emit("success");
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
@ -241,7 +342,7 @@ export default {
|
||||
};
|
||||
this.cascaderValue = [];
|
||||
this.resetForm("formRef");
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -1,195 +1,420 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="维修工单编号" prop="maintenanceOrderNo" label-width="100px">
|
||||
<el-input v-model="queryParams.maintenanceOrderNo" placeholder="请输入维修工单编号" clearable
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
style="text-align:right"
|
||||
>
|
||||
<el-form-item
|
||||
label="维修工单编号"
|
||||
prop="maintenanceOrderNo"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.maintenanceOrderNo"
|
||||
placeholder="请输入维修工单编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床设备" prop="equipId">
|
||||
<el-form-item
|
||||
label="机床设备"
|
||||
prop="equipId"
|
||||
>
|
||||
<el-cascader
|
||||
v-model="cascaderValue"
|
||||
:options="equipCascader"
|
||||
:props="{ value: 'id',label: 'name',children: 'children'}"
|
||||
clearable
|
||||
@change="cascaderChange"></el-cascader>
|
||||
@change="cascaderChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床客户" prop="customerId">
|
||||
<!-- <el-form-item label="机床客户" prop="customerId">
|
||||
<el-select v-model="queryParams.customerId" placeholder="请选择机床客户" clearable size="small">
|
||||
<el-option v-for="item in customerSelection"
|
||||
:key="item.customerId" :label="item.customerName" :value="item.customerId"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床组件" prop="componentId">
|
||||
<el-select v-model="queryParams.componentId" placeholder="请选择机床组件" clearable size="small">
|
||||
<el-option v-for="item in componentSelection"
|
||||
:key="item.componentId" :label="item.componentName" :value="item.componentId"/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item
|
||||
label="机床组件"
|
||||
prop="componentId"
|
||||
>
|
||||
<el-select
|
||||
v-model="queryParams.componentId"
|
||||
placeholder="请选择机床组件"
|
||||
clearable
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in componentSelection"
|
||||
:key="item.componentId"
|
||||
:label="item.componentName"
|
||||
:value="item.componentId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item
|
||||
label="状态"
|
||||
prop="status"
|
||||
>
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.MAINTENANCE_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.MAINTENANCE_STATUS)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批状态" prop="approveStatus">
|
||||
<el-select v-model="queryParams.approveStatus" placeholder="请选择审批状态" clearable size="small">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
<el-form-item
|
||||
label="审批状态"
|
||||
prop="approveStatus"
|
||||
>
|
||||
<el-select
|
||||
v-model="queryParams.approveStatus"
|
||||
placeholder="请选择审批状态"
|
||||
clearable
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button>
|
||||
<el-button
|
||||
icon="el-icon-refresh"
|
||||
@click="resetQuery"
|
||||
>重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 操作工具栏 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-row
|
||||
:gutter="10"
|
||||
class="mb8"
|
||||
>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:create']">新增
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="openForm(undefined)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:create']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"-->
|
||||
<!-- :loading="exportLoading"-->
|
||||
<!-- v-hasPermi="['imt:remote-maintenance-order:export']">导出-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"-->
|
||||
<!-- :loading="exportLoading"-->
|
||||
<!-- v-hasPermi="['imt:remote-maintenance-order:export']">导出-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="维修工单编号" align="center" prop="maintenanceOrderNo"/>
|
||||
<el-table-column label="机床设备" align="center" prop="equipNo"/>
|
||||
<el-table-column label="机床组件" align="center" prop="componentName"/>
|
||||
<el-table-column label="机床客户" align="center" prop="customerName"/>
|
||||
<el-table-column label="故障类型" align="center" prop="faultType">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="list"
|
||||
:stripe="true"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<el-table-column
|
||||
label="维修工单编号"
|
||||
align="center"
|
||||
prop="maintenanceOrderNo"
|
||||
/>
|
||||
<el-table-column
|
||||
label="机床设备"
|
||||
align="center"
|
||||
prop="equipNo"
|
||||
/>
|
||||
<el-table-column
|
||||
label="机床组件"
|
||||
align="center"
|
||||
prop="componentName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="机床客户"
|
||||
align="center"
|
||||
prop="customerName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="故障类型"
|
||||
align="center"
|
||||
prop="faultType"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.FAULT_TYPE" :value="scope.row.faultType"/>
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.FAULT_TYPE"
|
||||
:value="scope.row.faultType"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="故障描述" align="center" prop="description"/>
|
||||
<el-table-column label="优先级" align="center" prop="priority">
|
||||
<el-table-column
|
||||
label="故障描述"
|
||||
align="center"
|
||||
prop="description"
|
||||
/>
|
||||
<el-table-column
|
||||
label="优先级"
|
||||
align="center"
|
||||
prop="priority"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.MAINTENANCE_PRIORITY" :value="scope.row.priority"/>
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.MAINTENANCE_PRIORITY"
|
||||
:value="scope.row.priority"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成时间" align="center" prop="completeTime" width="180">
|
||||
<el-table-column
|
||||
label="完成时间"
|
||||
align="center"
|
||||
prop="completeTime"
|
||||
width="180"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.completeTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
prop="status"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.MAINTENANCE_STATUS" :value="scope.row.status"/>
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.MAINTENANCE_STATUS"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批状态" align="center" prop="approveStatus">
|
||||
<el-table-column
|
||||
label="审批状态"
|
||||
align="center"
|
||||
prop="approveStatus"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.approveStatus" />
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS"
|
||||
:value="scope.row.approveStatus"
|
||||
/>
|
||||
</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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前审批任务" align="center" prop="taskName"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column
|
||||
label="当前审批任务"
|
||||
align="center"
|
||||
prop="taskName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-button v-if="scope.row.status === 0" size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.maintenanceOrderId)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:update']">修改
|
||||
<el-button
|
||||
v-if="scope.row.status === 0"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="openForm(scope.row.maintenanceOrderId)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:update']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.status === 0" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:delete']">删除
|
||||
<el-button
|
||||
v-if="scope.row.status === 0"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:delete']"
|
||||
>删除
|
||||
</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
|
||||
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="openSubmitApprove(scope.row)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:submitApprove']">提交审批
|
||||
<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>
|
||||
<el-button v-if="scope.row.taskName != null" size="mini" type="text" icon="el-icon-s-check" @click="openApprove(scope.row)"
|
||||
>审批
|
||||
<el-button
|
||||
v-if="scope.row.taskName != null"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-s-check"
|
||||
@click="openApprove(scope.row)"
|
||||
>审批
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<RemoteMaintenanceOrderForm ref="formRef" @success="getList"/>
|
||||
<RemoteMaintenanceOrderForm
|
||||
ref="formRef"
|
||||
@success="getList"
|
||||
/>
|
||||
<approve-record ref="approve" />
|
||||
|
||||
<!-- 指定审批人弹窗 -->
|
||||
<el-dialog title="选择指定审批人" :visible.sync="submitApproveOpen" append-to-body>
|
||||
<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">
|
||||
<el-form-item
|
||||
label="维修工单:"
|
||||
prop="maintenanceOrderNo"
|
||||
>
|
||||
{{ submitApproveForm.maintenanceOrderNo }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床设备:" prop="equipName">
|
||||
<el-form-item
|
||||
label="机床设备:"
|
||||
prop="equipName"
|
||||
>
|
||||
{{ submitApproveForm.equipNo }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床组件:" prop="componentName">
|
||||
<el-form-item
|
||||
label="机床组件:"
|
||||
prop="componentName"
|
||||
>
|
||||
{{ submitApproveForm.componentName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床客户信息:" prop="customerName">
|
||||
<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
|
||||
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">
|
||||
<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
|
||||
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-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">
|
||||
<el-card
|
||||
class="mb-10px"
|
||||
v-if="this.startUserSelectTasks.length > 0"
|
||||
>
|
||||
<template>指定审批人</template>
|
||||
<el-form
|
||||
:model="startUserSelectAssignees"
|
||||
@ -218,8 +443,16 @@
|
||||
</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>
|
||||
<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>
|
||||
@ -227,22 +460,22 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as RemoteMaintenanceOrderApi from '@/api/system/maintenance/maintenance';
|
||||
import {getEquipCascader} from '@/api/system/equip/equipInfo'
|
||||
import {getComponentSelection} from '@/api/system/equip/componentInfo'
|
||||
import {getCustomerSelection} from '@/api/system/baseData/customerInfo'
|
||||
import RemoteMaintenanceOrderForm from './RemoteMaintenanceOrderForm.vue';
|
||||
import {DICT_TYPE} from "@/utils/dict";
|
||||
import * as RemoteMaintenanceOrderApi from "@/api/system/maintenance/maintenance";
|
||||
import { getEquipCascader } from "@/api/system/equip/equipInfo";
|
||||
import { getComponentSelection } from "@/api/system/equip/componentInfo";
|
||||
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";
|
||||
import { getProcessDefinitionBpmnXML } from "@/api/bpm/definition";
|
||||
import { listSimpleUsers } from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
name: "RemoteMaintenanceOrder",
|
||||
computed: {
|
||||
DICT_TYPE() {
|
||||
return DICT_TYPE
|
||||
}
|
||||
return DICT_TYPE;
|
||||
},
|
||||
},
|
||||
components: {
|
||||
ApproveRecord,
|
||||
@ -250,16 +483,16 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
submitApproveForm:{},
|
||||
startUserSelectAssignees:{},
|
||||
startUserSelectAssigneesFormRules:{},
|
||||
startUserSelectTasks:[],
|
||||
userList:[],
|
||||
submitApproveForm: {},
|
||||
startUserSelectAssignees: {},
|
||||
startUserSelectAssigneesFormRules: {},
|
||||
startUserSelectTasks: [],
|
||||
userList: [],
|
||||
submitApproveOpen: false,
|
||||
cascaderValue:[],
|
||||
equipCascader:[],
|
||||
componentSelection:[],
|
||||
customerSelection:[],
|
||||
cascaderValue: [],
|
||||
equipCascader: [],
|
||||
componentSelection: [],
|
||||
customerSelection: [],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
@ -283,7 +516,7 @@ export default {
|
||||
maintenanceOrderNo: null,
|
||||
equipId: null,
|
||||
componentId: null,
|
||||
approveStatus:null
|
||||
approveStatus: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -292,45 +525,60 @@ export default {
|
||||
this.initSelection();
|
||||
},
|
||||
methods: {
|
||||
openApprove(row){
|
||||
this.$router.push({ name: "BpmProcessInstanceDetail", query: { id: row.processInstanceId}});
|
||||
openApprove(row) {
|
||||
this.$router.push({
|
||||
name: "BpmProcessInstanceDetail",
|
||||
query: { id: row.processInstanceId },
|
||||
});
|
||||
},
|
||||
closeSubmitApprove(){
|
||||
closeSubmitApprove() {
|
||||
this.submitApproveOpen = false;
|
||||
this.$refs.startUserSelectAssigneesFormRef.resetFields();
|
||||
},
|
||||
openSubmitApprove(row){
|
||||
openSubmitApprove(row) {
|
||||
const maintenanceOrderId = row.maintenanceOrderId;
|
||||
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'}]);
|
||||
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);
|
||||
});
|
||||
}
|
||||
}else {
|
||||
this.$modal.confirm('是否确认提交维修工单编号为"' + row.maintenanceOrderNo + '"的数据项?').then(()=>{
|
||||
this.submitApprove(row.maintenanceOrderId);
|
||||
})
|
||||
}
|
||||
})
|
||||
);
|
||||
},
|
||||
async submitApprove(maintenanceOrderId){
|
||||
async submitApprove(maintenanceOrderId) {
|
||||
this.loading = true;
|
||||
console.log(maintenanceOrderId);
|
||||
await this.$nextTick();
|
||||
@ -338,38 +586,40 @@ export default {
|
||||
await this.$refs.startUserSelectAssigneesFormRef.validate();
|
||||
}
|
||||
const data = {
|
||||
maintenanceOrderId:maintenanceOrderId,
|
||||
startUserSelectAssignees: this.startUserSelectAssignees
|
||||
}
|
||||
await RemoteMaintenanceOrderApi.submitMaintenanceApprove(data).then(res=>{
|
||||
this.$modal.msgSuccess("提交审批成功");
|
||||
this.submitApproveOpen = false;
|
||||
this.getList();
|
||||
})
|
||||
maintenanceOrderId: maintenanceOrderId,
|
||||
startUserSelectAssignees: this.startUserSelectAssignees,
|
||||
};
|
||||
await RemoteMaintenanceOrderApi.submitMaintenanceApprove(data).then(
|
||||
(res) => {
|
||||
this.$modal.msgSuccess("提交审批成功");
|
||||
this.submitApproveOpen = false;
|
||||
this.getList();
|
||||
}
|
||||
);
|
||||
},
|
||||
openApproveRecord(approveId){
|
||||
openApproveRecord(approveId) {
|
||||
this.$refs["approve"].getApproveRecord(approveId);
|
||||
},
|
||||
cascaderChange(value){
|
||||
if (value.length > 0){
|
||||
cascaderChange(value) {
|
||||
if (value.length > 0) {
|
||||
this.queryParams.equipId = value[1];
|
||||
}else {
|
||||
} else {
|
||||
this.queryParams.equipId = null;
|
||||
}
|
||||
},
|
||||
initSelection(){
|
||||
getEquipCascader().then(res=>{
|
||||
res.forEach(item=>{
|
||||
if (item.children == null){
|
||||
initSelection() {
|
||||
getEquipCascader().then((res) => {
|
||||
res.forEach((item) => {
|
||||
if (item.children == null) {
|
||||
item.disabled = true;
|
||||
}
|
||||
})
|
||||
});
|
||||
this.equipCascader = res;
|
||||
});
|
||||
getComponentSelection().then(res=>{
|
||||
getComponentSelection().then((res) => {
|
||||
this.componentSelection = res;
|
||||
});
|
||||
getCustomerSelection().then(res=>{
|
||||
getCustomerSelection().then((res) => {
|
||||
this.customerSelection = res;
|
||||
});
|
||||
},
|
||||
@ -377,7 +627,10 @@ export default {
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true;
|
||||
const res = await RemoteMaintenanceOrderApi.getRemoteMaintenanceOrderPage(this.queryParams);
|
||||
const res =
|
||||
await RemoteMaintenanceOrderApi.getRemoteMaintenanceOrderPage(
|
||||
this.queryParams
|
||||
);
|
||||
this.list = res.data.list;
|
||||
this.total = res.data.total;
|
||||
} finally {
|
||||
@ -403,26 +656,32 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
async handleDelete(row) {
|
||||
const maintenanceOrderId = row.maintenanceOrderId;
|
||||
await this.$modal.confirm('是否确认删除维修工单编号为"' + row.maintenanceOrderNo + '"的数据项?')
|
||||
await this.$modal.confirm(
|
||||
'是否确认删除维修工单编号为"' + row.maintenanceOrderNo + '"的数据项?'
|
||||
);
|
||||
try {
|
||||
await RemoteMaintenanceOrderApi.deleteRemoteMaintenanceOrder(maintenanceOrderId);
|
||||
await RemoteMaintenanceOrderApi.deleteRemoteMaintenanceOrder(
|
||||
maintenanceOrderId
|
||||
);
|
||||
await this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
} catch {
|
||||
}
|
||||
} catch {}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
async handleExport() {
|
||||
await this.$modal.confirm('是否确认导出所有维修工单数据项?');
|
||||
await this.$modal.confirm("是否确认导出所有维修工单数据项?");
|
||||
try {
|
||||
this.exportLoading = true;
|
||||
const data = await RemoteMaintenanceOrderApi.exportRemoteMaintenanceOrderExcel(this.queryParams);
|
||||
this.$download.excel(data, '维修工单.xls');
|
||||
const data =
|
||||
await RemoteMaintenanceOrderApi.exportRemoteMaintenanceOrderExcel(
|
||||
this.queryParams
|
||||
);
|
||||
this.$download.excel(data, "维修工单.xls");
|
||||
} catch {
|
||||
} finally {
|
||||
this.exportLoading = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -117,13 +117,19 @@
|
||||
<el-table-column
|
||||
label="类型"
|
||||
align="center"
|
||||
prop="templateType"
|
||||
prop="type"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<!-- <template v-slot="scope">
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE"
|
||||
:value="scope.row.templateType"
|
||||
/>
|
||||
</template> -->
|
||||
<template v-slot="scope">
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.SYSTEM_NOTICE_TYPE"
|
||||
:value="scope.row.type"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@ -148,7 +154,7 @@
|
||||
width="400"
|
||||
trigger="hover"
|
||||
>
|
||||
<div style="text-align:center">消息通知内容详情</div>
|
||||
<div style="text-align:center;font-size: 16px;font-weight: 500;">消息通知内容详情</div>
|
||||
<div v-html="scope.row.content" />
|
||||
<el-button
|
||||
slot="reference"
|
||||
@ -185,6 +191,13 @@
|
||||
icon="el-icon-check"
|
||||
@click="handleUpdateSingle(scope.row)"
|
||||
>已读</el-button>
|
||||
<el-button
|
||||
v-show="scope.row.orderId && scope.row.type === 3"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-check"
|
||||
@click="handle2MaintenanceOrder(scope.row.orderId)"
|
||||
>维修工单</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -280,6 +293,12 @@ export default {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
handle2MaintenanceOrder(orderId) {
|
||||
this.$router.push({
|
||||
path: "/maintenance/remote-maintenance-order",
|
||||
query: { orderId: orderId },
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user