Commit e2ccb136 authored by 王晓倩's avatar 王晓倩

工单详细信息显示设备列表树,工单接收、反馈

parent b85e12cc
......@@ -3,6 +3,7 @@ package com.zehong.web.controller.device;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.domain.entity.SysDept;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
......@@ -50,6 +51,15 @@ public class TDeviceInfoController extends BaseController
return AjaxResult.success(tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo));
}
/**
* 获取设备下拉树列表
*/
@PutMapping("/deviceTree")
public AjaxResult deviceTree(@RequestBody List<TDeviceInfo> deviceInfoList)
{
return AjaxResult.success(tDeviceInfoService.buildDeviceTreeSelect(deviceInfoList));
}
/**
* 导出设备信息列表
*/
......
package com.zehong.web.controller.system;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -65,6 +67,17 @@ public class SysUserController extends BaseController
return getDataTable(list);
}
/**
* 获取巡检员列表
*/
@PreAuthorize("@ss.hasPermi('system:user:inspectorList')")
@GetMapping("/inspectorList")
public AjaxResult inspectorList()
{
List<SysUser> list = userService.selectInspectorList();
return AjaxResult.success(list);
}
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:user:export')")
@GetMapping("/export")
......
......@@ -2,7 +2,9 @@ package com.zehong.web.controller.workOrder;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.form.TWorkOrderForm;
import com.zehong.system.domain.vo.WorkOrderVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -41,12 +43,12 @@ public class TWorkOrderController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:list')")
@GetMapping("/list")
public TableDataInfo list(TWorkOrder tWorkOrder) throws Exception
public TableDataInfo list(TWorkOrderForm tWorkOrderForm) throws Exception
{
startPage();
List<WorkOrderVo> list = null;
try {
list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
list = tWorkOrderService.selectTWorkOrderList(tWorkOrderForm);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("查询工单基础信息列表失败"));
......@@ -60,11 +62,11 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:export')")
@Log(title = "工单基础信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TWorkOrder tWorkOrder) throws Exception
public AjaxResult export(TWorkOrderForm tWorkOrderForm) throws Exception
{
List<WorkOrderVo> list = null;
try {
list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
list = tWorkOrderService.selectTWorkOrderList(tWorkOrderForm);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("导出工单基础信息列表失败"));
......@@ -116,8 +118,8 @@ public class TWorkOrderController extends BaseController
public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder) throws Exception
{
String orderStatus = tWorkOrder.getOrderStatus();
// 工单状态只有是0未下发或1已下发,才允许修改
if(!"0".equals(orderStatus) && !"1".equals(orderStatus)){
// 工单状态只有是0未接收才允许修改
if(!"0".equals(orderStatus)){
throw new Exception(StringUtils.format("工单({})当前状态不允许修改", tWorkOrder.getOrderId()));
}
......@@ -139,7 +141,14 @@ public class TWorkOrderController extends BaseController
public AjaxResult editStatus(@RequestBody TWorkOrder tWorkOrder) throws Exception
{
String orderStatus = tWorkOrder.getOrderStatus();
if("5".equals(orderStatus)) {
if("0".equals(orderStatus)){
tWorkOrder.setOrderStatus("1");
tWorkOrder.setActualTime(DateUtils.getNowDate());
} else if("1".equals(orderStatus)) {
tWorkOrder.setOrderStatus("2");
} else if("2".equals(orderStatus)) {
tWorkOrder.setOrderStatus("3");
} else if("3".equals(orderStatus)) {
throw new Exception(StringUtils.format("工单({})已归档,不允许更改状态", tWorkOrder.getOrderId()));
}
......
package com.zehong.system.domain.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 工单基础信息对象 t_work_order
*
* @author zehong
* @date 2021-07-19
*/
public class TWorkOrderForm extends BaseEntity
{
/** 工单id */
private String orderId;
/** 工单类型(1巡检信息,2隐患信息,3报警信息) */
private String orderType;
/** 工单名称 */
private String orderName;
/** 工单状态(0未接收,1已接收,2进行中,3已反馈,4已归档) */
private String orderStatus;
/** 指定执行人员(巡检员id) */
private Long appointInspector;
/** 开始下发时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startAllotTime;
/** 结束下发时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endAllotTime;
/** 实际接收人员(巡检员id) */
@Excel(name = "实际接收人员", readConverterExp = "巡检员id")
private Long actualInspector;
/** 实际接收时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "实际接收时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualTime;
/** 用户名 */
private String userName;
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setOrderType(String orderType)
{
this.orderType = orderType;
}
public String getOrderType()
{
return orderType;
}
public void setOrderName(String orderName)
{
this.orderName = orderName;
}
public String getOrderName()
{
return orderName;
}
public void setOrderStatus(String orderStatus)
{
this.orderStatus = orderStatus;
}
public String getOrderStatus()
{
return orderStatus;
}
public void setAppointInspector(Long appointInspector)
{
this.appointInspector = appointInspector;
}
public Long getAppointInspector()
{
return appointInspector;
}
public Date getStartAllotTime() {
return startAllotTime;
}
public void setStartAllotTime(Date startAllotTime) {
this.startAllotTime = startAllotTime;
}
public Date getEndAllotTime() {
return endAllotTime;
}
public void setEndAllotTime(Date endAllotTime) {
this.endAllotTime = endAllotTime;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Long getActualInspector() {
return actualInspector;
}
public void setActualInspector(Long actualInspector) {
this.actualInspector = actualInspector;
}
public Date getActualTime() {
return actualTime;
}
public void setActualTime(Date actualTime) {
this.actualTime = actualTime;
}
}
......@@ -36,6 +36,9 @@ public class WorkOrderVo extends BaseEntity
/** 设备编号 */
private String deviceCodes;
/** 设备名称 */
private String deviceName;
/** 设备列表 */
private List<TDeviceInfo> deviceInfoList;
......@@ -150,6 +153,14 @@ public class WorkOrderVo extends BaseEntity
this.deviceCodes = deviceCodes;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public List<TDeviceInfo> getDeviceInfoList() {
return deviceInfoList;
}
......
......@@ -19,6 +19,14 @@ public interface SysUserMapper
*/
public List<SysUser> selectUserList(SysUser sysUser);
/**
* 查询巡检员列表
*
* @param
* @return 用户信息集合信息
*/
public List<SysUser> selectInspectorList();
/**
* 通过用户名查询用户
*
......
......@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.form.TWorkOrderForm;
/**
* 工单基础信息Mapper接口
......@@ -32,7 +33,7 @@ public interface TWorkOrderMapper
* @param tWorkOrder 工单基础信息
* @return 工单基础信息集合
*/
public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder);
public List<TWorkOrder> selectTWorkOrderList(TWorkOrderForm tWorkOrderForm);
/**
* 新增工单基础信息
......
......@@ -18,6 +18,14 @@ public interface ISysUserService
*/
public List<SysUser> selectUserList(SysUser user);
/**
* 查询巡检员列表
*
* @param
* @return 用户信息集合信息
*/
public List<SysUser> selectInspectorList();
/**
* 通过用户名查询用户
*
......
......@@ -3,6 +3,8 @@ package com.zehong.system.service;
import java.util.List;
import java.util.Map;
import com.zehong.common.core.domain.TreeSelect;
import com.zehong.common.core.domain.entity.SysDept;
import com.zehong.system.domain.TDeviceInfo;
/**
......@@ -29,6 +31,14 @@ public interface ITDeviceInfoService
*/
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo);
/**
* 构建前端所需要下拉树结构
*
* @param deviceInfoList 设备列表
* @return 下拉树结构列表
*/
public List<Map<Object, Object>> buildDeviceTreeSelect(List<TDeviceInfo> deviceInfoList);
/**
* 统计各设备类型的设备总数
* @return
......
......@@ -2,6 +2,7 @@ package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.form.TWorkOrderForm;
import com.zehong.system.domain.vo.WorkOrderVo;
/**
......@@ -24,10 +25,10 @@ public interface ITWorkOrderService
/**
* 查询工单基础信息列表
*
* @param tWorkOrder 工单基础信息
* @param tWorkOrderForm 工单基础信息表单
* @return 工单基础信息集合
*/
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) throws Exception;
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrderForm tWorkOrderForm) throws Exception;
/**
* 新增工单基础信息
......
......@@ -66,6 +66,18 @@ public class SysUserServiceImpl implements ISysUserService
return userMapper.selectUserList(user);
}
/**
* 查询巡检员列表
*
* @param
* @return 用户信息集合信息
*/
@Override
public List<SysUser> selectInspectorList()
{
return userMapper.selectInspectorList();
}
/**
* 通过用户名查询用户
*
......
package com.zehong.system.service.impl;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import com.zehong.common.core.domain.TreeSelect;
import com.zehong.common.core.domain.entity.SysDept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.service.ITDeviceInfoService;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 设备信息Service业务层处理
......@@ -45,6 +48,28 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
return tDeviceInfoMapper.selectTDeviceInfoList(tDeviceInfo);
}
/**
* 构建前端所需要下拉树结构
*
* @param deviceInfoList 部门列表
* @return 下拉树结构列表
*/
@Override
public List<Map<Object, Object>> buildDeviceTreeSelect(List<TDeviceInfo> deviceInfoList)
{
List<Map<Object, Object>> list = new ArrayList<>();
for (TDeviceInfo deviceInfo : deviceInfoList) {
Map<Object, Object> map = new HashMap<>();
map.put("id", deviceInfo.getDeviceId());
map.put("label", deviceInfo.getDeviceName());
list.add(map);
}
return list;
}
/**
* 统计各设备类型的设备总数
* @return
......
......@@ -2,6 +2,7 @@ package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -78,18 +79,18 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
trouble.setDealStatus(dealStatus);
tHiddenTroubleMapper.updateTHiddenTrouble(trouble);
} else {
} else if("3".equals(orderType)) {
TDeviceAlarm alarm = tDeviceAlarmMapper.selectTDeviceAlarmById(order.getResourceId());
alarm.setDealStatus(dealStatus);
tDeviceAlarmMapper.updateTDeviceAlarm(alarm);
}
// 如果工单状态是进行中,修改状态为已反馈
if("2".equals(order.getOrderStatus())){
order.setOrderStatus("3");
// 如果工单状态是已接收,修改状态为已反馈
if("1".equals(order.getOrderStatus())){
order.setOrderStatus("2");
tWorkOrderMapper.updateTWorkOrder(order);
}
tOrderFeedback.setFeedbackTime(DateUtils.getNowDate());
return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback);
}
......
......@@ -6,6 +6,7 @@ import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.*;
import com.zehong.system.domain.form.TWorkOrderForm;
import com.zehong.system.domain.vo.WorkOrderVo;
import com.zehong.system.mapper.*;
import org.springframework.beans.BeanUtils;
......@@ -107,6 +108,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
String deviceCode = trouble.getDeviceCode();
TDeviceInfo device = tDeviceInfoMapper.selectTDeviceInfoByCode(deviceCode);
if(device != null){
workOrderVo.setDeviceName(device.getDeviceName());
deviceInfoList.add(device);
}
......@@ -128,6 +130,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
workOrderVo.setLongitude(device.getLongitude());
workOrderVo.setLatitude(device.getLatitude());
workOrderVo.setDeviceType(device.getDeviceType());
workOrderVo.setDeviceName(device.getDeviceName());
workOrderVo.setAddress(device.getDeviceAddr());
deviceInfoList.add(device);
}
......@@ -152,14 +155,14 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
/**
* 查询工单基础信息列表
*
* @param tWorkOrder 工单基础信息
* @param tWorkOrderForm 工单基础信息
* @return 工单基础信息
*/
@Override
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) throws Exception
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrderForm tWorkOrderForm) throws Exception
{
List<WorkOrderVo> workOrderVoList = new ArrayList<WorkOrderVo>();
List<TWorkOrder> workOrderList = tWorkOrderMapper.selectTWorkOrderList(tWorkOrder);
List<TWorkOrder> workOrderList = tWorkOrderMapper.selectTWorkOrderList(tWorkOrderForm);
if(workOrderList.size() != 0){
......@@ -172,7 +175,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
workOrderVo.setAppointInspectorName(appointInspector.getNickName());
if(workOrder.getActualInspector() != workOrder.getAppointInspector() && workOrder.getActualInspector() != null){
SysUser actualInspector = sysUserMapper.selectUserById(tWorkOrder.getActualInspector());
SysUser actualInspector = sysUserMapper.selectUserById(workOrder.getActualInspector());
workOrderVo.setActualInspectorName(actualInspector.getNickName());
} else {
workOrderVo.setActualInspectorName(appointInspector.getNickName());
......@@ -237,8 +240,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
{
if("1".equals(tWorkOrder.getOrderStatus())){
TWorkOrder order = tWorkOrderMapper.selectTWorkOrderById(tWorkOrder.getOrderId());
int planId = order.getResourceId();
int planId = tWorkOrder.getResourceId();
// 修改巡检计划状态为进行中
TInspectionPlan plan = new TInspectionPlan();
plan.setPlanId(planId);
......@@ -246,10 +248,11 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
plan.setUpdateTime(DateUtils.getNowDate());
tInspectionPlanMapper.updateTInspectionPlan(plan);
} else if ("4".equals(tWorkOrder.getOrderStatus())){
tWorkOrder.setActualTime(DateUtils.getNowDate());
} else if ("3".equals(tWorkOrder.getOrderStatus())){
TWorkOrder order = tWorkOrderMapper.selectTWorkOrderById(tWorkOrder.getOrderId());
int planId = order.getResourceId();
int planId = tWorkOrder.getResourceId();
// 修改巡检计划状态为已完成
TInspectionPlan plan = new TInspectionPlan();
plan.setPlanId(planId);
......@@ -257,8 +260,9 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
plan.setUpdateTime(DateUtils.getNowDate());
tInspectionPlanMapper.updateTInspectionPlan(plan);
} else if ("0".equals(tWorkOrder.getOrderStatus())){
tWorkOrder.setUpdateTime(DateUtils.getNowDate());
}
tWorkOrder.setUpdateTime(DateUtils.getNowDate());
return tWorkOrderMapper.updateTWorkOrder(tWorkOrder);
}
......
......@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
</sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
......@@ -90,6 +90,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectUserVo"/>
where u.user_id = #{userId}
</select>
<select id="selectInspectorList" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.del_flag = '0' and r.role_id = 102
</select>
<select id="checkUserNameUnique" parameterType="String" resultType="int">
select count(1) from sys_user where user_name = #{userName} limit 1
......
......@@ -52,7 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTOrderFeedback" parameterType="TOrderFeedback">
insert into t_order_feedback
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="feedbackId != null">feedback_id,</if>
<if test="orderId != null">order_id,</if>
<if test="deviceCode != null">device_code,</if>
<if test="contents != null">contents,</if>
......@@ -65,7 +64,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="feedbackId != null">#{feedbackId},</if>
<if test="orderId != null">#{orderId},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="contents != null">#{contents},</if>
......
......@@ -23,26 +23,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<sql id="selectTWorkOrderVo">
select order_id, order_type, resource_id, order_name, order_status, update_time, appoint_inspector, allot_time, actual_inspector, actual_time, remarks from t_work_order
select t.order_id, t.order_type, t.resource_id, t.order_name, t.order_status, t.update_time, t.appoint_inspector, t.allot_time, t.actual_inspector, t.actual_time, t.remarks
from t_work_order t
left join sys_user s on t.appoint_inspector = s.user_id
</sql>
<select id="selectTWorkOrderList" parameterType="TWorkOrder" resultMap="TWorkOrderResult">
<select id="selectTWorkOrderList" parameterType="TWorkOrderForm" resultMap="TWorkOrderResult">
<include refid="selectTWorkOrderVo"/>
<where>
<if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
<if test="orderName != null and orderName != ''"> and order_name like concat('%', #{orderName}, '%')</if>
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
<if test="appointInspector != null "> and appoint_inspector = #{appointInspector}</if>
<if test="allotTime != null "> and allot_time = #{allotTime}</if>
<if test="actualInspector != null "> and actual_inspector = #{actualInspector}</if>
<if test="actualTime != null "> and actual_time = #{actualTime}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<where>
<if test="orderId != null and orderId != ''"> and t.order_id like concat('%',#{orderId},'%')</if>
<if test="orderType != null and orderType != ''"> and t.order_type = #{orderType}</if>
<if test="orderName != null and orderName != ''"> and t.order_name like concat('%', #{orderName}, '%')</if>
<if test="orderStatus != null and orderStatus != ''"> and t.order_status = #{orderStatus}</if>
<if test="appointInspector != null "> and t.appoint_inspector = #{appointInspector}</if>
<if test="startAllotTime != null "> and t.allot_time &gt;= #{startAllotTime}</if>
<if test="endAllotTime != null "> and t.allot_time &lt;= #{endAllotTime}</if>
<if test="userName != null and userName != ''"> and s.user_name = #{userName}</if>
</where>
</select>
<select id="selectTWorkOrderById" parameterType="String" resultMap="TWorkOrderResult">
<include refid="selectTWorkOrderVo"/>
where order_id = #{orderId}
where t.order_id = #{orderId}
</select>
<insert id="insertTWorkOrder" parameterType="TWorkOrder">
......
......@@ -62,9 +62,19 @@ export function exportDeviceInfo(query) {
}
// 统计各设备类型的设备总数
export function countDeviceByType(){
export function countDeviceByType() {
return request({
url: '/device/deviceInfo/countDeviceByType',
method: 'get'
})
}
// 查询设备下拉树结构
export function deviceTree(data) {
return request({
url: '/device/deviceInfo/deviceTree',
method: 'put',
data: data
})
}
......@@ -10,6 +10,15 @@ export function listUser(query) {
})
}
// 查询巡检员列表
export function inspectorList(query) {
return request({
url: '/system/user/inspectorList',
method: 'get',
params: query
})
}
// 查询用户详细
export function getUser(userId) {
return request({
......
......@@ -4,28 +4,38 @@
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:file-list="fileArr"
:limit="1"
:limit="3"
:list-type="listType"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleUploadSuccess"
:on-remove="handleRemove"
:on-preview="handleFileClick"
:show-file-list="true"
:headers="headers"
class="upload-file-uploader"
ref="upload"
>
<!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button>
<!-- <el-button size="mini" icon="" type="primary"></el-button> -->
<i class="el-icon-plus"></i>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
</template>
的文件
</div>
</el-upload>
<el-dialog :modal="modal" :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="" />
</el-dialog>
<!-- 文件列表 -->
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<!-- <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list">
<el-link :href="file.url" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
......@@ -34,164 +44,183 @@
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
</div>
</li>
</transition-group>
</transition-group> -->
</div>
</template>
<script>
import { getToken } from "@/utils/auth";
import { getToken } from "@/utils/auth";
export default {
props: {
// 值
value: [String, Object, Array],
// 大小限制(MB)
fileSize: {
type: Number,
default: 5,
},
fileArr: {
type: Array,
default: [],
export default {
props: {
// 值
value: [String, Object, Array],
listType: {
type: String,
defaule: "text",
},
// 大小限制(MB)
fileSize: {
type: Number,
default: 5,
},
fileArr: {
type: Array,
default: [],
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["doc", "xls", "ppt", "txt", "pdf", "png", "jpg", "jpeg"],
},
// 是否显示提示
isShowTip: {
type: Boolean,
default: false,
},
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["doc", "xls", "ppt", "txt", "pdf",'png', 'jpg', 'jpeg'],
data() {
return {
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: [],
modal:false,
dialogVisible:false,
dialogImageUrl:"",
};
},
// 是否显示提示
isShowTip: {
type: Boolean,
default: false
}
},
data() {
return {
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
headers: {
Authorization: "Bearer " + getToken(),
computed: {
// 是否显示提示
showTip() {
return this.isShowTip && (this.fileType || this.fileSize);
},
// 列表
list() {
let temp = 1;
if (this.value) {
// 首先将值转为数组
const list = Array.isArray(this.value) ? this.value : [this.value];
// 然后将数组转为对象数组
return list.map((item) => {
if (typeof item === "string") {
item = { name: item, url: item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;
});
} else {
this.fileList = [];
return [];
}
},
fileList: [],
};
},
computed: {
// 是否显示提示
showTip() {
return this.isShowTip && (this.fileType || this.fileSize);
},
// 列表
list() {
let temp = 1;
if (this.value) {
// 首先将值转为数组
const list = Array.isArray(this.value) ? this.value : [this.value];
// 然后将数组转为对象数组
return list.map((item) => {
if (typeof item === "string") {
item = { name: item, url: item };
methods: {
// 上传前校检格式和大小
handleBeforeUpload(file) {
// 校检文件类型
if (this.fileType) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
const isTypeOk = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
if (!isTypeOk) {
this.$message.error(
`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
);
return false;
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;
});
} else {
this.fileList = [];
return [];
}
},
},
methods: {
// 上传前校检格式和大小
handleBeforeUpload(file) {
// 校检文件类型
if (this.fileType) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
const isTypeOk = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
if (!isTypeOk) {
this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
return false;
// 校检文件大小
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
}
// 校检文件大小
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
return false;
return true;
},
// 文件个数超出
handleExceed() {
this.$message.error(`只允许上传三张照片`);
},
// 上传失败
handleUploadError(err) {
this.$message.error("上传失败, 请重试");
},
// 上传成功回调
handleUploadSuccess(res, file) {
this.$message.success("上传成功");
this.$emit("resFun", res);
},
// 文件列表移除文件
handleRemove(file, fileList) {
console.log("列表移除", file, fileList);
this.$emit("remove", file);
},
// 删除文件
handleDelete(index) {
this.fileList.splice(index, 1);
this.$emit("input", "");
// let that = this,
// param;
// param = file.response ? file.response.fileName.replace(/\\/g, "%")
// : file.response.url.replace(/\\/g, "%").slice(9);
// $.ajax({
// type: "GET",
// url: process.env.VUE_APP_BASE_API + "/common/deleteFile",
// data: {savePath: param},
// dataType: "json",
// success: function(data){
// if (data) that.$message.success("删除成功");
// else return false;
// }
// });
},
handleFileClick(file) {
this.dialogImageUrl = file.response.url;
this.dialogVisible=true;
console.log(file);
},
// 获取文件名称
getFileName(name) {
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
} else {
return "";
}
}
return true;
},
// 文件个数超出
handleExceed() {
this.$message.error(`只允许上传单个文件`);
},
// 上传失败
handleUploadError(err) {
this.$message.error("上传失败, 请重试");
},
// 上传成功回调
handleUploadSuccess(res, file) {
this.$message.success("上传成功");
this.$emit("resFun", res);
},
},
// 删除文件
handleDelete(index) {
this.fileList.splice(index, 1);
this.$emit("input", '');
// let that = this,
// param;
// param = file.response ? file.response.fileName.replace(/\\/g, "%")
// : file.response.url.replace(/\\/g, "%").slice(9);
// $.ajax({
// type: "GET",
// url: process.env.VUE_APP_BASE_API + "/common/deleteFile",
// data: {savePath: param},
// dataType: "json",
// success: function(data){
// if (data) that.$message.success("删除成功");
// else return false;
// }
// });
created() {
// this.fileList = this.list;
},
// 获取文件名称
getFileName(name) {
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
} else {
return "";
}
}
},
created() {
// this.fileList = this.list;
},
};
};
</script>
<style scoped lang="scss">
.upload-file-uploader {
margin-bottom: 5px;
}
.upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
}
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
}
.upload-file-uploader {
margin-bottom: 5px;
}
.upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
}
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
}
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备id" prop="deviceId">
<el-form-item label="设备编号" prop="deviceCode">
<el-input
v-model="queryParams.deviceId"
placeholder="请输入设备id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入工单id"
v-model="queryParams.deviceCode"
placeholder="请输入设备编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
......@@ -21,143 +12,64 @@
</el-form-item>
<el-form-item label="报警类型" prop="alarmType">
<el-select v-model="queryParams.alarmType" placeholder="请选择报警类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="报警值" prop="alarmValue">
<el-input
v-model="queryParams.alarmValue"
placeholder="请输入报警值"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报警开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="报警结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="
处理状态" prop="dealStatus">
<el-select v-model="queryParams.dealStatus" placeholder="请选择
处理状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input
v-model="queryParams.remarks"
placeholder="请输入备注"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['dataMonitoring:deviceAlarm:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['dataMonitoring:deviceAlarm:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['dataMonitoring:deviceAlarm:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['dataMonitoring:deviceAlarm:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deviceAlarmList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="备注" align="center" prop="alarmId" />
<el-table-column label="设备id" align="center" prop="deviceId" />
<el-table-column label="工单id" align="center" prop="orderId" />
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="报警类型" align="center" prop="alarmType" />
<el-table-column label="报警值" align="center" prop="alarmValue" />
<el-table-column label="报警开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column label="报警结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.endTime) }}</span>
</template>
</el-table-column>
<el-table-column label="处理状态" align="center" prop="dealStatus" >
<template slot-scope="scope">
<span v-if="scope.row.dealStatus == null">未处理</span>
<span v-if="scope.row.dealStatus == 3">已解决</span>
<span v-if="scope.row.dealStatus != 3 && scope.row.dealStatus != null">已解决</span>
</template>
</el-table-column>
<el-table-column label="
处理状态" align="center" prop="dealStatus" />
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['dataMonitoring:deviceAlarm:edit']"
>修改</el-button>
@click="handleAdd(scope.row)"
v-hasPermi="['workOrder:basicsInfo:add']"
v-if="scope.row.orderId == '' || scope.row.orderId == null"
>下发工单</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dataMonitoring:deviceAlarm:remove']"
>删除</el-button>
icon="el-icon-edit"
@click="showDetail(scope.row)"
v-if="scope.row.orderId != '' && scope.row.orderId != null"
>详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
......@@ -166,47 +78,14 @@
@pagination="getList"
/>
<!-- 添加或修改报警信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="deviceId">
<el-input v-model="form.deviceId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入工单id" />
</el-form-item>
<el-form-item label="报警类型" prop="alarmType">
<el-select v-model="form.alarmType" placeholder="请选择报警类型">
<el-option label="请选择字典生成" value="" />
</el-select>
<!-- 添加工单信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-form-item label="工单名称" prop="orderName">
<el-input v-model="form.orderName" placeholder="请输入工单名称" />
</el-form-item>
<el-form-item label="报警值" prop="alarmValue">
<el-input v-model="form.alarmValue" placeholder="请输入报警值" />
</el-form-item>
<el-form-item label="报警开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="form.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="报警结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="
处理状态">
<el-radio-group v-model="form.dealStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
<el-form-item label="指定执行人员" prop="appointInspector">
<el-input v-model="form.appointInspector" placeholder="请输入指定执行人员" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -218,7 +97,9 @@
</template>
<script>
import { listDeviceAlarm, getDeviceAlarm, delDeviceAlarm, addDeviceAlarm, updateDeviceAlarm, exportDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
import { listDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
import { addBasicsInfo } from "@/api/workOrder/basicsInfo";
import { inspectorList } from "@/api/system/user";
export default {
name: "DeviceAlarm",
......@@ -242,6 +123,10 @@ export default {
total: 0,
// 报警信息表格数据
deviceAlarmList: [],
// 巡检员列表数据
inspectorList: [],
// 报警类型字典
typeOptions: [],
// 弹出层标题
title: "",
// 是否显示弹出层
......@@ -268,6 +153,9 @@ export default {
},
created() {
this.getList();
this.getDicts("t_alarm_type").then(response => {
this.typeOptions = response.data;
});
},
methods: {
/** 查询报警信息列表 */
......@@ -279,6 +167,14 @@ export default {
this.loading = false;
});
},
/** 获取用户信息列表 */
getUserList() {
this.loading = true;
inspectorList().then(response => {
this.inspectorList = response.rows;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
......@@ -287,16 +183,15 @@ export default {
// 表单重置
reset() {
this.form = {
alarmId: null,
deviceId: null,
orderId: null,
alarmType: null,
alarmValue: null,
startTime: null,
endTime: null,
dealStatus: "0",
updateTime: null,
orderType: null,
orderName: null,
orderStatus: "0",
createTime: null,
appointInspector: null,
allotTime: null,
actualInspector: null,
actualTime: null,
remarks: null
};
this.resetForm("form");
......@@ -318,70 +213,34 @@ export default {
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
handleAdd(row) {
this.reset();
this.form.resourceId = row.alarmId;
this.form.orderType = "3";
this.open = true;
this.title = "添加报警信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const alarmId = row.alarmId || this.ids
getDeviceAlarm(alarmId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改报警信息";
});
this.title = "填写工单信息";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.alarmId != null) {
updateDeviceAlarm(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDeviceAlarm(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
addBasicsInfo(this.form).then(response => {
this.msgSuccess("下发工单成功");
this.open = false;
this.getList();
});
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const alarmIds = row.alarmId || this.ids;
this.$confirm('是否确认删除报警信息编号为"' + alarmIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delDeviceAlarm(alarmIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
/** 工单详细信息跳转 */
showDetail(row) {
this.$router.push({
path: '/basicsInfo/detail',
query:{
orderId : row.orderId
}
}) //带参跳转
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有报警信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportDeviceAlarm(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
......@@ -7,7 +7,7 @@
<el-steps :active="active" finish-status="success" simple prop="orderStatus" style="margin-top: 20px">
<el-step title="未接收" ></el-step>
<el-step title="已接收" ></el-step>
<el-step title="进行中" ></el-step>
<!-- <el-step title="进行中" ></el-step>-->
<el-step title="已反馈" ></el-step>
<el-step title="已归档" ></el-step>
</el-steps>
......@@ -33,9 +33,8 @@
<el-form-item label="工单状态:" prop="orderStatus">
<font v-if="form.orderStatus == 0">未接收</font>
<font v-if="form.orderStatus == 1">已接收</font>
<font v-if="form.orderStatus == 2">进行中</font>
<font v-if="form.orderStatus == 3">已反馈</font>
<font v-if="form.orderStatus == 4">已归档</font>
<font v-if="form.orderStatus == 2">已反馈</font>
<font v-if="form.orderStatus == 3">已归档</font>
</el-form-item>
<el-form-item label="指定执行人员:" prop="appointInspectorName">
<font>{{form.appointInspectorName}}</font>
......@@ -52,8 +51,16 @@
<font v-if="form.deviceType == 3">流量计</font>
<font v-if="form.deviceType == 4">压力表</font>
</el-form-item>
<el-form-item label="设备编号:" prop="deviceCodes">
<font>{{form.deviceCodes}}</font>
<el-form-item label="设备名称:" prop="deviceName">
<font v-if="form.orderType != 1">{{form.deviceName}}</font>
<el-tree
:data="deviceOptions"
:props="defaultProps"
:expand-on-click-node="false"
ref="tree"
@node-click="handleNodeClick"
v-if="form.orderType == 1"
/>
</el-form-item>
<el-form-item label="设备位置:" v-if="form.orderType != 1">
<font>{{form.address}}</font>
......@@ -95,59 +102,25 @@
<ul><li>反馈信息</li></ul>
</div>
<div style="width: 95%;float: left;">
<!-- <el-upload style="float: left;"
action="#"
list-type="picture-card"
:auto-upload="false">
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img
class="el-upload-list__item-thumbnail"
:src="file.url" alt=""
>
<span class="el-upload-list__item-actions">
<span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<i class="el-icon-download"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload> -->
<div style="float: left;margin-left: 50px;" >
<el-image :src="form.pictureUrl1" fit="cover" v-if="form.pictureUrl1 != null" style="width: 100px;height: 100px;">
</el-image>
<el-image :src="form.pictureUrl2" fit="cover" v-if="form.pictureUrl2 != null" style="width: 100px;height: 100px;">
</el-image>
<el-image :src="form.pictureUrl3" fit="cover" v-if="form.pictureUrl3 != null" style="width: 100px;height: 100px;">
</el-image>
</div>
<div style="float: left;margin-left: 50px;" >
<el-image :src="form.pictureUrl1" fit="cover" v-if="form.pictureUrl1 != null && form.pictureUrl1 != ''" style="width: 100px;height: 100px;">
</el-image>
<el-image :src="form.pictureUrl2" fit="cover" v-if="form.pictureUrl2 != null && form.pictureUrl2 != ''" style="width: 100px;height: 100px;">
</el-image>
<el-image :src="form.pictureUrl3" fit="cover" v-if="form.pictureUrl3 != null && form.pictureUrl3 != ''" style="width: 100px;height: 100px;">
</el-image>
</div>
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;margin-left: 50px;" >
<el-form-item label="反馈信息:" prop="contents">
<font>{{form.contents}}</font>
</el-form-item>
<el-form-item label="反馈时间:" prop="feedbackTime">
<font>{{form.feedbackTime}}</font>
</el-form-item>
<el-form-item label="是否解决:" prop="dealStatus">
<font v-if="form.dealStatus == 3">未解决</font>
<font v-if="form.dealStatus != 3 && form.dealStatus != null">已解决</font>
</el-form-item>
<el-form-item label="反馈信息:" prop="contents">
<font>{{form.contents}}</font>
</el-form-item>
<el-form-item label="反馈时间:" prop="feedbackTime">
<font>{{form.feedbackTime}}</font>
</el-form-item>
<el-form-item label="是否解决:" prop="dealStatus">
<font v-if="form.dealStatus == 3">未解决</font>
<font v-if="form.dealStatus != 3 && form.dealStatus != null">已解决</font>
</el-form-item>
</el-form>
</div>
</div>
......@@ -169,8 +142,10 @@
<script>
import { listBasicsInfo, getBasicsInfo, delBasicsInfo, addBasicsInfo, updateBasicsInfo, exportBasicsInfo } from "@/api/workOrder/basicsInfo";
import gaodeMap from "utils/gaodeMap.js"
import {map, DEVICE_TYPE} from "utils/gaodeMap.js"
import { deviceTree } from "@/api/device/deviceInfo";
import gaodeMap from "utils/gaodeMap.js";
import {map, DEVICE_TYPE} from "utils/gaodeMap.js";
export default {
name: "BasicsInfo",
components: {
......@@ -206,6 +181,17 @@ export default {
pickerOptions:[],
// 工单类型字典
ordertypeOptions: [],
// 设备树选项
deviceOptions: [
{
label: "设备列表",
childList: []
}
],
defaultProps: {
children: "childList",
label: "label"
},
// 查询参数
queryParams: {
pageNum: 1,
......@@ -232,7 +218,6 @@ export default {
// 如果是跳转来的,则接受初始化参数
// this.user_id = this.$route.query.id; //详细信息页接收参数
this.orderId = this.$route.query.orderId;
this.getList();
this.getDicts("t_order_status").then(response => {
this.typeOptions = response.data;
......@@ -270,7 +255,6 @@ export default {
getBasicsInfo (){
getBasicsInfo(this.orderId).then(response =>{
this.form = response.data;
console.log(response.data,"fdsfdsa======")
this.active = parseInt(response.data.orderStatus) + 1;
if(this.form.deviceInfoList.length>0){
this.gaoMap.resetMapCenter([this.form.deviceInfoList[0].longitude,this.form.deviceInfoList[0].latitude]);
......@@ -278,9 +262,25 @@ export default {
for(var i = 0; i < this.form.deviceInfoList.length; i++){
let obj = this.form.deviceInfoList[i];
this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, obj)
}
if(this.form.orderType == '1') {
// 获取设备列表树
let data = this.form.deviceInfoList;
console.log(data, "====");
deviceTree(data).then(response => {
this.deviceOptions[0].childList = response.data;
});
}
});
},
// 筛选节点
// filterNode(value, data) {
// if (!value) return true;
// return data.label.indexOf(value) !== -1;
// },
// 节点单击事件
handleNodeClick(data) {
},
// 取消按钮
......
......@@ -11,24 +11,15 @@
></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="工单号" prop="orderName">
<el-form-item label="工单编号" prop="orderId">
<el-input
v-model="queryParams.orderName"
placeholder="请输入工单名称"
v-model="queryParams.orderId"
placeholder="请输入工单编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="设备id" prop="deviceId">
<el-input
v-model="queryParams.deviceId"
placeholder="请输入设备id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item label="工单状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable size="small">
<el-option
......@@ -39,148 +30,58 @@
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="指定执行人员" prop="appointInspector">
<el-input
v-model="queryParams.appointInspector"
placeholder="请输入指定执行人员"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<!-- <el-form-item label="下发时间" prop="allotTime">
<el-date-picker clearable size="small"
v-model="queryParams.allotTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择下发时间">
<el-form-item label="创建时间" prop="startAllotTime">
<el-date-picker
clearable size="small"
v-model="queryParams.startAllotTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="请选择开始时间"
align="right">
</el-date-picker>
<font color="#C0C4CC"></font>
</el-form-item>
<el-form-item label="实际接收人员" prop="actualInspector">
<el-input
v-model="queryParams.actualInspector"
placeholder="请输入实际接收人员"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item label="时间" prop="actualTime">
<!-- <el-date-picker clearable size="small"
v-model="queryParams.actualTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择实际接收时间">
</el-date-picker> -->
<el-form-item label="" prop="endAllotTime">
<el-date-picker
clearable size="small"
v-model="queryParams.actualTime"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
v-model="queryParams.endAllotTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="请选择结束时间"
align="right">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="备注" prop="remarks">
<el-input
v-model="queryParams.remarks"
placeholder="请输入备注"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['workOrder:basicsInfo:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['workOrder:basicsInfo:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['workOrder:basicsInfo:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['workOrder:basicsInfo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> -->
<el-table v-loading="loading" :data="basicsInfoList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="" width="55" align="center" /> -->
<el-table-column label="工单号" align="center" prop="orderId" />
<!-- <el-table-column label="设备编号" align="center" prop="deviceId" /> -->
<el-table-column label="工单编号" align="center" prop="orderId" />
<el-table-column label="工单类型" align="center" prop="orderType" >
<template slot-scope="scope">
<span v-if="scope.row.orderType == 1">巡检信息</span>
<span type="primary" v-if="scope.row.orderType == 1">巡检信息</span>
<span type="primary" v-if="scope.row.orderType == 2">隐患信息</span>
<span type="primary" v-if="scope.row.orderType == 3">报警信息</span>
<span type="primary" v-if="scope.row.orderType == 3">报警信息</span>
</template>
</el-table-column>
<!-- <el-table-column label="接单人" align="center" prop="" /> -->
<el-table-column label="指定执行人员" align="center" prop="appointInspectorName">
</el-table-column>
<el-table-column label="实际接收人员" align="center" prop="actualInspectorName">
</el-table-column>
<!-- <el-table-column label="设备名称" align="center" prop="" />
<el-table-column label="位置" align="center" prop="" />
<el-table-column label="报警类型" align="center" prop="" /> -->
<el-table-column label="工单名称" align="center" prop="orderName" />
<el-table-column label="工单状态" align="center" prop="orderStatus" >
<template slot-scope="scope">
<el-button type="info" v-if="scope.row.orderStatus == 0">未接收</el-button>
<el-button type="info" v-if="scope.row.orderStatus == 1">已接收</el-button>
<el-button type="warning" v-if="scope.row.orderStatus == 2">进行中</el-button>
<el-button type="primary" v-if="scope.row.orderStatus == 3">已反馈</el-button>
<el-button type="success" v-if="scope.row.orderStatus == 4">已归档</el-button>
<el-button type="warning" v-if="scope.row.orderStatus == 1">已接收</el-button>
<el-button type="primary" v-if="scope.row.orderStatus == 2">已反馈</el-button>
<el-button type="success" v-if="scope.row.orderStatus == 3">已归档</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="指定执行人员" align="center" prop="appointInspector" /> -->
<el-table-column label="创建时间" align="center" prop="allotTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.allotTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="实际接收人员" align="center" prop="actualInspector" /> -->
<el-table-column label="更新时间" align="center" prop="actualTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.actualTime) }}</span>
......@@ -190,30 +91,23 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
size="normal"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['workOrder:basicsInfo:edit']"
v-if="scope.row.orderStatus == 0"
>修改</el-button>
<!-- <el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['workOrder:basicsInfo:remove']"
>删除</el-button> -->
<el-button
size="mini"
size="normal"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['workOrder:basicsInfo:edit']"
v-if="scope.row.orderStatus == 3"
@click="handleFinish(scope.row)"
v-hasPermi="['workOrder:basicsInfo:editStatus']"
v-if="scope.row.orderStatus == 2"
>归档</el-button>
<el-button
size="mini"
size="normal"
type="text"
icon="el-icon-edit"
@click="showDetail(scope.row)"
......@@ -228,49 +122,31 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改工单基础信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="工单类型" prop="orderType">
<el-select v-model="form.orderType" placeholder="请选择工单类型">
<el-option
v-for="dict in ordertypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工单名称" prop="orderName">
<el-input v-model="form.orderName" placeholder="请输入工单名称" />
</el-form-item>
<el-form-item label="指定执行人员" prop="appointInspector">
<el-input v-model="form.appointInspector" placeholder="请输入指定执行人员" />
</el-form-item>
<el-form-item label="下发时间" prop="allotTime">
<el-date-picker clearable size="small"
v-model="form.allotTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择下发时间">
</el-date-picker>
</el-form-item>
<el-form-item label="实际接收人员" prop="actualInspector">
<el-input v-model="form.actualInspector" placeholder="请输入实际接收人员" />
</el-form-item>
<el-form-item label="实际接收时间" prop="actualTime">
<el-date-picker clearable size="small"
v-model="form.actualTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择实际接收时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>
<!-- 归档或修改工单基础信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<div v-if="this.title == '工单信息修改'">
<el-form-item label="工单名称" prop="orderName">
<el-input v-model="form.orderName" placeholder="请输入工单名称" />
</el-form-item>
<el-form-item label="指定执行人员" prop="appointInspector">
<el-select v-model="form.appointInspectorName" placeholder="请选择执行人员" clearable size="small" @change="setUserId">
<el-option
v-for="item in inspector"
:key="item.userId"
:label="item.nickName"
:value="item.userId"
></el-option>
</el-select>
</el-form-item>
</div>
<div v-if="this.title == '工单信息归档'">
<el-form-item label="归档信息" prop="remarks">
<el-input v-model="form.remarks" type="textarea" placeholder="请输入归档信息" />
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
......@@ -281,7 +157,8 @@
</template>
<script>
import { listBasicsInfo, getBasicsInfo, delBasicsInfo, addBasicsInfo, updateBasicsInfo, exportBasicsInfo } from "@/api/workOrder/basicsInfo";
import { listBasicsInfo, getBasicsInfo, delBasicsInfo, updateOrderStatus, updateBasicsInfo, exportBasicsInfo } from "@/api/workOrder/basicsInfo";
import { inspectorList } from "@/api/system/user";
export default {
name: "BasicsInfo",
......@@ -311,20 +188,23 @@ export default {
open: false,
// 工单状态字典
typeOptions: [],
pickerOptions:[],
// 巡检员列表
inspector: [],
// 时间搜索
pickerOptions: [],
// 工单类型字典
ordertypeOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
orderId: null,
orderType: null,
orderName: null,
orderStatus: null,
appointInspector: null,
allotTime: null,
actualInspector: null,
actualTime: null,
startAllotTime: null,
endAllotTime: null,
remarks: null
},
// 表单参数
......@@ -353,6 +233,16 @@ export default {
this.loading = false;
});
},
getInspectorList(){
this.loading = true;
inspectorList().then(response => {
this.inspector = response.data;
this.loading = false;
});
},
setUserId(val){
this.form.appointInspector = val;
},
// 取消按钮
cancel() {
this.open = false;
......@@ -398,37 +288,47 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getInspectorList();
const orderId = row.orderId || this.ids
getBasicsInfo(orderId).then(response => {
this.form = response.data;
this.open = true;
this.title = "工单信息修改";
});
},
/** 归档按钮操作 */
handleFinish(row) {
this.reset();
const orderId = row.orderId || this.ids
getBasicsInfo(orderId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改工单基础信息";
this.title = "工单信息归档";
});
},
/** 详细信息跳转 */
showDetail(row) {
this.$router.push({
// path: '/workOrder/basicsInfo/'+row.orderId,
path: '/basicsInfo/detail',
this.$router.push({
path: '/basicsInfo/detail',
query:{
orderId : row.orderId
}
}) //带参跳转
}) //带参跳转
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.orderId != null) {
if (this.form.orderStatus == '0') {
updateBasicsInfo(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addBasicsInfo(this.form).then(response => {
this.msgSuccess("新增成功");
} else if(this.form.orderStatus == '2'){
updateOrderStatus(this.form).then(response => {
this.msgSuccess("操作成功");
this.open = false;
this.getList();
});
......@@ -469,4 +369,4 @@ export default {
};
</script>
<style>
</style>
\ No newline at end of file
</style>
<template>
<div class="app-container">
<div class="app-container basicsInfo">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="工单id" prop="orderId">
<!-- <el-form-item label="工单类型" prop="orderType">
<el-select v-model="queryParams.orderType" placeholder="请选择工单类型" clearable size="small">
<el-option
v-for="dict in ordertypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="工单编号" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入工单id"
placeholder="请输入工单编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备id" prop="deviceId">
<el-input
v-model="queryParams.deviceId"
placeholder="请输入设备id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-form-item label="工单状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="反馈时间" prop="feedbackTime">
<el-date-picker clearable size="small"
v-model="queryParams.feedbackTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择反馈时间">
<el-form-item label="创建时间" prop="startAllotTime">
<el-date-picker
clearable size="small"
v-model="queryParams.startAllotTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="请选择开始时间"
align="right">
</el-date-picker>
<font color="#C0C4CC"></font>
</el-form-item>
<el-form-item label="是否存在隐患" prop="isHiddenDanger">
<el-input
v-model="queryParams.isHiddenDanger"
placeholder="请输入是否存在隐患"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="处理状态" prop="dealStatus">
<el-select v-model="queryParams.dealStatus" placeholder="请选择处理状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input
v-model="queryParams.remarks"
placeholder="请输入备注"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-form-item label="" prop="endAllotTime">
<el-date-picker
clearable size="small"
v-model="queryParams.endAllotTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="请选择结束时间"
align="right">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
......@@ -56,90 +57,62 @@
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['workOrder:feedback:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['workOrder:feedback:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['workOrder:feedback:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['workOrder:feedback:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="feedbackList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="工单反馈id" align="center" prop="feedbackId" />
<el-table-column label="工单id" align="center" prop="orderId" />
<el-table-column label="设备id" align="center" prop="deviceId" />
<el-table-column label="反馈内容" align="center" prop="contents" />
<el-table-column label="反馈时间" align="center" prop="feedbackTime" width="180">
<el-table v-loading="loading" :data="basicsInfoList" @selection-change="handleSelectionChange">
<el-table-column label="工单编号" align="center" prop="orderId" />
<el-table-column label="工单类型" align="center" prop="orderType" >
<template slot-scope="scope">
<span type="primary" v-if="scope.row.orderType == 1">巡检信息</span>
<span type="primary" v-if="scope.row.orderType == 2">隐患信息</span>
<span type="primary" v-if="scope.row.orderType == 3">报警信息</span>
</template>
</el-table-column>
<el-table-column label="工单名称" align="center" prop="orderName" />
<el-table-column label="工单状态" align="center" prop="orderStatus" >
<template slot-scope="scope">
<el-button type="info" v-if="scope.row.orderStatus == 0">未接收</el-button>
<el-button type="warning" v-if="scope.row.orderStatus == 1">已接收</el-button>
<el-button type="primary" v-if="scope.row.orderStatus == 2">已反馈</el-button>
<el-button type="success" v-if="scope.row.orderStatus == 3">已归档</el-button>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="allotTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.feedbackTime)}}</span>
<span>{{ parseTime(scope.row.allotTime) }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="actualTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.actualTime) }}</span>
</template>
</el-table-column>
<el-table-column label="是否存在隐患" align="center" prop="isHiddenDanger" />
<el-table-column label="处理状态" align="center" prop="dealStatus" />
<el-table-column label="图片地址1" align="center" prop="pictureUrl1" />
<el-table-column label="图片地址2" align="center" prop="pictureUrl2" />
<el-table-column label="图片地址3" align="center" prop="pictureUrl3" />
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
size="normal"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['workOrder:feedback:edit']"
>修改</el-button>
@click="handleReceive(scope.row)"
v-hasPermi="['workOrder:basicsInfo:edit']"
v-if="scope.row.orderStatus == 0"
>接单</el-button>
<el-button
size="mini"
size="normal"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['workOrder:feedback:remove']"
>删除</el-button>
icon="el-icon-edit"
@click="handleFeedback(scope.row)"
v-hasPermi="['workOrder:basicsInfo:editStatus']"
v-if="scope.row.orderStatus == 1 || scope.row.orderStatus == 2"
>反馈</el-button>
<el-button
size="normal"
type="text"
icon="el-icon-edit"
@click="showDetail(scope.row)"
>详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
......@@ -148,45 +121,42 @@
@pagination="getList"
/>
<!-- 添加或修改工单反馈信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="工单号" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入工单id" />
</el-form-item>
<el-form-item label="设备编号" prop="deviceId">
<el-input v-model="form.deviceId" placeholder="请输入设备id" />
<!-- 工单反馈对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="设备列表" prop="deviceCode" v-if="form.orderType == '1'">
<el-select v-model="form.deviceCode" placeholder="请选择设备" clearable size="small" >
<el-option
v-for="device in form.deviceInfoList"
:key="device.deviceCode"
:label="device.deviceName"
:value="device.deviceCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="反馈内容" prop="contents">
<el-input v-model="form.contents" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="反馈时间" prop="feedbackTime">
<el-date-picker clearable size="small"
v-model="form.feedbackTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择反馈时间">
</el-date-picker>
<el-form-item label="反馈图片" prop="pictureUrl1">
<FileUpload
listType="picture-card"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList"
/>
</el-form-item>
<el-form-item label="是否存在隐患" prop="isHiddenDanger">
<el-input v-model="form.isHiddenDanger" placeholder="请输入是否存在隐患" />
<el-radio-group v-model="form.isHiddenDanger">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="处理状态">
<el-form-item label="处理结果" prop="dealStatus">
<el-radio-group v-model="form.dealStatus">
<el-radio label="1">请选择字典生成</el-radio>
<el-radio :label="2">已处理完成</el-radio>
<el-radio :label="3">未处理完成</el-radio>
<el-radio :label="1">不需处理</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="图片地址1" prop="pictureUrl1">
<el-input v-model="form.pictureUrl1" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="图片地址2" prop="pictureUrl2">
<el-input v-model="form.pictureUrl2" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="图片地址3" prop="pictureUrl3">
<el-input v-model="form.pictureUrl3" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
<el-form-item label="反馈信息" prop="contents">
<el-input v-model="form.contents" type="textarea" placeholder="请输入反馈信息" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -198,172 +168,198 @@
</template>
<script>
import { listFeedback, getFeedback, delFeedback, addFeedback, updateFeedback, exportFeedback } from "@/api/workOrder/feedback";
import { listBasicsInfo, getBasicsInfo, updateOrderStatus } from "@/api/workOrder/basicsInfo";
import { addFeedback } from "@/api/workOrder/feedback";
import FileUpload from '@/components/FileUpload';
import Cookie from 'js-cookie';
export default {
name: "Feedback",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 工单反馈信息表格数据
feedbackList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
orderId: null,
deviceId: null,
contents: null,
feedbackTime: null,
isHiddenDanger: null,
dealStatus: null,
pictureUrl1: null,
pictureUrl2: null,
pictureUrl3: null,
remarks: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询工单反馈信息列表 */
getList() {
this.loading = true;
listFeedback(this.queryParams).then(response => {
this.feedbackList = response.rows;
this.total = response.total;
this.loading = false;
});
export default {
name: "Feedback",
components: {
FileUpload,
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
feedbackId: null,
orderId: null,
deviceId: null,
contents: null,
feedbackTime: null,
isHiddenDanger: null,
dealStatus: "0",
pictureUrl1: null,
pictureUrl2: null,
pictureUrl3: null,
remarks: null
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 工单基础信息表格数据
basicsInfoList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 工单状态字典
typeOptions: [],
// 巡检员列表
inspector: [],
// 时间搜索
pickerOptions: [],
// 工单类型字典
ordertypeOptions: [],
// 上传文件列表
fileList: [],
fileIndex: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
orderId: null,
orderType: null,
orderName: null,
orderStatus: null,
appointInspector: null,
startAllotTime: null,
endAllotTime: null,
remarks: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
created() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.feedbackId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加工单反馈信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const feedbackId = row.feedbackId || this.ids
getFeedback(feedbackId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改工单反馈信息";
this.getDicts("t_order_status").then(response => {
this.typeOptions = response.data;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.feedbackId != null) {
updateFeedback(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addFeedback(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
this.getDicts("t_order_type").then(response => {
this.ordertypeOptions = response.data;
});
},
/** 删除按钮操作 */
handleDelete(row) {
const feedbackIds = row.feedbackId || this.ids;
this.$confirm('是否确认删除工单反馈信息编号为"' + feedbackIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delFeedback(feedbackIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有工单反馈信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportFeedback(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
methods: {
/** 查询工单基础信息列表 */
getList() {
this.loading = true;
this.queryParams.userName = Cookie.get('username');
listBasicsInfo(this.queryParams).then(response => {
this.basicsInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getFileInfo(res){
this.fileIndex++;
console.log(this.fileIndex,"index");
console.log(res,"res.url");
if(this.fileIndex == 1){
this.form.pictureUrl1 = res.url;
} else if(this.fileIndex == 2){
this.form.pictureUrl2 = res.url;
} else if(this.fileIndex == 3){
this.form.pictureUrl3 = res.url;
}
},
listRemove(e) {
this.form.pictureUrl1 = "";
this.form.pictureUrl2 = "";
this.form.pictureUrl3 = "";
this.fileList = [];
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.fileList = [];
},
// 表单重置
reset() {
this.form = {
deviceCode: null,
pictureUrl1: null,
pictureUrl2: null,
pictureUrl3: null,
isHiddenDanger: null,
dealStatus: null,
contents: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.orderId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 接单按钮操作 */
handleReceive(row) {
if (row.orderStatus == '0') {
const orderIds = row.orderId;
this.$confirm('是否确认接收工单' + orderIds, "操作提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return updateOrderStatus(row);
}).then(() => {
this.getList();
this.msgSuccess("操作成功");
}).catch(() => {});
}
},
/** 反馈按钮操作 */
handleFeedback(row) {
this.open = true;
const orderId = row.orderId || this.ids
getBasicsInfo(orderId).then(response => {
this.form = response.data;
this.form.pictureUrl1 = null;
this.form.pictureUrl2 = null;
this.form.pictureUrl3 = null;
this.form.contents = null;
this.form.remarks = null;
this.open = true;
this.title = "工单反馈";
});
},
/** 详细信息跳转 */
showDetail(row) {
this.$router.push({
path: '/basicsInfo/detail',
query:{
orderId : row.orderId
}
}) //带参跳转
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if(this.form.orderStatus == '1' || this.form.orderStatus == '2'){
addFeedback(this.form).then(response => {
this.msgSuccess("反馈成功");
this.open = false;
this.getList();
});
}
}
});
},
}
}
};
};
</script>
<style>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment