doneManage.vue 12 KB

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