Commit da2002dc authored by 耿迪迪's avatar 耿迪迪

Merge branch 'master' of ssh://111.61.77.35:15/gengdidi/gassafety

parents 65039efb 05f0482a
......@@ -41,10 +41,16 @@ public class TWorkOrderController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:list')")
@GetMapping("/list")
public TableDataInfo list(TWorkOrder tWorkOrder)
public TableDataInfo list(TWorkOrder tWorkOrder) throws Exception
{
startPage();
List<WorkOrderVo> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
List<WorkOrderVo> list = null;
try {
list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("查询工单基础信息列表失败"));
}
return getDataTable(list);
}
......@@ -54,9 +60,15 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:export')")
@Log(title = "工单基础信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TWorkOrder tWorkOrder)
public AjaxResult export(TWorkOrder tWorkOrder) throws Exception
{
List<WorkOrderVo> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
List<WorkOrderVo> list = null;
try {
list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("导出工单基础信息列表失败"));
}
ExcelUtil<WorkOrderVo> util = new ExcelUtil<WorkOrderVo>(WorkOrderVo.class);
return util.exportExcel(list, "工单基础信息数据");
}
......@@ -66,9 +78,16 @@ public class TWorkOrderController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:query')")
@GetMapping(value = "/{orderId}")
public AjaxResult getInfo(@PathVariable("orderId") String orderId)
public AjaxResult getInfo(@PathVariable("orderId") String orderId) throws Exception
{
return AjaxResult.success(tWorkOrderService.selectTWorkOrderById(orderId));
WorkOrderVo workOrderVo = new WorkOrderVo();
try {
workOrderVo = tWorkOrderService.selectTWorkOrderById(orderId);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("获取工单({})工详细信息失败", orderId));
}
return AjaxResult.success(workOrderVo);
}
/**
......@@ -77,9 +96,15 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:add')")
@Log(title = "工单基础信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TWorkOrder tWorkOrder)
public AjaxResult add(@RequestBody TWorkOrder tWorkOrder) throws Exception
{
return toAjax(tWorkOrderService.insertTWorkOrder(tWorkOrder));
try {
tWorkOrderService.insertTWorkOrder(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("工单({})信息有误", tWorkOrder.getOrderId()));
}
return AjaxResult.success();
}
/**
......@@ -88,15 +113,21 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:edit')")
@Log(title = "工单基础信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder) throws Exception {
public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder) throws Exception
{
String orderStatus = tWorkOrder.getOrderStatus();
// 工单状态只有是0未下发或1已下发,才允许修改
if(!"0".equals(orderStatus) && !"1".equals(orderStatus)){
throw new Exception(StringUtils.format("工单({})当前状态不允许修改", tWorkOrder.getOrderId()));
throw new Exception(StringUtils.format("工单({})当前状态不允许修改", tWorkOrder.getOrderId()));
}
return toAjax(tWorkOrderService.updateTWorkOrder(tWorkOrder));
try {
tWorkOrderService.updateTWorkOrder(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("修改工单({})信息失败,", tWorkOrder.getOrderId()));
}
return AjaxResult.success();
}
/**
......@@ -105,11 +136,18 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:editStatus')")
@Log(title = "工单基础信息", businessType = BusinessType.UPDATE)
@PutMapping("/editStatus")
public AjaxResult editStatus(@RequestBody TWorkOrder tWorkOrder) throws Exception {
public AjaxResult editStatus(@RequestBody TWorkOrder tWorkOrder) throws Exception
{
String orderStatus = tWorkOrder.getOrderStatus();
if("5".equals(orderStatus)) {
throw new Exception(StringUtils.format("工单({})已归档,不允许更改状态。", tWorkOrder.getOrderId()));
throw new Exception(StringUtils.format("工单({})已归档,不允许更改状态", tWorkOrder.getOrderId()));
}
try {
tWorkOrderService.updateTWorkOrder(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("修改工单({})状态失败", tWorkOrder.getOrderId()));
}
return AjaxResult.success();
}
......
package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TDeviceInfo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 工单基础信息对象 t_work_order
......@@ -32,7 +33,10 @@ public class WorkOrderVo extends BaseEntity
private String orderName;
/** 设备编号 */
private String deviceIds;
private String deviceCodes;
/** 设备列表 */
private List<TDeviceInfo> deviceInfoList;
/** 设备数量 */
private int deviceNum;
......@@ -78,6 +82,16 @@ public class WorkOrderVo extends BaseEntity
/** 备注 */
private String remarks;
/** 反馈内容 */
private String contents;
/** 反馈时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date feedbackTime;
/** 处理状态 */
private String dealStatus;
public void setOrderId(String orderId)
{
this.orderId = orderId;
......@@ -115,12 +129,20 @@ public class WorkOrderVo extends BaseEntity
return orderName;
}
public String getDeviceIds() {
return deviceIds;
public String getDeviceCodes() {
return deviceCodes;
}
public void setDeviceIds(String deviceIds) {
this.deviceIds = deviceIds;
public void setDeviceCodes(String deviceCodes) {
this.deviceCodes = deviceCodes;
}
public List<TDeviceInfo> getDeviceInfoList() {
return deviceInfoList;
}
public void setDeviceInfoList(List<TDeviceInfo> deviceInfoList) {
this.deviceInfoList = deviceInfoList;
}
public int getDeviceNum() {
......@@ -242,6 +264,30 @@ public class WorkOrderVo extends BaseEntity
this.actualInspectorName = actualInspectorName;
}
public String getContents() {
return contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public Date getFeedbackTime() {
return feedbackTime;
}
public void setFeedbackTime(Date feedbackTime) {
this.feedbackTime = feedbackTime;
}
public String getDealStatus() {
return dealStatus;
}
public void setDealStatus(String dealStatus) {
this.dealStatus = dealStatus;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......@@ -249,7 +295,7 @@ public class WorkOrderVo extends BaseEntity
.append("orderType", getOrderType())
.append("resourceId", getResourceId())
.append("orderName", getOrderName())
.append("deviceIds", getDeviceIds())
.append("deviceCodes", getDeviceCodes())
.append("deviceNum", getDeviceNum())
.append("finishNum", getFinishNum())
.append("deviceType", getDeviceType())
......
......@@ -19,6 +19,14 @@ public interface TOrderFeedbackMapper
*/
public TOrderFeedback selectTOrderFeedbackById(int feedbackId);
/**
* 查询工单反馈信息列表
*
* @param orderId 工单信息id
* @return 工单反馈信息集合
*/
public List<TOrderFeedback> selectTOrderFeedbackByOrderId(String orderId);
/**
* 查询工单反馈信息列表
*
......
......@@ -19,7 +19,7 @@ public interface ITWorkOrderService
* @param orderId 工单基础信息ID
* @return 工单基础信息
*/
public WorkOrderVo selectTWorkOrderById(String orderId);
public WorkOrderVo selectTWorkOrderById(String orderId) throws Exception;
/**
* 查询工单基础信息列表
......@@ -27,7 +27,7 @@ public interface ITWorkOrderService
* @param tWorkOrder 工单基础信息
* @return 工单基础信息集合
*/
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder);
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) throws Exception;
/**
* 新增工单基础信息
......@@ -35,7 +35,7 @@ public interface ITWorkOrderService
* @param tWorkOrder 工单基础信息
* @return 结果
*/
public int insertTWorkOrder(TWorkOrder tWorkOrder);
public int insertTWorkOrder(TWorkOrder tWorkOrder) throws Exception;
/**
* 修改工单基础信息
......
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TOrderFeedbackMapper;
import com.zehong.system.domain.TOrderFeedback;
import com.zehong.system.service.ITOrderFeedbackService;
/**
......@@ -18,6 +19,14 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
{
@Autowired
private TOrderFeedbackMapper tOrderFeedbackMapper;
@Autowired
private TWorkOrderMapper tWorkOrderMapper;
@Autowired
private TInspectionDataMapper tInspectionDataMapper;
@Autowired
private THiddenTroubleMapper tHiddenTroubleMapper;
@Autowired
private TDeviceAlarmMapper tDeviceAlarmMapper;
/**
* 查询工单反馈信息
......@@ -53,10 +62,32 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback)
{
String deviceCode = tOrderFeedback.getDeviceCode();
// 更改巡检记录状态
if(deviceCode != null){
String dealStatus = tOrderFeedback.getDealStatus();
// 根据工单类型和源id修改源数据状态
TWorkOrder order = tWorkOrderMapper.selectTWorkOrderById(tOrderFeedback.getOrderId());
String orderType = order.getOrderType();
if("1".equals(orderType)){
TInspectionData data = tInspectionDataMapper.selectTInspectionDataByCode(deviceCode);
data.setDealStatus(dealStatus);
tInspectionDataMapper.updateTInspectionData(data);
} else if("2".equals(orderType)) {
THiddenTrouble trouble = tHiddenTroubleMapper.selectTHiddenTroubleById(order.getResourceId());
trouble.setDealStatus(dealStatus);
tHiddenTroubleMapper.updateTHiddenTrouble(trouble);
} else {
TDeviceAlarm alarm = tDeviceAlarmMapper.selectTDeviceAlarmById(order.getResourceId());
alarm.setDealStatus(dealStatus);
tDeviceAlarmMapper.updateTDeviceAlarm(alarm);
}
// 如果工单状态是进行中,修改状态为已反馈
if("2".equals(order.getOrderStatus())){
order.setOrderStatus("3");
tWorkOrderMapper.updateTWorkOrder(order);
}
return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback);
......
......@@ -26,12 +26,14 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
@Autowired
private TWorkOrderMapper tWorkOrderMapper;
@Autowired
private SysUserMapper sysUserMapper;
private TOrderFeedbackMapper tOrderFeedbackMapper;
@Autowired
private TInspectionDataMapper tInspectionDataMapper;
private SysUserMapper sysUserMapper;
@Autowired
private TInspectionPlanMapper tInspectionPlanMapper;
@Autowired
private TInspectionDataMapper tInspectionDataMapper;
@Autowired
private THiddenTroubleMapper tHiddenTroubleMapper;
@Autowired
private TDeviceAlarmMapper tDeviceAlarmMapper;
......@@ -50,7 +52,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 工单基础信息
*/
@Override
public WorkOrderVo selectTWorkOrderById(String orderId)
public WorkOrderVo selectTWorkOrderById(String orderId) throws Exception
{
WorkOrderVo workOrderVo = new WorkOrderVo();
TWorkOrder tWorkOrder = tWorkOrderMapper.selectTWorkOrderById(orderId);
......@@ -74,20 +76,31 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
if("1".equals(orderType)){
TInspectionPlan plan = tInspectionPlanMapper.selectTInspectionPlanById(resourceId);
workOrderVo.setDeviceIds(plan.getDeviceCodes());
workOrderVo.setDeviceCodes(plan.getDeviceCodes());
TInspectionData data = new TInspectionData();
data.setPlanId(resourceId);
List<TInspectionData> totalList = tInspectionDataMapper.selectTInspectionDataList(data);
workOrderVo.setDeviceNum(totalList.size());
List<TDeviceInfo> deviceInfoList = new ArrayList<>();
TDeviceInfo deviceInfo = null;
for(TInspectionData temp : totalList){
deviceInfo = tDeviceInfoMapper.selectTDeviceInfoByCode(temp.getDeviceCode());
if(deviceInfo != null){
deviceInfoList.add(deviceInfo);
}
}
int finish = tInspectionDataMapper.selectFinishTInspectionData(resourceId);
workOrderVo.setFinishNum(finish);
} else if("2".equals(orderType)){
THiddenTrouble trouble = tHiddenTroubleMapper.selectTHiddenTroubleById(resourceId);
workOrderVo.setDeviceIds((trouble.getDeviceCode() != null ? trouble.getDeviceCode() : null).toString());
workOrderVo.setDeviceCodes((trouble.getDeviceCode() != null ? trouble.getDeviceCode() : null).toString());
workOrderVo.setLongitude(trouble.getLongitude() != null ? trouble.getLongitude() : null);
workOrderVo.setLatitude(trouble.getLatitude() != null ? trouble.getLatitude() : null);
workOrderVo.setCoordinates(trouble.getCoordinates() != null ? trouble.getCoordinates() : null);
......@@ -97,7 +110,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
TDeviceAlarm alarm = tDeviceAlarmMapper.selectTDeviceAlarmById(resourceId);
String deviceCode = alarm.getDeviceCode();
workOrderVo.setDeviceIds(String.valueOf(deviceCode));
workOrderVo.setDeviceCodes(String.valueOf(deviceCode));
String isPipe = alarm.getIsPipe();
if("0".equals(isPipe)){
......@@ -110,8 +123,16 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
workOrderVo.setLatitude(device.getLatitude());
workOrderVo.setDeviceType(device.getDeviceType());
}
}
List<TOrderFeedback> feedbackList = tOrderFeedbackMapper.selectTOrderFeedbackByOrderId(tWorkOrder.getOrderId());
if(feedbackList.size() != 0){
TOrderFeedback feedback = feedbackList.get(0);
workOrderVo.setContents(feedback.getContents());
workOrderVo.setFeedbackTime(feedback.getFeedbackTime());
workOrderVo.setDealStatus(feedback.getDealStatus());
}
return workOrderVo;
}
......@@ -122,7 +143,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 工单基础信息
*/
@Override
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder)
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) throws Exception
{
List<WorkOrderVo> workOrderVoList = new ArrayList<WorkOrderVo>();
List<TWorkOrder> workOrderList = tWorkOrderMapper.selectTWorkOrderList(tWorkOrder);
......@@ -157,12 +178,12 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 结果
*/
@Override
public int insertTWorkOrder(TWorkOrder tWorkOrder)
public int insertTWorkOrder(TWorkOrder tWorkOrder) throws Exception
{
String orderId = tWorkOrderMapper.getWorkOrderId();
tWorkOrder.setOrderId(orderId);
tWorkOrder.setOrderStatus("0");
tWorkOrder.setCreateTime(DateUtils.getNowDate());
tWorkOrder.setAllotTime(DateUtils.getNowDate());
int planId = tWorkOrder.getResourceId();
// 修改巡检计划状态为已下发
......@@ -181,7 +202,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 结果
*/
@Override
public int updateTWorkOrder(TWorkOrder tWorkOrder)
public int updateTWorkOrder(TWorkOrder tWorkOrder) throws Exception
{
if("1".equals(tWorkOrder.getOrderStatus())){
......@@ -204,6 +225,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
tInspectionPlanService.updateTInspectionPlan(plan);
}
tWorkOrder.setUpdateTime(DateUtils.getNowDate());
return tWorkOrderMapper.updateTWorkOrder(tWorkOrder);
}
......
......@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTDeviceAlarmById" parameterType="Long" resultMap="TDeviceAlarmResult">
<select id="selectTDeviceAlarmById" parameterType="int" resultMap="TDeviceAlarmResult">
<include refid="selectTDeviceAlarmVo"/>
where alarm_id = #{alarmId}
</select>
......
......@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTDeviceInfoById" parameterType="Long" resultMap="TDeviceInfoResult">
<select id="selectTDeviceInfoById" parameterType="int" resultMap="TDeviceInfoResult">
<include refid="selectTDeviceInfoVo"/>
where device_id = #{deviceId}
</select>
......
......@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTEnterpriseInfoById" parameterType="Long" resultMap="TEnterpriseInfoResult">
<select id="selectTEnterpriseInfoById" parameterType="int" resultMap="TEnterpriseInfoResult">
<include refid="selectTEnterpriseInfoVo"/>
where info_id = #{infoId}
</select>
......
......@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTHiddenTroubleById" parameterType="Long" resultMap="THiddenTroubleResult">
<select id="selectTHiddenTroubleById" parameterType="int" resultMap="THiddenTroubleResult">
<include refid="selectTHiddenTroubleVo"/>
where trouble_id = #{troubleId}
</select>
......
......@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectFinishTInspectionData" parameterType="int">
<select id="selectFinishTInspectionData" parameterType="int" resultType="int">
select count(*) from t_inspection_data
where plan_id = #{planId}
and deal_status != null
......
......@@ -38,11 +38,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTOrderFeedbackById" parameterType="Long" resultMap="TOrderFeedbackResult">
<select id="selectTOrderFeedbackById" parameterType="int" resultMap="TOrderFeedbackResult">
<include refid="selectTOrderFeedbackVo"/>
where feedback_id = #{feedbackId}
</select>
<select id="selectTOrderFeedbackByOrderId" parameterType="String" resultMap="TOrderFeedbackResult">
<include refid="selectTOrderFeedbackVo"/>
where order_id = #{orderId}
order by feedback_time desc
</select>
<insert id="insertTOrderFeedback" parameterType="TOrderFeedback">
insert into t_order_feedback
<trim prefix="(" suffix=")" suffixOverrides=",">
......
......@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTPipeById" parameterType="Long" resultMap="TPipeResult">
<select id="selectTPipeById" parameterType="int" resultMap="TPipeResult">
<include refid="selectTPipeVo"/>
where pipe_id = #{pipeId}
</select>
......
......@@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="resourceId" column="resource_id" />
<result property="orderName" column="order_name" />
<result property="orderStatus" column="order_status" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="appointInspector" column="appoint_inspector" />
<result property="allotTime" column="allot_time" />
<result property="actualInspector" column="actual_inspector" />
......@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<sql id="selectTWorkOrderVo">
select order_id, order_type, resource_id, order_name, order_status, create_time, appoint_inspector, allot_time, actual_inspector, actual_time, remarks from t_work_order
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
</sql>
<select id="selectTWorkOrderList" parameterType="TWorkOrder" resultMap="TWorkOrderResult">
......@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="resourceId != null">resource_id,</if>
<if test="orderName != null">order_name,</if>
<if test="orderStatus != null">order_status,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="appointInspector != null">appoint_inspector,</if>
<if test="allotTime != null">allot_time,</if>
<if test="actualInspector != null">actual_inspector,</if>
......@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="resourceId != null">#{resourceId},</if>
<if test="orderName != null">#{orderName},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="appointInspector != null">#{appointInspector},</if>
<if test="allotTime != null">#{allotTime},</if>
<if test="actualInspector != null">#{actualInspector},</if>
......@@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderType != null">order_type = #{orderType},</if>
<if test="orderName != null">order_name = #{orderName},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="appointInspector != null">appoint_inspector = #{appointInspector},</if>
<if test="allotTime != null">allot_time = #{allotTime},</if>
<if test="actualInspector != null">actual_inspector = #{actualInspector},</if>
......
......@@ -14,7 +14,8 @@ export const DEVICE_TYPE = {
REGEULATORBOX: "2",
VALUEWELL: "3",
FLOWMETER: "4",
DUTYPERSON: "5"
DUTYPERSON: "5",
WORKORDER: "6"
};
class gaodeMap {
// 所有线的数组
......@@ -107,8 +108,9 @@ class gaodeMap {
map: map,
offset: new AMap.Pixel(-13, -30)
});
marker.content = this.getMarketContent(data);
this.setMarkerIcon(marker);
if(DEVICE_TYPE.WORKORDER != markerType){
marker.content = this.getMarketContent(data);
marker.on("mouseover", infoOpen);
marker.on("mouseout", infoClose);
marker.setExtData(data);
......@@ -138,6 +140,9 @@ class gaodeMap {
editWindow.form.longitude = e.lnglat.lng;
editWindow.form.latitude = e.lnglat.lat;
});
}
this.markers.push(marker);
map.setZoom("11");
//map.setFitView();
......@@ -207,6 +212,7 @@ class gaodeMap {
dom.remove();
return html;
}
}
}
......@@ -260,6 +266,14 @@ class gaodeMap {
marker.setIcon(icon);
break;
}
case DEVICE_TYPE.WORKORDER: {
let icon = new AMap.Icon({
//size: new AMap.Size(51, 23),
image: require("../assets/images/zhibaorenyuan.png"),
});
marker.setIcon(icon);
break;
}
}
}
......
......@@ -60,11 +60,11 @@
<div style="color: #31EAEA;width: 100%;height: 40px;">
<ul><li>接单信息</li></ul>
</div>
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="margin-left: 50px;">
<el-form-item label="接单人:" prop="actualInspectorName">
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="margin-left: 50px;height: 30px;width: 100%;">
<el-form-item label="接单人:" prop="actualInspectorName" style="float: left;width: 250px;">
<font>{{form.actualInspectorName}}</font>
</el-form-item>
<el-form-item label="接单时间:" prop="actualTime">
<el-form-item label="接单时间:" prop="actualTime" style="float: left;">
<font>{{form.actualTime}}</font>
</el-form-item>
</el-form>
......@@ -140,7 +140,7 @@
import { listBasicsInfo, getBasicsInfo, delBasicsInfo, addBasicsInfo, updateBasicsInfo, exportBasicsInfo } from "@/api/workOrder/basicsInfo";
import gaodeMap from "utils/gaodeMap.js"
import {map} from "utils/gaodeMap.js"
import {map, DEVICE_TYPE} from "utils/gaodeMap.js"
export default {
name: "BasicsInfo",
components: {
......@@ -201,7 +201,6 @@ export default {
created() {
// 如果是跳转来的,则接受初始化参数
// this.user_id = this.$route.query.id; //详细信息页接收参数
console.log(this.$route.query.orderId,"12234==========")
this.orderId = this.$route.query.orderId;
this.getList();
......@@ -215,6 +214,9 @@ export default {
},
mounted(){
let map = new gaodeMap("平山");
let data = {longitude:"114.208371",latitude:"38.267036"}
map.addMarker(DEVICE_TYPE.WORKORDER,data)
},
methods: {
......@@ -241,7 +243,6 @@ export default {
getBasicsInfo(this.orderId).then(response =>{
this.form = response.data;
this.active = parseInt(response.data.orderStatus) + 1;
console.log("response.data",response.data)
});
},
......
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