相关方关联分公司功能

1212-八项作业迁移
zhaoyu 2023-12-04 17:05:54 +08:00
parent e75ce58894
commit 22ca42987c
3 changed files with 931 additions and 0 deletions

View File

@ -0,0 +1,484 @@
<template>
<div class="icons-container">
<el-container>
<el-main>
<el-form label-width="100px">
<el-row>
<el-col :span="4">
<el-form-item label="关键字搜索">
<el-input v-model="searchForm.KEYWORDS" style="width: 150px" placeholder="请输入关键字"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="20px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table v-loading="listLoading" ref="multipleTable" :data="varList" :row-key="getRowKey" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row>
<el-table-column :reserve-selection="true" type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="FGS_NAME" label="分公司名称" />
<el-table-column prop="NAME" label="姓名" />
<el-table-column prop="PHONE" label="电话" />
<el-table-column prop="IS_SPECIAL_JOB" label="是否特殊工种">
<template slot-scope="scope">
<span v-if="scope.row.IS_SPECIAL_JOB=='0'"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop="ISFLOW" label="是否流动人员" >
<template slot-scope="scope">
<span v-if="scope.row.ISFLOW=='0'"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="{row}">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDel(row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</el-main>
</el-container>
<div/>
<el-dialog :visible.sync="dialogFormEdit" title="人员关联分公司" width="600px">
<el-table v-loading="userListLoading" ref="userListTable" :data="userList" @selection-change="handleSelectionChange" :row-key="getRowUserKey" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row >
<el-table-column :reserve-selection="true" type="selection" width="45" align="center" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="NAME" label="姓名" />
<el-table-column prop="PHONE" label="电话" />
<el-table-column prop="IS_SPECIAL_JOB" label="是否特殊工种">
<template slot-scope="scope">
<span v-if="scope.row.IS_SPECIAL_JOB=='0'"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop="ISFLOW" label="是否流动人员" >
<template slot-scope="scope">
<span v-if="scope.row.ISFLOW=='0'"></span>
<span v-else></span>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="usertotal" :page.sync="userListQuery.page" :limit.sync="userListQuery.limit" @pagination="getUserList" />
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirm"> </el-button>
<el-button @click="dialogFormEdit = false"> </el-button>
</div>
</el-dialog>
<div class="ui-foot">
<el-button plain type="info" @click="goBack"> </el-button>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
import { upload } from '@/utils/upload'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
dayTime: [],
dialogFormEdit: false,
dialogFormEditState: false,
listLoading: true,
userListLoading:true,
treeLoading: false,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
userListQuery: {
page: 1,
limit: 10
},
form: {
FGS_ID:'',
CORPINFO_ID: '',
USER_ID:JSON.parse(sessionStorage.getItem('user')).USER_ID
},
total: 0,
usertotal: 0,
KEYWORDS: '',
ISFLOW: '',
DEPART_STATE: '',
varList: [],
multipleSelectionAll: [], //
multipleSelection: [], //
dialogType: 'saveUser',
disabledLCSelect: false,
displayLCSelect: 'display: block',
disabledLCInput: true,
displayLCInput: 'display: none',
LearnerCategoryList: [],
searchForm: {
FGS_ID:'',
CORPINFO_ID: '',
KEYWORDS: ''
},
config: config,
dialogVisible: false,
roleList: [],
postList: [],
dialogFormDaoru: false,
daoruFrom: {
FFILE: '',
FFILEName: ''
},
PARENTID: '0',
fgsList: [],
userList:[],
selectedRows:[], //
USER_ID: '',
LOGIN_USER: JSON.parse(sessionStorage.getItem('user')).USER_ID,
}
},
watch: {
},
created() {
this.form.FGS_ID = this.$parent.FGS_ID;
this.searchForm.FGS_ID = this.$parent.FGS_ID;
this.form.CORPINFO_ID = this.$parent.CORPINFO_ID;
this.searchForm.CORPINFO_ID = this.$parent.CORPINFO_ID;
this.getList();
this.hasButton()
},
mounted() {
this.handleEdit(this.$parent.USER_ID)
this.getDict()
},
methods: {
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
goKeyReset() {
this.searchForm.KEYWORDS = ''
this.getList()
},
goBack() {
this.$parent.activeName = 'List'
},
getList() {
this.listLoading = true
requestFN(
'/corpUserFgs/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
...this.searchForm
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.fgsList = data.fgsList
console.log(this.varList)
this.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
getUserList(){
this.userListLoading = true
requestFN(
'/corpUserFgs/userList?showCount=' + this.userListQuery.limit + '&currentPage=' + this.userListQuery.page,
{
FGS_ID:this.searchForm.FGS_ID,
CORPINFO_ID:this.searchForm.CORPINFO_ID
}
).then((data) => {
this.userListLoading = false
this.userList = data.varList
console.log(this.varList)
this.usertotal = data.page.totalResult
}).catch((e) => {
this.userListLoading = false
})
},
getRowKey(row) {
return row.CORP_USER_FGS_ID
},
getRowUserKey(row) {
return row.USER_ID
},
//
hasButton() {
var keys = 'user:add,user:del,user:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.userfhadminadd
this.del = data.userfhadmindel
this.edit = data.userfhadminedit
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.dialogFormEdit = true;
this.getUserList();
this.$refs.userListTable.clearSelection();
},
confirm() {
if(this.selectedRows.length==0){
this.$message.error('请选择要关联的人员');
return;
}
var userIds = '';
for(var i =0 ;i<this.selectedRows.length;i++){
if(i == 0){
userIds = this.selectedRows[0].USER_ID;
}else {
userIds += ',';
userIds += this.selectedRows[i].USER_ID;
}
}
this.listLoading = true
requestFN(
'/corpUserFgs/add',
{
...this.form,
userIds: userIds
}
).then((data) => {
if(data.result=='fail'){
this.$message.error(data.msg);
}
this.listLoading = false
this.dialogFormEdit = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
handleDel(row){
this.listLoading = true
requestFN(
'/corpUserFgs/delete',
{
CORP_USER_FGS_ID:row.CORP_USER_FGS_ID,
USER_ID:JSON.parse(sessionStorage.getItem('user')).USER_ID
}
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
//
handleSelectionChange(selection){
this.selectedRows = selection;
},
}
}
</script>
<style lang="scss" scoped>
.el-dialog__body{
padding: 0;
background: red;
}
.mark_up{
margin-bottom:20px;
margin-left: 110px;
}
.icons-container {
margin: 0;
overflow: hidden;
.grid {
position: relative;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.icon-item {
margin-bottom: 10px;
height: 70px;
text-align: center;
width: 100px;
float: left;
font-size: 24px;
color: #24292e;
cursor: pointer;
span {
display: block;
font-size: 14px;
margin-top: 10px;
}
}
.disabled {
pointer-events: none;
}
}
.filter-btn-group{
position: relative;
}
.filter-flot{
position: absolute;
right: 0;
top: 0;
}
.uploader{
width: 570px;
display: flex;
align-items: center;
}
.el-form-item__content{
line-height: 1;
}
.uo-flex{
display: flex
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
border: 1px dashed #d9d9d9;
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
<style lang="sass" scoped>
.el-row
margin-bottom: 16px
&:last-child
margin-bottom: 0
.form-group
display: flex
align-items: center
margin-right: 20px
.form-label
padding: 9px 15px
font-size: 14px
width: 240px
font-weight: 400
line-height: 20px
text-align: right
margin-bottom: 0
.star
color: red
padding-right: 4px
.input-block
flex: 1
min-height: 36px
position: relative
.disContent
padding: 0 20px
display: flex
align-items: center
flex-wrap: wrap
.img-div
position: relative
margin: auto 10px 10px 10px
width: 20px
height: 20px
border-radius: 4px
&>img
width: 2%
height: 3%
.disContent-hide
position: absolute
width: 100%
height: 100%
border-radius: 4px
background-color: rgba(48, 48, 48, 0.59)
display: none
top: 0
left: 0
.Delete
position: absolute
bottom: 14px
right: 10px
font-size: 16px
color: white
cursor: pointer
.editCss
.Delete
font-size: 16px
right: 90px
.yuLan
position: absolute
bottom: 23px
right: 50px
font-size: 16px
color: white
cursor: pointer
.yuLanImg
position: absolute
bottom: 0
right: 0
width: 100%
height: 100%
opacity: 0
.img-div:hover .disContent-hide
display: block
.pitchCss
border: 1px solid #202e78
transition: all linear 0.1s
width: 116px
height: 116px
</style>

View File

@ -0,0 +1,412 @@
<template>
<div class="icons-container">
<el-container>
<el-main>
<el-form label-width="100px">
<el-row>
<el-col :span="4">
<el-form-item label="分公司">
<el-select v-model="searchForm.FGS_ID" clearable placeholder="请选择要分公司">
<el-option v-for="item in fgsList" :key="item.CORPINFO_ID" :label="item.CORP_NAME" :value="item.CORPINFO_ID" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="20px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table v-loading="listLoading" ref="multipleTable" :data="varList" :row-key="getRowKey" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row>
<el-table-column :reserve-selection="true" type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="FGS_NAME" label="分公司名称" />
<el-table-column prop="NUM" label="已关联人数" />
<el-table-column label="操作">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDel(row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</el-main>
</el-container>
<div/>
<el-dialog :visible.sync="dialogFormEdit" title="关联分公司" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="150px" style="width: 500px;">
<el-form-item label="选择关联分公司" prop="REVIEW_TIME">
<el-select v-model="form.FGS_ID" clearable placeholder="请选择要关联的分公司">
<el-option v-for="item in fgsList" :key="item.CORPINFO_ID" :label="item.CORP_NAME" :value="item.CORPINFO_ID" />
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirm"> </el-button>
<el-button @click="dialogFormEdit = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
import { upload } from '@/utils/upload'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
dayTime: [],
dialogFormEdit: false,
dialogFormEditState: false,
listLoading: true,
treeLoading: false,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
form: {
FGS_ID:'',
CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID,
USER_ID:JSON.parse(sessionStorage.getItem('user')).USER_ID
},
total: 0,
KEYWORDS: '',
ISFLOW: '',
DEPART_STATE: '',
varList: [],
multipleSelectionAll: [], //
multipleSelection: [], //
dialogType: 'saveUser',
disabledLCSelect: false,
displayLCSelect: 'display: block',
disabledLCInput: true,
displayLCInput: 'display: none',
LearnerCategoryList: [],
searchForm: {
FGS_ID: ''
},
config: config,
dialogVisible: false,
roleList: [],
postList: [],
dialogFormDaoru: false,
daoruFrom: {
FFILE: '',
FFILEName: ''
},
PARENTID: '0',
fgsList: [],
datePage: 0,
USER_ID: '',
LOGIN_USER: JSON.parse(sessionStorage.getItem('user')).USER_ID
}
},
watch: {
},
created() {
this.getList();
this.hasButton()
},
methods: {
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
goKeyReset() {
this.searchForm.FGS_ID = ''
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/corpFgs/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
...this.searchForm,
CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.fgsList = data.fgsList
console.log(this.varList)
this.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
getRowKey(row) {
return row.CORP_FGS_ID
},
//
hasButton() {
var keys = 'user:add,user:del,user:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.userfhadminadd
this.del = data.userfhadmindel
this.edit = data.userfhadminedit
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.dialogFormEdit = true
},
confirm() {
if(!this.form.FGS_ID){
this.$message.error('请选择要关联的分公司');
return;
}
this.listLoading = true
requestFN(
'/corpFgs/add',
{
...this.form
}
).then((data) => {
if(data.result=='fail'){
this.$message.error(data.msg);
}
this.form.FGS_ID = '';
this.listLoading = false
this.dialogFormEdit = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
handleDel(row){
this.listLoading = true
requestFN(
'/corpFgs/delete',
{
FGS_ID:row.FGS_ID,
CORPINFO_ID: row.CORPINFO_ID,
USER_ID:JSON.parse(sessionStorage.getItem('user')).USER_ID,
CORP_FGS_ID:row.CORP_FGS_ID
}
).then((data) => {
if(data.result=='fail'){
this.$message.error(data.msg);
}
this.listLoading = false
this.dialogFormEdit = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
//
handleEdit(row) {
this.$parent.FGS_ID = row.FGS_ID
this.$parent.CORPINFO_ID = row.CORPINFO_ID
this.$parent.activeName = 'Edit'
},
}
}
</script>
<style lang="scss" scoped>
.el-dialog__body{
padding: 0;
background: red;
}
.mark_up{
margin-bottom:20px;
margin-left: 110px;
}
.icons-container {
margin: 0;
overflow: hidden;
.grid {
position: relative;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.icon-item {
margin-bottom: 10px;
height: 70px;
text-align: center;
width: 100px;
float: left;
font-size: 24px;
color: #24292e;
cursor: pointer;
span {
display: block;
font-size: 14px;
margin-top: 10px;
}
}
.disabled {
pointer-events: none;
}
}
.filter-btn-group{
position: relative;
}
.filter-flot{
position: absolute;
right: 0;
top: 0;
}
.uploader{
width: 570px;
display: flex;
align-items: center;
}
.el-form-item__content{
line-height: 1;
}
.uo-flex{
display: flex
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
border: 1px dashed #d9d9d9;
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
<style lang="sass" scoped>
.el-row
margin-bottom: 16px
&:last-child
margin-bottom: 0
.form-group
display: flex
align-items: center
margin-right: 20px
.form-label
padding: 9px 15px
font-size: 14px
width: 240px
font-weight: 400
line-height: 20px
text-align: right
margin-bottom: 0
.star
color: red
padding-right: 4px
.input-block
flex: 1
min-height: 36px
position: relative
.disContent
padding: 0 20px
display: flex
align-items: center
flex-wrap: wrap
.img-div
position: relative
margin: auto 10px 10px 10px
width: 20px
height: 20px
border-radius: 4px
&>img
width: 2%
height: 3%
.disContent-hide
position: absolute
width: 100%
height: 100%
border-radius: 4px
background-color: rgba(48, 48, 48, 0.59)
display: none
top: 0
left: 0
.Delete
position: absolute
bottom: 14px
right: 10px
font-size: 16px
color: white
cursor: pointer
.editCss
.Delete
font-size: 16px
right: 90px
.yuLan
position: absolute
bottom: 23px
right: 50px
font-size: 16px
color: white
cursor: pointer
.yuLanImg
position: absolute
bottom: 0
right: 0
width: 100%
height: 100%
opacity: 0
.img-div:hover .disContent-hide
display: block
.pitchCss
border: 1px solid #202e78
transition: all linear 0.1s
width: 116px
height: 116px
</style>

View File

@ -0,0 +1,35 @@
<template>
<div>
<List v-show="activeName=='List'" ref="list" />
<Edit v-if="activeName=='Edit'" />
</div>
</template>
<script>
import List from './components/list'
import Edit from './components/edit'
export default {
components: {
List: List,
Edit: Edit,
},
data() {
return {
activeName: 'List',
FGS_ID: '',
CORPINFO_ID:''
}
},
watch: {
activeName(val) {
if (val == 'List') {
this.$refs.list.getList()
}
}
}
}
</script>
<style scoped>
</style>