dev_xd
姜玉琦 2025-03-05 23:22:27 +08:00
commit f3735dbced
10 changed files with 629 additions and 298 deletions

View File

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.yanzhu.common.core.annotation.Excel; import com.yanzhu.common.core.annotation.Excel;
import com.yanzhu.common.core.web.domain.BaseEntity; import com.yanzhu.common.core.web.domain.BaseEntity;
import java.util.List;
/** /**
* smz_ssp_auditinfo * smz_ssp_auditinfo
* *
@ -38,6 +40,25 @@ public class SmzSspAuditinfo extends BaseEntity
@Excel(name = "创建人") @Excel(name = "创建人")
private String createUser; private String createUser;
private String images;
private List<SmzSspFileinfo> files;
public List<SmzSspFileinfo> getFiles() {
return files;
}
public void setFiles(List<SmzSspFileinfo> files) {
this.files = files;
}
public String getImages() {
return images;
}
public void setImages(String images) {
this.images = images;
}
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;

View File

@ -12,6 +12,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="isDel" column="isDel" /> <result property="isDel" column="isDel" />
<result property="createUser" column="createUser" /> <result property="createUser" column="createUser" />
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
<collection property="files" ofType="com.yanzhu.manage.domain.SmzSspFileinfo">
<id property="id" column="fileId"/>
<result property="fileUrl" column="fileUrl"/>
</collection>
</resultMap> </resultMap>
<sql id="selectSmzSspAuditinfoVo"> <sql id="selectSmzSspAuditinfoVo">
@ -19,7 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectSmzSspAuditinfoList" parameterType="SmzSspAuditinfo" resultMap="SmzSspAuditinfoResult"> <select id="selectSmzSspAuditinfoList" parameterType="SmzSspAuditinfo" resultMap="SmzSspAuditinfoResult">
<include refid="selectSmzSspAuditinfoVo"/> select a.id, a.mainId, a.processState, a.opinion, a.isDel, a.createUser, a.createTime,b.id fileId,b.fileUrl
from smz_ssp_auditinfo a
left join smz_ssp_fileinfo b on a.id=b.auditId
<where> <where>
<if test="mainId != null "> and mainId = #{mainId}</if> <if test="mainId != null "> and mainId = #{mainId}</if>
<if test="processState != null and processState != ''"> and processState = #{processState}</if> <if test="processState != null and processState != ''"> and processState = #{processState}</if>
@ -28,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUser != null and createUser != ''"> and createUser = #{createUser}</if> <if test="createUser != null and createUser != ''"> and createUser = #{createUser}</if>
<if test="createTime != null "> and createTime = #{createTime}</if> <if test="createTime != null "> and createTime = #{createTime}</if>
</where> </where>
order by createTime desc
</select> </select>
<select id="selectSmzSspAuditinfoById" parameterType="Long" resultMap="SmzSspAuditinfoResult"> <select id="selectSmzSspAuditinfoById" parameterType="Long" resultMap="SmzSspAuditinfoResult">

View File

@ -294,7 +294,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.problemArea, a.problemArea,
a.workParts, a.workParts,
a.changeInfo, a.changeInfo,
CONCAT(a.lordSentUser ,'【',b.sub_dept_name,'】',b.user_phone) as lordSent, a.lordSent,
CONCAT(a.lordSentUser ,'【',b.sub_dept_name,'】',b.user_phone) as lordSentUser,
a.lordSentUser, a.lordSentUser,
a.copySend, a.copySend,
a.copySendUser, a.copySendUser,
@ -310,11 +311,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.smark_url, a.smark_url,
a.isDel, a.isDel,
CONCAT(c.nick_name,'【',c.phonenumber,'】') as createUser, CONCAT(c.nick_name,'【',c.phonenumber,'】') as createUser,
a.createUser as updateUser,
a.createTime, a.createTime,
a.updateUser, a.updateUser,
a.updateTime, a.updateTime,
a.danger_type, a.danger_type,
CONCAT(a.recheckSendUser ,'【',d.sub_dept_name,'】',d.user_phone) as recheckSend, a.recheckSend,
CONCAT(a.recheckSendUser ,'【',d.sub_dept_name,'】',d.user_phone) as recheckSendUser,
a.recheckSendUser, a.recheckSendUser,
a.roleType, a.roleType,
a.problemType a.problemType

View File

@ -1,8 +1,18 @@
package com.yanzhu.manage.service.impl; package com.yanzhu.manage.service.impl;
import java.util.Arrays;
import java.util.List; import java.util.List;
import cn.hutool.core.util.NumberUtil;
import com.yanzhu.common.core.utils.DateUtils; import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.common.security.utils.SecurityUtils;
import com.yanzhu.manage.domain.SmzSspFileinfo;
import com.yanzhu.manage.domain.SmzSspProblemmodify;
import com.yanzhu.manage.mapper.SmzSspFileinfoMapper;
import com.yanzhu.manage.mapper.SmzSspProblemmodifyMapper;
import com.yanzhu.system.api.domain.SysUser;
import com.yanzhu.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.yanzhu.manage.mapper.SmzSspAuditinfoMapper; import com.yanzhu.manage.mapper.SmzSspAuditinfoMapper;
@ -21,6 +31,11 @@ public class SmzSspAuditinfoServiceImpl implements ISmzSspAuditinfoService
@Autowired @Autowired
private SmzSspAuditinfoMapper smzSspAuditinfoMapper; private SmzSspAuditinfoMapper smzSspAuditinfoMapper;
@Autowired
private SmzSspFileinfoMapper fileinfoMapper;
@Autowired
private SmzSspProblemmodifyMapper problemmodifyMapper;
/** /**
* *
* *
@ -54,8 +69,39 @@ public class SmzSspAuditinfoServiceImpl implements ISmzSspAuditinfoService
@Override @Override
public int insertSmzSspAuditinfo(SmzSspAuditinfo smzSspAuditinfo) public int insertSmzSspAuditinfo(SmzSspAuditinfo smzSspAuditinfo)
{ {
LoginUser loginUser= SecurityUtils.getLoginUser();
SysUser sysUser=loginUser.getSysUser();
smzSspAuditinfo.setCreateTime(DateUtils.getNowDate()); smzSspAuditinfo.setCreateTime(DateUtils.getNowDate());
return smzSspAuditinfoMapper.insertSmzSspAuditinfo(smzSspAuditinfo); smzSspAuditinfo.setCreateUser(sysUser.getUserName());
int result= smzSspAuditinfoMapper.insertSmzSspAuditinfo(smzSspAuditinfo);
//上传图片
String images=smzSspAuditinfo.getImages();
if(StringUtils.isNotEmpty(images)){
Arrays.stream(images.split(",")).forEach(img->{
SmzSspFileinfo file=new SmzSspFileinfo();
file.setFileType(0L);
file.setAuditId(smzSspAuditinfo.getId());
file.setFileUrl(img);
file.setCreateUser(sysUser.getUserName());
file.setCreateTime(DateUtils.getNowDate());
fileinfoMapper.insertSmzSspFileinfo(file);
});
}
//修改安全隐患的状态
SmzSspProblemmodify problemmodify=new SmzSspProblemmodify();
problemmodify.setId(smzSspAuditinfo.getMainId());
//(0待审1通过2驳回)
//0待整改1待复检2复检驳回3复检通过
if("0".equals(smzSspAuditinfo.getProcessState())){
problemmodify.setCheckState(1L);
}else if("1".equals(smzSspAuditinfo.getProcessState())){
problemmodify.setCheckState(3L);
}else{
problemmodify.setCheckState(2L);
}
problemmodifyMapper.updateSmzSspProblemmodify(problemmodify);
return result;
} }
/** /**

View File

@ -1,44 +1,44 @@
import request from '@/utils/request' import request from "@/utils/request";
// 查询隐患流程信息列表 // 查询隐患流程信息列表
export function listAuditinfo(query) { export function listAuditinfo(query) {
return request({ return request({
url: '/trouble/auditinfo/list', url: "/manage/auditinfo/list",
method: 'get', method: "get",
params: query params: query,
}) });
} }
// 查询隐患流程信息详细 // 查询隐患流程信息详细
export function getAuditinfo(id) { export function getAuditinfo(id) {
return request({ return request({
url: '/trouble/auditinfo/' + id, url: "/manage/auditinfo/" + id,
method: 'get' method: "get",
}) });
} }
// 新增隐患流程信息 // 新增隐患流程信息
export function addAuditinfo(data) { export function addAuditinfo(data) {
return request({ return request({
url: '/trouble/auditinfo', url: "/manage/auditinfo",
method: 'post', method: "post",
data: data data: data,
}) });
} }
// 修改隐患流程信息 // 修改隐患流程信息
export function updateAuditinfo(data) { export function updateAuditinfo(data) {
return request({ return request({
url: '/trouble/auditinfo', url: "/manage/auditinfo",
method: 'put', method: "put",
data: data data: data,
}) });
} }
// 删除隐患流程信息 // 删除隐患流程信息
export function delAuditinfo(id) { export function delAuditinfo(id) {
return request({ return request({
url: '/trouble/auditinfo/' + id, url: "/manage/auditinfo/" + id,
method: 'delete' method: "delete",
}) });
} }

View File

@ -1,8 +1,8 @@
<template> <template>
<el-dialog :title="title" v-model="show" width="800px" append-to-body class="baidu-map-dialog" <el-dialog :title="title" v-model="show" width="800px" append-to-body class="baidu-map-dialog"
:close-on-click-modal="false" :close-on-press-escape="false" > :close-on-click-modal="false" :close-on-press-escape="false">
<div class="div-info"> <div class="div-info">
<div>经度纬度:{{point?(point.lng.toFixed(5)+","+point.lat.toFixed(5)):'' }}</div> <div>经度纬度:{{ point ? (point.lng.toFixed(5) + "," + point.lat.toFixed(5)) : '' }}</div>
<div>详细地址:{{ getAddress() }}</div> <div>详细地址:{{ getAddress() }}</div>
<div style="margin-top: 10px;text-align: center;" v-if="getAddress()"> <div style="margin-top: 10px;text-align: center;" v-if="getAddress()">
<el-button size="small" type="primary" @click="doOk"></el-button> <el-button size="small" type="primary" @click="doOk"></el-button>
@ -21,44 +21,44 @@ const cityInfo = ref("");
const emit = defineEmits(["docom"]); const emit = defineEmits(["docom"]);
function getCity(data,cb){ function getCity(data, cb) {
let myPoint = new BMapGL.Point(+data.longitude,+data.latitude); let myPoint = new BMapGL.Point(+data.longitude, +data.latitude);
let myGeo = new BMapGL.Geocoder({extensions_town: true}); let myGeo = new BMapGL.Geocoder({ extensions_town: true });
myGeo.getLocation(myPoint,r=>{ myGeo.getLocation(myPoint, r => {
let cityInfo={ let cityInfo = {
address:r.content?.address||'', address: r.content?.address || '',
poi_desc:r.content?.poi_desc||'', poi_desc: r.content?.poi_desc || '',
district:r.content?.address_detail?.district||'', district: r.content?.address_detail?.district || '',
city:r.content?.address_detail?.city||'', city: r.content?.address_detail?.city || '',
province:r.content?.address_detail?.province||'' province: r.content?.address_detail?.province || ''
} }
cb && cb(myPoint,cityInfo); cb && cb(myPoint, cityInfo);
}); });
} }
function doOk(){ function doOk() {
emit("docom",point.value,cityInfo.value); emit("docom", point.value, cityInfo.value);
show.value=false; show.value = false;
} }
function getAddress(){ function getAddress() {
let addr=cityInfo.value?.address||''; let addr = cityInfo.value?.address || '';
return addr; return addr;
} }
function showDlg(opt){ function showDlg(opt) {
title.value=opt?.title||'选择地址'; title.value = opt?.title || '选择地址';
show.value=true; show.value = true;
setTimeout(()=>{ setTimeout(() => {
initMap(opt); initMap(opt);
},400); }, 400);
} }
function currentPoint(){ function currentPoint() {
let geolocation = new BMapGL.Geolocation(); let geolocation = new BMapGL.Geolocation();
geolocation.enableSDKLocation(); geolocation.enableSDKLocation();
geolocation.getCurrentPosition(e=>{ geolocation.getCurrentPosition(e => {
if(e.point){ if (e.point) {
let point = e.point let point = e.point
let initMarker = new BMapGL.Marker(point); let initMarker = new BMapGL.Marker(point);
map.value.centerAndZoom(point, 18); map.value.centerAndZoom(point, 18);
@ -67,20 +67,20 @@ function currentPoint(){
}) })
} }
function mapClick(e){ function mapClick(e) {
point.value=e.latlng; point.value = e.latlng;
let myGeo = new BMapGL.Geocoder({extensions_town: true}); let myGeo = new BMapGL.Geocoder({ extensions_town: true });
myGeo.getLocation(e.latlng,r=>{ myGeo.getLocation(e.latlng, r => {
if(r){ if (r) {
cityInfo.value={ cityInfo.value = {
address:r.content?.address||'', address: r.content?.address || '',
poi_desc:r.content?.poi_desc||'', poi_desc: r.content?.poi_desc || '',
district:r.content?.address_detail?.district||'', district: r.content?.address_detail?.district || '',
city:r.content?.address_detail?.city||'', city: r.content?.address_detail?.city || '',
province:r.content?.address_detail?.province||'' province: r.content?.address_detail?.province || ''
} }
}else{ } else {
cityInfo.value={} cityInfo.value = {}
} }
}); });
} }
@ -109,12 +109,11 @@ function initMap(opt) {
// //
map.value.addControl(new BMapGL.NavigationControl()); map.value.addControl(new BMapGL.NavigationControl());
// //
map.value.addEventListener("click",mapClick); map.value.addEventListener("click", mapClick);
var myGeo = new BMapGL.Geocoder(); var myGeo = new BMapGL.Geocoder();
// //
myGeo.getPoint('经河新城', function (point) { myGeo.getPoint('经河新城', function (point) {
if (point) { if (point) {
console.log("--->",point)
map.value.centerAndZoom(point, 16); map.value.centerAndZoom(point, 16);
map.value.addOverlay(new BMapGL.Marker(point, { title: '经河新城' })) map.value.addOverlay(new BMapGL.Marker(point, { title: '经河新城' }))
map.value.enableScrollWheelZoom(true); map.value.enableScrollWheelZoom(true);
@ -127,17 +126,17 @@ function initMap(opt) {
}, '陕西省') }, '陕西省')
currentPoint(); currentPoint();
} }
function initMapData(data){ function initMapData(data) {
if(data.latitude && data.longitude){ if (data.latitude && data.longitude) {
point.value={} point.value = {}
point.value.lng=data.longitude*1.0; point.value.lng = data.longitude * 1.0;
point.value.lat=data.latitude*1.0; point.value.lat = data.latitude * 1.0;
} }
cityInfo.value={} cityInfo.value = {}
cityInfo.value.address=data.projectAddress||'' cityInfo.value.address = data.projectAddress || ''
cityInfo.value.district=data.district||'' cityInfo.value.district = data.district || ''
cityInfo.value.city=data.city||'' cityInfo.value.city = data.city || ''
cityInfo.value.province=data.province||'' cityInfo.value.province = data.province || ''
} }
/** 暴露组件 */ /** 暴露组件 */
@ -146,22 +145,23 @@ defineExpose({
initMapData initMapData
}); });
</script> </script>
<style lang="scss" > <style lang="scss">
.baidu-map-dialog{ .baidu-map-dialog {
.el-dialog__body{ .el-dialog__body {
position: relative; position: relative;
padding: 0px; padding: 0px;
.div-info{
.div-info {
position: absolute; position: absolute;
top:0px; top: 0px;
right: 10px; right: 10px;
width:300px; width: 300px;
font-size: 12px; font-size: 12px;
background: rgba(255,255,255,0.5); background: rgba(255, 255, 255, 0.5);
box-shadow: 6px 6px 6px rgba(0,0,0,0.2); box-shadow: 6px 6px 6px rgba(0, 0, 0, 0.2);
z-index: 99999; z-index: 99999;
padding: 8px; padding: 8px;
border:solid 1px #ccc; border: solid 1px #ccc;
color: #51b5ff; color: #51b5ff;
line-height: 24px; line-height: 24px;
} }

View File

@ -1,13 +1,14 @@
<template> <template>
<div class="navbar"> <div class="navbar">
<hamburger id="hamburger-container" :is-active="appStore.sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> <hamburger id="hamburger-container" :is-active="appStore.sidebar.opened" class="hamburger-container"
@toggleClick="toggleSideBar" />
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!settingsStore.topNav" /> <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!settingsStore.topNav" />
<top-nav id="topmenu-container" class="topmenu-container" v-if="settingsStore.topNav" /> <top-nav id="topmenu-container" class="topmenu-container" v-if="settingsStore.topNav" />
<div class="right-menu"> <div class="right-menu">
<template v-if="appStore.device !== 'mobile'"> <template v-if="appStore.device !== 'mobile'">
<el-tag class="cur-comp" v-if="data.comName">:{{ data.comName }}</el-tag> <el-tag class="cur-comp" v-if="data.comName">:{{ data.comName }}</el-tag>
<current-project id="current-project" class="right-menu-item"/> <current-project id="current-project" class="right-menu-item" />
<header-search id="header-search" class="right-menu-item" /> <header-search id="header-search" class="right-menu-item" />
@ -58,8 +59,8 @@ import useSettingsStore from '@/store/modules/settings'
const appStore = useAppStore() const appStore = useAppStore()
const userStore = useUserStore() const userStore = useUserStore()
const settingsStore = useSettingsStore() const settingsStore = useSettingsStore()
const data=reactive({ const data = reactive({
comName:'', comName: '',
}) })
function toggleSideBar() { function toggleSideBar() {
appStore.toggleSideBar(); appStore.toggleSideBar();
@ -95,8 +96,7 @@ const emits = defineEmits(['setLayout'])
function setLayout() { function setLayout() {
emits('setLayout'); emits('setLayout');
} }
data.comName=userStore.currentComName data.comName = userStore.currentComName
console.log("---->",userStore)
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
@ -107,12 +107,13 @@ console.log("---->",userStore)
background: #fff; background: #fff;
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
.cur-comp{ .cur-comp {
position: relative; position: relative;
top: 11px; top: 11px;
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
.hamburger-container { .hamburger-container {
line-height: 46px; line-height: 46px;
height: 100%; height: 100%;

View File

@ -1,79 +1,90 @@
import { login, logout, getInfo } from '@/api/login' import { login, logout, getInfo } from "@/api/login";
import { findMyTasks } from '@/api/flowable/businessKey' import { findMyTasks } from "@/api/flowable/businessKey";
import { getToken, setToken, removeToken } from '@/utils/auth' import { getToken, setToken, removeToken } from "@/utils/auth";
import defAva from '@/assets/images/profile.jpg' import defAva from "@/assets/images/profile.jpg";
const useUserStore = defineStore( const useUserStore = defineStore("user", {
'user',
{
state: () => ({ state: () => ({
token: getToken(), token: getToken(),
uid: '', uid: "",
name: '', name: "",
nickName: '', nickName: "",
avatar: '', avatar: "",
compInfo:{}, compInfo: {},
roles: [], roles: [],
permissions: [], permissions: [],
currentComId: null, currentComId: null,
currentComName: null, currentComName: null,
currentPrjId: null, currentPrjId: null,
currentProName: null, currentProName: null,
isAdmin: false,
}), }),
actions: { actions: {
// 登录 // 登录
login(userInfo) { login(userInfo) {
const username = userInfo.username.trim() const username = userInfo.username.trim();
const password = userInfo.password const password = userInfo.password;
const code = userInfo.code const code = userInfo.code;
const uuid = userInfo.uuid const uuid = userInfo.uuid;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => { login(username, password, code, uuid)
let data = res.data .then((res) => {
setToken(data.access_token) let data = res.data;
this.token = data.access_token setToken(data.access_token);
resolve() this.token = data.access_token;
}).catch(error => { resolve();
reject(error)
})
}) })
.catch((error) => {
reject(error);
});
});
}, },
// 获取用户信息 // 获取用户信息
getInfo() { getInfo() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getInfo().then(res => { getInfo()
const user = res.user .then((res) => {
const avatar = (user.avatar == "" || user.avatar == null) ? defAva : user.avatar; const user = res.user;
const avatar =
user.avatar == "" || user.avatar == null ? defAva : user.avatar;
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 if (res.roles && res.roles.length > 0) {
this.roles = res.roles // 验证返回的roles是否是一个非空数组
this.permissions = res.permissions this.roles = res.roles;
this.permissions = res.permissions;
} else { } else {
this.roles = ['ROLE_DEFAULT'] this.roles = ["ROLE_DEFAULT"];
} }
this.uid = user.userId; this.uid = user.userId;
this.name = user.userName; this.name = user.userName;
this.nickName = user.nickName; this.nickName = user.nickName;
this.compInfo=user.comp; this.compInfo = user.comp;
this.avatar = avatar; this.avatar = avatar;
this.currentComId = user.activeComId; this.currentComId = user.activeComId;
this.currentComName = user.activeComName; this.currentComName = user.activeComName;
this.currentPrjId = user.activeProjectId; this.currentPrjId = user.activeProjectId;
this.currentProName = user.activeProjectName; this.currentProName = user.activeProjectName;
resolve(res) this.isAdmin = user.roles.some(
}).catch(error => { (item) =>
reject(error) item.roleKey.includes("admin") ||
}) item.roleKey.includes("gsAdmin")
);
resolve(res);
}) })
.catch((error) => {
reject(error);
});
});
}, },
// 获取用户代办 // 获取用户代办
getTasks(){ getTasks() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
findMyTasks().then(response => { findMyTasks()
.then((response) => {
let todos = document.querySelectorAll(".tips_Todo"); let todos = document.querySelectorAll(".tips_Todo");
let tasks = document.querySelectorAll(".tips_Task"); let tasks = document.querySelectorAll(".tips_Task");
if (todos.length > 0) { if (todos.length > 0) {
todos.forEach(el => { todos.forEach((el) => {
el.innerHTML = response.data.todo; el.innerHTML = response.data.todo;
if (response.data.todo > 0) { if (response.data.todo > 0) {
el.style.display = "inline"; el.style.display = "inline";
@ -83,7 +94,7 @@ const useUserStore = defineStore(
}); });
} }
if (tasks.length > 0) { if (tasks.length > 0) {
tasks.forEach(el => { tasks.forEach((el) => {
el.innerHTML = response.data.todo; el.innerHTML = response.data.todo;
if (response.data.todo > 0) { if (response.data.todo > 0) {
el.style.display = "inline"; el.style.display = "inline";
@ -92,27 +103,30 @@ const useUserStore = defineStore(
} }
}); });
} }
resolve(response) resolve(response);
}).catch(error => {
reject(error)
})
}) })
.catch((error) => {
reject(error);
});
});
}, },
// 退出系统 // 退出系统
logOut() { logOut() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
logout(this.token).then(() => { logout(this.token)
this.token = '' .then(() => {
this.roles = [] this.token = "";
this.permissions = [] this.roles = [];
removeToken() this.permissions = [];
resolve() removeToken();
}).catch(error => { resolve();
reject(error)
})
})
}
}
}) })
.catch((error) => {
reject(error);
});
});
},
},
});
export default useUserStore export default useUserStore;

View File

@ -3,12 +3,50 @@
:append-to-body="true" title="安全隐患详情" class="problemmodify-detail-drawer"> :append-to-body="true" title="安全隐患详情" class="problemmodify-detail-drawer">
<el-row v-if="data && data.row" style="padding:20px;"> <el-row v-if="data && data.row" style="padding:20px;">
<el-col :span="10" class="detail-left"> <el-col :span="10" class="detail-left">
<el-steps style="max-width: 600px" :active="1" finish-status="success" simple> <el-steps style="max-width: 600px" :active="data.stepActive" finish-status="success" simple>
<el-step title="待整改" /> <el-step title="待整改" />
<el-step title="待复检" /> <el-step title="待复检" />
<el-step title="复检驳回" /> <el-step title="复检驳回" v-if="!data.simple" />
<el-step title="复检通过" /> <el-step title="复检通过" />
</el-steps> </el-steps>
<div class="step-list">
<div v-for="(it, idx) in data.auditinfoList" :key="idx">
<div class="step-header" :class="data.row.checkState >= 0 ? 'is-active' : ''">
<el-icon>
<SuccessFilled />
</el-icon>
{{ it.index }}.
<span v-if="it.processState == 0"></span>
<span v-if="it.processState == 1"></span>
<span v-if="it.processState == 2"></span>
</div>
<el-card>
<table border class="step-table">
<tr>
<td width="40%"><el-icon>
<User />
</el-icon>
<span v-if="it.processState == 0"></span>
<span v-if="it.processState == 1"></span>
<span v-if="it.processState == 2"></span>
</td>
<td>{{ it.opinion }}</td>
</tr>
<tr v-if="it.processState == 0">
<td><el-icon>
<Picture />
</el-icon></td>
<td>
<div class="step-img"><el-image :src="file.fileUrl"
v-for="(file, index) in it.files" :key="index"
:preview-teleported="true"
:preview-src-list="[file.fileUrl]"></el-image></div>
</td>
</tr>
</table>
</el-card>
</div>
<div class="step-header" :class="data.row.checkState >= 0 ? 'is-active' : ''"> <div class="step-header" :class="data.row.checkState >= 0 ? 'is-active' : ''">
<el-icon> <el-icon>
@ -35,15 +73,17 @@
<Picture /> <Picture />
</el-icon></td> </el-icon></td>
<td> <td>
<el-image :src="data.row.smarkUrlPic" style="height:80px;" :preview-teleported="true" <el-image :src="data.row.smarkUrlPic" style="height:80px;"
:preview-src-list="data.row.smarkUrlPics"></el-image> :preview-teleported="true" :preview-src-list="data.row.smarkUrlPics"></el-image>
</td> </td>
</tr> </tr>
</table> </table>
</el-card> </el-card>
</div>
</el-col> </el-col>
<el-col :span="14" class="detail-right"> <el-col :span="14" class="detail-right" :class="'is-' + data.mode">
<el-form style="margin: 0px 20px;"> <el-form style="margin: 0px 20px;" :model="data.baseForm" ref="baseInfo">
<el-form-item label="项目名称"> <el-form-item label="项目名称">
{{ data.row.projectName }} {{ data.row.projectName }}
</el-form-item> </el-form-item>
@ -63,7 +103,7 @@
<el-form-item label="整改要求"> <el-form-item label="整改要求">
{{ data.row.changeInfo }} {{ data.row.changeInfo }}
</el-form-item> </el-form-item>
<template v-if="data.mode == 'edit'">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="提交人"> <el-form-item label="提交人">
@ -76,10 +116,11 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="整改人"> <el-form-item label="整改人">
{{ data.row.lordSent }} {{ data.row.lordSentUser }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -91,7 +132,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="复检人"> <el-form-item label="复检人">
{{ data.row.recheckSend }} {{ data.row.recheckSendUser }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -100,15 +141,41 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</template>
<template v-else>
<el-form-item label="提交人">
{{ data.row.createUser }}
</el-form-item>
<el-form-item label="提交时间">
{{ data.row.createTime }}
</el-form-item>
<el-form-item label="整改人">
{{ data.row.lordSentUser }}
</el-form-item>
<el-form-item label="抄送人">
{{ data.row.copySendUser }}
</el-form-item>
<el-form-item label="复检人">
{{ data.row.recheckSendUser }}
</el-form-item>
<el-form-item label="截至时间">
{{ data.row.nickedTime }}
</el-form-item>
<el-form-item label="流程状态">
<dict-tag :options="data.checkStates" :value="data.row.checkState" />
</el-form-item>
</template>
</el-form> </el-form>
<div class="step-2"> <template v-if="data.mode == 'edit'">
<div class="step-2"
v-if="data.hasStep2Role && (data.row.checkState == 0 || data.row.checkState == 2)">
<div class="step-header"> <div class="step-header">
<svg-icon icon-class="twrap" /> 整改情况 <svg-icon icon-class="twrap" /> 整改情况
</div> </div>
<el-form ref="formStep2Ref" :mode="step2Form" :rules="step2Rules"> <el-form ref="formStep2Ref" :model="step2Form" :rules="step2Rules">
<el-form-item label="整改说明" prop="opinion"> <el-form-item label="整改说明" prop="opinion">
<el-input v-model="step2Form.opinion" style="width: 100%" maxlength="200" :rows="3" <el-input v-model="step2Form.opinion" style="width: 100%" maxlength="200" :rows="3"
type="textarea" placeholder="请输入整改说明最多200字" /> type="textarea" placeholder="请输入整改说明最多255字)" />
</el-form-item> </el-form-item>
<el-form-item label="整改图片" prop="images" style="margin-top:15px"> <el-form-item label="整改图片" prop="images" style="margin-top:15px">
<image-upload v-model="step2Form.images" previewAll :limit="5" <image-upload v-model="step2Form.images" previewAll :limit="5"
@ -116,27 +183,57 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: center;"> <div style="text-align: center;">
<el-button @click="data.visible = false">取消</el-button>
<el-button type="primary" @click="step2Submit" :disabled="data.loading">提交</el-button> <el-button type="primary" @click="step2Submit" :disabled="data.loading">提交</el-button>
</div> </div>
</div> </div>
<div class="step-3" v-if="data.hasStep3Role && data.row.checkState == 1">
<div class="step-header">
<svg-icon icon-class="twrap" /> 复检
</div>
<el-form ref="formStep3Ref" :model="step3Form" :rules="step3Rules">
<el-form-item label="复检意见" prop="opinion">
<el-input v-model="step3Form.opinion" style="width: 100%" maxlength="200" :rows="3"
type="textarea" placeholder="请输入复检意见最多255字" />
</el-form-item>
</el-form>
<div style="text-align: center;margin-top:20px;">
<el-button @click="data.visible = false">取消</el-button>
<el-button type="danger" @click="step3Reject" :disabled="data.loading">复检驳回</el-button>
<el-button type="primary" @click="step3Submit" :disabled="data.loading">复检通过</el-button>
</div>
</div>
</template>
</el-col> </el-col>
</el-row> </el-row>
</el-drawer> </el-drawer>
</template> </template>
<script setup name="Problemmodify"> <script setup name="Problemmodify">
import useUserStore from '@/store/modules/user'
import { listAuditinfo, addAuditinfo } from '@/api/trouble/auditinfo'
import { fa } from 'element-plus/es/locales.mjs';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { ssp_proble_type, ssp_proble_sub_type } = proxy.useDict('ssp_proble_type', 'ssp_proble_sub_type'); const { ssp_proble_type, ssp_proble_sub_type } = proxy.useDict('ssp_proble_type', 'ssp_proble_sub_type');
const formStep2Ref = ref(); const formStep2Ref = ref();
const formStep3Ref = ref();
const userStore = useUserStore()
const emit = defineEmits(["success"]);
let data = reactive({ let data = reactive({
simple: false,
mode: '',
loading: false, loading: false,
visible: false, visible: false,
row: null, row: null,
step2: { auditinfoList: [],
stepActive: 0,
hasStep2Role: false,
hasStep3Role: false,
baseForm: {},
step2Form: {
opinion: '', opinion: '',
images: [], images: [],
}, },
step2Form: {},
step2Rules: { step2Rules: {
opinion: [ opinion: [
{ required: true, message: "请输入审核意见", trigger: "blur" }, { required: true, message: "请输入审核意见", trigger: "blur" },
@ -145,27 +242,140 @@ let data = reactive({
images: [ images: [
{ validator: validateStep2Images } { validator: validateStep2Images }
] ]
} },
step3Form: {
opinion: ''
},
step3Rules: {
opinion: [
{ required: true, message: "请输入审核意见", trigger: "blur" },
{ min: 1, max: 200, message: "长度在 1 到 255 个字符", trigger: "blur" }
]
},
checkStates: [{ value: "0", label: '待整改' }, { value: "1", label: '待复检' },
{ value: "2", label: '复检驳回' },
{ value: "3", label: '复检通过' }]
}); });
const { step2Form, step2Rules } = toRefs(data); const { step2Form, step2Rules, step3Form, step3Rules } = toRefs(data);
function validateStep2Images(rule, value, callback) { function validateStep2Images(rule, value, callback) {
if (value.length == 0) { if (step2Form.value.images.length == 0) {
callback(new Error("请上传图片!")) callback(new Error("请上传图片!"))
} else { } else {
callback() callback()
} }
} }
function showDrawer(row) { function showDrawer(row, mode) {
data.mode = mode;
data.row = row; data.row = row;
data.visible = true;
}
step2Form.value.images = [];
step2Form.value.opinion = "";
step3Form.value.opinion = "";
data.hasStep2Role = row.lordSent == userStore.uid;
data.hasStep3Role = row.recheckSend == userStore.uid;
data.stepActive = row.checkState + 1;
data.visible = true;
getListAuditinfo();
}
function getListAuditinfo() {
listAuditinfo({
page: 1,
limit: 100,
mainId: data.row.id
}).then(res => {
let tmps = (res.rows || []).map(it => {
it.index = "";
return it;
});
for (let i = 0; i < tmps.length; i++) {
let idx = tmps.length - i + 1;
tmps[i].index = idx < 10 ? '0' + idx : idx;
}
data.auditinfoList = tmps;
if (data.row.checkState == 3) {
if (tmps.length == 2) {
data.simple = true;
data.stepActive = 3;
} else {
data.simple = false;
data.stepActive = 4;
}
}
})
}
function step3Reject() {
data.loading = true;
formStep3Ref.value.validate(v => {
debugger
data.loading = false;
if (!v) {
return;
}
proxy.$confirm("确认驳回此整改?", "提示", {
confirmButtonText: "确 认",
cancelButtonText: "取 消"
}).then(() => {
let postData = {
mainId: data.row.id,
opinion: step3Form.value.opinion,
processState: 2,
};
addAuditinfo(postData).then(d => {
if (d.code == 200) {
proxy.$modal.msgSuccess("提交成功!");
data.visible = false;
emit("success");
}
});
});
});
}
function step3Submit() {
data.loading = true;
formStep3Ref.value.validate(v => {
data.loading = false;
if (!v) {
return;
}
proxy.$confirm("确认复检通过此整改?", "提示", {
confirmButtonText: "确 认",
cancelButtonText: "取 消"
}).then(() => {
let postData = {
mainId: data.row.id,
opinion: step3Form.value.opinion,
processState: 1,
};
addAuditinfo(postData).then(d => {
if (d.code == 200) {
proxy.$modal.msgSuccess("提交成功!");
data.visible = false;
emit("success");
}
});
});
});
}
function step2Submit() { function step2Submit() {
data.loading = true; data.loading = true;
formStep2Ref.value.validate(v => { formStep2Ref.value.validate(v => {
data.loading = false; data.loading = false;
if (v) { if (v) {
let postData = {
mainId: data.row.id,
opinion: step2Form.value.opinion,
processState: 0,
images: step2Form.value.images,
};
addAuditinfo(postData).then(d => {
if (d.code == 200) {
proxy.$modal.msgSuccess("提交成功!");
data.visible = false;
emit("success");
}
});
} }
}); });
} }
@ -197,6 +407,11 @@ defineExpose({
} }
} }
.step-list {
overflow-y: auto;
height: calc(100vh - 128px);
}
.el-card__body { .el-card__body {
padding: 8px !important; padding: 8px !important;
} }
@ -227,10 +442,25 @@ defineExpose({
top: 2px; top: 2px;
} }
} }
.step-img {
.el-image {
width: 90px;
height: 80px;
margin-left: 3px;
}
}
} }
} }
.detail-right { .detail-right {
padding-left: 12px;
&.is-edit {
.el-form-item--default {
margin-bottom: 0px;
}
}
.el-upload-list__item, .el-upload-list__item,
.el-upload--picture-card { .el-upload--picture-card {
@ -238,9 +468,6 @@ defineExpose({
height: 80px !important; height: 80px !important;
} }
.el-form-item--default {
margin-bottom: 0px;
}
.step-header { .step-header {
color: var(--el-color-primary); color: var(--el-color-primary);

View File

@ -59,8 +59,8 @@
<el-table-column label="施工部位" align="center" prop="workParts" /> <el-table-column label="施工部位" align="center" prop="workParts" />
<el-table-column label="整改要求" align="center" prop="changeInfo" /> <el-table-column label="整改要求" align="center" prop="changeInfo" />
<el-table-column label="整改截至时间" align="center" prop="nickedTime" width="120" /> <el-table-column label="整改截至时间" align="center" prop="nickedTime" width="120" />
<el-table-column label="整改人" align="center" prop="lordSent" width="200" /> <el-table-column label="整改人" align="center" prop="lordSentUser" width="200" />
<el-table-column label="复检人" align="center" prop="recheckSend" width="200" /> <el-table-column label="复检人" align="center" prop="recheckSendUser" width="200" />
<el-table-column label="抄送人" align="center" prop="copySendUser" width="200" /> <el-table-column label="抄送人" align="center" prop="copySendUser" width="200" />
<el-table-column label="流程状态" align="center" prop="checkState"> <el-table-column label="流程状态" align="center" prop="checkState">
<template #default="scope"> <template #default="scope">
@ -88,25 +88,25 @@
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="getList" /> v-model:limit="queryParams.pageSize" @pagination="getList" />
<detailDrawer ref="detailDrawerRef"></detailDrawer> <detailDrawer ref="detailDrawerRef" @success="handleQuery"></detailDrawer>
</div> </div>
</template> </template>
<script setup name="Problemmodify"> <script setup name="Problemmodify">
import detailDrawer from "./detailDrawer.vue"; import detailDrawer from "./detailDrawer.vue";
import useUserStore from '@/store/modules/user'
import { Check, Document, Delete } from '@element-plus/icons-vue' import { Check, Document, Delete } from '@element-plus/icons-vue'
import { listProblemmodify, getProblemmodify, delProblemmodify, addProblemmodify, updateProblemmodify, getListCount } from "@/api/trouble/problemmodify"; import { listProblemmodify, getProblemmodify, delProblemmodify, addProblemmodify, updateProblemmodify, getListCount } from "@/api/trouble/problemmodify";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { ssp_proble_type, ssp_proble_sub_type } = proxy.useDict('ssp_proble_type', 'ssp_proble_sub_type'); const { ssp_proble_type, ssp_proble_sub_type } = proxy.useDict('ssp_proble_type', 'ssp_proble_sub_type');
const problemmodifyList = ref([]); const problemmodifyList = ref([]);
const open = ref(false); const userStore = useUserStore()
const loading = ref(true); const loading = ref(true);
const showSearch = ref(true); const showSearch = ref(true);
const ids = ref([]); const ids = ref([]);
const single = ref(true); const single = ref(true);
const multiple = ref(true); const multiple = ref(true);
const total = ref(0); const total = ref(0);
const title = ref("");
const detailDrawerRef = ref(); const detailDrawerRef = ref();
const data = reactive({ const data = reactive({
form: {}, form: {},
@ -174,16 +174,28 @@ function tabClick() {
} }
function handleModify(row) { function handleModify(row) {
detailDrawerRef.value.showDrawer(row, 'edit');
} }
function handleDetail(row) { function handleDetail(row) {
detailDrawerRef.value.showDrawer(row); detailDrawerRef.value.showDrawer(row, 'show');
} }
function getIsVdel(row) { function getIsVdel(row) {
let isAdmin = userStore.isAdmin;
if (isAdmin) {
return true; return true;
} else if (row.updateUser == userStore.uid && row.checkState != 3) {
return true;
}
return false;
} }
function getIsModify(row) { function getIsModify(row) {
return true; if (row.checkState == 0 || row.checkState == 2) {
return row.lordSent == userStore.uid;
}
if (row.checkState == 1) {
return row.recheckSend == userStore.uid;
}
return false;
} }
/** 重置按钮操作 */ /** 重置按钮操作 */
function resetQuery() { function resetQuery() {