userAuthenticationApprove-list.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <div>
  3. <el-breadcrumb separator=">">
  4. <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
  5. <el-breadcrumb-item>
  6. <a href="#">审核管理</a>
  7. </el-breadcrumb-item>
  8. <el-breadcrumb-item>
  9. <a href="/base/userAuthenticationApprove">用户实名审核</a>
  10. </el-breadcrumb-item>
  11. </el-breadcrumb>
  12. <el-divider></el-divider>
  13. <!--
  14. 要resetFields起作用,必须配置:model和prop
  15. -->
  16. <el-form
  17. ref="queryForm"
  18. :model="queryModel"
  19. inline
  20. class="demo-form-inline"
  21. >
  22. <el-form-item label="审批状态" prop="approvalStatus">
  23. <el-select
  24. v-model="queryModel.approvalStatus"
  25. filterable
  26. placeholder="请选择审批状态"
  27. size="mini"
  28. >
  29. <el-option
  30. v-for="approvalStatus in approvalStatusResult"
  31. :key="approvalStatus.value"
  32. :label="approvalStatus.name"
  33. :value="approvalStatus.value"
  34. ></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item>
  38. <el-button
  39. type="primary"
  40. size="mini"
  41. icon="ios-search"
  42. @click="changePage(1)"
  43. :loading="loading"
  44. >查询</el-button
  45. >&nbsp;
  46. <el-button
  47. type="info"
  48. size="mini"
  49. style="margin-left: 8px"
  50. @click="handleReset('queryForm')"
  51. >重置</el-button
  52. >&nbsp;
  53. </el-form-item>
  54. </el-form>
  55. <el-divider></el-divider>
  56. <el-table
  57. :data="tableData"
  58. style="min-height: 400px"
  59. v-loading="loading"
  60. stripe
  61. @sort-change="sortChange"
  62. @selection-change="handleSelectionChange"
  63. >
  64. <el-table-column type="selection" width="55"></el-table-column>
  65. <el-table-column prop="approvalStatusName" label="审核状态" width="180"></el-table-column>
  66. <el-table-column prop="jobUserName" label="提交人" width="180"></el-table-column>
  67. <!-- <el-table-column prop="jobUserId" label="所属单位" width="180"></el-table-column> -->
  68. <el-table-column prop="createTime" label="申请时间" width="180"></el-table-column>
  69. <el-table-column prop="approvePersonName" label="审核人" width="180"></el-table-column>
  70. <el-table-column prop="approveTime" label="审核时间" width="180"></el-table-column>
  71. <el-table-column label="操作">
  72. <template slot-scope="{row}">
  73. <el-button v-if="row.approvalStatus==2" size="mini" type="warning" @click="handleEdit(row)">处理</el-button>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. <el-pagination
  78. :current-page.sync="pageIndex"
  79. :total="totalElements"
  80. :page-sizes="pageSizeList"
  81. @current-change="changePage"
  82. @size-change="pageSizeChange"
  83. layout="total, sizes, prev, pager, next, jumper"
  84. ></el-pagination>
  85. <userAuthenticationApprove-detail
  86. v-if="showModal"
  87. :jobUserKey="jobUserKey"
  88. :businessKey="businessKey"
  89. :title="modalTitle"
  90. @close="onDetailModalClose"
  91. ></userAuthenticationApprove-detail>
  92. </div>
  93. </template>
  94. <script>
  95. import Constant from "@/constant";
  96. import UserAuthenticationApproveDetail from "./userAuthenticationApprove-detail";
  97. import userAuthenticationApproveApi from "@/api/base/userAuthenticationApprove";
  98. import dataDictionaryApi from "@/api/sys/dataDictionary";
  99. import NProgress from "nprogress"; // progress bar
  100. import "nprogress/nprogress.css"; // progress bar style
  101. export default {
  102. data() {
  103. var self = this;
  104. return {
  105. queryModel: {
  106. id: "",
  107. createBy: "",
  108. createTime: "",
  109. updateBy: "",
  110. updateTime: "",
  111. delFlag: "",
  112. jobUserId: "",
  113. approvePersonId: "",
  114. approveTime: "",
  115. approvalStatus: "",
  116. },
  117. loading: false,
  118. tableData: [],
  119. pageIndex: 1,
  120. pageSize: 10,
  121. totalPages: 0,
  122. totalElements: 0,
  123. field: "",
  124. direction: "",
  125. pageSizeList: [10, 20, 30],
  126. multipleSelection: [],
  127. showModal: false,
  128. modalTitle: "",
  129. businessKey: "",
  130. approvalStatusResult: [],
  131. };
  132. },
  133. created() {
  134. dataDictionaryApi
  135. .findByCatalogName({
  136. catalogName: "实名制状态",
  137. })
  138. .then((response) => {
  139. var jsonData = response.data;
  140. this.approvalStatusResult = jsonData.data;
  141. });
  142. },
  143. methods: {
  144. changePage(pageIndex) {
  145. var self = this;
  146. self.loading = true;
  147. self.pageIndex = pageIndex;
  148. var formData = new FormData();
  149. formData.append("pageIndex", self.pageIndex);
  150. formData.append("pageSize", self.pageSize);
  151. formData.append("id", self.queryModel.id);
  152. formData.append("createBy", self.queryModel.createBy);
  153. formData.append("createTime", self.queryModel.createTime);
  154. formData.append("updateBy", self.queryModel.updateBy);
  155. formData.append("updateTime", self.queryModel.updateTime);
  156. formData.append("delFlag", self.queryModel.delFlag);
  157. formData.append("jobUserId", self.queryModel.jobUserId);
  158. formData.append("approvePersonId", self.queryModel.approvePersonId);
  159. formData.append("approveTime", self.queryModel.approveTime);
  160. formData.append("approvalStatus", self.queryModel.approvalStatus);
  161. if (this.field != null) {
  162. formData.append("field", this.field);
  163. }
  164. if (this.direction != null) {
  165. formData.append("direction", this.direction);
  166. }
  167. userAuthenticationApproveApi
  168. .pageList(formData)
  169. .then(function (response) {
  170. self.loading = false;
  171. var jsonData = response.data.data;
  172. self.tableData = jsonData.data;
  173. self.totalPages = jsonData.totalPages;
  174. self.totalElements = jsonData.recordsTotal;
  175. })
  176. .catch((error) => {
  177. self.loading = false;
  178. // self.$message.error(error + "");
  179. });
  180. },
  181. pageSizeChange(pageSize) {
  182. this.pageSize = pageSize;
  183. this.$nextTick(() => {
  184. this.changePage(this.pageIndex);
  185. });
  186. },
  187. sortChange(data) {
  188. this.field = data.column.field;
  189. this.direction = data.order;
  190. this.changePage(this.pageIndex);
  191. },
  192. handleSelectionChange(val) {
  193. this.multipleSelection = val;
  194. },
  195. handleReset(name) {
  196. this.$refs[name].resetFields();
  197. },
  198. handleAdd() {
  199. this.modalTitle = "新增";
  200. this.businessKey = "";
  201. this.showModal = true;
  202. },
  203. handleEdit(record) {
  204. this.modalTitle = "编辑";
  205. this.businessKey = record.id;
  206. this.jobUserKey = record.jobUserId;
  207. this.showModal = true;
  208. },
  209. handleDelete(record) {
  210. var self = this;
  211. self
  212. .$confirm("是否确认删除?", "提示", {
  213. confirmButtonText: "确定",
  214. cancelButtonText: "取消",
  215. type: "warning",
  216. })
  217. .then(() => {
  218. userAuthenticationApproveApi
  219. .remove(record.id)
  220. .then(function (response) {
  221. var jsonData = response.data;
  222. if (jsonData.result) {
  223. // var index = self.tableData.indexOf(record);
  224. // self.tableData.splice(index, 1);
  225. self.changePage(self.pageIndex);
  226. self.$message({
  227. type: "success",
  228. message: "删除成功!",
  229. });
  230. }
  231. });
  232. });
  233. },
  234. handleBatchDelete() {
  235. var self = this;
  236. var idList = this.multipleSelection.map((record) => {
  237. return record.id;
  238. });
  239. this.$confirm("是否确认删除选中项?", "提示", {
  240. confirmButtonText: "确定",
  241. cancelButtonText: "取消",
  242. type: "warning",
  243. }).then(() => {
  244. userAuthenticationApproveApi
  245. .batchRemove(idList)
  246. .then(function (response) {
  247. var jsonData = response.data;
  248. if (jsonData.result) {
  249. self.changePage(self.pageIndex);
  250. self.$message({
  251. type: "success",
  252. message: "删除成功!",
  253. });
  254. }
  255. });
  256. });
  257. },
  258. onDetailModalClose(refreshed) {
  259. //保存成功后回调
  260. this.showModal = false;
  261. if (refreshed) {
  262. this.changePage(this.pageIndex);
  263. }
  264. },
  265. },
  266. mounted: function () {
  267. this.changePage(1);
  268. },
  269. components: {
  270. "userAuthenticationApprove-detail": UserAuthenticationApproveDetail,
  271. },
  272. };
  273. </script>
  274. <style lang="scss" scoped>
  275. .el-breadcrumb {
  276. margin: 10px;
  277. line-height: 20px;
  278. }
  279. .el-divider {
  280. margin: 5px 0;
  281. }
  282. .demo-form-inline {
  283. margin-left: 10px;
  284. text-align: left;
  285. }
  286. .button-group {
  287. margin-left: 10px;
  288. text-align: left;
  289. }
  290. </style>