cloud-web-corejs-haier 1.0.43 → 1.0.45

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