fix:系统调整
This commit is contained in:
parent
88ea26163d
commit
553bddeea8
|
|
@ -16,10 +16,11 @@ VITE_PROXY_API = /dev-api
|
||||||
# VITE_PROXY = [ ["/dev-api", "http://42.193.40.239:8017" ],["/dev-img-api", "http://file.sczysoft.com" ]]
|
# VITE_PROXY = [ ["/dev-api", "http://42.193.40.239:8017" ],["/dev-img-api", "http://file.sczysoft.com" ]]
|
||||||
# VITE_UPLOAD_URL = http://42.193.40.239:8888
|
# VITE_UPLOAD_URL = http://42.193.40.239:8888
|
||||||
# 东哥
|
# 东哥
|
||||||
# VITE_PROXY = [ ["/dev-api", "http://192.168.110.186:8017" ],["/dev-img-api", "http://42.193.40.239:8017" ]]
|
VITE_PROXY = [ ["/dev-api", "http://192.168.2.179:8017" ],["/dev-img-api", "http://42.193.40.239:8017" ]]
|
||||||
# VITE_UPLOAD_URL = http://192.168.110.186
|
# VITE_UPLOAD_URL = http://192.168.110.186
|
||||||
# 陈游
|
# 陈游
|
||||||
VITE_PROXY = [ ["/dev-api", "http://192.168.110.10:8017" ],["/dev-img-api", "http://42.193.40.239:8017" ]]
|
# VITE_PROXY = [ ["/dev-api", "http://42.193.40.239:8017" ],["/dev-img-api", "http://42.193.40.239:8017" ]]
|
||||||
|
# VITE_PROXY = [ ["/dev-api", "http://42.193.40.239:6111" ],["/dev-img-api", "http://42.193.40.239:8017" ]]
|
||||||
VITE_UPLOAD_URL = http://42.193.40.239:8888/
|
VITE_UPLOAD_URL = http://42.193.40.239:8888/
|
||||||
# VITE_UPLOAD_URL = https://city.sczysoft.com/dffile/
|
# VITE_UPLOAD_URL = https://city.sczysoft.com/dffile/
|
||||||
#
|
#
|
||||||
|
|
|
||||||
22499
.pnpm-debug.log
22499
.pnpm-debug.log
File diff suppressed because it is too large
Load Diff
7938
pnpm-lock.yaml
7938
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
|
@ -107,7 +107,30 @@ export function saveRoleResource(params, token) {
|
||||||
data: params
|
data: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*角色接口
|
||||||
|
*/
|
||||||
|
export function getRoleApiTree(data) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/Sys/getRoleApiTree`,
|
||||||
|
method: "GET",
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*角色接口授权
|
||||||
|
*/
|
||||||
|
export function roleApiAdd(params, token) {
|
||||||
|
return request({
|
||||||
|
headers: {
|
||||||
|
userToken: token
|
||||||
|
},
|
||||||
|
url: `/admin/Sys/roleApiAdd`,
|
||||||
|
method: "POST",
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*安全类别分页
|
*安全类别分页
|
||||||
*/
|
*/
|
||||||
|
|
@ -234,6 +257,16 @@ export function getListperformTree() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位树
|
||||||
|
*/
|
||||||
|
export function userListperformTree() {
|
||||||
|
return request({
|
||||||
|
url: `/admin/Sys/userListperformTree`,
|
||||||
|
method: "GET",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位下用户分页
|
* 岗位下用户分页
|
||||||
*/
|
*/
|
||||||
|
|
@ -277,6 +310,37 @@ export function performDel(listperformid) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 风险类型列表
|
||||||
|
*/
|
||||||
|
export function riskTypePage(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/risk/riskTypePage`,
|
||||||
|
method: "GET",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*风险类型删除
|
||||||
|
*/
|
||||||
|
export function riskTypeDel(typeId) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/risk/riskTypeDel/${typeId}`,
|
||||||
|
method: "POST",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 风险类型新增/修改
|
||||||
|
*/
|
||||||
|
export function riskTypeAdd(data) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/risk/riskTypeAdd`,
|
||||||
|
method: "POST",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户管理-所属角色List
|
* 用户管理-所属角色List
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,28 @@ export function wkTypes(params) {
|
||||||
params:params
|
params:params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*查看工作分页
|
||||||
|
*/
|
||||||
|
export function allWorkPage(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/work/allWorkPage`,
|
||||||
|
method: "GET",
|
||||||
|
params:params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*动态查看分页
|
||||||
|
*/
|
||||||
|
export function wkDynamicsAllPage(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/work/wkDynamicsAllPage`,
|
||||||
|
method: "GET",
|
||||||
|
params:params
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*工作详情
|
*工作详情
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
BIN
src/assets/images/null.png
Normal file
BIN
src/assets/images/null.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
|
|
@ -99,7 +99,10 @@ onUnmounted(() => {
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<router-view v-slot="{ Component, route }">
|
<router-view v-slot="{ Component, route }">
|
||||||
<transition name="main" mode="out-in" appear>
|
<transition name="main" mode="out-in" appear>
|
||||||
<keep-alive :include="keepAliveStore.list">
|
<!-- <keep-alive :include="keepAliveStore.list">
|
||||||
|
<component :is="Component" :key="route.fullPath" />
|
||||||
|
</keep-alive> -->
|
||||||
|
<keep-alive>
|
||||||
<component :is="Component" :key="route.fullPath" />
|
<component :is="Component" :key="route.fullPath" />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,17 @@ export default {
|
||||||
breadcrumb: true,
|
breadcrumb: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'risktype',
|
||||||
|
name: 'risktype',
|
||||||
|
component: () => import('@/views/system/base/risk-type/index.vue'),
|
||||||
|
meta: {
|
||||||
|
auth: 'system.data.risktype',
|
||||||
|
icon: 'point',
|
||||||
|
title: '风险类型管理',
|
||||||
|
breadcrumb: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
39
src/router/modules/work-dynamic.js
Normal file
39
src/router/modules/work-dynamic.js
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
const Layout = () => import('@/layout/index.vue')
|
||||||
|
|
||||||
|
export default {
|
||||||
|
path: '/dynamic',
|
||||||
|
component: Layout,
|
||||||
|
name: 'dynamic',
|
||||||
|
redirect: '/dynamic/w-dynamic',
|
||||||
|
meta: {
|
||||||
|
auth: "dynamic",
|
||||||
|
title: '动态查看',
|
||||||
|
icon: 'icon-work',
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'w-dynamic',
|
||||||
|
name: 'w-dynamic',
|
||||||
|
component: () => import('@/views/work-dynamic/index.vue'),
|
||||||
|
meta: {
|
||||||
|
auth: "dynamic.index",
|
||||||
|
icon: 'point',
|
||||||
|
title: '动态列表',
|
||||||
|
sidebar: false
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
// {
|
||||||
|
// path: 'dynamic-detail',
|
||||||
|
// name: 'dynamic-detail',
|
||||||
|
// component: () => import('@/views/work-dynamic/components/detail.vue'),
|
||||||
|
// meta: {
|
||||||
|
// auth: "dynamic.index.detail",
|
||||||
|
// title: '动态详情',
|
||||||
|
// sidebar: false, //是否在菜单栏显示
|
||||||
|
// breadcrumb: true, //是否显示面包屑
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
39
src/router/modules/work-view.js
Normal file
39
src/router/modules/work-view.js
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
const Layout = () => import('@/layout/index.vue')
|
||||||
|
|
||||||
|
export default {
|
||||||
|
path: '/view',
|
||||||
|
component: Layout,
|
||||||
|
name: 'view',
|
||||||
|
redirect: '/view/w-view',
|
||||||
|
meta: {
|
||||||
|
auth: "view",
|
||||||
|
title: '工作查看',
|
||||||
|
icon: 'icon-work',
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'w-view',
|
||||||
|
name: 'w-view',
|
||||||
|
component: () => import('@/views/work-view/index.vue'),
|
||||||
|
meta: {
|
||||||
|
auth: "view.index",
|
||||||
|
icon: 'point',
|
||||||
|
title: '工作列表',
|
||||||
|
sidebar: false
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'view-detail',
|
||||||
|
name: 'view-detail',
|
||||||
|
component: () => import('@/views/work-view/components/detail.vue'),
|
||||||
|
meta: {
|
||||||
|
auth: "view.index.detail",
|
||||||
|
title: '工作详情',
|
||||||
|
sidebar: false, //是否在菜单栏显示
|
||||||
|
breadcrumb: true, //是否显示面包屑
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -107,6 +107,8 @@ import system from "./modules/system";
|
||||||
import base from './modules/basemanage';
|
import base from './modules/basemanage';
|
||||||
import trends from './modules/work-trends';
|
import trends from './modules/work-trends';
|
||||||
import manage from './modules/work-manage';
|
import manage from './modules/work-manage';
|
||||||
|
import view from './modules/work-view';
|
||||||
|
import dynamic from './modules/work-dynamic';
|
||||||
import statistic from './modules/statistic';
|
import statistic from './modules/statistic';
|
||||||
import bigData from './modules/big-data';
|
import bigData from './modules/big-data';
|
||||||
import demands from './modules/demands';
|
import demands from './modules/demands';
|
||||||
|
|
@ -128,6 +130,8 @@ let asyncRoutes = [
|
||||||
trends,
|
trends,
|
||||||
demands,
|
demands,
|
||||||
manage,
|
manage,
|
||||||
|
view,
|
||||||
|
dynamic,
|
||||||
acceptWork,
|
acceptWork,
|
||||||
statistic,
|
statistic,
|
||||||
system,
|
system,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
axios.defaults.headers["content-type"] = "application/json;charset=utf-8";
|
axios.defaults.headers["content-type"] = "application/json;charset=utf-8";
|
||||||
|
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
|
|
@ -71,6 +72,12 @@ function configRequest(service: {
|
||||||
localStorage.setItem('token_df', "")
|
localStorage.setItem('token_df', "")
|
||||||
location.reload();
|
location.reload();
|
||||||
} else {
|
} else {
|
||||||
|
if(res.data.code == 0 || res.data.code == 42){
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.data.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,22 @@
|
||||||
clearable
|
clearable
|
||||||
></el-cascader>
|
></el-cascader>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="label-select filter-tab">
|
||||||
|
<label>人员类型</label>
|
||||||
|
<el-select
|
||||||
|
@change="getList"
|
||||||
|
placeholder="请选择人员类型"
|
||||||
|
v-model="typeId"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(item, index) in crTypeListOptions"
|
||||||
|
:key="index"
|
||||||
|
:label="item.typeName"
|
||||||
|
:value="item.typeId"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 30%;">
|
<div style="width: 30%;">
|
||||||
|
|
@ -200,7 +216,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import DetailAddPersonnel from "./dialog/detail-addPersonnel.vue";
|
import DetailAddPersonnel from "./dialog/detail-addPersonnel.vue";
|
||||||
import { areaTree } from "@/api/account";
|
import { areaTree } from "@/api/account";
|
||||||
import { peoplePage, peopleDel } from "@/api/base";
|
import { peoplePage, peopleDel,crTypeList } from "@/api/base";
|
||||||
import useUserStore from "@/store/modules/user";
|
import useUserStore from "@/store/modules/user";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -225,6 +241,15 @@ const pageSize = ref(10);
|
||||||
const total = ref(2);
|
const total = ref(2);
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
const tableDataloading = ref(false);
|
const tableDataloading = ref(false);
|
||||||
|
|
||||||
|
const crTypeListOptions = ref([]);
|
||||||
|
const typeId = ref("");
|
||||||
|
const getcrTypeList = () => {
|
||||||
|
crTypeList({}).then((res: any) => {
|
||||||
|
crTypeListOptions.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
//获取列表
|
//获取列表
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
tableDataloading.value = true;
|
tableDataloading.value = true;
|
||||||
|
|
@ -235,6 +260,7 @@ const getList = () => {
|
||||||
userId: userId.value,
|
userId: userId.value,
|
||||||
areaCode: "",
|
areaCode: "",
|
||||||
typeName: "flowing",
|
typeName: "flowing",
|
||||||
|
typeId:typeId.value,
|
||||||
};
|
};
|
||||||
if (search.value.areaCode) {
|
if (search.value.areaCode) {
|
||||||
params.areaCode = search.value.areaCode[search.value.areaCode.length - 1];
|
params.areaCode = search.value.areaCode[search.value.areaCode.length - 1];
|
||||||
|
|
@ -293,6 +319,7 @@ const toDetail = (id) => {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getareaTree();
|
getareaTree();
|
||||||
getList();
|
getList();
|
||||||
|
getcrTypeList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -335,8 +335,6 @@ const crTypeListOptions = ref([]);
|
||||||
const getcrTypeList = () => {
|
const getcrTypeList = () => {
|
||||||
crTypeList({}).then((res: any) => {
|
crTypeList({}).then((res: any) => {
|
||||||
crTypeListOptions.value = res.data;
|
crTypeListOptions.value = res.data;
|
||||||
console.log(crTypeListOptions.value,'crTypeListOptions');
|
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,8 @@
|
||||||
<el-option label="已婚" :value="1">已婚</el-option>
|
<el-option label="已婚" :value="1">已婚</el-option>
|
||||||
<el-option label="未婚" :value="2">未婚</el-option>
|
<el-option label="未婚" :value="2">未婚</el-option>
|
||||||
<el-option label="离婚" :value="3">离婚</el-option>
|
<el-option label="离婚" :value="3">离婚</el-option>
|
||||||
|
<el-option label="丧偶" :value="4">丧偶</el-option>
|
||||||
|
<el-option label="单亲" :value="5">单亲</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="出生日期" prop="birthday">
|
<el-form-item label="出生日期" prop="birthday">
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,16 @@
|
||||||
<el-option label="女" :value="0">女</el-option>
|
<el-option label="女" :value="0">女</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="是否脱贫户" prop="poorState" class="right">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="formData.poorState"
|
||||||
|
>
|
||||||
|
<el-option label="是" :value="1">是</el-option>
|
||||||
|
<el-option label="否" :value="2">否</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item prop="areaCode" label="所属区域">
|
<el-form-item prop="areaCode" label="所属区域">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
|
|
@ -50,7 +60,7 @@
|
||||||
clearable
|
clearable
|
||||||
></el-cascader>
|
></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="婚姻状态" prop="marriageState">
|
<el-form-item label="婚姻状态" prop="marriageState" class="right">
|
||||||
<el-select
|
<el-select
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
|
|
@ -59,6 +69,8 @@
|
||||||
<el-option label="已婚" :value="1">已婚</el-option>
|
<el-option label="已婚" :value="1">已婚</el-option>
|
||||||
<el-option label="未婚" :value="2">未婚</el-option>
|
<el-option label="未婚" :value="2">未婚</el-option>
|
||||||
<el-option label="离婚" :value="3">离婚</el-option>
|
<el-option label="离婚" :value="3">离婚</el-option>
|
||||||
|
<el-option label="丧偶" :value="4">丧偶</el-option>
|
||||||
|
<el-option label="单亲" :value="5">单亲</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="出生日期" prop="birthday">
|
<el-form-item label="出生日期" prop="birthday">
|
||||||
|
|
@ -72,7 +84,7 @@
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="户籍创建时间" prop="changeTime">
|
<el-form-item label="户籍创建时间" prop="changeTime" style="width: 94%;">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
v-model="formData.changeTime"
|
v-model="formData.changeTime"
|
||||||
|
|
@ -276,4 +288,8 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
.right {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -64,6 +64,8 @@
|
||||||
<el-option label="已婚" :value="1">已婚</el-option>
|
<el-option label="已婚" :value="1">已婚</el-option>
|
||||||
<el-option label="未婚" :value="2">未婚</el-option>
|
<el-option label="未婚" :value="2">未婚</el-option>
|
||||||
<el-option label="离婚" :value="3">离婚</el-option>
|
<el-option label="离婚" :value="3">离婚</el-option>
|
||||||
|
<el-option label="丧偶" :value="4">丧偶</el-option>
|
||||||
|
<el-option label="单亲" :value="5">单亲</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="label-select filter-tab">
|
<div class="label-select filter-tab">
|
||||||
|
|
@ -78,6 +80,22 @@
|
||||||
<el-option label="女" :value="0">女</el-option>
|
<el-option label="女" :value="0">女</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="label-select filter-tab">
|
||||||
|
<label>人员类型</label>
|
||||||
|
<el-select
|
||||||
|
@change="getList"
|
||||||
|
placeholder="请选择人员类型"
|
||||||
|
v-model="typeId"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(item, index) in crTypeListOptions"
|
||||||
|
:key="index"
|
||||||
|
:label="item.typeName"
|
||||||
|
:value="item.typeId"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -90,7 +108,7 @@
|
||||||
@keydown.enter.native="getList"
|
@keydown.enter.native="getList"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<span class="search-bottom">
|
<span class="search-bottom" @click="getList">
|
||||||
<svg-icon name="search" class="icon_class" />
|
<svg-icon name="search" class="icon_class" />
|
||||||
<span>搜索</span>
|
<span>搜索</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -267,7 +285,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script lang='ts' setup>
|
<script lang='ts' setup>
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import { domicilePage, domicileDel, domicileRestore } from "@/api/base";
|
import { domicilePage, domicileDel, domicileRestore,crTypeList } from "@/api/base";
|
||||||
import AddEdit from "./dialog/add-edit.vue";
|
import AddEdit from "./dialog/add-edit.vue";
|
||||||
import Cancel from "./dialog/cancel.vue";
|
import Cancel from "./dialog/cancel.vue";
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
|
@ -294,6 +312,15 @@ const currentPage = ref(1);
|
||||||
const pageSize = ref(10);
|
const pageSize = ref(10);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
|
|
||||||
|
const crTypeListOptions = ref([]);
|
||||||
|
const typeId = ref("");
|
||||||
|
const getcrTypeList = () => {
|
||||||
|
crTypeList({}).then((res: any) => {
|
||||||
|
crTypeListOptions.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
//获取列表
|
//获取列表
|
||||||
const tableDataloading = ref(false);
|
const tableDataloading = ref(false);
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
|
|
@ -308,6 +335,7 @@ const getList = () => {
|
||||||
sex: search.value.sex,
|
sex: search.value.sex,
|
||||||
areaCode: "",
|
areaCode: "",
|
||||||
poorState:1,
|
poorState:1,
|
||||||
|
typeId:typeId.value,
|
||||||
};
|
};
|
||||||
if (search.value.areaCode) {
|
if (search.value.areaCode) {
|
||||||
params.areaCode = search.value.areaCode[search.value.areaCode.length - 1];
|
params.areaCode = search.value.areaCode[search.value.areaCode.length - 1];
|
||||||
|
|
@ -399,6 +427,7 @@ const fileExport = () => {
|
||||||
sex: search.value.sex,
|
sex: search.value.sex,
|
||||||
startTime: "",
|
startTime: "",
|
||||||
endTime: "",
|
endTime: "",
|
||||||
|
typeId:typeId.value,
|
||||||
};
|
};
|
||||||
exportFileRequest(
|
exportFileRequest(
|
||||||
`/admin/export/exportDomicileList`,
|
`/admin/export/exportDomicileList`,
|
||||||
|
|
@ -416,6 +445,7 @@ const getareaTree = () => {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
getareaTree();
|
getareaTree();
|
||||||
|
getcrTypeList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,12 @@
|
||||||
<el-option label="女" :value="0">女</el-option>
|
<el-option label="女" :value="0">女</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="迁入日期" prop="moveTime">
|
||||||
|
<el-input :disabled="formEnable" placeholder="请输入" type="input" v-model="detailForm.moveTime" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="迁入原因" prop="moveReason">
|
||||||
|
<el-input :disabled="formEnable" placeholder="请输入" type="input" v-model="detailForm.moveReason" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item prop="areaCode" label="所属区域">
|
<el-form-item prop="areaCode" label="所属区域">
|
||||||
<el-cascader :disabled="formEnable" ref="cascader" v-model="detailForm.areaCode" placeholder="请选择地区"
|
<el-cascader :disabled="formEnable" ref="cascader" v-model="detailForm.areaCode" placeholder="请选择地区"
|
||||||
:options="orgList" :props="{
|
:options="orgList" :props="{
|
||||||
|
|
@ -48,6 +54,18 @@
|
||||||
<el-option label="已婚" :value="1">已婚</el-option>
|
<el-option label="已婚" :value="1">已婚</el-option>
|
||||||
<el-option label="未婚" :value="2">未婚</el-option>
|
<el-option label="未婚" :value="2">未婚</el-option>
|
||||||
<el-option label="离婚" :value="3">离婚</el-option>
|
<el-option label="离婚" :value="3">离婚</el-option>
|
||||||
|
<el-option label="丧偶" :value="4">丧偶</el-option>
|
||||||
|
<el-option label="单亲" :value="5">单亲</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否脱贫户" prop="poorState">
|
||||||
|
<el-select
|
||||||
|
:disabled="formEnable"
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="detailForm.poorState"
|
||||||
|
>
|
||||||
|
<el-option label="是" :value="1">是</el-option>
|
||||||
|
<el-option label="否" :value="2">否</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="出生日期" prop="birthday">
|
<el-form-item label="出生日期" prop="birthday">
|
||||||
|
|
@ -61,7 +79,7 @@
|
||||||
<el-form-item label="身份证号" prop="idCard">
|
<el-form-item label="身份证号" prop="idCard">
|
||||||
<el-input :disabled="formEnable" placeholder="请输入身份证号" type="input" v-model="detailForm.idCard" />
|
<el-input :disabled="formEnable" placeholder="请输入身份证号" type="input" v-model="detailForm.idCard" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="现居地址" prop="address">
|
<el-form-item label="现居地址" prop="address" style="width: 100%;">
|
||||||
<el-input :disabled="formEnable" placeholder="请输入" type="input" v-model="detailForm.address" />
|
<el-input :disabled="formEnable" placeholder="请输入" type="input" v-model="detailForm.address" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="经度" prop="lon">
|
<el-form-item label="经度" prop="lon">
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
v-model="formData.name"
|
v-model="formData.name"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="性别" prop="sortId">
|
<el-form-item label="性别" prop="sortId" class="right">
|
||||||
<el-select
|
<el-select
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
|
|
@ -35,6 +35,37 @@
|
||||||
<el-option label="女" :value="0">女</el-option>
|
<el-option label="女" :value="0">女</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="迁入原因" prop="moveReason" class="right">
|
||||||
|
<el-input
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请输入"
|
||||||
|
type="input"
|
||||||
|
v-model="formData.moveReason"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="迁入日期" prop="moveTimeStr">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="readonly"
|
||||||
|
v-model="formData.moveTimeStr"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择出生日期"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="是否脱贫户" prop="poorState" class="right">
|
||||||
|
<el-select
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="formData.poorState"
|
||||||
|
>
|
||||||
|
<el-option label="是" :value="1">是</el-option>
|
||||||
|
<el-option label="否" :value="2">否</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item prop="areaCode" label="所属区域">
|
<el-form-item prop="areaCode" label="所属区域">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
|
|
@ -50,7 +81,7 @@
|
||||||
clearable
|
clearable
|
||||||
></el-cascader>
|
></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="婚姻状态" prop="marriageState">
|
<el-form-item label="婚姻状态" prop="marriageState" class="right">
|
||||||
<el-select
|
<el-select
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
|
|
@ -59,6 +90,8 @@
|
||||||
<el-option label="已婚" :value="1">已婚</el-option>
|
<el-option label="已婚" :value="1">已婚</el-option>
|
||||||
<el-option label="未婚" :value="2">未婚</el-option>
|
<el-option label="未婚" :value="2">未婚</el-option>
|
||||||
<el-option label="离婚" :value="3">离婚</el-option>
|
<el-option label="离婚" :value="3">离婚</el-option>
|
||||||
|
<el-option label="丧偶" :value="4">丧偶</el-option>
|
||||||
|
<el-option label="单亲" :value="5">单亲</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="出生日期" prop="birthday">
|
<el-form-item label="出生日期" prop="birthday">
|
||||||
|
|
@ -72,7 +105,7 @@
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="户籍创建时间" prop="changeTime">
|
<el-form-item label="户籍创建时间" prop="changeTime" style="width: 94%;">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
v-model="formData.changeTime"
|
v-model="formData.changeTime"
|
||||||
|
|
@ -238,6 +271,14 @@ const getareaTree = () => {
|
||||||
orgList.value = res.data;
|
orgList.value = res.data;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
//获取当前日期
|
||||||
|
const getCurrentDate = () => {
|
||||||
|
const today = new Date();
|
||||||
|
const year = today.getFullYear();
|
||||||
|
const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||||
|
const day = String(today.getDate()).padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day}`;
|
||||||
|
};
|
||||||
// 地图拖拽结束
|
// 地图拖拽结束
|
||||||
const handleMapChange = (pos) => {
|
const handleMapChange = (pos) => {
|
||||||
formData.value.lon = pos[0];
|
formData.value.lon = pos[0];
|
||||||
|
|
@ -297,6 +338,9 @@ watch(
|
||||||
titleName.value = val.domicileId ? "编辑" : "新增/迁入";
|
titleName.value = val.domicileId ? "编辑" : "新增/迁入";
|
||||||
formData.value = JSON.parse(JSON.stringify(val));
|
formData.value = JSON.parse(JSON.stringify(val));
|
||||||
if(val.domicileId) getDomicileDetail(formData.value.domicileId);
|
if(val.domicileId) getDomicileDetail(formData.value.domicileId);
|
||||||
|
if(!val.domicileId){
|
||||||
|
formData.value.moveTimeStr = getCurrentDate()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -307,6 +351,9 @@ watch(
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
}
|
}
|
||||||
|
.right {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
:deep(.el-input-group__append) {
|
:deep(.el-input-group__append) {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
background-color:transparent !important;
|
background-color:transparent !important;
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,15 @@
|
||||||
<el-option label="否" :value=2></el-option>
|
<el-option label="否" :value=2></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="新增原因" prop="addReason" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.addReason"
|
||||||
|
:disabled="readonly"
|
||||||
|
:rows="2"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入工作地点"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="工作地点" prop="workAddress" style="width: 100%;">
|
<el-form-item label="工作地点" prop="workAddress" style="width: 100%;">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="formData.workAddress"
|
v-model="formData.workAddress"
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,22 @@
|
||||||
<el-option label="女" :value="0">女</el-option>
|
<el-option label="女" :value="0">女</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="label-select filter-tab">
|
||||||
|
<label>人员类型</label>
|
||||||
|
<el-select
|
||||||
|
@change="getList"
|
||||||
|
placeholder="请选择人员类型"
|
||||||
|
v-model="typeId"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(item, index) in crTypeListOptions"
|
||||||
|
:key="index"
|
||||||
|
:label="item.typeName"
|
||||||
|
:value="item.typeId"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -80,7 +96,7 @@
|
||||||
@keydown.enter.native="getList"
|
@keydown.enter.native="getList"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<span class="search-bottom">
|
<span class="search-bottom" @click="getList">
|
||||||
<svg-icon name="search" class="icon_class" />
|
<svg-icon name="search" class="icon_class" />
|
||||||
<span>搜索</span>
|
<span>搜索</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -264,7 +280,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script lang='ts' setup>
|
<script lang='ts' setup>
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import { domicilePage, domicileDel, domicileRestore } from "@/api/base";
|
import { domicilePage, domicileDel, domicileRestore,crTypeList } from "@/api/base";
|
||||||
import AddEdit from "./dialog/add-edit.vue";
|
import AddEdit from "./dialog/add-edit.vue";
|
||||||
import Cancel from "./dialog/cancel.vue";
|
import Cancel from "./dialog/cancel.vue";
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
|
@ -291,6 +307,15 @@ const currentPage = ref(1);
|
||||||
const pageSize = ref(10);
|
const pageSize = ref(10);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
|
|
||||||
|
const crTypeListOptions = ref([]);
|
||||||
|
const typeId = ref("");
|
||||||
|
const getcrTypeList = () => {
|
||||||
|
crTypeList({}).then((res: any) => {
|
||||||
|
crTypeListOptions.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
//获取列表
|
//获取列表
|
||||||
const tableDataloading = ref(false);
|
const tableDataloading = ref(false);
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
|
|
@ -304,6 +329,7 @@ const getList = () => {
|
||||||
marriageState:search.value.marriageState,
|
marriageState:search.value.marriageState,
|
||||||
sex:search.value.sex,
|
sex:search.value.sex,
|
||||||
areaCode: "",
|
areaCode: "",
|
||||||
|
typeId:typeId.value,
|
||||||
};
|
};
|
||||||
if (search.value.areaCode) {
|
if (search.value.areaCode) {
|
||||||
params.areaCode = search.value.areaCode[search.value.areaCode.length - 1];
|
params.areaCode = search.value.areaCode[search.value.areaCode.length - 1];
|
||||||
|
|
@ -411,6 +437,7 @@ const getareaTree = () => {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
getareaTree();
|
getareaTree();
|
||||||
|
getcrTypeList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
class="search-input"
|
class="search-input"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<span class="search-bottom">
|
<span class="search-bottom" @click="getList">
|
||||||
<svg-icon name="search" class="icon_class" />
|
<svg-icon name="search" class="icon_class" />
|
||||||
<span>搜索</span>
|
<span>搜索</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ import useUserStore from "@/store/modules/user";
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const user = ref(JSON.parse(userStore.userInfo));
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
const userId = ref(user.value.userId);
|
const userId = ref(user.value.userId);
|
||||||
const uuid = ref(getUUID());
|
const uuid = ref('');
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
|
|
@ -112,7 +112,7 @@ const handleSubmit = () => {
|
||||||
let params = {
|
let params = {
|
||||||
...formData.value,
|
...formData.value,
|
||||||
areaCode: "",
|
areaCode: "",
|
||||||
dutyId:uuid.value
|
dutyId:formData.value.dutyId?formData.value.dutyId:uuid.value
|
||||||
};
|
};
|
||||||
if (formData.value.areaCode instanceof Array) {
|
if (formData.value.areaCode instanceof Array) {
|
||||||
params.areaCode =
|
params.areaCode =
|
||||||
|
|
@ -165,8 +165,9 @@ onMounted(() => {
|
||||||
watch(
|
watch(
|
||||||
() => props.form,
|
() => props.form,
|
||||||
(val: any) => {
|
(val: any) => {
|
||||||
titleName.value = val.id ? "编辑" : "新增";
|
titleName.value = val.dutyId ? "编辑" : "新增";
|
||||||
formData.value = JSON.parse(JSON.stringify(val));
|
formData.value = JSON.parse(JSON.stringify(val));
|
||||||
|
uuid.value = getUUID();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@
|
||||||
<el-table-column type="index" align="center" label="序号" width="80"/>
|
<el-table-column type="index" align="center" label="序号" width="80"/>
|
||||||
<el-table-column prop="chinaName" align="center" label="接收人姓名" />
|
<el-table-column prop="chinaName" align="center" label="接收人姓名" />
|
||||||
<el-table-column prop="postName" align="center" label="接收人岗位" />
|
<el-table-column prop="postName" align="center" label="接收人岗位" />
|
||||||
|
<el-table-column prop="workContent" align="center" label="工作内容" />
|
||||||
<el-table-column prop="workState" align="center" label="工作状态" >
|
<el-table-column prop="workState" align="center" label="工作状态" >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span class="notViewed" v-if="scope.row.workState==1">未查看</span>
|
<span class="notViewed" v-if="scope.row.workState==1">未查看</span>
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,13 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="con">{{ item.title }}</div>
|
<div class="con">{{ item.title }}</div>
|
||||||
<div>
|
<div>
|
||||||
<img class="log_img" @click="openImg(item.filePath)" :src="baseUrl+item.filePath" alt="" srcset="">
|
<img v-if="item.filePath" class="log_img" @click="openImg(item.filePath)" :src="baseUrl+item.filePath" alt="" srcset="">
|
||||||
|
<img
|
||||||
|
v-else
|
||||||
|
src="../../assets/images/null.png"
|
||||||
|
class="log_img"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div style="margin-bottom: 16px;" class="h-layout space-between h-center">
|
<div style="margin-bottom: 16px;" class="h-layout space-between h-center">
|
||||||
<div>
|
<div>
|
||||||
<div class="h-layout">
|
<div class="h-layout" style="display: flex;align-items: center;">
|
||||||
<div class="tool-item" @click="getList">
|
<div class="tool-item" @click="getList">
|
||||||
<svg-icon name="refurbish" class="icon" />
|
<svg-icon name="refurbish" class="icon" />
|
||||||
<span>刷新</span>
|
<span>刷新</span>
|
||||||
|
|
@ -19,6 +19,19 @@
|
||||||
<svg-icon name="export" class="icon" />
|
<svg-icon name="export" class="icon" />
|
||||||
<span>导出</span>
|
<span>导出</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="label-select filter-tab">
|
||||||
|
<label>岗位</label>
|
||||||
|
<el-tree-select
|
||||||
|
v-model="listperformid"
|
||||||
|
:data="postTree"
|
||||||
|
:render-after-expand="false"
|
||||||
|
check-strictly
|
||||||
|
:filter-node-method="filterPostMethod"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
@change="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<!-- <div
|
<!-- <div
|
||||||
v-if="tableCheckBoxs.length > 0"
|
v-if="tableCheckBoxs.length > 0"
|
||||||
class="tool-item"
|
class="tool-item"
|
||||||
|
|
@ -186,6 +199,7 @@
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
import { getUserPage, delUser } from "@/api/Sys";
|
import { getUserPage, delUser } from "@/api/Sys";
|
||||||
|
import { userListperformTree } from "@/api/Sys";
|
||||||
import Adddetails from "./details.vue";
|
import Adddetails from "./details.vue";
|
||||||
import useUserStore from "@/store/modules/user";
|
import useUserStore from "@/store/modules/user";
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
@ -210,6 +224,32 @@ const handleSelectionChange = (val: any) => {
|
||||||
tableCheckBoxs.value.push(element.sysuserid);
|
tableCheckBoxs.value.push(element.sysuserid);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const listperformid = ref('')
|
||||||
|
//组织list
|
||||||
|
const postTree = ref([]);
|
||||||
|
/**筛选组织*/
|
||||||
|
const filterPostMethod = (value, data) => data.label.includes(value);
|
||||||
|
/**
|
||||||
|
* 获取组织
|
||||||
|
*/
|
||||||
|
const getPostTree = () => {
|
||||||
|
userListperformTree().then((res: any) => {
|
||||||
|
if (res.code == 1) postTree.value = handlePostData(res.data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/**处理组织数据 */
|
||||||
|
let handlePostData = (list) => {
|
||||||
|
let data = list.map((item) => {
|
||||||
|
return {
|
||||||
|
label: item.chinaName ? item.performclassname + '-' + item.chinaName :item.performclassname,
|
||||||
|
value: item.listperformid,
|
||||||
|
children: item.children ? handlePostData(item.children) : [],
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
//获取列表
|
//获取列表
|
||||||
const tableDataloading = ref(false);
|
const tableDataloading = ref(false);
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
|
|
@ -220,6 +260,7 @@ const getList = () => {
|
||||||
page: currentPage.value,
|
page: currentPage.value,
|
||||||
state: null,
|
state: null,
|
||||||
unitId: null,
|
unitId: null,
|
||||||
|
listperformid:listperformid.value
|
||||||
};
|
};
|
||||||
getUserPage(params).then((res: any) => {
|
getUserPage(params).then((res: any) => {
|
||||||
console.log(res,'res===>');
|
console.log(res,'res===>');
|
||||||
|
|
@ -266,6 +307,7 @@ const onclone = () => {
|
||||||
getList();
|
getList();
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getPostTree();
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="h-layout space-between h-center">
|
<div class="h-layout space-between h-center">
|
||||||
<div>
|
<div>
|
||||||
<div class="h-layout">
|
<div class="h-layout" style="display: flex;align-items: center;">
|
||||||
<div class="tool-item" @click="getList">
|
<div class="tool-item" @click="getList">
|
||||||
<svg-icon name="refurbish" class="icon" />
|
<svg-icon name="refurbish" class="icon" />
|
||||||
<span>刷新</span>
|
<span>刷新</span>
|
||||||
|
|
@ -15,6 +15,19 @@
|
||||||
<svg-icon name="add" class="icon" />
|
<svg-icon name="add" class="icon" />
|
||||||
<span>新增</span>
|
<span>新增</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="label-select filter-tab">
|
||||||
|
<label>岗位</label>
|
||||||
|
<el-tree-select
|
||||||
|
v-model="listperformid"
|
||||||
|
:data="postTree"
|
||||||
|
:render-after-expand="false"
|
||||||
|
check-strictly
|
||||||
|
:filter-node-method="filterPostMethod"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
@change="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 30%">
|
<div style="width: 30%">
|
||||||
|
|
@ -123,6 +136,7 @@ import { useRouter } from "vue-router";
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
import { getListperformPage, performDel } from "@/api/Sys";
|
import { getListperformPage, performDel } from "@/api/Sys";
|
||||||
|
import { userListperformTree } from "@/api/Sys";
|
||||||
import AddOrEdit from "./add-or-edit-post.vue";
|
import AddOrEdit from "./add-or-edit-post.vue";
|
||||||
|
|
||||||
import useUserStore from "@/store/modules/user";
|
import useUserStore from "@/store/modules/user";
|
||||||
|
|
@ -141,6 +155,31 @@ const dialogVisible = ref(false);
|
||||||
const form = ref({});
|
const form = ref({});
|
||||||
const readonly = ref(false);
|
const readonly = ref(false);
|
||||||
|
|
||||||
|
const listperformid = ref('')
|
||||||
|
//组织list
|
||||||
|
const postTree = ref([]);
|
||||||
|
/**筛选组织*/
|
||||||
|
const filterPostMethod = (value, data) => data.label.includes(value);
|
||||||
|
/**
|
||||||
|
* 获取组织
|
||||||
|
*/
|
||||||
|
const getPostTree = () => {
|
||||||
|
userListperformTree().then((res: any) => {
|
||||||
|
if (res.code == 1) postTree.value = handlePostData(res.data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/**处理组织数据 */
|
||||||
|
let handlePostData = (list) => {
|
||||||
|
let data = list.map((item) => {
|
||||||
|
return {
|
||||||
|
label: item.chinaName ? item.performclassname + '-' + item.chinaName :item.performclassname,
|
||||||
|
value: item.listperformid,
|
||||||
|
children: item.children ? handlePostData(item.children) : [],
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
//获取列表
|
//获取列表
|
||||||
const tableDataloading = ref(false);
|
const tableDataloading = ref(false);
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
|
|
@ -151,6 +190,7 @@ const getList = () => {
|
||||||
page: currentPage.value,
|
page: currentPage.value,
|
||||||
state: null,
|
state: null,
|
||||||
unitId: null,
|
unitId: null,
|
||||||
|
listperformid:listperformid.value
|
||||||
};
|
};
|
||||||
getListperformPage(params).then((res: any) => {
|
getListperformPage(params).then((res: any) => {
|
||||||
tableData.value = res.data.list;
|
tableData.value = res.data.list;
|
||||||
|
|
@ -175,6 +215,7 @@ const toDetail = (item: any) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getPostTree();
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
162
src/views/system/base/risk-type/add-or-edit.vue
Normal file
162
src/views/system/base/risk-type/add-or-edit.vue
Normal file
|
|
@ -0,0 +1,162 @@
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
:titleName="
|
||||||
|
readonly ? '隐患类型详情' : props.form.listperformid ? '编辑隐患类型' : '新增隐患类型'
|
||||||
|
"
|
||||||
|
width="50%"
|
||||||
|
@onSubmit="handleSubmit"
|
||||||
|
:footerclosed="true"
|
||||||
|
:diafooter="true"
|
||||||
|
:footerkeepnaem="props.readonly ? false : true"
|
||||||
|
>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-position="right"
|
||||||
|
label-width="100"
|
||||||
|
:disabled="readonly"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="addPostFactorForm"
|
||||||
|
>
|
||||||
|
<el-form-item label="类型名称:" prop="typeName">
|
||||||
|
<el-input
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model="addPostFactorForm.typeName"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="检查频率:" prop="frequency">
|
||||||
|
<!-- <el-input
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model="addPostFactorForm.frequency"
|
||||||
|
>
|
||||||
|
</el-input> -->
|
||||||
|
<el-input-number v-model="addPostFactorForm.frequency" :min="1" :max="1000" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序:" prop="sortId">
|
||||||
|
<!-- <el-input
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model="addPostFactorForm.sortId"
|
||||||
|
></el-input> -->
|
||||||
|
<el-input-number v-model="addPostFactorForm.sortId" :min="1" :max="1000" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" >
|
||||||
|
import { reactive, ref, onMounted, watch } from "vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
|
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||||
|
import { areaTree } from "@/api/account";
|
||||||
|
import { getListperformTree, riskTypeAdd } from "@/api/Sys";
|
||||||
|
|
||||||
|
const areaData = ref([]);
|
||||||
|
const areaProps = ref({
|
||||||
|
label: "orgname",
|
||||||
|
value: "orgcode",
|
||||||
|
children: "children",
|
||||||
|
});
|
||||||
|
|
||||||
|
const postTree = ref([]);
|
||||||
|
const postProps = ref({
|
||||||
|
label: "performclassname",
|
||||||
|
value: "listperformid",
|
||||||
|
});
|
||||||
|
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
const uuid = ref("");
|
||||||
|
const ruleForm = reactive<FormRules>({
|
||||||
|
typeName: [
|
||||||
|
{ required: true, message: "请输入类型名", trigger: "blur" },
|
||||||
|
],
|
||||||
|
sortId:[{ required: true, message: "输入排序", trigger: "blur" }],
|
||||||
|
frequency: [{ required: true, message: "请输入检查频率", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
form: Object,
|
||||||
|
readonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: String,
|
||||||
|
});
|
||||||
|
const listperformid = ref(props.id);
|
||||||
|
const addPostFactorForm = ref(<any>{});
|
||||||
|
const emits = defineEmits(["close", "onSubmit"]);
|
||||||
|
|
||||||
|
//保存并退出
|
||||||
|
const handleSubmit = () => {
|
||||||
|
formRef.value?.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
console.log(addPostFactorForm.value);
|
||||||
|
|
||||||
|
const params = JSON.parse(JSON.stringify(addPostFactorForm.value));
|
||||||
|
riskTypeAdd(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "保存成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
onclone();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
emits("close");
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(val) => {
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.form,
|
||||||
|
(val) => {
|
||||||
|
uuid.value = getUUID();
|
||||||
|
if (val) {
|
||||||
|
if (!props.visible) return;
|
||||||
|
addPostFactorForm.value = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
228
src/views/system/base/risk-type/index.vue
Normal file
228
src/views/system/base/risk-type/index.vue
Normal file
|
|
@ -0,0 +1,228 @@
|
||||||
|
<template>
|
||||||
|
<div class="percentage-content">
|
||||||
|
<div class="content">
|
||||||
|
<div class="h-layout space-between h-center">
|
||||||
|
<div>
|
||||||
|
<div class="h-layout">
|
||||||
|
<div class="tool-item" @click="getList">
|
||||||
|
<svg-icon name="refurbish" class="icon" />
|
||||||
|
<span>刷新</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="tool-item"
|
||||||
|
@click="(dialogVisible = true), (form = {}), (readonly = false)"
|
||||||
|
>
|
||||||
|
<svg-icon name="add" class="icon" />
|
||||||
|
<span>新增</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width: 30%;">
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="search"
|
||||||
|
@keydown.enter.native="getList"
|
||||||
|
placeholder="请输入风险类型名称"
|
||||||
|
class="search-input"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<span @click="getList" class="search-bottom">
|
||||||
|
<svg-icon name="search" class="icon_class" />
|
||||||
|
<span>搜索</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
ref="loading"
|
||||||
|
class="table"
|
||||||
|
v-loading="tableDataloading"
|
||||||
|
:data="tableData"
|
||||||
|
header-row-class-name="el-one-header"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
:resizable="true"
|
||||||
|
width="100"
|
||||||
|
label="序列"
|
||||||
|
type="index"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.$index + 1 + (currentPage - 1) * pageSize }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="typeName"
|
||||||
|
:resizable="true"
|
||||||
|
label="类型名称"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="frequency"
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="检查频率"
|
||||||
|
width="250"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="sortId"
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="排序"
|
||||||
|
width="250"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
width="300"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span
|
||||||
|
class="operate"
|
||||||
|
@click="
|
||||||
|
(dialogVisible = true), (form = scope.row), (readonly = false)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
|
<span class="edit">编辑</span>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="operate"
|
||||||
|
@click="
|
||||||
|
(dialogVisible = true), (form = scope.row), (readonly = true)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
|
<span class="detail">详情</span>
|
||||||
|
</span>
|
||||||
|
<span class="operate" @click="clickDelete(scope.row.typeId)">
|
||||||
|
<svg-icon name="delete" class="icon"></svg-icon>
|
||||||
|
<span class="delete">删除</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<el-pagination
|
||||||
|
class="pagination"
|
||||||
|
@size-change="getList"
|
||||||
|
@current-change="getList"
|
||||||
|
v-model:current-page.sync="currentPage"
|
||||||
|
:page-sizes="[10, 15, 20, 30]"
|
||||||
|
v-model:page-size.sync="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total"
|
||||||
|
background
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
<!-- 新增/修改 -->
|
||||||
|
<AddOrEdit
|
||||||
|
:visible="dialogVisible"
|
||||||
|
:form="form"
|
||||||
|
:readonly="readonly"
|
||||||
|
@close="onclone"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { onMounted, reactive, ref } from "vue";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
import { riskTypePage, riskTypeDel } from "@/api/Sys";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import AddOrEdit from "./add-or-edit.vue";
|
||||||
|
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
|
||||||
|
const search = ref([]);
|
||||||
|
const tableData = ref([]);
|
||||||
|
const currentPage = ref(1);
|
||||||
|
const pageSize = ref(10);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const form = ref({});
|
||||||
|
const readonly = ref(false);
|
||||||
|
|
||||||
|
//获取列表
|
||||||
|
const tableDataloading = ref(false);
|
||||||
|
const getList = () => {
|
||||||
|
tableDataloading.value = true;
|
||||||
|
let params = {
|
||||||
|
condition: search.value,
|
||||||
|
limit: pageSize.value,
|
||||||
|
page: currentPage.value,
|
||||||
|
state: null,
|
||||||
|
unitId: null,
|
||||||
|
};
|
||||||
|
riskTypePage(params).then((res: any) => {
|
||||||
|
tableData.value = res.data.list;
|
||||||
|
total.value = res.data.total;
|
||||||
|
tableDataloading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const clickDelete = (listperformid)=>{
|
||||||
|
console.log(listperformid);
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||||
|
confirmButtonText: "是",
|
||||||
|
cancelButtonText: "否",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
riskTypeDel(listperformid).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "删除成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//关闭新增弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
form.value = {};
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 0.26042vw;
|
||||||
|
box-shadow: 0 0 0.41667vw 0 rgb(8 33 85 / 10%);
|
||||||
|
height: 100%;
|
||||||
|
padding: 0.83333vw;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.table {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
171
src/views/system/base/role/apiSelection.vue
Normal file
171
src/views/system/base/role/apiSelection.vue
Normal file
|
|
@ -0,0 +1,171 @@
|
||||||
|
<template>
|
||||||
|
<BaseDialog :dialogVisible="props.visible" @close="onclone" :titleName="'接口授权'" width="50%" @onSubmit="handleSubmit"
|
||||||
|
:footerclosed="true" :diafooter="true">
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-tree
|
||||||
|
:data="data.value"
|
||||||
|
show-checkbox
|
||||||
|
node-key="apiId"
|
||||||
|
ref="tree"
|
||||||
|
:props="defaultProps"
|
||||||
|
:default-checked-keys="defaultCheckedKeys"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang='ts'>
|
||||||
|
import { reactive, ref, onMounted, watch } from "vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { getRoleApiTree, roleApiAdd, resourceTree } from "@/api/Sys";
|
||||||
|
import { ElMessageBox } from "element-plus";
|
||||||
|
const emits = defineEmits(["close"]);
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: String,
|
||||||
|
});
|
||||||
|
const tree = ref();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
|
||||||
|
const data = reactive([]);
|
||||||
|
|
||||||
|
const defaultProps = {
|
||||||
|
children: "resourceIfs",
|
||||||
|
apiId: "apiId",
|
||||||
|
label: "name",
|
||||||
|
selected: "checkState",
|
||||||
|
};
|
||||||
|
|
||||||
|
const defaultCheckedKeys = ref([]);
|
||||||
|
|
||||||
|
const getRoleResourceTreeList = () => {
|
||||||
|
getRoleApiTree({ roleId: props.id }).then((res: any) => {
|
||||||
|
// 过滤出包含 resourceIfs 子节点的数据,并处理子节点
|
||||||
|
data.value = res.data
|
||||||
|
.filter(item => item.resourceIfs && item.resourceIfs.length > 0)
|
||||||
|
.map(item => {
|
||||||
|
const newItem = { ...item }; // 浅拷贝原对象
|
||||||
|
newItem.resourceIfs = newItem.resourceIfs.map(resource => {
|
||||||
|
const newResource = { ...resource }; // 浅拷贝资源对象
|
||||||
|
newResource.name = newResource.apiName; // 添加 name 字段,并赋值 apiName
|
||||||
|
return newResource;
|
||||||
|
});
|
||||||
|
return newItem;
|
||||||
|
});
|
||||||
|
dfsChecked(data.value);
|
||||||
|
console.log(data.value, defaultCheckedKeys, "data.value");
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 递归选中
|
||||||
|
const dfsChecked = (arr) => {
|
||||||
|
if (arr && arr.length > 0) {
|
||||||
|
arr.forEach((item) => {
|
||||||
|
if (item.resourceIfs && item.resourceIfs.length > 0) {
|
||||||
|
dfsChecked(item.resourceIfs);
|
||||||
|
} else if (item.checkState == 1) {
|
||||||
|
defaultCheckedKeys.value.push(item.apiId);
|
||||||
|
} else return;
|
||||||
|
});
|
||||||
|
} else return;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = () => {
|
||||||
|
ElMessageBox.confirm("是否确认添加?", "提示", {
|
||||||
|
confirmButtonText: "是",
|
||||||
|
cancelButtonText: "否",
|
||||||
|
type: "success",
|
||||||
|
}).then(() => {
|
||||||
|
let apiId = [];
|
||||||
|
let trees = tree.value.getCheckedNodes();
|
||||||
|
console.log(trees);
|
||||||
|
trees.forEach((item) => {
|
||||||
|
apiId.push(item.apiId);
|
||||||
|
});
|
||||||
|
let params = {
|
||||||
|
apiId: apiId.join(','),
|
||||||
|
roleId: props.id,
|
||||||
|
userId: userId.value,
|
||||||
|
};
|
||||||
|
let token = localStorage.getItem("token");
|
||||||
|
roleApiAdd(params, token).then((res: any) => {
|
||||||
|
console.log(res, "res=========>");
|
||||||
|
|
||||||
|
// data.value = res.data
|
||||||
|
// console.log(data.value, 'data=========>');
|
||||||
|
});
|
||||||
|
emits("close");
|
||||||
|
data.value = [];
|
||||||
|
defaultCheckedKeys.value = [];
|
||||||
|
tree.value = [];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
emits("close");
|
||||||
|
data.value = [];
|
||||||
|
defaultCheckedKeys.value = [];
|
||||||
|
tree.value = [];
|
||||||
|
};
|
||||||
|
|
||||||
|
const getResourceTree = () => {
|
||||||
|
resourceTree({ roleId: props.id }).then((res: any) => {
|
||||||
|
data.value = res.data;
|
||||||
|
dfsChecked(res.data);
|
||||||
|
console.log(data.value, defaultCheckedKeys, "data.value");
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => { });
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.id,
|
||||||
|
(val) => {
|
||||||
|
console.log(val, "val=====>");
|
||||||
|
getRoleResourceTreeList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
() => {
|
||||||
|
getRoleResourceTreeList();
|
||||||
|
data.value = [];
|
||||||
|
defaultCheckedKeys.value = [];
|
||||||
|
tree.value = [];
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.tree-view {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.parent-node {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.parent-label {
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.parent-label span {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.children-nodes {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.child-node {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
<el-table-column type="index" align="center" label="序列" width="60"></el-table-column>
|
<el-table-column type="index" align="center" label="序列" width="60"></el-table-column>
|
||||||
<el-table-column prop="rolename" :resizable="true" align="center" label="角色名称">
|
<el-table-column prop="rolename" :resizable="true" align="center" label="角色名称">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :resizable="true" align="center" width="300" label="操作">
|
<el-table-column :resizable="true" align="center" width="350" label="操作">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span class="operate" @click="(dialogVisible = true),(form = scope.row), (readonly = false)">
|
<span class="operate" @click="(dialogVisible = true),(form = scope.row), (readonly = false)">
|
||||||
<svg-icon name="edit" class="icon"></svg-icon>
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
|
|
@ -45,6 +45,10 @@
|
||||||
<svg-icon name="detail" class="icon"></svg-icon>
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
<span class="detail">功能</span>
|
<span class="detail">功能</span>
|
||||||
</span>
|
</span>
|
||||||
|
<span class="operate" @click="(apiVisible = true),(funId = scope.row.sysroleid)">
|
||||||
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
|
<span class="detail">接口</span>
|
||||||
|
</span>
|
||||||
<span class="operate" @click="deletelist(scope.row.sysroleid)">
|
<span class="operate" @click="deletelist(scope.row.sysroleid)">
|
||||||
<svg-icon name="delete" class="icon"></svg-icon>
|
<svg-icon name="delete" class="icon"></svg-icon>
|
||||||
<span class="func">删除</span>
|
<span class="func">删除</span>
|
||||||
|
|
@ -60,6 +64,7 @@
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
<Adddetails :visible="dialogVisible" :form="form" :readonly="readonly" @close="onclone" />
|
<Adddetails :visible="dialogVisible" :form="form" :readonly="readonly" @close="onclone" />
|
||||||
<funSelection :visible="funVisible" :id="funId" @close="funOnclone" />
|
<funSelection :visible="funVisible" :id="funId" @close="funOnclone" />
|
||||||
|
<ApiSelection :visible="apiVisible" :id="funId" @close="apiOnclone" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -69,6 +74,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
import { getSysrolePage, delSysrole } from "@/api/Sys";
|
import { getSysrolePage, delSysrole } from "@/api/Sys";
|
||||||
import Adddetails from "./details.vue";
|
import Adddetails from "./details.vue";
|
||||||
import funSelection from "./funSelection.vue";
|
import funSelection from "./funSelection.vue";
|
||||||
|
import ApiSelection from "./apiSelection.vue";
|
||||||
import useUserStore from "@/store/modules/user";
|
import useUserStore from "@/store/modules/user";
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const user = ref(JSON.parse(userStore.userInfo));
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
|
@ -81,6 +87,7 @@ const total = ref(0);
|
||||||
|
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
const funVisible = ref(false);
|
const funVisible = ref(false);
|
||||||
|
const apiVisible = ref(false);
|
||||||
const form = ref({});
|
const form = ref({});
|
||||||
const funId = ref('');
|
const funId = ref('');
|
||||||
const readonly = ref(false);
|
const readonly = ref(false);
|
||||||
|
|
@ -139,6 +146,10 @@ const funOnclone = () => {
|
||||||
funVisible.value = false;
|
funVisible.value = false;
|
||||||
getList();
|
getList();
|
||||||
};
|
};
|
||||||
|
const apiOnclone = () => {
|
||||||
|
apiVisible.value = false;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
358
src/views/work-dynamic/components/Add.vue
Normal file
358
src/views/work-dynamic/components/Add.vue
Normal file
|
|
@ -0,0 +1,358 @@
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
:titleName="props.form.dynamicsId ? '编辑' + props.tabsTitle : '新增' + props.tabsTitle"
|
||||||
|
width="50%"
|
||||||
|
@onSubmit="handleSubmit"
|
||||||
|
:footerclosed="true"
|
||||||
|
:diafooter="true"
|
||||||
|
:footerkeepnaem="props.readonly ? false : true"
|
||||||
|
>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-position="right"
|
||||||
|
label-width="150px"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="form"
|
||||||
|
>
|
||||||
|
<el-form-item label="动态标题:" prop="title" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
:disabled="props.readonly"
|
||||||
|
placeholder="请输入动态标题"
|
||||||
|
v-model="form.title"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="动态内容:" prop="detail" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
:disabled="props.readonly"
|
||||||
|
placeholder="请输入动态内容"
|
||||||
|
v-model="form.detail"
|
||||||
|
:rows="3"
|
||||||
|
type="textarea"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="时间:" prop="time">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="props.readonly"
|
||||||
|
v-model="form.time"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工作附件:" style="width: 100%;">
|
||||||
|
<el-upload
|
||||||
|
class="avatar-uploader"
|
||||||
|
ref="uploadAfter"
|
||||||
|
action="#"
|
||||||
|
list-type="upload-demo"
|
||||||
|
:file-list="afterList"
|
||||||
|
:http-request="handleUploadAfter"
|
||||||
|
>
|
||||||
|
<el-icon class="avatar-uploader-icon" :size="40">
|
||||||
|
<Plus />
|
||||||
|
</el-icon>
|
||||||
|
<template #file="{ file }">
|
||||||
|
<div>
|
||||||
|
<span class="el-upload-list__item-actions">
|
||||||
|
<span class="el-upload-list__item-preview">
|
||||||
|
<el-icon>
|
||||||
|
<Document />
|
||||||
|
</el-icon>
|
||||||
|
<span>{{ file.realfilename }}</span>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleInfo(file)"
|
||||||
|
>
|
||||||
|
<el-icon><zoom-in /></el-icon>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleDownload(file)"
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<Download />
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleRemove(file)"
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<Delete />
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-dialog v-model="upVisible">
|
||||||
|
<img style="width: 100%;" w-full :src="upImageUrl" alt="Preview Image" />
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts" >
|
||||||
|
import { reactive, ref, onMounted, watch, getCurrentInstance } from "vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { ElMessage, FormInstance, FormRules, valueEquals } from "element-plus";
|
||||||
|
import type { UploadUserFile } from "element-plus";
|
||||||
|
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||||
|
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||||
|
import { getListperformTree } from "@/api/Sys";
|
||||||
|
import { wkDynamicsAdd } from "@/api/Work";
|
||||||
|
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
const uuid = ref(getUUID());
|
||||||
|
const ruleForm = reactive<FormRules>({
|
||||||
|
detail: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入动态内容",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
processedBy: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入处理人",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
time: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请选择时间",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
title:[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入动态标题",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
});
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
form: Object,
|
||||||
|
readonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
typeId: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
tabsTitle:{
|
||||||
|
type: String,
|
||||||
|
default:"",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const form = ref(<any>{});
|
||||||
|
const emits = defineEmits(["close", "onSubmit"]);
|
||||||
|
//保存并退出
|
||||||
|
const handleSubmit = () => {
|
||||||
|
formRef.value?.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let params = {
|
||||||
|
dynamicsId: form.value.dynamicsId || uuid.value,
|
||||||
|
detail: form.value.detail,
|
||||||
|
title: form.value.title,
|
||||||
|
typeId: props.typeId,
|
||||||
|
userId: form.value.userId || userId.value,
|
||||||
|
startTime: form.value.time[0],
|
||||||
|
endTime: form.value.time[1],
|
||||||
|
filePath:afterList.value.length > 0 ? afterList.value[0].filepath:'',
|
||||||
|
};
|
||||||
|
wkDynamicsAdd(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "保存成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
onclone();
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 文件上传
|
||||||
|
const afterList = ref<UploadUserFile[]>([]);
|
||||||
|
const handleUploadAfter = (file: any) => {
|
||||||
|
// if (afterList.value.length != 0) {
|
||||||
|
// ElMessage.error("只能上传一份文件!");
|
||||||
|
// getCheckDangers(form.value.dynamicsId || uuid.value);
|
||||||
|
// } else {
|
||||||
|
// }
|
||||||
|
const newFile = new FormData();
|
||||||
|
newFile.append("file", file.file);
|
||||||
|
uploadFile(userId.value, form.value.dynamicsId || uuid.value, FileType.resumptionAcs, newFile).then((res) => {
|
||||||
|
if (res) {
|
||||||
|
ElMessage.success("上传成功!");
|
||||||
|
getCheckDangers(form.value.dynamicsId || uuid.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
};
|
||||||
|
//文件显示
|
||||||
|
const baseImgUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||||
|
const getCheckDangers = (id) => {
|
||||||
|
getFile(
|
||||||
|
id,
|
||||||
|
FileType.resumptionAcs
|
||||||
|
).then((res: any) => {
|
||||||
|
afterList.value = res.data.map(item => {
|
||||||
|
let arr = item;
|
||||||
|
let index = item.filepath.indexOf(".");//获取第一个"_"的位置
|
||||||
|
let after1 = item.filepath.substring(index + 1);
|
||||||
|
switch (after1) {
|
||||||
|
case 'xlsx':
|
||||||
|
arr.url = 'src/assets/images/exl.png';
|
||||||
|
break;
|
||||||
|
case 'exl':
|
||||||
|
arr.url = 'src/assets/images/exl.png';
|
||||||
|
break;
|
||||||
|
case 'pdf':
|
||||||
|
arr.url = 'src/assets/images/pdf.png';
|
||||||
|
break;
|
||||||
|
case 'word':
|
||||||
|
arr.url = 'src/assets/images/word.png';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
arr.url = baseImgUrl.value + item.filepath;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
};
|
||||||
|
//删除附件
|
||||||
|
const handleRemove = (file) => {
|
||||||
|
delFile(file.sysdocumentid).then((res: any) => {
|
||||||
|
if (res) {
|
||||||
|
ElMessage.success("删除成功!");
|
||||||
|
}
|
||||||
|
getCheckDangers(form.value.dynamicsId || uuid.value);
|
||||||
|
})
|
||||||
|
};
|
||||||
|
//下载附件
|
||||||
|
const handleDownload = (file) => {
|
||||||
|
function text() {
|
||||||
|
const x = new XMLHttpRequest();
|
||||||
|
x.open("GET", baseImgUrl.value + file.filepath, true);
|
||||||
|
x.responseType = "blob";
|
||||||
|
x.onload = function () {
|
||||||
|
const url = window.URL.createObjectURL(x.response);
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = file.name;
|
||||||
|
a.click();
|
||||||
|
};
|
||||||
|
x.send();
|
||||||
|
}
|
||||||
|
let index = file.filepath.indexOf("."); //获取第一个"_"的位置
|
||||||
|
let after1 = file.filepath.substring(index + 1);
|
||||||
|
switch (after1) {
|
||||||
|
case "xlsx":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "exl":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "pdf":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "word":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
window.open(baseImgUrl.value + file.filepath, "_blank");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const upVisible = ref(false);
|
||||||
|
const upImageUrl = ref("");
|
||||||
|
//查看附件
|
||||||
|
const handleInfo = (file) => {
|
||||||
|
upImageUrl.value = file.url!;
|
||||||
|
upVisible.value = true;
|
||||||
|
};
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
afterList.value = [];
|
||||||
|
form.value = {};
|
||||||
|
emits("close");
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {});
|
||||||
|
watch(
|
||||||
|
() => props.form.dynamicsId,
|
||||||
|
(val) => {
|
||||||
|
uuid.value = getUUID();
|
||||||
|
if (val) {
|
||||||
|
form.value = props.form;
|
||||||
|
form.value.time = [form.value.startTime, form.value.endTime];
|
||||||
|
getCheckDangers(form.value.dynamicsId || uuid.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
// justify-content: space-around;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
::v-deep(.el-upload-list__item-actions) {
|
||||||
|
display: flex;
|
||||||
|
> span:nth-child(2) {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep(.el-upload-list__item-preview) {
|
||||||
|
margin-right: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
> span {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep(.avatar-uploader-icon) {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
366
src/views/work-dynamic/index.vue
Normal file
366
src/views/work-dynamic/index.vue
Normal file
|
|
@ -0,0 +1,366 @@
|
||||||
|
<template>
|
||||||
|
<div class="percentage-content">
|
||||||
|
<el-radio-group class="rg" v-model="tabIndex" @change="clickRadio">
|
||||||
|
<template v-for="item in tabs" :key="item.sortId">
|
||||||
|
<el-radio-button :label="item.sortId">{{
|
||||||
|
item.typeName
|
||||||
|
}}</el-radio-button>
|
||||||
|
</template>
|
||||||
|
</el-radio-group>
|
||||||
|
<div class="content">
|
||||||
|
<div class="h-layout space-between h-center">
|
||||||
|
<div>
|
||||||
|
<div class="h-layout h-center">
|
||||||
|
<div class="tool-item" @click="getList">
|
||||||
|
<svg-icon name="refurbish" class="icon" />
|
||||||
|
<span>刷新</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="tool-item"
|
||||||
|
@click="(dialogVisible = true), (form = {}), (readonly = false)"
|
||||||
|
>
|
||||||
|
<svg-icon name="add" class="icon" />
|
||||||
|
<span>新增</span>
|
||||||
|
</div>
|
||||||
|
<div class="tool-item" @click="fileExport">
|
||||||
|
<svg-icon name="export" class="icon" />
|
||||||
|
<span>导出</span>
|
||||||
|
</div>
|
||||||
|
<div class="label-select filter-tab">
|
||||||
|
<label>岗位</label>
|
||||||
|
<el-cascader
|
||||||
|
@change="getList"
|
||||||
|
ref="cascader"
|
||||||
|
v-model="search.postId"
|
||||||
|
placeholder="请选择岗位"
|
||||||
|
:options="postTree"
|
||||||
|
:props="{
|
||||||
|
checkStrictly: true,
|
||||||
|
label: 'performclassname',
|
||||||
|
value: 'listperformid',
|
||||||
|
}"
|
||||||
|
clearable
|
||||||
|
style="width: 300px;"
|
||||||
|
></el-cascader>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width: 30%;">
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="search.condition"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
class="search-input"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<span class="search-bottom" @click="getList">
|
||||||
|
<svg-icon name="search" class="icon_class" />
|
||||||
|
<span>搜索</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
ref="loading"
|
||||||
|
class="table"
|
||||||
|
v-loading="tableDataloading"
|
||||||
|
:data="tableData"
|
||||||
|
header-row-class-name="el-one-header"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
:resizable="true"
|
||||||
|
width="100"
|
||||||
|
label="序列"
|
||||||
|
type="index"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.$index + 1 + (currentPage - 1) * pageSize }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="动态标题"
|
||||||
|
width="150"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="detail"
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="动态内容"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="startTime"
|
||||||
|
align="center"
|
||||||
|
label="开始时间"
|
||||||
|
width="190"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="endTime"
|
||||||
|
align="center"
|
||||||
|
label="结束时间"
|
||||||
|
width="190"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="chinaName"
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="发布人"
|
||||||
|
width="120"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="postName"
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label=" 发布人岗位"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
width="300"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<!-- <span
|
||||||
|
class="operate"
|
||||||
|
@click="(dialogVisible = true), (form = scope.row),(readonly = false)"
|
||||||
|
>
|
||||||
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
|
<span class="edit">编辑</span>
|
||||||
|
</span> -->
|
||||||
|
<span
|
||||||
|
class="operate"
|
||||||
|
@click="
|
||||||
|
(form = scope.row), (dialogVisible = true), (readonly = true)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
|
<span class="detail">详情</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span class="operate" @click="deletelist(scope.row)">
|
||||||
|
<svg-icon name="delete" class="icon"></svg-icon>
|
||||||
|
<span class="func">删除</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<el-pagination
|
||||||
|
class="pagination"
|
||||||
|
v-model:current-page.sync="currentPage"
|
||||||
|
:page-sizes="[10, 15, 20, 30]"
|
||||||
|
v-model:page-size.sync="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total"
|
||||||
|
background
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
<!-- 新增 -->
|
||||||
|
<Add
|
||||||
|
:visible="dialogVisible"
|
||||||
|
:form="form"
|
||||||
|
:readonly="readonly"
|
||||||
|
@close="onclone"
|
||||||
|
:typeId="typeId"
|
||||||
|
:tabsTitle="tabsTitle"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { onMounted, reactive, ref } from "vue";
|
||||||
|
import Add from "./components/add.vue";
|
||||||
|
import { ElMessageBox, ElMessage } from "element-plus";
|
||||||
|
import { wkTypes, wkDynamicsAllPage, deleteWork } from "@/api/Work";
|
||||||
|
import { exportFileRequest } from "@/api/export";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { areaTree } from "@/api/account";
|
||||||
|
import { getListperformTree } from "@/api/Sys";
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
|
||||||
|
const tabIndex = ref(0);
|
||||||
|
const tabs = ref([{ typeName: "常规工作", sortId: 1 }]);
|
||||||
|
|
||||||
|
const search = ref({});
|
||||||
|
const currentPage = ref(1);
|
||||||
|
const pageSize = ref(10);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
|
const readonly = ref(false);
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const form = ref({});
|
||||||
|
|
||||||
|
//获取列表
|
||||||
|
const tableDataloading = ref(false);
|
||||||
|
const tableData = ref([
|
||||||
|
{ cName: "xxx村名", name: "村长名称", phone: "村长电话" },
|
||||||
|
]);
|
||||||
|
const getWkDynamicsPage = () => {
|
||||||
|
tableDataloading.value = true;
|
||||||
|
let params = {
|
||||||
|
userId: userId.value,
|
||||||
|
limit: pageSize.value,
|
||||||
|
page: currentPage.value,
|
||||||
|
typeId: typeId.value,
|
||||||
|
condition: search.value.condition,
|
||||||
|
postId: "",
|
||||||
|
};
|
||||||
|
if (search.value.postId) {
|
||||||
|
params.postId = search.value.postId[search.value.postId.length - 1];
|
||||||
|
}
|
||||||
|
wkDynamicsAllPage(params).then((res: any) => {
|
||||||
|
console.log(res, "res==>");
|
||||||
|
tableData.value = res.data.list;
|
||||||
|
total.value = res.data.total;
|
||||||
|
tableDataloading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//弹窗标题
|
||||||
|
const tabsTitle = ref("");
|
||||||
|
//头部点击取id
|
||||||
|
const clickRadio = () => {
|
||||||
|
tabs.value.forEach((item) => {
|
||||||
|
if (item.sortId == tabIndex.value) {
|
||||||
|
typeId.value = item.typeId;
|
||||||
|
tabsTitle.value = item.typeName;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
//关闭新增弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
form.value = {};
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
//工作类型
|
||||||
|
const typeId = ref("");
|
||||||
|
const getWkTypes = () => {
|
||||||
|
let params = {
|
||||||
|
classify: 2,
|
||||||
|
};
|
||||||
|
wkTypes(params).then((res: any) => {
|
||||||
|
tabs.value = res.data;
|
||||||
|
typeId.value = res.data[0].typeId;
|
||||||
|
tabsTitle.value = res.data[0].typeName;
|
||||||
|
tabIndex.value = 1;
|
||||||
|
getWkDynamicsPage();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//删除
|
||||||
|
const deletelist = (data) => {
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||||
|
confirmButtonText: "是",
|
||||||
|
cancelButtonText: "否",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
let params = {
|
||||||
|
workId: data.dynamicsId,
|
||||||
|
classify: 2,
|
||||||
|
};
|
||||||
|
deleteWork(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "删除成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//获取地区
|
||||||
|
const postTree = ref([]);
|
||||||
|
const getListperformTrees = () => {
|
||||||
|
getListperformTree().then((res: any) => {
|
||||||
|
console.log(res.data, "res.data===>");
|
||||||
|
|
||||||
|
postTree.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//刷新
|
||||||
|
const getList = () => {
|
||||||
|
currentPage.value = 1;
|
||||||
|
getWkDynamicsPage();
|
||||||
|
};
|
||||||
|
//导出
|
||||||
|
const fileExport = () => {
|
||||||
|
const params = {
|
||||||
|
userId: userId.value,
|
||||||
|
postId: "",
|
||||||
|
condition: search.value.condition,
|
||||||
|
startTime: "",
|
||||||
|
endTime: "",
|
||||||
|
typeId: typeId.value,
|
||||||
|
};
|
||||||
|
if (search.value.postId) {
|
||||||
|
params.postId = search.value.postId[search.value.postId.length - 1];
|
||||||
|
}
|
||||||
|
let name = tabsTitle.value;
|
||||||
|
exportFileRequest(
|
||||||
|
`/admin/export/exportWorkDynamic`,
|
||||||
|
`${name}统计.xlsx`,
|
||||||
|
params
|
||||||
|
).then((res) => {});
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
getWkTypes();
|
||||||
|
getListperformTrees();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.percentage-content {
|
||||||
|
height: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.rg {
|
||||||
|
padding: 16px;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 0 6px rgb(0 120 255 / 10%);
|
||||||
|
border-radius: 6px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
:deep(.el-radio-button__inner) {
|
||||||
|
min-width: 150px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 0.26042vw;
|
||||||
|
box-shadow: 0 0 0.41667vw 0 rgb(8 33 85 / 10%);
|
||||||
|
height: 100%;
|
||||||
|
padding: 0.83333vw;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.table {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属组织:" prop="listperformid">
|
<el-form-item v-if="!props.readonly" label="所属组织:" prop="listperformid">
|
||||||
<el-tree-select
|
<el-tree-select
|
||||||
:disabled="props.readonly"
|
:disabled="props.readonly"
|
||||||
v-model="form.listperformid"
|
v-model="form.listperformid"
|
||||||
|
|
@ -50,6 +50,7 @@
|
||||||
check-strictly
|
check-strictly
|
||||||
:filter-node-method="filterPostMethod"
|
:filter-node-method="filterPostMethod"
|
||||||
filterable
|
filterable
|
||||||
|
multiple
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工作附件:" style="width: 100%;">
|
<el-form-item label="工作附件:" style="width: 100%;">
|
||||||
|
|
@ -74,6 +75,7 @@
|
||||||
<span>{{ file.realfilename }}</span>
|
<span>{{ file.realfilename }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
|
v-if="file.types === 'png'"
|
||||||
class="el-upload-list__item-preview"
|
class="el-upload-list__item-preview"
|
||||||
@click="handleInfo(file)"
|
@click="handleInfo(file)"
|
||||||
>
|
>
|
||||||
|
|
@ -117,6 +119,7 @@
|
||||||
<el-table-column type="index" align="center" label="序号" width="80"/>
|
<el-table-column type="index" align="center" label="序号" width="80"/>
|
||||||
<el-table-column prop="chinaName" align="center" label="接收人姓名" />
|
<el-table-column prop="chinaName" align="center" label="接收人姓名" />
|
||||||
<el-table-column prop="postName" align="center" label="接收人岗位" />
|
<el-table-column prop="postName" align="center" label="接收人岗位" />
|
||||||
|
<el-table-column prop="workContent" align="center" label="工作内容" />
|
||||||
<el-table-column prop="workState" align="center" label="工作状态" >
|
<el-table-column prop="workState" align="center" label="工作状态" >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span class="notViewed" v-if="scope.row.workState==1">未查看</span>
|
<span class="notViewed" v-if="scope.row.workState==1">未查看</span>
|
||||||
|
|
@ -124,9 +127,19 @@
|
||||||
<span class="completed" v-if="scope.row.workState==3">已完成</span>
|
<span class="completed" v-if="scope.row.workState==3">已完成</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="附件" >
|
||||||
|
<template #default="scope">
|
||||||
|
<span style="cursor: pointer;color: #1a7eed;" @click="(dialogVisible = true), (id = scope.row.wkUserId)">查看</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
|
<Fujian
|
||||||
|
:visible="dialogVisible"
|
||||||
|
@close="onclones"
|
||||||
|
:id="id"
|
||||||
|
></Fujian>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" >
|
<script setup lang="ts" >
|
||||||
import { reactive, ref, onMounted, watch, getCurrentInstance } from "vue";
|
import { reactive, ref, onMounted, watch, getCurrentInstance } from "vue";
|
||||||
|
|
@ -135,8 +148,17 @@ import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
import type { UploadUserFile } from "element-plus";
|
import type { UploadUserFile } from "element-plus";
|
||||||
import { getYears, getUUID, FileType } from "@/utils/common";
|
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||||
import { uploadFile, getFile, delFile } from "@/api/file";
|
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||||
import { getListperformTree } from "@/api/Sys";
|
import { userListperformTree } from "@/api/Sys";
|
||||||
import { workAdd,workDetail } from "@/api/Work";
|
import { workAdd,workDetail } from "@/api/Work";
|
||||||
|
import Fujian from "./Fujian.vue";
|
||||||
|
|
||||||
|
//新增弹窗
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const id = ref('');
|
||||||
|
//关闭新增弹窗
|
||||||
|
const onclones = () => {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
const formRef = ref<FormInstance>();
|
const formRef = ref<FormInstance>();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
@ -201,7 +223,7 @@ const filterPostMethod = (value, data) => data.label.includes(value);
|
||||||
* 获取组织
|
* 获取组织
|
||||||
*/
|
*/
|
||||||
const getPostTree = () => {
|
const getPostTree = () => {
|
||||||
getListperformTree({}).then((res: any) => {
|
userListperformTree().then((res: any) => {
|
||||||
if (res.code == 1) postTree.value = handlePostData(res.data);
|
if (res.code == 1) postTree.value = handlePostData(res.data);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -209,8 +231,8 @@ const getPostTree = () => {
|
||||||
let handlePostData = (list) => {
|
let handlePostData = (list) => {
|
||||||
let data = list.map((item) => {
|
let data = list.map((item) => {
|
||||||
return {
|
return {
|
||||||
label: item.performclassname,
|
label: item.chinaName ? item.performclassname + '-' + item.chinaName :item.performclassname,
|
||||||
value: item.listperformid,
|
value: item.userId,
|
||||||
children: item.children ? handlePostData(item.children) : [],
|
children: item.children ? handlePostData(item.children) : [],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
@ -223,7 +245,7 @@ const handleSubmit = () => {
|
||||||
let params = {
|
let params = {
|
||||||
workId: form.value.workId || uuid.value,
|
workId: form.value.workId || uuid.value,
|
||||||
title: form.value.title,
|
title: form.value.title,
|
||||||
listperformid: form.value.listperformid,
|
listperformid: form.value.listperformid.join(','),
|
||||||
typeId: props.typeId,
|
typeId: props.typeId,
|
||||||
userId: form.value.userId || userId.value,
|
userId: form.value.userId || userId.value,
|
||||||
startTime: form.value.time[0],
|
startTime: form.value.time[0],
|
||||||
|
|
@ -291,6 +313,7 @@ const getCheckDangers = (id) => {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
arr.url = baseImgUrl.value + item.filepath;
|
arr.url = baseImgUrl.value + item.filepath;
|
||||||
|
arr.types = 'png';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return arr;
|
return arr;
|
||||||
|
|
@ -316,7 +339,7 @@ const handleDownload = (file) => {
|
||||||
const url = window.URL.createObjectURL(x.response);
|
const url = window.URL.createObjectURL(x.response);
|
||||||
const a = document.createElement("a");
|
const a = document.createElement("a");
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = file.name;
|
a.download = file.realfilename;
|
||||||
a.click();
|
a.click();
|
||||||
};
|
};
|
||||||
x.send();
|
x.send();
|
||||||
|
|
@ -352,6 +375,7 @@ const handleInfo = (file) => {
|
||||||
const onclone = () => {
|
const onclone = () => {
|
||||||
afterList.value = [];
|
afterList.value = [];
|
||||||
form.value = {};
|
form.value = {};
|
||||||
|
uuid.value = getUUID();
|
||||||
emits("close");
|
emits("close");
|
||||||
};
|
};
|
||||||
//获取列表
|
//获取列表
|
||||||
|
|
|
||||||
192
src/views/work-manage/components/Fujian.vue
Normal file
192
src/views/work-manage/components/Fujian.vue
Normal file
|
|
@ -0,0 +1,192 @@
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
:titleName="'附件列表'"
|
||||||
|
width="50%"
|
||||||
|
:footerclosed="true"
|
||||||
|
:diafooter="true"
|
||||||
|
:footerkeepnaem="false"
|
||||||
|
>
|
||||||
|
<div v-for="(item,index) in afterList" :key="index">
|
||||||
|
<div>
|
||||||
|
<span class="el-upload-list__item-actions">
|
||||||
|
<span class="el-upload-list__item-preview">
|
||||||
|
<el-icon>
|
||||||
|
<Document />
|
||||||
|
</el-icon>
|
||||||
|
<span>{{ item.realfilename }}</span>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="item.types === 'png'"
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleInfo(item)"
|
||||||
|
>
|
||||||
|
<el-icon><zoom-in /></el-icon>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleDownload(item)"
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<Download />
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-empty v-if="afterList.length === 0" description="暂无附件" />
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts" >
|
||||||
|
import { reactive, ref, onMounted, watch, getCurrentInstance } from "vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
|
import type { UploadUserFile } from "element-plus";
|
||||||
|
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||||
|
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||||
|
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
const uuid = ref(getUUID());
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: String,
|
||||||
|
});
|
||||||
|
const form = ref(<any>{});
|
||||||
|
const emits = defineEmits(["close", "onSubmit"]);
|
||||||
|
//文件显示
|
||||||
|
const baseImgUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||||
|
const afterList = ref([])
|
||||||
|
const getCheckDangers = (id) => {
|
||||||
|
getFile(
|
||||||
|
id,
|
||||||
|
FileType.WorkFile
|
||||||
|
).then((res: any) => {
|
||||||
|
afterList.value = res.data.map(item => {
|
||||||
|
let arr = item;
|
||||||
|
let index = item.filepath.indexOf(".");//获取第一个"_"的位置
|
||||||
|
let after1 = item.filepath.substring(index + 1);
|
||||||
|
switch (after1) {
|
||||||
|
case 'xlsx':
|
||||||
|
arr.url = 'src/assets/images/exl.png';
|
||||||
|
break;
|
||||||
|
case 'exl':
|
||||||
|
arr.url = 'src/assets/images/exl.png';
|
||||||
|
break;
|
||||||
|
case 'pdf':
|
||||||
|
arr.url = 'src/assets/images/pdf.png';
|
||||||
|
break;
|
||||||
|
case 'word':
|
||||||
|
arr.url = 'src/assets/images/word.png';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
arr.url = baseImgUrl.value + item.filepath;
|
||||||
|
arr.types = 'png'
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
};
|
||||||
|
//下载附件
|
||||||
|
const handleDownload = (file) => {
|
||||||
|
function text() {
|
||||||
|
const x = new XMLHttpRequest();
|
||||||
|
x.open("GET", baseImgUrl.value + file.filepath, true);
|
||||||
|
x.responseType = "blob";
|
||||||
|
x.onload = function () {
|
||||||
|
const url = window.URL.createObjectURL(x.response);
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = file.realfilename;
|
||||||
|
a.click();
|
||||||
|
};
|
||||||
|
x.send();
|
||||||
|
}
|
||||||
|
let index = file.filepath.indexOf("."); //获取第一个"_"的位置
|
||||||
|
let after1 = file.filepath.substring(index + 1);
|
||||||
|
switch (after1) {
|
||||||
|
case "xlsx":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "exl":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "pdf":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "word":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
window.open(baseImgUrl.value + file.filepath, "_blank");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const upVisible = ref(false);
|
||||||
|
const upImageUrl = ref("");
|
||||||
|
//查看附件
|
||||||
|
const handleInfo = (file) => {
|
||||||
|
upImageUrl.value = file.url!;
|
||||||
|
upVisible.value = true;
|
||||||
|
};
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
emits("close");
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {});
|
||||||
|
watch(
|
||||||
|
() => props.id,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
getCheckDangers(val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
.chakan {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #1a7eed;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
// justify-content: space-around;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
::v-deep(.el-upload-list__item-actions) {
|
||||||
|
display: flex;
|
||||||
|
> span:nth-child(2) {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep(.el-upload-list__item-preview) {
|
||||||
|
margin-right: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
> span {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep(.avatar-uploader-icon) {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -124,6 +124,7 @@
|
||||||
<el-table-column type="index" align="center" label="序号" width="80"/>
|
<el-table-column type="index" align="center" label="序号" width="80"/>
|
||||||
<el-table-column prop="chinaName" align="center" label="接收人姓名" />
|
<el-table-column prop="chinaName" align="center" label="接收人姓名" />
|
||||||
<el-table-column prop="postName" align="center" label="接收人岗位" />
|
<el-table-column prop="postName" align="center" label="接收人岗位" />
|
||||||
|
<el-table-column prop="workContent" align="center" label="工作内容" />
|
||||||
<el-table-column prop="workState" align="center" label="工作状态" >
|
<el-table-column prop="workState" align="center" label="工作状态" >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span class="notViewed" v-if="scope.row.workState==1">未查看</span>
|
<span class="notViewed" v-if="scope.row.workState==1">未查看</span>
|
||||||
|
|
|
||||||
456
src/views/work-view/components/Add.vue
Normal file
456
src/views/work-view/components/Add.vue
Normal file
|
|
@ -0,0 +1,456 @@
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
:titleName="props.form.workId ? '编辑' + props.tabsTitle : '新增' + props.tabsTitle"
|
||||||
|
width="50%"
|
||||||
|
@onSubmit="handleSubmit"
|
||||||
|
:footerclosed="true"
|
||||||
|
:diafooter="true"
|
||||||
|
:footerkeepnaem="props.readonly ? false : true"
|
||||||
|
>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-position="right"
|
||||||
|
label-width="150px"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="form"
|
||||||
|
>
|
||||||
|
<el-form-item label="工作内容:" prop="title" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
:disabled="props.readonly"
|
||||||
|
placeholder="请输入工作内容"
|
||||||
|
v-model="form.title"
|
||||||
|
:rows="3"
|
||||||
|
type="textarea"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="时间:" prop="time">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="props.readonly"
|
||||||
|
v-model="form.time"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="!props.readonly" label="所属组织:" prop="listperformid">
|
||||||
|
<el-tree-select
|
||||||
|
:disabled="props.readonly"
|
||||||
|
v-model="form.listperformid"
|
||||||
|
:data="postTree"
|
||||||
|
:render-after-expand="false"
|
||||||
|
check-strictly
|
||||||
|
:filter-node-method="filterPostMethod"
|
||||||
|
filterable
|
||||||
|
multiple
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工作附件:" style="width: 100%;">
|
||||||
|
<el-upload
|
||||||
|
class="avatar-uploader"
|
||||||
|
ref="uploadAfter"
|
||||||
|
action="#"
|
||||||
|
list-type="upload-demo"
|
||||||
|
:file-list="afterList"
|
||||||
|
:http-request="handleUploadAfter"
|
||||||
|
>
|
||||||
|
<el-icon class="avatar-uploader-icon" :size="40">
|
||||||
|
<Plus />
|
||||||
|
</el-icon>
|
||||||
|
<template #file="{ file }">
|
||||||
|
<div>
|
||||||
|
<span class="el-upload-list__item-actions">
|
||||||
|
<span class="el-upload-list__item-preview">
|
||||||
|
<el-icon>
|
||||||
|
<Document />
|
||||||
|
</el-icon>
|
||||||
|
<span>{{ file.realfilename }}</span>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="file.types === 'png'"
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleInfo(file)"
|
||||||
|
>
|
||||||
|
<el-icon><zoom-in /></el-icon>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleDownload(file)"
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<Download />
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleRemove(file)"
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<Delete />
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-dialog v-model="upVisible">
|
||||||
|
<img style="width: 100%;" w-full :src="upImageUrl" alt="Preview Image" />
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
<div v-if="props.readonly">
|
||||||
|
<el-table
|
||||||
|
ref="loading"
|
||||||
|
class="table"
|
||||||
|
v-loading="tableDataloading"
|
||||||
|
:data="tableData"
|
||||||
|
header-row-class-name="el-one-header"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column type="index" align="center" label="序号" width="80"/>
|
||||||
|
<el-table-column prop="chinaName" align="center" label="接收人姓名" />
|
||||||
|
<el-table-column prop="postName" align="center" label="接收人岗位" />
|
||||||
|
<el-table-column prop="workContent" align="center" label="工作内容" />
|
||||||
|
<el-table-column prop="workState" align="center" label="工作状态" >
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="notViewed" v-if="scope.row.workState==1">未查看</span>
|
||||||
|
<span class="viewed" v-if="scope.row.workState==2">已查看</span>
|
||||||
|
<span class="completed" v-if="scope.row.workState==3">已完成</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="附件" >
|
||||||
|
<template #default="scope">
|
||||||
|
<span style="cursor: pointer;color: #1a7eed;" @click="(dialogVisible = true), (id = scope.row.wkUserId)">查看</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</BaseDialog>
|
||||||
|
<Fujian
|
||||||
|
:visible="dialogVisible"
|
||||||
|
@close="onclones"
|
||||||
|
:id="id"
|
||||||
|
></Fujian>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts" >
|
||||||
|
import { reactive, ref, onMounted, watch, getCurrentInstance } from "vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
|
import type { UploadUserFile } from "element-plus";
|
||||||
|
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||||
|
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||||
|
import { userListperformTree } from "@/api/Sys";
|
||||||
|
import { workAdd,workDetail } from "@/api/Work";
|
||||||
|
import Fujian from "./Fujian.vue";
|
||||||
|
|
||||||
|
//新增弹窗
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const id = ref('');
|
||||||
|
//关闭新增弹窗
|
||||||
|
const onclones = () => {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
const uuid = ref(getUUID());
|
||||||
|
const ruleForm = reactive<FormRules>({
|
||||||
|
title: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入工作内容",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
processedBy: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入处理人",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
time: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请选择时间",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
listperformid: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请选择所属组织",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
form: Object,
|
||||||
|
readonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
typeId: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
tabsTitle:{
|
||||||
|
type: String,
|
||||||
|
default:"",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const form = ref(<any>{});
|
||||||
|
const emits = defineEmits(["close", "onSubmit"]);
|
||||||
|
//组织list
|
||||||
|
const postTree = ref([]);
|
||||||
|
/**筛选组织*/
|
||||||
|
const filterPostMethod = (value, data) => data.label.includes(value);
|
||||||
|
/**
|
||||||
|
* 获取组织
|
||||||
|
*/
|
||||||
|
const getPostTree = () => {
|
||||||
|
userListperformTree().then((res: any) => {
|
||||||
|
if (res.code == 1) postTree.value = handlePostData(res.data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/**处理组织数据 */
|
||||||
|
let handlePostData = (list) => {
|
||||||
|
let data = list.map((item) => {
|
||||||
|
return {
|
||||||
|
label: item.chinaName ? item.performclassname + '-' + item.chinaName :item.performclassname,
|
||||||
|
value: item.userId,
|
||||||
|
children: item.children ? handlePostData(item.children) : [],
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
//保存并退出
|
||||||
|
const handleSubmit = () => {
|
||||||
|
formRef.value?.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let params = {
|
||||||
|
workId: form.value.workId || uuid.value,
|
||||||
|
title: form.value.title,
|
||||||
|
listperformid: form.value.listperformid.join(','),
|
||||||
|
typeId: props.typeId,
|
||||||
|
userId: form.value.userId || userId.value,
|
||||||
|
startTime: form.value.time[0],
|
||||||
|
endTime: form.value.time[1],
|
||||||
|
};
|
||||||
|
workAdd(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "保存成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
onclone();
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 文件上传
|
||||||
|
const afterList = ref<UploadUserFile[]>([]);
|
||||||
|
const handleUploadAfter = (file: any) => {
|
||||||
|
// if (afterList.value.length != 0) {
|
||||||
|
// ElMessage.error("只能上传一份文件!");
|
||||||
|
// getCheckDangers(form.value.workId || uuid.value);
|
||||||
|
// } else {
|
||||||
|
// }
|
||||||
|
const newFile = new FormData();
|
||||||
|
newFile.append("file", file.file);
|
||||||
|
uploadFile(userId.value, form.value.workId || uuid.value, FileType.workManagement, newFile).then((res) => {
|
||||||
|
if (res) {
|
||||||
|
ElMessage.success("上传成功!");
|
||||||
|
getCheckDangers(form.value.workId || uuid.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
};
|
||||||
|
//文件显示
|
||||||
|
const baseImgUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||||
|
const getCheckDangers = (id) => {
|
||||||
|
getFile(
|
||||||
|
id,
|
||||||
|
FileType.workManagement
|
||||||
|
).then((res: any) => {
|
||||||
|
afterList.value = res.data.map(item => {
|
||||||
|
let arr = item;
|
||||||
|
let index = item.filepath.indexOf(".");//获取第一个"_"的位置
|
||||||
|
let after1 = item.filepath.substring(index + 1);
|
||||||
|
switch (after1) {
|
||||||
|
case 'xlsx':
|
||||||
|
arr.url = 'src/assets/images/exl.png';
|
||||||
|
break;
|
||||||
|
case 'exl':
|
||||||
|
arr.url = 'src/assets/images/exl.png';
|
||||||
|
break;
|
||||||
|
case 'pdf':
|
||||||
|
arr.url = 'src/assets/images/pdf.png';
|
||||||
|
break;
|
||||||
|
case 'word':
|
||||||
|
arr.url = 'src/assets/images/word.png';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
arr.url = baseImgUrl.value + item.filepath;
|
||||||
|
arr.types = 'png';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
};
|
||||||
|
//删除附件
|
||||||
|
const handleRemove = (file) => {
|
||||||
|
delFile(file.sysdocumentid).then((res: any) => {
|
||||||
|
if (res) {
|
||||||
|
ElMessage.success("删除成功!");
|
||||||
|
}
|
||||||
|
getCheckDangers(form.value.workId || uuid.value);
|
||||||
|
})
|
||||||
|
};
|
||||||
|
//下载附件
|
||||||
|
const handleDownload = (file) => {
|
||||||
|
function text() {
|
||||||
|
const x = new XMLHttpRequest();
|
||||||
|
x.open("GET", baseImgUrl.value + file.filepath, true);
|
||||||
|
x.responseType = "blob";
|
||||||
|
x.onload = function () {
|
||||||
|
const url = window.URL.createObjectURL(x.response);
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = file.realfilename;
|
||||||
|
a.click();
|
||||||
|
};
|
||||||
|
x.send();
|
||||||
|
}
|
||||||
|
let index = file.filepath.indexOf("."); //获取第一个"_"的位置
|
||||||
|
let after1 = file.filepath.substring(index + 1);
|
||||||
|
switch (after1) {
|
||||||
|
case "xlsx":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "exl":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "pdf":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "word":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
window.open(baseImgUrl.value + file.filepath, "_blank");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const upVisible = ref(false);
|
||||||
|
const upImageUrl = ref("");
|
||||||
|
//查看附件
|
||||||
|
const handleInfo = (file) => {
|
||||||
|
upImageUrl.value = file.url!;
|
||||||
|
upVisible.value = true;
|
||||||
|
};
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
afterList.value = [];
|
||||||
|
form.value = {};
|
||||||
|
uuid.value = getUUID();
|
||||||
|
emits("close");
|
||||||
|
};
|
||||||
|
//获取列表
|
||||||
|
const tableData = ref([]);
|
||||||
|
const getCompanyList = (workId) => {
|
||||||
|
workDetail(workId).then((res: any) => {
|
||||||
|
form.value = res.data;
|
||||||
|
form.value.time = [res.data.startTime, res.data.endTime];
|
||||||
|
form.value.listperformid =res.data.listPerformId;
|
||||||
|
tableData.value = res.data.wkUsers;
|
||||||
|
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {});
|
||||||
|
watch(
|
||||||
|
() => props.form.workId,
|
||||||
|
(val) => {
|
||||||
|
uuid.value = getUUID();
|
||||||
|
if (val) {
|
||||||
|
form.value = props.form;
|
||||||
|
form.value.time = [form.value.startTime, form.value.endTime];
|
||||||
|
getCheckDangers(form.value.workId || uuid.value);
|
||||||
|
getCompanyList(props.form.workId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => props.readonly,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(val) => {
|
||||||
|
if (val) getPostTree();
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
// justify-content: space-around;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
::v-deep(.el-upload-list__item-actions) {
|
||||||
|
display: flex;
|
||||||
|
> span:nth-child(2) {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep(.el-upload-list__item-preview) {
|
||||||
|
margin-right: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
> span {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep(.avatar-uploader-icon) {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
192
src/views/work-view/components/Fujian.vue
Normal file
192
src/views/work-view/components/Fujian.vue
Normal file
|
|
@ -0,0 +1,192 @@
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
:titleName="'附件列表'"
|
||||||
|
width="50%"
|
||||||
|
:footerclosed="true"
|
||||||
|
:diafooter="true"
|
||||||
|
:footerkeepnaem="false"
|
||||||
|
>
|
||||||
|
<div v-for="(item,index) in afterList" :key="index">
|
||||||
|
<div>
|
||||||
|
<span class="el-upload-list__item-actions">
|
||||||
|
<span class="el-upload-list__item-preview">
|
||||||
|
<el-icon>
|
||||||
|
<Document />
|
||||||
|
</el-icon>
|
||||||
|
<span>{{ item.realfilename }}</span>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="item.types === 'png'"
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleInfo(item)"
|
||||||
|
>
|
||||||
|
<el-icon><zoom-in /></el-icon>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleDownload(item)"
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<Download />
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-empty v-if="afterList.length === 0" description="暂无附件" />
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts" >
|
||||||
|
import { reactive, ref, onMounted, watch, getCurrentInstance } from "vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
|
import type { UploadUserFile } from "element-plus";
|
||||||
|
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||||
|
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||||
|
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
const uuid = ref(getUUID());
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: String,
|
||||||
|
});
|
||||||
|
const form = ref(<any>{});
|
||||||
|
const emits = defineEmits(["close", "onSubmit"]);
|
||||||
|
//文件显示
|
||||||
|
const baseImgUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||||
|
const afterList = ref([])
|
||||||
|
const getCheckDangers = (id) => {
|
||||||
|
getFile(
|
||||||
|
id,
|
||||||
|
FileType.WorkFile
|
||||||
|
).then((res: any) => {
|
||||||
|
afterList.value = res.data.map(item => {
|
||||||
|
let arr = item;
|
||||||
|
let index = item.filepath.indexOf(".");//获取第一个"_"的位置
|
||||||
|
let after1 = item.filepath.substring(index + 1);
|
||||||
|
switch (after1) {
|
||||||
|
case 'xlsx':
|
||||||
|
arr.url = 'src/assets/images/exl.png';
|
||||||
|
break;
|
||||||
|
case 'exl':
|
||||||
|
arr.url = 'src/assets/images/exl.png';
|
||||||
|
break;
|
||||||
|
case 'pdf':
|
||||||
|
arr.url = 'src/assets/images/pdf.png';
|
||||||
|
break;
|
||||||
|
case 'word':
|
||||||
|
arr.url = 'src/assets/images/word.png';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
arr.url = baseImgUrl.value + item.filepath;
|
||||||
|
arr.types = 'png'
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
};
|
||||||
|
//下载附件
|
||||||
|
const handleDownload = (file) => {
|
||||||
|
function text() {
|
||||||
|
const x = new XMLHttpRequest();
|
||||||
|
x.open("GET", baseImgUrl.value + file.filepath, true);
|
||||||
|
x.responseType = "blob";
|
||||||
|
x.onload = function () {
|
||||||
|
const url = window.URL.createObjectURL(x.response);
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = file.realfilename;
|
||||||
|
a.click();
|
||||||
|
};
|
||||||
|
x.send();
|
||||||
|
}
|
||||||
|
let index = file.filepath.indexOf("."); //获取第一个"_"的位置
|
||||||
|
let after1 = file.filepath.substring(index + 1);
|
||||||
|
switch (after1) {
|
||||||
|
case "xlsx":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "exl":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "pdf":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "word":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
window.open(baseImgUrl.value + file.filepath, "_blank");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const upVisible = ref(false);
|
||||||
|
const upImageUrl = ref("");
|
||||||
|
//查看附件
|
||||||
|
const handleInfo = (file) => {
|
||||||
|
upImageUrl.value = file.url!;
|
||||||
|
upVisible.value = true;
|
||||||
|
};
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
emits("close");
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {});
|
||||||
|
watch(
|
||||||
|
() => props.id,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
getCheckDangers(val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
.chakan {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #1a7eed;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
// justify-content: space-around;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
::v-deep(.el-upload-list__item-actions) {
|
||||||
|
display: flex;
|
||||||
|
> span:nth-child(2) {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep(.el-upload-list__item-preview) {
|
||||||
|
margin-right: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
> span {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep(.avatar-uploader-icon) {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
522
src/views/work-view/components/detail.vue
Normal file
522
src/views/work-view/components/detail.vue
Normal file
|
|
@ -0,0 +1,522 @@
|
||||||
|
<template>
|
||||||
|
<div class="percentage-content">
|
||||||
|
<div class="content">
|
||||||
|
<div>
|
||||||
|
<TitleC titleName="户籍信息">
|
||||||
|
<template v-slot:option>
|
||||||
|
<div class="h-layout option">
|
||||||
|
<div class="h-layout h-titlec" @click="clone">
|
||||||
|
<svg-icon name="close" class="icon" />
|
||||||
|
<span class="span">关闭</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</TitleC>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-width="150px"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="detailForm"
|
||||||
|
>
|
||||||
|
<el-form-item label="工作内容:" prop="title">
|
||||||
|
<el-input
|
||||||
|
:disabled="formEnable"
|
||||||
|
placeholder="请输入"
|
||||||
|
type="input"
|
||||||
|
v-model="detailForm.title"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="时间:" prop="time">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="formEnable"
|
||||||
|
v-model="detailForm.time"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属组织:" prop="listperformid">
|
||||||
|
<el-tree-select
|
||||||
|
:disabled="formEnable"
|
||||||
|
v-model="detailForm.listperformid"
|
||||||
|
:data="postTree"
|
||||||
|
:render-after-expand="false"
|
||||||
|
check-strictly
|
||||||
|
:filter-node-method="filterPostMethod"
|
||||||
|
filterable
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工作附件:" style="width: 100%;">
|
||||||
|
<el-upload
|
||||||
|
class="avatar-uploader"
|
||||||
|
ref="uploadAfter"
|
||||||
|
action="#"
|
||||||
|
list-type="upload-demo"
|
||||||
|
:file-list="afterList"
|
||||||
|
:http-request="handleUploadAfter"
|
||||||
|
>
|
||||||
|
<el-icon class="avatar-uploader-icon" :size="40">
|
||||||
|
<Plus />
|
||||||
|
</el-icon>
|
||||||
|
<template #file="{ file }">
|
||||||
|
<div>
|
||||||
|
<span class="el-upload-list__item-actions">
|
||||||
|
<span class="el-upload-list__item-preview">
|
||||||
|
<el-icon>
|
||||||
|
<Document />
|
||||||
|
</el-icon>
|
||||||
|
<span>{{ file.realfilename }}</span>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleInfo(file)"
|
||||||
|
>
|
||||||
|
<el-icon><zoom-in /></el-icon>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleDownload(file)"
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<Download />
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handleRemove(file)"
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<Delete />
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<TitleC titleName="人员查看情况">
|
||||||
|
<template v-slot:option>
|
||||||
|
<div class="h-layout option">
|
||||||
|
<div class="h-layout h-titlec" @click="refurbish">
|
||||||
|
<svg-icon name="refurbish" class="icon" />
|
||||||
|
<span class="span">刷新</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</TitleC>
|
||||||
|
<el-table
|
||||||
|
ref="loading"
|
||||||
|
class="table"
|
||||||
|
v-loading="tableDataloading"
|
||||||
|
:data="tableData"
|
||||||
|
header-row-class-name="el-one-header"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column type="index" align="center" label="序号" width="80"/>
|
||||||
|
<el-table-column prop="chinaName" align="center" label="接收人姓名" />
|
||||||
|
<el-table-column prop="postName" align="center" label="接收人岗位" />
|
||||||
|
<el-table-column prop="workContent" align="center" label="工作内容" />
|
||||||
|
<el-table-column prop="workState" align="center" label="工作状态" >
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="notViewed" v-if="scope.row.workState==1">未查看</span>
|
||||||
|
<span class="viewed" v-if="scope.row.workState==2">已查看</span>
|
||||||
|
<span class="completed" v-if="scope.row.workState==3">已完成</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<TitleC titleName="应急预案">
|
||||||
|
<template v-slot:option>
|
||||||
|
<div class="h-layout option">
|
||||||
|
<div class="h-layout h-titlec" @click="planRefurbish">
|
||||||
|
<svg-icon name="refurbish" class="icon" />
|
||||||
|
<span class="span">刷新</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</TitleC>
|
||||||
|
<el-table
|
||||||
|
ref="loading"
|
||||||
|
class="table"
|
||||||
|
v-loading="planTableDataloading"
|
||||||
|
:data="planTableData"
|
||||||
|
header-row-class-name="el-one-header"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
type="index"
|
||||||
|
align="center"
|
||||||
|
label="序列"
|
||||||
|
width="60"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="planname"
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="预案名称"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="introduction"
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="预案简介"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="othtypename"
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="预案类型"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
width="240"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span
|
||||||
|
class="operate"
|
||||||
|
@click="
|
||||||
|
(dialogVisible = true), (form = scope.row), (readonly = true)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
|
<span class="edit">详情</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
class="pagination"
|
||||||
|
@size-change="getList"
|
||||||
|
@current-change="getList"
|
||||||
|
v-model:current-page.sync="currentPage"
|
||||||
|
:page-sizes="[10, 15, 20, 30]"
|
||||||
|
v-model:page-size.sync="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total"
|
||||||
|
background
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-dialog v-model="upVisible">
|
||||||
|
<img style="width: 100%;" w-full :src="upImageUrl" alt="Preview Image" />
|
||||||
|
</el-dialog>
|
||||||
|
<PlanDetail
|
||||||
|
:visible="dialogVisible"
|
||||||
|
:typeList="option"
|
||||||
|
:form="form"
|
||||||
|
:readonly="readonly"
|
||||||
|
@close="onclone"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { onMounted, reactive, ref } from "vue";
|
||||||
|
import { ElMessage, FormInstance, FormRules, ElMessageBox } from "element-plus";
|
||||||
|
import { areaTree } from "@/api/account";
|
||||||
|
import { domicileAdd, domicileDetail, domicilePeoplePageList, peopleDel } from "@/api/base";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { workAdd,workDetail, emerPlanByWorkId } from "@/api/Work";
|
||||||
|
import { getListperformTree } from "@/api/Sys";
|
||||||
|
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||||
|
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||||
|
import PlanDetail from "./planDetail.vue";
|
||||||
|
import { othplanemerEventType } from "@/api/emergency";
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
//控制form框操作
|
||||||
|
const formEnable = ref(true);
|
||||||
|
const detailForm = ref<any>({});
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
//户籍id
|
||||||
|
const domicileId = ref();
|
||||||
|
//人员信息
|
||||||
|
//人员信息弹窗
|
||||||
|
//table列表
|
||||||
|
const tableDataloading = ref(false);
|
||||||
|
const tableData = ref([]);
|
||||||
|
//关闭
|
||||||
|
const clone = () => {
|
||||||
|
router.go(-1);
|
||||||
|
};
|
||||||
|
|
||||||
|
//获取地区
|
||||||
|
const orgList = ref([]);
|
||||||
|
const getAreaTree = () => {
|
||||||
|
areaTree(userId.value).then((res: any) => {
|
||||||
|
orgList.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//组织list
|
||||||
|
const postTree = ref([]);
|
||||||
|
/**筛选组织*/
|
||||||
|
const filterPostMethod = (value, data) => data.label.includes(value);
|
||||||
|
/**
|
||||||
|
* 获取组织
|
||||||
|
*/
|
||||||
|
const getPostTree = () => {
|
||||||
|
getListperformTree({}).then((res: any) => {
|
||||||
|
if (res.code == 1) postTree.value = handlePostData(res.data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/**处理组织数据 */
|
||||||
|
let handlePostData = (list) => {
|
||||||
|
let data = list.map((item) => {
|
||||||
|
return {
|
||||||
|
label: item.performclassname,
|
||||||
|
value: item.listperformid,
|
||||||
|
children: item.children ? handlePostData(item.children) : [],
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 文件上传
|
||||||
|
const afterList = ref<UploadUserFile[]>([]);
|
||||||
|
const handleUploadAfter = (file: any) => {
|
||||||
|
// if (afterList.value.length != 0) {
|
||||||
|
// ElMessage.error("只能上传一份文件!");
|
||||||
|
// getCheckDangers(detailForm.value.workId);
|
||||||
|
// } else {
|
||||||
|
// }
|
||||||
|
const newFile = new FormData();
|
||||||
|
newFile.append("file", file.file);
|
||||||
|
uploadFile(userId.value, detailForm.value.workId, FileType.workManagement, newFile).then((res) => {
|
||||||
|
if (res) {
|
||||||
|
ElMessage.success("上传成功!");
|
||||||
|
getCheckDangers(detailForm.value.workId)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
};
|
||||||
|
//文件显示
|
||||||
|
const baseImgUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||||
|
const getCheckDangers = (id) => {
|
||||||
|
getFile(
|
||||||
|
id,
|
||||||
|
FileType.workManagement
|
||||||
|
).then((res: any) => {
|
||||||
|
afterList.value = res.data.map(item => {
|
||||||
|
let arr = item;
|
||||||
|
let index = item.filepath.indexOf(".");//获取第一个"_"的位置
|
||||||
|
let after1 = item.filepath.substring(index + 1);
|
||||||
|
switch (after1) {
|
||||||
|
case 'xlsx':
|
||||||
|
arr.url = 'src/assets/images/exl.png';
|
||||||
|
break;
|
||||||
|
case 'exl':
|
||||||
|
arr.url = 'src/assets/images/exl.png';
|
||||||
|
break;
|
||||||
|
case 'pdf':
|
||||||
|
arr.url = 'src/assets/images/pdf.png';
|
||||||
|
break;
|
||||||
|
case 'word':
|
||||||
|
arr.url = 'src/assets/images/word.png';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
arr.url = baseImgUrl.value + item.filepath;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
};
|
||||||
|
//删除附件
|
||||||
|
const handleRemove = (file) => {
|
||||||
|
delFile(file.sysdocumentid).then((res: any) => {
|
||||||
|
if (res) {
|
||||||
|
ElMessage.success("删除成功!");
|
||||||
|
}
|
||||||
|
getCheckDangers(detailForm.value.workId);
|
||||||
|
})
|
||||||
|
};
|
||||||
|
//下载附件
|
||||||
|
const handleDownload = (file) => {
|
||||||
|
function text() {
|
||||||
|
const x = new XMLHttpRequest();
|
||||||
|
x.open("GET", baseImgUrl.value + file.filepath, true);
|
||||||
|
x.responseType = "blob";
|
||||||
|
x.onload = function () {
|
||||||
|
const url = window.URL.createObjectURL(x.response);
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = file.name;
|
||||||
|
a.click();
|
||||||
|
};
|
||||||
|
x.send();
|
||||||
|
}
|
||||||
|
let index = file.filepath.indexOf("."); //获取第一个"_"的位置
|
||||||
|
let after1 = file.filepath.substring(index + 1);
|
||||||
|
switch (after1) {
|
||||||
|
case "xlsx":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "exl":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "pdf":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
case "word":
|
||||||
|
text();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
window.open(baseImgUrl.value + file.filepath, "_blank");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const upVisible = ref(false);
|
||||||
|
const upImageUrl = ref("");
|
||||||
|
//查看附件
|
||||||
|
const handleInfo = (file) => {
|
||||||
|
upImageUrl.value = file.url!;
|
||||||
|
upVisible.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
//预案分页
|
||||||
|
const currentPage = ref(1);
|
||||||
|
const pageSize = ref(10);
|
||||||
|
const total = ref(0);
|
||||||
|
const planTableData = ref([]);
|
||||||
|
const planTableDataloading = ref(false);
|
||||||
|
|
||||||
|
const getEmerPlanByWorkId = (id) =>{
|
||||||
|
planTableDataloading.value = true
|
||||||
|
let params = {
|
||||||
|
limit: pageSize.value,
|
||||||
|
page: currentPage.value,
|
||||||
|
workId:id
|
||||||
|
}
|
||||||
|
emerPlanByWorkId(params).then((res: any) => {
|
||||||
|
console.log(res,'res====>');
|
||||||
|
planTableData.value = res.data.list
|
||||||
|
total.value =res.data.total;
|
||||||
|
planTableDataloading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//预案详情
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const form = ref({});
|
||||||
|
const readonly = ref(false);
|
||||||
|
const option = ref([]);
|
||||||
|
// 获取预案类型
|
||||||
|
const OthtypeList = () => {
|
||||||
|
othplanemerEventType().then((res: any) => {
|
||||||
|
console.log(res.data , '获取预案类型==>');
|
||||||
|
|
||||||
|
option.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//关闭新增弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
form.value = {};
|
||||||
|
planRefurbish();
|
||||||
|
};
|
||||||
|
//预案分页刷新
|
||||||
|
const planRefurbish = () => {
|
||||||
|
currentPage.value = 1;
|
||||||
|
pageSize.value = 10;
|
||||||
|
getEmerPlanByWorkId(route.query.id);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//获取列表
|
||||||
|
const getCompanyList = (workId) => {
|
||||||
|
tableDataloading.value = true;
|
||||||
|
workDetail(workId).then((res: any) => {
|
||||||
|
console.log(res,'res====>');
|
||||||
|
|
||||||
|
detailForm.value = res.data;
|
||||||
|
detailForm.value.time = [res.data.startTime, res.data.endTime?res.data.endTime:res.data.startTime];
|
||||||
|
detailForm.value.listperformid =res.data.listPerformId;
|
||||||
|
tableData.value = res.data.wkUsers;
|
||||||
|
tableDataloading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//刷新
|
||||||
|
const refurbish = () => {
|
||||||
|
getCompanyList(route.query.id);
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
domicileId.value = route.query.id || "";
|
||||||
|
refurbish();
|
||||||
|
|
||||||
|
getAreaTree();
|
||||||
|
getPostTree();
|
||||||
|
getCompanyList(route.query.id);
|
||||||
|
getCheckDangers(route.query.id);
|
||||||
|
getEmerPlanByWorkId(route.query.id)
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 0.26042vw;
|
||||||
|
box-shadow: 0 0 0.41667vw 0 rgb(8 33 85 / 10%);
|
||||||
|
height: 100%;
|
||||||
|
padding: 0.83333vw;
|
||||||
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-o-box-sizing: border-box;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-ms-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 45%;
|
||||||
|
}
|
||||||
|
::v-deep(.el-upload-list__item-actions) {
|
||||||
|
display: flex;
|
||||||
|
> span:nth-child(2) {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep(.el-upload-list__item-preview) {
|
||||||
|
margin-right: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
> span {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep(.avatar-uploader-icon) {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
242
src/views/work-view/components/planDetail.vue
Normal file
242
src/views/work-view/components/planDetail.vue
Normal file
|
|
@ -0,0 +1,242 @@
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
titleName="查看应急预案"
|
||||||
|
width="50%"
|
||||||
|
@onSubmit="handleSubmit"
|
||||||
|
:footerclosed="true"
|
||||||
|
:diafooter="true"
|
||||||
|
:footerkeepnaem="props.readonly ? false : true"
|
||||||
|
>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-position="right"
|
||||||
|
label-width="120px"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="addPostFactorForm"
|
||||||
|
>
|
||||||
|
<el-form-item label="预案名称:" prop="planname">
|
||||||
|
<el-input
|
||||||
|
placeholder="请输入预案名称"
|
||||||
|
v-model="addPostFactorForm.planname"
|
||||||
|
:disabled="props.readonly"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预案类型:" prop="othtypeid">
|
||||||
|
<el-select
|
||||||
|
placeholder="请选择预案类型:"
|
||||||
|
v-model="addPostFactorForm.othtypeid"
|
||||||
|
:disabled="props.readonly"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in option"
|
||||||
|
:key="item.emerTypeId"
|
||||||
|
:label="item.emerTypeName"
|
||||||
|
:value="item.emerTypeId"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="areaCode" label="所属区域">
|
||||||
|
<el-cascader
|
||||||
|
ref="cascader"
|
||||||
|
v-model="addPostFactorForm.areaCode"
|
||||||
|
:disabled="props.readonly"
|
||||||
|
placeholder="请选择地区"
|
||||||
|
:options="orgList"
|
||||||
|
:props="{
|
||||||
|
checkStrictly: true,
|
||||||
|
label: 'orgname',
|
||||||
|
value: 'orgcode',
|
||||||
|
}"
|
||||||
|
clearable
|
||||||
|
></el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预案简介:" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
placeholder="请输入预案简介"
|
||||||
|
v-model="addPostFactorForm.introduction"
|
||||||
|
:disabled="props.readonly"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="文件" style="width: 100%;" class="inline-block">
|
||||||
|
<CustomUpload
|
||||||
|
:listPic="fileList"
|
||||||
|
:OTCType="FileType.EmergencyFile"
|
||||||
|
:uuid="addPostFactorForm.othplanid || uuid"
|
||||||
|
:userId="userId"
|
||||||
|
:baseUrl="baseUrl"
|
||||||
|
:max="9"
|
||||||
|
@onUpdate="updateFile"
|
||||||
|
:readonly="props.readonly"
|
||||||
|
></CustomUpload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts" >
|
||||||
|
import { reactive, ref, onMounted, watch } from "vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
|
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||||
|
import { areaTree } from "@/api/account";
|
||||||
|
import { saveOthplan, othplanemerEventType } from "@/api/emergency";
|
||||||
|
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||||
|
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
const uuid = ref("");
|
||||||
|
const baseUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||||
|
const unitList = ref([]);
|
||||||
|
const fileList = ref([]);
|
||||||
|
const chartFileList = ref([]);
|
||||||
|
const chartFile = ref([]);
|
||||||
|
const ruleForm = reactive<FormRules>({
|
||||||
|
planname: [{ required: true, message: "请输入预案名称", trigger: "blur" }],
|
||||||
|
othtypeid: [{ required: true, message: "请选择预案类型", trigger: "blur" }],
|
||||||
|
areaCode: [{ required: true, message: "请选择所属地区", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
form: Object,
|
||||||
|
readonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: String,
|
||||||
|
});
|
||||||
|
const listperformid = ref(props.id);
|
||||||
|
const addPostFactorForm = ref(<any>{});
|
||||||
|
const emits = defineEmits(["close", "onSubmit"]);
|
||||||
|
//保存并退出
|
||||||
|
const handleSubmit = () => {
|
||||||
|
formRef.value?.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let params = {
|
||||||
|
...addPostFactorForm.value,
|
||||||
|
areaCode: "",
|
||||||
|
userId: addPostFactorForm.value.userId || userId.value,
|
||||||
|
othplanid: addPostFactorForm.value.othplanid || uuid.value,
|
||||||
|
};
|
||||||
|
if (addPostFactorForm.value.areaCode instanceof Array) {
|
||||||
|
params.areaCode =
|
||||||
|
addPostFactorForm.value.areaCode[addPostFactorForm.value.areaCode.length - 1];
|
||||||
|
} else {
|
||||||
|
params.areaCode = addPostFactorForm.value.areaCode;
|
||||||
|
};
|
||||||
|
saveOthplan(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "保存成功",
|
||||||
|
// type: "success",
|
||||||
|
});
|
||||||
|
onclone();
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const option = ref([]);
|
||||||
|
// 获取预案类型
|
||||||
|
const OthtypeList = () => {
|
||||||
|
othplanemerEventType().then((res: any) => {
|
||||||
|
option.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//获取地区
|
||||||
|
const orgList = ref([]);
|
||||||
|
const getareaTree = () => {
|
||||||
|
areaTree(userId.value).then((res: any) => {
|
||||||
|
orgList.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* 文件列表更新
|
||||||
|
*/
|
||||||
|
const updateFile = (files: any) => {
|
||||||
|
fileList.value = files;
|
||||||
|
};
|
||||||
|
const chartupdateFile = (files: any) => {
|
||||||
|
chartFileList.value = files;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 上传附件前
|
||||||
|
const upload = ref();
|
||||||
|
const beforeAvatarUpload = () => {
|
||||||
|
upload.value.submit();
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
//图片查询
|
||||||
|
const getFiles = (FileType) => {
|
||||||
|
getFile(addPostFactorForm.value.othplanid || uuid.value, FileType).then(
|
||||||
|
(res: any) => {
|
||||||
|
if (FileType == "Files") {
|
||||||
|
//文件
|
||||||
|
fileList.value = res.data;
|
||||||
|
} else {
|
||||||
|
//一图一表
|
||||||
|
chartFileList.value = res.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
emits("close");
|
||||||
|
fileList.value = [];
|
||||||
|
chartFileList.value = [];
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
OthtypeList();
|
||||||
|
getareaTree();
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => props.form,
|
||||||
|
(val) => {
|
||||||
|
uuid.value = getUUID();
|
||||||
|
if (val) {
|
||||||
|
if (!props.visible) return;
|
||||||
|
addPostFactorForm.value = val;
|
||||||
|
console.log(addPostFactorForm.value,'addPostFactorForm.value===>');
|
||||||
|
|
||||||
|
getFiles(FileType.EmergencyFile);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
// justify-content: space-around;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
266
src/views/work-view/index.vue
Normal file
266
src/views/work-view/index.vue
Normal file
|
|
@ -0,0 +1,266 @@
|
||||||
|
<template>
|
||||||
|
<div class="percentage-content">
|
||||||
|
<el-radio-group class="rg" v-model="tabIndex" @change="clickRadio">
|
||||||
|
<template v-for="item in tabs" :key="item.sortId">
|
||||||
|
<el-radio-button :label="item.sortId">{{ item.typeName }}</el-radio-button>
|
||||||
|
</template>
|
||||||
|
</el-radio-group>
|
||||||
|
<div class="content">
|
||||||
|
<!-- <transition name="main" mode="out-in" appear>
|
||||||
|
<component :is="tabs[tabIndex].compon" />
|
||||||
|
</transition> -->
|
||||||
|
<!-- <CG :tabIndex="tabIndex" :typeId="typeId"></CG> -->
|
||||||
|
<div class="h-layout space-between h-center">
|
||||||
|
<!-- <div>
|
||||||
|
<div class="h-layout">
|
||||||
|
<div
|
||||||
|
class="tool-item"
|
||||||
|
@click="(dialogVisible = true), (form = {}), (readonly = false)"
|
||||||
|
>
|
||||||
|
<svg-icon name="add" class="icon" />
|
||||||
|
<span>新增</span>
|
||||||
|
</div>
|
||||||
|
<div class="tool-item" @click="getList">
|
||||||
|
<svg-icon name="refurbish" class="icon" />
|
||||||
|
<span>刷新</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
ref="loading"
|
||||||
|
class="table"
|
||||||
|
v-loading="tableDataloading"
|
||||||
|
:data="tableData"
|
||||||
|
header-row-class-name="el-one-header"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column type="index" align="center" label="序号" width="80"/>
|
||||||
|
<el-table-column prop="title" align="center" label="工作内容" />
|
||||||
|
<el-table-column prop="startTime" align="center" label="开始时间" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.startTime}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="endTime" align="center" label="结束时间" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.endTime?scope.row.endTime:'--'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="chinaName" align="center" label="发布人" width="120"/>
|
||||||
|
<el-table-column prop="postName" align="center" label="发布人岗位" width="150"/>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
width="260"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span
|
||||||
|
v-if="tabIndex != 3"
|
||||||
|
class="operate"
|
||||||
|
@click="
|
||||||
|
(dialogVisible = true), (form = scope.row), (readonly = true)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
|
<span class="detail">详情</span>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-else
|
||||||
|
class="operate"
|
||||||
|
@click="toDetail(scope.row.workId)"
|
||||||
|
>
|
||||||
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
|
<span class="detail">详情</span>
|
||||||
|
</span>
|
||||||
|
<span class="operate" @click="deletelist(scope.row)">
|
||||||
|
<svg-icon name="delete" class="icon"></svg-icon>
|
||||||
|
<span class="func">删除</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<el-pagination
|
||||||
|
class="pagination"
|
||||||
|
@size-change="getSendWorkPage"
|
||||||
|
@current-change="getSendWorkPage"
|
||||||
|
v-model:current-page.sync="currentPage"
|
||||||
|
:page-sizes="[10, 15, 20, 30]"
|
||||||
|
v-model:page-size.sync="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total"
|
||||||
|
background
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
<!-- 新增 -->
|
||||||
|
<Add
|
||||||
|
:visible="dialogVisible"
|
||||||
|
:form="form"
|
||||||
|
:readonly="readonly"
|
||||||
|
@close="onclone"
|
||||||
|
:typeId="typeId"
|
||||||
|
:tabsTitle="tabsTitle"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { onMounted, ref } from "vue";
|
||||||
|
import Add from "./components/add.vue";
|
||||||
|
import { wkTypes, allWorkPage, deleteWork } from "@/api/Work";
|
||||||
|
import { ElMessageBox, ElMessage } from "element-plus";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
const router = useRouter();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
|
||||||
|
const tabIndex = ref(0);
|
||||||
|
const tabs = ref([
|
||||||
|
{ typeName: "常规工作", sortId: 1, },
|
||||||
|
]);
|
||||||
|
const typeId = ref('');
|
||||||
|
//弹窗标题
|
||||||
|
const tabsTitle = ref('');
|
||||||
|
//头部点击取id
|
||||||
|
const clickRadio = ()=>{
|
||||||
|
tabs.value.forEach(item => {
|
||||||
|
if (item.sortId == tabIndex.value) {
|
||||||
|
typeId.value = item.typeId
|
||||||
|
tabsTitle.value = item.typeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
//工作类型
|
||||||
|
const getWkTypes = ()=>{
|
||||||
|
let params = {
|
||||||
|
classify:1
|
||||||
|
}
|
||||||
|
wkTypes(params).then((res: any) => {
|
||||||
|
tabs.value = res.data;
|
||||||
|
typeId.value = res.data[0].typeId;
|
||||||
|
tabsTitle.value = res.data[0].typeName;
|
||||||
|
tabIndex.value = 1;
|
||||||
|
getSendWorkPage();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const search = ref([]);
|
||||||
|
const currentPage = ref(1);
|
||||||
|
const pageSize = ref(10);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
|
|
||||||
|
//获取列表
|
||||||
|
const tableDataloading = ref(false);
|
||||||
|
const tableData = ref([]);
|
||||||
|
const getSendWorkPage = () => {
|
||||||
|
tableDataloading.value = true;
|
||||||
|
let params = {
|
||||||
|
userId:userId.value,
|
||||||
|
limit: pageSize.value,
|
||||||
|
page: currentPage.value,
|
||||||
|
typeId:typeId.value,
|
||||||
|
};
|
||||||
|
allWorkPage(params).then((res: any) => {
|
||||||
|
tableData.value = res.data.list;
|
||||||
|
total.value = res.data.total;
|
||||||
|
tableDataloading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//新增弹窗
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const form = ref({});
|
||||||
|
const readonly = ref(false);
|
||||||
|
//关闭新增弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
form.value = {};
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
//删除
|
||||||
|
const deletelist = (data)=>{
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||||
|
confirmButtonText: "是",
|
||||||
|
cancelButtonText: "否",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
let params = {
|
||||||
|
workId: data.workId,
|
||||||
|
classify: 1,
|
||||||
|
};
|
||||||
|
deleteWork(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "删除成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//应急事件详情
|
||||||
|
const toDetail = (id) => {
|
||||||
|
router.push({
|
||||||
|
name: "work-detail",
|
||||||
|
query: { id: id },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getList = ()=>{
|
||||||
|
currentPage.value = 1;
|
||||||
|
getSendWorkPage();
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getWkTypes();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.percentage-content {
|
||||||
|
height: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.rg {
|
||||||
|
padding: 16px;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 0 6px rgb(0 120 255 / 10%);
|
||||||
|
border-radius: 6px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
:deep(.el-radio-button__inner) {
|
||||||
|
min-width: 150px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 0.26042vw;
|
||||||
|
box-shadow: 0 0 0.41667vw 0 rgb(8 33 85 / 10%);
|
||||||
|
padding: 0.83333vw;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.table {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user