4 changed files with 322 additions and 2 deletions
@ -0,0 +1,65 @@ |
|||||
|
|
||||
|
|
||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
// 申请加入组织列表
|
||||
|
export function applyToJoinList(query) { |
||||
|
return request({ |
||||
|
url: '/system/dept/applyToJoinList', |
||||
|
method: 'post', |
||||
|
data: query |
||||
|
}) |
||||
|
} |
||||
|
// 根据cryptoDeptId查看组织
|
||||
|
export function getDeptByCryptoDeptId(query) { |
||||
|
return request({ |
||||
|
url: '/system/dept/getDeptByCryptoDeptId', |
||||
|
method: 'post', |
||||
|
data: query |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 审核申请加入组织列表
|
||||
|
export function applyToJoin(query) { |
||||
|
return request({ |
||||
|
url: '/system/dept/applyToJoin', |
||||
|
method: 'post', |
||||
|
data: query |
||||
|
}) |
||||
|
} |
||||
|
// 申请加入组织列表
|
||||
|
export function selfCreatedList(query) { |
||||
|
return request({ |
||||
|
url: '/system/dept/selfCreatedList', |
||||
|
method: 'post', |
||||
|
data: query |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 创建根节点
|
||||
|
export function createNewRootNode(query) { |
||||
|
return request({ |
||||
|
url: '/system/dept/createNewRootNode', |
||||
|
method: 'post', |
||||
|
data: query |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 同意申请加入组织
|
||||
|
export function agreeApplyToJoin(query) { |
||||
|
return request({ |
||||
|
url: '/system/dept/agreeApplyToJoin', |
||||
|
method: 'post', |
||||
|
data: query |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 拒绝申请加入组织
|
||||
|
export function refuseApplyToJoin(query) { |
||||
|
return request({ |
||||
|
url: '/system/dept/refuseApplyToJoin', |
||||
|
method: 'post', |
||||
|
data: query |
||||
|
}) |
||||
|
} |
@ -0,0 +1,254 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<el-row :gutter="10" class="mb8"> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
plain |
||||
|
icon="el-icon-plus" |
||||
|
size="mini" |
||||
|
@click="handleAdd" |
||||
|
v-hasPermi="['system:dept:add']" |
||||
|
>新增所属组织</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
plain |
||||
|
icon="el-icon-plus" |
||||
|
size="mini" |
||||
|
@click="handleAddRoot" |
||||
|
v-hasPermi="['system:dept:add']" |
||||
|
>创建根节点组织</el-button> |
||||
|
</el-col> |
||||
|
<!-- <right-toolbar @queryTable="getList"></right-toolbar> --> |
||||
|
</el-row> |
||||
|
<el-tabs type="border-card"> |
||||
|
<el-tab-pane label="我的申请"> |
||||
|
<el-table :data="deptList"> |
||||
|
<el-table-column label="归属企业名称" align="center" prop="parentName" /> |
||||
|
<el-table-column label="企业名称" align="center" prop="deptName" /> |
||||
|
<el-table-column label="创建日期" align="center" prop="createTime" /> |
||||
|
<el-table-column label="创建人" align="center" prop="createBy" /> |
||||
|
<el-table-column label="审核状态" align="center" prop="delFlag"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.row.delFlag == 2" class="text-warning">待审核</span> |
||||
|
<span v-else-if="scope.row.delFlag == 0" class="text-navy">审核通过</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
</el-table> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane > |
||||
|
<span slot="label"> |
||||
|
<el-badge :is-dot="verifyList.length>0" class="item"> |
||||
|
我的审核 |
||||
|
</el-badge> |
||||
|
</span> |
||||
|
<el-table :data="verifyList"> |
||||
|
<el-table-column label="归属企业名称" align="center" prop="parentName" /> |
||||
|
<el-table-column label="企业名称" align="center" prop="deptName" /> |
||||
|
<el-table-column label="创建日期" align="center" prop="createTime" /> |
||||
|
<el-table-column label="创建人" align="center" prop="createBy" /> |
||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
class="text-navy" |
||||
|
@click="handleVerify(scope.row.deptId,true)" |
||||
|
>通过</el-button> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
class="text-danger" |
||||
|
@click="handleVerify(scope.row.deptId,false)" |
||||
|
>驳回</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> |
||||
|
|
||||
|
<!-- <pagination |
||||
|
v-show="total>0" |
||||
|
:total="total" |
||||
|
:page.sync="queryParams.pageNum" |
||||
|
:limit.sync="queryParams.pageSize" |
||||
|
@pagination="getList" |
||||
|
/> --> |
||||
|
<el-dialog title="申请所属组织" :visible.sync="open" width="500px" append-to-body> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="180px"> |
||||
|
<el-form-item label="所属组织编号(对方):" prop="applyCode"> |
||||
|
<el-input |
||||
|
v-model="form.applyCode" |
||||
|
@blur="getEnterpriseByApplyCode" |
||||
|
placeholder="请输入对方组织编号" |
||||
|
clearable |
||||
|
size="small" |
||||
|
style="width:250px" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label=""> |
||||
|
<span>{{applyEnterprise.name}}</span> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="submitForm('form')">确 定</el-button> |
||||
|
<el-button @click="cancel">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
<el-dialog title="创建根节点组织" :visible.sync="open2" width="500px" append-to-body> |
||||
|
<el-form ref="form2" :model="form2" :rules="rules2" label-width="150px"> |
||||
|
<el-form-item label="根节点组织名称:" prop="name"> |
||||
|
<el-input |
||||
|
v-model="form2.name" |
||||
|
placeholder="请输入组织名称" |
||||
|
clearable |
||||
|
size="small" |
||||
|
style="width:250px" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label=""> |
||||
|
<span>{{applyEnterprise.name}}</span> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="submitForm('form2')">确 定</el-button> |
||||
|
<el-button @click="cancel">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import {applyToJoinList,getDeptByCryptoDeptId,applyToJoin,createNewRootNode,selfCreatedList,agreeApplyToJoin,refuseApplyToJoin} from "@/api/company/companyDept" |
||||
|
export default { |
||||
|
name:"companyDept", |
||||
|
data(){ |
||||
|
return { |
||||
|
deptList:[], |
||||
|
verifyList:[], |
||||
|
|
||||
|
// 是否显示弹出层 |
||||
|
open: false, |
||||
|
open2: false, |
||||
|
// 总条数 |
||||
|
total: 0, |
||||
|
// 查询参数 |
||||
|
queryParams: { |
||||
|
pageNum: 1, |
||||
|
pageSize: 10 |
||||
|
}, |
||||
|
// 表单参数 |
||||
|
form: {}, |
||||
|
form2: {}, |
||||
|
// 表单校验 |
||||
|
rules: { |
||||
|
applyCode: [ |
||||
|
{ required: true, message: "组织编号不能为空", trigger: "blur" } |
||||
|
] |
||||
|
}, |
||||
|
rules2: { |
||||
|
name: [ |
||||
|
{ required: true, message: "组织名称不能为空", trigger: "blur" } |
||||
|
] |
||||
|
}, |
||||
|
applyEnterprise:{ |
||||
|
name:'', |
||||
|
id:'' |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
this.getList() |
||||
|
}, |
||||
|
methods:{ |
||||
|
getList(){ |
||||
|
applyToJoinList().then(res => { |
||||
|
this.verifyList = res.data |
||||
|
}) |
||||
|
selfCreatedList().then(res => { |
||||
|
this.deptList = res.data |
||||
|
}) |
||||
|
}, |
||||
|
handleAdd(){ |
||||
|
this.reset(); |
||||
|
this.open = true; |
||||
|
}, |
||||
|
handleAddRoot(){ |
||||
|
this.reset(); |
||||
|
this.open2 = true; |
||||
|
}, |
||||
|
// 根据组织编号查询组织名称 |
||||
|
getEnterpriseByApplyCode(){ |
||||
|
if(!this.form.applyCode || this.form.applyCode == '') { |
||||
|
this.applyEnterpriseName = '' |
||||
|
return |
||||
|
} |
||||
|
getDeptByCryptoDeptId({cryptoDeptId:this.form.applyCode }).then(res => { |
||||
|
this.applyEnterprise.name = res.msg |
||||
|
}) |
||||
|
}, |
||||
|
//审核按钮 |
||||
|
handleVerify(deptId,boolean){ |
||||
|
if(boolean) |
||||
|
{ |
||||
|
agreeApplyToJoin({deptId:deptId}).then(res => { |
||||
|
this.msgSuccess("审核通过"); |
||||
|
this.getList(); |
||||
|
}) |
||||
|
} else { |
||||
|
refuseApplyToJoin({deptId:deptId}).then(res => { |
||||
|
this.msgSuccess("审核驳回"); |
||||
|
this.getList(); |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
/** 提交按钮 */ |
||||
|
submitForm(form) { |
||||
|
this.$refs[form].validate(valid => { |
||||
|
if (valid) { |
||||
|
if(form == 'form') |
||||
|
{ |
||||
|
applyToJoin({cryptoDeptId:this.form.applyCode}).then(res => { |
||||
|
this.msgSuccess("申请成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}) |
||||
|
} else if (form == 'form2') |
||||
|
{ |
||||
|
createNewRootNode({deptName:this.form2.name}).then(res => { |
||||
|
this.msgSuccess("创建成功"); |
||||
|
this.open2 = false; |
||||
|
this.getList(); |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 取消按钮 |
||||
|
cancel() { |
||||
|
this.open = false; |
||||
|
this.open2 = false; |
||||
|
this.reset(); |
||||
|
}, |
||||
|
// 表单重置 |
||||
|
reset() { |
||||
|
this.form = {}; |
||||
|
this.resetForm("form"); |
||||
|
this.form2 = {}; |
||||
|
this.resetForm("form2"); |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss"> |
||||
|
.el-badge__content.is-fixed { |
||||
|
top: 7px; |
||||
|
} |
||||
|
.el-badge__content.is-fixed.is-dot { |
||||
|
right: 0; |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue