index.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <div class="filter-container">
  5. <el-form
  6. label-width="100px"
  7. class="ele-form-search"
  8. @keyup.enter.native="reload"
  9. @submit.native.prevent
  10. >
  11. <el-row :gutter="15">
  12. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  13. <el-form-item label="流程分类:" prop="processTypeName">
  14. <el-input
  15. clearable
  16. v-model.trim="params.processTypeName"
  17. ></el-input>
  18. </el-form-item>
  19. </el-col>
  20. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  21. <el-form-item label="任务名:" prop="name">
  22. <el-input clearable v-model.trim="params.name"></el-input>
  23. </el-form-item>
  24. </el-col>
  25. <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  26. <el-form-item label="状态:" prop="status">
  27. <el-select
  28. v-model="params.status"
  29. placeholder="请选择状态"
  30. clearable
  31. >
  32. <el-option
  33. v-for="dict in statusList"
  34. :key="dict.value"
  35. :label="dict.label"
  36. :value="dict.value"
  37. />
  38. </el-select>
  39. </el-form-item>
  40. </el-col> -->
  41. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  42. <el-form-item label="创建时间:" prop="createTime">
  43. <el-date-picker
  44. v-model="params.createTime"
  45. style="width: 100%"
  46. value-format="yyyy-MM-dd HH:mm:ss"
  47. type="daterange"
  48. range-separator="-"
  49. start-placeholder="开始日期"
  50. end-placeholder="结束日期"
  51. :default-time="['00:00:00', '23:59:59']"
  52. />
  53. </el-form-item>
  54. </el-col>
  55. <el-col
  56. style="display: flex; justify-content: flex-end"
  57. v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }"
  58. >
  59. <div class="ele-form-actions">
  60. <el-button
  61. type="primary"
  62. icon="el-icon-search"
  63. class="ele-btn-icon"
  64. @click="reload"
  65. >
  66. 查询
  67. </el-button>
  68. <el-button @click="reset">重置</el-button>
  69. </div>
  70. </el-col>
  71. </el-row>
  72. </el-form>
  73. </div>
  74. <ele-pro-table
  75. ref="table"
  76. :columns="columns"
  77. :datasource="datasource"
  78. @columns-change="handleColumnChange"
  79. :cache-key="cacheKeyUrl"
  80. >
  81. <template v-slot:status="{ row }">
  82. <el-tag type="success" v-if="row.suspensionState === 1">激活</el-tag>
  83. <el-tag type="warning" v-if="row.suspensionState === 2">挂起</el-tag>
  84. </template>
  85. <template v-slot:name="{ row }">
  86. <el-link
  87. type="primary"
  88. :underline="false"
  89. @click="handleAudit('', row)"
  90. >
  91. {{ row.name }}</el-link
  92. >
  93. </template>
  94. <!-- 操作列 -->
  95. <template v-slot:action="{ row }">
  96. <el-button
  97. size="mini"
  98. type="text"
  99. icon="el-icon-edit"
  100. @click="handleAudit('audit', row)"
  101. >处理</el-button
  102. >
  103. <!-- <el-button-->
  104. <!-- size="mini"-->
  105. <!-- type="text"-->
  106. <!-- icon="el-icon-edit"-->
  107. <!-- @click="handleAudit('audit', row)"-->
  108. <!-- >转派</el-button-->
  109. <!-- >-->
  110. <!-- <el-button
  111. size="mini"
  112. type="text"
  113. icon="el-icon-edit"
  114. @click="openEdit('upDate', row)"
  115. >待办详情</el-button
  116. > -->
  117. </template>
  118. </ele-pro-table>
  119. </el-card>
  120. <handleTask ref="handleTaskRef" @reload="reload"></handleTask>
  121. <handleFormParserTask
  122. v-if="formParserDialogFlag"
  123. @reload="reload"
  124. :formParserDialogFlag.sync="formParserDialogFlag"
  125. ref="formParserDialogRef"
  126. ></handleFormParserTask>
  127. <detail ref="detailRef"></detail>
  128. <!-- <el-button type="text" @click="dialogVisible = true"
  129. >点击打开 Dialog</el-button
  130. >
  131. <el-dialog title="提示" :visible.sync="dialogVisible" width="90%">
  132. <inOut />
  133. <span slot="footer" class="dialog-footer">
  134. <el-button @click="dialogVisible = false">取 消</el-button>
  135. <el-button type="primary" @click="dialogVisible = false"
  136. >确 定</el-button
  137. >
  138. </span>
  139. </el-dialog> -->
  140. </div>
  141. </template>
  142. <script>
  143. import { getTodoTaskPage } from '@/api/bpm/task';
  144. import handleTask from '@/views/bpm/handleTask/index.vue';
  145. import handleFormParserTask from '@/views/bpm/handleTask/formParser/formParserDialog.vue'; //处理
  146. import detail from '@/views/bpm/done/detailDialog.vue';
  147. import inOut from '../outgoingManagement/add.vue';
  148. import tabMixins from '@/mixins/tableColumnsMixin';
  149. // 默认表单数据
  150. const defaultParams = {
  151. status: '',
  152. processTypeName: '',
  153. name: ''
  154. };
  155. export default {
  156. name: 'BpmDoneTask',
  157. components: { handleTask, detail, inOut, handleFormParserTask },
  158. computed: {
  159. // 是否开启响应式布局
  160. styleResponsive() {
  161. return this.$store.state.theme.styleResponsive;
  162. }
  163. },
  164. mixins: [tabMixins],
  165. data() {
  166. return {
  167. cacheKeyUrl: 'wt-todo',
  168. dialogVisible: false,
  169. formParserDialogFlag: false,
  170. // 遮罩层
  171. loading: true,
  172. params: { ...defaultParams },
  173. statusList: [],
  174. columns: [
  175. {
  176. columnKey: 'index',
  177. label: '序号',
  178. type: 'index',
  179. width: 55,
  180. align: 'center',
  181. showOverflowTooltip: true,
  182. fixed: 'left'
  183. },
  184. {
  185. prop: 'processInstance.processTypeName',
  186. label: '流程分类',
  187. align: 'center',
  188. showOverflowTooltip: true,
  189. minWidth: 200
  190. },
  191. {
  192. prop: 'processInstance.name',
  193. label: '流程名称',
  194. align: 'center',
  195. showOverflowTooltip: true,
  196. minWidth: 200
  197. },
  198. {
  199. prop: 'name',
  200. label: '任务名称',
  201. align: 'center',
  202. slot: 'name',
  203. showOverflowTooltip: true,
  204. minWidth: 200
  205. },
  206. {
  207. prop: 'businessCode',
  208. label: '单据编码',
  209. align: 'center',
  210. showOverflowTooltip: true,
  211. minWidth: 120
  212. },
  213. {
  214. prop: 'businessName',
  215. label: '单据名称',
  216. align: 'center',
  217. showOverflowTooltip: true,
  218. minWidth: 120
  219. },
  220. {
  221. prop: 'businessType',
  222. label: '单据类型',
  223. align: 'center',
  224. showOverflowTooltip: true,
  225. minWidth: 120
  226. },
  227. {
  228. prop: 'processInstance.startUserNickname',
  229. label: '流程发起人',
  230. align: 'center',
  231. showOverflowTooltip: true,
  232. minWidth: 200
  233. },
  234. // {
  235. // prop: 'suspensionState',
  236. // slot: 'suspensionState',
  237. // label: '状态',
  238. // align: 'center',
  239. // showOverflowTooltip: true,
  240. // minWidth: 200
  241. // },
  242. {
  243. prop: 'createTime',
  244. label: '创建时间',
  245. align: 'center',
  246. showOverflowTooltip: true,
  247. minWidth: 180
  248. },
  249. {
  250. columnKey: 'action',
  251. label: '操作',
  252. width: 230,
  253. align: 'center',
  254. resizable: false,
  255. slot: 'action',
  256. showOverflowTooltip: true,
  257. fixed: 'right'
  258. }
  259. ]
  260. };
  261. },
  262. created() {},
  263. methods: {
  264. /* 表格数据源 */
  265. datasource({ page, limit, where, order }) {
  266. return getTodoTaskPage({
  267. pageNo: page,
  268. pageSize: limit,
  269. ...this.params
  270. });
  271. },
  272. /* 刷新表格 */
  273. reload(where) {
  274. this.$refs.table.reload({ page: 1, where });
  275. },
  276. /* 重置 */
  277. reset() {
  278. this.params = { ...defaultParams };
  279. this.reload();
  280. },
  281. /** 处理审批按钮 */
  282. handleAudit(type, row) {
  283. console.log(type,row)
  284. // return
  285. if (type == 'audit') {
  286. if (row.formJson && Object.keys(row.formJson).length) {
  287. console.log('处理1');
  288. this.formParserDialogFlag = true;
  289. this.$nextTick(() => {
  290. this.$refs.formParserDialogRef.open({
  291. // id: row.processInstance.id,
  292. // taskId: row.id,
  293. taskDefinitionKey: row.taskDefinitionKey,
  294. // formJson:row.formJson,
  295. // valueJsom:row.formJson,
  296. businessId: row.businessId,
  297. ...row
  298. });
  299. });
  300. } else {
  301. console.log('处理2');
  302. this.$refs.handleTaskRef.open({
  303. id: row.processInstance.id,
  304. businessId: row.businessId,
  305. businessCode: row.businessCode,
  306. businessType: row.businessType,
  307. taskId: row.id,
  308. taskDefinitionKey: row.taskDefinitionKey,
  309. pcHandleRouter: row.pcHandleRouter,
  310. pcViewRouter: row.pcViewRouter
  311. });
  312. }
  313. } else {
  314. this.$refs.detailRef.open(row);
  315. }
  316. }
  317. }
  318. };
  319. </script>