Merge branch 'feature/develop' of ssh://source.supwisdom.com:12388/leave-school/microservice into feature/develop
diff --git a/leave-school-vue/src/api/leaveschoolnode-api.js b/leave-school-vue/src/api/leaveschoolnode-api.js
index be89f15..381fe14 100644
--- a/leave-school-vue/src/api/leaveschoolnode-api.js
+++ b/leave-school-vue/src/api/leaveschoolnode-api.js
@@ -37,3 +37,59 @@
data
})
}
+
+export function getUser(params) {
+ return request({
+ url: '/api/procedures/node/get-user',
+ method: 'get',
+ params
+ })
+}
+
+export function getAuditorList(params) {
+ return request({
+ url: '/api/procedures/node/auditor-list',
+ method: 'get',
+ params
+ })
+}
+
+export function createNodeAuditor(data) {
+ return request({
+ url: '/api/procedures/node/create-node-auditor',
+ method: 'post',
+ data
+ })
+}
+
+export function deleteNodeAuditor(data) {
+ return request({
+ url: '/api/procedures/node/delete-node-auditor',
+ method: 'delete',
+ data
+ })
+}
+
+export function getPrincipalList(params) {
+ return request({
+ url: '/api/procedures/node/principal-list',
+ method: 'get',
+ params
+ })
+}
+
+export function createNodePrincipal(data) {
+ return request({
+ url: '/api/procedures/node/create-node-principal',
+ method: 'post',
+ data
+ })
+}
+
+export function deleteNodePrincipal(data) {
+ return request({
+ url: '/api/procedures/node/delete-node-principal',
+ method: 'delete',
+ data
+ })
+}
diff --git a/leave-school-vue/src/mock/index.js b/leave-school-vue/src/mock/index.js
index 49bf902..32c0d6e 100644
--- a/leave-school-vue/src/mock/index.js
+++ b/leave-school-vue/src/mock/index.js
@@ -132,6 +132,13 @@
Mock.mock(/\/api\/procedures\/node\/create-node/, 'post', leaveschoolnodeApi.createData)
Mock.mock(/\/api\/procedures\/node\/delete-node/, 'delete', leaveschoolnodeApi.deleteData)
Mock.mock(/\/api\/procedures\/node\/get-item/, 'get', leaveschoolnodeApi.getItem)
+Mock.mock(/\/api\/procedures\/node\/get-user/, 'get', leaveschoolnodeApi.getUser)
+Mock.mock(/\/api\/procedures\/node\/auditor-list/, 'get', leaveschoolnodeApi.getAuditorList)
+Mock.mock(/\/api\/procedures\/node\/create-node-auditor/, 'post', leaveschoolnodeApi.createNodeAuditor)
+Mock.mock(/\/api\/procedures\/node\/delete-node-auditor/, 'delete', leaveschoolnodeApi.deleteNodeAuditor)
+Mock.mock(/\/api\/procedures\/node\/principal-list/, 'get', leaveschoolnodeApi.getPrincipalList)
+Mock.mock(/\/api\/procedures\/node\/create-node-principal/, 'post', leaveschoolnodeApi.createNodeAuditor)
+Mock.mock(/\/api\/procedures\/node\/delete-node-principal/, 'delete', leaveschoolnodeApi.deleteNodeAuditor)
// 用户管理
Mock.mock(/\/api\/system\/user\/list-api/, 'get', userApi.getPage)
diff --git a/leave-school-vue/src/mock/leaveschoolnode.js b/leave-school-vue/src/mock/leaveschoolnode.js
index 10c7257..914b82a 100644
--- a/leave-school-vue/src/mock/leaveschoolnode.js
+++ b/leave-school-vue/src/mock/leaveschoolnode.js
@@ -42,6 +42,47 @@
}
]
+const userList = [
+ {
+ 'id': '1',
+ 'xm': '张三',
+ 'xb': { 'value': 'male', 'label': '男' },
+ 'ghxh': '11'
+ },
+ {
+ 'id': '2',
+ 'xm': '李四',
+ 'xb': { 'value': 'female', 'label': '女' },
+ 'ghxh': '22'
+ }
+]
+
+const auditorList = [
+ {
+ 'id': '11',
+ 'auditNode': { 'id': '26', 'name': '后勤处' },
+ 'user': { 'id': '3', 'ghxh': '33', 'xm': '王五', 'xb': { 'value': 'male', 'label': '男' }}
+ },
+ {
+ 'id': '22',
+ 'auditNode': { 'id': '28', 'name': '图书馆' },
+ 'user': { 'id': '4', 'ghxh': '44', 'xm': '赵六', 'xb': { 'value': 'female', 'label': '女' }}
+ }
+]
+
+const principalList = [
+ {
+ 'id': '11',
+ 'auditNode': { 'id': '26', 'name': '后勤处' },
+ 'user': { 'id': '3', 'ghxh': '33', 'xm': '王六', 'xb': { 'value': 'male', 'label': '男' }}
+ },
+ {
+ 'id': '11',
+ 'auditNode': { 'id': '28', 'name': '图书馆' },
+ 'user': { 'id': '4', 'ghxh': '44', 'xm': '赵七', 'xb': { 'value': 'female', 'label': '女' }}
+ }
+]
+
export default{
getList: config => {
const { name, auditType, pageIndex = 1, pageSize = 20 } = param2Obj(config.url)
@@ -99,5 +140,97 @@
return {
code: 200
}
+ },
+ getUser: config => {
+ const { ghxh } = param2Obj(config.url)
+ const mockList = userList.filter(item => item.ghxh + '' === ghxh + '')
+ return {
+ data: mockList.length > 0 ? mockList[0] : null,
+ code: 200
+ }
+ },
+ getAuditorList: config => {
+ const { nodeId } = param2Obj(config.url)
+ const mockList = auditorList.filter(item => item.auditNode.id + '' === nodeId + '')
+ return {
+ items: mockList,
+ code: 200
+ }
+ },
+ createNodeAuditor: config => {
+ const nodeAuditor = JSON.parse(config.body)
+ if (!nodeAuditor.id) {
+ nodeAuditor.id = '' + parseInt(Math.random() * 100) + 1024 // mock a id
+ auditorList.unshift(nodeAuditor)
+ } else {
+ for (let i = 0; i < auditorList.length; i++) {
+ if (auditorList[i].id + '' === nodeAuditor.id + '') {
+ auditorList.splice(i, 1, nodeAuditor)
+ break
+ }
+ }
+ }
+ return {
+ item: nodeAuditor,
+ code: 200
+ }
+ },
+ deleteNodeAuditor: config => {
+ const nodeAuditor = JSON.parse(config.body)
+ let index = -1
+ for (let i = 0; i < auditorList.length; i++) {
+ if (auditorList[i].id + '' === nodeAuditor.id + '') {
+ index = i
+ break
+ }
+ }
+ if (index > -1) {
+ auditorList.splice(index, 1)
+ }
+ return {
+ code: 200
+ }
+ },
+ getPrincipalList: config => {
+ const { nodeId } = param2Obj(config.url)
+ const mockList = principalList.filter(item => item.auditNode.id + '' === nodeId + '')
+ return {
+ items: mockList,
+ code: 200
+ }
+ },
+ createNodePrincipal: config => {
+ const nodePrincipal = JSON.parse(config.body)
+ if (!nodePrincipal.id) {
+ nodePrincipal.id = '' + parseInt(Math.random() * 100) + 1024 // mock a id
+ principalList.unshift(nodePrincipal)
+ } else {
+ for (let i = 0; i < principalList.length; i++) {
+ if (principalList[i].id + '' === nodePrincipal.id + '') {
+ principalList.splice(i, 1, nodePrincipal)
+ break
+ }
+ }
+ }
+ return {
+ item: nodePrincipal,
+ code: 200
+ }
+ },
+ deleteNodePrincipal: config => {
+ const nodePrincipal = JSON.parse(config.body)
+ let index = -1
+ for (let i = 0; i < principalList.length; i++) {
+ if (principalList[i].id + '' === nodePrincipal.id + '') {
+ index = i
+ break
+ }
+ }
+ if (index > -1) {
+ principalList.splice(index, 1)
+ }
+ return {
+ code: 200
+ }
}
}
diff --git a/leave-school-vue/src/views/procedures/node/index.vue b/leave-school-vue/src/views/procedures/node/index.vue
index 648e4f2..8c21bc2 100644
--- a/leave-school-vue/src/views/procedures/node/index.vue
+++ b/leave-school-vue/src/views/procedures/node/index.vue
@@ -76,6 +76,8 @@
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleCreate(scope.row.id, 'update')">修改</el-button>
<el-button type="text" size="small" @click="handleDelete(scope.row.id)">删除</el-button>
+ <el-button type="text" size="small" @click="handleAuditor(scope.row.id)">编辑审核人</el-button>
+ <el-button type="text" size="small" @click="handlePrincipal(scope.row.id)">编辑负责人</el-button>
</template>
</el-table-column>
</el-table>
@@ -84,7 +86,7 @@
</el-pagination>
</div>
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="80%" top="10vh">
+ <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="60%" top="10vh">
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="left" label-width="150px" style='margin-left:50px;'>
<el-form-item label="审核环节名称" prop="name">
<el-input v-model="temp.name"></el-input>
@@ -132,17 +134,118 @@
<el-button type="primary" @click="createData">提交</el-button>
</div>
</el-dialog>
+ <el-dialog title="编辑审核人" :visible.sync="dialogAuditorVisible" width="70%" top="10vh">
+ <el-form :inline="true" class="demo-form-inline" :model="auditor" style='margin-left:50px;' >
+ <el-form-item label="工号" prop="ghxh">
+ <el-input v-model="auditor.ghxh" @blur="handleGetAuditor"></el-input>
+ <input type="hidden" v-model="auditor.id" />
+ <input type="hidden" v-model="nodeId" />
+ </el-form-item>
+ <el-form-item label="姓名" prop="xm">
+ <el-input v-model="auditor.xm" disabled="true"></el-input>
+ </el-form-item>
+ <el-form-item label="性别" prop="xb">
+ <el-input v-model="auditor.xb" disabled="true"></el-input>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="handleSaveAuditor">保存</el-button>
+ </el-form-item>
+ </el-form>
+ <el-table :data="auditorList" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row>
+ <el-table-column align="center" type="index" label='序号' width="95">
+ </el-table-column>
+ <el-table-column label="工号" align="center">
+ <template slot-scope="scope">
+ {{scope.row.user.ghxh}}
+ </template>
+ </el-table-column>
+ <el-table-column label="姓名" align="center">
+ <template slot-scope="scope">
+ <span>{{scope.row.user.xm}}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="性别" align="center">
+ <template slot-scope="scope">
+ {{scope.row.user.xb.label}}
+ </template>
+ </el-table-column>
+ <el-table-column
+ fixed="right"
+ header-align="center"
+ align="center"
+ width="150"
+ label="操作">
+ <template slot-scope="scope">
+ <el-button type="text" size="small" @click="handleDeleteAuditor(scope.row.id)">删除</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="dialogAuditorVisible = false">返回</el-button>
+ </div>
+ </el-dialog>
+ <el-dialog title="编辑负责人" :visible.sync="dialogPrincipalVisible" width="70%" top="10vh">
+ <el-form :inline="true" class="demo-form-inline" :model="principal" style='margin-left:50px;' >
+ <el-form-item label="工号" prop="ghxh">
+ <el-input v-model="principal.ghxh" @blur="handleGetPrincipal"></el-input>
+ <input type="hidden" v-model="principal.id" />
+ <input type="hidden" v-model="nodeId" />
+ </el-form-item>
+ <el-form-item label="姓名" prop="xm">
+ <el-input v-model="principal.xm" disabled="true"></el-input>
+ </el-form-item>
+ <el-form-item label="性别" prop="xb">
+ <el-input v-model="principal.xb" disabled="true"></el-input>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="handleSavePrincipal">保存</el-button>
+ </el-form-item>
+ </el-form>
+ <el-table :data="principalList" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row>
+ <el-table-column align="center" type="index" label='序号' width="95">
+ </el-table-column>
+ <el-table-column label="工号" align="center">
+ <template slot-scope="scope">
+ {{scope.row.user.ghxh}}
+ </template>
+ </el-table-column>
+ <el-table-column label="姓名" align="center">
+ <template slot-scope="scope">
+ <span>{{scope.row.user.xm}}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="性别" align="center">
+ <template slot-scope="scope">
+ {{scope.row.user.xb.label}}
+ </template>
+ </el-table-column>
+ <el-table-column
+ fixed="right"
+ header-align="center"
+ align="center"
+ width="150"
+ label="操作">
+ <template slot-scope="scope">
+ <el-button type="text" size="small" @click="handleDeletePrincipal(scope.row.id)">删除</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="dialogPrincipalVisible = false">返回</el-button>
+ </div>
+ </el-dialog>
</div>
</template>
<script>
-import { getList, getItem, createNode, deleteNode } from '@/api/leaveschoolnode-api'
+import { getList, getItem, createNode, deleteNode, getUser, getAuditorList, createNodeAuditor, deleteNodeAuditor, getPrincipalList, createNodePrincipal, deleteNodePrincipal } from '@/api/leaveschoolnode-api'
import { getDicList } from '@/api/dictionary-api'
import { getDeptList } from '@/api/department-api'
import waves from '@/directive/waves' // 水波纹指令
import { resetForm } from '@/utils'
import { crudPageList, crudGetItem, crudCreate, crudDelete } from '@/utils/crud'
import mixindata from '@/utils/crud'
+import { MessageBox } from 'element-ui'
const initData = { auditType: '25', defaultAuditStatus: '22' }
export default {
@@ -161,6 +264,15 @@
auditTypeList: [],
scopeList: [],
statusList: [],
+ nodeId: '',
+ dialogAuditorVisible: false,
+ dialogPrincipalVisible: false,
+ auditor: {},
+ nodeAuditor: {},
+ auditorList: [],
+ principal: {},
+ nodePrincipal: {},
+ principalList: [],
rules: {
name: [{ required: true, message: '环节名称', trigger: 'blur' }],
scope: [{ required: true, message: '范围控制', trigger: 'change' }],
@@ -225,6 +337,110 @@
},
handleDelete(rowid) {
crudDelete(this, deleteNode, rowid, this.handlePageList)
+ },
+ handleAuditor(rowid) {
+ this.auditor = {}
+ this.nodeId = rowid
+ this.handleAuditorList()
+ this.dialogAuditorVisible = true
+ },
+ handleAuditorList() {
+ getAuditorList({ nodeId: this.nodeId }).then(response => {
+ this.auditorList = response.items
+ })
+ },
+ handleGetAuditor(event) {
+ const ghxh = event.target.value
+ if (ghxh) {
+ getUser({ ghxh: ghxh }).then(response => {
+ if (response.data) {
+ this.auditor = { 'id': response.data.id, 'ghxh': response.data.ghxh, 'xm': response.data.xm, 'xb': response.data.xb.label }
+ } else {
+ MessageBox.alert('用户不存在,请重新重新输入工号!', '消息', {
+ confirmButtonText: '确定'
+ })
+ this.auditor = {}
+ }
+ })
+ } else {
+ MessageBox.alert('请填写工号!', '消息', {
+ confirmButtonText: '确定'
+ })
+ this.auditor = {}
+ }
+ },
+ handleSaveAuditor() {
+ if (!this.auditor.id) {
+ MessageBox.alert('请填写正确的工号!', '消息', {
+ confirmButtonText: '确定'
+ })
+ return
+ }
+ this.nodeAuditor = { 'auditNode': { 'id': this.nodeId }, 'user': { 'id': this.auditor.id }}
+ createNodeAuditor(this.nodeAuditor).then(response => {
+ this.handleAuditorList()
+ this.$notify({
+ title: '成功',
+ message: '创建成功',
+ type: 'success',
+ duration: 2000
+ })
+ })
+ },
+ handleDeleteAuditor(rowid) {
+ crudDelete(this, deleteNodeAuditor, rowid, this.handleAuditorList)
+ },
+ handlePrincipal(rowid) {
+ this.principal = {}
+ this.nodeId = rowid
+ this.handlePrincipalList()
+ this.dialogPrincipalVisible = true
+ },
+ handlePrincipalList() {
+ getPrincipalList({ nodeId: this.nodeId }).then(response => {
+ this.principalList = response.items
+ })
+ },
+ handleGetPrincipal(event) {
+ const ghxh = event.target.value
+ if (ghxh) {
+ getUser({ ghxh: ghxh }).then(response => {
+ if (response.data) {
+ this.principal = { 'id': response.data.id, 'ghxh': response.data.ghxh, 'xm': response.data.xm, 'xb': response.data.xb.label }
+ } else {
+ MessageBox.alert('用户不存在,请重新重新输入工号!', '消息', {
+ confirmButtonText: '确定'
+ })
+ this.principal = {}
+ }
+ })
+ } else {
+ MessageBox.alert('请填写工号!', '消息', {
+ confirmButtonText: '确定'
+ })
+ this.principal = {}
+ }
+ },
+ handleSavePrincipal() {
+ if (!this.principal.id) {
+ MessageBox.alert('请填写正确的工号!', '消息', {
+ confirmButtonText: '确定'
+ })
+ return
+ }
+ this.nodePrincipal = { 'auditNode': { 'id': this.nodeId }, 'user': { 'id': this.principal.id }}
+ createNodePrincipal(this.nodePrincipal).then(response => {
+ this.handlePrincipalList()
+ this.$notify({
+ title: '成功',
+ message: '创建成功',
+ type: 'success',
+ duration: 2000
+ })
+ })
+ },
+ handleDeletePrincipal(rowid) {
+ crudDelete(this, deleteNodePrincipal, rowid, this.handlePrincipalList)
}
}
}