|
@@ -36,7 +36,135 @@
|
|
@refresh-change="refreshChange"
|
|
@refresh-change="refreshChange"
|
|
@on-load="onLoad"
|
|
@on-load="onLoad"
|
|
>
|
|
>
|
|
|
|
+ <!-- 自 定义按钮 -->
|
|
|
|
+ <template
|
|
|
|
+ slot-scope="{row,index}"
|
|
|
|
+ slot="menu"
|
|
|
|
+ >
|
|
|
|
+ <el-link
|
|
|
|
+ :underline="false"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="$refs.crud.rowView(row,index)"
|
|
|
|
+ >查看</el-link>
|
|
|
|
+ <el-link
|
|
|
|
+ class="marleft10"
|
|
|
|
+ :underline="false"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="editKJ(row, index)"
|
|
|
|
+ >编辑</el-link>
|
|
|
|
+ <el-link
|
|
|
|
+ class="marleft10"
|
|
|
|
+ :underline="false"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="$refs.crud.rowDel(row,index)"
|
|
|
|
+ >删除</el-link>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ <!-- 参建项目 -->
|
|
|
|
+ <template
|
|
|
|
+ slot-scope="{type,disabled}"
|
|
|
|
+ slot="projectAndUserListForm"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ class="flexStar"
|
|
|
|
+ v-for="(item,key) in fromss.projectAndUserList"
|
|
|
|
+ :key='key'
|
|
|
|
+ >
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="fromss.projectAndUserList[key].projectName"
|
|
|
|
+ :disabled="true"
|
|
|
|
+ ></el-input>
|
|
|
|
+ <el-input
|
|
|
|
+ class="marleft10"
|
|
|
|
+ v-model="fromss.projectAndUserList[key].contractName"
|
|
|
|
+ :disabled="true"
|
|
|
|
+ ></el-input>
|
|
|
|
+ <el-input
|
|
|
|
+ class="marleft10"
|
|
|
|
+ v-model="fromss.projectAndUserList[key].roleType +' | '+fromss.projectAndUserList[key].roleName"
|
|
|
|
+ :disabled="true"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ <!-- 参与项目自定义表单 -->
|
|
|
|
+ <template
|
|
|
|
+ slot-scope="{type,disabled}"
|
|
|
|
+ slot="projectIdForm"
|
|
|
|
+ >
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="fromss.projectId"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in projectData"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :label="item.projectName"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 合同段自定义表单 -->
|
|
|
|
+ <template
|
|
|
|
+ slot-scope="{type,disabled}"
|
|
|
|
+ slot="contractIdForm"
|
|
|
|
+ >
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="fromss.contractId"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in contractData"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :label="item.projectName"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 用户类型自定义表单 -->
|
|
|
|
+ <template
|
|
|
|
+ slot-scope="{type,disabled}"
|
|
|
|
+ slot="roleIdsForm"
|
|
|
|
+ >
|
|
|
|
+ <div class="flexStar">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="fromss.roleIds"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in roleIdsData"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :label="item.roleName"
|
|
|
|
+ :value="item.roleId"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-button
|
|
|
|
+ v-show="type!=='view'"
|
|
|
|
+ class="marleft10"
|
|
|
|
+ type="warning"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="addProject(type)"
|
|
|
|
+ >确认添加</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
<template slot="menuLeft">
|
|
<template slot="menuLeft">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
+ @click="addKJ()"
|
|
|
|
+ >新 增
|
|
|
|
+ </el-button>
|
|
<el-button
|
|
<el-button
|
|
type="danger"
|
|
type="danger"
|
|
size="small"
|
|
size="small"
|
|
@@ -231,9 +359,12 @@ import {
|
|
grant,
|
|
grant,
|
|
resetPassword, unlock
|
|
resetPassword, unlock
|
|
} from "@/api/system/user";
|
|
} from "@/api/system/user";
|
|
|
|
+import { getProjectList } from "@/api/manager/projectinfo";
|
|
|
|
+
|
|
|
|
+import { findContractByProjectId } from "@/api/manager/contractinfo";
|
|
import { exportBlob } from "@/api/common";
|
|
import { exportBlob } from "@/api/common";
|
|
import { getDeptTree, getDeptLazyTree } from "@/api/system/dept";
|
|
import { getDeptTree, getDeptLazyTree } from "@/api/system/dept";
|
|
-import { getRoleTree } from "@/api/system/role";
|
|
|
|
|
|
+import { getRoleTree, treeUser, findProjectAndContractList } from "@/api/system/role";
|
|
import { getPostList } from "@/api/system/post";
|
|
import { getPostList } from "@/api/system/post";
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
import website from '@/config/website';
|
|
import website from '@/config/website';
|
|
@@ -318,6 +449,16 @@ export default {
|
|
children: 'children'
|
|
children: 'children'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ fromss: {
|
|
|
|
+ userId: '',//
|
|
|
|
+ projectAndUserList: [],
|
|
|
|
+ projectId: '',//参与项项目
|
|
|
|
+ contractId: '',//合同段
|
|
|
|
+ roleIds: '',//用户类型
|
|
|
|
+ },
|
|
|
|
+ projectData: [],//参与项项目
|
|
|
|
+ contractData: [],//合同段
|
|
|
|
+ roleIdsData: [],//用户类型
|
|
option: {
|
|
option: {
|
|
height: 'auto',
|
|
height: 'auto',
|
|
calcHeight: 80,
|
|
calcHeight: 80,
|
|
@@ -327,7 +468,10 @@ export default {
|
|
border: true,
|
|
border: true,
|
|
index: true,
|
|
index: true,
|
|
selection: true,
|
|
selection: true,
|
|
- viewBtn: true,
|
|
|
|
|
|
+ addBtn: false,
|
|
|
|
+ // viewBtn: true,
|
|
|
|
+ editBtn: false,
|
|
|
|
+ delBtn: false,
|
|
dialogType: 'drawer',
|
|
dialogType: 'drawer',
|
|
dialogClickModal: false,
|
|
dialogClickModal: false,
|
|
column: [
|
|
column: [
|
|
@@ -462,16 +606,6 @@ export default {
|
|
prop: 'detailInfo',
|
|
prop: 'detailInfo',
|
|
icon: 'el-icon-s-order',
|
|
icon: 'el-icon-s-order',
|
|
column: [
|
|
column: [
|
|
- {
|
|
|
|
- label: "用户昵称",
|
|
|
|
- prop: "name",
|
|
|
|
- hide: true,
|
|
|
|
- rules: [{
|
|
|
|
- required: true,
|
|
|
|
- message: "请输入用户昵称",
|
|
|
|
- trigger: "blur"
|
|
|
|
- }]
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
label: "用户姓名",
|
|
label: "用户姓名",
|
|
prop: "realName",
|
|
prop: "realName",
|
|
@@ -497,38 +631,20 @@ export default {
|
|
overHidden: true
|
|
overHidden: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- label: "用户性别",
|
|
|
|
- prop: "sex",
|
|
|
|
|
|
+ label: "账号状态",
|
|
|
|
+ prop: "status",
|
|
type: "select",
|
|
type: "select",
|
|
|
|
+ hide: true,
|
|
dicData: [
|
|
dicData: [
|
|
{
|
|
{
|
|
- label: "男",
|
|
|
|
|
|
+ label: "启用",
|
|
value: 1
|
|
value: 1
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- label: "女",
|
|
|
|
- value: 2
|
|
|
|
|
|
+ label: "禁用",
|
|
|
|
+ value: 0
|
|
},
|
|
},
|
|
- {
|
|
|
|
- label: "未知",
|
|
|
|
- value: 3
|
|
|
|
- }
|
|
|
|
],
|
|
],
|
|
- hide: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: "用户生日",
|
|
|
|
- type: "date",
|
|
|
|
- prop: "birthday",
|
|
|
|
- format: "yyyy-MM-dd hh:mm:ss",
|
|
|
|
- valueFormat: "yyyy-MM-dd hh:mm:ss",
|
|
|
|
- hide: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: "账号状态",
|
|
|
|
- prop: "statusName",
|
|
|
|
- hide: true,
|
|
|
|
- display: false
|
|
|
|
}
|
|
}
|
|
]
|
|
]
|
|
},
|
|
},
|
|
@@ -593,6 +709,49 @@ export default {
|
|
},
|
|
},
|
|
]
|
|
]
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ label: '职能描述',
|
|
|
|
+ prop: 'dutyInfo',
|
|
|
|
+ icon: 'el-icon-s-custom',
|
|
|
|
+ column: [
|
|
|
|
+ {
|
|
|
|
+ label: "参建项目",
|
|
|
|
+ prop: "projectAndUserList",
|
|
|
|
+ span: 24,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "参与项目",
|
|
|
|
+ prop: "projectId",
|
|
|
|
+ span: 16,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "合同段",
|
|
|
|
+ prop: "contractId",
|
|
|
|
+ span: 16,
|
|
|
|
+ }, {
|
|
|
|
+ label: "用户类型",
|
|
|
|
+ prop: "roleIds",
|
|
|
|
+ span: 16,
|
|
|
|
+ }, {
|
|
|
|
+ label: "单位名称",
|
|
|
|
+ prop: "companyName",
|
|
|
|
+ span: 16,
|
|
|
|
+ }, {
|
|
|
|
+ label: "职位",
|
|
|
|
+ prop: "position",
|
|
|
|
+ span: 16,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "允许登录",
|
|
|
|
+ type: "select",
|
|
|
|
+ span: 16,
|
|
|
|
+ prop: "status",
|
|
|
|
+ dicData: [
|
|
|
|
+ { value: 1, label: '是' },
|
|
|
|
+ { value: 0, label: '否' }],
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
]
|
|
]
|
|
},
|
|
},
|
|
data: [],
|
|
data: [],
|
|
@@ -732,7 +891,14 @@ export default {
|
|
const column = this.findObject(this.excelOption.column, "excelFile");
|
|
const column = this.findObject(this.excelOption.column, "excelFile");
|
|
column.action = `/api/blade-user/import-user?isCovered=${this.excelForm.isCovered}`;
|
|
column.action = `/api/blade-user/import-user?isCovered=${this.excelForm.isCovered}`;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ 'fromss.projectId': function () {
|
|
|
|
+ if (this.fromss.projectId) {
|
|
|
|
+ this.findContractByProjectId(this.fromss.projectId)
|
|
|
|
+ } else {
|
|
|
|
+ this.contractData = []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapGetters(["userInfo", "permission"]),
|
|
...mapGetters(["userInfo", "permission"]),
|
|
@@ -767,6 +933,154 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //#region 弹框事件及方法
|
|
|
|
+ addKJ () {
|
|
|
|
+ this.getProjectList()
|
|
|
|
+ this.treeUser()
|
|
|
|
+ this.$refs.crud.rowAdd()
|
|
|
|
+ this.fromss.projectAndUserList = []
|
|
|
|
+ this.fromss.projectId = ''
|
|
|
|
+ this.fromss.userId = ''
|
|
|
|
+ this.fromss.contractId = ''
|
|
|
|
+ this.fromss.projectAndUserList = ''
|
|
|
|
+ this.fromss.roleIds = '' //合同段Id
|
|
|
|
+ this.contractData = [] //合同段枚举
|
|
|
|
+ },
|
|
|
|
+ addProject (type) {//确定添加参建项目
|
|
|
|
+ if (type == 'add') {
|
|
|
|
+ this.addfangfa()
|
|
|
|
+ } else {
|
|
|
|
+ const tag = true
|
|
|
|
+ if (!this.fromss.projectId) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "请选择参与项目!"
|
|
|
|
+ })
|
|
|
|
+ return tag = false
|
|
|
|
+ }
|
|
|
|
+ if (!this.fromss.contractId) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "请选择合同段!"
|
|
|
|
+ })
|
|
|
|
+ return tag = false
|
|
|
|
+ }
|
|
|
|
+ if (!this.fromss.roleIds) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "请选择用户类型!"
|
|
|
|
+ })
|
|
|
|
+ return tag = false
|
|
|
|
+ }
|
|
|
|
+ if (tag) {
|
|
|
|
+ this.saveUserInfoByProjectTow({
|
|
|
|
+ projectId: this.fromss.projectId,
|
|
|
|
+ contractId: this.fromss.contractId,
|
|
|
|
+ roleId: this.fromss.roleIds,
|
|
|
|
+ userId: this.fromss.userId
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ addfangfa () {//添加时确定添加按钮方法处理
|
|
|
|
+ // this.fromss.projectAndUserList
|
|
|
|
+ const tag = true
|
|
|
|
+ if (!this.fromss.projectId) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "请选择参与项目!"
|
|
|
|
+ })
|
|
|
|
+ return tag = false
|
|
|
|
+ }
|
|
|
|
+ if (!this.fromss.contractId) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "请选择合同段!"
|
|
|
|
+ })
|
|
|
|
+ return tag = false
|
|
|
|
+ }
|
|
|
|
+ if (!this.fromss.roleIds) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "请选择用户类型!"
|
|
|
|
+ })
|
|
|
|
+ return tag = false
|
|
|
|
+ }
|
|
|
|
+ let tas = {
|
|
|
|
+ projectName: '',
|
|
|
|
+ contractName: '',
|
|
|
|
+ roleType: '',
|
|
|
|
+ roleName: ''
|
|
|
|
+ }
|
|
|
|
+ this.projectData.forEach(val => {
|
|
|
|
+ if (val.id === this.fromss.projectId) {
|
|
|
|
+ tas.projectName = val.projectName
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.contractData.forEach(val => {
|
|
|
|
+ if (val.id === this.fromss.contractId) {
|
|
|
|
+ tas.contractName = val.projectName
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.roleIdsData.forEach(val => {
|
|
|
|
+ if (val.roleId === this.fromss.contractId) {
|
|
|
|
+ tas.roleName = val.roleName
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.fromss.projectAndUserList.push({
|
|
|
|
+ projectId: this.fromss.projectId,
|
|
|
|
+ contractId: this.fromss.contractId,
|
|
|
|
+ roleId: this.fromss.roleIds,
|
|
|
|
+ projectName: '',
|
|
|
|
+ contractName: '',
|
|
|
|
+ roleName: ''
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ editKJ (row, index) {//编辑用户
|
|
|
|
+ console.log(row);
|
|
|
|
+ this.fromss.userId = row.id //用户ID
|
|
|
|
+ this.fromss.contractId = '' //合同段Id
|
|
|
|
+ this.contractData = [] //合同段枚举
|
|
|
|
+ this.getProjectList()
|
|
|
|
+ this.treeUser()
|
|
|
|
+ this.findProjectAndContractList(row.id)
|
|
|
|
+ this.$refs.crud.rowEdit(row, index)
|
|
|
|
+ },
|
|
|
|
+ async getProjectList () {//项目类型
|
|
|
|
+ const { data: res } = await getProjectList()
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.projectData = res.data.records
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async findContractByProjectId (pId) {//合同段
|
|
|
|
+ const { data: res } = await findContractByProjectId(pId)
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.contractData = res.data
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async treeUser () {//获取用户类型枚举
|
|
|
|
+ const { data: res } = await treeUser()
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.roleIdsData = res.data
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async findProjectAndContractList (userId) {//编辑获取参建项目
|
|
|
|
+ const { data: res } = await findProjectAndContractList({ userId })
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.fromss.projectAndUserList = res.data
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async saveUserInfoByProjectTow (da) {//编辑添加参建项目
|
|
|
|
+ const { data: res } = await saveUserInfoByProjectTow(da)
|
|
|
|
+ console.log(res);
|
|
|
|
+ },
|
|
|
|
+ //#endregion
|
|
|
|
+
|
|
|
|
+ //#region 甘云杰
|
|
nodeClick (data) {
|
|
nodeClick (data) {
|
|
this.treeDeptId = data.id;
|
|
this.treeDeptId = data.id;
|
|
this.page.currentPage = 1;
|
|
this.page.currentPage = 1;
|
|
@@ -797,11 +1111,11 @@ export default {
|
|
this.onLoad(this.page);
|
|
this.onLoad(this.page);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- rowSave (row, done, loading) {
|
|
|
|
|
|
+ rowSave (row, done, loading) { //新增保存
|
|
row.deptId = row.deptId.join(",");
|
|
row.deptId = row.deptId.join(",");
|
|
row.roleId = row.roleId.join(",");
|
|
row.roleId = row.roleId.join(",");
|
|
row.postId = row.postId.join(",");
|
|
row.postId = row.postId.join(",");
|
|
- add(row).then(() => {
|
|
|
|
|
|
+ add({ ...row, projectAndUserList: this.fromss.projectAndUserList }).then(() => {
|
|
this.initFlag = false;
|
|
this.initFlag = false;
|
|
this.onLoad(this.page);
|
|
this.onLoad(this.page);
|
|
this.$message({
|
|
this.$message({
|
|
@@ -810,11 +1124,10 @@ export default {
|
|
});
|
|
});
|
|
done();
|
|
done();
|
|
}, error => {
|
|
}, error => {
|
|
- window.console.log(error);
|
|
|
|
loading();
|
|
loading();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- rowUpdate (row, index, done, loading) {
|
|
|
|
|
|
+ rowUpdate (row, index, done, loading) {//修改按钮
|
|
row.deptId = row.deptId.join(",");
|
|
row.deptId = row.deptId.join(",");
|
|
row.roleId = row.roleId.join(",");
|
|
row.roleId = row.roleId.join(",");
|
|
row.postId = row.postId.join(",");
|
|
row.postId = row.postId.join(",");
|
|
@@ -827,7 +1140,6 @@ export default {
|
|
});
|
|
});
|
|
done();
|
|
done();
|
|
}, error => {
|
|
}, error => {
|
|
- window.console.log(error);
|
|
|
|
loading();
|
|
loading();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -1066,7 +1378,8 @@ export default {
|
|
this.platformLoading = false;
|
|
this.platformLoading = false;
|
|
this.selectionClear();
|
|
this.selectionClear();
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ //#endregion
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|