havedone.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10" class="mb8">
  4. <el-col :span="1.5">
  5. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
  6. <el-form-item label="名称" prop="mailTheme">
  7. <el-input
  8. v-model="queryParams.mailTheme"
  9. placeholder="请输入名称"
  10. clearable
  11. size="small"
  12. @keyup.enter.native="handleQuery"
  13. />
  14. </el-form-item>
  15. <el-form-item>
  16. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  17. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  18. </el-form-item>
  19. </el-form>
  20. </el-col>
  21. </el-row>
  22. <el-table border :data="infoList" @selection-change="handleSelectionChange">
  23. <el-table-column type="selection" width="55" align="center" />
  24. <el-table-column label="序号" type="index" width="55" align="center"></el-table-column>
  25. <el-table-column label="流程名称" width="180" align="center" prop="taskName" >
  26. </el-table-column>
  27. <el-table-column label="标题" align="center" prop="title" />
  28. <el-table-column label="当前处理" width="180" align="center" prop="name"/>
  29. <el-table-column label="创建时间" width="180" align="center" prop="createTime" >
  30. <template slot-scope="scope">
  31. <span>{{scope.row.createTime | format('yyyy-MM-dd hh:mm')}}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="办理时间" width="180" align="center" prop="endTime" >
  35. <template slot-scope="scope">
  36. <span>{{scope.row.endTime | format('yyyy-MM-dd hh:mm')}}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width" >
  40. <template slot-scope="scope">
  41. <el-button
  42. size="small"
  43. type="text"
  44. icon="el-icon-edit"
  45. @click="openactform(scope.row.processDfinitionId,scope.row.businessKey)"
  46. >详情</el-button>
  47. <el-button
  48. size="small"
  49. type="text"
  50. icon="el-icon-share"
  51. @click="detail(scope.row)"
  52. >审批记录</el-button>
  53. </template>
  54. </el-table-column>
  55. </el-table>
  56. <pagination
  57. v-show="total>0"
  58. :total="total"
  59. :page.sync="queryParams.pageNum"
  60. :limit.sync="queryParams.pageSize"
  61. @pagination="getList"
  62. />
  63. <el-dialog title="审批记录" :visible.sync="dialogVisible" width="1200px">
  64. <el-tabs :tab-position="tabPosition" style="min-height: 200px;">
  65. <el-tab-pane>
  66. <span slot="label"><i class="el-icon-date"></i> 审批记录</span>
  67. <img :src="picUrl">
  68. </el-tab-pane>
  69. <el-tab-pane>
  70. <span slot="label"><i class="el-icon-date"></i> 审批详细</span>
  71. <el-table border :data="historyExamine" @selection-change="handleSelectionChange">
  72. <el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
  73. <el-table-column label="任务名称" width="100" align="center" prop="activityName"/>
  74. <el-table-column label="审批人员" width="180"align="center" prop="assigneeName"/>
  75. <el-table-column label="到达时间" align="center" prop="startTime">
  76. <template slot-scope="scope">
  77. <span>{{scope.row.startTime | format('yyyy-MM-dd hh:mm')}}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="审批时间" align="center" prop="endTime">
  81. <template slot-scope="scope">
  82. <span>{{scope.row.endTime | format('yyyy-MM-dd hh:mm')}}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="审批耗时" width="180" align="center" prop="activityType">
  86. <template slot-scope="scope">
  87. <span>{{scope.row.activityType }}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="审批意见" width="180" align="center" prop="comment"/>
  91. </el-table>
  92. <!-- formatTotalDateSub()-->
  93. </el-tab-pane>
  94. </el-tabs>
  95. <span slot="footer" class="dialog-footer">
  96. <el-button @click="cancel">关 闭</el-button>
  97. </span>
  98. </el-dialog>
  99. <el-dialog id="actform" title="流程详情" :visible.sync="actOpen" :before-close="cancel" append-to-body width="80%" top="10" height="90%">
  100. <!-- 动态引入组件-->
  101. <component :is="actForm" :data="details":actOpen="actOpen" @getList="getList" ></component>
  102. </el-dialog>
  103. </div>
  104. </template>
  105. <script>
  106. import { havedInfo } from "@/api/activiti/form/fw";
  107. import { recordImg, examineHistory } from '@/api/system/meapply/meapply'
  108. import {getStartFormKey } from '@/api/activiti/process/startprocess'
  109. export default {
  110. name: 'havedone',
  111. data(){
  112. return {
  113. //流程遮罩层
  114. actOpen: false,
  115. //传入到下一页面的值
  116. details:{getactkey: '',
  117. formId:'',
  118. flg:'2'},
  119. actForm: null,
  120. // 遮罩层
  121. loading: true,
  122. // 选中数组
  123. ids: [],
  124. flgs: [],
  125. // 非单个禁用
  126. single: true,
  127. // 非多个禁用
  128. multiple: true,
  129. // 总条数
  130. total: 0,
  131. // 【请填写功能名称】表格数据
  132. infoList: [],
  133. // 弹出层标题
  134. title: "",
  135. // 是否显示弹出层
  136. open: false,
  137. // 查询参数
  138. queryParams: {
  139. pageNum: 1,
  140. pageSize: 10,
  141. orderByColumn: "createTime",
  142. isAsc:"desc",//排序方式
  143. },
  144. // 表单参数
  145. form: {},
  146. // 表单校验
  147. rules: {
  148. },
  149. picUrl: '',
  150. tabPosition: 'left',
  151. //弹窗
  152. dialogVisible:false,
  153. //审批历史
  154. historyExamine: [
  155. {
  156. activityName: '',
  157. assignee: '',
  158. assigneeName: '',
  159. comment: '',
  160. startTime: '',
  161. endTime: '',
  162. activityType: ''
  163. }
  164. ],
  165. };
  166. },
  167. created() {
  168. this.getList();
  169. },
  170. methods: {
  171. //通过流程key查询启动的表单fromkey
  172. openactform(actkey,id) {
  173. let vue = this
  174. actkey=actkey.split(":")[0];
  175. this.details.getactkey = actkey//动态传参到下面的页面
  176. this.details.formId = id//动态传参到下面的页面
  177. getStartFormKey(actkey).then(response => {
  178. var path = response.msg
  179. this.actForm = () => Promise.resolve().then(() => require(`@/views/${path}`))
  180. })
  181. this.actOpen = true
  182. return vue.actForm = this.actForm
  183. },
  184. detern(row){
  185. this.reset();
  186. const actkey = row.taskid || this.ids
  187. const form = row || this.form
  188. this.$router.push({path:'/actwork/havedone/havedetails',query: {bd:form,id:actkey }})
  189. },
  190. detail(row){
  191. this.dialogVisible = true
  192. //查看图片
  193. var formdata = new FormData
  194. formdata.append('pProcessInstanceId', row.processInstanceId)
  195. recordImg(formdata).then(response => {
  196. this.picUrl = window.URL.createObjectURL(response)
  197. })
  198. examineHistory(row.processInstanceId,row.businessKey).then(response => {
  199. this.historyExamine = response.rows;
  200. console.log(response.rows)
  201. })
  202. },
  203. /** 查询列表 */
  204. getList() {
  205. this.loading = true;
  206. havedInfo(this.queryParams).then(response => {
  207. this.infoList = response.rows;
  208. this.total = response.total;
  209. this.loading = false;
  210. this.actOpen=false;
  211. });
  212. },
  213. // 取消按钮
  214. cancel() {
  215. this.open = false;
  216. this.dialogVisible = false;
  217. this.actOpen = false;
  218. this.reset();
  219. },
  220. // 表单重置
  221. reset() {
  222. this.form = {
  223. mailGuid: undefined,
  224. senderName: undefined,
  225. senderAccount: undefined,
  226. receiverName: undefined,
  227. receiverAccount: undefined,
  228. mailTheme: undefined,
  229. mailContent: undefined,
  230. createTime: undefined,
  231. status: "0",
  232. deleteTime: undefined
  233. };
  234. this.resetForm("form");
  235. },
  236. /** 搜索按钮操作 */
  237. handleQuery() {
  238. this.queryParams.pageNum = 1;
  239. this.getList();
  240. },
  241. /** 重置按钮操作 */
  242. resetQuery() {
  243. this.resetForm("queryForm");
  244. this.handleQuery();
  245. },
  246. // 多选框选中数据
  247. handleSelectionChange(selection) {
  248. this.ids = selection.map(item => item.mailGuid)
  249. this.flgs = selection.map(item => item.flg)
  250. this.single = selection.length!=1
  251. this.multiple = !selection.length
  252. },
  253. /** 新增按钮操作 */
  254. handleAdd() {
  255. this.reset();
  256. this.open = true;
  257. this.title = "添加【请填写功能名称】";
  258. },
  259. /** 修改按钮操作 */
  260. handleUpdate(row) {
  261. this.reset();
  262. const mailGuid = row.mailGuid || this.ids
  263. getInfo(mailGuid).then(response => {
  264. this.form = response.data;
  265. this.open = true;
  266. this.title = "修改";
  267. });
  268. },
  269. handleUpdate1(row) {
  270. this.reset();
  271. const mailGuid = row.mailGuid || this.ids
  272. this.$router.push({path:'/email/draftList/draftinfo',query: {id:mailGuid }})
  273. getInfo(mailGuid).then(response => {
  274. this.form = response.data;
  275. // this.open = true;
  276. // this.title = "修改";
  277. });
  278. },
  279. /** 删除按钮操作 */
  280. handleDelete(row) {
  281. const mailGuids = row.mailGuid || this.ids;
  282. const flg = row.flg || this.ids;
  283. let len = flg.length;
  284. this.$confirm('是否确认删除这' + len + '封邮件?', "警告", {
  285. confirmButtonText: "确定",
  286. cancelButtonText: "取消",
  287. type: "warning"
  288. }).then(function() {
  289. return delInfo(mailGuids);
  290. }).then(() => {
  291. this.getList();
  292. this.msgSuccess("删除成功");
  293. }).catch(function() {});
  294. },
  295. }
  296. }
  297. </script>
  298. <style scoped>
  299. </style>