index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. size="small"
  7. :inline="true"
  8. v-show="showSearch"
  9. label-width="68px"
  10. >
  11. <el-form-item label="审核状态" prop="status">
  12. <el-select
  13. v-model="queryParams.status"
  14. placeholder="请选择审核状态"
  15. clearable
  16. filterable
  17. >
  18. <el-option
  19. v-for="dict in statusList"
  20. :key="dict.value + 'statusList'"
  21. :label="dict.label"
  22. :value="dict.value"
  23. />
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item>
  27. <el-button
  28. type="primary"
  29. icon="el-icon-search"
  30. size="mini"
  31. @click="handleQuery"
  32. >搜索</el-button
  33. >
  34. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  35. >重置</el-button
  36. >
  37. </el-form-item>
  38. </el-form>
  39. <!--
  40. <el-row :gutter="10" class="mb8">
  41. <el-col :span="1.5">
  42. <el-button
  43. type="warning"
  44. plain
  45. icon="el-icon-download"
  46. size="mini"
  47. @click="handleExport"
  48. v-hasPermi="['business:INSTACTIONTASK:export']"
  49. >导出</el-button>
  50. </el-col>
  51. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  52. </el-row> -->
  53. <!-- <el-table
  54. v-loading="loading"
  55. :data="INSTACTIONTASKList"
  56. @selection-change="handleSelectionChange"
  57. >
  58. <el-table-column type="selection" width="55" align="center" />
  59. <el-table-column label="${comment}" align="center" prop="id">
  60. <template slot-scope="scope">
  61. <dict-tag
  62. :options="dict.type.${column.dictType}"
  63. :value="scope.row.id"
  64. />
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="创建时间" align="center" prop="createTime">
  68. <template slot-scope="scope">
  69. <dict-tag
  70. :options="dict.type.${column.dictType}"
  71. :value="scope.row.createTime"
  72. />
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="创建人" align="center" prop="createBy">
  76. <template slot-scope="scope">
  77. <dict-tag
  78. :options="dict.type.${column.dictType}"
  79. :value="scope.row.createBy"
  80. />
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="修改时间" align="center" prop="updateTime">
  84. <template slot-scope="scope">
  85. <dict-tag
  86. :options="dict.type.${column.dictType}"
  87. :value="scope.row.updateTime"
  88. />
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="修改人" align="center" prop="updateBy">
  92. <template slot-scope="scope">
  93. <dict-tag
  94. :options="dict.type.${column.dictType}"
  95. :value="scope.row.updateBy"
  96. />
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="删除标识" align="center" prop="delFlag">
  100. <template slot-scope="scope">
  101. <dict-tag
  102. :options="dict.type.${column.dictType}"
  103. :value="scope.row.delFlag"
  104. />
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="活动实例任务ID" align="center" prop="instAcId">
  108. <template slot-scope="scope">
  109. <dict-tag
  110. :options="dict.type.${column.dictType}"
  111. :value="scope.row.instAcId"
  112. />
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="活动实例id" align="center" prop="instProId">
  116. <template slot-scope="scope">
  117. <dict-tag
  118. :options="dict.type.${column.dictType}"
  119. :value="scope.row.instProId"
  120. />
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="活动名称" align="center" prop="acname">
  124. <template slot-scope="scope">
  125. <dict-tag
  126. :options="dict.type.${column.dictType}"
  127. :value="scope.row.acname"
  128. />
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="审核人" align="center" prop="execId">
  132. <template slot-scope="scope">
  133. <dict-tag
  134. :options="dict.type.${column.dictType}"
  135. :value="scope.row.execId"
  136. />
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="任务启动时间" align="center" prop="beginTime">
  140. <template slot-scope="scope">
  141. <dict-tag
  142. :options="dict.type.${column.dictType}"
  143. :value="scope.row.beginTime"
  144. />
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="任务结束时间" align="center" prop="endTime">
  148. <template slot-scope="scope">
  149. <dict-tag
  150. :options="dict.type.${column.dictType}"
  151. :value="scope.row.endTime"
  152. />
  153. </template>
  154. </el-table-column>
  155. <el-table-column
  156. label="审核状态(1=同意,2=驳回)"
  157. align="center"
  158. prop="status"
  159. >
  160. <template slot-scope="scope">
  161. <dict-tag
  162. :options="dict.type.${column.dictType}"
  163. :value="scope.row.status"
  164. />
  165. </template>
  166. </el-table-column>
  167. <el-table-column label="审核意见" align="center" prop="comments">
  168. <template slot-scope="scope">
  169. <dict-tag
  170. :options="dict.type.${column.dictType}"
  171. :value="scope.row.comments"
  172. />
  173. </template>
  174. </el-table-column>
  175. <el-table-column
  176. label="操作"
  177. align="center"
  178. class-name="small-padding fixed-width"
  179. >
  180. <template slot-scope="scope">
  181. <el-button
  182. size="mini"
  183. type="text"
  184. icon="el-icon-edit"
  185. @click="handleUpdate(scope.row)"
  186. v-hasPermi="['business:INSTACTIONTASK:edit']"
  187. >修改</el-button
  188. >
  189. <el-button
  190. size="mini"
  191. type="text"
  192. icon="el-icon-delete"
  193. @click="handleDelete(scope.row)"
  194. v-hasPermi="['business:INSTACTIONTASK:remove']"
  195. >删除</el-button
  196. >
  197. </template>
  198. </el-table-column>
  199. </el-table> -->
  200. <pagination
  201. v-show="total > 0"
  202. :total="total"
  203. :page.sync="queryParams.pageNum"
  204. :limit.sync="queryParams.pageSize"
  205. @pagination="getList"
  206. />
  207. </div>
  208. </template>
  209. <script>
  210. import {
  211. listINSTACTIONTASK,
  212. getINSTACTIONTASK,
  213. delINSTACTIONTASK,
  214. addINSTACTIONTASK,
  215. updateINSTACTIONTASK,
  216. } from "@/api/portal/task/task";
  217. export default {
  218. name: "INSTACTIONTASK",
  219. data() {
  220. return {
  221. // 根路径
  222. baseURL: process.env.VUE_APP_BASE_API,
  223. // 遮罩层
  224. loading: true,
  225. // 选中数组
  226. ids: [],
  227. // 非单个禁用
  228. single: true,
  229. // 非多个禁用
  230. multiple: true,
  231. // 显示搜索条件
  232. showSearch: true,
  233. // 总条数
  234. total: 0,
  235. // 审批任务实例表格数据
  236. INSTACTIONTASKList: [],
  237. // 弹出层标题
  238. title: "",
  239. // 是否显示弹出层
  240. open: false,
  241. // 查询参数
  242. queryParams: {
  243. pageNum: 1,
  244. pageSize: 10,
  245. id: null,
  246. createTime: null,
  247. createBy: null,
  248. updateTime: null,
  249. updateBy: null,
  250. delFlag: null,
  251. instAcId: null,
  252. instProId: null,
  253. acname: null,
  254. execId: null,
  255. beginTime: null,
  256. endTime: null,
  257. status: null,
  258. comments: null,
  259. },
  260. // 表单参数
  261. form: {},
  262. // 表单校验
  263. rules: {
  264. id: [{ required: true, message: "$comment不能为空", trigger: "blur" }],
  265. delFlag: [
  266. { required: true, message: "删除标识不能为空", trigger: "blur" },
  267. ],
  268. instAcId: [
  269. {
  270. required: true,
  271. message: "活动实例任务ID不能为空",
  272. trigger: "blur",
  273. },
  274. ],
  275. instProId: [
  276. { required: true, message: "活动实例id不能为空", trigger: "blur" },
  277. ],
  278. acname: [
  279. { required: true, message: "活动名称不能为空", trigger: "blur" },
  280. ],
  281. execId: [
  282. { required: true, message: "审核人不能为空", trigger: "blur" },
  283. ],
  284. beginTime: [
  285. { required: true, message: "任务启动时间不能为空", trigger: "blur" },
  286. ],
  287. endTime: [
  288. { required: true, message: "任务结束时间不能为空", trigger: "blur" },
  289. ],
  290. status: [
  291. {
  292. required: true,
  293. message: "审核状态(1=同意,2=驳回)不能为空",
  294. trigger: "blur",
  295. },
  296. ],
  297. comments: [
  298. { required: true, message: "审核意见不能为空", trigger: "blur" },
  299. ],
  300. },
  301. statusList: [
  302. { value: "1", label: "同意" },
  303. { value: "2", label: "驳回" },
  304. { value: "3", label: "退回" },
  305. ],
  306. };
  307. },
  308. created() {
  309. this.getList();
  310. },
  311. methods: {
  312. /** 查询审批任务实例列表 */
  313. getList() {
  314. this.loading = true;
  315. listINSTACTIONTASK(this.queryParams).then((response) => {
  316. this.INSTACTIONTASKList = response.rows;
  317. this.total = response.total;
  318. this.loading = false;
  319. });
  320. },
  321. // 取消按钮
  322. cancel() {
  323. this.open = false;
  324. this.reset();
  325. },
  326. // 表单重置
  327. reset() {
  328. this.form = {
  329. id: null,
  330. delFlag: null,
  331. instAcId: null,
  332. instProId: null,
  333. acname: null,
  334. execId: null,
  335. beginTime: null,
  336. endTime: null,
  337. status: "0",
  338. comments: null,
  339. };
  340. this.resetForm("form");
  341. },
  342. /** 搜索按钮操作 */
  343. handleQuery() {
  344. this.queryParams.pageNum = 1;
  345. this.getList();
  346. },
  347. /** 重置按钮操作 */
  348. resetQuery() {
  349. this.resetForm("queryForm");
  350. this.handleQuery();
  351. },
  352. // 多选框选中数据
  353. handleSelectionChange(selection) {
  354. this.ids = selection.map((item) => item.id);
  355. this.single = selection.length !== 1;
  356. this.multiple = !selection.length;
  357. },
  358. /** 新增按钮操作 */
  359. handleAdd() {
  360. this.reset();
  361. this.open = true;
  362. this.title = "添加审批任务实例";
  363. },
  364. /** 修改按钮操作 */
  365. handleUpdate(row) {
  366. this.reset();
  367. const id = row.id || this.ids;
  368. getINSTACTIONTASK(id).then((response) => {
  369. this.form = response.data;
  370. this.open = true;
  371. this.title = "修改审批任务实例";
  372. });
  373. },
  374. /** 提交按钮 */
  375. submitForm() {
  376. this.$refs["form"].validate((valid) => {
  377. if (valid) {
  378. if (this.form.id != null) {
  379. updateINSTACTIONTASK(this.form).then((response) => {
  380. this.$modal.msgSuccess("修改成功");
  381. this.open = false;
  382. this.getList();
  383. });
  384. } else {
  385. addINSTACTIONTASK(this.form).then((response) => {
  386. this.$modal.msgSuccess("新增成功");
  387. this.open = false;
  388. this.getList();
  389. });
  390. }
  391. }
  392. });
  393. },
  394. /** 删除按钮操作 */
  395. handleDelete(row) {
  396. const ids = row.id || this.ids;
  397. this.$modal
  398. .confirm('是否确认删除审批任务实例编号为"' + ids + '"的数据项?')
  399. .then(function () {
  400. return delINSTACTIONTASK(ids);
  401. })
  402. .then(() => {
  403. this.getList();
  404. this.$modal.msgSuccess("删除成功");
  405. })
  406. .catch(() => {});
  407. },
  408. /** 导出按钮操作 */
  409. handleExport() {
  410. this.download(
  411. "business/INSTACTIONTASK/export",
  412. {
  413. ...this.queryParams,
  414. },
  415. `INSTACTIONTASK_${new Date().getTime()}.xlsx`
  416. );
  417. },
  418. },
  419. };
  420. </script>