【修改】修改部门

This commit is contained in:
zhoulingpo
2023-05-16 19:08:01 +08:00
parent a03e268e33
commit c76a892a39
5 changed files with 68 additions and 67 deletions
+30 -30
View File
@@ -22,7 +22,7 @@
<el-col :xl="8" :lg="8"> <el-col :xl="8" :lg="8">
<el-form-item label="部门名称" class="search-item"> <el-form-item label="部门名称" class="search-item">
<!-- <el-input :placeholder="'根据角色名查询'" class="search-item" v-model="searchForm.roleName"/>--> <!-- <el-input :placeholder="'根据角色名查询'" class="search-item" v-model="searchForm.roleName"/>-->
<el-input v-model="searchForm.orgName" maxlength="50" placeholder="请输入部门名称"></el-input> <el-input v-model="searchForm.longName" maxlength="50" placeholder="请输入部门名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xl="8" :lg="8"> <el-col :xl="8" :lg="8">
@@ -31,7 +31,7 @@
<!-- v-model="searchForm.uname"--> <!-- v-model="searchForm.uname"-->
<!-- placeholder="根据姓名查询"--> <!-- placeholder="根据姓名查询"-->
<!-- clearable></el-input>--> <!-- clearable></el-input>-->
<el-input :placeholder="'请输入部门编码'" v-model="searchForm.orgCode"/> <el-input :placeholder="'请输入部门编码'" v-model="searchForm.departmentCode"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xl="8" :lg="24"> <el-col :xl="8" :lg="24">
@@ -71,7 +71,7 @@
<el-table-column v-if="maxSelected && maxSelected == 1" label="" width="35" align="center"> <el-table-column v-if="maxSelected && maxSelected == 1" label="" width="35" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-radio class="tableRadio" v-model="tableChecked" @change="radioChange(scope.row)" <el-radio class="tableRadio" v-model="tableChecked" @change="radioChange(scope.row)"
:label="scope.row.orgCode">{{ null }} :label="scope.row.id">{{ null }}
</el-radio> </el-radio>
</template> </template>
</el-table-column> </el-table-column>
@@ -85,18 +85,18 @@
<!-- v-if="workNumFlag"--> <!-- v-if="workNumFlag"-->
<el-table-column <el-table-column
label="部门名称" label="部门名称"
prop="orgName" prop="longName"
align="center" align="center"
show-overflow-tooltip> show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="部门编码" label="部门编码"
prop="orgCode" prop="departmentCode"
align="center" align="center"
show-overflow-tooltip> show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="orgLevel" prop="leveL"
width="120" width="120"
label="部门级别" label="部门级别"
align="center" align="center"
@@ -124,8 +124,8 @@
size="medium" size="medium"
closable closable
v-for="item in checkedList" v-for="item in checkedList"
:key="item.usid || item.USID || item.id || item.orgCode" :key="item.usid || item.USID || item.id "
@close="handleRemove(item)">{{ item.uname || item.USNAME || item.name || item.orgName}} @close="handleRemove(item)">{{ item.uname || item.USNAME || item.name || item.longName}}
</el-tag> </el-tag>
<el-button <el-button
type="danger" type="danger"
@@ -489,7 +489,7 @@ export default {
visibleOrgClearBtn: false, visibleOrgClearBtn: false,
searchForm: { searchForm: {
orgId: '', orgId: '',
orgName: '', longName: '',
USNAME: '', USNAME: '',
uname: '', uname: '',
roleName: '', roleName: '',
@@ -541,7 +541,7 @@ export default {
handleClose () { handleClose () {
this.searchForm = { this.searchForm = {
orgId: '', orgId: '',
orgName: '', longName: '',
USNAME: '', USNAME: '',
uname: '', uname: '',
roleId: '', roleId: '',
@@ -570,12 +570,12 @@ export default {
if (chkItem.uname) { if (chkItem.uname) {
chkItem.uname = chkItem.uname + '_' + chkItem.account chkItem.uname = chkItem.uname + '_' + chkItem.account
chkItem.USNAME = chkItem.USNAME + '_' + chkItem.account chkItem.USNAME = chkItem.USNAME + '_' + chkItem.account
chkItem.orgName = chkItem.departmentName ? chkItem.departmentName : chkItem.orgName chkItem.longName = chkItem.departmentName ? chkItem.departmentName : chkItem.longName
} else if (!chkItem.uname && chkItem.USNAME) { } else if (!chkItem.uname && chkItem.USNAME) {
chkItem.uname = chkItem.USNAME chkItem.uname = chkItem.USNAME
chkItem.USNAME = chkItem.USNAME chkItem.USNAME = chkItem.USNAME
}else{ }else{
chkItem.orgName = chkItem.orgName chkItem.longName = chkItem.longName
} }
}) })
this.$emit('confirm', this.checkedList, checkedIdList) this.$emit('confirm', this.checkedList, checkedIdList)
@@ -593,8 +593,8 @@ export default {
this.$message.warning(`${this.config.attrName} 只能选择一个用户`) this.$message.warning(`${this.config.attrName} 只能选择一个用户`)
} else { } else {
const dataItem = this.checkedList[0] const dataItem = this.checkedList[0]
this.checkedName = dataItem.uname || dataItem.USNAME || dataItem.orgName this.checkedName = dataItem.uname || dataItem.USNAME || dataItem.longName
const id = dataItem.id || dataItem.USID || dataItem.usid || dataItem.orgCode const id = dataItem.id || dataItem.USID || dataItem.usid || dataItem.id
this.$emit('input', id) this.$emit('input', id)
this.$emit('on-checked', this.checkedName) this.$emit('on-checked', this.checkedName)
this.$emit('on-dept', dataItem.pOrgId, dataItem.pOrgName) this.$emit('on-dept', dataItem.pOrgId, dataItem.pOrgName)
@@ -626,7 +626,7 @@ export default {
this.page = 1 this.page = 1
this.searchForm = { this.searchForm = {
orgId: '', orgId: '',
orgName: '', longName: '',
USNAME: '', USNAME: '',
uname: '', uname: '',
account: '', account: '',
@@ -637,7 +637,7 @@ export default {
handleSearchOrgChecked (treeId, treeNode) { handleSearchOrgChecked (treeId, treeNode) {
this.searchForm.orgId = treeNode.id this.searchForm.orgId = treeNode.id
this.searchForm.orgName = treeNode.oldname || treeNode.name this.searchForm.longName = treeNode.oldname || treeNode.name
$('#orgInput').click() $('#orgInput').click()
}, },
@@ -651,7 +651,7 @@ export default {
res => { res => {
if (res.ok) { if (res.ok) {
res.data.map(item => { res.data.map(item => {
item.name = item.orgName item.name = item.longName
// item.icon = 'static/images/dept.png' // item.icon = 'static/images/dept.png'
}) })
this.orgZNodes = res.data this.orgZNodes = res.data
@@ -744,7 +744,7 @@ export default {
const selected = selection.length && selection.indexOf(row) !== -1 // 为true时选中,为 0 时(false)未选中 const selected = selection.length && selection.indexOf(row) !== -1 // 为true时选中,为 0 时(false)未选中
if (selected) { if (selected) {
selection.map(selItem => { selection.map(selItem => {
const id = selItem.USID || selItem.orgCode const id = selItem.USID || selItem.id
if (!this.checkedIdList.includes(id)) { if (!this.checkedIdList.includes(id)) {
this.checkedIdList.push(id) this.checkedIdList.push(id)
this.checkedList.push(row) this.checkedList.push(row)
@@ -757,7 +757,7 @@ export default {
selectionRowAll (selection) { selectionRowAll (selection) {
if (selection.length > 0) { if (selection.length > 0) {
selection.map(selItem => { selection.map(selItem => {
const id = selItem.USID || selItem.orgCode const id = selItem.USID || selItem.id
if (!this.checkedIdList.includes(id)) { if (!this.checkedIdList.includes(id)) {
this.checkedIdList.push(id) this.checkedIdList.push(id)
this.checkedList.push(selItem) this.checkedList.push(selItem)
@@ -809,7 +809,7 @@ export default {
handleOrgDel () { handleOrgDel () {
this.searchForm.orgId = '' this.searchForm.orgId = ''
this.searchForm.orgName = '' this.searchForm.longName = ''
}, },
/** /**
@@ -826,7 +826,7 @@ export default {
if (this.tableData[i].USID == row.USID && !this.isOrg) { if (this.tableData[i].USID == row.USID && !this.isOrg) {
// console.log(this.tableData[i], '666') // console.log(this.tableData[i], '666')
this.$refs.orgTable && this.$refs.orgTable.toggleRowSelection(this.tableData[i]) this.$refs.orgTable && this.$refs.orgTable.toggleRowSelection(this.tableData[i])
}else if (this.tableData[i].orgCode == row.orgCode&& this.isOrg){ }else if (this.tableData[i].id == row.id&& this.isOrg){
this.$refs.orgTable && this.$refs.orgTable.toggleRowSelection(this.tableData[i]) this.$refs.orgTable && this.$refs.orgTable.toggleRowSelection(this.tableData[i])
} }
@@ -865,7 +865,7 @@ export default {
}, },
handleMouseEnter () { handleMouseEnter () {
if (this.searchForm.orgName !== '') { if (this.searchForm.longName !== '') {
this.visibleOrgClearBtn = true this.visibleOrgClearBtn = true
} }
}, },
@@ -945,8 +945,8 @@ export default {
if(this.isOrg){ if(this.isOrg){
idList.map((id, index) => { idList.map((id, index) => {
checkedList.push({ checkedList.push({
orgCode:id, id:id,
orgName:nameList[index] longName:nameList[index]
}) })
}) })
}else{ }else{
@@ -968,10 +968,10 @@ export default {
} }
if (this.searchVal && this.searchVal.type == 'qcrbm') { if (this.searchVal && this.searchVal.type == 'qcrbm') {
this.searchForm.orgId = this.searchVal.OrgId this.searchForm.orgId = this.searchVal.OrgId
this.searchForm.orgName = this.searchVal.orgName this.searchForm.longName = this.searchVal.longName
} else { } else {
this.searchForm.orgId = '' this.searchForm.orgId = ''
this.searchForm.orgName = '' this.searchForm.longName = ''
} }
this.getRoleAndUserByOrgIdPage() this.getRoleAndUserByOrgIdPage()
} }
@@ -996,8 +996,8 @@ export default {
if (this.config.value !== '') { if (this.config.value !== '') {
if(this.isOrg){ if(this.isOrg){
this.checkedList = [{ this.checkedList = [{
orgCode: this.config.value, id: this.config.value,
orgName: this.config.valueName longName: this.config.valueName
}] }]
}else{ }else{
this.checkedList = [{ this.checkedList = [{
@@ -1017,8 +1017,8 @@ export default {
if(this.isOrg){ if(this.isOrg){
idList.map((id, index) => { idList.map((id, index) => {
checkedList.push({ checkedList.push({
orgCode: id, id: id,
orgName: nameList[index] longName: nameList[index]
}) })
}) })
}else { }else {
+32 -31
View File
@@ -8,7 +8,7 @@
<el-col :span="20"> <el-col :span="20">
<div class="search-box-left"> <div class="search-box-left">
<label>部门名称:</label> <label>部门名称:</label>
<el-input v-model="q.orgName" placeholder="请输入部门名称"></el-input> <el-input v-model="q.longName" placeholder="请输入部门名称"></el-input>
<!-- <label>角色名:</label>--> <!-- <label>角色名:</label>-->
<!-- <el-select v-model="q.roleName" class="icon-auth" placeholder="请选择角色名">--> <!-- <el-select v-model="q.roleName" class="icon-auth" placeholder="请选择角色名">-->
<!-- <el-option label="全部" value=""></el-option>--> <!-- <el-option label="全部" value=""></el-option>-->
@@ -50,10 +50,10 @@
{{ rowIndex + (q.pageNo - 1) * q.pageSize + 1 }} {{ rowIndex + (q.pageNo - 1) * q.pageSize + 1 }}
</template> </template>
</vxe-column> </vxe-column>
<vxe-column show-overflow show-header-overflow field="orgCode" title="部门编码"></vxe-column> <vxe-column show-overflow show-header-overflow field="departmentCode" title="部门编码"></vxe-column>
<vxe-column show-overflow show-header-overflow field="orgName" title="部门名称"></vxe-column> <vxe-column show-overflow show-header-overflow field="longName" title="部门名称"></vxe-column>
<vxe-column show-overflow show-header-overflow field="orgLevel" title="部门级别"></vxe-column> <vxe-column show-overflow show-header-overflow field="leveL" title="部门级别"></vxe-column>
<vxe-column show-overflow show-header-overflow field="orgShortName" title="部门简称"></vxe-column> <vxe-column show-overflow show-header-overflow field="shortName" title="部门简称"></vxe-column>
<vxe-column show-overflow show-header-overflow field="attribution" title="归属地"></vxe-column> <vxe-column show-overflow show-header-overflow field="attribution" title="归属地"></vxe-column>
<vxe-column show-overflow show-header-overflow field="bmdm14" title="部门14位码"></vxe-column> <vxe-column show-overflow show-header-overflow field="bmdm14" title="部门14位码"></vxe-column>
<vxe-column show-overflow show-header-overflow field="updateTime" title="更新时间"></vxe-column> <vxe-column show-overflow show-header-overflow field="updateTime" title="更新时间"></vxe-column>
@@ -86,19 +86,19 @@
<div class="user-form showLimit"> <div class="user-form showLimit">
<el-form :model="form" label-width="186px" :disabled="mode === 'view'"> <el-form :model="form" label-width="186px" :disabled="mode === 'view'">
<el-form-item label="部门名称:" required> <el-form-item label="部门名称:" required>
<el-input v-model="form.orgName" maxlength="50" show-word-limit placeholder="请输入部门名称"></el-input> <el-input v-model="form.longName" maxlength="50" show-word-limit placeholder="请输入部门名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="部门编码:" required> <el-form-item label="部门编码:" required>
<el-input v-model="form.orgCode" :disabled="dialogTitle=='编辑'" maxlength="50" show-word-limit placeholder="请输入部门编码"></el-input> <el-input v-model="form.departmentCode" :disabled="dialogTitle=='编辑'" maxlength="50" show-word-limit placeholder="请输入部门编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="部门级别:" required> <el-form-item label="部门级别:" required>
<el-input v-model="form.orgLevel" maxlength="10" show-word-limit placeholder="请输入部门级别"></el-input> <el-input v-model="form.leveL" maxlength="10" show-word-limit placeholder="请输入部门级别"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="父部门编码:" > <el-form-item label="父部门编码:" >
<el-input v-model="form.supOrgCode" maxlength="50" show-word-limit placeholder="请输入父部门编码"></el-input> <el-input v-model="form.parentID" maxlength="50" show-word-limit placeholder="请输入父部门编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="部门简称:" > <el-form-item label="部门简称:" >
<el-input v-model="form.orgShortName" maxlength="50" show-word-limit placeholder="请输入部门简称"></el-input> <el-input v-model="form.shortName" maxlength="50" show-word-limit placeholder="请输入部门简称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="归属地:" > <el-form-item label="归属地:" >
<el-input v-model="form.attribution" maxlength="50" show-word-limit placeholder="请输入归属地"></el-input> <el-input v-model="form.attribution" maxlength="50" show-word-limit placeholder="请输入归属地"></el-input>
@@ -113,7 +113,7 @@
<!--<el-input v-model="repassword" maxlength="20" type="password" placeholder="请确认密码"></el-input>--> <!--<el-input v-model="repassword" maxlength="20" type="password" placeholder="请确认密码"></el-input>-->
<!--</el-form-item>--> <!--</el-form-item>-->
<!-- <el-form-item label="手机号:">--> <!-- <el-form-item label="手机号:">-->
<!-- <el-input v-model="form.orgCode" placeholder="请输入手机号"></el-input>--> <!-- <el-input v-model="form.departmentCode" placeholder="请输入手机号"></el-input>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- <el-form-item label="部门:">--> <!-- <el-form-item label="部门:">-->
<!-- <el-input v-model="form.department" maxlength="50" show-word-limit placeholder="请输入部门"></el-input>--> <!-- <el-input v-model="form.department" maxlength="50" show-word-limit placeholder="请输入部门"></el-input>-->
@@ -148,7 +148,7 @@ export default {
data () { data () {
return { return {
q: { q: {
orgName: '', // 用户名 longName: '', // 用户名
// roleName: '', // 角色名称 // roleName: '', // 角色名称
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
@@ -158,11 +158,11 @@ export default {
mode: '', mode: '',
dialogUser: false, dialogUser: false,
form: { form: {
orgName: '', // 部门名称 longName: '', // 部门名称
orgCode: '', // 部门编码 departmentCode: '', // 部门编码
orgLevel: '', // 部门级别 leveL: '', // 部门级别
supOrgCode: '', // 父部门编码 parentID: '', // 父部门编码
orgShortName: '', // 部门简称 shortName: '', // 部门简称
attribution: '', //归属地 attribution: '', //归属地
bmdm14: '', // 部门14位码 bmdm14: '', // 部门14位码
// roleIdList: [''] // 角色 // roleIdList: [''] // 角色
@@ -201,7 +201,7 @@ export default {
// 重置 // 重置
reset () { reset () {
this.q = { this.q = {
orgName: '', // 部门名称 longName: '', // 部门名称
// roleName: '', // 角色名称 // roleName: '', // 角色名称
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
@@ -225,11 +225,11 @@ export default {
add () { add () {
this.mode = 'add' this.mode = 'add'
this.form = { this.form = {
orgName: '', // 部门名称 longName: '', // 部门名称
orgCode: '', // 部门编码 departmentCode: '', // 部门编码
orgLevel: '', // 部门级别 leveL: '', // 部门级别
supOrgCode: '', // 父部门编码 parentID: '', // 父部门编码
orgShortName: '', // 部门简称 shortName: '', // 部门简称
attribution: '', //归属地 attribution: '', //归属地
bmdm14: '', // 部门14位码 bmdm14: '', // 部门14位码
// roleIdList: [''] // 角色 // roleIdList: [''] // 角色
@@ -258,13 +258,13 @@ export default {
}, },
// 验证 // 验证
checkUserForm () { checkUserForm () {
if (!this.form.orgName) { if (!this.form.longName) {
return this.$message.warning('请检查部门名称') && false return this.$message.warning('请检查部门名称') && false
} }
if (!this.form.orgCode) { if (!this.form.departmentCode) {
return this.$message.warning('请检查部门编码') && false return this.$message.warning('请检查部门编码') && false
} }
if (!this.form.orgLevel || !(/^[a-zA-Z0-9]*$/.test(this.form.orgLevel))) { if (!this.form.leveL || !(/^[a-zA-Z0-9]*$/.test(this.form.leveL))) {
return this.$message.warning('部门级别只能为纯数字') && false return this.$message.warning('部门级别只能为纯数字') && false
} }
return true return true
@@ -272,6 +272,7 @@ export default {
// 新增用户 // 新增用户
sysOrgAddOrg () { sysOrgAddOrg () {
if (!this.checkUserForm()) return if (!this.checkUserForm()) return
let form={}
const data = JSON.parse(JSON.stringify(this.form)) const data = JSON.parse(JSON.stringify(this.form))
this.$api.org.sysOrgAddUser(data).then(_ => { this.$api.org.sysOrgAddUser(data).then(_ => {
@@ -284,11 +285,11 @@ export default {
openRowData (mode, row) { openRowData (mode, row) {
this.mode = mode this.mode = mode
this.form = { this.form = {
orgName: row.orgName, // 部门名称 longName: row.longName, // 部门名称
orgLevel: row.orgLevel, // 部门级别 leveL: row.leveL, // 部门级别
orgCode: row.orgCode, // 部门级别 departmentCode: row.departmentCode, // 部门级别
supOrgCode: row.supOrgCode, // 父部门编码 parentID: row.parentID, // 父部门编码
orgShortName: row.orgShortName, // 部门简称 shortName: row.shortName, // 部门简称
id: row.id, // ID id: row.id, // ID
attribution: row.attribution, // 归属地 attribution: row.attribution, // 归属地
bmdm14: row.bmdm14 // 部门14位码 bmdm14: row.bmdm14 // 部门14位码
+2 -2
View File
@@ -168,8 +168,8 @@ export default {
const parts = [] const parts = []
const partsName = [] const partsName = []
checkedList.map((item, index) => { checkedList.map((item, index) => {
parts.push(item.orgCode) parts.push(item.id)
partsName.push(item.orgName) partsName.push(item.longName)
}) })
this.form.orgId = parts.toString() this.form.orgId = parts.toString()
this.form.orgName = partsName.toString() this.form.orgName = partsName.toString()
@@ -310,8 +310,8 @@ export default {
const parts = [] const parts = []
const partsName = [] const partsName = []
checkedList.map((item, index) => { checkedList.map((item, index) => {
parts.push(item.orgCode) parts.push(item.id)
partsName.push(item.orgName) partsName.push(item.longName)
}) })
this.qcrList = checkedList this.qcrList = checkedList
+2 -2
View File
@@ -198,8 +198,8 @@ export default {
// 需要给部门带出来 // 需要给部门带出来
if(this.$store.getters.userInfo.orgEOList.length>0){ if(this.$store.getters.userInfo.orgEOList.length>0){
let temp=this.$store.getters.userInfo.orgEOList let temp=this.$store.getters.userInfo.orgEOList
this.$set(this.processForm,'departmentName',temp[0].orgName) this.$set(this.processForm,'departmentName',temp[0].longName)
this.$set(this.processForm,'department',temp[0].orgCode) this.$set(this.processForm,'department',temp[0].id)
console.log(this.processForm,"wowowwoo") console.log(this.processForm,"wowowwoo")
} }
} }