doneManage.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <style lang="less">
  2. @import '~@assets/less/common.less';
  3. </style>
  4. <template>
  5. <div class="search">
  6. <a-card>
  7. <!-- 搜索重置 -->
  8. <div class="table-page-search-wrapper">
  9. <a-form layout="inline" @keyup.enter.native="handleSearch">
  10. <a-row :gutter="24">
  11. <a-col :md="6" :sm="8">
  12. <a-form-item label="任务名称" prop="name">
  13. <a-input type="text" v-model="searchForm.name" placeholder="请输入" clearable />
  14. </a-form-item>
  15. </a-col>
  16. <a-col :md="6" :sm="8">
  17. <a-form-item label="表单名称" prop="defname">
  18. <a-input type="text" v-model="searchForm.defname" placeholder="请输入" clearable />
  19. </a-form-item>
  20. </a-col>
  21. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  22. <a-col :md="6" :sm="12">
  23. <a-button @click="handleSearch" type="primary" icon="search">搜索</a-button>
  24. <a-button @click="handleReset" style="margin-left: 10px;">重置</a-button>
  25. </a-col>
  26. </span>
  27. </a-row>
  28. </a-form>
  29. </div>
  30. <!-- 表 -->
  31. <a-row>
  32. <!--:scroll="scroll+150" :scroll="scroll" -->
  33. <a-table
  34. bordered
  35. :loading="loading"
  36. rowKey="id"
  37. :dataSource="data"
  38. :pagination="ipagination"
  39. @change="handleTableChange"
  40. ref="table"
  41. >
  42. <a-table-column title="#" :width="50" align="center">
  43. <template slot-scope="t, r, i">
  44. <span> {{ i + 1 }} </span>
  45. </template>
  46. </a-table-column>
  47. <a-table-column title="任务名称" dataIndex="name" :width="100" align="center">
  48. <template slot-scope="t, r, i">
  49. <span> {{ t }} </span>
  50. </template>
  51. </a-table-column>
  52. <a-table-column title="所属流程" dataIndex="processName" :width="100" align="center">
  53. <template slot-scope="t, r, i">
  54. <span> {{ t }} </span>
  55. </template>
  56. </a-table-column>
  57. <a-table-column title="业务信息" dataIndex="description" :width="100" align="center">
  58. <template slot-scope="t, r, i">
  59. <span> {{ t }} </span>
  60. </template>
  61. </a-table-column>
  62. <a-table-column title="委托代办人" dataIndex="owner" :width="100" align="center">
  63. <template slot-scope="t, r, i">
  64. <span> {{ t }} </span>
  65. </template>
  66. </a-table-column>
  67. <a-table-column title="流程发起人" dataIndex="applyer" :width="100" align="center">
  68. <template slot-scope="t, r, i">
  69. <span> {{ t }} </span>
  70. </template>
  71. </a-table-column>
  72. <a-table-column
  73. title="优先级"
  74. dataIndex="priority"
  75. :width="80"
  76. align="center"
  77. key="priority"
  78. :sorter="(a, b) => a.priority - b.priority"
  79. >
  80. <template slot-scope="t">
  81. <span v-if="t == 0" style="color: green;"> 普通 </span>
  82. <span v-else-if="t == 1" style="color: orange;"> 重要 </span>
  83. <span v-else-if="t == 2" style="color: red;"> 紧急 </span>
  84. <span v-else style="color: #999;"> 无 </span>
  85. </template>
  86. </a-table-column>
  87. <!-- 审批操作 -->
  88. <a-table-column title="审批操作" dataIndex="deleteReason" :width="100" align="center">
  89. <template slot-scope="t, r, i">
  90. <template v-if="r.deleteReason == '审批通过'">
  91. <a-tag color="#87d068">{{ t }}</a-tag>
  92. </template>
  93. <template v-else>
  94. <a-tag color="#b7b7a4">{{ t }}</a-tag>
  95. </template>
  96. </template>
  97. </a-table-column>
  98. <a-table-column title="审批意见" dataIndex="comment" :width="100" align="center">
  99. <template slot-scope="t">
  100. <j-ellipsis :value="t" :length="6" />
  101. </template>
  102. </a-table-column>
  103. <a-table-column
  104. title="耗时"
  105. dataIndex="duration"
  106. :width="60"
  107. align="center"
  108. key="duration"
  109. :sorter="(a, b) => a.duration - b.duration"
  110. >
  111. <template slot-scope="t">
  112. <span> {{ millsToTime(t) }} </span>
  113. </template>
  114. </a-table-column>
  115. <a-table-column title="创建时间" dataIndex="createTime" :width="130" align="center">
  116. <template slot-scope="t">
  117. <span> {{ t }} </span>
  118. </template>
  119. </a-table-column>
  120. <a-table-column title="操作" dataIndex="action" align="center" :width="150">
  121. <template slot-scope="t, r, i">
  122. <a href="javascript:void(0);" @click="detail(r)">详情</a>
  123. <a-divider type="vertical" />
  124. <a href="javascript:void(0);" @click="history(r)" style="color:gray">审批历史</a>
  125. <a-divider type="vertical" />
  126. <a-popconfirm title="确定删除吗?" @confirm="() => remove(r)">
  127. <a style="color: red;">删除</a>
  128. </a-popconfirm>
  129. </template>
  130. </a-table-column>
  131. </a-table>
  132. </a-row>
  133. </a-card>
  134. <!--审批历史-->
  135. <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
  136. <div v-if="modalLsVisible">
  137. <component :is="historicDetail" :procInstId="procInstId"></component>
  138. </div>
  139. </a-modal>
  140. <!--流程表单-->
  141. <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
  142. <component
  143. :disabled="lcModa.disabled"
  144. v-if="lcModa.visible"
  145. :is="lcModa.formComponent"
  146. :processData="lcModa.processData"
  147. :isNew="lcModa.isNew"
  148. @close=";(lcModa.visible = false), (lcModa.disabled = false)"
  149. ></component>
  150. </a-modal>
  151. <!-- 项目管理整合 打开合同页面 -->
  152. <outerForm-check ref="outerFormCheck" @refreshData="handleSearch" ></outerForm-check>
  153. </div>
  154. </template>
  155. <script>
  156. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  157. import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
  158. import {getEditorJumpUrl,getProjctManageUrl}from '../../../url.config'
  159. import outerFormCheck from '../../share/modal/OuterFormCheck'
  160. import { getAction } from '@/api/manage'
  161. export default {
  162. name: 'done-manage',
  163. mixins: [activitiMixin, JeecgListMixin],
  164. components:{
  165. outerFormCheck
  166. },
  167. data() {
  168. return {
  169. openSearch: true,
  170. openTip: true,
  171. loading: true, // 表单加载状态
  172. selectCount: 0, // 多选计数
  173. selectList: [], // 多选数据
  174. searchForm: {
  175. // 搜索框对应data对象
  176. name: '',
  177. pageNumber: 1, // 当前页数
  178. pageSize: 10, // 页面大小
  179. sort: 'createTime', // 默认排序字段
  180. order: 'desc' // 默认排序方式
  181. },
  182. modalType: 0, // 添加或编辑标识
  183. modalVisible: false, // 添加或编辑显示
  184. modalTitle: '', // 添加或编辑标题
  185. form: {
  186. // 添加或编辑表单对象初始化数据
  187. reason: ''
  188. },
  189. formValidate: {
  190. // 表单验证规则
  191. },
  192. submitLoading: false, // 添加或编辑提交状态
  193. data: [], // 表数据
  194. total: 0, // 表数据总数
  195. deleteId: '',
  196. url: {
  197. doneList: '/actTask/doneList',
  198. deleteHistoricTask: '/actTask/deleteHistoric/',
  199. outformViewUrl:"/actBusiness/external/getViewUrl",
  200. },
  201. modalLsVisible: false,
  202. procInstId: '',
  203. lcModa: {
  204. title: '',
  205. disabled: false,
  206. visible: false,
  207. formComponent: null,
  208. isNew: false
  209. }
  210. }
  211. },
  212. mounted() {
  213. this.init()
  214. },
  215. methods: {
  216. loadData() {},
  217. init() {
  218. this.getDataList()
  219. },
  220. getDataList() {
  221. this.loading = true
  222. this.postFormAction(this.url.doneList, this.searchForm).then(res => {
  223. this.loading = false
  224. if (res.success) {
  225. this.data = res.result || []
  226. } else {
  227. this.$message.error(res.message)
  228. }
  229. })
  230. },
  231. handleSearch() {
  232. this.searchForm.pageNumber = 1
  233. this.searchForm.pageSize = 10
  234. this.getDataList()
  235. },
  236. handleReset() {
  237. this.searchForm = {}
  238. this.searchForm.pageNumber = 1
  239. this.searchForm.pageSize = 10
  240. // 重新加载数据
  241. this.getDataList()
  242. },
  243. handelCancel() {
  244. this.modalVisible = false
  245. },
  246. detail(r) {
  247. if (!r.routeName) {
  248. this.$message.warning('该流程信息未配置表单,请联系开发人员!')
  249. return
  250. }
  251. if (r.routeName.indexOf('外部表单') != -1||r.tableName.indexOf('外部表单') != -1) {
  252. //外部项目开发的表单
  253. //其他项目的表单流程
  254. //var id = r.tableId //项目管理合同数据id
  255. //打开MyIframe弹框
  256. //this.$refs.MyIframe.editorVisible = true
  257. //并传入地址参数
  258. //this.$refs.MyIframe.editorJumpUrlMy = getProjctManageUrl()+'/contract-process-view?id=' + id
  259. this.showOuterFormViewDlg(r.tableId, '查看业务流程:' + r.processName, r);
  260. } else if (r.routeName.indexOf('自定义') != -1) {
  261. //自定义的表单流程
  262. this.lcModa.disabled = true
  263. this.lcModa.title = '查看流程业务信息:' + r.processName
  264. let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
  265. this.lcModa.formComponent = com.component
  266. this.lcModa.isNew = false
  267. this.lcModa.processData = r
  268. this.lcModa.visible = true
  269. } else {
  270. //固定的表单
  271. this.lcModa.disabled = true
  272. this.lcModa.title = '查看流程业务信息:' + r.processName
  273. this.lcModa.formComponent = this.getFormComponent(r.routeName).component
  274. this.lcModa.processData = r
  275. this.lcModa.isNew = false
  276. this.lcModa.visible = true
  277. }
  278. },
  279. history(v) {
  280. if (!v.procInstId) {
  281. this.$message.error('流程实例ID不存在')
  282. return
  283. }
  284. this.procInstId = v.procInstId
  285. this.modalLsVisible = true
  286. },
  287. remove(v) {
  288. this.postFormAction(this.url.deleteHistoricTask + v.id).then(res => {
  289. if (res.success) {
  290. this.$message.success('操作成功')
  291. this.getDataList()
  292. } else {
  293. this.$message.error(res.message)
  294. }
  295. })
  296. },
  297. handleTableChange(pagination, filters, sorter) {
  298. //分页、排序、筛选变化时触发
  299. //TODO 筛选
  300. if (Object.keys(sorter).length > 0) {
  301. this.isorter.column = sorter.field
  302. this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
  303. }
  304. this.ipagination = pagination
  305. // this.loadData();
  306. },
  307. showOuterFormViewDlg(tableId, title, processData){
  308. getAction(this.url.outformViewUrl,{tableId:tableId}).then(res=>{
  309. if (res.success){
  310. var url = res.result.url;
  311. var param = res.result.param;
  312. url = url+"?"+this.jsonToUrlParam(param);
  313. this.$refs.outerFormCheck.openDialog(url, title, processData);
  314. }else{
  315. this.$message.error(res.message);
  316. }
  317. });
  318. },
  319. jsonToUrlParam(query){
  320. var tmpArr = [];
  321. for (var i in query){
  322. var key = encodeURIComponent(i);
  323. var value = encodeURIComponent(query[i]);
  324. tmpArr.push(key+"="+value);
  325. }
  326. return tmpArr.join("&");
  327. },
  328. },
  329. watch: {}
  330. }
  331. </script>