代码优化,安装单已完成后,设备状态变为离线,设备表加repair_flag创建时为1,维修单已完成时设置为0
| | |
| | | @Log(title = "用户头像", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/avatar") |
| | | public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException { |
| | | // 判断头像文件不为空 |
| | | if (!file.isEmpty()) { |
| | | // 通过Security获取到登录的用户信息 |
| | | LoginUser loginUser = getLoginUser(); |
| | | // 头像完整路径 |
| | | String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file); |
| | | // 保存到数据库通过用户名查找到对应用户修改头像地址信息 |
| | | if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 返回值中增加头像地址(为空时默认使用若依头像) |
| | | ajax.put("imgUrl", avatar); |
| | | // 更新缓存用户头像 |
| | | loginUser.getUser().setAvatar(avatar); |
| | | // 更新token |
| | | tokenService.setLoginUser(loginUser); |
| | | // 返回前端 |
| | | return ajax; |
| | | } |
| | | } |
| | |
| | | # 文件路径,以uploadPath结尾 示例( Windows配置 D:/uploadPath,Linux配置 /uploadPath) |
| | | # /var/data/java/uploadPath |
| | | # D:/uploadPath |
| | | profile: /var/data/java/uploadPath |
| | | profile: D:/uploadPath |
| | | |
| | | # 获取ip地址开关 |
| | | addressEnabled: true |
| | | # 验证码类型 math 数组计算 char 字符验证 |
| | |
| | | public static String getUploadPath() { |
| | | return getProfile() + "/upload"; |
| | | } |
| | | |
| | | /** |
| | | * 获取按安装单完成的时候上传的图片 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getDeviceOrderPath() { |
| | | return getProfile() + "/deviceOrder"; |
| | | } |
| | | } |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | |
| | | /** |
| | | * 时间工具类 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class DateUtils extends org.apache.commons.lang3.time.DateUtils |
| | | { |
| | | public class DateUtils extends org.apache.commons.lang3.time.DateUtils { |
| | | public static String YYYY = "yyyy"; |
| | | |
| | | public static String YYYY_MM = "yyyy-MM"; |
| | |
| | | public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; |
| | | |
| | | public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; |
| | | |
| | | |
| | | private static String[] parsePatterns = { |
| | | "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", |
| | | "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", |
| | | "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", |
| | | "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; |
| | | |
| | | /** |
| | | * 获取当前Date型日期 |
| | | * |
| | | * |
| | | * @return Date() 当前日期 |
| | | */ |
| | | public static Date getNowDate() |
| | | { |
| | | public static Date getNowDate() { |
| | | return new Date(); |
| | | } |
| | | |
| | | /** |
| | | * 获取当前日期, 默认格式为yyyy-MM-dd |
| | | * |
| | | * |
| | | * @return String |
| | | */ |
| | | public static String getDate() |
| | | { |
| | | public static String getDate() { |
| | | return dateTimeNow(YYYY_MM_DD); |
| | | } |
| | | |
| | | public static final String getTime() |
| | | { |
| | | public static final String getTime() { |
| | | return dateTimeNow(YYYY_MM_DD_HH_MM_SS); |
| | | } |
| | | |
| | | public static final String dateTimeNow() |
| | | { |
| | | public static final String dateTimeNow() { |
| | | return dateTimeNow(YYYYMMDDHHMMSS); |
| | | } |
| | | |
| | | public static final String dateTimeNow(final String format) |
| | | { |
| | | public static final String dateTimeNow(final String format) { |
| | | return parseDateToStr(format, new Date()); |
| | | } |
| | | |
| | | public static final String dateTime(final Date date) |
| | | { |
| | | public static final String dateTime(final Date date) { |
| | | return parseDateToStr(YYYY_MM_DD, date); |
| | | } |
| | | |
| | | public static final String parseDateToStr(final String format, final Date date) |
| | | { |
| | | public static final String parseDateToStr(final String format, final Date date) { |
| | | return new SimpleDateFormat(format).format(date); |
| | | } |
| | | |
| | | public static final Date dateTime(final String format, final String ts) |
| | | { |
| | | try |
| | | { |
| | | public static final Date dateTime(final String format, final String ts) { |
| | | try { |
| | | return new SimpleDateFormat(format).parse(ts); |
| | | } |
| | | catch (ParseException e) |
| | | { |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 日期路径 即年/月/日 如2018/08/08 |
| | | */ |
| | | public static final String datePath() |
| | | { |
| | | public static final String datePath() { |
| | | Date now = new Date(); |
| | | return DateFormatUtils.format(now, "yyyy/MM/dd"); |
| | | } |
| | |
| | | /** |
| | | * 日期路径 即年/月/日 如20180808 |
| | | */ |
| | | public static final String dateTime() |
| | | { |
| | | public static final String dateTime() { |
| | | Date now = new Date(); |
| | | return DateFormatUtils.format(now, "yyyyMMdd"); |
| | | } |
| | |
| | | /** |
| | | * 日期型字符串转化为日期 格式 |
| | | */ |
| | | public static Date parseDate(Object str) |
| | | { |
| | | if (str == null) |
| | | { |
| | | public static Date parseDate(Object str) { |
| | | if (str == null) { |
| | | return null; |
| | | } |
| | | try |
| | | { |
| | | try { |
| | | return parseDate(str.toString(), parsePatterns); |
| | | } |
| | | catch (ParseException e) |
| | | { |
| | | } catch (ParseException e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取服务器启动时间 |
| | | */ |
| | | public static Date getServerStartDate() |
| | | { |
| | | public static Date getServerStartDate() { |
| | | long time = ManagementFactory.getRuntimeMXBean().getStartTime(); |
| | | return new Date(time); |
| | | } |
| | |
| | | /** |
| | | * 计算两个时间差 |
| | | */ |
| | | public static String getDatePoor(Date endDate, Date nowDate) |
| | | { |
| | | public static String getDatePoor(Date endDate, Date nowDate) { |
| | | long nd = 1000 * 24 * 60 * 60; |
| | | long nh = 1000 * 60 * 60; |
| | | long nm = 1000 * 60; |
| | |
| | | */ |
| | | public static final String upload(String baseDir, MultipartFile file) throws IOException { |
| | | try { |
| | | //baseDir文件上传的路径,file是上传的文件,DEFAULT_ALLOWED_EXTENSION数组定义的图片的格式 |
| | | return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
| | | } catch (Exception e) { |
| | | throw new IOException(e.getMessage(), e); |
| | |
| | | public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension) |
| | | throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException, |
| | | InvalidExtensionException { |
| | | // 要求文件名不为空,获取文件名长度 |
| | | int fileNamelength = file.getOriginalFilename().length(); |
| | | // 文件名长度限制,默认值——100 (原有) |
| | | if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) { |
| | | throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH); |
| | | } |
| | | |
| | | assertAllowed(file, allowedExtension); |
| | | |
| | | // 判断文件扩展名是否被允许——不被允许会返回异常 |
| | | assertAllowed(file, allowedExtension); //判断上传过来的文件的类型例如(jpg,jpeg,png)扩展名是否在所定义的图片格式里面 |
| | | // 编码文件名:文件夹/文件名_类型(上传下载).扩展名 |
| | | //fileName: "2023/11/24/71132d88-9ba1-47c1-b501-b9edb8f48e8b.jpeg" |
| | | String fileName = extractFilename(file); |
| | | |
| | | File desc = getAbsoluteFile(baseDir, fileName); |
| | | File desc = getAbsoluteFile(baseDir, fileName); //baseDir: "D:/uploadPath/avatar" fileName: "2023/11/24/71132d88-9ba1-47c1-b501-b9edb8f48e8b.jpeg" |
| | | //转录文件(系统内置) |
| | | file.transferTo(desc); |
| | | //返回完整保存路径 |
| | | String pathFileName = getPathFileName(baseDir, fileName); |
| | | return pathFileName; |
| | | } |
| | |
| | | |
| | | /** |
| | | * ID生成器工具类 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class IdUtils |
| | | { |
| | | public class IdUtils { |
| | | /** |
| | | * 获取随机UUID |
| | | * |
| | | * |
| | | * @return 随机UUID |
| | | */ |
| | | public static String randomUUID() |
| | | { |
| | | public static String randomUUID() { |
| | | return UUID.randomUUID().toString(); |
| | | } |
| | | |
| | | /** |
| | | * 简化的UUID,去掉了横线 |
| | | * |
| | | * |
| | | * @return 简化的UUID,去掉了横线 |
| | | */ |
| | | public static String simpleUUID() |
| | | { |
| | | public static String simpleUUID() { |
| | | return UUID.randomUUID().toString(true); |
| | | } |
| | | |
| | | /** |
| | | * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID |
| | | * |
| | | * |
| | | * @return 随机UUID |
| | | */ |
| | | public static String fastUUID() |
| | | { |
| | | public static String fastUUID() { |
| | | return UUID.fastUUID().toString(); |
| | | } |
| | | |
| | | /** |
| | | * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID |
| | | * |
| | | * |
| | | * @return 简化的UUID,去掉了横线 |
| | | */ |
| | | public static String fastSimpleUUID() |
| | | { |
| | | public static String fastSimpleUUID() { |
| | | return UUID.fastUUID().toString(true); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.iot.controller; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.iot.domain.Device; |
| | | import com.ruoyi.iot.domain.DeviceOrder; |
| | | import com.ruoyi.iot.service.IDeviceOrderService; |
| | | import com.ruoyi.iot.service.IDeviceService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.slf4j.Logger; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private IDeviceService deviceService; |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 查询全部设备安装单订单信息 |
| | |
| | | } else { |
| | | deviceOrder.setState(1); |
| | | } |
| | | if ("2".equals(deviceOrder.getOrderType())) { |
| | | Device device = new Device(); |
| | | device.setDeviceId(deviceOrder.getDeviceId()); |
| | | device.setRepairFlag(1); |
| | | deviceService.updateDevice(device); |
| | | } |
| | | //更新订单的用户信息 |
| | | SysUser sysUser = getLoginUser().getUser(); |
| | | deviceOrder.setCreateUserId(sysUser.getUserId()); |
| | | if (sysUser.getUserId() != 1) { |
| | | //插入安装订单 |
| | | int rows = iDeviceOrderService.insertDeviceOrder(deviceOrder); |
| | | if (rows > 0) { |
| | | //更新当前设备状态信息--安装中 |
| | | Device device = new Device(); |
| | | device.setDeviceId(deviceOrder.getDeviceId()); |
| | | device.setStatus(5); |
| | | deviceService.updateDevice(device); |
| | | } |
| | | return toAjax(rows); |
| | | } else { |
| | | return AjaxResult.error("超级管理员不可以添加设备单信息"); |
| | | //插入安装订单 |
| | | int rows = iDeviceOrderService.insertDeviceOrder(deviceOrder); |
| | | if (rows > 0) { |
| | | //更新当前设备状态信息--安装中 |
| | | Device device = new Device(); |
| | | device.setDeviceId(deviceOrder.getDeviceId()); |
| | | device.setStatus(5); |
| | | deviceService.updateDevice(device); |
| | | } |
| | | return toAjax(rows); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "修改设备订单信息", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DeviceOrder deviceOrder) throws Exception { |
| | | if ("1".equals(deviceOrder.getOrderType()) && deviceOrder.getState() == 3) { |
| | | Device device = new Device(); |
| | | device.setDeviceId(deviceOrder.getDeviceId()); |
| | | device.setStatus(4); |
| | | deviceService.updateDevice(device); |
| | | } |
| | | if ("2".equals(deviceOrder.getOrderType()) && deviceOrder.getState() == 3) { |
| | | Device device = new Device(); |
| | | device.setDeviceId(deviceOrder.getDeviceId()); |
| | | device.setRepairFlag(0); |
| | | } |
| | | //获取修改订单的用户信息 |
| | | SysUser sysUser = getLoginUser().getUser(); |
| | | //拿到修改安装单的用户id |
| | | deviceOrder.setUpdateUserId(sysUser.getUserId()); |
| | | if (sysUser.getUserId() != 1) { |
| | | return toAjax(iDeviceOrderService.updateDeviceOrder(deviceOrder)); |
| | | } else { |
| | | return AjaxResult.error("超级管理员不可以修改信息"); |
| | | } |
| | | return toAjax(iDeviceOrderService.updateDeviceOrder(deviceOrder)); |
| | | } |
| | | |
| | | /** |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 安装单维修单图片上传 |
| | | */ |
| | | |
| | | @Log(title = "安装单图片上传", businessType = BusinessType.INSERT) |
| | | @PostMapping("/profile/avatar") |
| | | @ApiOperation("安装单图片上传") |
| | | public AjaxResult imgurl(@RequestParam("avatarfile") MultipartFile file) throws Exception { |
| | | // 判断头像文件不为空 |
| | | if (!file.isEmpty()) { |
| | | // 通过Security获取到登录的用户信息 |
| | | LoginUser loginUser = getLoginUser(); |
| | | String avatar = FileUploadUtils.upload(RuoYiConfig.getDeviceOrderPath(), file); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("imgUrl", avatar); |
| | | return ajax; |
| | | } |
| | | return AjaxResult.error("图片上传失败"); |
| | | } |
| | | } |
| | | |
| | |
| | | @Excel(name = "分派时间", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date assignTime; |
| | | |
| | | /** |
| | | * 删除标志(0代表存在 2代表删除) |
| | | */ |
| | | private String delFlag; |
| | | |
| | | /** |
| | | * 是否维修 |
| | | */ |
| | | private Integer repairFlag; |
| | | |
| | | |
| | | public Integer getLocationWay() { |
| | | return locationWay; |
| | | } |
| | |
| | | public void setIsOwner(Integer isOwner) { |
| | | this.isOwner = isOwner; |
| | | } |
| | | |
| | | /** |
| | | * 删除标志(0代表存在 2代表删除) |
| | | */ |
| | | private String delFlag; |
| | | |
| | | public Long getGroupId() { |
| | | return groupId; |
| | |
| | | this.tDSA = tDSA; |
| | | } |
| | | |
| | | public Integer getRepairFlag() { |
| | | return repairFlag; |
| | | } |
| | | |
| | | public void setRepairFlag(Integer repairFlag) { |
| | | this.repairFlag = repairFlag; |
| | | } |
| | | |
| | | public Device() { |
| | | } |
| | | |
| | |
| | | .append("assignTime", getAssignTime()) |
| | | .append("tDSP", gettDSP()) |
| | | .append("tDSA", gettDSA()) |
| | | .append("repairFlag", getRepairFlag()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | this.description = description; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int updateDeviceUserBySN(List<String> snList, Long userId); |
| | | |
| | | } |
| | |
| | | <result property="assignTime" column="assign_time"/> |
| | | <result property="tDSA" column="tds_a"/> |
| | | <result property="tDSP" column="tds_p"/> |
| | | <result property="repairFlag" column="repair_flag"/> |
| | | </resultMap> |
| | | |
| | | <resultMap type="com.ruoyi.iot.model.DeviceShortOutput" id="DeviceShortResult"> |
| | |
| | | summary, |
| | | remark, |
| | | tds_p, |
| | | tds_a |
| | | tds_a, |
| | | repair_flag |
| | | from iot_device |
| | | </sql> |
| | | |
| | |
| | | active_time, |
| | | img_url, |
| | | tds_p, |
| | | tds_a |
| | | tds_a, |
| | | repair_flag |
| | | from iot_device |
| | | </sql> |
| | | |
| | |
| | | select d.device_id, d.device_name, d.product_id, d.product_name, d.user_id, d.user_name, d.tenant_id, |
| | | d.tenant_name, |
| | | d.serial_number, d.firmware_version, d.status,d.is_shadow ,d.location_way,d.active_time, |
| | | d.img_url,a.device_id,d.tds_p,d.tds_a |
| | | d.img_url,a.device_id,d.tds_p,d.tds_a,d.repair_flag |
| | | as auth_device_id |
| | | from iot_device d |
| | | left join iot_product_authorize a on a.device_id=d.device_id |
| | |
| | | |
| | | <select id="selectDeviceListByGroup" parameterType="com.ruoyi.iot.domain.Device" resultMap="DeviceResult"> |
| | | select d.device_id, d.device_name, d.product_name, d.user_name, d.serial_number, d.firmware_version, |
| | | d.status,d.rssi,d.is_shadow ,d.tds_p,d.tds_a, |
| | | d.status,d.rssi,d.is_shadow ,d.tds_p,d.tds_a,d.repair_flag, |
| | | d.location_way, d.active_time,d.network_address,d.longitude,d.latitude,max(u.is_owner) as is_owner |
| | | from iot_device d |
| | | inner join iot_device_user u on u.device_id = d.device_id |
| | |
| | | |
| | | <select id="selectAllDeviceShortList" parameterType="com.ruoyi.iot.domain.Device" resultMap="DeviceAllShortResult"> |
| | | select d.device_id, d.device_name, d.product_name, d.user_name, d.serial_number, d.firmware_version, |
| | | d.status,d.rssi,d.is_shadow ,d.tds_p,d.tds_a, |
| | | d.status,d.rssi,d.is_shadow ,d.tds_p,d.tds_a,d.repair_flag, |
| | | d.location_way, d.active_time,d.network_address,d.longitude,d.latitude,max(u.is_owner) as is_owner |
| | | from iot_device d |
| | | inner join iot_device_user u on u.device_id = d.device_id |
| | |
| | | select d.device_id, d.device_name, d.product_id, d.product_name, |
| | | d.user_id, d.user_name, d.tenant_id, su.nick_name tenant_name, d.serial_number, |
| | | d.firmware_version, d.status,d.rssi,d.is_shadow ,d.location_way, |
| | | d.things_model_value,d.assign_time, d.active_time,d.img_url,max(u.is_owner) as is_owner,d.tds_p,d.tds_a |
| | | d.things_model_value,d.assign_time, d.active_time,d.img_url,max(u.is_owner) as |
| | | is_owner,d.tds_p,d.tds_a,d.repair_flag |
| | | from iot_device d |
| | | inner join iot_device_user u on u.device_id = d.device_id |
| | | inner join sys_user su on su.user_id = d.tenant_id |
| | |
| | | <if test="summary != null">summary,</if> |
| | | <if test="tDSP != null">tds_p,</if> |
| | | <if test="tDSA != null">tds_a,</if> |
| | | <if test="repairFlag != null">repair_flag,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="deviceName != null and deviceName != ''">#{deviceName},</if> |
| | |
| | | <if test="summary != null">#{summary},</if> |
| | | <if test="tDSP != null">#{tDSP},</if> |
| | | <if test="tDSA != null">#{tDSA},</if> |
| | | <if test="repairFlag != null">#{repairFlag},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="assignTime != null">assign_time = #{assignTime},</if> |
| | | <if test="tDSP != null ">tds_p = #{tDSP},</if> |
| | | <if test="tDSA != null ">tds_a = #{tDSA},</if> |
| | | <if test="repairFlag != null">repair_flag = #{repairFlag},</if> |
| | | </trim> |
| | | where device_id = #{deviceId} |
| | | </update> |
| | |
| | | <if test="assignTime != null">assign_time = #{assignTime},</if> |
| | | <if test="tDSP != null ">tds_p = #{tDSP},</if> |
| | | <if test="tDSA != null ">tds_a = #{tDSA},</if> |
| | | <if test="repairFlag != null">repair_flag = #{repairFlag},</if> |
| | | </trim> |
| | | where serial_number = #{serialNumber} |
| | | </update> |
| | |
| | | <if test="finshTime != null">#{finshTime},</if> |
| | | <if test="state != null and state != ''">#{state},</if> |
| | | <if test="createUserId != null and createUserId != 0">#{createUserId},</if> |
| | | <if test="imgUrl != null and imgUrl != ''">#{imgUrl}</if> |
| | | <if test="imgUrl != null and imgUrl != ''">#{imgUrl},</if> |
| | | sysdate()) |
| | | </insert> |
| | | <insert id="insertDeviceOrders"></insert> |
| | | <update id="updateDeviceOrder" parameterType="DeviceOrder"> |
| | | update iot_device_order |
| | | <set> |
| | |
| | | <el-card style="margin-bottom:6px;"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true"> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="state" placeholder="菜单状态"> |
| | | <el-select v-model="state" placeholder="菜单状态" size="mini"> |
| | | <el-option label="全部" :value="-1" /> |
| | | <el-option label="未派单" :value="0" /> |
| | | <el-option label="已派单" :value="1" /> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="等级" prop="level"> |
| | | <el-select v-model="level" placeholder="菜单状态" :disabled="erectoListLevel.length == 0"> |
| | | <el-select v-model="level" placeholder="菜单状态" :disabled="erectoListLevel.length == 0" size="mini"> |
| | | <el-option label="本级" :value="0" /> |
| | | <el-option label="下级" :value="1" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="level == 1 && erectoListLevel.length > 0" label="下级联营商" prop="nextlevel"> |
| | | <el-select v-model="nextlevel" placeholder="菜单状态"> |
| | | <el-select v-model="nextlevel" placeholder="菜单状态" size="mini"> |
| | | <el-option v-for="item in erectoListLevel" :label="item.dept.deptName" :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" @click="changePage(1)">搜索</el-button> |
| | | <el-form-item > |
| | | <el-button size="mini" type="primary" icon="el-icon-search" |
| | | @click="changePage(1)">搜索</el-button></el-form-item> |
| | | <!-- <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="queryParams.WXBody" placeholder="菜单状态" clearable size="small"> |
| | | <el-option v-for="dict in WXBodyType" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | |
| | | <el-button slot="append" icon="el-icon-search"></el-button> |
| | | </el-input> |
| | | </el-form-item> --> |
| | | <el-form-item style="float: right;"> |
| | | <el-button type="primary" v-hasPermi="['iot:device:add']" plain icon="el-icon-plus" |
| | | <el-form-item style="float: right;" v-if="roleKey !== 'admin'"> |
| | | <el-button type="primary" v-hasPermi="['iot:device:add']" plain icon="el-icon-plus" size="mini" |
| | | @click="openAZModal">新增</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <el-table-column type="selection" fixed width="55"> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="基本信息"> --> |
| | | <el-table-column prop="id" label="编号" width="120"> |
| | | <el-table-column prop="id" label="编号" width="60"> |
| | | </el-table-column> |
| | | |
| | | <!-- </el-table-column> --> |
| | |
| | | </el-table-column> |
| | | </el-table-column> --> |
| | | |
| | | <el-table-column label="操作" fixed="right" align="center" width="190" class-name="small-padding fixed-width" > |
| | | <el-table-column label="操作" fixed="right" align="center" width="150" class-name="small-padding fixed-width" |
| | | v-if="roleKey !== 'admin'"> |
| | | <template slot-scope="scope"> |
| | | <div style="display: flex;justify-content: space-around;flex-wrap: wrap;"> |
| | | <el-button size="small" type="primary" style="padding:5px;" icon="el-icon-edit" |
| | | <div style="display: flex;justify-content: space-around;"> |
| | | <el-button v-if="scope.row.state != 3" size="small" type="primary" style="padding:5px;" icon="el-icon-edit" |
| | | v-hasPermi="['iot:device:edit']" @click="editModal(scope.row)">修改</el-button> |
| | | <el-button size="small" type="danger" style="padding:5px;" icon="el-icon-delete" |
| | | <el-button v-if="scope.row.state == 0" size="small" type="danger" style="padding:5px;" icon="el-icon-delete" |
| | | v-hasPermi="['iot:device:remove']" @click="delModal(scope.row)">删除</el-button> |
| | | <el-button v-if="scope.row.state == 1" size="small" type="primary" style="padding:5px;" |
| | | icon="el-icon-edit" @click="JDModal(scope.row)">接单</el-button> |
| | | <el-button v-if="scope.row.state == 1" size="small" type="success" style="padding:5px;" |
| | | icon="el-icon-odometer" @click="JDModal(scope.row)">接单</el-button> |
| | | </div> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination background :current-page="pageIndex" @current-change="changePage" :page-size="pageSize" |
| | | layout="prev, pager, next" :total="total" style="margin-top: 12px;"> |
| | | </el-pagination> |
| | | |
| | | </el-card> |
| | | |
| | | <el-dialog :title="title" :visible.sync="AZModal"> |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="AZModal = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitForm('form')">确 定</el-button> |
| | | <el-button @click="AZModal = false" size="mini">取 消</el-button> |
| | | <el-button type="primary" @click="submitForm('form')" size="mini">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog title="删除数据" :visible.sync="deleteModal" width="30%"> |
| | | <span>是否删除该条数据</span> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="deleteModal = false">取 消</el-button> |
| | | <el-button type="primary" @click="delDate">确 定</el-button> |
| | | <el-button @click="deleteModal = false" size="mini">取 消</el-button> |
| | | <el-button type="primary" @click="delDate" size="mini">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="接单" :visible.sync="acceptModal" width="30%"> |
| | | <span>是否确认接单?此操作不可恢复!</span> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="acceptModal = false">取 消</el-button> |
| | | <el-button type="primary" @click="add">确 定</el-button> |
| | | <el-button @click="acceptModal = false" size="mini">取 消</el-button> |
| | | <el-button type="primary" @click="add" size="mini">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | |
| | | getList() { |
| | | this.tableData = [] |
| | | let data = { |
| | | pageNum: this.pagenpmIndex, |
| | | pageNum: this.pageIndex, |
| | | pageSize: this.pageSize, |
| | | state: this.state, |
| | | orderType: 1, |
| | |
| | | <el-card style="margin-bottom:6px;"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true"> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="state" placeholder="菜单状态"> |
| | | <el-select v-model="state" placeholder="菜单状态" size="mini"> |
| | | <el-option label="全部" :value="-1" /> |
| | | <el-option label="未派单" :value="0" /> |
| | | <el-option label="已派单" :value="1" /> |
| | |
| | | <el-option label="已完成" :value="3" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" @click="changePage(1)">搜索</el-button> |
| | | <el-form-item > |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="changePage(1)">搜索</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="queryParams.WXBody" placeholder="菜单状态" clearable size="small"> |
| | | <el-option v-for="dict in WXBodyType" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | |
| | | <el-button slot="append" icon="el-icon-search"></el-button> |
| | | </el-input> |
| | | </el-form-item> --> |
| | | <el-form-item style="float: right;"> |
| | | <el-button type="primary" v-hasPermi="['iot:device:add']" plain icon="el-icon-plus" |
| | | <el-form-item style="float: right;" v-if="roleKey !== 'admin'"> |
| | | <el-button type="primary" v-hasPermi="['iot:device:add']" plain icon="el-icon-plus" size="mini" |
| | | @click="openAZModal">新增</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <el-table-column type="selection" fixed width="55"> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="基本信息"> --> |
| | | <el-table-column prop="id" label="编号" width="120"> |
| | | <el-table-column prop="id" label="编号" width="60"> |
| | | </el-table-column> |
| | | |
| | | <!-- </el-table-column> --> |
| | |
| | | </el-table-column> |
| | | </el-table-column> --> |
| | | |
| | | <el-table-column label="操作" fixed="right" align="center" width="190" class-name="small-padding fixed-width"> |
| | | <el-table-column label="操作" fixed="right" align="center" width="150" class-name="small-padding fixed-width" v-if="roleKey !== 'admin'"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" type="primary" style="padding:5px;" icon="el-icon-edit" |
| | | v-hasPermi="['iot:device:edit']" @click="editModal(scope.row)">修改</el-button> |
| | | <el-button size="small" type="danger" style="padding:5px;" icon="el-icon-delete" |
| | | v-hasPermi="['iot:device:remove']" @click="delModal(scope.row)">删除</el-button> |
| | | <el-button v-if="scope.row.state == 1" size="small" type="primary" style="padding:5px;" |
| | | icon="el-icon-edit" @click="JDModal(scope.row)">接单</el-button> |
| | | <div style="display: flex;justify-content: space-around;"> |
| | | <el-button v-if="scope.row.state != 3" size="small" type="primary" style="padding:5px;" icon="el-icon-edit" |
| | | v-hasPermi="['iot:device:edit']" @click="editModal(scope.row)">修改</el-button> |
| | | <el-button v-if="scope.row.state == 0" size="small" type="danger" style="padding:5px;" icon="el-icon-delete" |
| | | v-hasPermi="['iot:device:remove']" @click="delModal(scope.row)">删除</el-button> |
| | | <el-button v-if="scope.row.state == 1" size="small" type="success" style="padding:5px;" |
| | | icon="el-icon-odometer" @click="JDModal(scope.row)">接单</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | deleteModal: false, |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | total: 20, |
| | | total: 0, |
| | | searchName: '', |
| | | queryParams: { |
| | | WXBody: '未派单', |