添加离校环节编辑审核人及编辑负责人功能
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)
     }
   }
 }