Ver código fonte

审批角色管理

xiao547607 5 anos atrás
pai
commit
9c8ef120fd

+ 46 - 0
src/api/base/applicationExamine.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+import constant from '@/constant'
+
+function pageList(formData){
+  return request.post(constant.serverUrl + "/base/applicationExamine/pageList", formData);
+}
+
+function create(){
+  return request.get(constant.serverUrl + "/base/applicationExamine/create");
+}
+
+function edit(id){
+  return request.get(constant.serverUrl + "/base/applicationExamine/edit/" + id);
+}
+
+function add(formModel){
+  return request.post(constant.serverUrl + "/base/applicationExamine/add", formModel,{
+    headers: {
+      "Content-Type": "application/json"
+    }
+  });
+}
+
+function update(formModel){  
+  return request.post(constant.serverUrl + "/base/applicationExamine/update", formModel,{
+    headers: {
+      "Content-Type": "application/json"
+    }
+  });
+}
+
+function remove(id){
+  return request.post(constant.serverUrl + "/base/applicationExamine/delete/" + id);
+}
+
+function batchRemove(idList){
+  return request.post(constant.serverUrl + "/base/applicationExamine/batchDelete",idList,{
+    headers: {
+      "Content-Type": "application/json"
+    }
+  });
+}
+
+export default {
+  pageList,create,edit,add,update,remove,batchRemove
+}

+ 9 - 0
src/routers/modules/base.js

@@ -512,6 +512,15 @@ var routers = [
                         roles: ["admin"],
                         title: '长者管理'
                 }
+        },
+        {
+                path: '/base/applicationExamine/list',
+                name: 'baseApplicationExamineList',
+                component: () => import('@/views/base/applicationExamine-list.vue'),
+                meta: {
+                        roles: ["admin"],
+                        title: '审批角色管理'
+                }
         }
 ]
 

+ 253 - 0
src/views/base/applicationExamine-detail.vue

@@ -0,0 +1,253 @@
+
+<style scoped>
+.user-panel {
+  margin: 10px auto;
+}
+</style>
+<template>
+  <el-dialog
+    :visible.sync="showDialog"
+    :title="title"
+    :modal-append-to-body="false"
+    style="text-align: left"
+    @close="closeDialog"
+    :close-on-click-modal="false"
+  >
+    <div class="user-panel" v-loading="loading">
+      <el-form
+        ref="form"
+        :model="formModel"
+        :rules="ruleValidate"
+        :label-width="'130px'"
+      >
+      <el-form-item label="申请者公司" prop="applicationCompanyId">
+          <el-select-tree
+            :props="props"
+            :options="companyResult"
+            v-model="formModel.applicationCompanyId"
+            size=""
+            height="200"
+          ></el-select-tree>
+        </el-form-item>
+        <el-form-item label="申请者角色" prop="applicationRoleId">
+        <el-select
+          v-model="formModel.applicationRoleId"
+          filterable
+          placeholder="请选择"
+          style="width: 280px"
+        >
+          <el-option
+            v-for="role in applicationRoleResult"
+            :key="role.id"
+            :label="role.personRoleName"
+            :value="role.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+        <el-form-item label="审核人公司" prop="examineCompanyId">
+          <el-select-tree
+            :props="props"
+            :options="companyResult"
+            v-model="formModel.examineCompanyId"
+            size=""
+            height="200"
+          ></el-select-tree>
+        </el-form-item>
+        <el-form-item label="审核人角色" prop="examineRoleId">
+          <el-select
+          v-model="formModel.examineRoleId"
+          filterable
+          placeholder="请选择"
+          style="width: 280px"
+        >
+          <el-option
+            v-for="role in examineRoleResult"
+            :key="role.id"
+            :label="role.personRoleName"
+            :value="role.id"
+          ></el-option>
+        </el-select>
+        </el-form-item>
+        <el-form-item label="备注信息" prop="remark">
+          <el-input
+            v-model="formModel.remark"
+            placeholder="请输入备注信息"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="closeDialog">取 消</el-button>
+      <el-button type="primary" @click="handleSubmit" :loading="submitting"
+        >确 定</el-button
+      >
+    </span>
+  </el-dialog>
+</template>
+<script>
+import Constant from "@/constant";
+import applicationExamineApi from "@/api/base/applicationExamine";
+import companyInfoApi from "@/api/base/companyInfo";
+import personRoleInfoApi from "@/api/base/personRoleInfo";
+
+import SelectTree from "@/components/SelectTree";
+
+export default {
+  
+  components: {
+    "el-select-tree": SelectTree,
+  },
+  props: ["businessKey", "title"],
+  data() {
+    return {
+      formModel: {},
+      ruleValidate: {
+        applicationRoleId: [
+          { required: true, message: "申请者角色不能为空", trigger: "blur" },
+        ],
+        applicationCompanyId: [
+          { required: true, message: "申请者公司不能为空", trigger: "blur" },
+        ],
+        examineRoleId: [
+          { required: true, message: "审核人角色不能为空", trigger: "blur" },
+        ],
+        examineCompanyId: [
+          { required: true, message: "审核人公司不能为空", trigger: "blur" },
+        ],
+      },
+      showDialog: true,
+      loading: false,
+      submitting: false,
+      treeData: [],
+      props: {
+        // 配置项(必选)
+        value: "id",
+        label: "name",
+        children: "children",
+      },
+      applicationRoleResult:[],
+      examineRoleResult:[],
+      companyResult: [],
+    };
+  },
+  created() {
+    var self = this;
+    companyInfoApi.list().then(function (response) {
+      var jsonData = response.data;
+      if (jsonData.result) {
+        if (jsonData.data != null && jsonData.data != "") {
+          self.companyResult = jsonData.data;
+        }
+      }
+    });
+  },watch: {
+    "formModel.applicationCompanyId": function (val, oldval) {
+      if (val != null && val != "") {
+        var self = this;
+        var formData = new FormData();
+        formData.append("companyId", val);
+        personRoleInfoApi.listByCompanyId(formData).then(function (response) {
+          var jsonData = response.data;
+          if (jsonData.result) {
+            if (jsonData.data != null && jsonData.data != "") {
+              self.applicationRoleResult = jsonData.data;
+
+              // applicationCompanyId
+              // applicationRoleId
+              // examineCompanyId
+              // examineRoleId
+            }
+          }
+        });
+
+      }
+    },
+    "formModel.examineCompanyId": function (val, oldval) {
+      if (val != null && val != "") {
+        var self = this;
+        var formData = new FormData();
+        formData.append("companyId", val);
+        personRoleInfoApi.listByCompanyId(formData).then(function (response) {
+          var jsonData = response.data;
+          if (jsonData.result) {
+            if (jsonData.data != null && jsonData.data != "") {
+              self.examineRoleResult = jsonData.data;
+
+              // applicationCompanyId
+              // applicationRoleId
+              // examineCompanyId
+              // examineRoleId
+            }
+          }
+        });
+
+      }
+    }
+  },
+  methods: {
+    closeDialog() {
+      this.$emit("close", false);
+    },
+    handleSubmit() {
+      var self = this;
+
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          (function () {
+            var id = self.formModel.id;
+
+            if (id == null || id.length == 0) {
+              return applicationExamineApi.add(self.formModel);
+            } else {
+              return applicationExamineApi.update(self.formModel);
+            }
+          })().then(function (response) {
+            var jsonData = response.data;
+
+            if (jsonData.result) {
+              self.$message({
+                message: "保存成功!",
+                type: "success",
+              });
+
+              self.$emit("close", true);
+            } else {
+              self.$message({
+                message: jsonData.message + "",
+                type: "warning",
+              });
+
+              self.$emit("close", false);
+            }
+          });
+        }
+      });
+    },
+  },
+  mounted: function () {
+    var self = this;
+
+    (function () {
+      if (self.businessKey.length == 0) {
+        return applicationExamineApi.create();
+      } else {
+        return applicationExamineApi.edit(self.businessKey);
+      }
+    })()
+      .then((response) => {
+        var jsonData = response.data;
+        self.loading = false;
+
+        if (jsonData.result) {
+          self.formModel = jsonData.data;
+        } else {
+          self.$message.error(jsonData.message + "");
+        }
+      })
+      .catch((error) => {
+        self.$message.error(error + "");
+      });
+  },
+};
+</script>

+ 382 - 0
src/views/base/applicationExamine-list.vue

@@ -0,0 +1,382 @@
+<template>
+  <div>
+    <el-breadcrumb separator=">">
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
+      <el-breadcrumb-item>
+        <a href="#">系统管理</a>
+      </el-breadcrumb-item>
+      <el-breadcrumb-item>
+        <a href="/applicationExamine">审批角色管理</a>
+      </el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-divider></el-divider>
+    <!--
+      要resetFields起作用,必须配置:model和prop
+    -->
+    <el-form
+      ref="queryForm"
+      :model="queryModel"
+      inline
+      class="demo-form-inline"
+    >
+      <el-form-item label="申请者公司" prop="applicationCompanyId">
+        <el-select-tree
+          :props="props"
+          :options="companyResult"
+          v-model="queryModel.applicationCompanyId"
+          size=""
+          height="200"
+        ></el-select-tree
+        >&nbsp;
+        <el-checkbox v-model="queryModel.applicationSubordinate"
+          >是否包含下级单位</el-checkbox
+        >
+      </el-form-item>
+      <el-form-item label="审核人公司" prop="examineCompanyId">
+        <el-select-tree
+          :props="props"
+          :options="companyResult"
+          v-model="queryModel.examineCompanyId"
+          size=""
+          height="200"
+        ></el-select-tree
+        >&nbsp;
+        <el-checkbox v-model="queryModel.examineSubordinate"
+          >是否包含下级单位</el-checkbox
+        >
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          size="mini"
+          icon="ios-search"
+          @click="changePage(1)"
+          :loading="loading"
+          >查询</el-button
+        >&nbsp;
+        <el-button
+          type="info"
+          size="mini"
+          style="margin-left: 8px"
+          @click="handleReset('queryForm')"
+          >重置</el-button
+        >&nbsp;
+      </el-form-item>
+    </el-form>
+    <el-divider></el-divider>
+    <el-row class="button-group">
+      <el-button
+        type="primary"
+        size="small"
+        plain
+        icon="el-icon-circle-plus"
+        @click="handleAdd"
+        >新增</el-button
+      >
+      <el-button
+        type="primary"
+        size="small"
+        plain
+        icon="el-icon-circle-plus"
+        :disabled="multipleSelection.length == 0"
+        @click="handleBatchDelete"
+        >删除选中项</el-button
+      >
+    </el-row>
+    <el-table
+      :data="tableData"
+      style="min-height: 400px"
+      v-loading="loading"
+      stripe
+      @sort-change="sortChange"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55"></el-table-column>
+      <el-table-column
+        type="index"
+        label="序号"
+        :index="indexMethod"
+        width="50"
+      ></el-table-column>
+      <el-table-column
+        prop="applicationCompanyName"
+        label="申请者公司"
+        width="180"
+      ></el-table-column>
+      <el-table-column
+        prop="applicationRoleName"
+        label="申请者角色"
+        width="180"
+      ></el-table-column>
+      <el-table-column
+        prop="examineCompanyName"
+        label="审核人公司"
+        width="180"
+      ></el-table-column>
+      <el-table-column
+        prop="examineRoleName"
+        label="审核人角色"
+        width="180"
+      ></el-table-column>
+      <el-table-column
+        prop="remark"
+        label="备注信息"
+        width="180"
+      ></el-table-column>
+      <el-table-column label="操作">
+        <template slot-scope="{ row }">
+          <el-button size="mini" type="warning" @click="handleEdit(row)"
+            >编辑</el-button
+          >
+          <el-button size="mini" type="danger" @click="handleDelete(row)"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      :current-page.sync="pageIndex"
+      :total="totalElements"
+      :page-sizes="pageSizeList"
+      @current-change="changePage"
+      @size-change="pageSizeChange"
+      layout="total, sizes, prev, pager, next, jumper"
+    ></el-pagination>
+    <applicationExamine-detail
+      v-if="showModal"
+      :businessKey="businessKey"
+      :title="modalTitle"
+      @close="onDetailModalClose"
+    ></applicationExamine-detail>
+  </div>
+</template>
+<script>
+import Constant from "@/constant";
+import ApplicationExamineDetail from "./applicationExamine-detail";
+import applicationExamineApi from "@/api/base/applicationExamine";
+import companyInfoApi from "@/api/base/companyInfo";
+import NProgress from "nprogress"; // progress bar
+import "nprogress/nprogress.css"; // progress bar style
+
+import SelectTree from "@/components/SelectTree";
+
+export default {
+  name: "baseApplicationExamineList",
+  data() {
+    var self = this;
+
+    return {
+      queryModel: {
+        applicationRoleId: "",
+        applicationCompanyId: "",
+        applicationSubordinate: false,
+        examineRoleId: "",
+        examineCompanyId: "",
+        examineSubordinate: false,
+      },
+      loading: false,
+      tableData: [],
+      pageIndex: 1,
+      pageSize: 10,
+      totalPages: 0,
+      totalElements: 0,
+      field: "",
+      direction: "",
+      pageSizeList: [10, 20, 30],
+      multipleSelection: [],
+      showModal: false,
+      modalTitle: "",
+      businessKey: "",
+      treeData: [],
+      props: {
+        // 配置项(必选)
+        value: "id",
+        label: "name",
+        children: "children",
+      },
+    };
+  },
+  created() {
+    var self = this;
+    companyInfoApi.list().then(function (response) {
+      var jsonData = response.data;
+      if (jsonData.result) {
+        if (jsonData.data != null && jsonData.data != "") {
+          self.companyResult = jsonData.data;
+        }
+      }
+    });
+  },
+  methods: {
+    indexMethod(index) {
+      return (this.pageIndex - 1) * this.pageSize + (index + 1);
+    },
+    changePage(pageIndex) {
+      var self = this;
+
+      self.loading = true;
+
+      self.pageIndex = pageIndex;
+      var formData = new FormData();
+
+      formData.append("pageIndex", self.pageIndex);
+      formData.append("pageSize", self.pageSize);
+
+      formData.append("applicationRoleId", self.queryModel.applicationRoleId);
+      if (self.queryModel.applicationCompanyId == null) {
+        self.queryModel.applicationCompanyId = "";
+      }
+      formData.append(
+        "applicationCompanyId",
+        self.queryModel.applicationCompanyId
+      );
+      formData.append("applicationSubordinate", self.queryModel.applicationSubordinate);
+      formData.append("examineRoleId", self.queryModel.examineRoleId);
+      if (self.queryModel.examineCompanyId == null) {
+        self.queryModel.examineCompanyId = "";
+      }
+      formData.append("examineCompanyId", self.queryModel.examineCompanyId);
+      formData.append("examineSubordinate", self.queryModel.examineSubordinate);
+      if (this.field != null) {
+        formData.append("field", this.field);
+      }
+
+      if (this.direction != null) {
+        formData.append("direction", this.direction);
+      }
+
+      applicationExamineApi
+        .pageList(formData)
+        .then(function (response) {
+          self.loading = false;
+
+          var jsonData = response.data.data;
+
+          self.tableData = jsonData.data;
+          self.totalPages = jsonData.totalPages;
+          self.totalElements = jsonData.recordsTotal;
+        })
+        .catch((error) => {
+          self.loading = false;
+          // self.$message.error(error + "");
+        });
+    },
+    pageSizeChange(pageSize) {
+      this.pageSize = pageSize;
+
+      this.$nextTick(() => {
+        this.changePage(this.pageIndex);
+      });
+    },
+    sortChange(data) {
+      this.field = data.column.field;
+      this.direction = data.order;
+
+      this.changePage(this.pageIndex);
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+    handleReset(name) {
+      this.$refs[name].resetFields();
+    },
+    handleAdd() {
+      this.modalTitle = "新增";
+      this.businessKey = "";
+      this.showModal = true;
+    },
+    handleEdit(record) {
+      this.modalTitle = "编辑";
+      this.businessKey = record.id;
+      this.showModal = true;
+    },
+    handleDelete(record) {
+      var self = this;
+
+      self
+        .$confirm("是否确认删除?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+        .then(() => {
+          applicationExamineApi.remove(record.id).then(function (response) {
+            var jsonData = response.data;
+
+            if (jsonData.result) {
+              // var index = self.tableData.indexOf(record);
+              // self.tableData.splice(index, 1);
+              self.changePage(self.pageIndex);
+
+              self.$message({
+                type: "success",
+                message: "删除成功!",
+              });
+            }
+          });
+        });
+    },
+    handleBatchDelete() {
+      var self = this;
+
+      var idList = this.multipleSelection.map((record) => {
+        return record.id;
+      });
+
+      this.$confirm("是否确认删除选中项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        applicationExamineApi.batchRemove(idList).then(function (response) {
+          var jsonData = response.data;
+
+          if (jsonData.result) {
+            self.changePage(self.pageIndex);
+
+            self.$message({
+              type: "success",
+              message: "删除成功!",
+            });
+          }
+        });
+      });
+    },
+    onDetailModalClose(refreshed) {
+      //保存成功后回调
+      this.showModal = false;
+
+      if (refreshed) {
+        this.changePage(this.pageIndex);
+      }
+    },
+  },
+  mounted: function () {
+    this.changePage(1);
+  },
+  components: {
+    "applicationExamine-detail": ApplicationExamineDetail,
+    "el-select-tree": SelectTree,
+  },
+};
+</script>
+<style lang="scss" scoped>
+.el-breadcrumb {
+  margin: 10px;
+  line-height: 20px;
+}
+
+.el-divider {
+  margin: 5px 0;
+}
+
+.demo-form-inline {
+  margin-left: 10px;
+  text-align: left;
+}
+
+.button-group {
+  margin-left: 10px;
+  text-align: left;
+}
+</style>

+ 18 - 0
src/views/base/companyInfo-detail.vue

@@ -50,6 +50,24 @@
               ></el-input>
             </el-form-item>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="单位性质" prop="unitType">
+              <el-select
+                v-model="formModel.unitType"
+                filterable
+                clearable
+                placeholder="请选择"
+                style="width: 50%"
+              >
+                <el-option
+                  v-for="result in typeData"
+                  :key="result.id"
+                  :label="result.name"
+                  :value="result.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
         </el-row>
         <el-row>
           <el-col :span="12">

+ 11 - 10
src/views/base/personInfo-detail.vue

@@ -19,7 +19,7 @@
         ref="form"
         :model="formModel"
         :rules="ruleValidate"
-        :label-width="'100px'"
+        :label-width="'130px'"
       >
         <el-row>
           <el-col :span="12">
@@ -163,33 +163,36 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <!-- <el-row>
+        <el-row>
           <el-col :span="12">
-            <el-form-item :label="companyPosition1" prop="position1">
+            <el-form-item label="拓展字段一" prop="position1">
               <el-input
                 v-model="formModel.position1"
-                placeholder="请输入一级位置"
+                placeholder="请输入拓展字段一1"
               ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item :label="companyPosition2" prop="position2">
+            <el-form-item label="拓展字段二" prop="position2">
               <el-input
                 v-model="formModel.position2"
-                placeholder="请输入二级位置"
+                placeholder="请输入拓展字段二"
               ></el-input>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="12">
-            <el-form-item :label="companyPosition3" prop="position3">
+            <el-form-item label="拓展字段三" prop="position3">
               <el-input
                 v-model="formModel.position3"
-                placeholder="请输入三级位置"
+                placeholder="请输入拓展字段三"
               ></el-input>
             </el-form-item>
           </el-col>
+        </el-row>
+        <!-- 
+        <el-row>
           <el-col :span="12">
             <el-form-item :label="companyPosition4" prop="position4">
               <el-input
@@ -198,8 +201,6 @@
               ></el-input>
             </el-form-item>
           </el-col>
-        </el-row>
-        <el-row>
           <el-col :span="12">
             <el-form-item :label="companyPosition5" prop="position5">
               <el-input