Commit 4b9c01b3 authored by wuqinghua's avatar wuqinghua

Merge remote-tracking branch 'origin/master'

parents eea1a2a6 6ac8be6c
package com.zehong.web.controller.operationMonitor;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.core.domain.model.LoginUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.SysPost;
import com.zehong.system.service.ISysPostService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -33,6 +39,9 @@ public class TWorkOrderController extends BaseController
@Autowired
private ITWorkOrderService tWorkOrderService;
@Autowired
private ISysPostService iSysPostService;
/**
* 查询燃气任务列表
*/
......@@ -41,6 +50,7 @@ public class TWorkOrderController extends BaseController
public TableDataInfo list(TWorkOrder tWorkOrder)
{
startPage();
judgeUserRole(tWorkOrder);
List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
return getDataTable(list);
}
......@@ -53,11 +63,34 @@ public class TWorkOrderController extends BaseController
@GetMapping("/export")
public AjaxResult export(TWorkOrder tWorkOrder)
{
judgeUserRole(tWorkOrder);
List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
ExcelUtil<TWorkOrder> util = new ExcelUtil<TWorkOrder>(TWorkOrder.class);
return util.exportExcel(list, "燃气任务数据");
}
/**
* 判断用户角色
* @param tWorkOrder
*/
private void judgeUserRole(TWorkOrder tWorkOrder){
SysUser user = SecurityUtils.getLoginUser().getUser();
//获取用户所属单位
long enterpriseId = user.getDeptId();
//判断是否为政府用户
if(!"-2".equals(String.valueOf(enterpriseId))){
tWorkOrder.setWorkAssignEnterproseId(enterpriseId);
//判断是否为巡线员
List<Integer> postIds = iSysPostService.selectPostListByUserId(user.getUserId());
for(Integer postId : postIds){
SysPost postInfo = iSysPostService.selectPostById(postId.longValue());
if("se".equals(postInfo.getPostCode())){
tWorkOrder.setWorkAssignManId(user.getUserId());
}
}
}
}
/**
* 获取燃气任务详细信息
*/
......
......@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Set;
import com.zehong.framework.systemsetting.SystemSetting;
import com.zehong.system.service.ISysPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -44,6 +45,9 @@ public class SysLoginController
@Autowired
private SystemSetting systemSetting;
@Autowired
private ISysPostService iSysPostService;
/**
* 登录方法
*
......@@ -80,6 +84,7 @@ public class SysLoginController
ajax.put("roles", roles);
ajax.put("permissions", permissions);
ajax.put("systemSetting",systemSetting.getSystemWebSetting());
ajax.put("posts",iSysPostService.getPostListByUserId(user.getUserId()));
return ajax;
}
......
package com.zehong.web.controller.system;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.zehong.framework.systemsetting.SystemSetting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.zehong.common.annotation.Log;
import com.zehong.common.constant.UserConstants;
......@@ -207,4 +202,19 @@ public class SysUserController extends BaseController
user.setUpdateBy(SecurityUtils.getUsername());
return toAjax(userService.updateUserStatus(user));
}
/**
* 根据企业获取巡线员
*
* @param enterpriseId 企业id
* @param postCode 岗位编码
* @return 巡线员信息
*/
@GetMapping("/getInspectionUsers")
public AjaxResult getInspectionUsers(@RequestParam(value = "enterpriseId") String enterpriseId, @RequestParam(value="postCode") String postCode){
Map<String,String> map = new HashMap<>();
map.put("enterpriseId",enterpriseId);
map.put("postCode",postCode);
return AjaxResult.success(userService.getInspectionUsers(map));
};
}
......@@ -45,6 +45,18 @@ public class TEnterpriseInfoController extends BaseController
return getDataTable(list);
}
/**
*查询所有企业信息
* @param tEnterpriseInfo
* @return
*/
@GetMapping("/enterpriseLists")
public TableDataInfo enterpriseLists(TEnterpriseInfo tEnterpriseInfo)
{
List<TEnterpriseInfo> list = tEnterpriseInfoService.selectTEnterpriseInfoList(tEnterpriseInfo);
return getDataTable(list);
}
/**
* 导出企业信息列表
*/
......
......@@ -76,13 +76,17 @@ public class SysUser extends BaseEntity
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
private Date loginDate;
/** 部门对象 */
/** 部门对象 */
@Excels({
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
})
private SysDept dept;
/** 所属单位 */
@Excel(name = "所属单位", targetAttr = "enterpriseName", type = Type.EXPORT)
private String enterpriseName;
/** 角色对象 */
private List<SysRole> roles;
......@@ -300,6 +304,14 @@ public class SysUser extends BaseEntity
this.postIds = postIds;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -41,8 +41,8 @@ public class TSafeEquipmentStandingBook extends BaseEntity
private String linkMobile;
/** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date installTime;
/** 品牌名称 */
......
......@@ -59,6 +59,11 @@ public class TTroubleStandingBook extends BaseEntity
@Excel(name = "是否处理:1.已处理 2.未处理")
private String isDeal;
/** 事故发生时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "事故发生时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date happenDate;
/** 处理完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "处理完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
......@@ -170,7 +175,16 @@ public class TTroubleStandingBook extends BaseEntity
{
return isDeal;
}
public void setDealDate(Date dealDate)
public Date getHappenDate() {
return happenDate;
}
public void setHappenDate(Date happenDate) {
this.happenDate = happenDate;
}
public void setDealDate(Date dealDate)
{
this.dealDate = dealDate;
}
......
......@@ -28,6 +28,14 @@ public class TTroubleStandingBookForm
/** 是否处理:1.已处理 2.未处理 */
private String isDeal;
/** 事故发生起始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date happenDateStart;
/** 事故发生截止时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date happenDateEnd;
/** 处理完成起始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dealDateStart;
......
......@@ -41,6 +41,13 @@ public interface SysPostMapper
*/
public List<Integer> selectPostListByUserId(Long userId);
/**
* 根据用户ID查询岗位信息
* @param userId 用户id
* @return
*/
List<SysPost> getPostListByUserId(Long userId);
/**
* 查询用户所属岗位组
*
......
package com.zehong.system.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.zehong.common.core.domain.entity.SysUser;
......@@ -108,4 +110,12 @@ public interface SysUserMapper
* @return 结果
*/
public SysUser checkEmailUnique(String email);
/**
* 根据企业获取巡线员
*
* @param map
* @return 巡线员信息
*/
List<SysUser> getInspectionUsers(Map<String,String> map);
}
......@@ -41,6 +41,13 @@ public interface ISysPostService
*/
public List<Integer> selectPostListByUserId(Long userId);
/**
* 根据用户ID查询岗位信息
* @param userId 用户id
* @return
*/
List<SysPost> getPostListByUserId(Long userId);
/**
* 校验岗位名称
*
......
package com.zehong.system.service;
import java.util.List;
import java.util.Map;
import com.zehong.common.core.domain.entity.SysUser;
/**
......@@ -164,4 +166,12 @@ public interface ISysUserService
* @return 结果
*/
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
/**
* 根据企业获取巡线员
*
* @param map
* @return 巡线员信息
*/
List<SysUser> getInspectionUsers(Map<String,String> map);
}
......@@ -72,6 +72,16 @@ public class SysPostServiceImpl implements ISysPostService
return postMapper.selectPostListByUserId(userId);
}
/**
* 根据用户ID查询岗位信息
* @param userId 用户id
* @return
*/
@Override
public List<SysPost> getPostListByUserId(Long userId){
return postMapper.getPostListByUserId(userId);
}
/**
* 校验岗位名称是否唯一
*
......
......@@ -2,6 +2,8 @@ package com.zehong.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -460,4 +462,16 @@ public class SysUserServiceImpl implements ISysUserService
}
return successMsg.toString();
}
/**
* 根据企业获取巡线员
*
* @param map
* @return 巡线员信息
*/
@Override
public List<SysUser> getInspectionUsers(Map<String,String> map){
return userMapper.getInspectionUsers(map);
}
}
......@@ -2,6 +2,7 @@ package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TWorkOrderMapper;
......@@ -54,6 +55,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
public int insertTWorkOrder(TWorkOrder tWorkOrder)
{
tWorkOrder.setCreateTime(DateUtils.getNowDate());
tWorkOrder.setCreateBy(SecurityUtils.getUsername());
return tWorkOrderMapper.insertTWorkOrder(tWorkOrder);
}
......@@ -67,6 +69,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
public int updateTWorkOrder(TWorkOrder tWorkOrder)
{
tWorkOrder.setUpdateTime(DateUtils.getNowDate());
tWorkOrder.setUpdateBy(SecurityUtils.getUsername());
return tWorkOrderMapper.updateTWorkOrder(tWorkOrder);
}
......
......@@ -53,6 +53,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user u on u.user_id = up.user_id
where u.user_id = #{userId}
</select>
<select id="getPostListByUserId" parameterType="Long" resultMap="SysPostResult">
select p.*
from sys_post p
left join sys_user_post up on up.post_id = p.post_id
left join sys_user u on u.user_id = up.user_id
where u.user_id = #{userId}
</select>
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
select p.post_id, p.post_name, p.post_code
......
......@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="enterpriseName" column="enterprise_name" />
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
......@@ -56,8 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</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
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, (CASE WHEN u.dept_id = '-2' THEN '政府部门'
ELSE enter.enterprise_name END)AS enterprise_name from sys_user u
LEFT JOIN t_enterprise_info enter ON u.dept_id = enter.enterprise_id
where u.del_flag = '0'
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
......@@ -74,9 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="deptId != null and deptId != 0">
<!--<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
</if>
</if>-->
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
......@@ -178,5 +180,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{userId}
</foreach>
</delete>
<select id="getInspectionUsers" parameterType="java.util.Map" resultMap="SysUserResult">
SELECT
u.user_id,
u.dept_id,
u.user_name
FROM
sys_user u
LEFT JOIN sys_user_post up ON u.user_id = up.user_id
LEFT JOIN sys_post p ON up.post_id = p.post_id
<where>
<if test="enterpriseId != null and enterpriseId != 0">
AND u.dept_id = #{enterpriseId}
</if>
<if test="postCode !=null and postCode != ''">
AND p.post_code = #{postCode}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="responsibleUnit" column="responsible_unit" />
<result property="responsiblePeople" column="responsible_people" />
<result property="isDeal" column="is_deal" />
<result property="happenDate" column="happen_date" />
<result property="dealDate" column="deal_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
......@@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectTTroubleStandingBookVo">
select trouble_id, trouble_name, trouble_location, longitude, latitude, trouble_type, brief_process, trouble_reason, responsible_unit, responsible_people, is_deal, deal_date, create_by, create_time, update_by, update_time, is_del, remarks from t_trouble_standing_book
select trouble_id, trouble_name, trouble_location, longitude, latitude, trouble_type, brief_process, trouble_reason, responsible_unit, responsible_people, is_deal,happen_date, deal_date, create_by, create_time, update_by, update_time, is_del, remarks from t_trouble_standing_book
</sql>
<select id="selectTTroubleStandingBookList" parameterType="TTroubleStandingBookForm" resultMap="TTroubleStandingBookResult">
......@@ -35,6 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="troubleName != null and troubleName != ''"> and trouble_name like concat('%', #{troubleName}, '%')</if>
<if test="troubleType != null and troubleType != ''"> and trouble_type = #{troubleType}</if>
<if test="isDeal != null and isDeal != ''"> and is_deal = #{isDeal}</if>
<if test="happenDateStart != null "> and happen_date &gt;= #{happenDateStart}</if>
<if test="happenDateEnd != null "> and happen_date &lt;= #{happenDateEnd}</if>
<if test="dealDateStart != null "> and deal_date &gt;= #{dealDateStart}</if>
<if test="dealDateEnd != null "> and deal_date &lt;= #{dealDateEnd}</if>
</where>
......@@ -58,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="responsibleUnit != null">responsible_unit,</if>
<if test="responsiblePeople != null">responsible_people,</if>
<if test="isDeal != null">is_deal,</if>
<if test="happenDate != null">happen_date,</if>
<if test="dealDate != null">deal_date,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
......@@ -77,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="responsibleUnit != null">#{responsibleUnit},</if>
<if test="responsiblePeople != null">#{responsiblePeople},</if>
<if test="isDeal != null">#{isDeal},</if>
<if test="happenDate != null">#{happenDate},</if>
<if test="dealDate != null">#{dealDate},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
......@@ -100,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="responsibleUnit != null">responsible_unit = #{responsibleUnit},</if>
<if test="responsiblePeople != null">responsible_people = #{responsiblePeople},</if>
<if test="isDeal != null">is_deal = #{isDeal},</if>
<if test="happenDate != null">happen_date = #{happenDate},</if>
<if test="dealDate != null">deal_date = #{dealDate},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
......
......@@ -9,6 +9,17 @@ export function listInfo(query) {
})
}
// 查询企业所有信息
export function enterpriseLists(query) {
return request({
url: '/regulation/info/enterpriseLists',
method: 'get',
params: query
})
}
// 查询企业信息详细
export function getInfo(enterpriseId) {
return request({
......
......@@ -50,4 +50,13 @@ export function exportPost(query) {
method: 'get',
params: query
})
}
\ No newline at end of file
}
//查询所有岗位
export function optionselect(query) {
return request({
url: '/system/post/optionselect',
method: 'get',
params: query
})
}
......@@ -125,3 +125,17 @@ export function importTemplate() {
method: 'get'
})
}
//获取用户巡检员
export function getInspectionUsers(enterpriseId,postCode) {
const data = {
enterpriseId,
postCode
}
return request({
url: '/system/user/getInspectionUsers',
method: 'get',
params: data
})
}
......@@ -17,6 +17,7 @@
class="upload-file-uploader"
:class="{ hide: fileArr.length>0 ||addShow }"
ref="upload"
:disabled="readOnly"
>
<!-- 上传按钮 -->
<!-- <el-button size="mini" icon="" type="primary"></el-button> -->
......@@ -95,6 +96,7 @@ export default {
type: Boolean,
default: true,
},
readOnly: false
},
data() {
return {
......
......@@ -9,6 +9,8 @@ const user = {
roles: [],
permissions: [],
systemSetting:{},
posts: [],
enterpriseId: ''
},
mutations: {
......@@ -29,6 +31,12 @@ const user = {
},
SET_SYSTEMSETTING: (state, systemSetting) => {
state.systemSetting = systemSetting
},
SET_POSTS: (state, posts) => {
state.posts = posts
},
SET_ENTERPRISEID: (state,enterpriseId) =>{
state.enterpriseId = enterpriseId
}
},
......@@ -67,6 +75,8 @@ const user = {
commit('SET_AVATAR', avatar)
// 默认配置
commit('SET_SYSTEMSETTING', res.systemSetting)
commit('SET_POSTS',res.posts)
commit('SET_ENTERPRISEID',user.deptId)
console.log(res.systemSetting)
resolve(res)
}).catch(error => {
......@@ -74,7 +84,7 @@ const user = {
})
})
},
// 退出系统
LogOut({ commit, state }) {
return new Promise((resolve, reject) => {
......
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
>
<h3 class="title">泽宏后台管理系统</h3>
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
<svg-icon
slot="prefix"
icon-class="user"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="password">
......@@ -15,7 +29,11 @@
placeholder="密码"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
<svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="code">
......@@ -26,19 +44,27 @@
style="width: 63%"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
<svg-icon
slot="prefix"
icon-class="validCode"
class="el-input__icon input-icon"
/>
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
<img :src="codeUrl" @click="getCode" class="login-code-img" />
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-form-item style="width:100%;">
<el-checkbox
v-model="loginForm.rememberMe"
style="margin: 0px 0px 25px 0px"
>记住密码</el-checkbox
>
<el-form-item style="width: 100%">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
style="width: 100%"
@click.native.prevent="handleLogin"
>
<span v-if="!loading">登 录</span>
......@@ -54,9 +80,9 @@
</template>
<script>
import { getCodeImg } from "@/api/login";
import { getCodeImg,getInfo } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
import { encrypt, decrypt } from "@/utils/jsencrypt";
export default {
name: "Login",
......@@ -69,29 +95,30 @@ export default {
password: "admin123",
rememberMe: false,
code: "",
uuid: ""
uuid: "",
},
loginRules: {
username: [
{ required: true, trigger: "blur", message: "用户名不能为空" }
{ required: true, trigger: "blur", message: "用户名不能为空" },
],
password: [
{ required: true, trigger: "blur", message: "密码不能为空" }
{ required: true, trigger: "blur", message: "密码不能为空" },
],
code: [
{ required: true, trigger: "change", message: "验证码不能为空" },
],
code: [{ required: true, trigger: "change", message: "验证码不能为空" }]
},
loading: false,
redirect: undefined
redirect: undefined,
};
},
watch: {
$route: {
handler: function(route) {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true
}
immediate: true,
},
},
created() {
this.getCode();
......@@ -99,7 +126,7 @@ export default {
},
methods: {
getCode() {
getCodeImg().then(res => {
getCodeImg().then((res) => {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
});
......@@ -107,36 +134,55 @@ export default {
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const rememberMe = Cookies.get('rememberMe')
const rememberMe = Cookies.get("rememberMe");
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
password:
password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), {
expires: 30,
});
Cookies.set("rememberMe", this.loginForm.rememberMe, {
expires: 30,
});
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
Cookies.remove("rememberMe");
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: "/bigWindow" || "/" }).catch(()=>{});
}).catch(() => {
this.loading = false;
this.getCode();
});
this.$store
.dispatch("Login", this.loginForm)
.then((res) => {
console.log("登录", res);
// 获取权限
return getInfo();
})
.then((res) => {
const roles = res.user.deptId;
let path = "/";
// 如果是最高权限,就进入大屏
if (roles == -2) {
path = "/bigWindow";
}
this.$router.push({ path }).catch(() => {});
})
.catch(() => {
this.loading = false;
this.getCode();
});
}
});
}
}
},
},
};
</script>
......
<template>
<el-dialog title="任务下发" :visible.sync="dialogVisible" width="900px" append-to-body>
<el-form ref="workForm" :model="workForm" label-width="80px">
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
props:{
workForm:{},
dialogVisible:false
},
data() {
return {
}
},
created() {
console.log("dsaadddd=============>",this.workForm)
},
methods: {
submitForm(){
},
cancel(){
}
}
}
</script>
<style lang="scss" scoped>
</style>
......@@ -31,14 +31,14 @@
<el-form-item label="安装时间" prop="installTime">
<el-date-picker clearable size="small"
v-model="queryParams.installTimeStart"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择起始时间">
</el-date-picker><span style="color: #bebfc3"> - </span>
<el-date-picker clearable size="small"
v-model="queryParams.installTimeEnd"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择截止时间">
</el-date-picker>
</el-form-item>
......@@ -116,7 +116,7 @@
/>
<!-- 添加或修改用户加装安全装置台账对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @cancel="cancel">
<el-dialog :title="title1" :visible.sync="open1" width="800px" append-to-body @cancel="cancel1">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="11">
......@@ -159,8 +159,8 @@
<el-form-item label="安装时间" prop="installTime">
<el-date-picker clearable size="small"
v-model="form.installTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择安装时间"
style="width: 100%">
</el-date-picker>
......@@ -175,11 +175,54 @@
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
<el-button @click="cancel1">取 消</el-button>
</div>
</el-dialog>
<el-dialog :title="title2" :visible.sync="open2" width="800px" append-to-body @cancel="cancel2">
<el-form ref="detailForm" :model="detailForm" label-width="120px">
<el-row>
<el-col :span="11">
<el-form-item label="用户名称:">
<font>{{detailForm.userName}}</font>
</el-form-item>
<el-form-item label="身份证号:">
<font>{{detailForm.idCard}}</font>
</el-form-item>
<el-form-item label="品牌名称:">
<font v-if="detailForm.brandName != '' && detailForm.brandName != null">{{detailForm.brandName}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="用户编号:">
<font v-if="detailForm.userNo != '' && detailForm.userNo != null">{{detailForm.userNo}}</font>
<font v-else> - </font>
</el-form-item>
<el-form-item label="联系电话:">
<font>{{detailForm.linkMobile}}</font>
</el-form-item>
<el-form-item label="安装时间:">
<font>{{detailForm.installTime}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="详细地址:">
<font>{{detailForm.userAddress}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="备注信息:">
<font v-if="detailForm.remarks != '' && detailForm.remarks != null">{{detailForm.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-dialog>
</div>
</template>
......@@ -209,9 +252,11 @@ export default {
// 用户加装安全装置台账表格数据
equipmentList: [],
// 弹出层标题
title: "",
title1: "",
title2: "",
// 是否显示弹出层
open: false,
open1: false,
open2: false,
// 查询参数
queryParams: {
pageNum: 1,
......@@ -224,6 +269,7 @@ export default {
},
// 表单参数
form: {},
detailForm: {},
// 表单校验
rules: {
userName: [
......@@ -260,12 +306,16 @@ export default {
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
cancel1() {
this.open1 = false;
this.reset1();
},
cancel2() {
this.open2 = false;
this.reset2();
},
// 表单重置
reset() {
reset1() {
this.form = {
safeEquipmentId: null,
userName: null,
......@@ -284,6 +334,25 @@ export default {
};
this.resetForm("form");
},
reset2() {
this.detailForm = {
safeEquipmentId: null,
userName: null,
userNo: null,
userAddress: null,
idCard: null,
linkMobile: null,
installTime: null,
brandName: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.resetForm("detailForm");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
......@@ -296,18 +365,17 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加用户加装安全装置台账";
this.reset1();
this.open1 = true;
this.title1 = "添加用户加装安全装置台账";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset1();
getEquipment(row.safeEquipmentId).then(response => {
console.log("data",response.data);
this.form = response.data;
this.open = true;
this.title = "修改用户加装安全装置台账";
this.open1 = true;
this.title1 = "修改用户加装安全装置台账";
});
},
/** 提交按钮 */
......@@ -362,12 +430,12 @@ export default {
},
/** 详细信息跳转 */
showDetail(row) {
this.$router.push({
path: '/standingBook/equipmentDetail',
query: {
safeEquipmentId: row.safeEquipmentId
}
})
this.reset2();
getEquipment(row.safeEquipmentId).then(response => {
this.detailForm = response.data;
this.open2 = true;
this.title2 = "用户加装安全装置台账详情";
});
},
}
};
......
<template>
<div class="app-container">
<!--<el-row>
<el-col :span="24" style="padding-left: 15px;margin-bottom: -10px;">
<div style="height: 45px;" @click="$router.go(-1)">
<el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回
</el-button>
</div>
</el-col>
</el-row>-->
<el-row style="width: 100%;height: 40px;">
<el-col :span="24">
<div style="">
<ul>
<li style="list-style: none;font-weight: 900;font-size: 20px;color: #053b6a;">燃气用户加装安全装置台账详情</li>
</ul>
</div>
</el-col>
</el-row>
<el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="100px" style="width: 100%;">
<el-row>
<el-col :span="6">
<el-form-item label="用户名称:" prop="userName">
<font>{{form.userName}}</font>
</el-form-item>
<el-form-item label="身份证号:" prop="idCard">
<font>{{form.idCard}}</font>
</el-form-item>
<el-form-item label="品牌名称:" prop="brandName">
<font v-if="form.brandName != '' && form.brandName != null">{{form.brandName}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="用户编号:" prop="userNo">
<font v-if="form.userNo != '' && form.userNo != null">{{form.userNo}}</font>
<font v-else> - </font>
</el-form-item>
<el-form-item label="联系电话:" prop="linkMobile">
<font>{{form.linkMobile}}</font>
</el-form-item>
<el-form-item label="安装时间:" prop="installTime">
<font>{{form.installTime}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="详细地址:" prop="userAddress">
<font>{{form.userAddress}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="备注信息:" prop="remarks">
<font v-if="form.remarks != '' && form.remarks != null">{{form.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-row>
</div>
</template>
<script>
import { getEquipment } from "@/api/standingBook/equipment";
export default {
name: "equipmentDetail",
components: {
},
data() {
return {
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
// 如果是跳转来的,则接受初始化参数
this.safeEquipmentId = this.$route.query.safeEquipmentId;
},
mounted() {
this.getDetail();
},
methods: {
getDetail() {
getEquipment(this.safeEquipmentId).then(response => {
this.form = response.data;
console.log(this.form, "this.form")
const obj =this.form;
});
},
}
}
</script>
<template>
<div class="app-container">
<!--<el-row>
<el-col :span="24" style="padding-left: 15px;margin-bottom: -10px;">
<div style="height: 45px;" @click="$router.go(-1)">
<el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回
</el-button>
</div>
</el-col>
</el-row>-->
<el-row style="width: 100%;height: 40px;">
<el-col :span="24">
<div style="">
<ul>
<li style="list-style: none;font-weight: 900;font-size: 20px;color: #053b6a;">隐患整治台账详情</li>
</ul>
</div>
</el-col>
</el-row>
<el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="120px" style="width: 100%;">
<el-row>
<el-col :span="6">
<el-form-item label="隐患名称:" prop="hiddenTitle">
<font>{{form.hiddenTitle}}</font>
</el-form-item>
<el-form-item label="隐患发现人员:" prop="hiddenFindPeople">
<font>{{form.hiddenFindPeople}}</font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="隐患等级:" prop="hiddenType">
<font v-if="form.hiddenType == '1'">一级隐患</font>
<font v-if="form.hiddenType == '2'">二级隐患</font>
<font v-if="form.hiddenType == '3'">三级隐患</font>
</el-form-item>
<el-form-item label="发现时间:" prop="hiddenFindDate">
<font>{{form.hiddenFindDate}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="隐患位置:" prop="hiddenLocation">
<font>{{form.hiddenLocation}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="隐患内容:" prop="hiddenContent">
<font>{{form.hiddenContent}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="整治情况:" prop="remediation">
<font v-if="form.remediation != '' && form.remediation != null">{{form.remediation}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="备注信息:" prop="remarks">
<font v-if="form.remarks != '' && form.remarks != null">{{form.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-row>
</div>
</template>
<script>
import { getHidden } from "@/api/standingBook/hidden";
export default {
name: "hiddenDetail",
components: {
},
data() {
return {
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
// 如果是跳转来的,则接受初始化参数
this.hiddenId = this.$route.query.hiddenId;
},
mounted() {
this.getDetail();
},
methods: {
getDetail() {
getHidden(this.hiddenId).then(response => {
this.form = response.data;
console.log(this.form, "this.form")
const obj =this.form;
});
},
}
}
</script>
<template>
<div class="app-container">
<!--<el-row>
<el-col :span="24" style="padding-left: 15px;margin-bottom: -10px;">
<div style="height: 45px;" @click="$router.go(-1)">
<el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回
</el-button>
</div>
</el-col>
</el-row>-->
<el-row style="width: 100%;height: 40px;">
<el-col :span="24">
<div style="">
<ul>
<li style="list-style: none;font-weight: 900;font-size: 20px;color: #053b6a;">燃气事故台账详情</li>
</ul>
</div>
</el-col>
</el-row>
<el-row style="width: 100%;padding: 20px;">
<el-form ref="form" v-model="form" label-width="120px" style="width: 100%;">
<el-row>
<el-col :span="6">
<el-form-item label="事故名称:" prop="troubleName">
<font>{{form.troubleName}}</font>
</el-form-item>
<el-form-item label="事故原因:" prop="troubleReason">
<font>{{form.troubleReason}}</font>
</el-form-item>
<el-form-item label="责任单位:" prop="responsibleUnit">
<font v-if="form.responsibleUnit != '' && form.responsibleUnit != null">{{form.responsibleUnit}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="事故类型:" prop="troubleType">
<font v-if="form.troubleType == '1'">安全生产事故</font>
<font v-if="form.troubleType == '2'">非生产安全事故</font>
</el-form-item>
<el-form-item label="事故地点:" prop="troubleLocation">
<font>{{form.troubleLocation}}</font>
</el-form-item>
<el-form-item label="责任人员:" prop="responsiblePeople">
<font v-if="form.responsiblePeople != '' && form.responsiblePeople != null">{{form.responsiblePeople}}</font>
<font v-else> - </font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="简要经过:" prop="briefProcess">
<font v-if="form.briefProcess != '' && form.briefProcess != null">{{form.briefProcess}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="是否处理:" prop="isDeal">
<font>{{form.isDeal}}</font>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="处理完成时间:" prop="dealDate">
<font>{{form.dealDate}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="备注信息:" prop="remarks">
<font v-if="form.remarks != '' && form.remarks != null">{{form.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-row>
</div>
</template>
<script>
import { getTrouble } from "@/api/standingBook/trouble";
export default {
name: "troubleDetail",
components: {
},
data() {
return {
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
// 如果是跳转来的,则接受初始化参数
this.troubleId = this.$route.query.troubleId;
},
mounted() {
this.getDetail();
},
methods: {
getDetail() {
getTrouble(this.troubleId).then(response => {
this.form = response.data;
console.log(this.form, "this.form")
const obj =this.form;
});
},
}
}
</script>
......@@ -2,7 +2,7 @@
<div class="app-container">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<!-- <el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="deptName"
......@@ -24,9 +24,9 @@
@node-click="handleNodeClick"
/>
</div>
</el-col>
</el-col>-->
<!--用户数据-->
<el-col :span="20" :xs="24">
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户名称" prop="userName">
<el-input
......@@ -144,7 +144,7 @@
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="所属单位" align="center" key="enterpriseName" prop="enterpriseName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
<template slot-scope="scope">
......@@ -214,8 +214,16 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归属部门" prop="deptId">
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
<el-form-item label="所属单位" prop="deptId">
<!--<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />-->
<el-select v-model="form.deptId" placeholder="请选择" @change="selectWorkUnit($event)">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
......@@ -349,12 +357,15 @@ import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { enterpriseLists } from "@/api/regulation/info";
import { optionselect } from "@/api/system/post";
export default {
name: "User",
components: { Treeselect },
data() {
return {
zzz:'',
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -389,8 +400,11 @@ export default {
sexOptions: [],
// 岗位选项
postOptions: [],
//企业选项
enterprises: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
defaultProps: {
......@@ -467,7 +481,9 @@ export default {
},
created() {
this.getList();
this.getTreeselect();
this.getPosts();
//this.getTreeselect();
//this.getEnterpriseLists();
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
......@@ -563,9 +579,10 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getTreeselect();
//this.getTreeselect();
this.getEnterpriseLists();
getUser().then(response => {
this.postOptions = response.posts;
//this.postOptions = response.posts;
this.roleOptions = response.roles;
this.open = true;
this.title = "添加用户";
......@@ -575,11 +592,13 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
//this.getTreeselect();
this.getEnterpriseLists();
const userId = row.userId || this.ids;
getUser(userId).then(response => {
this.form = response.data;
this.postOptions = response.posts;
this.getPosts();
//this.postOptions = response.posts;
this.roleOptions = response.roles;
this.form.postIds = response.postIds;
this.form.roleIds = response.roleIds;
......@@ -587,6 +606,7 @@ export default {
this.title = "修改用户";
this.form.password = "";
});
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
......@@ -674,7 +694,50 @@ export default {
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
//查询所属单位
getEnterpriseLists(){
enterpriseLists().then(response => {
this.enterprises = response.rows;
this.enterprises.push({
enterpriseId: -2,
enterpriseName: "政府部门",
isDel: null
})
});
},
//选取所属单位
selectWorkUnit(val){
this.getPosts();
},
//获取岗位
getPosts(){
this.postOptions = [];
console.log(this.form.deptId,'dkdfsdfkfkfkfkfdkfdkfkfkdkdfk')
if(this.form.deptId == "-2"){
this.postOptions.push(
{
"searchValue": null,
"createBy": "admin",
"createTime": "2022-01-10 16:22:37",
"updateBy": null,
"updateTime": null,
"remark": "",
"params": {},
"postId": 1,
"postCode": "zhengfu",
"postName": "县级指挥",
"postSort": "1",
"status": "0",
"flag": false
}
)
return;
}
optionselect().then(response =>{
this.postOptions = response.data;
})
}
}
};
</script>
\ No newline at end of file
</script>
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