综合办公系统
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="名称" prop="name">
  5. <el-input v-model="queryParams.name" placeholder="请输入名称" clearable size="small"
  6. @keyup.enter.native="handleQuery" />
  7. </el-form-item>
  8. <el-form-item label="开始时间" prop="deployTime">
  9. <el-date-picker clearable size="small" v-model="queryParams.deployTime" type="date" value-format="yyyy-MM-dd"
  10. placeholder="选择时间">
  11. </el-date-picker>
  12. </el-form-item>
  13. <el-form-item>
  14. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  15. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  16. </el-form-item>
  17. </el-form>
  18. <el-row :gutter="10" class="mb8">
  19. <el-col :span="1.5">
  20. <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
  21. v-hasPermi="['system:deployment:remove']">删除</el-button>
  22. </el-col>
  23. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  24. </el-row>
  25. <el-table v-loading="loading" :data="finishedList" border @selection-change="handleSelectionChange">
  26. <el-table-column type="selection" width="55" align="center" />
  27. <el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true" />
  28. <el-table-column label="任务编号" align="center" prop="taskId" :show-overflow-tooltip="true" />
  29. <el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true" />
  30. <el-table-column label="任务节点" align="center" prop="taskName" />
  31. <el-table-column label="流程发起人" align="center">
  32. <template slot-scope="scope">
  33. <label>{{ scope.row.startUserName }}
  34. <el-tag type="info" size="mini">
  35. {{ scope.row.startDeptName }}
  36. </el-tag>
  37. </label>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="接收时间" align="center" prop="createTime" width="180" />
  41. <el-table-column label="审批时间" align="center" prop="finishTime" width="180" />
  42. <el-table-column label="耗时" align="center" prop="duration" width="180" />
  43. <el-table-column label="操作" align="center" width="220" fixed="right" class-name="small-padding fixed-width">
  44. <template slot-scope="scope">
  45. <el-button size="mini" type="text" icon="el-icon-tickets"
  46. @click="handleFlowRecord(scope.row)">办理进度</el-button>
  47. <el-button size="mini" type="text" icon="el-icon-tickets" @click="handleFlowNote(scope.row)">表单信息</el-button>
  48. <el-button size="mini" type="text" icon="el-icon-refresh-left" @click="handleRevoke(scope.row)">撤回
  49. </el-button>
  50. </template>
  51. </el-table-column>
  52. </el-table>
  53. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
  54. @pagination="getList" />
  55. <el-dialog title="表单信息" :visible.sync="formOpen" append-to-body width="80%">
  56. <condition-display :passingParam="passingParam"></condition-display>
  57. </el-dialog>
  58. <el-dialog title="流程进度" :visible.sync="detailsOpen" append-to-body width="600px">
  59. <el-scrollbar style="height: 600px;">
  60. <row-detail :rows="clickRow"></row-detail>
  61. </el-scrollbar>
  62. </el-dialog>
  63. </div>
  64. </template>
  65. <script>
  66. import { finishedList, getDeployment, delDeployment, addDeployment, updateDeployment, exportDeployment, revokeProcess } from "@/api/flowable/finished";
  67. import { getProcessVariables } from "@/api/flowable/definition";
  68. import ConditionDisplay from '@/views/flowable/form/components/conditionDisplay.vue';
  69. import RowDetail from '../myProcess/send/rowDetail.vue';
  70. export default {
  71. name: "Deploy",
  72. components: {
  73. ConditionDisplay,
  74. RowDetail
  75. },
  76. data() {
  77. return {
  78. // 遮罩层
  79. loading: true,
  80. // 选中数组
  81. ids: [],
  82. // 非单个禁用
  83. single: true,
  84. // 非多个禁用
  85. multiple: true,
  86. // 显示搜索条件
  87. showSearch: true,
  88. // 总条数
  89. total: 0,
  90. // 已办任务列表数据
  91. finishedList: [],
  92. // 弹出层标题
  93. title: "",
  94. // 是否显示弹出层
  95. open: false,
  96. src: "",
  97. // 查询参数
  98. queryParams: {
  99. pageNum: 1,
  100. pageSize: 10,
  101. name: null,
  102. category: null,
  103. key: null,
  104. tenantId: null,
  105. deployTime: null,
  106. derivedFrom: null,
  107. derivedFromRoot: null,
  108. parentDeploymentId: null,
  109. engineVersion: null
  110. },
  111. // 表单参数
  112. form: {},
  113. // 表单校验
  114. rules: {
  115. },
  116. passingParam: {},
  117. formOpen: false,
  118. // 当前点击的行数据
  119. clickRow: {},
  120. detailsOpen:false
  121. };
  122. },
  123. created() {
  124. this.getList();
  125. },
  126. methods: {
  127. /** 查询流程定义列表 */
  128. getList() {
  129. this.loading = true;
  130. finishedList(this.queryParams).then(response => {
  131. this.finishedList = response.data.records;
  132. this.total = response.data.total;
  133. this.loading = false;
  134. });
  135. },
  136. // 取消按钮
  137. cancel() {
  138. this.open = false;
  139. this.reset();
  140. },
  141. // 表单重置
  142. reset() {
  143. this.form = {
  144. id: null,
  145. name: null,
  146. category: null,
  147. key: null,
  148. tenantId: null,
  149. deployTime: null,
  150. derivedFrom: null,
  151. derivedFromRoot: null,
  152. parentDeploymentId: null,
  153. engineVersion: null
  154. };
  155. this.resetForm("form");
  156. },
  157. setIcon(val) {
  158. if (val) {
  159. return "el-icon-check";
  160. } else {
  161. return "el-icon-time";
  162. }
  163. },
  164. setColor(val) {
  165. if (val) {
  166. return "#2bc418";
  167. } else {
  168. return "#b3bdbb";
  169. }
  170. },
  171. /** 搜索按钮操作 */
  172. handleQuery() {
  173. this.queryParams.pageNum = 1;
  174. this.getList();
  175. },
  176. /** 重置按钮操作 */
  177. resetQuery() {
  178. this.resetForm("queryForm");
  179. this.handleQuery();
  180. },
  181. // 多选框选中数据
  182. handleSelectionChange(selection) {
  183. this.ids = selection.map(item => item.id)
  184. this.single = selection.length !== 1
  185. this.multiple = !selection.length
  186. },
  187. /** 新增按钮操作 */
  188. handleAdd() {
  189. this.reset();
  190. this.open = true;
  191. this.title = "添加流程定义";
  192. },
  193. /** 流程流转记录 */
  194. handleFlowRecord(row) {
  195. // getProcessVariables(row.taskId).then(res => {
  196. // this.$router.push({
  197. // path: '/flowable/task/finished/detail/index',
  198. // query: {
  199. // procInsId: row.procInsId,
  200. // deployId: row.deployId,
  201. // taskId: row.taskId,
  202. // formId: res.data.formId,
  203. // procDefName: row.procDefName
  204. // }
  205. // })
  206. // })
  207. this.clickRow = row;
  208. this.detailsOpen = true;
  209. },
  210. // 表单信息
  211. handleFlowNote(row) {
  212. getProcessVariables(row.taskId).then(res => {
  213. if (res.data) {
  214. this.passingParam = row
  215. this.passingParam.formId = res.data.formId
  216. this.formOpen = true
  217. }
  218. })
  219. },
  220. /** 撤回任务 */
  221. handleRevoke(row) {
  222. this.$confirm('确定撤回任务吗?', '提示', {
  223. confirmButtonText: '确定',
  224. cancelButtonText: '取消',
  225. type: 'warning'
  226. }).then(() => {
  227. const params = {
  228. instanceId: row.procInsId,
  229. taskId: row.taskId
  230. }
  231. revokeProcess(params).then(res => {
  232. this.$modal.msgSuccess(res.msg);
  233. this.getList();
  234. });
  235. }).catch(() => { });
  236. },
  237. /** 修改按钮操作 */
  238. handleUpdate(row) {
  239. this.reset();
  240. const id = row.deployId || this.ids
  241. getDeployment(id).then(response => {
  242. this.form = response.data;
  243. this.open = true;
  244. this.title = "修改流程定义";
  245. });
  246. },
  247. /** 提交按钮 */
  248. submitForm() {
  249. this.$refs["form"].validate(valid => {
  250. if (valid) {
  251. if (this.form.id != null) {
  252. updateDeployment(this.form).then(response => {
  253. this.$modal.msgSuccess("修改成功");
  254. this.open = false;
  255. this.getList();
  256. });
  257. } else {
  258. addDeployment(this.form).then(response => {
  259. this.$modal.msgSuccess("新增成功");
  260. this.open = false;
  261. this.getList();
  262. });
  263. }
  264. }
  265. });
  266. },
  267. /** 删除按钮操作 */
  268. handleDelete(row) {
  269. const ids = row.id || this.ids;
  270. this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
  271. confirmButtonText: "确定",
  272. cancelButtonText: "取消",
  273. type: "warning"
  274. }).then(function () {
  275. return delDeployment(ids);
  276. }).then(() => {
  277. this.getList();
  278. this.$modal.msgSuccess("删除成功");
  279. })
  280. },
  281. /** 导出按钮操作 */
  282. handleExport() {
  283. const queryParams = this.queryParams;
  284. this.$confirm('是否确认导出所有流程定义数据项?', "警告", {
  285. confirmButtonText: "确定",
  286. cancelButtonText: "取消",
  287. type: "warning"
  288. }).then(function () {
  289. return exportDeployment(queryParams);
  290. }).then(response => {
  291. this.download(response.msg);
  292. })
  293. }
  294. }
  295. };
  296. </script>