doneManage.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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. <a-tag color="#87d068">通过</a-tag>
  93. </template>
  94. <template v-else>
  95. <!-- <a-tag color="#b7b7a4">{{ t }}</a-tag> -->
  96. <a-tag color="#b7b7a4">驳回</a-tag>
  97. </template>
  98. </template>
  99. </a-table-column>
  100. <a-table-column title="审批意见" dataIndex="comment" :width="100" align="center">
  101. <template slot-scope="t">
  102. <j-ellipsis :value="t" :length="6" />
  103. </template>
  104. </a-table-column>
  105. <!-- <a-table-column
  106. title="耗时"
  107. dataIndex="duration"
  108. :width="60"
  109. align="center"
  110. key="duration"
  111. :sorter="(a, b) => a.duration - b.duration"
  112. >
  113. <template slot-scope="t">
  114. <span> {{ millsToTime(t) }} </span>
  115. </template>
  116. </a-table-column> -->
  117. <a-table-column title="创建时间" dataIndex="createTime" :width="130" align="center">
  118. <template slot-scope="t">
  119. <span> {{ t }} </span>
  120. </template>
  121. </a-table-column>
  122. <a-table-column title="操作" dataIndex="action" align="center" :width="150">
  123. <template slot-scope="t, r, i">
  124. <a href="javascript:void(0);" @click="detail(r)">详情</a>
  125. <a-divider type="vertical" />
  126. <a href="javascript:void(0);" @click="history(r)" style="color:gray">审批历史</a>
  127. <a-divider type="vertical" />
  128. <!-- <a-popconfirm title="确定删除吗?" @confirm="() => remove(r)">
  129. <a style="color: red;">删除</a>
  130. </a-popconfirm> -->
  131. </template>
  132. </a-table-column>
  133. </a-table>
  134. </a-row>
  135. </a-card>
  136. <!--审批历史-->
  137. <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
  138. <div v-if="modalLsVisible">
  139. <component :is="historicDetail" :procInstId="procInstId"></component>
  140. </div>
  141. </a-modal>
  142. <!--流程表单-->
  143. <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
  144. <component
  145. :disabled="lcModa.disabled"
  146. v-if="lcModa.visible"
  147. :is="lcModa.formComponent"
  148. :processData="lcModa.processData"
  149. :isNew="lcModa.isNew"
  150. @close=";(lcModa.visible = false), (lcModa.disabled = false)"
  151. ></component>
  152. </a-modal>
  153. <!-- 项目管理整合 打开合同页面 -->
  154. <outerForm-check ref="outerFormCheck" @refreshData="handleSearch" ></outerForm-check>
  155. </div>
  156. </template>
  157. <script>
  158. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  159. import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
  160. import {getEditorJumpUrl,getProjctManageUrl}from '../../../url.config'
  161. import outerFormCheck from '../../share/modal/OuterFormCheck'
  162. import { getAction } from '@/api/manage'
  163. export default {
  164. name: 'done-manage',
  165. mixins: [activitiMixin, JeecgListMixin],
  166. components:{
  167. outerFormCheck
  168. },
  169. data() {
  170. return {
  171. openSearch: true,
  172. openTip: true,
  173. loading: true, // 表单加载状态
  174. selectCount: 0, // 多选计数
  175. selectList: [], // 多选数据
  176. searchForm: {
  177. // 搜索框对应data对象
  178. name: '',
  179. pageNumber: 1, // 当前页数
  180. pageSize: 10, // 页面大小
  181. sort: 'createTime', // 默认排序字段
  182. order: 'desc' // 默认排序方式
  183. },
  184. modalType: 0, // 添加或编辑标识
  185. modalVisible: false, // 添加或编辑显示
  186. modalTitle: '', // 添加或编辑标题
  187. form: {
  188. // 添加或编辑表单对象初始化数据
  189. reason: ''
  190. },
  191. formValidate: {
  192. // 表单验证规则
  193. },
  194. submitLoading: false, // 添加或编辑提交状态
  195. data: [], // 表数据
  196. total: 0, // 表数据总数
  197. deleteId: '',
  198. url: {
  199. doneList: '/actTask/doneList',
  200. deleteHistoricTask: '/actTask/deleteHistoric/',
  201. outformViewUrl:"/actBusiness/external/getViewUrl",
  202. },
  203. modalLsVisible: false,
  204. procInstId: '',
  205. lcModa: {
  206. title: '',
  207. disabled: false,
  208. visible: false,
  209. formComponent: null,
  210. isNew: false
  211. }
  212. }
  213. },
  214. mounted() {
  215. this.init()
  216. },
  217. methods: {
  218. loadData() {},
  219. init() {
  220. this.getDataList()
  221. },
  222. getDataList() {
  223. this.loading = true
  224. this.postFormAction(this.url.doneList, this.searchForm).then(res => {
  225. this.loading = false
  226. if (res.success) {
  227. this.data = res.result || []
  228. } else {
  229. this.$message.error(res.message)
  230. }
  231. })
  232. },
  233. handleSearch() {
  234. this.searchForm.pageNumber = 1
  235. this.searchForm.pageSize = 10
  236. this.getDataList()
  237. },
  238. handleReset() {
  239. this.searchForm = {}
  240. this.searchForm.pageNumber = 1
  241. this.searchForm.pageSize = 10
  242. // 重新加载数据
  243. this.getDataList()
  244. },
  245. handelCancel() {
  246. this.modalVisible = false
  247. },
  248. detail(r) {
  249. if (!r.routeName) {
  250. this.$message.warning('该流程信息未配置表单,请联系开发人员!')
  251. return
  252. }
  253. if (r.routeName.indexOf('外部表单') != -1||r.tableName.indexOf('外部表单') != -1) {
  254. //外部项目开发的表单
  255. //其他项目的表单流程
  256. //var id = r.tableId //项目管理合同数据id
  257. //打开MyIframe弹框
  258. //this.$refs.MyIframe.editorVisible = true
  259. //并传入地址参数
  260. //this.$refs.MyIframe.editorJumpUrlMy = getProjctManageUrl()+'/contract-process-view?id=' + id
  261. this.showOuterFormViewDlg(r.tableId, '查看业务流程:' + r.processName, r);
  262. } else if (r.routeName.indexOf('自定义') != -1) {
  263. //自定义的表单流程
  264. this.lcModa.disabled = true
  265. this.lcModa.title = '查看流程业务信息:' + r.processName
  266. let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
  267. this.lcModa.formComponent = com.component
  268. this.lcModa.isNew = false
  269. this.lcModa.processData = r
  270. this.lcModa.visible = true
  271. } else {
  272. //固定的表单
  273. this.lcModa.disabled = true
  274. this.lcModa.title = '查看流程业务信息:' + r.processName
  275. this.lcModa.formComponent = this.getFormComponent(r.routeName).component
  276. this.lcModa.processData = r
  277. this.lcModa.isNew = false
  278. this.lcModa.visible = true
  279. }
  280. },
  281. history(v) {
  282. if (!v.procInstId) {
  283. this.$message.error('流程实例ID不存在')
  284. return
  285. }
  286. this.procInstId = v.procInstId
  287. this.modalLsVisible = true
  288. },
  289. remove(v) {
  290. this.postFormAction(this.url.deleteHistoricTask + v.id).then(res => {
  291. if (res.success) {
  292. this.$message.success('操作成功')
  293. this.getDataList()
  294. } else {
  295. this.$message.error(res.message)
  296. }
  297. })
  298. },
  299. handleTableChange(pagination, filters, sorter) {
  300. //分页、排序、筛选变化时触发
  301. //TODO 筛选
  302. if (Object.keys(sorter).length > 0) {
  303. this.isorter.column = sorter.field
  304. this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
  305. }
  306. this.ipagination = pagination
  307. // this.loadData();
  308. },
  309. showOuterFormViewDlg(tableId, title, processData){
  310. getAction(this.url.outformViewUrl,{tableId:tableId}).then(res=>{
  311. if (res.success){
  312. var url = res.result.url;
  313. var param = res.result.param;
  314. url = url+"?"+this.jsonToUrlParam(param);
  315. this.$refs.outerFormCheck.openDialog(url, title, processData);
  316. }else{
  317. this.$message.error(res.message);
  318. }
  319. });
  320. },
  321. jsonToUrlParam(query){
  322. var tmpArr = [];
  323. for (var i in query){
  324. var key = encodeURIComponent(i);
  325. var value = encodeURIComponent(query[i]);
  326. tmpArr.push(key+"="+value);
  327. }
  328. return tmpArr.join("&");
  329. },
  330. },
  331. watch: {}
  332. }
  333. </script>