processFinishManage.vue 11 KB

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