cloud-web-corejs 1.0.258 → 1.0.259

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/package.json +32 -25
  2. package/src/components/VabUpload/fileLibraryDialog.vue +296 -0
  3. package/src/components/VabUpload/index.js +22 -2
  4. package/src/components/VabUpload/index.vue +242 -231
  5. package/src/components/VabUpload/mixins/fileLibraryDialog.js +1112 -0
  6. package/src/components/VabUpload/mixins.js +1971 -1829
  7. package/src/components/VabUpload/privateProfileDialog.vue +2 -2
  8. package/src/components/baseArea/index.vue +1628 -0
  9. package/src/components/baseInputExport/mixins.js +48 -31
  10. package/src/components/baseInputNumber/index.vue +9 -9
  11. package/src/components/baseTabs/index.vue +16 -8
  12. package/src/components/code-editor/async.js +29 -0
  13. package/src/components/code-editor/index.vue +93 -4
  14. package/src/components/errorMsg/index.js +10 -9
  15. package/src/components/errorMsg/mixins.js +25 -23
  16. package/src/components/excelExport/exportFieldDialog.vue +40 -18
  17. package/src/components/excelExport/index.js +62 -3
  18. package/src/components/excelExport/index.vue +2 -1
  19. package/src/components/excelExport/mixins.js +496 -340
  20. package/src/components/excelImport/index.js +69 -7
  21. package/src/components/excelImport/mixins.js +841 -9
  22. package/src/components/fileLibrary/categoryMoveDialog.vue +109 -109
  23. package/src/components/fileLibrary/fileHistoryDialog.vue +1 -1
  24. package/src/components/fileLibrary/fileObjAuthDialog.vue +297 -298
  25. package/src/components/fileLibrary/fileObjAuthEdit.vue +1 -1
  26. package/src/components/fileLibrary/filterDialog.vue +1 -1
  27. package/src/components/fileLibrary/index.vue +1109 -1110
  28. package/src/components/fileLibrary/mixins/indexMixins.js +10 -0
  29. package/src/components/fileLibrary/propertiesDialog.vue +190 -190
  30. package/src/components/fileLibrary/recycleBinDialog.vue +237 -236
  31. package/src/components/formOplog/mixins.js +85 -80
  32. package/src/components/hiprint/view/design/index.vue +7 -2
  33. package/src/components/jsonImport/exportUtil.js +106 -0
  34. package/src/components/jsonImport/index.js +75 -50
  35. package/src/components/jsonImport/mixins.js +350 -348
  36. package/src/components/langImport/mixins.js +502 -500
  37. package/src/components/micro-view-host/contract.js +66 -0
  38. package/src/components/micro-view-host/index.vue +148 -0
  39. package/src/components/mobile/file/index.vue +10 -0
  40. package/src/components/mobile/wf/mixins/wfModifyDialogMixin.js +51 -47
  41. package/src/components/obsUpload/index.vue +234 -231
  42. package/src/components/obsUpload/mixins.js +1542 -1476
  43. package/src/components/onlineTalk/talkUserDialog.vue +1 -1
  44. package/src/components/table/CellSlot.vue +12 -10
  45. package/src/components/table/config.js +74 -1
  46. package/src/components/table/index.js +1208 -1
  47. package/src/components/table/tableFormMixin.js +285 -1
  48. package/src/components/table/util/index.js +38 -40
  49. package/src/components/table/vxeFilter/index.js +153 -2
  50. package/src/components/table/vxeFilter/mixin.js +305 -3
  51. package/src/components/tempStorage/tempStorageDialog.vue +1 -1
  52. package/src/components/vb-tabs/x-tabs.vue +10 -5
  53. package/src/components/wf/addTaskUserdialog.vue +1 -1
  54. package/src/components/wf/mixins/setCandidateDialog.js +217 -217
  55. package/src/components/wf/mixins/setCandidateDialog2.js +252 -252
  56. package/src/components/wf/wf.js +2224 -2203
  57. package/src/components/wf/wfUtil.js +2 -1
  58. package/src/components/xform/docs/2026-08 /345/210/227/350/241/250/345/257/274/345/207/272/350/204/261/346/225/217/345/210/227/345/211/224/351/231/244/350/220/275/345/234/260/346/226/207/346/241/243.md" +173 -0
  59. package/src/components/xform/form-designer/designer.js +1 -0
  60. package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +110 -1
  61. package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +282 -1
  62. package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +272 -0
  63. package/src/components/xform/form-designer/form-widget/field-widget/autocomplete-widget.vue +119 -0
  64. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +14 -0
  65. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +18 -73
  66. package/src/components/xform/form-designer/form-widget/field-widget/mixins/autocomplete-mixin.js +451 -0
  67. package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +157 -0
  68. package/src/components/xform/form-designer/form-widget/field-widget/mixins/utc-transform-mixin.js +75 -0
  69. package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +112 -0
  70. package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +149 -0
  71. package/src/components/xform/form-designer/form-widget/indexMixin.js +179 -1
  72. package/src/components/xform/form-designer/indexMixin.js +823 -1
  73. package/src/components/xform/form-designer/refMixinDesign.js +27 -1
  74. package/src/components/xform/form-designer/setting-panel/action-button-config-dialog.vue +241 -0
  75. package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +601 -0
  76. package/src/components/xform/form-designer/setting-panel/form-setting.vue +6 -0
  77. package/src/components/xform/form-designer/setting-panel/index.vue +314 -309
  78. package/src/components/xform/form-designer/setting-panel/indexMixin.js +324 -1
  79. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +8 -7
  80. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +8 -7
  81. package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +344 -0
  82. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +2 -2
  83. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +25 -0
  84. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -0
  85. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +20 -0
  86. package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +199 -0
  87. package/src/components/xform/form-designer/setting-panel/property-editor/field-baseAttachment/baseAttachment-fileTypes-editor.vue +23 -0
  88. package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/showAllLevels-editor.vue +21 -0
  89. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +157 -0
  90. package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +55 -0
  91. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/vabUpload-fileTypes-editor.vue +23 -0
  92. package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesEditorMixin.js +116 -0
  93. package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -0
  94. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +3 -3
  95. package/src/components/xform/form-designer/setting-panel/property-editor/utcTransformEnabled-editor.vue +19 -0
  96. package/src/components/xform/form-designer/setting-panel/widgetPropertyDialogMixin.js +186 -0
  97. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +566 -1
  98. package/src/components/xform/form-designer/widget-panel/indexMixin.js +290 -1
  99. package/src/components/xform/form-render/compareDelList.vue +83 -0
  100. package/src/components/xform/form-render/compareView.vue +76 -0
  101. package/src/components/xform/form-render/container-item/containerItemMixin.js +378 -1
  102. package/src/components/xform/form-render/container-item/data-table-mixin.js +35 -0
  103. package/src/components/xform/form-render/container-item/detail-item.vue +41 -0
  104. package/src/components/xform/form-render/container-item/dynamicFieldEngine.js +285 -0
  105. package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +416 -0
  106. package/src/components/xform/form-render/container-item/list-h5-item.vue +12 -0
  107. package/src/components/xform/form-render/dynamicDialogRender.js +195 -1
  108. package/src/components/xform/form-render/dynamicDrawerRender.js +229 -0
  109. package/src/components/xform/form-render/formDynamicFieldMixin.js +131 -0
  110. package/src/components/xform/form-render/refMixin.js +29 -1
  111. package/src/components/xform/mixins/scriptHttp.js +172 -1
  112. package/src/components/xform/utils/dynamicSchemaUtil.js +361 -0
  113. package/src/components/xform/utils/tableCellValidateUtil.js +148 -0
  114. package/src/components/xform/utils/textMaskUtil.js +179 -0
  115. package/src/components/xform/utils/treeTableUtil.js +1265 -0
  116. package/src/components/xform/utils/util.js +1 -0
  117. package/src/components/xform/utils/validators.js +133 -1
  118. package/src/directive/LimitNumber/index.js +143 -124
  119. package/src/microRouter/index.js +447 -0
  120. package/src/mixins/tableTree/index.js +77 -14
  121. package/src/permission.js +132 -107
  122. package/src/public-path.js +38 -0
  123. package/src/router/index.js +3 -3
  124. package/src/store/modules/micro.js +57 -0
  125. package/src/store/modules/permission.js +535 -371
  126. package/src/store/modules/tagsView.js +38 -21
  127. package/src/store/modules/user.js +409 -370
  128. package/src/utils/aes.js +9 -3
  129. package/src/utils/auth.js +1 -1
  130. package/src/utils/componentDialog.js +162 -40
  131. package/src/utils/global.js +35 -34
  132. package/src/utils/index.js +579 -579
  133. package/src/utils/keepAlive.js +8 -4
  134. package/src/utils/lazyPlugin.js +66 -0
  135. package/src/utils/menuAdapter.js +277 -0
  136. package/src/utils/repeatOpen.js +48 -0
  137. package/src/utils/request.js +417 -395
  138. package/src/utils/resolveViewComponent.js +203 -0
  139. package/src/utils/vab.js +14 -3
  140. package/src/utils/validate.js +104 -106
  141. package/src/views/bd/setting/bd_attach_setting/dialog.vue +1 -1
  142. package/src/views/bd/setting/bd_attach_setting/list.vue +1 -1
  143. package/src/views/bd/setting/bd_company_env/dialog.vue +1 -1
  144. package/src/views/bd/setting/bd_company_env/list.vue +1 -1
  145. package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +488 -489
  146. package/src/views/bd/setting/form_import_log/list.vue +1 -1
  147. package/src/views/bd/setting/form_script/dialog.vue +1 -1
  148. package/src/views/bd/setting/form_script/form_list.vue +174 -166
  149. package/src/views/bd/setting/form_script/list.vue +1 -1
  150. package/src/views/bd/setting/form_script/list1.vue +1 -1
  151. package/src/views/bd/setting/form_script/mixins/form_list.js +330 -322
  152. package/src/views/bd/setting/form_template/dialog.vue +1 -1
  153. package/src/views/bd/setting/form_template/formDesignerDialog.vue +172 -171
  154. package/src/views/bd/setting/form_template/ftHistoryDialog.vue +1 -1
  155. package/src/views/bd/setting/form_template/itemList.vue +1 -1
  156. package/src/views/bd/setting/form_template/list.vue +3 -3
  157. package/src/views/bd/setting/form_template/mixins/edit.js +3 -3
  158. package/src/views/bd/setting/form_template/mixins/list.js +3 -3
  159. package/src/views/bd/setting/form_template/mixins/list2.js +3 -3
  160. package/src/views/bd/setting/form_template/mixins/wf_list.js +3 -3
  161. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +253 -254
  162. package/src/views/bd/setting/form_template/wf_list.vue +3 -3
  163. package/src/views/bd/setting/logic_param/edit.vue +20 -20
  164. package/src/views/bd/setting/logic_param/list.vue +1 -1
  165. package/src/views/bd/setting/menu_kind/dialog.vue +1 -1
  166. package/src/views/bd/setting/menu_kind/list.vue +1 -1
  167. package/src/views/bd/setting/push_data/list.vue +1 -1
  168. package/src/views/bd/setting/push_data_h/list.vue +1 -1
  169. package/src/views/bd/setting/request_async_setting/list.vue +1 -1
  170. package/src/views/bd/setting/request_setting/list.vue +1 -1
  171. package/src/views/bd/setting/table_model/dialog.vue +1 -1
  172. package/src/views/bd/setting/table_model/list.vue +1 -1
  173. package/src/views/bd/setting/table_model/zdDialog.vue +1 -1
  174. package/src/views/user/access_log/list.vue +1 -1
  175. package/src/views/user/access_log/list2.vue +1 -1
  176. package/src/views/user/api_request/list.vue +1 -1
  177. package/src/views/user/area/dialog.vue +1 -1
  178. package/src/views/user/area/list.vue +1 -1
  179. package/src/views/user/bill_setting/list.vue +1 -1
  180. package/src/views/user/bill_setting/userDialog.vue +1 -1
  181. package/src/views/user/code_rules/list.vue +1 -1
  182. package/src/views/user/commMenu/index.vue +2 -2
  183. package/src/views/user/common_attribute/list.vue +2 -2
  184. package/src/views/user/common_script/list.vue +1 -1
  185. package/src/views/user/company_info/dialog.vue +1 -1
  186. package/src/views/user/country/dialog.vue +1 -1
  187. package/src/views/user/country/list.vue +1 -1
  188. package/src/views/user/data_type_setting/dialog.vue +1 -1
  189. package/src/views/user/extend_datasource/dialog.vue +4 -1
  190. package/src/views/user/extend_datasource/edit.vue +2 -1
  191. package/src/views/user/extend_datasource/list.vue +4 -1
  192. package/src/views/user/fieldTranslation/list.vue +1 -1
  193. package/src/views/user/field_values_invisible/list.vue +1 -1
  194. package/src/views/user/file_type/list.vue +1 -1
  195. package/src/views/user/file_view_area/list.vue +1 -1
  196. package/src/views/user/file_view_ins/list.vue +22 -1
  197. package/src/views/user/form/view/list.vue +64 -1
  198. package/src/views/user/groups/dialog.vue +1 -1
  199. package/src/views/user/groups/list.vue +1 -1
  200. package/src/views/user/home/default.vue +2 -2
  201. package/src/views/user/home/default2.vue +1158 -1148
  202. package/src/views/user/home/index.vue +3 -10
  203. package/src/views/user/lang_tag/dialog.vue +1 -1
  204. package/src/views/user/lang_tag/list.vue +1 -1
  205. package/src/views/user/language_setting/list.vue +1 -1
  206. package/src/views/user/login/default.vue +0 -8
  207. package/src/views/user/login/indexMixin.js +547 -556
  208. package/src/views/user/menu/list.vue +25 -2
  209. package/src/views/user/menuFallback/index.vue +123 -0
  210. package/src/views/user/mobile_menu/list.vue +1 -1
  211. package/src/views/user/notify_message/dialog.vue +22 -1
  212. package/src/views/user/notify_message/list.vue +1 -1
  213. package/src/views/user/notify_template/list.vue +1 -1
  214. package/src/views/user/notify_template/list2.vue +1 -1
  215. package/src/views/user/oplog/list.vue +1 -1
  216. package/src/views/user/outLink/form_view.vue +5 -14
  217. package/src/views/user/outLink/index.vue +6 -1
  218. package/src/views/user/outLink/view.vue +5 -13
  219. package/src/views/user/position/dialog.vue +1 -1
  220. package/src/views/user/position/list.vue +1 -1
  221. package/src/views/user/project_tag/dialog.vue +1 -1
  222. package/src/views/user/project_tag/list.vue +1 -1
  223. package/src/views/user/push_setting/list.vue +1 -1
  224. package/src/views/user/request_setting/list.vue +1 -1
  225. package/src/views/user/role/dialog.vue +1 -1
  226. package/src/views/user/role/list.vue +1 -1
  227. package/src/views/user/sale_org/dialog.vue +1 -1
  228. package/src/views/user/sale_org/list.vue +1 -1
  229. package/src/views/user/system_notice/list.vue +1 -1
  230. package/src/views/user/system_parameter/list.vue +1 -1
  231. package/src/views/user/user/dialog.vue +1 -1
  232. package/src/views/user/user/edit.vue +306 -159
  233. package/src/views/user/user/form_dialog.vue +1 -1
  234. package/src/views/user/user/form_list.vue +1 -1
  235. package/src/views/user/user/list.vue +2 -2
  236. package/src/views/user/user_log_classify/list.vue +1 -1
  237. package/src/views/user/wf/iframe/index.vue +6 -1
  238. package/src/views/user/wf/iframe/index2.vue +6 -1
  239. package/src/views/user/wf/wfReport/index.vue +12 -6
  240. package/src/views/user/wf/wf_auto_submit_data/list.vue +2 -2
  241. package/src/views/user/wf/wf_manage/list.vue +97 -24
  242. package/src/views/user/wf/wf_manage/list2.vue +875 -0
  243. package/src/views/user/wf/wf_manage/wfContentDialog.vue +23 -1
  244. package/src/views/user/wf/wf_obj_config/dialog.vue +1 -1
  245. package/src/views/user/wf/wf_obj_config/list.vue +1 -1
  246. package/src/views/user/wf/wf_obj_config/list_form.vue +1 -1
  247. package/src/views/user/wf/wf_transfer_setting/list.vue +1 -1
  248. package/src/views/user/workbench_menu/list.vue +1 -1
@@ -1,2203 +1,2224 @@
1
- /**version-1.0*/
2
- import {getToken} from "../../utils/auth";
3
- import settingConfig from "@/settings.js";
4
- import {selectDialogMixins} from "../../mixins/selectDialog";
5
-
6
- let configUtil = {
7
- baseUrl: process.env.VUE_APP_BASE_API,
8
- getToken,
9
- requireView: (url) => {
10
- return require("@/views" + url).default;
11
- },
12
- };
13
-
14
- let wfIndexMixin,
15
- wfStartMixin,
16
- wfContentMixin,
17
- wfModifyMixin,
18
- wfUrgingMixin,
19
- deleteTaskUserMixin,
20
- addTaskUserMixin;
21
-
22
- function getTarget(t, flag) {
23
- let target;
24
- if (t.parentVue) {
25
- target = t.parentVue;
26
- } else if (flag === 0) {
27
- target = t.$parent.$parent;
28
- } else {
29
- target = t.$parent.$parent.$parent;
30
- }
31
- return target;
32
- }
33
-
34
- function oaPublishEvent(that) {
35
- let _closeWindowOnCheck = that.$attrs._closeWindowOnCheck || that._closeWindowOnCheck;
36
- if (_closeWindowOnCheck === true || _closeWindowOnCheck === "true") {
37
- let win = window.opener;
38
- if (win && domain && domain.call) {
39
- var event = {type: "topic", name: "successReloadPage"};
40
- domain.call(win, 'fireEvent', [event]);
41
- }
42
- }
43
- }
44
-
45
- wfIndexMixin = {
46
- name: "wfView",
47
- props: {
48
- objId: [String, Number],
49
- wfCode: String,
50
- serviceId: String,
51
- },
52
- data() {
53
- return {
54
- wfReloadFlag: false,
55
- hasWf: false,
56
- wfStartVisible: false,
57
- paramData: "",
58
- showModifyDialog: false,
59
- showBillEdit: false,
60
- content: "",
61
- wfInfo: "",
62
- currentTask: "",
63
- taskParam: "",
64
- };
65
- },
66
- computed: {
67
- current_prefix() {
68
- return this.serviceId ? "/" + this.serviceId : "";
69
- },
70
- },
71
- created() {
72
- },
73
- watch: {
74
- wfCode(val) {
75
- this.getWfInfo();
76
- },
77
- objId(val) {
78
- this.getWfInfo();
79
- },
80
- },
81
- async mounted() {
82
- if (this.objId) {
83
- let hasWf = false;
84
- let wfInfo, currentTask, taskParam;
85
- await this.initWfInfo().then((res) => {
86
- if (res && res.type == "success") {
87
- if (res.objx && res.objx.procInstId) {
88
- hasWf = true;
89
- wfInfo = res.objx;
90
- }
91
- }
92
- });
93
-
94
- if (hasWf) {
95
- /* await this.getCurrentTask(wfInfo).then(res1 => {
96
- if (res1.type == 'success') {
97
- currentTask = res1.objx;
98
- }
99
- }); */
100
- /* if (wfInfo.taskId) {
101
- await this.getTaskParams(currentTask).then(res2 => {
102
- if (res2.type == 'success') {
103
- taskParam = res2.objx;
104
- }
105
- });
106
- } */
107
- }
108
- this.paramData = taskParam;
109
- this.wfInfo = wfInfo;
110
- this.currentTask = currentTask;
111
- this.taskParam = taskParam;
112
-
113
- let flag = true;
114
- this.$emit("onShow", {
115
- wfInfo: wfInfo,
116
- currentTask: currentTask,
117
- taskParam: taskParam,
118
- hasWf: hasWf,
119
- callback: (val) => {
120
- flag = false;
121
- if (val !== false && hasWf) {
122
- this.wfReloadFlag = true;
123
- }
124
- },
125
- });
126
- if (flag) {
127
- if (hasWf) {
128
- this.wfReloadFlag = true;
129
- }
130
- }
131
- }
132
- this.$on("toDo", (option) => {
133
- this.$emit(option.methd, option.param);
134
- });
135
- },
136
- methods: {
137
- getWfInfo() {
138
- if (this.wfCode && this.objId) {
139
- this.reload();
140
- } else {
141
- this.wfReloadFlag = false;
142
- }
143
- },
144
- openStartWfDialog(code) {
145
- this.wfStartVisible = true;
146
- },
147
- reload() {
148
- this.wfReloadFlag = false;
149
- this.$nextTick(() => {
150
- this.wfReloadFlag = true;
151
- });
152
- },
153
- manualCallback() {
154
- this.$emit("manualCallback");
155
- },
156
- async getCurrentTask(obj) {
157
- let that = getTarget(this, 0);
158
- return that.$http({
159
- url: "/agilebpm/wf_task/getCurrentTask",
160
- data: {
161
- procInstId: obj.procInstId,
162
- },
163
- method: "post",
164
- async: false,
165
- isLoading: true,
166
- modalStrictly: true,
167
- });
168
- },
169
- async initWfInfo() {
170
- let that = getTarget(this, 0);
171
- let id = this.objId;
172
- let code = this.wfCode;
173
- return that.$http({
174
- url: this.current_prefix + "/wf/getWfInfo",
175
- method: `post`,
176
- data: {
177
- objTypeCode: code,
178
- objId: id,
179
- },
180
- isLoading: true,
181
- modalStrictly: true,
182
- });
183
- },
184
- async getTaskParams(data) {
185
- let that = getTarget(this, 0);
186
- return that.$http({
187
- url: "/agilebpm/wf_task/getTaskParams",
188
- method: `post`,
189
- data: {
190
- taskId: data.taskId,
191
- },
192
- isLoading: true,
193
- modalStrictly: true,
194
- });
195
- },
196
- openWfModifyDialog() {
197
- let row = this.paramData;
198
- let url = row.url + ".vue";
199
- this.showModifyDialog = true;
200
- this.content = configUtil.requireView(url);
201
- this.$openEditView("showBillEdit");
202
- },
203
- modfyDialogClose() {
204
- this.showBillEdit = false;
205
- this.content = null;
206
- },
207
- },
208
- };
209
-
210
- wfContentMixin = {
211
- name: "wfContent",
212
- props: {
213
- objId: [String, Number],
214
- wfCode: String,
215
- serviceId: String,
216
- _wfInfo: Object,
217
- _taskParam: Object,
218
- parentVue: Object,
219
- wfConfig: Object,
220
- defaultShowWfContent: Boolean,
221
- },
222
- computed: {
223
- current_prefix() {
224
- return this.serviceId ? "/" + this.serviceId : "";
225
- },
226
- viewTarget() {
227
- return getTarget(this);
228
- },
229
- isHideWf() {
230
- let that = this.viewTarget;
231
- let _hideWf = that._hideWf || that.$attrs._hideWf;
232
- return _hideWf === true || _hideWf === 'true';
233
- }
234
- },
235
- data() {
236
- let showWfFold =
237
- settingConfig.showWfFold != null && settingConfig.showWfFold != undefined
238
- ? settingConfig.showWfFold
239
- : false;
240
- if (this.wfConfig.showWfFold != null && this.wfConfig.showWfFold != undefined) {
241
- showWfFold = this.wfConfig.showWfFold;
242
- }
243
- let showWfContent =
244
- showWfFold &&
245
- settingConfig.defaultShowWfContent != null &&
246
- settingConfig.defaultShowWfContent != undefined
247
- ? settingConfig.defaultShowWfContent
248
- : true;
249
- if (
250
- this.defaultShowWfContent != null &&
251
- this.defaultShowWfContent != undefined
252
- ) {
253
- showWfContent = this.defaultShowWfContent;
254
- }
255
-
256
- return {
257
- fileInfos: [],
258
- showUserDialog: false,
259
- showContent: true,
260
- objTypeCode: "",
261
- // objId: '',
262
- wfInfo: {},
263
- // currentTask: {},
264
- taskParam: {},
265
- wfImage: "",
266
- wfStartBtn: false,
267
- wfManualendBtn: false,
268
- wfSubmitBtn: false,
269
- wfRejectBtn: false,
270
- changeHandlerBtn: false,
271
- wftaskData: [],
272
- allWfTaskOpinions: [],
273
- vxeOption: {},
274
- rejectNodes: [],
275
- rejectDialogVisible: false,
276
- rejectForm: {
277
- rejectSubmitModel: null,
278
- nodeId: null,
279
- opinion: null,
280
- },
281
- formLabelWidth: "120px",
282
- agreeDialogVisible: false,
283
- agreeForm: {
284
- opinion: this.$t2('同意', 'components.wf.defaultAgreeOption'),
285
- nodeId: null,
286
- },
287
- changeWfDialogVisible: false,
288
- changeWfForm: {},
289
- changeUserRows: [],
290
- taskStatuses: {
291
- start: {
292
- class: "blue",
293
- value: this.$t2('开始', 'components.wf.startStatus'),
294
- },
295
- approve: {
296
- class: "orgn",
297
- value: this.$t2('待审批', 'components.wf.approveStatus'),
298
- },
299
- submit: {
300
- class: "green",
301
- value: this.$t2('同意', 'components.wf.submitStatus'),
302
- },
303
- reject: {
304
- class: "red",
305
- value: this.$t2('驳回', 'components.wf.rejectStatus'),
306
- },
307
- transfer: {
308
- class: "green",
309
- value: this.$t2('转办', 'components.wf.transferStatus'),
310
- },
311
- addIncreaseSign: {
312
- class: "green",
313
- value: this.$t2('加签', 'components.wf.addIncreaseSignStatus'),
314
- },
315
- revoke: {
316
- class: "red",
317
- value: this.$t2('撤回', 'components.wf.revokeStatus'),
318
- },
319
- end: {
320
- class: "gray",
321
- value: this.$t2('结束', 'components.wf.endStatus'),
322
- },
323
- },
324
- opinion: "",
325
- showWfFold: showWfFold,
326
- showWfContent: showWfContent,
327
-
328
- urgingForm: {},
329
- urgingDialogVisible: false,
330
- urgingUserIds: [],
331
- urgingUsers: [],
332
- agreeNodes: [],
333
- showWfManualDialog: false,
334
-
335
- showDeleteTaskUserDialog: false,
336
- showAddTaskUserDialog: false,
337
- wfUserParam: {},
338
- wfUserParamForTransfer: {},//转办
339
- wfUserParamForAddSign: {},//加签
340
- wfUserParamForTalk: {},//沟通
341
- tabIndex: "1",
342
- linkupOption: {},
343
- talkForm: {
344
- receiverName: null,
345
- content: null,
346
- attachmentDTOs: [],
347
- replyId: null
348
- },
349
- showTalkUserDialog: false,
350
- showTalkDialog: false,
351
- showFlowImg: true,
352
- operateType: null,
353
- addIncreaseSignUsers: [],
354
- addIncreaseSignForm: {
355
- userNickNames: null,
356
- opinion: null
357
- },
358
- showAddIncreaseSignDialog: false,
359
- showOpeaImg: true,
360
- showSetCandidateDialog: false,
361
- toTalk: false,
362
- showAllWfOpinon: false,
363
-
364
- revokeDialogVisible: false,
365
- revokeForm: {opinion: null},
366
- showWfInfoTab: false,
367
-
368
- showWfMemo:false,
369
- wfMemoOption: {},
370
- wfMemoForm: {
371
- receiverName: null,
372
- content: null,
373
- attachmentDTOs: [],
374
- replyId: null
375
- },
376
- showWfMemoDialog: false,
377
- wfMemoData:[],
378
-
379
- showCandidate: false,
380
- candidateOption:{},
381
- candidateDatas:[],
382
- wfSendTaskId: null,
383
- showAddOpinionButton: false,
384
-
385
- addOpinionEnabled: false,
386
- modifyCurrentCandidateEnabled: false,
387
-
388
- //修改脚本
389
- showWfFlowEleScriptDialog: false
390
- };
391
- },
392
- provide() {
393
- return {
394
- getParentVue: () => this.parentVue,
395
- getWfInfo: () => this.wfInfo,
396
- getCurrentPrefix: () => this.current_prefix,
397
- getEditVueTarget: ()=> getTarget(this)
398
- };
399
- },
400
- created() {
401
- this.wfInfo = this._wfInfo;
402
- this.showFlowImg = settingConfig.expandWfImage === false ? false : true;
403
- this.showAllWfOpinon = settingConfig.showAllWfOpinon === true;
404
- },
405
- mounted() {
406
- this.initOperateType();
407
- this.initForAll();
408
- },
409
- methods: {
410
- openWfFlowEleScriptDialog(){
411
- this.showWfFlowEleScriptDialog = true
412
- },
413
- initWfParam13(){
414
- //初始化补充意见权限
415
- let that = getTarget(this);
416
- return that.$http({
417
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
418
- method: `post`,
419
- data: {attributeKey: "param13"},
420
- success: (res) => {
421
- this.addOpinionEnabled = res?.objx === true;
422
- if(this.addOpinionEnabled){
423
- this.wfSendTaskId = this.getViewParam('wfSendTaskId');
424
- this.showAddOpinionButton = !!this.wfSendTaskId;
425
- }
426
- },
427
- });
428
- },
429
-
430
- initWfParam14(){
431
- //初始化修改当前候选人权限
432
- let that = getTarget(this);
433
- return that.$http({
434
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
435
- method: `post`,
436
- data: {attributeKey: "param14"},
437
- success: (res) => {
438
- this.modifyCurrentCandidateEnabled = res?.objx === true;
439
- },
440
- });
441
- },
442
- getViewParam(key){
443
- let that = this.viewTarget;
444
- let value = that[key] || that.$attrs[key];
445
- return value;
446
- },
447
- initCandidate(){
448
- // 是否显示"节点候选人"选项卡
449
- let that = getTarget(this);
450
- that.$http({
451
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
452
- method: `post`,
453
- data: {attributeKey: "param11"},
454
- isLoading: true,
455
- success: (res) => {
456
- this.showCandidate = res?.objx === true;
457
- if(this.showCandidate){
458
- this.$nextTick(()=>{
459
- this.initCandidateTable();
460
- })
461
- }
462
- },
463
- });
464
- },
465
- initCandidateTable(){
466
- let that = this;
467
- let tableOption = {
468
- vue: that,
469
- tableRef: 'table-candidate',
470
- tableName: 'wf_candidate-list',
471
- path: this.current_prefix + '/wf/getAllNodes',
472
- param: () => {
473
- return {
474
- stringOne: this.wfInfo.uuid
475
- }
476
- },
477
- config: {
478
- height: 350,
479
- proxyConfig: {
480
- props: {
481
- result: "objx", // 配置响应结果列表字段
482
- total: "objx.length", // 配置响应结果总页数字段
483
- },
484
- },
485
- pagerConfig:{
486
- autoHidden: true
487
- }
488
- },
489
- columns: [
490
- {type: 'checkbox', width: 50, resizable: false, fixed: 'left'},
491
- {title: this.$t2('节点名称', 'components.wf.nodeName'), field: 'nodeName', width: 250, fixed: 'left'},
492
- {
493
- field: 'wfTaskCandidates',
494
- title: this.$t2('候选人', 'components.wf.candidate'),
495
- width: 450,
496
- slots: {
497
- default: ({row, rowIndex}) => {
498
- return row.wfTaskCandidateDTOs ? row.wfTaskCandidateDTOs.map(item => item.name).join(",") : null;
499
- },
500
- },
501
- },
502
- {
503
- width: 47,
504
- fixed: 'right',
505
- title: '',
506
- sortable: false,
507
- }
508
- ]
509
- };
510
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
511
- that.candidateOption = opts;
512
- });
513
- },
514
- initOperateType() {
515
- if (this.operateType) {
516
- let wfInfo = this.wfInfo;
517
- if (wfInfo.toSubmit) {
518
- this.openAgreeDialog('submit');
519
- } else if (wfInfo.toReject) {
520
- this.rejectWfTask('reject');
521
- } else if (wfInfo.toAddIncreaseSign) {
522
- this.openAddIncreaseSign('addIncreaseSign')
523
- } else if (wfInfo.toRevoke) {
524
- this.openRevokeDialog('revoke')
525
- } else if (wfInfo.toLinkup) {
526
- this.openTalkDialog(null, null, 'talk');
527
- } else {
528
- this.operateType = null;
529
- }
530
- }
531
- },
532
- initForAll() {
533
- let that = getTarget(this);
534
- this.initWf(() => {
535
- if (this.wfInfo.procInstId) {
536
- this.initCurrentTask(this.wfInfo.procInstId, () => {
537
- this.initWftask(this.wfInfo.procInstId);
538
- this.getAllWfTaskOpinions();
539
- });
540
- this.initWfUserParam();
541
- this.initTabIndex();
542
- this.initShowTaskInfo();
543
- //初始化附言
544
- this.getIsShowWfMemo();
545
- // 是否显示"节点候选人"选项卡
546
- this.initCandidate()
547
-
548
- //初始化补充意见权限
549
- this.initWfParam13();
550
-
551
- //初始化修改当前候选人权限
552
- this.initWfParam14();
553
-
554
- }
555
- });
556
- },
557
- initTabIndex() {
558
- let that = getTarget(this);
559
- that.$http({
560
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
561
- method: `post`,
562
- data: {attributeKey: "param7"},
563
- isLoading: true,
564
- success: (res) => {
565
- let val = res !== null ? res.objx === true : false;
566
- this.toTalk = val;
567
- let flag = false;
568
- if (val) {
569
- let flag1 = that.$attrs._isNotifyMessage == true || that.$attrs._isNotifyMessage == "true";
570
- if (flag1) {
571
- this.tabIndex = "2";
572
- }
573
- if (settingConfig.autoOpenWfLinkup) {
574
- flag = true;
575
- let flag2 = that.$attrs._wfNotifyType == "wfLinkup";
576
- let flag3 = flag1 && flag2;
577
- if (flag3) {
578
- this.$nextTick(() => {
579
- let wfTabPane = this.$refs.wfTabPane;
580
- if (!wfTabPane.showContent) {
581
- wfTabPane.handleFold();
582
- }
583
- });
584
- }
585
- }
586
- }
587
- this.initLinkup(flag);
588
- }
589
- });
590
-
591
- },
592
- initWf(done) {
593
- var data = this.wfInfo;
594
- if (data && data.procInstId) {
595
- /** 流程状态:0未启动,1审核中,2已完成,3驳回,4中断 */
596
- var statuses = {
597
- 1: '<span class="tag">' + this.$t2('审核中', 'components.wf.wfStatus1') + '</span>',
598
- 3: '<span class="tag red">' + this.$t2('已驳回', 'components.wf.wfStatus2') + '</span>',
599
- 2: '<span class="tag green">' + this.$t2('已完成', 'components.wf.wfStatus3') + '</span>',
600
- };
601
- var statusStr = "";
602
- if (data.stat != null) {
603
- statusStr = statuses[data.stat] || "";
604
- }
605
- data.statusStr = statusStr;
606
- this.wfInfo = data;
607
-
608
- this.wfStartBtn = false;
609
- if (data.status != 2 && data.starterId) {
610
- this.wfManualendBtn = true;
611
- }
612
- this.wfSubmitBtn = false;
613
- this.wfRejectBtn = false;
614
-
615
- var url =
616
- this.current_prefix +
617
- "/wf/flowImage?procInstId=" +
618
- data.procInstId +
619
- "&_r=" +
620
- Math.random() +
621
- "&access_token=" +
622
- configUtil.getToken();
623
- this.wfImage = configUtil.baseUrl + url;
624
- done();
625
- }
626
- },
627
- initCurrentTask(procInstId, done) {
628
- if (this.wfInfo.taskId) {
629
- this.wfSubmitBtn = true;
630
- this.wfRejectBtn = true;
631
- this.changeHandlerBtn = true;
632
- }
633
- done();
634
- },
635
- initWftask(procInstId) {
636
- let that = getTarget(this);
637
- that.$http({
638
- url: this.current_prefix + "/wf/getWfTaskOpinionMerge",
639
- data: {
640
- stringOne: procInstId,
641
- },
642
- method: "post",
643
- async: false,
644
- isLoading: true,
645
- modalStrictly: true,
646
- success: (resultmsg) => {
647
- var datas = resultmsg.objx || [];
648
- this.wftaskData = datas;
649
- },
650
- });
651
- },
652
- getAllWfTaskOpinions() {
653
- if (!this.showAllWfOpinon) {
654
- return;
655
- }
656
- let that = getTarget(this);
657
- let wfInfo = this.wfInfo;
658
- that.$http({
659
- url: this.current_prefix + "/wf/getAllWfTaskOpinions",
660
- data: {
661
- objId: wfInfo.objId,
662
- objTypeCode: wfInfo.objTypeCode
663
- },
664
- method: "post",
665
- async: false,
666
- isLoading: true,
667
- modalStrictly: true,
668
- success: (resultmsg) => {
669
- var datas = resultmsg.objx || [];
670
- this.allWfTaskOpinions = datas;
671
- },
672
- });
673
- },
674
- openManualDialog(operateType) {
675
- this.operateType = operateType;
676
- this.showWfManualDialog = true;
677
- },
678
- manualEndWf() {
679
- this.showWfManualDialog = false;
680
- let that = getTarget(this);
681
- var procInstId = this.wfInfo.procInstId;
682
- var taskId = this.wfInfo.taskId ? this.wfInfo.taskId : "";
683
- var data = JSON.stringify({
684
- uuid: this.wfInfo.uuid,
685
- });
686
- that.$http({
687
- url: this.current_prefix + "/wf/interrupt",
688
- data: data,
689
- method: "post",
690
- headers: {
691
- "Content-Type": "application/json;charset=utf-8",
692
- },
693
- isLoading: true,
694
- success: (resultMsg) => {
695
- that.$message({
696
- message: resultMsg.content,
697
- type: "success",
698
- duration: 500,
699
- onClose: (t) => {
700
- this.reloadContent();
701
- this.closeWinOnCheck(3);
702
- },
703
- });
704
- },
705
- });
706
- },
707
- async rejectWfTask(operateType) {
708
- this.handleReminderContent("rejectReminder", async ()=>{
709
- let that = getTarget(this);
710
- var procInstId = this.wfInfo.procInstId;
711
- var taskId = this.wfInfo.taskId;
712
- var destinations = [];
713
-
714
- await that.$http({
715
- url: this.current_prefix + "/wf/getPreIncomeNodes",
716
- data: {
717
- stringOne: taskId,
718
- },
719
- method: "post",
720
- //contentType: 'application/json;charset=utf-8',
721
- async: false,
722
- isLoading: true,
723
- success: (resultMsg) => {
724
- destinations = (resultMsg.objx || []).reverse();
725
- },
726
- });
727
-
728
- if (destinations == null) {
729
- return false;
730
- }
731
- if (destinations.length == 0) {
732
- that.$message({
733
- message: this.$t2('无法驳回,没有目标节点', 'components.wf.rejectWarnMsg1'),
734
- type: "error",
735
- duration: 2 * 1000,
736
- });
737
- return false;
738
- }
739
- this.operateType = operateType;
740
- let rejectSubmitModel = null;
741
- if (this.wfInfo.toNextNode === 1) {
742
- rejectSubmitModel = this.wfInfo.toNextNode
743
- } else {
744
- rejectSubmitModel = this.wfInfo.toRejectNode == false ? 2 : null
745
- }
746
- this.rejectForm.rejectSubmitModel = rejectSubmitModel;
747
- this.rejectForm.nodeId = destinations[0].nodeId;
748
- this.rejectForm.opinion = "";
749
- this.rejectNodes = destinations;
750
- this.rejectDialogVisible = true;
751
- })
752
-
753
- },
754
- subRejectForm() {
755
- let that = getTarget(this);
756
- var procInstId = this.wfInfo.procInstId;
757
- var taskId = this.wfInfo.taskId;
758
-
759
- if (!this.rejectForm.nodeId) {
760
- that.$message({
761
- message: this.$t2('请选择驳回节点', 'components.wf.rejectWarnMsg2'),
762
- type: "error",
763
- duration: 2 * 1000,
764
- });
765
- return false;
766
- }
767
-
768
- if (!this.rejectForm.opinion) {
769
- that.$message({
770
- message: this.$t2('请输入驳回意见', 'components.wf.rejectWarnMsg3'),
771
- type: "error",
772
- duration: 2 * 1000,
773
- });
774
- return false;
775
- }
776
-
777
- var data = JSON.stringify({
778
- taskId: taskId,
779
- uuid: this.wfInfo.uuid,
780
- nodeId: this.rejectForm.nodeId,
781
- suggestion: this.rejectForm.opinion,
782
- rejectSubmitModel: this.rejectForm.rejectSubmitModel
783
- });
784
- this.rejectDialogVisible = false;
785
- that.$http({
786
- url: this.current_prefix + "/wf/reject",
787
- data: data,
788
- method: "post",
789
- headers: {
790
- "Content-Type": "application/json;charset=utf-8",
791
- },
792
- isLoading: true,
793
- success: (resultMsg) => {
794
- that.$message({
795
- message: resultMsg.content,
796
- type: "success",
797
- duration: 500,
798
- onClose: (t) => {
799
- this.reloadContent();
800
- this.closeWinOnCheck(2);
801
- },
802
- });
803
- },
804
- });
805
- },
806
- handleReminderContent(scriptType, callback){
807
- let that = getTarget(this);
808
- that.$http({
809
- url: this.current_prefix + "/wf/getReminderContent",
810
- data: {
811
- scriptType,
812
- taskId: this.wfInfo.taskId,
813
- uuid: this.wfInfo.uuid,
814
- },
815
- method: "post",
816
- isLoading: true,
817
- errorMsg: false,
818
- success: (res) => {
819
- if(res.objx){
820
- that.$baseConfirm(res.objx).then(() => {
821
- callback && callback();
822
- });
823
- }else{
824
- callback && callback();
825
- }
826
- },
827
- error: (e) => {
828
- if(e.response.status === 404){
829
- callback && callback();
830
- }else{
831
- that.$errorMsg({
832
- content: e.message,
833
- type: 'error',
834
- });
835
- }
836
- },
837
- });
838
- },
839
- openAgreeDialog(operateType) {
840
- const done = () => {
841
- this.handleReminderContent("submitReminder", ()=>{
842
- this.operateType = operateType;
843
- let that = getTarget(this);
844
- this.agreeForm = {
845
- opinion: this.$t2('同意', 'components.wf.defaultAgreeOption'),
846
- nodeId: null,
847
- };
848
- this.agreeNodes = [];
849
- that.$http({
850
- url: this.current_prefix + "/wf/getNextOutgoingNodes",
851
- data: {
852
- stringOne: this.wfInfo.taskId,
853
- },
854
- method: "post",
855
- async: false,
856
- isLoading: true,
857
- success: (res) => {
858
- let nodes = res.objx || [];
859
- /*if (tq == true) {
860
- nodes.reverse();
861
- }*/
862
- if (nodes.length) {
863
- this.agreeForm.nodeId = nodes[0].nodeId;
864
- }
865
- this.agreeNodes = nodes;
866
- this.agreeDialogVisible = true;
867
- },
868
- });
869
- })
870
- }
871
- let wfConfig = this.wfConfig;
872
- if (wfConfig.onClickAgree) {
873
- wfConfig.onClickAgree(done)
874
- } else {
875
- done();
876
- }
877
- },
878
- subAgreeForm() {
879
- let wfConfig = this.wfConfig;
880
- let done = () => {
881
- this.subAgreeHandle();
882
- }
883
- if (wfConfig.onBeforeAgree) {
884
- wfConfig.onBeforeAgree(done)
885
- } else {
886
- done();
887
- }
888
- },
889
-
890
- subAgreeHandle() {
891
- let that = getTarget(this);
892
- let nodeId = null;
893
- if (this.agreeNodes.length) {
894
- if (!this.agreeForm.nodeId) {
895
- that.$message({
896
- message: this.$t2('请选择节点', 'components.wf.agreeWarnMsg1'),
897
- type: "error",
898
- duration: 2 * 1000,
899
- });
900
- return;
901
- }
902
- nodeId = this.agreeForm.nodeId;
903
- }
904
-
905
- var procInstId = this.wfInfo.procInstId;
906
- var taskId = this.wfInfo.taskId;
907
- var memo = this.agreeForm.opinion || this.$t2('同意', 'components.wf.defaultAgreeOption');
908
- var data = JSON.stringify({
909
- taskId: taskId,
910
- uuid: this.wfInfo.uuid,
911
- suggestion: memo,
912
- nodeId: nodeId,
913
- });
914
- this.agreeDialogVisible = false;
915
- that.$http({
916
- url: this.current_prefix + "/wf/submit",
917
- data: data,
918
- method: "post",
919
- headers: {
920
- "Content-Type": "application/json;charset=utf-8",
921
- },
922
- isLoading: true,
923
- success: (resultMsg) => {
924
- if (resultMsg.objx && resultMsg.objx.code == "999999") {
925
- this.errorSubmit({
926
- taskId: taskId,
927
- uuid: this.wfInfo.uuid,
928
- suggestion: memo,
929
- errorMsg: resultMsg.objx.errorMsg
930
- });
931
- } else {
932
- that.$message({
933
- message: resultMsg.content,
934
- type: "success",
935
- duration: 500,
936
- onClose: (t) => {
937
- this.reloadContent();
938
- this.closeWinOnCheck(1);
939
- },
940
- });
941
- }
942
- },
943
- });
944
- },
945
- errorSubmit(data) {
946
- let that = getTarget(this);
947
- that.$http({
948
- url: this.current_prefix + "/wf/errorSubmit",
949
- data: data,
950
- method: "post",
951
- isLoading: true,
952
- success: (resultMsg) => {
953
- that.$message({
954
- message: resultMsg.content,
955
- type: "success",
956
- duration: 500,
957
- onClose: (t) => {
958
- this.reloadContent();
959
- this.closeWinOnCheck(1);
960
- },
961
- });
962
- },
963
- });
964
- },
965
- openChangeWfForm(operateType) {
966
- this.operateType = operateType;
967
- this.changeWfDialogVisible = true;
968
- this.changeUserRows = [];
969
- this.changeWfForm = {
970
- userIds: [],
971
- userNickNames: null,
972
- opinion: null,
973
- };
974
- },
975
- subChangeWfForm() {
976
- let that = getTarget(this);
977
- var procInstId = this.wfInfo.procInstId;
978
- var taskId = this.wfInfo.taskId;
979
-
980
- var userIds = this.changeWfForm.userIds || [];
981
- var opinion = this.changeWfForm.opinion || null;
982
-
983
- if (!userIds.length) {
984
- that.$message({
985
- message: this.$t2('请选择转办人', 'components.wf.transferWarnMsg1'),
986
- type: "error",
987
- duration: 2000,
988
- onClose: (t) => {
989
- },
990
- });
991
- return false;
992
- }
993
-
994
- var data = JSON.stringify({
995
- taskId: taskId,
996
- uuid: this.wfInfo.uuid,
997
- transferTo: userIds,
998
- suggestion: opinion,
999
- });
1000
- this.changeWfDialogVisible = false;
1001
- that.$http({
1002
- url: this.current_prefix + "/wf/transfer",
1003
- data: data,
1004
- method: "post",
1005
- headers: {
1006
- "Content-Type": "application/json;charset=utf-8",
1007
- },
1008
- isLoading: true,
1009
- success: (resultMsg) => {
1010
- that.$message({
1011
- message: resultMsg.content,
1012
- type: "success",
1013
- duration: 500,
1014
- onClose: (t) => {
1015
- this.reloadContent();
1016
- this.closeWinOnCheck(4);
1017
- },
1018
- });
1019
- },
1020
- });
1021
- },
1022
- userConfirm(rows) {
1023
- if (rows.length > 0) {
1024
- let changeUserRows = this.changeUserRows;
1025
- let ids = changeUserRows.map((changeUserRow) => changeUserRow.id);
1026
- let addRows = rows.filter((row) => !ids.includes(row.id));
1027
- changeUserRows.push(...addRows);
1028
-
1029
- let row = rows[0];
1030
- this.changeWfForm.userIds = changeUserRows.map(
1031
- (changeUserRow) => changeUserRow.id
1032
- );
1033
- this.changeWfForm.userNickNames = changeUserRows
1034
- .map((changeUserRow) => changeUserRow.nickName)
1035
- .join(",");
1036
- }
1037
- },
1038
- reloadContent() {
1039
- let that = getTarget(this);
1040
- oaPublishEvent(that);
1041
- that.$baseReload();
1042
- },
1043
- closeWinOnCheck(flag) {
1044
- //_closeWindowOnCheck=true, 1提交,2驳回,3中断,4转办时,5沟通 关闭窗口
1045
- let that = getTarget(this);
1046
- let _closeWindowOnCheck = that.$attrs._closeWindowOnCheck || that._closeWindowOnCheck;
1047
- if (_closeWindowOnCheck === true || _closeWindowOnCheck === "true") {
1048
- window.close && window.close();
1049
- }
1050
- let _handleCallback = that.$attrs._handleCallback || that._handleCallback;
1051
- _handleCallback && _handleCallback(flag);
1052
- },
1053
- manualCallback() {
1054
- this.$emit("manualCallback");
1055
- },
1056
- openUrgingDialog(operateType) {
1057
- this.operateType = operateType;
1058
- this.urgingDialogVisible = true;
1059
- },
1060
- openDeleteTaskUserDialog(operateType) {
1061
- this.operateType = operateType;
1062
- this.showDeleteTaskUserDialog = true;
1063
- },
1064
- openAddTaskUserDialog(operateType) {
1065
- this.operateType = operateType;
1066
- this.showAddTaskUserDialog = true;
1067
- },
1068
- openAddIncreaseSign(operateType) {
1069
- this.operateType = operateType;
1070
- this.addIncreaseSignUsers = [];
1071
- this.addIncreaseSignForm = {userNickNames: null};
1072
- this.showAddIncreaseSignDialog = true;
1073
- },
1074
- initWfUserParam(callback) {
1075
- this.initTransferUserParam();//转办
1076
- this.initAddSignUserParam();//加签
1077
- this.initTalkUserParam();//沟通
1078
- },
1079
- //
1080
- initTransferUserParam(callback) {
1081
- //初始化转办用户参数
1082
- let that = getTarget(this);
1083
- return that.$http({
1084
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1085
- method: `post`,
1086
- data: {attributeKey: "param1"},
1087
- isLoading: true,
1088
- modalStrictly: true,
1089
- success: (res) => {
1090
- this.wfUserParamForTransfer = res.objx || {};
1091
- callback && callback();
1092
- },
1093
- });
1094
- },
1095
- initAddSignUserParam(callback) {
1096
- //初始化加签用户参数
1097
- let that = getTarget(this);
1098
- return that.$http({
1099
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1100
- method: `post`,
1101
- data: {attributeKey: "param2"},
1102
- isLoading: true,
1103
- modalStrictly: true,
1104
- success: (res) => {
1105
- this.wfUserParamForAddSign = res.objx || {};
1106
- callback && callback();
1107
- },
1108
- });
1109
- },
1110
- initTalkUserParam(callback) {
1111
- //初始化沟通用户参数
1112
- let that = getTarget(this);
1113
- return that.$http({
1114
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1115
- method: `post`,
1116
- data: {attributeKey: "param3"},
1117
- isLoading: true,
1118
- modalStrictly: true,
1119
- success: (res) => {
1120
- this.wfUserParamForTalk = res.objx || {};
1121
- callback && callback();
1122
- },
1123
- });
1124
- },
1125
- //
1126
- resetLinkup() {
1127
- this.formData = {};
1128
- this.$refs["table-linkup"].commitProxy("reload");
1129
- },
1130
- searchLinkup() {
1131
- this.$refs["table-linkup"].commitProxy("reload");
1132
- },
1133
- initLinkup(flag) {
1134
- let h = this.$createElement;
1135
- let statusMap = {
1136
- 0: this.$t2('未完成', 'components.wf.talkStatus0'),
1137
- 1: this.$t2('已完成', 'components.wf.talkStatus1'),
1138
- 2: this.$t2('已取消', 'components.wf.talkStatus2')
1139
- };
1140
- let tableOption = {
1141
- vue: this,
1142
- tableRef: "table-linkup",
1143
- tableName: "wf_table-linkup",
1144
- path: this.current_prefix + "/wf_linkup/listPage",
1145
- param: () => {
1146
- return {
1147
- uuid: this.wfInfo.uuid,
1148
- };
1149
- },
1150
- config: {
1151
- height: 350
1152
- },
1153
- columns: [
1154
- {type: "checkbox", width: 48, resizable: false, fixed: "left"},
1155
- {
1156
- title: this.$t2('任务名称', 'components.wf.taskName'),
1157
- field: "taskName",
1158
- width: 150,
1159
- fixed: "left",
1160
- },
1161
- {
1162
- title: this.$t2('发送人', 'components.wf.senderName'),
1163
- field: "senderName",
1164
- width: 150,
1165
- slots: {
1166
- default: "sender",
1167
- },
1168
- },
1169
- {
1170
- title: this.$t2('接收人', 'components.wf.receiverName'),
1171
- field: "receiverName",
1172
- width: 150,
1173
- slots: {
1174
- default: "receiver",
1175
- },
1176
- },
1177
- {
1178
- title: this.$t2('沟通内容', 'components.wf.talkContent'),
1179
- field: "content",
1180
- width: 250,
1181
- showOverflow: false,
1182
- slots: {
1183
- default: ({row, rowIndex}) => {
1184
- return row.replyId ? ("[" + this.$t2('回复', 'components.wf.reply') + "]" + row.content) : row.content;
1185
- },
1186
- },
1187
- },
1188
- {
1189
- width: 150,
1190
- title: this.$t2('沟通资料', 'components.wf.talkAttachment'),
1191
- field: "attachmentImage",
1192
- sortable: false,
1193
- slots: {
1194
- default: ({row, rowIndex}) => {
1195
- let option = {
1196
- title: this.$t2('沟通资料', 'components.wf.talkAttachment'),
1197
- edit: false,
1198
- rows: (done) => {
1199
- done(row.attachmentDTOs);
1200
- },
1201
- };
1202
- return [
1203
- h("base-attachment", {
1204
- props: {
1205
- option: option,
1206
- imageLazy: false
1207
- },
1208
- }),
1209
- ];
1210
- },
1211
- },
1212
- },
1213
-
1214
- {
1215
- title: this.$t2('状态', 'components.wf.status'),
1216
- field: "status",
1217
- width: 150,
1218
- slots: {
1219
- default: ({row, rowIndex}) => {
1220
- return statusMap[row.status] || "";
1221
- },
1222
- },
1223
- },
1224
- {
1225
- title: this.$t2('创建时间', 'system.label.createDate'),
1226
- field: "createDate",
1227
- width: 150,
1228
- },
1229
- {
1230
- width: 80,
1231
- fixed: "right",
1232
- title: "",
1233
- sortable: false,
1234
- slots: {
1235
- default: "operate"
1236
- }
1237
- },
1238
- ],
1239
- callback: (rows) => {
1240
- if (rows.length && flag) {
1241
- let row = rows[0];
1242
- if (row.replyToSender) {
1243
- this.$nextTick(() => {
1244
- this.tabIndex = "2";
1245
- this.openTalkDialog(row.sender, row.senderName, 'talk', 1, row.id)
1246
- });
1247
- }
1248
- }
1249
- }
1250
- };
1251
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1252
- this.linkupOption = opts;
1253
- });
1254
- },
1255
- cancelTalk(row) {
1256
- let that = getTarget(this);
1257
- that.$baseConfirm(this.$t2('您确定要取消沟通记录吗?', 'components.wf.cancelTalkTip')).then(() => {
1258
- that.$http({
1259
- url: this.current_prefix + "/wf_linkup/cancel",
1260
- data: {id: row.id},
1261
- method: "post",
1262
- loadingTarget: document.body,
1263
- isLoading: true,
1264
- success: (resultMsg) => {
1265
- that.$message({
1266
- message: resultMsg.content,
1267
- type: "success",
1268
- duration: 500,
1269
- onClose: (t) => {
1270
- this.reloadContent();
1271
- },
1272
- });
1273
- },
1274
- });
1275
- });
1276
- },
1277
- openTalkDialog(receiver, receiverName, operateType, flag, replyId) {
1278
- this.operateType = operateType;
1279
- /*this.talkForm.receiver = receiver || null;
1280
- this.talkForm.receiverName = receiverName || null;
1281
- this.talkForm.replyId = replyId || null;
1282
- this.talkForm.content = null;
1283
- this.talkForm.attachmentDTOs = [];*/
1284
- this.initTalkForm(receiver, receiverName, replyId)
1285
- this.showTalkDialog = true;
1286
- if (flag == 1) {
1287
- let opeaBtnDom = this.$refs.opeaBtn;
1288
- opeaBtnDom && opeaBtnDom.scrollIntoView();
1289
- }
1290
- },
1291
- initTalkForm(receiver, receiverName, replyId) {
1292
- this.talkForm.receiver = receiver || null;
1293
- this.talkForm.receiverName = receiverName || null;
1294
- this.talkForm.replyId = replyId || null;
1295
- this.talkForm.content = null;
1296
- this.talkForm.attachmentDTOs = [];
1297
- },
1298
- submitTalkForm() {
1299
- let that = getTarget(this);
1300
- var procInstId = this.wfInfo.procInstId;
1301
- var taskId = this.wfInfo.taskId;
1302
-
1303
- if (!this.talkForm.receiver) {
1304
- that.$message({
1305
- message: this.$t2('请选择接收人', 'components.wf.talkWarnMsg1'),
1306
- type: "error",
1307
- duration: 2 * 1000,
1308
- });
1309
- return false;
1310
- }
1311
- if (!this.talkForm.content) {
1312
- that.$message({
1313
- message: this.$t2('请输入沟通内容', 'components.wf.talkWarnMsg2'),
1314
- type: "error",
1315
- duration: 2 * 1000,
1316
- });
1317
- return false;
1318
- }
1319
-
1320
- var data = {
1321
- taskId: taskId,
1322
- uuid: this.wfInfo.uuid,
1323
- receiver: this.talkForm.receiver,
1324
- receiverName: this.talkForm.receiverName,
1325
- replyId: this.talkForm.replyId,
1326
- content: this.talkForm.content,
1327
- attachmentDTOs: this.talkForm.attachmentDTOs,
1328
- notifyType: "wfLinkup",
1329
- };
1330
- this.showTalkDialog = false;
1331
- that.$http({
1332
- url: this.current_prefix + "/wf_linkup/save",
1333
- data: data,
1334
- method: "post",
1335
- isLoading: true,
1336
- success: (resultMsg) => {
1337
- that.$message({
1338
- message: resultMsg.content,
1339
- type: "success",
1340
- duration: 500,
1341
- onClose: (t) => {
1342
- this.reloadContent();
1343
- this.closeWinOnCheck(5);
1344
- },
1345
- });
1346
- },
1347
- });
1348
- },
1349
- openTalkUserDialog() {
1350
- this.showTalkUserDialog = true;
1351
- },
1352
- confirmTalkUserDialog(rows) {
1353
- if (rows.length > 0) {
1354
- let row = rows[0];
1355
- if (this.talkForm.receiver != row.id) {
1356
- this.talkForm.replyId = null;
1357
- }
1358
- this.talkForm.receiver = row.id;
1359
- this.talkForm.receiverName = row.nickName;
1360
- }
1361
- },
1362
- confirmUrging() {
1363
- this.reloadContent();
1364
- },
1365
- confirmDeleteTaskUser() {
1366
- this.reloadContent();
1367
- },
1368
- confirmAddTaskUser(rows) {
1369
- this.addIncreaseSignUsers = rows;
1370
- this.addIncreaseSignForm.userNickNames = rows.map(row => row.nickName).join(',');
1371
- // this.reloadContent();
1372
- },
1373
- submitAddTaskUserForm(flag) {
1374
- let that = getTarget(this);
1375
- let userIds = this.addIncreaseSignUsers.map((checkRow) => checkRow.id);
1376
- if (userIds.length == 0) {
1377
- that.$message({
1378
- message: this.$t2('请选择候选人', 'components.wf.addIncreaseSignWarnMsg1'),
1379
- type: "error",
1380
- duration: 2000,
1381
- onClose: (t) => {
1382
- },
1383
- });
1384
- return false;
1385
- }
1386
- let toDo = () => {
1387
- var data = JSON.stringify({
1388
- uuid: this.wfInfo.uuid,
1389
- taskId: this.wfInfo.taskId,
1390
- userIds: userIds,
1391
- suggestion: this.addIncreaseSignForm.opinion
1392
-
1393
- });
1394
- this.agreeDialogVisible = false;
1395
- that.$http({
1396
- url: this.current_prefix + "/wf/addIncreaseSign",
1397
- data: data,
1398
- method: "post",
1399
- loadingTarget: document.body,
1400
- headers: {
1401
- "Content-Type": "application/json;charset=utf-8",
1402
- },
1403
- isLoading: true,
1404
- success: (resultMsg) => {
1405
- this.showAddIncreaseSignDialog = false
1406
- that.$message({
1407
- message: resultMsg.content,
1408
- type: "success",
1409
- duration: 500,
1410
- onClose: (t) => {
1411
- this.reloadContent();
1412
- },
1413
- });
1414
- },
1415
- });
1416
- }
1417
- if (flag === 0) {
1418
- toDo();
1419
- } else {
1420
- that.$baseConfirm(this.$t2('您确定要加签吗?', 'components.wf.addIncreaseSignConfirmTip')).then(() => {
1421
- toDo();
1422
- });
1423
- }
1424
- },
1425
- openSetCandidateDialog(operateType) {
1426
- this.operateType = operateType;
1427
- this.showSetCandidateDialog = true;
1428
- },
1429
- closeSetCandidateDialog() {
1430
- this.showSetCandidateDialog = false;
1431
- this.reloadContent();
1432
- },
1433
- openRevokeDialog(operateType) {
1434
- this.operateType = operateType;
1435
- this.revokeForm = {opinion: null}
1436
- this.revokeDialogVisible = true;
1437
- },
1438
- subRevokeForm(flag) {
1439
- //撤回
1440
- let that = getTarget(this);
1441
- let toDo = () => {
1442
- var data = JSON.stringify({
1443
- uuid: this.wfInfo.uuid,
1444
- taskId: this.wfInfo.taskId,
1445
- suggestion: this.revokeForm.opinion,
1446
- });
1447
- this.revokeDialogVisible = false;
1448
- that.$http({
1449
- url: this.current_prefix + "/wf/revoke",
1450
- data: data,
1451
- method: "post",
1452
- loadingTarget: document.body,
1453
- headers: {
1454
- "Content-Type": "application/json;charset=utf-8",
1455
- },
1456
- isLoading: true,
1457
- success: (resultMsg) => {
1458
- that.$message({
1459
- message: resultMsg.content,
1460
- type: "success",
1461
- duration: 500,
1462
- onClose: (t) => {
1463
- this.reloadContent();
1464
- },
1465
- });
1466
- },
1467
- });
1468
- }
1469
- if (flag === 0) {
1470
- toDo();
1471
- } else {
1472
- that.$baseConfirm(this.$t2('您确定要撤回吗?', 'components.wf.revokeConfirmTip')).then(() => {
1473
- toDo();
1474
- });
1475
- }
1476
- },
1477
- initShowTaskInfo(callback) {
1478
- //初始化转办用户参数
1479
- let that = getTarget(this);
1480
- return that.$http({
1481
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1482
- method: `post`,
1483
- data: {attributeKey: "param9"},
1484
- isLoading: true,
1485
- modalStrictly: true,
1486
- success: (res) => {
1487
- this.showWfInfoTab = res.objx !== 1;
1488
- callback && callback();
1489
- },
1490
- });
1491
- },
1492
- getIsShowWfMemo(){
1493
- let that = getTarget(this);
1494
- that.$http({
1495
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1496
- method: `post`,
1497
- data: {attributeKey: "param10"},
1498
- isLoading: true,
1499
- success: (res) => {
1500
- this.showWfMemo = res?.objx === true;
1501
- if(this.showWfMemo){
1502
- this.$nextTick(()=>{
1503
- this.initWfMemo();
1504
- })
1505
- }
1506
- },
1507
- });
1508
- },
1509
-
1510
- initWfMemo() {
1511
- this.wfMemoSearchEvent();
1512
- /* let h = this.$createElement;
1513
- let tableOption = {
1514
- vue: this,
1515
- tableRef: "table-wfMemo",
1516
- tableName: "wf_table-wfMemo",
1517
- path: this.current_prefix + "/wf_memo/listPage",
1518
- param: () => {
1519
- return {
1520
- uuid: this.wfInfo.uuid,
1521
- };
1522
- },
1523
- config: {
1524
- height: 350
1525
- },
1526
- columns: [
1527
- {type: "checkbox", width: 48, resizable: false, fixed: "left"},
1528
- {
1529
- title: this.$t1('操作人'),
1530
- field: "operatorName",
1531
- width: 150,
1532
- fixed: "left",
1533
- },
1534
- {
1535
- title: this.$t1('内容'),
1536
- field: "content",
1537
- width: 250,
1538
- showOverflow: false
1539
- },
1540
- {
1541
- width: 150,
1542
- title: this.$t1('附件'),
1543
- field: "attachmentImage",
1544
- sortable: false,
1545
- slots: {
1546
- default: ({row, rowIndex}) => {
1547
- let option = {
1548
- title: this.$t1('附件'),
1549
- edit: false,
1550
- rows: (done) => {
1551
- done(row.attachmentDTOs);
1552
- },
1553
- };
1554
- return [
1555
- h("base-attachment", {
1556
- props: {
1557
- option: option,
1558
- imageLazy: false
1559
- },
1560
- }),
1561
- ];
1562
- },
1563
- },
1564
- },
1565
- {
1566
- title: this.$t2('创建时间', 'system.label.createDate'),
1567
- field: "createDate",
1568
- width: 150,
1569
- },
1570
- {
1571
- width: 80,
1572
- fixed: "right",
1573
- title: "",
1574
- sortable: false
1575
- },
1576
- ]
1577
- };
1578
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1579
- this.wfMemoOption = opts;
1580
- }); */
1581
- },
1582
- wfMemoSearchEvent(){
1583
- // this.$refs['table-wfMemo'].commitProxy('reload');
1584
- let that = getTarget(this);
1585
- that.$http({
1586
- url: this.current_prefix + "/wf_memo/listPage",
1587
- method: `post`,
1588
- data: {
1589
- uuid: this.wfInfo.uuid,
1590
- },
1591
- isLoading: true,
1592
- success: (res) => {
1593
- let rows = res?.objx?.records || [];
1594
- this.wfMemoData = rows;
1595
- },
1596
- });
1597
- },
1598
- openWfMemoDialog(row) {
1599
- if(row){
1600
- this.wfMemoForm = this.$baseLodash.cloneDeep(row);
1601
- }else{
1602
- this.wfMemoForm = {
1603
- uuid: this.wfInfo.uuid,
1604
- content:null,
1605
- attachmentDTOs: []
1606
- }
1607
- }
1608
- this.showWfMemoDialog = true;
1609
- },
1610
- submitWfMemoForm() {
1611
- let that = getTarget(this);
1612
-
1613
- if (!this.wfMemoForm.content) {
1614
- that.$message({
1615
- message: this.$t1('请输入内容'),
1616
- type: "error",
1617
- duration: 2 * 1000,
1618
- });
1619
- return false;
1620
- }
1621
-
1622
- this.showWfMemoDialog = false;
1623
- that.$http({
1624
- url: this.current_prefix + "/wf_memo/save",
1625
- data: this.wfMemoForm,
1626
- method: "post",
1627
- isLoading: true,
1628
- success: (resultMsg) => {
1629
- that.$message({
1630
- message: resultMsg.content,
1631
- type: "success"
1632
- });
1633
- this.wfMemoSearchEvent();
1634
- },
1635
- });
1636
- },
1637
- }
1638
- };
1639
-
1640
- wfStartMixin = {
1641
- name: "wfStartDialog",
1642
- props: {
1643
- dataId: [String, Number],
1644
- code: [String, Number],
1645
- serviceId: String,
1646
- startParam: Object,
1647
- visible: Boolean,
1648
- parentVue: Object,
1649
- wfName: String,
1650
- formCode: String,
1651
- option: Object
1652
- },
1653
- data() {
1654
- return {
1655
- showDialog: false,
1656
- wfStartForm: {},
1657
- wfDefItems: [],
1658
-
1659
- startFormData:{},
1660
- wfUserRangeEnabled: false,
1661
- preStartResult:[],
1662
- showSetCandidateDialog2:false
1663
- };
1664
- },
1665
- computed: {
1666
- current_prefix() {
1667
- return this.serviceId ? "/" + this.serviceId : "";
1668
- },
1669
- },
1670
- mounted() {
1671
- this.initWfInfo(this.code);
1672
- // this.showDialog = true;
1673
- },
1674
- methods: {
1675
- preStart(){
1676
- let that = getTarget(this);
1677
- return new Promise(resolve=>{
1678
- return that.$http({
1679
- url: this.current_prefix + "/wf/preStart",
1680
- method: `post`,
1681
- data: this.startFormData,
1682
- success: (res) => {
1683
- resolve(res.objx);
1684
- },
1685
- });
1686
- })
1687
- },
1688
- initWfUserRangeParam(){
1689
- let that = getTarget(this);
1690
- return that.$http({
1691
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1692
- method: `post`,
1693
- data: {attributeKey: "param12"},
1694
- success: (res) => {
1695
- this.wfUserRangeEnabled = res?.objx === true;
1696
- },
1697
- });
1698
- },
1699
- openSetCandidateDialog(){
1700
- this.showSetCandidateDialog2 = true;
1701
- },
1702
- confirmSetCandidateDialog(rows){
1703
- let formData = {
1704
- ...this.startFormData,
1705
- wfNodeDTOs: rows
1706
- }
1707
- this.startSubmitHanlde(formData);
1708
- },
1709
- async initWfInfo(code) {
1710
- let that = getTarget(this);
1711
- var wfDefItems = null;
1712
- var objId = this.dataId;
1713
-
1714
- await this.initWfUserRangeParam();
1715
- await that.$http({
1716
- url: this.current_prefix + "/wf_obj_config_item/list",
1717
- data: {
1718
- objTypeCode: code,
1719
- enabled: true,
1720
- objId: objId
1721
- },
1722
- method: "post",
1723
- //contentType: 'application/json;charset=utf-8',
1724
- async: false,
1725
- isLoading: true,
1726
- error: (error) => {
1727
- this.close();
1728
- },
1729
- success: (resultMsg) => {
1730
- wfDefItems = resultMsg.objx || [];
1731
- },
1732
- });
1733
-
1734
- if (!wfDefItems || wfDefItems.length == 0) {
1735
- that.$baseAlert(this.$t2('无法启动,没有流程单据', 'components.wf.startWarnMsg1'));
1736
- this.close();
1737
- return false;
1738
- }
1739
-
1740
- (this.wfStartForm = {
1741
- wfCode: code,
1742
- }),
1743
- (this.wfDefItems = wfDefItems);
1744
- this.$set(this.wfStartForm, "modelId", wfDefItems[0].modelId);
1745
- if (wfDefItems.length == 1) {
1746
- if (settingConfig.withoutConfrimByOneWf === true) {
1747
- this.startSubmit();
1748
- } else {
1749
- let customStartTip = this.option && this.option.startConfirmText;
1750
- if (typeof customStartTip === "function") {
1751
- customStartTip = await customStartTip.call(
1752
- this.parentVue || this,
1753
- {
1754
- objId: this.dataId,
1755
- wfCode: this.code,
1756
- formCode: this.formCode,
1757
- startParam: this.startParam,
1758
- }
1759
- );
1760
- }
1761
- let wfStartOperateName =
1762
- settingConfig.wfStartOperateName ||
1763
- settingConfig.wfStartButtonName ||
1764
- "启动流程";
1765
- let defaultStartTip = "您确定要" + wfStartOperateName + "吗?";
1766
- let startTip;
1767
- if (typeof customStartTip === "string" && customStartTip.trim()) {
1768
- startTip = customStartTip;
1769
- } else {
1770
- startTip = this.$t2(defaultStartTip, 'components.wf.startTip');
1771
- }
1772
- that
1773
- .$baseConfirm(startTip)
1774
- .then(() => {
1775
- this.startSubmit();
1776
- });
1777
- }
1778
- } else {
1779
- this.showDialog = true;
1780
- }
1781
- },
1782
- startSubmit() {
1783
- var modelId = this.wfStartForm.modelId;
1784
- if (!modelId) {
1785
- that.$baseAlert(this.$t2('请选择流程模版', 'components.wf.startWarnMsg2'));
1786
- return false;
1787
- }
1788
- let option = this.option;
1789
- if (option.onBeforeStartSubmit) {
1790
- option.onBeforeStartSubmit(() => {
1791
- this.subWfStartForm();
1792
- })
1793
- } else {
1794
- this.subWfStartForm();
1795
- }
1796
- },
1797
- async subWfStartForm() {
1798
- let that = getTarget(this);
1799
- var modelId = this.wfStartForm.modelId;
1800
- if (!modelId) {
1801
- that.$baseAlert(this.$t2('请选择流程模版', 'components.wf.startWarnMsg2'));
1802
- return false;
1803
- }
1804
-
1805
- let option = this.option;
1806
-
1807
- var objId = this.dataId;
1808
-
1809
- let startParam = this.startParam || {};
1810
- let formCode = this.formCode || null;
1811
-
1812
- var data = {
1813
- modelId: modelId,
1814
- objTypeCode: this.code,
1815
- objId: objId,
1816
- formData: startParam,
1817
- formCode: formCode
1818
- // name:this.wfName
1819
- };
1820
- this.startFormData = data;
1821
-
1822
- if(this.wfUserRangeEnabled){
1823
- this.preStartResult = await this.preStart() || []
1824
- if(this.preStartResult.length){
1825
- this.openSetCandidateDialog()
1826
- return
1827
- }
1828
- }
1829
- this.startSubmitHanlde(this.startFormData);
1830
-
1831
- },
1832
- startSubmitHanlde(formData){
1833
- this.showDialog = false;
1834
- let that = getTarget(this);
1835
- let option = this.option;
1836
- that.$http({
1837
- url: this.current_prefix + "/wf/start",
1838
- data: formData,
1839
- method: "post",
1840
- /* headers: {
1841
- "Content-Type": "application/json;charset=utf-8",
1842
- }, */
1843
- isLoading: true,
1844
- callback: (resultMsg) => {
1845
- if (resultMsg.type == "success") {
1846
- that.$message({
1847
- message: resultMsg.content,
1848
- type: "success",
1849
- duration: 500,
1850
- onClose: (t) => {
1851
- if (!option.onStartSuccess) {
1852
- that.$baseReload();
1853
- } else {
1854
- option.onStartSuccess();
1855
- }
1856
- if (resultMsg.objx) {
1857
- that.$baseAlert(resultMsg.objx)
1858
- }
1859
- },
1860
- });
1861
- } else {
1862
- option.onStartFail && option.onStartFail()
1863
- }
1864
-
1865
- }
1866
- });
1867
- },
1868
- close() {
1869
- this.$emit("update:visible", false);
1870
- },
1871
- },
1872
- };
1873
-
1874
- wfModifyMixin = {
1875
- name: "wfModifyMixin",
1876
- props: {
1877
- dataId: [String, Number],
1878
- code: [String, Number],
1879
- visible: Boolean,
1880
- paramData: Object,
1881
- parentVue: Object,
1882
- wfInfo: Object,
1883
- title: String
1884
- },
1885
- data() {
1886
- return {
1887
- showModifyDialog: false,
1888
- showBillEdit: false,
1889
- content: "",
1890
- };
1891
- },
1892
- async mounted() {
1893
- this.openWfModifyDialog(this.code);
1894
- },
1895
- methods: {
1896
- openWfModifyDialog() {
1897
- let row = this.paramData;
1898
- let url = row.url + ".vue";
1899
- this.showModifyDialog = true;
1900
- this.content = configUtil.requireView(url);
1901
- this.$openEditView("showBillEdit");
1902
- },
1903
- modfyDialogClose() {
1904
- this.showBillEdit = false;
1905
- this.content = null;
1906
- },
1907
- refreshEdit() {
1908
- this.showModifyDialog = false;
1909
- this.parentVue.$baseReload()
1910
- }
1911
- },
1912
- };
1913
-
1914
- wfUrgingMixin = {
1915
- props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
1916
- mixins: [selectDialogMixins],
1917
- created() {
1918
- this.initSetting();
1919
- },
1920
- mounted() {
1921
- this.initTableM1();
1922
- },
1923
- data() {
1924
- return {
1925
- showDialog: true,
1926
- selectMulti: true,
1927
- vxeOption: {},
1928
- };
1929
- },
1930
- methods: {
1931
- initTableM1() {
1932
- var that = this;
1933
- let tableOption = {
1934
- vue: that,
1935
- tableRef: "table-m1",
1936
- tableName: "wf_urgingDialog-m1",
1937
- path: this.current_prefix + "/wf/getTaskCandidates",
1938
- param: () => {
1939
- return {stringOne: this.wfInfo.uuid};
1940
- },
1941
- config: {
1942
- checkboxConfig: {
1943
- checkStrictly: true,
1944
- showHeader: this.selectMulti,
1945
- trigger: "row",
1946
- },
1947
- proxyConfig: {
1948
- props: {
1949
- result: "objx", // 配置响应结果列表字段
1950
- total: "objx.length", // 配置响应结果总页数字段
1951
- },
1952
- },
1953
- },
1954
- columns: [
1955
- {type: "checkbox", width: 50, resizable: false, fixed: "left"},
1956
- {title: this.$t2('催办人', 'components.wf.urgingUser'), field: "name", width: 250, fixed: "left"},
1957
- {title: this.$t2('催办人ID', 'components.wf.urgingUserId'), field: "id", width: 150},
1958
- {
1959
- width: 47,
1960
- fixed: "right",
1961
- title: "",
1962
- sortable: false,
1963
- },
1964
- ],
1965
- };
1966
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1967
- that.vxeOption = opts;
1968
- });
1969
- },
1970
- dialogConfirm() {
1971
- this.dialogPrimary();
1972
- this.$emit("confirm");
1973
- },
1974
- subUrgingForm() {
1975
- let that = this;
1976
- let urgingUserIds = this.checkRows.map((checkRow) => checkRow.id);
1977
- if (urgingUserIds.length == 0) {
1978
- that.$message({
1979
- message: this.$t2('请选择催办人', 'components.wf.urgingWarnMsg1'),
1980
- type: "error",
1981
- duration: 2000,
1982
- onClose: (t) => {
1983
- },
1984
- });
1985
- return false;
1986
- }
1987
- that.$baseConfirm(this.$t2('您确定要催办吗?', 'components.wf.urgingConfirmTip')).then(() => {
1988
- var data = JSON.stringify({
1989
- uuid: this.wfInfo.uuid,
1990
- taskId: this.wfInfo.taskId,
1991
- notifyType: "wfUrging",
1992
- userIds: urgingUserIds,
1993
- });
1994
- this.agreeDialogVisible = false;
1995
- that.$http({
1996
- url: this.current_prefix + "/wf/urging",
1997
- data: data,
1998
- method: "post",
1999
- loadingTarget: document.body,
2000
- headers: {
2001
- "Content-Type": "application/json;charset=utf-8",
2002
- },
2003
- isLoading: true,
2004
- success: (resultMsg) => {
2005
- that.$message({
2006
- message: resultMsg.content,
2007
- type: "success",
2008
- duration: 500,
2009
- onClose: (t) => {
2010
- // this.reloadContent();
2011
- this.dialogConfirm();
2012
- },
2013
- });
2014
- },
2015
- });
2016
- });
2017
- },
2018
- },
2019
- };
2020
-
2021
- deleteTaskUserMixin = {
2022
- props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
2023
- mixins: [selectDialogMixins],
2024
- created() {
2025
- this.initSetting();
2026
- },
2027
- mounted() {
2028
- this.initTableM1();
2029
- },
2030
- data() {
2031
- return {
2032
- showDialog: true,
2033
- selectMulti: true,
2034
- vxeOption: {},
2035
- };
2036
- },
2037
- methods: {
2038
- initTableM1() {
2039
- var that = this;
2040
- let tableOption = {
2041
- vue: that,
2042
- tableRef: "table-m1",
2043
- tableName: "wf_deleteTaskUserDialog-m1",
2044
- path: this.current_prefix + "/wf/getIncreaseSign",
2045
- param: () => {
2046
- return {
2047
- uuid: this.wfInfo.uuid,
2048
- taskId: this.wfInfo.taskId,
2049
- };
2050
- },
2051
- config: {
2052
- checkboxConfig: {
2053
- checkStrictly: true,
2054
- showHeader: this.selectMulti,
2055
- trigger: "row",
2056
- },
2057
- proxyConfig: {
2058
- props: {
2059
- result: "objx", // 配置响应结果列表字段
2060
- total: "objx.length", // 配置响应结果总页数字段
2061
- },
2062
- },
2063
- },
2064
- columns: [
2065
- {type: "checkbox", width: 50, resizable: false, fixed: "left"},
2066
- {title: this.$t2('候选人', 'components.wf.candidate'), field: "name", width: 250, fixed: "left"},
2067
- {title: this.$t2('候选人ID', 'components.wf.candidateId'), field: "id", width: 150},
2068
- {
2069
- width: 47,
2070
- fixed: "right",
2071
- title: "",
2072
- sortable: false,
2073
- },
2074
- ],
2075
- };
2076
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
2077
- that.vxeOption = opts;
2078
- });
2079
- },
2080
- dialogConfirm() {
2081
- this.dialogPrimary();
2082
- // this.$emit("confirm");
2083
- },
2084
- subForm() {
2085
- let that = this;
2086
- let userIds = this.checkRows.map((checkRow) => checkRow.id);
2087
- if (userIds.length == 0) {
2088
- that.$message({
2089
- message: this.$t2('请选择候选人', 'components.wf.deleteIncreaseSignWarnMsg1'),
2090
- type: "error",
2091
- duration: 2000,
2092
- onClose: (t) => {
2093
- },
2094
- });
2095
- return false;
2096
- }
2097
- that.$baseConfirm(this.$t2('您确定要减签选中的候选人吗?', 'components.wf.deleteIncreaseSignTip')).then(() => {
2098
- var data = JSON.stringify({
2099
- uuid: this.wfInfo.uuid,
2100
- taskId: this.wfInfo.taskId,
2101
- userIds: userIds,
2102
- });
2103
- this.agreeDialogVisible = false;
2104
- that.$http({
2105
- url: this.current_prefix + "/wf/deleteIncreaseSign",
2106
- data: data,
2107
- method: "post",
2108
- loadingTarget: document.body,
2109
- headers: {
2110
- "Content-Type": "application/json;charset=utf-8",
2111
- },
2112
- isLoading: true,
2113
- success: (resultMsg) => {
2114
- that.$message({
2115
- message: resultMsg.content,
2116
- type: "success",
2117
- duration: 500,
2118
- onClose: (t) => {
2119
- this.dialogConfirm();
2120
- },
2121
- });
2122
- },
2123
- });
2124
- });
2125
- },
2126
- },
2127
- };
2128
-
2129
- addTaskUserMixin = {
2130
- props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
2131
- mixins: [selectDialogMixins],
2132
- data() {
2133
- return {
2134
- showDialog: true,
2135
- selectMulti: true,
2136
- vxeOption: {},
2137
- };
2138
- },
2139
- created() {
2140
- this.initSetting();
2141
- },
2142
- mounted() {
2143
- this.initTableM1();
2144
- },
2145
- methods: {
2146
- dialogConfirm() {
2147
- this.dialogPrimary();
2148
- // this.$emit('confirm');
2149
- },
2150
- subForm() {
2151
- let that = this;
2152
- let userIds = this.checkRows.map((checkRow) => checkRow.id);
2153
- if (userIds.length == 0) {
2154
- that.$message({
2155
- message: this.$t2('请选择候选人', 'components.wf.addIncreaseSignWarnMsg1'),
2156
- type: "error",
2157
- duration: 2000,
2158
- onClose: (t) => {
2159
- },
2160
- });
2161
- return false;
2162
- }
2163
- that.$baseConfirm(this.$t2('您确定要加签选中的候选人吗?', 'components.wf.addIncreaseSignConfirmTip2')).then(() => {
2164
- var data = JSON.stringify({
2165
- uuid: this.wfInfo.uuid,
2166
- taskId: this.wfInfo.taskId,
2167
- userIds: userIds,
2168
- });
2169
- this.agreeDialogVisible = false;
2170
- that.$http({
2171
- url: this.current_prefix + "/wf/addIncreaseSign",
2172
- data: data,
2173
- method: "post",
2174
- loadingTarget: document.body,
2175
- headers: {
2176
- "Content-Type": "application/json;charset=utf-8",
2177
- },
2178
- isLoading: true,
2179
- success: (resultMsg) => {
2180
- that.$message({
2181
- message: resultMsg.content,
2182
- type: "success",
2183
- duration: 500,
2184
- onClose: (t) => {
2185
- this.dialogConfirm();
2186
- },
2187
- });
2188
- },
2189
- });
2190
- });
2191
- },
2192
- },
2193
- };
2194
-
2195
- export {
2196
- wfIndexMixin,
2197
- wfStartMixin,
2198
- wfContentMixin,
2199
- wfModifyMixin,
2200
- wfUrgingMixin,
2201
- deleteTaskUserMixin,
2202
- addTaskUserMixin,
2203
- };
1
+ /**version-1.0*/
2
+ import {getToken} from "../../utils/auth";
3
+ import settingConfig from "@/settings.js";
4
+ import {selectDialogMixins} from "../../mixins/selectDialog";
5
+ import {requireViewCompat} from "@base/utils/resolveViewComponent";
6
+
7
+ let configUtil = {
8
+ baseUrl: process.env.VUE_APP_BASE_API,
9
+ getToken,
10
+ // 归属自己 / 包内组件本地渲染;归属别家子应用(remote)或缺文件时返回 null,
11
+ // 不再抛错崩溃。归属解析见 @base/utils/resolveViewComponent。
12
+ requireView: (url) => {
13
+ return requireViewCompat(url);
14
+ },
15
+ };
16
+
17
+ let wfIndexMixin,
18
+ wfStartMixin,
19
+ wfContentMixin,
20
+ wfModifyMixin,
21
+ wfUrgingMixin,
22
+ deleteTaskUserMixin,
23
+ addTaskUserMixin;
24
+
25
+ function getTarget(t, flag) {
26
+ let target;
27
+ if (t.parentVue) {
28
+ target = t.parentVue;
29
+ } else if (flag === 0) {
30
+ target = t.$parent.$parent;
31
+ } else {
32
+ target = t.$parent.$parent.$parent;
33
+ }
34
+ return target;
35
+ }
36
+
37
+ function oaPublishEvent(that) {
38
+ let _closeWindowOnCheck = that.$attrs._closeWindowOnCheck || that._closeWindowOnCheck;
39
+ if (_closeWindowOnCheck === true || _closeWindowOnCheck === "true") {
40
+ let win = window.opener;
41
+ if (win && domain && domain.call) {
42
+ var event = {type: "topic", name: "successReloadPage"};
43
+ domain.call(win, 'fireEvent', [event]);
44
+ }
45
+ }
46
+ }
47
+
48
+ wfIndexMixin = {
49
+ name: "wfView",
50
+ props: {
51
+ objId: [String, Number],
52
+ wfCode: String,
53
+ serviceId: String,
54
+ },
55
+ data() {
56
+ return {
57
+ wfReloadFlag: false,
58
+ hasWf: false,
59
+ wfStartVisible: false,
60
+ paramData: "",
61
+ showModifyDialog: false,
62
+ showBillEdit: false,
63
+ content: "",
64
+ wfInfo: "",
65
+ currentTask: "",
66
+ taskParam: "",
67
+ };
68
+ },
69
+ computed: {
70
+ current_prefix() {
71
+ return this.serviceId ? "/" + this.serviceId : "";
72
+ },
73
+ },
74
+ created() {
75
+ },
76
+ watch: {
77
+ wfCode(val) {
78
+ this.getWfInfo();
79
+ },
80
+ objId(val) {
81
+ this.getWfInfo();
82
+ },
83
+ },
84
+ async mounted() {
85
+ if (this.objId) {
86
+ let hasWf = false;
87
+ let wfInfo, currentTask, taskParam;
88
+ await this.initWfInfo().then((res) => {
89
+ if (res && res.type == "success") {
90
+ if (res.objx && res.objx.procInstId) {
91
+ hasWf = true;
92
+ wfInfo = res.objx;
93
+ }
94
+ }
95
+ });
96
+
97
+ if (hasWf) {
98
+ /* await this.getCurrentTask(wfInfo).then(res1 => {
99
+ if (res1.type == 'success') {
100
+ currentTask = res1.objx;
101
+ }
102
+ }); */
103
+ /* if (wfInfo.taskId) {
104
+ await this.getTaskParams(currentTask).then(res2 => {
105
+ if (res2.type == 'success') {
106
+ taskParam = res2.objx;
107
+ }
108
+ });
109
+ } */
110
+ }
111
+ this.paramData = taskParam;
112
+ this.wfInfo = wfInfo;
113
+ this.currentTask = currentTask;
114
+ this.taskParam = taskParam;
115
+
116
+ let flag = true;
117
+ this.$emit("onShow", {
118
+ wfInfo: wfInfo,
119
+ currentTask: currentTask,
120
+ taskParam: taskParam,
121
+ hasWf: hasWf,
122
+ callback: (val) => {
123
+ flag = false;
124
+ if (val !== false && hasWf) {
125
+ this.wfReloadFlag = true;
126
+ }
127
+ },
128
+ });
129
+ if (flag) {
130
+ if (hasWf) {
131
+ this.wfReloadFlag = true;
132
+ }
133
+ }
134
+ }
135
+ this.$on("toDo", (option) => {
136
+ this.$emit(option.methd, option.param);
137
+ });
138
+ },
139
+ methods: {
140
+ getWfInfo() {
141
+ if (this.wfCode && this.objId) {
142
+ this.reload();
143
+ } else {
144
+ this.wfReloadFlag = false;
145
+ }
146
+ },
147
+ openStartWfDialog(code) {
148
+ this.wfStartVisible = true;
149
+ },
150
+ reload() {
151
+ this.wfReloadFlag = false;
152
+ this.$nextTick(() => {
153
+ this.wfReloadFlag = true;
154
+ });
155
+ },
156
+ manualCallback() {
157
+ this.$emit("manualCallback");
158
+ },
159
+ async getCurrentTask(obj) {
160
+ let that = getTarget(this, 0);
161
+ return that.$http({
162
+ url: "/agilebpm/wf_task/getCurrentTask",
163
+ data: {
164
+ procInstId: obj.procInstId,
165
+ },
166
+ method: "post",
167
+ async: false,
168
+ isLoading: true,
169
+ modalStrictly: true,
170
+ });
171
+ },
172
+ async initWfInfo() {
173
+ let that = getTarget(this, 0);
174
+ let id = this.objId;
175
+ let code = this.wfCode;
176
+ return that.$http({
177
+ url: this.current_prefix + "/wf/getWfInfo",
178
+ method: `post`,
179
+ data: {
180
+ objTypeCode: code,
181
+ objId: id,
182
+ },
183
+ isLoading: true,
184
+ modalStrictly: true,
185
+ });
186
+ },
187
+ async getTaskParams(data) {
188
+ let that = getTarget(this, 0);
189
+ return that.$http({
190
+ url: "/agilebpm/wf_task/getTaskParams",
191
+ method: `post`,
192
+ data: {
193
+ taskId: data.taskId,
194
+ },
195
+ isLoading: true,
196
+ modalStrictly: true,
197
+ });
198
+ },
199
+ openWfModifyDialog() {
200
+ let row = this.paramData;
201
+ let url = row.url + ".vue";
202
+ this.showModifyDialog = true;
203
+ this.content = configUtil.requireView(url);
204
+ this.$openEditView("showBillEdit");
205
+ },
206
+ modfyDialogClose() {
207
+ this.showBillEdit = false;
208
+ this.content = null;
209
+ },
210
+ },
211
+ };
212
+
213
+ wfContentMixin = {
214
+ name: "wfContent",
215
+ props: {
216
+ objId: [String, Number],
217
+ wfCode: String,
218
+ serviceId: String,
219
+ _wfInfo: Object,
220
+ _taskParam: Object,
221
+ parentVue: Object,
222
+ wfConfig: Object,
223
+ defaultShowWfContent: Boolean,
224
+ },
225
+ computed: {
226
+ current_prefix() {
227
+ return this.serviceId ? "/" + this.serviceId : "";
228
+ },
229
+ viewTarget() {
230
+ return getTarget(this);
231
+ },
232
+ isHideWf() {
233
+ let that = this.viewTarget;
234
+ let _hideWf = that._hideWf || that.$attrs._hideWf;
235
+ return _hideWf === true || _hideWf === 'true';
236
+ }
237
+ },
238
+ data() {
239
+ let showWfFold =
240
+ settingConfig.showWfFold != null && settingConfig.showWfFold != undefined
241
+ ? settingConfig.showWfFold
242
+ : false;
243
+ if (this.wfConfig.showWfFold != null && this.wfConfig.showWfFold != undefined) {
244
+ showWfFold = this.wfConfig.showWfFold;
245
+ }
246
+ let showWfContent =
247
+ showWfFold &&
248
+ settingConfig.defaultShowWfContent != null &&
249
+ settingConfig.defaultShowWfContent != undefined
250
+ ? settingConfig.defaultShowWfContent
251
+ : true;
252
+ if (
253
+ this.defaultShowWfContent != null &&
254
+ this.defaultShowWfContent != undefined
255
+ ) {
256
+ showWfContent = this.defaultShowWfContent;
257
+ }
258
+
259
+ return {
260
+ fileInfos: [],
261
+ showUserDialog: false,
262
+ showContent: true,
263
+ objTypeCode: "",
264
+ // objId: '',
265
+ wfInfo: {},
266
+ // currentTask: {},
267
+ taskParam: {},
268
+ wfImage: "",
269
+ wfStartBtn: false,
270
+ wfManualendBtn: false,
271
+ wfSubmitBtn: false,
272
+ wfRejectBtn: false,
273
+ changeHandlerBtn: false,
274
+ wftaskData: [],
275
+ allWfTaskOpinions: [],
276
+ vxeOption: {},
277
+ rejectNodes: [],
278
+ rejectDialogVisible: false,
279
+ rejectForm: {
280
+ rejectSubmitModel: null,
281
+ nodeId: null,
282
+ opinion: null,
283
+ },
284
+ formLabelWidth: "120px",
285
+ agreeDialogVisible: false,
286
+ agreeForm: {
287
+ opinion: this.$t2('同意', 'components.wf.defaultAgreeOption'),
288
+ nodeId: null,
289
+ },
290
+ changeWfDialogVisible: false,
291
+ changeWfForm: {},
292
+ changeUserRows: [],
293
+ taskStatuses: {
294
+ start: {
295
+ class: "blue",
296
+ value: this.$t2('开始', 'components.wf.startStatus'),
297
+ },
298
+ approve: {
299
+ class: "orgn",
300
+ value: this.$t2('待审批', 'components.wf.approveStatus'),
301
+ },
302
+ submit: {
303
+ class: "green",
304
+ value: this.$t2('同意', 'components.wf.submitStatus'),
305
+ },
306
+ reject: {
307
+ class: "red",
308
+ value: this.$t2('驳回', 'components.wf.rejectStatus'),
309
+ },
310
+ transfer: {
311
+ class: "green",
312
+ value: this.$t2('转办', 'components.wf.transferStatus'),
313
+ },
314
+ addIncreaseSign: {
315
+ class: "green",
316
+ value: this.$t2('加签', 'components.wf.addIncreaseSignStatus'),
317
+ },
318
+ revoke: {
319
+ class: "red",
320
+ value: this.$t2('撤回', 'components.wf.revokeStatus'),
321
+ },
322
+ end: {
323
+ class: "gray",
324
+ value: this.$t2('结束', 'components.wf.endStatus'),
325
+ },
326
+ },
327
+ opinion: "",
328
+ showWfFold: showWfFold,
329
+ showWfContent: showWfContent,
330
+
331
+ urgingForm: {},
332
+ urgingDialogVisible: false,
333
+ urgingUserIds: [],
334
+ urgingUsers: [],
335
+ agreeNodes: [],
336
+ showWfManualDialog: false,
337
+
338
+ showDeleteTaskUserDialog: false,
339
+ showAddTaskUserDialog: false,
340
+ wfUserParam: {},
341
+ wfUserParamForTransfer: {},//转办
342
+ wfUserParamForAddSign: {},//加签
343
+ wfUserParamForTalk: {},//沟通
344
+ tabIndex: "1",
345
+ linkupOption: {},
346
+ talkForm: {
347
+ receiverName: null,
348
+ content: null,
349
+ attachmentDTOs: [],
350
+ replyId: null
351
+ },
352
+ showTalkUserDialog: false,
353
+ showTalkDialog: false,
354
+ showFlowImg: true,
355
+ operateType: null,
356
+ addIncreaseSignUsers: [],
357
+ addIncreaseSignForm: {
358
+ userNickNames: null,
359
+ opinion: null
360
+ },
361
+ showAddIncreaseSignDialog: false,
362
+ showOpeaImg: true,
363
+ showSetCandidateDialog: false,
364
+ toTalk: false,
365
+ showAllWfOpinon: false,
366
+
367
+ revokeDialogVisible: false,
368
+ revokeForm: {opinion: null},
369
+ showWfInfoTab: false,
370
+
371
+ showWfMemo:false,
372
+ wfMemoOption: {},
373
+ wfMemoForm: {
374
+ receiverName: null,
375
+ content: null,
376
+ attachmentDTOs: [],
377
+ replyId: null
378
+ },
379
+ showWfMemoDialog: false,
380
+ wfMemoData:[],
381
+
382
+ showCandidate: false,
383
+ candidateOption:{},
384
+ candidateDatas:[],
385
+ wfSendTaskId: null,
386
+ showAddOpinionButton: false,
387
+
388
+ addOpinionEnabled: false,
389
+ modifyCurrentCandidateEnabled: false,
390
+
391
+ //修改脚本
392
+ showWfFlowEleScriptDialog: false
393
+ };
394
+ },
395
+ provide() {
396
+ return {
397
+ getParentVue: () => this.parentVue,
398
+ getWfInfo: () => this.wfInfo,
399
+ getCurrentPrefix: () => this.current_prefix,
400
+ getEditVueTarget: ()=> getTarget(this)
401
+ };
402
+ },
403
+ created() {
404
+ this.wfInfo = this._wfInfo;
405
+ this.showFlowImg = settingConfig.expandWfImage === false ? false : true;
406
+ this.showAllWfOpinon = settingConfig.showAllWfOpinon === true;
407
+ },
408
+ mounted() {
409
+ this.initOperateType();
410
+ this.initForAll();
411
+ },
412
+ methods: {
413
+ openWfFlowEleScriptDialog(){
414
+ this.showWfFlowEleScriptDialog = true
415
+ },
416
+ initWfParam13(){
417
+ //初始化补充意见权限
418
+ let that = getTarget(this);
419
+ return that.$http({
420
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
421
+ method: `post`,
422
+ data: {attributeKey: "param13"},
423
+ success: (res) => {
424
+ this.addOpinionEnabled = res?.objx === true;
425
+ if(this.addOpinionEnabled){
426
+ this.wfSendTaskId = this.getViewParam('wfSendTaskId');
427
+ this.showAddOpinionButton = !!this.wfSendTaskId;
428
+ }
429
+ },
430
+ });
431
+ },
432
+
433
+ initWfParam14(){
434
+ //初始化修改当前候选人权限
435
+ let that = getTarget(this);
436
+ return that.$http({
437
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
438
+ method: `post`,
439
+ data: {attributeKey: "param14"},
440
+ success: (res) => {
441
+ this.modifyCurrentCandidateEnabled = res?.objx === true;
442
+ },
443
+ });
444
+ },
445
+ getViewParam(key){
446
+ let that = this.viewTarget;
447
+ let value = that[key] || that.$attrs[key];
448
+ return value;
449
+ },
450
+ initCandidate(){
451
+ // 是否显示"节点候选人"选项卡
452
+ let that = getTarget(this);
453
+ that.$http({
454
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
455
+ method: `post`,
456
+ data: {attributeKey: "param11"},
457
+ isLoading: true,
458
+ success: (res) => {
459
+ this.showCandidate = res?.objx === true;
460
+ if(this.showCandidate){
461
+ this.$nextTick(()=>{
462
+ this.initCandidateTable();
463
+ })
464
+ }
465
+ },
466
+ });
467
+ },
468
+ initCandidateTable(){
469
+ let that = this;
470
+ let tableOption = {
471
+ vue: that,
472
+ tableRef: 'table-candidate',
473
+ tableName: 'wf_candidate-list',
474
+ path: this.current_prefix + '/wf/getAllNodes',
475
+ param: () => {
476
+ return {
477
+ stringOne: this.wfInfo.uuid
478
+ }
479
+ },
480
+ config: {
481
+ height: 350,
482
+ proxyConfig: {
483
+ props: {
484
+ result: "objx", // 配置响应结果列表字段
485
+ total: "objx.length", // 配置响应结果总页数字段
486
+ },
487
+ },
488
+ pagerConfig:{
489
+ autoHidden: true
490
+ }
491
+ },
492
+ columns: [
493
+ {type: 'checkbox', width: 50, resizable: false, fixed: 'left'},
494
+ {title: this.$t2('节点名称', 'components.wf.nodeName'), field: 'nodeName', width: 250, fixed: 'left'},
495
+ {
496
+ field: 'wfTaskCandidates',
497
+ title: this.$t2('候选人', 'components.wf.candidate'),
498
+ width: 450,
499
+ slots: {
500
+ default: ({row, rowIndex}) => {
501
+ return row.wfTaskCandidateDTOs ? row.wfTaskCandidateDTOs.map(item => item.name).join(",") : null;
502
+ },
503
+ },
504
+ },
505
+ {
506
+ width: 47,
507
+ fixed: 'right',
508
+ title: '',
509
+ sortable: false,
510
+ }
511
+ ]
512
+ };
513
+ this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
514
+ that.candidateOption = opts;
515
+ });
516
+ },
517
+ initOperateType() {
518
+ if (this.operateType) {
519
+ let wfInfo = this.wfInfo;
520
+ if (wfInfo.toSubmit) {
521
+ this.openAgreeDialog('submit');
522
+ } else if (wfInfo.toReject) {
523
+ this.rejectWfTask('reject');
524
+ } else if (wfInfo.toAddIncreaseSign) {
525
+ this.openAddIncreaseSign('addIncreaseSign')
526
+ } else if (wfInfo.toRevoke) {
527
+ this.openRevokeDialog('revoke')
528
+ } else if (wfInfo.toLinkup) {
529
+ this.openTalkDialog(null, null, 'talk');
530
+ } else {
531
+ this.operateType = null;
532
+ }
533
+ }
534
+ },
535
+ initForAll() {
536
+ let that = getTarget(this);
537
+ this.initWf(() => {
538
+ if (this.wfInfo.procInstId) {
539
+ this.initCurrentTask(this.wfInfo.procInstId, () => {
540
+ this.initWftask(this.wfInfo.procInstId);
541
+ this.getAllWfTaskOpinions();
542
+ });
543
+ this.initWfUserParam();
544
+ this.initTabIndex();
545
+ this.initShowTaskInfo();
546
+ //初始化附言
547
+ this.getIsShowWfMemo();
548
+ // 是否显示"节点候选人"选项卡
549
+ this.initCandidate()
550
+
551
+ //初始化补充意见权限
552
+ this.initWfParam13();
553
+
554
+ //初始化修改当前候选人权限
555
+ this.initWfParam14();
556
+
557
+ }
558
+ });
559
+ },
560
+ initTabIndex() {
561
+ let that = getTarget(this);
562
+ that.$http({
563
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
564
+ method: `post`,
565
+ data: {attributeKey: "param7"},
566
+ isLoading: true,
567
+ success: (res) => {
568
+ let val = res !== null ? res.objx === true : false;
569
+ this.toTalk = val;
570
+ let flag = false;
571
+ if (val) {
572
+ let flag1 = that.$attrs._isNotifyMessage == true || that.$attrs._isNotifyMessage == "true";
573
+ if (flag1) {
574
+ this.tabIndex = "2";
575
+ }
576
+ if (settingConfig.autoOpenWfLinkup) {
577
+ flag = true;
578
+ let flag2 = that.$attrs._wfNotifyType == "wfLinkup";
579
+ let flag3 = flag1 && flag2;
580
+ if (flag3) {
581
+ this.$nextTick(() => {
582
+ let wfTabPane = this.$refs.wfTabPane;
583
+ if (!wfTabPane.showContent) {
584
+ wfTabPane.handleFold();
585
+ }
586
+ });
587
+ }
588
+ }
589
+ }
590
+ this.initLinkup(flag);
591
+ }
592
+ });
593
+
594
+ },
595
+ initWf(done) {
596
+ var data = this.wfInfo;
597
+ if (data && data.procInstId) {
598
+ /** 流程状态:0未启动,1审核中,2已完成,3驳回,4中断 */
599
+ var statuses = {
600
+ 1: '<span class="tag">' + this.$t2('审核中', 'components.wf.wfStatus1') + '</span>',
601
+ 3: '<span class="tag red">' + this.$t2('已驳回', 'components.wf.wfStatus2') + '</span>',
602
+ 2: '<span class="tag green">' + this.$t2('已完成', 'components.wf.wfStatus3') + '</span>',
603
+ };
604
+ var statusStr = "";
605
+ if (data.stat != null) {
606
+ statusStr = statuses[data.stat] || "";
607
+ }
608
+ data.statusStr = statusStr;
609
+ this.wfInfo = data;
610
+
611
+ this.wfStartBtn = false;
612
+ if (data.status != 2 && data.starterId) {
613
+ this.wfManualendBtn = true;
614
+ }
615
+ this.wfSubmitBtn = false;
616
+ this.wfRejectBtn = false;
617
+
618
+ var url =
619
+ this.current_prefix +
620
+ "/wf/flowImage?procInstId=" +
621
+ data.procInstId +
622
+ "&_r=" +
623
+ Math.random() +
624
+ "&access_token=" +
625
+ configUtil.getToken();
626
+ this.wfImage = configUtil.baseUrl + url;
627
+ done();
628
+ }
629
+ },
630
+ initCurrentTask(procInstId, done) {
631
+ if (this.wfInfo.taskId) {
632
+ this.wfSubmitBtn = true;
633
+ this.wfRejectBtn = true;
634
+ this.changeHandlerBtn = true;
635
+ }
636
+ done();
637
+ },
638
+ initWftask(procInstId) {
639
+ let that = getTarget(this);
640
+ that.$http({
641
+ url: this.current_prefix + "/wf/getWfTaskOpinionMerge",
642
+ data: {
643
+ stringOne: procInstId,
644
+ },
645
+ method: "post",
646
+ async: false,
647
+ isLoading: true,
648
+ modalStrictly: true,
649
+ success: (resultmsg) => {
650
+ var datas = resultmsg.objx || [];
651
+ this.wftaskData = datas;
652
+ },
653
+ });
654
+ },
655
+ getAllWfTaskOpinions() {
656
+ if (!this.showAllWfOpinon) {
657
+ return;
658
+ }
659
+ let that = getTarget(this);
660
+ let wfInfo = this.wfInfo;
661
+ that.$http({
662
+ url: this.current_prefix + "/wf/getAllWfTaskOpinions",
663
+ data: {
664
+ objId: wfInfo.objId,
665
+ objTypeCode: wfInfo.objTypeCode
666
+ },
667
+ method: "post",
668
+ async: false,
669
+ isLoading: true,
670
+ modalStrictly: true,
671
+ success: (resultmsg) => {
672
+ var datas = resultmsg.objx || [];
673
+ this.allWfTaskOpinions = datas;
674
+ },
675
+ });
676
+ },
677
+ openManualDialog(operateType) {
678
+ this.operateType = operateType;
679
+ this.showWfManualDialog = true;
680
+ },
681
+ manualEndWf() {
682
+ this.showWfManualDialog = false;
683
+ let that = getTarget(this);
684
+ var procInstId = this.wfInfo.procInstId;
685
+ var taskId = this.wfInfo.taskId ? this.wfInfo.taskId : "";
686
+ var data = JSON.stringify({
687
+ uuid: this.wfInfo.uuid,
688
+ });
689
+ that.$http({
690
+ url: this.current_prefix + "/wf/interrupt",
691
+ data: data,
692
+ method: "post",
693
+ headers: {
694
+ "Content-Type": "application/json;charset=utf-8",
695
+ },
696
+ isLoading: true,
697
+ success: (resultMsg) => {
698
+ that.$message({
699
+ message: resultMsg.content,
700
+ type: "success",
701
+ duration: 500,
702
+ onClose: (t) => {
703
+ this.reloadContent();
704
+ this.closeWinOnCheck(3);
705
+ },
706
+ });
707
+ },
708
+ });
709
+ },
710
+ async rejectWfTask(operateType) {
711
+ this.handleReminderContent("rejectReminder", async ()=>{
712
+ let that = getTarget(this);
713
+ var procInstId = this.wfInfo.procInstId;
714
+ var taskId = this.wfInfo.taskId;
715
+ var destinations = [];
716
+
717
+ await that.$http({
718
+ url: this.current_prefix + "/wf/getPreIncomeNodes",
719
+ data: {
720
+ stringOne: taskId,
721
+ },
722
+ method: "post",
723
+ //contentType: 'application/json;charset=utf-8',
724
+ async: false,
725
+ isLoading: true,
726
+ success: (resultMsg) => {
727
+ destinations = (resultMsg.objx || []).reverse();
728
+ },
729
+ });
730
+
731
+ if (destinations == null) {
732
+ return false;
733
+ }
734
+ if (destinations.length == 0) {
735
+ that.$message({
736
+ message: this.$t2('无法驳回,没有目标节点', 'components.wf.rejectWarnMsg1'),
737
+ type: "error",
738
+ duration: 2 * 1000,
739
+ });
740
+ return false;
741
+ }
742
+ this.operateType = operateType;
743
+ let rejectSubmitModel = null;
744
+ if (this.wfInfo.toNextNode === 1) {
745
+ rejectSubmitModel = this.wfInfo.toNextNode
746
+ } else {
747
+ rejectSubmitModel = this.wfInfo.toRejectNode == false ? 2 : null
748
+ }
749
+ this.rejectForm.rejectSubmitModel = rejectSubmitModel;
750
+ this.rejectForm.nodeId = destinations[0].nodeId;
751
+ this.rejectForm.opinion = "";
752
+ this.rejectNodes = destinations;
753
+ this.rejectDialogVisible = true;
754
+ })
755
+
756
+ },
757
+ subRejectForm() {
758
+ let that = getTarget(this);
759
+ var procInstId = this.wfInfo.procInstId;
760
+ var taskId = this.wfInfo.taskId;
761
+
762
+ if (!this.rejectForm.nodeId) {
763
+ that.$message({
764
+ message: this.$t2('请选择驳回节点', 'components.wf.rejectWarnMsg2'),
765
+ type: "error",
766
+ duration: 2 * 1000,
767
+ });
768
+ return false;
769
+ }
770
+
771
+ if (!this.rejectForm.opinion) {
772
+ that.$message({
773
+ message: this.$t2('请输入驳回意见', 'components.wf.rejectWarnMsg3'),
774
+ type: "error",
775
+ duration: 2 * 1000,
776
+ });
777
+ return false;
778
+ }
779
+
780
+ var data = JSON.stringify({
781
+ taskId: taskId,
782
+ uuid: this.wfInfo.uuid,
783
+ nodeId: this.rejectForm.nodeId,
784
+ suggestion: this.rejectForm.opinion,
785
+ rejectSubmitModel: this.rejectForm.rejectSubmitModel
786
+ });
787
+ this.rejectDialogVisible = false;
788
+ that.$http({
789
+ url: this.current_prefix + "/wf/reject",
790
+ data: data,
791
+ method: "post",
792
+ headers: {
793
+ "Content-Type": "application/json;charset=utf-8",
794
+ },
795
+ isLoading: true,
796
+ success: (resultMsg) => {
797
+ that.$message({
798
+ message: resultMsg.content,
799
+ type: "success",
800
+ duration: 500,
801
+ onClose: (t) => {
802
+ this.reloadContent();
803
+ this.closeWinOnCheck(2);
804
+ },
805
+ });
806
+ },
807
+ });
808
+ },
809
+ handleReminderContent(scriptType, callback){
810
+ let that = getTarget(this);
811
+ that.$http({
812
+ url: this.current_prefix + "/wf/getReminderContent",
813
+ data: {
814
+ scriptType,
815
+ taskId: this.wfInfo.taskId,
816
+ uuid: this.wfInfo.uuid,
817
+ },
818
+ method: "post",
819
+ isLoading: true,
820
+ errorMsg: false,
821
+ success: (res) => {
822
+ if(res.objx){
823
+ that.$baseConfirm(res.objx).then(() => {
824
+ callback && callback();
825
+ });
826
+ }else{
827
+ callback && callback();
828
+ }
829
+ },
830
+ error: (e) => {
831
+ if(e.response.status === 404){
832
+ callback && callback();
833
+ }else{
834
+ that.$errorMsg({
835
+ content: e.message,
836
+ type: 'error',
837
+ });
838
+ }
839
+ },
840
+ });
841
+ },
842
+ openAgreeDialog(operateType) {
843
+ const done = () => {
844
+ this.handleReminderContent("submitReminder", ()=>{
845
+ this.operateType = operateType;
846
+ let that = getTarget(this);
847
+ this.agreeForm = {
848
+ opinion: this.$t2('同意', 'components.wf.defaultAgreeOption'),
849
+ nodeId: null,
850
+ };
851
+ this.agreeNodes = [];
852
+ that.$http({
853
+ url: this.current_prefix + "/wf/getNextOutgoingNodes",
854
+ data: {
855
+ stringOne: this.wfInfo.taskId,
856
+ },
857
+ method: "post",
858
+ async: false,
859
+ isLoading: true,
860
+ success: (res) => {
861
+ let nodes = res.objx || [];
862
+ /*if (tq == true) {
863
+ nodes.reverse();
864
+ }*/
865
+ if (nodes.length) {
866
+ this.agreeForm.nodeId = nodes[0].nodeId;
867
+ }
868
+ this.agreeNodes = nodes;
869
+ this.agreeDialogVisible = true;
870
+ },
871
+ });
872
+ })
873
+ }
874
+ let wfConfig = this.wfConfig;
875
+ if (wfConfig.onClickAgree) {
876
+ wfConfig.onClickAgree(done)
877
+ } else {
878
+ done();
879
+ }
880
+ },
881
+ subAgreeForm() {
882
+ let wfConfig = this.wfConfig;
883
+ let done = () => {
884
+ this.subAgreeHandle();
885
+ }
886
+ if (wfConfig.onBeforeAgree) {
887
+ wfConfig.onBeforeAgree(done)
888
+ } else {
889
+ done();
890
+ }
891
+ },
892
+
893
+ subAgreeHandle() {
894
+ let that = getTarget(this);
895
+ let nodeId = null;
896
+ if (this.agreeNodes.length) {
897
+ if (!this.agreeForm.nodeId) {
898
+ that.$message({
899
+ message: this.$t2('请选择节点', 'components.wf.agreeWarnMsg1'),
900
+ type: "error",
901
+ duration: 2 * 1000,
902
+ });
903
+ return;
904
+ }
905
+ nodeId = this.agreeForm.nodeId;
906
+ }
907
+
908
+ var procInstId = this.wfInfo.procInstId;
909
+ var taskId = this.wfInfo.taskId;
910
+ var memo = this.agreeForm.opinion || this.$t2('同意', 'components.wf.defaultAgreeOption');
911
+ var data = JSON.stringify({
912
+ taskId: taskId,
913
+ uuid: this.wfInfo.uuid,
914
+ suggestion: memo,
915
+ nodeId: nodeId,
916
+ });
917
+ this.agreeDialogVisible = false;
918
+ that.$http({
919
+ url: this.current_prefix + "/wf/submit",
920
+ data: data,
921
+ method: "post",
922
+ headers: {
923
+ "Content-Type": "application/json;charset=utf-8",
924
+ },
925
+ isLoading: true,
926
+ success: (resultMsg) => {
927
+ if (resultMsg.objx && resultMsg.objx.code == "999999") {
928
+ this.errorSubmit({
929
+ taskId: taskId,
930
+ uuid: this.wfInfo.uuid,
931
+ suggestion: memo,
932
+ errorMsg: resultMsg.objx.errorMsg
933
+ });
934
+ } else {
935
+ that.$message({
936
+ message: resultMsg.content,
937
+ type: "success",
938
+ duration: 500,
939
+ onClose: (t) => {
940
+ this.reloadContent();
941
+ this.closeWinOnCheck(1);
942
+ },
943
+ });
944
+ }
945
+ },
946
+ });
947
+ },
948
+ errorSubmit(data) {
949
+ let that = getTarget(this);
950
+ that.$http({
951
+ url: this.current_prefix + "/wf/errorSubmit",
952
+ data: data,
953
+ method: "post",
954
+ isLoading: true,
955
+ success: (resultMsg) => {
956
+ that.$message({
957
+ message: resultMsg.content,
958
+ type: "success",
959
+ duration: 500,
960
+ onClose: (t) => {
961
+ this.reloadContent();
962
+ this.closeWinOnCheck(1);
963
+ },
964
+ });
965
+ },
966
+ });
967
+ },
968
+ openChangeWfForm(operateType) {
969
+ this.operateType = operateType;
970
+ this.changeWfDialogVisible = true;
971
+ this.changeUserRows = [];
972
+ this.changeWfForm = {
973
+ userIds: [],
974
+ userNickNames: null,
975
+ opinion: null,
976
+ };
977
+ },
978
+ subChangeWfForm() {
979
+ let that = getTarget(this);
980
+ var procInstId = this.wfInfo.procInstId;
981
+ var taskId = this.wfInfo.taskId;
982
+
983
+ var userIds = this.changeWfForm.userIds || [];
984
+ var opinion = this.changeWfForm.opinion || null;
985
+
986
+ if (!userIds.length) {
987
+ that.$message({
988
+ message: this.$t2('请选择转办人', 'components.wf.transferWarnMsg1'),
989
+ type: "error",
990
+ duration: 2000,
991
+ onClose: (t) => {
992
+ },
993
+ });
994
+ return false;
995
+ }
996
+
997
+ var data = JSON.stringify({
998
+ taskId: taskId,
999
+ uuid: this.wfInfo.uuid,
1000
+ transferTo: userIds,
1001
+ suggestion: opinion,
1002
+ });
1003
+ this.changeWfDialogVisible = false;
1004
+ that.$http({
1005
+ url: this.current_prefix + "/wf/transfer",
1006
+ data: data,
1007
+ method: "post",
1008
+ headers: {
1009
+ "Content-Type": "application/json;charset=utf-8",
1010
+ },
1011
+ isLoading: true,
1012
+ success: (resultMsg) => {
1013
+ that.$message({
1014
+ message: resultMsg.content,
1015
+ type: "success",
1016
+ duration: 500,
1017
+ onClose: (t) => {
1018
+ this.reloadContent();
1019
+ this.closeWinOnCheck(4);
1020
+ },
1021
+ });
1022
+ },
1023
+ });
1024
+ },
1025
+ userConfirm(rows) {
1026
+ if (rows.length > 0) {
1027
+ let changeUserRows = this.changeUserRows;
1028
+ let ids = changeUserRows.map((changeUserRow) => changeUserRow.id);
1029
+ let addRows = rows.filter((row) => !ids.includes(row.id));
1030
+ changeUserRows.push(...addRows);
1031
+
1032
+ let row = rows[0];
1033
+ this.changeWfForm.userIds = changeUserRows.map(
1034
+ (changeUserRow) => changeUserRow.id
1035
+ );
1036
+ this.changeWfForm.userNickNames = changeUserRows
1037
+ .map((changeUserRow) => changeUserRow.nickName)
1038
+ .join(",");
1039
+ }
1040
+ },
1041
+ reloadContent() {
1042
+ let that = getTarget(this);
1043
+ oaPublishEvent(that);
1044
+ that.$baseReload();
1045
+ },
1046
+ closeWinOnCheck(flag) {
1047
+ //_closeWindowOnCheck=true, 1提交,2驳回,3中断,4转办时,5沟通 关闭窗口
1048
+ let that = getTarget(this);
1049
+ let _closeWindowOnCheck = that.$attrs._closeWindowOnCheck || that._closeWindowOnCheck;
1050
+ if (_closeWindowOnCheck === true || _closeWindowOnCheck === "true") {
1051
+ window.close && window.close();
1052
+ }
1053
+ let _handleCallback = that.$attrs._handleCallback || that._handleCallback;
1054
+ _handleCallback && _handleCallback(flag);
1055
+ },
1056
+ manualCallback() {
1057
+ this.$emit("manualCallback");
1058
+ },
1059
+ openUrgingDialog(operateType) {
1060
+ this.operateType = operateType;
1061
+ this.urgingDialogVisible = true;
1062
+ },
1063
+ openDeleteTaskUserDialog(operateType) {
1064
+ this.operateType = operateType;
1065
+ this.showDeleteTaskUserDialog = true;
1066
+ },
1067
+ openAddTaskUserDialog(operateType) {
1068
+ this.operateType = operateType;
1069
+ this.showAddTaskUserDialog = true;
1070
+ },
1071
+ openAddIncreaseSign(operateType) {
1072
+ this.operateType = operateType;
1073
+ this.addIncreaseSignUsers = [];
1074
+ this.addIncreaseSignForm = {userNickNames: null};
1075
+ this.showAddIncreaseSignDialog = true;
1076
+ },
1077
+ initWfUserParam(callback) {
1078
+ this.initTransferUserParam();//转办
1079
+ this.initAddSignUserParam();//加签
1080
+ this.initTalkUserParam();//沟通
1081
+ },
1082
+ //
1083
+ initTransferUserParam(callback) {
1084
+ //初始化转办用户参数
1085
+ let that = getTarget(this);
1086
+ return that.$http({
1087
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1088
+ method: `post`,
1089
+ data: {attributeKey: "param1"},
1090
+ isLoading: true,
1091
+ modalStrictly: true,
1092
+ success: (res) => {
1093
+ this.wfUserParamForTransfer = res.objx || {};
1094
+ callback && callback();
1095
+ },
1096
+ });
1097
+ },
1098
+ initAddSignUserParam(callback) {
1099
+ //初始化加签用户参数
1100
+ let that = getTarget(this);
1101
+ return that.$http({
1102
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1103
+ method: `post`,
1104
+ data: {attributeKey: "param2"},
1105
+ isLoading: true,
1106
+ modalStrictly: true,
1107
+ success: (res) => {
1108
+ this.wfUserParamForAddSign = res.objx || {};
1109
+ callback && callback();
1110
+ },
1111
+ });
1112
+ },
1113
+ initTalkUserParam(callback) {
1114
+ //初始化沟通用户参数
1115
+ let that = getTarget(this);
1116
+ return that.$http({
1117
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1118
+ method: `post`,
1119
+ data: {attributeKey: "param3"},
1120
+ isLoading: true,
1121
+ modalStrictly: true,
1122
+ success: (res) => {
1123
+ this.wfUserParamForTalk = res.objx || {};
1124
+ callback && callback();
1125
+ },
1126
+ });
1127
+ },
1128
+ //
1129
+ resetLinkup() {
1130
+ this.formData = {};
1131
+ this.$refs["table-linkup"].commitProxy("reload");
1132
+ },
1133
+ searchLinkup() {
1134
+ this.$refs["table-linkup"].commitProxy("reload");
1135
+ },
1136
+ initLinkup(flag) {
1137
+ let h = this.$createElement;
1138
+ let statusMap = {
1139
+ 0: this.$t2('未完成', 'components.wf.talkStatus0'),
1140
+ 1: this.$t2('已完成', 'components.wf.talkStatus1'),
1141
+ 2: this.$t2('已取消', 'components.wf.talkStatus2')
1142
+ };
1143
+ let tableOption = {
1144
+ vue: this,
1145
+ tableRef: "table-linkup",
1146
+ tableName: "wf_table-linkup",
1147
+ path: this.current_prefix + "/wf_linkup/listPage",
1148
+ param: () => {
1149
+ return {
1150
+ uuid: this.wfInfo.uuid,
1151
+ };
1152
+ },
1153
+ config: {
1154
+ height: 350
1155
+ },
1156
+ columns: [
1157
+ {type: "checkbox", width: 48, resizable: false, fixed: "left"},
1158
+ {
1159
+ title: this.$t2('任务名称', 'components.wf.taskName'),
1160
+ field: "taskName",
1161
+ width: 150,
1162
+ fixed: "left",
1163
+ },
1164
+ {
1165
+ title: this.$t2('发送人', 'components.wf.senderName'),
1166
+ field: "senderName",
1167
+ width: 150,
1168
+ slots: {
1169
+ default: "sender",
1170
+ },
1171
+ },
1172
+ {
1173
+ title: this.$t2('接收人', 'components.wf.receiverName'),
1174
+ field: "receiverName",
1175
+ width: 150,
1176
+ slots: {
1177
+ default: "receiver",
1178
+ },
1179
+ },
1180
+ {
1181
+ title: this.$t2('沟通内容', 'components.wf.talkContent'),
1182
+ field: "content",
1183
+ width: 250,
1184
+ showOverflow: false,
1185
+ slots: {
1186
+ default: ({row, rowIndex}) => {
1187
+ return row.replyId ? ("[" + this.$t2('回复', 'components.wf.reply') + "]" + row.content) : row.content;
1188
+ },
1189
+ },
1190
+ },
1191
+ {
1192
+ width: 150,
1193
+ title: this.$t2('沟通资料', 'components.wf.talkAttachment'),
1194
+ field: "attachmentImage",
1195
+ sortable: false,
1196
+ slots: {
1197
+ default: ({row, rowIndex}) => {
1198
+ let option = {
1199
+ title: this.$t2('沟通资料', 'components.wf.talkAttachment'),
1200
+ edit: false,
1201
+ rows: (done) => {
1202
+ done(row.attachmentDTOs);
1203
+ },
1204
+ };
1205
+ return [
1206
+ h("base-attachment", {
1207
+ props: {
1208
+ option: option,
1209
+ imageLazy: false
1210
+ },
1211
+ }),
1212
+ ];
1213
+ },
1214
+ },
1215
+ },
1216
+
1217
+ {
1218
+ title: this.$t2('状态', 'components.wf.status'),
1219
+ field: "status",
1220
+ width: 150,
1221
+ slots: {
1222
+ default: ({row, rowIndex}) => {
1223
+ return statusMap[row.status] || "";
1224
+ },
1225
+ },
1226
+ },
1227
+ {
1228
+ title: this.$t2('创建时间', 'system.label.createDate'),
1229
+ field: "createDate",
1230
+ width: 150,
1231
+ },
1232
+ {
1233
+ width: 80,
1234
+ fixed: "right",
1235
+ title: "",
1236
+ sortable: false,
1237
+ slots: {
1238
+ default: "operate"
1239
+ }
1240
+ },
1241
+ ],
1242
+ callback: (rows) => {
1243
+ if (rows.length && flag) {
1244
+ let row = rows[0];
1245
+ if (row.replyToSender) {
1246
+ this.$nextTick(() => {
1247
+ this.tabIndex = "2";
1248
+ this.openTalkDialog(row.sender, row.senderName, 'talk', 1, row.id)
1249
+ });
1250
+ }
1251
+ }
1252
+ }
1253
+ };
1254
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1255
+ this.linkupOption = opts;
1256
+ });
1257
+ },
1258
+ cancelTalk(row) {
1259
+ let that = getTarget(this);
1260
+ that.$baseConfirm(this.$t2('您确定要取消沟通记录吗?', 'components.wf.cancelTalkTip')).then(() => {
1261
+ that.$http({
1262
+ url: this.current_prefix + "/wf_linkup/cancel",
1263
+ data: {id: row.id},
1264
+ method: "post",
1265
+ loadingTarget: document.body,
1266
+ isLoading: true,
1267
+ success: (resultMsg) => {
1268
+ that.$message({
1269
+ message: resultMsg.content,
1270
+ type: "success",
1271
+ duration: 500,
1272
+ onClose: (t) => {
1273
+ this.reloadContent();
1274
+ },
1275
+ });
1276
+ },
1277
+ });
1278
+ });
1279
+ },
1280
+ openTalkDialog(receiver, receiverName, operateType, flag, replyId) {
1281
+ this.operateType = operateType;
1282
+ /*this.talkForm.receiver = receiver || null;
1283
+ this.talkForm.receiverName = receiverName || null;
1284
+ this.talkForm.replyId = replyId || null;
1285
+ this.talkForm.content = null;
1286
+ this.talkForm.attachmentDTOs = [];*/
1287
+ this.initTalkForm(receiver, receiverName, replyId)
1288
+ this.showTalkDialog = true;
1289
+ if (flag == 1) {
1290
+ let opeaBtnDom = this.$refs.opeaBtn;
1291
+ opeaBtnDom && opeaBtnDom.scrollIntoView();
1292
+ }
1293
+ },
1294
+ initTalkForm(receiver, receiverName, replyId) {
1295
+ this.talkForm.receiver = receiver || null;
1296
+ this.talkForm.receiverName = receiverName || null;
1297
+ this.talkForm.replyId = replyId || null;
1298
+ this.talkForm.content = null;
1299
+ this.talkForm.attachmentDTOs = [];
1300
+ },
1301
+ submitTalkForm() {
1302
+ let that = getTarget(this);
1303
+ var procInstId = this.wfInfo.procInstId;
1304
+ var taskId = this.wfInfo.taskId;
1305
+
1306
+ if (!this.talkForm.receiver) {
1307
+ that.$message({
1308
+ message: this.$t2('请选择接收人', 'components.wf.talkWarnMsg1'),
1309
+ type: "error",
1310
+ duration: 2 * 1000,
1311
+ });
1312
+ return false;
1313
+ }
1314
+ if (!this.talkForm.content) {
1315
+ that.$message({
1316
+ message: this.$t2('请输入沟通内容', 'components.wf.talkWarnMsg2'),
1317
+ type: "error",
1318
+ duration: 2 * 1000,
1319
+ });
1320
+ return false;
1321
+ }
1322
+
1323
+ var data = {
1324
+ taskId: taskId,
1325
+ uuid: this.wfInfo.uuid,
1326
+ receiver: this.talkForm.receiver,
1327
+ receiverName: this.talkForm.receiverName,
1328
+ replyId: this.talkForm.replyId,
1329
+ content: this.talkForm.content,
1330
+ attachmentDTOs: this.talkForm.attachmentDTOs,
1331
+ notifyType: "wfLinkup",
1332
+ };
1333
+ this.showTalkDialog = false;
1334
+ that.$http({
1335
+ url: this.current_prefix + "/wf_linkup/save",
1336
+ data: data,
1337
+ method: "post",
1338
+ isLoading: true,
1339
+ success: (resultMsg) => {
1340
+ that.$message({
1341
+ message: resultMsg.content,
1342
+ type: "success",
1343
+ duration: 500,
1344
+ onClose: (t) => {
1345
+ this.reloadContent();
1346
+ this.closeWinOnCheck(5);
1347
+ },
1348
+ });
1349
+ },
1350
+ });
1351
+ },
1352
+ openTalkUserDialog() {
1353
+ this.showTalkUserDialog = true;
1354
+ },
1355
+ confirmTalkUserDialog(rows) {
1356
+ if (rows.length > 0) {
1357
+ let row = rows[0];
1358
+ if (this.talkForm.receiver != row.id) {
1359
+ this.talkForm.replyId = null;
1360
+ }
1361
+ this.talkForm.receiver = row.id;
1362
+ this.talkForm.receiverName = row.nickName;
1363
+ }
1364
+ },
1365
+ confirmUrging() {
1366
+ this.reloadContent();
1367
+ },
1368
+ confirmDeleteTaskUser() {
1369
+ this.reloadContent();
1370
+ },
1371
+ confirmAddTaskUser(rows) {
1372
+ this.addIncreaseSignUsers = rows;
1373
+ this.addIncreaseSignForm.userNickNames = rows.map(row => row.nickName).join(',');
1374
+ // this.reloadContent();
1375
+ },
1376
+ submitAddTaskUserForm(flag) {
1377
+ let that = getTarget(this);
1378
+ let userIds = this.addIncreaseSignUsers.map((checkRow) => checkRow.id);
1379
+ if (userIds.length == 0) {
1380
+ that.$message({
1381
+ message: this.$t2('请选择候选人', 'components.wf.addIncreaseSignWarnMsg1'),
1382
+ type: "error",
1383
+ duration: 2000,
1384
+ onClose: (t) => {
1385
+ },
1386
+ });
1387
+ return false;
1388
+ }
1389
+ let toDo = () => {
1390
+ var data = JSON.stringify({
1391
+ uuid: this.wfInfo.uuid,
1392
+ taskId: this.wfInfo.taskId,
1393
+ userIds: userIds,
1394
+ suggestion: this.addIncreaseSignForm.opinion
1395
+
1396
+ });
1397
+ this.agreeDialogVisible = false;
1398
+ that.$http({
1399
+ url: this.current_prefix + "/wf/addIncreaseSign",
1400
+ data: data,
1401
+ method: "post",
1402
+ loadingTarget: document.body,
1403
+ headers: {
1404
+ "Content-Type": "application/json;charset=utf-8",
1405
+ },
1406
+ isLoading: true,
1407
+ success: (resultMsg) => {
1408
+ this.showAddIncreaseSignDialog = false
1409
+ that.$message({
1410
+ message: resultMsg.content,
1411
+ type: "success",
1412
+ duration: 500,
1413
+ onClose: (t) => {
1414
+ this.reloadContent();
1415
+ },
1416
+ });
1417
+ },
1418
+ });
1419
+ }
1420
+ if (flag === 0) {
1421
+ toDo();
1422
+ } else {
1423
+ that.$baseConfirm(this.$t2('您确定要加签吗?', 'components.wf.addIncreaseSignConfirmTip')).then(() => {
1424
+ toDo();
1425
+ });
1426
+ }
1427
+ },
1428
+ openSetCandidateDialog(operateType) {
1429
+ this.operateType = operateType;
1430
+ this.showSetCandidateDialog = true;
1431
+ },
1432
+ closeSetCandidateDialog() {
1433
+ this.showSetCandidateDialog = false;
1434
+ this.reloadContent();
1435
+ },
1436
+ openRevokeDialog(operateType) {
1437
+ this.operateType = operateType;
1438
+ this.revokeForm = {opinion: null}
1439
+ this.revokeDialogVisible = true;
1440
+ },
1441
+ subRevokeForm(flag) {
1442
+ //撤回
1443
+ let that = getTarget(this);
1444
+ let toDo = () => {
1445
+ var data = JSON.stringify({
1446
+ uuid: this.wfInfo.uuid,
1447
+ taskId: this.wfInfo.taskId,
1448
+ suggestion: this.revokeForm.opinion,
1449
+ });
1450
+ this.revokeDialogVisible = false;
1451
+ that.$http({
1452
+ url: this.current_prefix + "/wf/revoke",
1453
+ data: data,
1454
+ method: "post",
1455
+ loadingTarget: document.body,
1456
+ headers: {
1457
+ "Content-Type": "application/json;charset=utf-8",
1458
+ },
1459
+ isLoading: true,
1460
+ success: (resultMsg) => {
1461
+ that.$message({
1462
+ message: resultMsg.content,
1463
+ type: "success",
1464
+ duration: 500,
1465
+ onClose: (t) => {
1466
+ this.reloadContent();
1467
+ },
1468
+ });
1469
+ },
1470
+ });
1471
+ }
1472
+ if (flag === 0) {
1473
+ toDo();
1474
+ } else {
1475
+ that.$baseConfirm(this.$t2('您确定要撤回吗?', 'components.wf.revokeConfirmTip')).then(() => {
1476
+ toDo();
1477
+ });
1478
+ }
1479
+ },
1480
+ initShowTaskInfo(callback) {
1481
+ //初始化转办用户参数
1482
+ let that = getTarget(this);
1483
+ return that.$http({
1484
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1485
+ method: `post`,
1486
+ data: {attributeKey: "param9"},
1487
+ isLoading: true,
1488
+ modalStrictly: true,
1489
+ success: (res) => {
1490
+ this.showWfInfoTab = res.objx !== 1;
1491
+ callback && callback();
1492
+ },
1493
+ });
1494
+ },
1495
+ getIsShowWfMemo(){
1496
+ let that = getTarget(this);
1497
+ that.$http({
1498
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1499
+ method: `post`,
1500
+ data: {attributeKey: "param10"},
1501
+ isLoading: true,
1502
+ success: (res) => {
1503
+ this.showWfMemo = res?.objx === true;
1504
+ if(this.showWfMemo){
1505
+ this.$nextTick(()=>{
1506
+ this.initWfMemo();
1507
+ })
1508
+ }
1509
+ },
1510
+ });
1511
+ },
1512
+
1513
+ initWfMemo() {
1514
+ this.wfMemoSearchEvent();
1515
+ /* let h = this.$createElement;
1516
+ let tableOption = {
1517
+ vue: this,
1518
+ tableRef: "table-wfMemo",
1519
+ tableName: "wf_table-wfMemo",
1520
+ path: this.current_prefix + "/wf_memo/listPage",
1521
+ param: () => {
1522
+ return {
1523
+ uuid: this.wfInfo.uuid,
1524
+ };
1525
+ },
1526
+ config: {
1527
+ height: 350
1528
+ },
1529
+ columns: [
1530
+ {type: "checkbox", width: 48, resizable: false, fixed: "left"},
1531
+ {
1532
+ title: this.$t1('操作人'),
1533
+ field: "operatorName",
1534
+ width: 150,
1535
+ fixed: "left",
1536
+ },
1537
+ {
1538
+ title: this.$t1('内容'),
1539
+ field: "content",
1540
+ width: 250,
1541
+ showOverflow: false
1542
+ },
1543
+ {
1544
+ width: 150,
1545
+ title: this.$t1('附件'),
1546
+ field: "attachmentImage",
1547
+ sortable: false,
1548
+ slots: {
1549
+ default: ({row, rowIndex}) => {
1550
+ let option = {
1551
+ title: this.$t1('附件'),
1552
+ edit: false,
1553
+ rows: (done) => {
1554
+ done(row.attachmentDTOs);
1555
+ },
1556
+ };
1557
+ return [
1558
+ h("base-attachment", {
1559
+ props: {
1560
+ option: option,
1561
+ imageLazy: false
1562
+ },
1563
+ }),
1564
+ ];
1565
+ },
1566
+ },
1567
+ },
1568
+ {
1569
+ title: this.$t2('创建时间', 'system.label.createDate'),
1570
+ field: "createDate",
1571
+ width: 150,
1572
+ },
1573
+ {
1574
+ width: 80,
1575
+ fixed: "right",
1576
+ title: "",
1577
+ sortable: false
1578
+ },
1579
+ ]
1580
+ };
1581
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1582
+ this.wfMemoOption = opts;
1583
+ }); */
1584
+ },
1585
+ wfMemoSearchEvent(){
1586
+ // this.$refs['table-wfMemo'].commitProxy('reload');
1587
+ let that = getTarget(this);
1588
+ that.$http({
1589
+ url: this.current_prefix + "/wf_memo/listPage",
1590
+ method: `post`,
1591
+ data: {
1592
+ uuid: this.wfInfo.uuid,
1593
+ },
1594
+ isLoading: true,
1595
+ success: (res) => {
1596
+ let rows = res?.objx?.records || [];
1597
+ this.wfMemoData = rows;
1598
+ },
1599
+ });
1600
+ },
1601
+ openWfMemoDialog(row) {
1602
+ if(row){
1603
+ this.wfMemoForm = this.$baseLodash.cloneDeep(row);
1604
+ }else{
1605
+ this.wfMemoForm = {
1606
+ uuid: this.wfInfo.uuid,
1607
+ content:null,
1608
+ attachmentDTOs: []
1609
+ }
1610
+ }
1611
+ this.showWfMemoDialog = true;
1612
+ },
1613
+ submitWfMemoForm() {
1614
+ let that = getTarget(this);
1615
+
1616
+ if (!this.wfMemoForm.content) {
1617
+ that.$message({
1618
+ message: this.$t1('请输入内容'),
1619
+ type: "error",
1620
+ duration: 2 * 1000,
1621
+ });
1622
+ return false;
1623
+ }
1624
+
1625
+ this.showWfMemoDialog = false;
1626
+ that.$http({
1627
+ url: this.current_prefix + "/wf_memo/save",
1628
+ data: this.wfMemoForm,
1629
+ method: "post",
1630
+ isLoading: true,
1631
+ success: (resultMsg) => {
1632
+ that.$message({
1633
+ message: resultMsg.content,
1634
+ type: "success"
1635
+ });
1636
+ this.wfMemoSearchEvent();
1637
+ },
1638
+ });
1639
+ },
1640
+ }
1641
+ };
1642
+
1643
+ wfStartMixin = {
1644
+ name: "wfStartDialog",
1645
+ props: {
1646
+ dataId: [String, Number],
1647
+ code: [String, Number],
1648
+ serviceId: String,
1649
+ startParam: Object,
1650
+ visible: Boolean,
1651
+ parentVue: Object,
1652
+ wfName: String,
1653
+ formCode: String,
1654
+ option: Object
1655
+ },
1656
+ data() {
1657
+ return {
1658
+ showDialog: false,
1659
+ wfStartForm: {},
1660
+ wfDefItems: [],
1661
+
1662
+ startFormData:{},
1663
+ wfUserRangeEnabled: false,
1664
+ preStartResult:[],
1665
+ showSetCandidateDialog2:false,
1666
+ wfSubmitted: false
1667
+ };
1668
+ },
1669
+ computed: {
1670
+ current_prefix() {
1671
+ return this.serviceId ? "/" + this.serviceId : "";
1672
+ },
1673
+ },
1674
+ mounted() {
1675
+ this.initWfInfo(this.code);
1676
+ // this.showDialog = true;
1677
+ },
1678
+ methods: {
1679
+ preStart(){
1680
+ let that = getTarget(this);
1681
+ return new Promise(resolve=>{
1682
+ return that.$http({
1683
+ url: this.current_prefix + "/wf/preStart",
1684
+ method: `post`,
1685
+ data: this.startFormData,
1686
+ success: (res) => {
1687
+ resolve(res.objx);
1688
+ },
1689
+ });
1690
+ })
1691
+ },
1692
+ initWfUserRangeParam(){
1693
+ let that = getTarget(this);
1694
+ return that.$http({
1695
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1696
+ method: `post`,
1697
+ data: {attributeKey: "param12"},
1698
+ success: (res) => {
1699
+ this.wfUserRangeEnabled = res?.objx === true;
1700
+ },
1701
+ });
1702
+ },
1703
+ openSetCandidateDialog(){
1704
+ this.showSetCandidateDialog2 = true;
1705
+ },
1706
+ confirmSetCandidateDialog(rows){
1707
+ let formData = {
1708
+ ...this.startFormData,
1709
+ wfNodeDTOs: rows
1710
+ }
1711
+ this.startSubmitHanlde(formData);
1712
+ },
1713
+ async initWfInfo(code) {
1714
+ let that = getTarget(this);
1715
+ var wfDefItems = null;
1716
+ var objId = this.dataId;
1717
+
1718
+ await this.initWfUserRangeParam();
1719
+ await that.$http({
1720
+ url: this.current_prefix + "/wf_obj_config_item/list",
1721
+ data: {
1722
+ objTypeCode: code,
1723
+ enabled: true,
1724
+ objId: objId
1725
+ },
1726
+ method: "post",
1727
+ //contentType: 'application/json;charset=utf-8',
1728
+ async: false,
1729
+ isLoading: true,
1730
+ error: (error) => {
1731
+ this.close();
1732
+ },
1733
+ success: (resultMsg) => {
1734
+ wfDefItems = resultMsg.objx || [];
1735
+ },
1736
+ });
1737
+
1738
+ if (!wfDefItems || wfDefItems.length == 0) {
1739
+ that.$baseAlert(this.$t2('无法启动,没有流程单据', 'components.wf.startWarnMsg1'));
1740
+ this.close();
1741
+ return false;
1742
+ }
1743
+
1744
+ (this.wfStartForm = {
1745
+ wfCode: code,
1746
+ }),
1747
+ (this.wfDefItems = wfDefItems);
1748
+ this.$set(this.wfStartForm, "modelId", wfDefItems[0].modelId);
1749
+ if (wfDefItems.length == 1) {
1750
+ if (
1751
+ settingConfig.withoutConfrimByOneWf === true ||
1752
+ (this.option && this.option.skipStartConfirm)
1753
+ ) {
1754
+ this.startSubmit();
1755
+ } else {
1756
+ let customStartTip = this.option && this.option.startConfirmText;
1757
+ if (typeof customStartTip === "function") {
1758
+ customStartTip = await customStartTip.call(
1759
+ this.parentVue || this,
1760
+ {
1761
+ objId: this.dataId,
1762
+ wfCode: this.code,
1763
+ formCode: this.formCode,
1764
+ startParam: this.startParam,
1765
+ }
1766
+ );
1767
+ }
1768
+ let wfStartOperateName =
1769
+ settingConfig.wfStartOperateName ||
1770
+ settingConfig.wfStartButtonName ||
1771
+ "启动流程";
1772
+ let defaultStartTip = "您确定要" + wfStartOperateName + "吗?";
1773
+ let startTip;
1774
+ if (typeof customStartTip === "string" && customStartTip.trim()) {
1775
+ startTip = customStartTip;
1776
+ } else {
1777
+ startTip = this.$t2(defaultStartTip, 'components.wf.startTip');
1778
+ }
1779
+ that
1780
+ .$baseConfirm(startTip)
1781
+ .then(() => {
1782
+ this.startSubmit();
1783
+ });
1784
+ }
1785
+ } else {
1786
+ this.showDialog = true;
1787
+ }
1788
+ },
1789
+ startSubmit() {
1790
+ var modelId = this.wfStartForm.modelId;
1791
+ if (!modelId) {
1792
+ that.$baseAlert(this.$t2('请选择流程模版', 'components.wf.startWarnMsg2'));
1793
+ return false;
1794
+ }
1795
+ let option = this.option;
1796
+ if (option.onBeforeStartSubmit) {
1797
+ option.onBeforeStartSubmit(() => {
1798
+ this.subWfStartForm();
1799
+ })
1800
+ } else {
1801
+ this.subWfStartForm();
1802
+ }
1803
+ },
1804
+ async subWfStartForm() {
1805
+ let that = getTarget(this);
1806
+ var modelId = this.wfStartForm.modelId;
1807
+ if (!modelId) {
1808
+ that.$baseAlert(this.$t2('请选择流程模版', 'components.wf.startWarnMsg2'));
1809
+ return false;
1810
+ }
1811
+
1812
+ let option = this.option;
1813
+
1814
+ var objId = this.dataId;
1815
+
1816
+ let startParam = this.startParam || {};
1817
+ let formCode = this.formCode || null;
1818
+
1819
+ var data = {
1820
+ modelId: modelId,
1821
+ objTypeCode: this.code,
1822
+ objId: objId,
1823
+ formData: startParam,
1824
+ formCode: formCode
1825
+ // name:this.wfName
1826
+ };
1827
+ this.startFormData = data;
1828
+
1829
+ if(this.wfUserRangeEnabled){
1830
+ this.preStartResult = await this.preStart() || []
1831
+ if(this.preStartResult.length){
1832
+ this.openSetCandidateDialog()
1833
+ return
1834
+ }
1835
+ }
1836
+ this.startSubmitHanlde(this.startFormData);
1837
+
1838
+ },
1839
+ startSubmitHanlde(formData){
1840
+ this.wfSubmitted = true; // 标记已进入提交,避免随后关闭弹框误判为「取消」
1841
+ this.showDialog = false;
1842
+ let that = getTarget(this);
1843
+ let option = this.option;
1844
+ that.$http({
1845
+ url: this.current_prefix + "/wf/start",
1846
+ data: formData,
1847
+ method: "post",
1848
+ /* headers: {
1849
+ "Content-Type": "application/json;charset=utf-8",
1850
+ }, */
1851
+ isLoading: true,
1852
+ callback: (resultMsg) => {
1853
+ if (resultMsg.type == "success") {
1854
+ that.$message({
1855
+ message: resultMsg.content,
1856
+ type: "success",
1857
+ duration: 500,
1858
+ onClose: (t) => {
1859
+ if (!option.onStartSuccess) {
1860
+ that.$baseReload();
1861
+ } else {
1862
+ option.onStartSuccess();
1863
+ }
1864
+ if (resultMsg.objx) {
1865
+ that.$baseAlert(resultMsg.objx)
1866
+ }
1867
+ },
1868
+ });
1869
+ } else {
1870
+ option.onStartFail && option.onStartFail()
1871
+ }
1872
+
1873
+ }
1874
+ });
1875
+ },
1876
+ handleWfCancel() {
1877
+ // 未进入提交就关闭 = 取消启动,回调通用 onCancel(一次性,避免多个弹框关闭重复触发)
1878
+ if (this.wfSubmitted) return;
1879
+ this.wfSubmitted = true;
1880
+ this.option && this.option.onCancel && this.option.onCancel();
1881
+ },
1882
+ close() {
1883
+ this.handleWfCancel();
1884
+ this.$emit("update:visible", false);
1885
+ },
1886
+ },
1887
+ watch: {
1888
+ showSetCandidateDialog2(val, oldVal) {
1889
+ // 候选人弹框未提交就关闭 = 取消启动
1890
+ if (oldVal && !val) this.handleWfCancel();
1891
+ },
1892
+ },
1893
+ };
1894
+
1895
+ wfModifyMixin = {
1896
+ name: "wfModifyMixin",
1897
+ props: {
1898
+ dataId: [String, Number],
1899
+ code: [String, Number],
1900
+ visible: Boolean,
1901
+ paramData: Object,
1902
+ parentVue: Object,
1903
+ wfInfo: Object,
1904
+ title: String
1905
+ },
1906
+ data() {
1907
+ return {
1908
+ showModifyDialog: false,
1909
+ showBillEdit: false,
1910
+ content: "",
1911
+ };
1912
+ },
1913
+ async mounted() {
1914
+ this.openWfModifyDialog(this.code);
1915
+ },
1916
+ methods: {
1917
+ openWfModifyDialog() {
1918
+ let row = this.paramData;
1919
+ let url = row.url + ".vue";
1920
+ this.showModifyDialog = true;
1921
+ this.content = configUtil.requireView(url);
1922
+ this.$openEditView("showBillEdit");
1923
+ },
1924
+ modfyDialogClose() {
1925
+ this.showBillEdit = false;
1926
+ this.content = null;
1927
+ },
1928
+ refreshEdit() {
1929
+ this.showModifyDialog = false;
1930
+ this.parentVue.$baseReload()
1931
+ }
1932
+ },
1933
+ };
1934
+
1935
+ wfUrgingMixin = {
1936
+ props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
1937
+ mixins: [selectDialogMixins],
1938
+ created() {
1939
+ this.initSetting();
1940
+ },
1941
+ mounted() {
1942
+ this.initTableM1();
1943
+ },
1944
+ data() {
1945
+ return {
1946
+ showDialog: true,
1947
+ selectMulti: true,
1948
+ vxeOption: {},
1949
+ };
1950
+ },
1951
+ methods: {
1952
+ initTableM1() {
1953
+ var that = this;
1954
+ let tableOption = {
1955
+ vue: that,
1956
+ tableRef: "table-m1",
1957
+ tableName: "wf_urgingDialog-m1",
1958
+ path: this.current_prefix + "/wf/getTaskCandidates",
1959
+ param: () => {
1960
+ return {stringOne: this.wfInfo.uuid};
1961
+ },
1962
+ config: {
1963
+ checkboxConfig: {
1964
+ checkStrictly: true,
1965
+ showHeader: this.selectMulti,
1966
+ trigger: "row",
1967
+ },
1968
+ proxyConfig: {
1969
+ props: {
1970
+ result: "objx", // 配置响应结果列表字段
1971
+ total: "objx.length", // 配置响应结果总页数字段
1972
+ },
1973
+ },
1974
+ },
1975
+ columns: [
1976
+ {type: "checkbox", width: 50, resizable: false, fixed: "left"},
1977
+ {title: this.$t2('催办人', 'components.wf.urgingUser'), field: "name", width: 250, fixed: "left"},
1978
+ {title: this.$t2('催办人ID', 'components.wf.urgingUserId'), field: "id", width: 150},
1979
+ {
1980
+ width: 47,
1981
+ fixed: "right",
1982
+ title: "",
1983
+ sortable: false,
1984
+ },
1985
+ ],
1986
+ };
1987
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1988
+ that.vxeOption = opts;
1989
+ });
1990
+ },
1991
+ dialogConfirm() {
1992
+ this.dialogPrimary();
1993
+ this.$emit("confirm");
1994
+ },
1995
+ subUrgingForm() {
1996
+ let that = this;
1997
+ let urgingUserIds = this.checkRows.map((checkRow) => checkRow.id);
1998
+ if (urgingUserIds.length == 0) {
1999
+ that.$message({
2000
+ message: this.$t2('请选择催办人', 'components.wf.urgingWarnMsg1'),
2001
+ type: "error",
2002
+ duration: 2000,
2003
+ onClose: (t) => {
2004
+ },
2005
+ });
2006
+ return false;
2007
+ }
2008
+ that.$baseConfirm(this.$t2('您确定要催办吗?', 'components.wf.urgingConfirmTip')).then(() => {
2009
+ var data = JSON.stringify({
2010
+ uuid: this.wfInfo.uuid,
2011
+ taskId: this.wfInfo.taskId,
2012
+ notifyType: "wfUrging",
2013
+ userIds: urgingUserIds,
2014
+ });
2015
+ this.agreeDialogVisible = false;
2016
+ that.$http({
2017
+ url: this.current_prefix + "/wf/urging",
2018
+ data: data,
2019
+ method: "post",
2020
+ loadingTarget: document.body,
2021
+ headers: {
2022
+ "Content-Type": "application/json;charset=utf-8",
2023
+ },
2024
+ isLoading: true,
2025
+ success: (resultMsg) => {
2026
+ that.$message({
2027
+ message: resultMsg.content,
2028
+ type: "success",
2029
+ duration: 500,
2030
+ onClose: (t) => {
2031
+ // this.reloadContent();
2032
+ this.dialogConfirm();
2033
+ },
2034
+ });
2035
+ },
2036
+ });
2037
+ });
2038
+ },
2039
+ },
2040
+ };
2041
+
2042
+ deleteTaskUserMixin = {
2043
+ props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
2044
+ mixins: [selectDialogMixins],
2045
+ created() {
2046
+ this.initSetting();
2047
+ },
2048
+ mounted() {
2049
+ this.initTableM1();
2050
+ },
2051
+ data() {
2052
+ return {
2053
+ showDialog: true,
2054
+ selectMulti: true,
2055
+ vxeOption: {},
2056
+ };
2057
+ },
2058
+ methods: {
2059
+ initTableM1() {
2060
+ var that = this;
2061
+ let tableOption = {
2062
+ vue: that,
2063
+ tableRef: "table-m1",
2064
+ tableName: "wf_deleteTaskUserDialog-m1",
2065
+ path: this.current_prefix + "/wf/getIncreaseSign",
2066
+ param: () => {
2067
+ return {
2068
+ uuid: this.wfInfo.uuid,
2069
+ taskId: this.wfInfo.taskId,
2070
+ };
2071
+ },
2072
+ config: {
2073
+ checkboxConfig: {
2074
+ checkStrictly: true,
2075
+ showHeader: this.selectMulti,
2076
+ trigger: "row",
2077
+ },
2078
+ proxyConfig: {
2079
+ props: {
2080
+ result: "objx", // 配置响应结果列表字段
2081
+ total: "objx.length", // 配置响应结果总页数字段
2082
+ },
2083
+ },
2084
+ },
2085
+ columns: [
2086
+ {type: "checkbox", width: 50, resizable: false, fixed: "left"},
2087
+ {title: this.$t2('候选人', 'components.wf.candidate'), field: "name", width: 250, fixed: "left"},
2088
+ {title: this.$t2('候选人ID', 'components.wf.candidateId'), field: "id", width: 150},
2089
+ {
2090
+ width: 47,
2091
+ fixed: "right",
2092
+ title: "",
2093
+ sortable: false,
2094
+ },
2095
+ ],
2096
+ };
2097
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
2098
+ that.vxeOption = opts;
2099
+ });
2100
+ },
2101
+ dialogConfirm() {
2102
+ this.dialogPrimary();
2103
+ // this.$emit("confirm");
2104
+ },
2105
+ subForm() {
2106
+ let that = this;
2107
+ let userIds = this.checkRows.map((checkRow) => checkRow.id);
2108
+ if (userIds.length == 0) {
2109
+ that.$message({
2110
+ message: this.$t2('请选择候选人', 'components.wf.deleteIncreaseSignWarnMsg1'),
2111
+ type: "error",
2112
+ duration: 2000,
2113
+ onClose: (t) => {
2114
+ },
2115
+ });
2116
+ return false;
2117
+ }
2118
+ that.$baseConfirm(this.$t2('您确定要减签选中的候选人吗?', 'components.wf.deleteIncreaseSignTip')).then(() => {
2119
+ var data = JSON.stringify({
2120
+ uuid: this.wfInfo.uuid,
2121
+ taskId: this.wfInfo.taskId,
2122
+ userIds: userIds,
2123
+ });
2124
+ this.agreeDialogVisible = false;
2125
+ that.$http({
2126
+ url: this.current_prefix + "/wf/deleteIncreaseSign",
2127
+ data: data,
2128
+ method: "post",
2129
+ loadingTarget: document.body,
2130
+ headers: {
2131
+ "Content-Type": "application/json;charset=utf-8",
2132
+ },
2133
+ isLoading: true,
2134
+ success: (resultMsg) => {
2135
+ that.$message({
2136
+ message: resultMsg.content,
2137
+ type: "success",
2138
+ duration: 500,
2139
+ onClose: (t) => {
2140
+ this.dialogConfirm();
2141
+ },
2142
+ });
2143
+ },
2144
+ });
2145
+ });
2146
+ },
2147
+ },
2148
+ };
2149
+
2150
+ addTaskUserMixin = {
2151
+ props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
2152
+ mixins: [selectDialogMixins],
2153
+ data() {
2154
+ return {
2155
+ showDialog: true,
2156
+ selectMulti: true,
2157
+ vxeOption: {},
2158
+ };
2159
+ },
2160
+ created() {
2161
+ this.initSetting();
2162
+ },
2163
+ mounted() {
2164
+ this.initTableM1();
2165
+ },
2166
+ methods: {
2167
+ dialogConfirm() {
2168
+ this.dialogPrimary();
2169
+ // this.$emit('confirm');
2170
+ },
2171
+ subForm() {
2172
+ let that = this;
2173
+ let userIds = this.checkRows.map((checkRow) => checkRow.id);
2174
+ if (userIds.length == 0) {
2175
+ that.$message({
2176
+ message: this.$t2('请选择候选人', 'components.wf.addIncreaseSignWarnMsg1'),
2177
+ type: "error",
2178
+ duration: 2000,
2179
+ onClose: (t) => {
2180
+ },
2181
+ });
2182
+ return false;
2183
+ }
2184
+ that.$baseConfirm(this.$t2('您确定要加签选中的候选人吗?', 'components.wf.addIncreaseSignConfirmTip2')).then(() => {
2185
+ var data = JSON.stringify({
2186
+ uuid: this.wfInfo.uuid,
2187
+ taskId: this.wfInfo.taskId,
2188
+ userIds: userIds,
2189
+ });
2190
+ this.agreeDialogVisible = false;
2191
+ that.$http({
2192
+ url: this.current_prefix + "/wf/addIncreaseSign",
2193
+ data: data,
2194
+ method: "post",
2195
+ loadingTarget: document.body,
2196
+ headers: {
2197
+ "Content-Type": "application/json;charset=utf-8",
2198
+ },
2199
+ isLoading: true,
2200
+ success: (resultMsg) => {
2201
+ that.$message({
2202
+ message: resultMsg.content,
2203
+ type: "success",
2204
+ duration: 500,
2205
+ onClose: (t) => {
2206
+ this.dialogConfirm();
2207
+ },
2208
+ });
2209
+ },
2210
+ });
2211
+ });
2212
+ },
2213
+ },
2214
+ };
2215
+
2216
+ export {
2217
+ wfIndexMixin,
2218
+ wfStartMixin,
2219
+ wfContentMixin,
2220
+ wfModifyMixin,
2221
+ wfUrgingMixin,
2222
+ deleteTaskUserMixin,
2223
+ addTaskUserMixin,
2224
+ };