@ebiz/designer-components 0.1.124 → 0.1.125
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.
- package/README.md +29 -29
- package/dist/designer-components.css +1 -1
- package/dist/index.mjs +35847 -33799
- package/dist/{pdf-C9oIcL2N.js → pdf-KomaE0u5.js} +891 -891
- package/package.json +1 -1
- package/src/App.vue +26 -26
- package/src/apiService/SIMPLE_DATA_SERVICE.md +284 -284
- package/src/apiService/mockDataService.js +115 -115
- package/src/apiService/simpleDataService.js +312 -312
- package/src/assets/base.css +86 -86
- package/src/assets/logo.svg +1 -1
- package/src/components/Button.vue +149 -149
- package/src/components/DataContainer.vue +40 -40
- package/src/components/EbizApproval.vue +366 -366
- package/src/components/EbizApprovalDetail.vue +169 -169
- package/src/components/EbizApprovalForm.vue +534 -534
- package/src/components/EbizApprovalV2.vue +713 -713
- package/src/components/EbizAutoForm.vue +596 -596
- package/src/components/EbizAvatar.vue +115 -115
- package/src/components/EbizCheckbox.vue +93 -93
- package/src/components/EbizCheckboxGroup.vue +69 -69
- package/src/components/EbizDepartmentSelector.vue +148 -148
- package/src/components/EbizDescriptions.vue +340 -340
- package/src/components/EbizDescriptionsItem.vue +47 -47
- package/src/components/EbizDetailBlock.vue +81 -81
- package/src/components/EbizDetailItem.vue +559 -559
- package/src/components/EbizDetailView.md +438 -438
- package/src/components/EbizDetailView.vue +355 -355
- package/src/components/EbizDialog.vue +260 -260
- package/src/components/EbizDictionarySelect.vue +229 -229
- package/src/components/EbizDiv.vue +40 -40
- package/src/components/EbizDivider.vue +96 -96
- package/src/components/EbizDormDashboard.vue +314 -314
- package/src/components/EbizDropdown.vue +135 -135
- package/src/components/EbizDropdownItem.vue +85 -85
- package/src/components/EbizEmployeeInfo.vue +144 -144
- package/src/components/EbizEmployeeSelector.vue +1160 -1160
- package/src/components/EbizFileList.vue +502 -502
- package/src/components/EbizMap.vue +541 -541
- package/src/components/EbizMeetingRoomSelector.vue +1149 -1149
- package/src/components/EbizMobileMeetingRoomSelector.vue +727 -727
- package/src/components/EbizOkrTree.vue +99 -99
- package/src/components/EbizPageHeader.vue +98 -98
- package/src/components/EbizPagination.vue +162 -162
- package/src/components/EbizParkingDashboard.vue +152 -152
- package/src/components/EbizPdfViewer.vue +540 -540
- package/src/components/EbizPopconfirm.vue +47 -47
- package/src/components/EbizQrCode.vue +167 -167
- package/src/components/EbizRadio.vue +86 -86
- package/src/components/EbizRadioGroup.vue +83 -83
- package/src/components/EbizRemoteSelect.vue +232 -232
- package/src/components/EbizRichTextEditor.vue +338 -338
- package/src/components/EbizRouteBreadcrumb.vue +46 -46
- package/src/components/EbizSApprovalProcess.vue +1456 -1426
- package/src/components/EbizSelect.vue +85 -85
- package/src/components/EbizSpace.vue +100 -100
- package/src/components/EbizStatistic.vue +149 -149
- package/src/components/EbizStatsCard.vue +113 -113
- package/src/components/EbizSwiper.vue +113 -113
- package/src/components/EbizSwiperItem.vue +13 -13
- package/src/components/EbizSwitch.vue +85 -85
- package/src/components/EbizTabHeader.vue +132 -132
- package/src/components/EbizTabPanel.vue +22 -22
- package/src/components/EbizTable.vue +469 -469
- package/src/components/EbizTableColumn.vue +116 -116
- package/src/components/EbizTableSort.vue +179 -179
- package/src/components/EbizTabs.vue +142 -142
- package/src/components/EbizTdesignButtonDialog.vue +332 -332
- package/src/components/EbizTdesignLoading.vue +107 -107
- package/src/components/EbizTimePicker.vue +143 -143
- package/src/components/EbizTitle.vue +91 -91
- package/src/components/EbizTree.vue +141 -141
- package/src/components/EbizTreeMergeTable.vue +1494 -1494
- package/src/components/EbizTreeSelector.vue +469 -469
- package/src/components/EbizVideo.vue +553 -553
- package/src/components/EbizVxeTable.vue +290 -290
- package/src/components/Form.vue +28 -28
- package/src/components/Home.vue +7 -7
- package/src/components/LaunchInterview.vue +526 -526
- package/src/components/MyComponent.vue +39 -39
- package/src/components/Table.vue +45 -45
- package/src/components/TdesignAlert.vue +115 -115
- package/src/components/TdesignButton.vue +135 -135
- package/src/components/TdesignCalendar/index.vue +145 -145
- package/src/components/TdesignCard.vue +195 -195
- package/src/components/TdesignCol.vue +101 -101
- package/src/components/TdesignCollapse.vue +142 -142
- package/src/components/TdesignCollapsePanel.vue +79 -79
- package/src/components/TdesignDatePicker.vue +124 -124
- package/src/components/TdesignDescriptions.vue +74 -74
- package/src/components/TdesignDescriptionsItem.vue +50 -50
- package/src/components/TdesignDialog.vue +225 -225
- package/src/components/TdesignForm.vue +138 -138
- package/src/components/TdesignFormItem.vue +105 -105
- package/src/components/TdesignGrid.vue +55 -55
- package/src/components/TdesignIcon.vue +67 -67
- package/src/components/TdesignImage.vue +162 -162
- package/src/components/TdesignImageViewer.vue +200 -200
- package/src/components/TdesignInput.vue +242 -242
- package/src/components/TdesignSelect.vue +446 -446
- package/src/components/TdesignTag.vue +117 -117
- package/src/components/TdesignTextarea.vue +142 -142
- package/src/components/TdesignTimeline.vue +58 -58
- package/src/components/TdesignTimelineItem.vue +71 -71
- package/src/components/TdesignUpload.vue +414 -414
- package/src/components/TdesignWatermark.vue +107 -107
- package/src/components/ebiz-form/components/cascader.vue +61 -61
- package/src/components/ebiz-form/components/checkbox.vue +37 -37
- package/src/components/ebiz-form/components/city.vue +137 -137
- package/src/components/ebiz-form/components/date-panel.vue +52 -52
- package/src/components/ebiz-form/components/date-range-panel.vue +52 -52
- package/src/components/ebiz-form/components/date-range.vue +56 -56
- package/src/components/ebiz-form/components/date.vue +52 -52
- package/src/components/ebiz-form/components/editor-multi-language.vue +47 -47
- package/src/components/ebiz-form/components/editor.vue +78 -78
- package/src/components/ebiz-form/components/file-multi-language.vue +52 -52
- package/src/components/ebiz-form/components/file.vue +149 -149
- package/src/components/ebiz-form/components/images-multi-language.vue +52 -52
- package/src/components/ebiz-form/components/images.vue +129 -129
- package/src/components/ebiz-form/components/img-multi-language.vue +51 -51
- package/src/components/ebiz-form/components/img.vue +129 -129
- package/src/components/ebiz-form/components/number.vue +50 -50
- package/src/components/ebiz-form/components/radio.vue +28 -28
- package/src/components/ebiz-form/components/select.vue +119 -119
- package/src/components/ebiz-form/components/switch.vue +23 -23
- package/src/components/ebiz-form/components/text-multi-language.vue +47 -47
- package/src/components/ebiz-form/components/text.vue +52 -52
- package/src/components/ebiz-form/components/textarea-multi-language.vue +48 -48
- package/src/components/ebiz-form/components/textarea.vue +29 -29
- package/src/components/ebiz-form/components/video-multi-language.vue +51 -51
- package/src/components/ebiz-form/components/video.vue +97 -97
- package/src/components/ebiz-form/index.vue +157 -157
- package/src/components/examples/PopconfirmExample.vue +149 -149
- package/src/components/icons/IconCommunity.vue +7 -7
- package/src/components/icons/IconDocumentation.vue +7 -7
- package/src/components/icons/IconEcosystem.vue +7 -7
- package/src/components/icons/IconSupport.vue +7 -7
- package/src/components/icons/IconTooling.vue +19 -19
- package/src/components/mItems/UserInfo.vue +349 -349
- package/src/components/senior/EbizApprovalList/ApprovalList.vue +127 -127
- package/src/components/senior/EbizSData/index.vue +280 -280
- package/src/components/senior/EbizSDialog/index.vue +776 -776
- package/src/components/senior/EbizSForm/README.md +157 -157
- package/src/components/senior/EbizSForm/index.vue +667 -667
- package/src/components/senior/EbizSForm/item.vue +1011 -1011
- package/src/components/senior/EbizSForm/mItems/DateTimePicker.vue +51 -51
- package/src/components/senior/EbizSForm/mItems/Picker.vue +63 -63
- package/src/index.js +327 -327
- package/src/main.js +55 -55
- package/src/router/index.js +436 -436
- package/src/utils/formatCode.js +24 -24
- package/src/utils/generateImportStatement.js +52 -52
- package/src/utils/hasJsx.js +25 -25
- package/src/utils/index.js +166 -166
- package/src/utils/mergeOptions.js +29 -29
- package/src/utils/parseRequiredBlocks.js +18 -18
- package/src/utils/vue-sfc-validator.js +155 -155
- package/src/views/Button.vue +23 -23
- package/src/views/CheckboxDemo.vue +104 -104
- package/src/views/DataContainer.vue +19 -19
- package/src/views/DialogDemo.vue +125 -125
- package/src/views/EbizApprovalDemo.vue +87 -87
- package/src/views/EbizApprovalFormDemo.vue +207 -207
- package/src/views/EbizAutoFormDemo.vue +129 -129
- package/src/views/EbizAvatar.vue +223 -223
- package/src/views/EbizDepartmentSelectorDemo.vue +169 -169
- package/src/views/EbizDetailBlockDemo.vue +30 -30
- package/src/views/EbizDetailViewDemo.vue +412 -412
- package/src/views/EbizDormDashboardDemo.vue +87 -87
- package/src/views/EbizEmployeeInfo.vue +249 -249
- package/src/views/EbizEmployeeSelector.vue +85 -85
- package/src/views/EbizFileListDemo.vue +339 -339
- package/src/views/EbizMap.vue +201 -201
- package/src/views/EbizMeetingRoomSelectorDemo.vue +293 -293
- package/src/views/EbizMobileMeetingRoomSelectorDemo.vue +566 -566
- package/src/views/EbizParkingDashboardDemo.vue +28 -28
- package/src/views/EbizRadioDemo.vue +151 -151
- package/src/views/EbizSDataDemo.vue +136 -136
- package/src/views/EbizSDialogDemo.vue +303 -303
- package/src/views/EbizSForm/index.vue +352 -352
- package/src/views/EbizSFormDemo.vue +420 -420
- package/src/views/EbizSpace.vue +185 -185
- package/src/views/EbizSwiper.vue +157 -157
- package/src/views/EbizTdesignButtonDialogExample.vue +437 -437
- package/src/views/Form.vue +19 -19
- package/src/views/GridDemo.vue +238 -238
- package/src/views/Home.vue +156 -156
- package/src/views/LaunchInterviewDemo.vue +111 -111
- package/src/views/Mindmap.vue +17 -17
- package/src/views/MyComponent.vue +19 -19
- package/src/views/OkrTree.vue +19 -19
- package/src/views/PageHeaderDemo.vue +104 -104
- package/src/views/PaginationDemo.vue +96 -96
- package/src/views/PdfViewerDemo.vue +433 -433
- package/src/views/PermissionBoxDemo.vue +85 -85
- package/src/views/PopconfirmDemo.vue +80 -80
- package/src/views/RemoteSelect.vue +350 -350
- package/src/views/StatisticDemo.vue +190 -190
- package/src/views/SwitchDemo.vue +79 -79
- package/src/views/Table.vue +19 -19
- package/src/views/TableDemo.vue +334 -334
- package/src/views/TableSortDemo.vue +143 -143
- package/src/views/TableView.vue +68 -68
- package/src/views/TabsDemo.vue +282 -282
- package/src/views/TagDemo.vue +101 -101
- package/src/views/TdesignAlert.vue +98 -98
- package/src/views/TdesignButton.vue +190 -190
- package/src/views/TdesignCalendar.vue +94 -94
- package/src/views/TdesignCard.vue +296 -296
- package/src/views/TdesignCollapse.vue +293 -293
- package/src/views/TdesignDatePicker.vue +187 -187
- package/src/views/TdesignDescriptions.vue +101 -101
- package/src/views/TdesignForm.vue +248 -248
- package/src/views/TdesignIcon.vue +203 -203
- package/src/views/TdesignImage.vue +215 -215
- package/src/views/TdesignImageViewer.vue +198 -198
- package/src/views/TdesignInput.vue +252 -252
- package/src/views/TdesignSelect.vue +473 -473
- package/src/views/TdesignSwiper.vue +157 -157
- package/src/views/TextareaDemo.vue +93 -93
- package/src/views/TimePickerDemo.vue +146 -146
- package/src/views/TimelineDemo.vue +160 -160
- package/src/views/Title.vue +19 -19
- package/src/views/TreeDemo.vue +254 -254
- package/src/views/TreeMergeTableDemo.vue +239 -239
- package/src/views/TreeSelectorDemo.vue +245 -245
- package/src/views/UploadDemo.vue +128 -128
- package/src/views/VideoDemo.vue +245 -245
- package/src/views/VxeTableDemo.vue +279 -279
- package/src/views/WatermarkDemo.vue +85 -85
|
@@ -1,535 +1,535 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="approval-form">
|
|
3
|
-
<t-form labelWidth="100px" labelAlign="right" class="component-base-style" :data="{}">
|
|
4
|
-
<!-- 添加审批人选择组件 -->
|
|
5
|
-
<div v-if="!isInWhiteList && hasNextApprover" style="margin-bottom: 10px;">
|
|
6
|
-
<ebiz-approval :showCC="false" type="all" :showRootOrg="false" class="component-base-style"
|
|
7
|
-
:required="hasNextApprover" v-model:approverList="selectedApprover" :canEdit="hasNextApprover"
|
|
8
|
-
v-model:ccList="selectedCCList">
|
|
9
|
-
<template #title>
|
|
10
|
-
<div></div>
|
|
11
|
-
</template>
|
|
12
|
-
</ebiz-approval>
|
|
13
|
-
</div>
|
|
14
|
-
<t-form-item label="审批意见">
|
|
15
|
-
<t-textarea placeholder="请输入" :maxLength="200" :maxCharacter="true" class="component-base-style"
|
|
16
|
-
v-model="comments"></t-textarea>
|
|
17
|
-
</t-form-item>
|
|
18
|
-
<t-form-item label="附件">
|
|
19
|
-
<ebiz-upload v-model="attachments" :multiple="true" theme="file" />
|
|
20
|
-
</t-form-item>
|
|
21
|
-
<t-form-item>
|
|
22
|
-
<div class="button-group">
|
|
23
|
-
<div class="more-actions">
|
|
24
|
-
<t-dropdown :options="actionOptions" @click="onActionSelected">
|
|
25
|
-
<t-button theme="default" variant="outline">
|
|
26
|
-
<template #icon>
|
|
27
|
-
<t-icon name="ellipsis" size="large" class="component-base-style"></t-icon>
|
|
28
|
-
</template>
|
|
29
|
-
</t-button>
|
|
30
|
-
</t-dropdown>
|
|
31
|
-
</div>
|
|
32
|
-
<div style="display: flex;">
|
|
33
|
-
<t-button theme="primary" type="submit" content="通过" @click="handlePass">
|
|
34
|
-
<template #icon>
|
|
35
|
-
<t-icon name="check" size="large" class="component-base-style"></t-icon>
|
|
36
|
-
</template>
|
|
37
|
-
</t-button>
|
|
38
|
-
<t-button theme="danger" content="拒绝" the type="reset" style="margin-left: 10px" @click="handleReject">
|
|
39
|
-
<template #icon>
|
|
40
|
-
<t-icon name="close" size="large" class="component-base-style"></t-icon>
|
|
41
|
-
</template>
|
|
42
|
-
</t-button>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</t-form-item>
|
|
46
|
-
</t-form>
|
|
47
|
-
|
|
48
|
-
<!-- 转审人员选择 -->
|
|
49
|
-
<t-dialog header="选择转审人" :visible="showTransferDialog" :confirm-btn="{ content: '确定', theme: 'primary' }"
|
|
50
|
-
:cancel-btn="{ content: '取消', theme: 'default' }" @confirm="confirmTransfer" @close="showTransferDialog = false">
|
|
51
|
-
<ebiz-approval
|
|
52
|
-
workFlowKey=""
|
|
53
|
-
:required="true"
|
|
54
|
-
type="all"
|
|
55
|
-
limitedType="role"
|
|
56
|
-
:showRootOrg="true"
|
|
57
|
-
:childDeptEnable="false"
|
|
58
|
-
:showCC="false"
|
|
59
|
-
:canEdit="true"
|
|
60
|
-
v-model:approverList="transferApprover"
|
|
61
|
-
:limitedMap="[]"
|
|
62
|
-
></ebiz-approval>
|
|
63
|
-
</t-dialog>
|
|
64
|
-
|
|
65
|
-
<!-- 转接待人选择 -->
|
|
66
|
-
<t-dialog header="选择接待人" :visible="showReceiverDialog" :confirm-btn="{ content: '确定', theme: 'primary' }"
|
|
67
|
-
:cancel-btn="{ content: '取消', theme: 'default' }" @confirm="confirmReceiver" @close="showReceiverDialog = false">
|
|
68
|
-
<EbizEmployeeSelector v-model="selectedReceiver" :single="true"></EbizEmployeeSelector>
|
|
69
|
-
</t-dialog>
|
|
70
|
-
|
|
71
|
-
<!-- 加签位置选择 -->
|
|
72
|
-
<t-dialog header="加签" :visible="showPositionDialog" :confirm-btn="{ content: '确定', theme: 'primary' }"
|
|
73
|
-
:cancel-btn="{ content: '取消', theme: 'default' }" @confirm="confirmAddSign" @close="showPositionDialog = false">
|
|
74
|
-
<t-radio-group v-model="addSignPosition" style="margin-bottom: 10px;">
|
|
75
|
-
<t-radio value="before">往前加签</t-radio>
|
|
76
|
-
<t-radio value="after">往后加签</t-radio>
|
|
77
|
-
</t-radio-group>
|
|
78
|
-
<ebiz-approval
|
|
79
|
-
workFlowKey=""
|
|
80
|
-
:required="true"
|
|
81
|
-
type="all"
|
|
82
|
-
limitedType="role"
|
|
83
|
-
:showRootOrg="true"
|
|
84
|
-
:childDeptEnable="false"
|
|
85
|
-
:showCC="false"
|
|
86
|
-
:canEdit="true"
|
|
87
|
-
v-model:approverList="selectedAddSignUser"
|
|
88
|
-
:limitedMap="[]"
|
|
89
|
-
></ebiz-approval>
|
|
90
|
-
</t-dialog>
|
|
91
|
-
|
|
92
|
-
<!-- 加签人员选择 -->
|
|
93
|
-
<!-- <t-dialog header="选择加签人员" :visible="showAddSignDialog" :confirm-btn="{ content: '确定', theme: 'primary' }"
|
|
94
|
-
:cancel-btn="{ content: '取消', theme: 'default' }" @confirm="confirmAddSign" @close="showAddSignDialog = false">
|
|
95
|
-
<EbizEmployeeSelector v-model="selectedAddSignUser" :single="true"></EbizEmployeeSelector>
|
|
96
|
-
</t-dialog> -->
|
|
97
|
-
|
|
98
|
-
<!-- 退回确认 -->
|
|
99
|
-
<t-dialog header="退回确认" :visible="showReturnDialog" :confirm-btn="{ content: '确定退回', theme: 'danger' }"
|
|
100
|
-
:cancel-btn="{ content: '取消', theme: 'default' }" @confirm="confirmReturn" @close="showReturnDialog = false">
|
|
101
|
-
<p>确定要退回该审批吗?</p>
|
|
102
|
-
</t-dialog>
|
|
103
|
-
</div>
|
|
104
|
-
</template>
|
|
105
|
-
|
|
106
|
-
<script setup>
|
|
107
|
-
import {
|
|
108
|
-
Form as TForm,
|
|
109
|
-
FormItem as TFormItem,
|
|
110
|
-
Button as TButton,
|
|
111
|
-
Icon as TIcon,
|
|
112
|
-
Textarea as TTextarea,
|
|
113
|
-
Dropdown as TDropdown,
|
|
114
|
-
Dialog as TDialog,
|
|
115
|
-
Select as TSelect,
|
|
116
|
-
RadioGroup as TRadioGroup,
|
|
117
|
-
Radio as TRadio,
|
|
118
|
-
Input as TInput,
|
|
119
|
-
MessagePlugin
|
|
120
|
-
} from 'tdesign-vue-next'
|
|
121
|
-
import { defineProps, defineEmits, ref, reactive, computed, onMounted } from 'vue'
|
|
122
|
-
import { dataService, EbizEmployeeSelector, EbizApproval } from '../index'
|
|
123
|
-
import { EbizUpload } from '../index.js'
|
|
124
|
-
|
|
125
|
-
const request = (params = {}, apiConfig = {}, url = '') => {
|
|
126
|
-
return dataService.fetch(params, apiConfig, url)
|
|
127
|
-
}
|
|
128
|
-
const props = defineProps({
|
|
129
|
-
loading: {
|
|
130
|
-
type: Boolean,
|
|
131
|
-
default: false
|
|
132
|
-
},
|
|
133
|
-
approvalDetail: {
|
|
134
|
-
type: Object,
|
|
135
|
-
default: () => ({})
|
|
136
|
-
},
|
|
137
|
-
taskId: {
|
|
138
|
-
type: String,
|
|
139
|
-
default: ''
|
|
140
|
-
},
|
|
141
|
-
businessKey: {
|
|
142
|
-
type: String,
|
|
143
|
-
default: ''
|
|
144
|
-
},
|
|
145
|
-
processInstanceId: {
|
|
146
|
-
type: String,
|
|
147
|
-
default: ''
|
|
148
|
-
},
|
|
149
|
-
taskDefinitionKey: {
|
|
150
|
-
type: String,
|
|
151
|
-
default: ''
|
|
152
|
-
},
|
|
153
|
-
utils: {
|
|
154
|
-
type: Object,
|
|
155
|
-
default: () => ({})
|
|
156
|
-
}
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
const emit = defineEmits(['pass', 'reject', 'refresh'])
|
|
160
|
-
|
|
161
|
-
// 基础数据
|
|
162
|
-
const comments = ref('')
|
|
163
|
-
const attachments = ref([])
|
|
164
|
-
const showMoreActions = ref(false)
|
|
165
|
-
const taskType = ref('')
|
|
166
|
-
|
|
167
|
-
// 下一步审批人相关
|
|
168
|
-
const hasNextApprover = ref(false)
|
|
169
|
-
const isInWhiteList = ref(false)
|
|
170
|
-
const selectedApprover = ref([])
|
|
171
|
-
const selectedCCList = ref([])
|
|
172
|
-
|
|
173
|
-
// 转审相关
|
|
174
|
-
const showTransferDialog = ref(false)
|
|
175
|
-
const transferApprover = ref([])
|
|
176
|
-
|
|
177
|
-
// 转接待人相关
|
|
178
|
-
const showReceiverDialog = ref(false)
|
|
179
|
-
const selectedReceiver = ref(null)
|
|
180
|
-
|
|
181
|
-
// 加签相关
|
|
182
|
-
const showPositionDialog = ref(false)
|
|
183
|
-
const showAddSignDialog = ref(false)
|
|
184
|
-
const addSignPosition = ref('after')
|
|
185
|
-
const selectedAddSignUser = ref([])
|
|
186
|
-
|
|
187
|
-
// 退回相关
|
|
188
|
-
const showReturnDialog = ref(false)
|
|
189
|
-
const returnReason = ref('')
|
|
190
|
-
|
|
191
|
-
// 员工选择相关
|
|
192
|
-
const employeeLoading = ref(false)
|
|
193
|
-
const employeeOptions = ref([])
|
|
194
|
-
|
|
195
|
-
// 操作选项
|
|
196
|
-
const actionOptions = computed(() => {
|
|
197
|
-
const options = [
|
|
198
|
-
{ content: '转审', value: 'transfer' },
|
|
199
|
-
{ content: '加签', value: 'addSign' },
|
|
200
|
-
{ content: '退回', value: 'return' }
|
|
201
|
-
]
|
|
202
|
-
|
|
203
|
-
// 如果是接待人节点,添加转接待人选项
|
|
204
|
-
if (props.taskDefinitionKey === 'receiver') {
|
|
205
|
-
options.unshift({ content: '转接待人', value: 'changeReceiver' })
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return options
|
|
209
|
-
})
|
|
210
|
-
|
|
211
|
-
// 获取当前任务节点类型
|
|
212
|
-
const getCurrentTaskType = async () => {
|
|
213
|
-
try {
|
|
214
|
-
employeeLoading.value = true
|
|
215
|
-
const res = await request(
|
|
216
|
-
{ taskId: props.taskId },
|
|
217
|
-
{},
|
|
218
|
-
`/tasks/curr-user-task-type`
|
|
219
|
-
)
|
|
220
|
-
taskType.value = res.taskType
|
|
221
|
-
} catch (err) {
|
|
222
|
-
MessagePlugin.error(err.message || '获取任务类型失败')
|
|
223
|
-
} finally {
|
|
224
|
-
employeeLoading.value = false
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// 判断是否需要选择审批人
|
|
229
|
-
const checkHasNextApprover = async () => {
|
|
230
|
-
try {
|
|
231
|
-
const res = await request(
|
|
232
|
-
{ taskId: props.taskId },
|
|
233
|
-
{},
|
|
234
|
-
'/tasks/next-user-task-type'
|
|
235
|
-
)
|
|
236
|
-
hasNextApprover.value = res.hasNextUserTask ? ['sequential', 'parallel'].includes(res.taskType) : false
|
|
237
|
-
} catch (err) {
|
|
238
|
-
MessagePlugin.error(err.message || '获取下一步审批信息失败')
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// 检查是否在白名单中
|
|
243
|
-
const checkIsInWhiteList = async () => {
|
|
244
|
-
if (props.taskDefinitionKey === 'receiver' && props.approvalDetail?.variables?.form?.receiver) {
|
|
245
|
-
try {
|
|
246
|
-
const res = await request(
|
|
247
|
-
{},
|
|
248
|
-
{
|
|
249
|
-
key: 'visitor_whitelist_disenable_pagination',
|
|
250
|
-
apiId: 2282,
|
|
251
|
-
apiType: 0
|
|
252
|
-
},
|
|
253
|
-
''
|
|
254
|
-
)
|
|
255
|
-
isInWhiteList.value = res?.data?.some(item =>
|
|
256
|
-
item.emp_id === Number(props.approvalDetail.variables.form.receiver)
|
|
257
|
-
)
|
|
258
|
-
} catch (err) {
|
|
259
|
-
MessagePlugin.error(err.message || '获取白名单信息失败')
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
// 获取员工列表
|
|
265
|
-
const getEmployeeList = async () => {
|
|
266
|
-
try {
|
|
267
|
-
employeeLoading.value = true
|
|
268
|
-
const res = await request(
|
|
269
|
-
{},
|
|
270
|
-
{ key: 'approval_employee_list', apiId: 2269, apiType: '0' },
|
|
271
|
-
''
|
|
272
|
-
)
|
|
273
|
-
employeeOptions.value = (res.data || []).map(item => ({
|
|
274
|
-
label: item.name,
|
|
275
|
-
value: item.id
|
|
276
|
-
}))
|
|
277
|
-
} catch (err) {
|
|
278
|
-
MessagePlugin.error(err.message || '获取员工列表失败')
|
|
279
|
-
} finally {
|
|
280
|
-
employeeLoading.value = false
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// 显示更多操作菜单
|
|
285
|
-
const onShowMore = () => {
|
|
286
|
-
showMoreActions.value = true
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// 选择操作
|
|
290
|
-
const onActionSelected = ({ value }) => {
|
|
291
|
-
switch (value) {
|
|
292
|
-
case 'transfer':
|
|
293
|
-
showTransferDialog.value = true
|
|
294
|
-
getEmployeeList()
|
|
295
|
-
break
|
|
296
|
-
case 'changeReceiver':
|
|
297
|
-
showReceiverDialog.value = true
|
|
298
|
-
getEmployeeList()
|
|
299
|
-
break
|
|
300
|
-
case 'addSign':
|
|
301
|
-
if (taskType.value === 'sequential') {
|
|
302
|
-
showPositionDialog.value = true
|
|
303
|
-
} else {
|
|
304
|
-
MessagePlugin.warning('加签仅支持会签模式')
|
|
305
|
-
}
|
|
306
|
-
break
|
|
307
|
-
case 'return':
|
|
308
|
-
showReturnDialog.value = true
|
|
309
|
-
break
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// 通过审批
|
|
314
|
-
const handlePass = async () => {
|
|
315
|
-
console.log("selectedApprover", selectedApprover.value)
|
|
316
|
-
// 检查是否需要选择下一步审批人
|
|
317
|
-
if (!isInWhiteList.value && hasNextApprover.value && (!Array.isArray(selectedApprover.value) || selectedApprover.value.length === 0)) {
|
|
318
|
-
MessagePlugin.warning('请先选择审批人')
|
|
319
|
-
return
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
const params = {
|
|
323
|
-
taskId: props.taskId,
|
|
324
|
-
comment: comments.value,
|
|
325
|
-
attachments: attachments.value,
|
|
326
|
-
approve: true,
|
|
327
|
-
ccList: selectedCCList.value || []
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
console.log("Array.isArray(selectedApprover.value)", Array.isArray(selectedApprover.value))
|
|
331
|
-
if (Array.isArray(selectedApprover.value) && selectedApprover.value.length > 0) {
|
|
332
|
-
params.approverList = selectedApprover.value
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
try {
|
|
336
|
-
//await emit('pass', params)
|
|
337
|
-
|
|
338
|
-
//通过审批申请
|
|
339
|
-
await request(
|
|
340
|
-
{
|
|
341
|
-
...params
|
|
342
|
-
},
|
|
343
|
-
{},
|
|
344
|
-
`/tasks/${params.taskId}/complete`
|
|
345
|
-
)
|
|
346
|
-
|
|
347
|
-
emit('pass')
|
|
348
|
-
|
|
349
|
-
comments.value = ''
|
|
350
|
-
attachments.value = []
|
|
351
|
-
} catch (err) {
|
|
352
|
-
MessagePlugin.error(err.message || '操作失败')
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// 拒绝审批
|
|
357
|
-
const handleReject = async () => {
|
|
358
|
-
try {
|
|
359
|
-
//await emit('reject', comments.value)
|
|
360
|
-
await request(
|
|
361
|
-
{
|
|
362
|
-
taskId: props.taskId,
|
|
363
|
-
comment: comments.value,
|
|
364
|
-
approve: false
|
|
365
|
-
},
|
|
366
|
-
{},
|
|
367
|
-
`/tasks/${props.taskId}/complete`
|
|
368
|
-
)
|
|
369
|
-
emit('reject')
|
|
370
|
-
comments.value = ''
|
|
371
|
-
attachments.value = []
|
|
372
|
-
} catch (err) {
|
|
373
|
-
MessagePlugin.error(err.message || '操作失败')
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
// 确认转审
|
|
378
|
-
const confirmTransfer = async () => {
|
|
379
|
-
if (transferApprover.value.length === 0) {
|
|
380
|
-
MessagePlugin.warning('请选择转审人')
|
|
381
|
-
return
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
const toUserId = Array.isArray(transferApprover.value)
|
|
385
|
-
? transferApprover.value[0]
|
|
386
|
-
: transferApprover.value
|
|
387
|
-
|
|
388
|
-
try {
|
|
389
|
-
const res = await request(
|
|
390
|
-
{
|
|
391
|
-
toUserId: String(toUserId),
|
|
392
|
-
comment: comments.value,
|
|
393
|
-
attachments: attachments.value
|
|
394
|
-
},
|
|
395
|
-
{},
|
|
396
|
-
`/tasks/${props.taskId}/transfer`
|
|
397
|
-
)
|
|
398
|
-
|
|
399
|
-
if (res.success) {
|
|
400
|
-
MessagePlugin.success(res.message || '转审成功')
|
|
401
|
-
showTransferDialog.value = false
|
|
402
|
-
transferApprover.value = []
|
|
403
|
-
emit('refresh')
|
|
404
|
-
}
|
|
405
|
-
} catch (err) {
|
|
406
|
-
MessagePlugin.error(err.message || '转审失败')
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
// 确认转接待人
|
|
411
|
-
const confirmReceiver = async () => {
|
|
412
|
-
if (!selectedReceiver.value) {
|
|
413
|
-
MessagePlugin.warning('请选择接待人')
|
|
414
|
-
return
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
try {
|
|
418
|
-
const res = await request(
|
|
419
|
-
{
|
|
420
|
-
saveData: {
|
|
421
|
-
id: props.approvalDetail.variables.form.id,
|
|
422
|
-
receiver: String(selectedReceiver.value),
|
|
423
|
-
taskId: props.taskId,
|
|
424
|
-
comment: comments.value,
|
|
425
|
-
attachments: attachments.value
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
key: 'out_visitor_apply_update_receiver',
|
|
430
|
-
apiId: 2276,
|
|
431
|
-
apiType: 5
|
|
432
|
-
},
|
|
433
|
-
''
|
|
434
|
-
)
|
|
435
|
-
|
|
436
|
-
MessagePlugin.success('转接待人成功')
|
|
437
|
-
|
|
438
|
-
showReceiverDialog.value = false
|
|
439
|
-
selectedReceiver.value = null
|
|
440
|
-
emit('refresh')
|
|
441
|
-
} catch (err) {
|
|
442
|
-
MessagePlugin.error(err.message || '转接待人失败')
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
// 确认加签位置
|
|
447
|
-
const confirmPosition = () => {
|
|
448
|
-
showPositionDialog.value = false
|
|
449
|
-
showAddSignDialog.value = true
|
|
450
|
-
getEmployeeList()
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
// 确认加签
|
|
454
|
-
const confirmAddSign = async () => {
|
|
455
|
-
if (selectedAddSignUser.value.length === 0) {
|
|
456
|
-
MessagePlugin.warning('请选择加签人员')
|
|
457
|
-
return
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
try {
|
|
461
|
-
const res = await request(
|
|
462
|
-
{
|
|
463
|
-
userIds: selectedAddSignUser.value,
|
|
464
|
-
position: addSignPosition.value,
|
|
465
|
-
comment: comments.value,
|
|
466
|
-
attachments: attachments.value
|
|
467
|
-
},
|
|
468
|
-
{},
|
|
469
|
-
`/tasks/${props.taskId}/addSign`
|
|
470
|
-
)
|
|
471
|
-
|
|
472
|
-
MessagePlugin.success('加签成功')
|
|
473
|
-
|
|
474
|
-
showAddSignDialog.value = false
|
|
475
|
-
selectedAddSignUser.value = []
|
|
476
|
-
|
|
477
|
-
/* if (addSignPosition.value === 'before') {
|
|
478
|
-
emit('refresh')
|
|
479
|
-
} */
|
|
480
|
-
emit('refresh')
|
|
481
|
-
} catch (err) {
|
|
482
|
-
MessagePlugin.error(err.message || '加签失败')
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
// 确认退回
|
|
487
|
-
const confirmReturn = async () => {
|
|
488
|
-
try {
|
|
489
|
-
const res = await request(
|
|
490
|
-
{
|
|
491
|
-
comment: comments.value,
|
|
492
|
-
attachments: attachments.value
|
|
493
|
-
},
|
|
494
|
-
{},
|
|
495
|
-
`/tasks/${props.taskId}/return`
|
|
496
|
-
)
|
|
497
|
-
|
|
498
|
-
MessagePlugin.success('退回成功')
|
|
499
|
-
|
|
500
|
-
showReturnDialog.value = false
|
|
501
|
-
returnReason.value = ''
|
|
502
|
-
emit('refresh')
|
|
503
|
-
} catch (err) {
|
|
504
|
-
MessagePlugin.error(err.message || '退回失败')
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
onMounted(async () => {
|
|
509
|
-
if (props.taskId) {
|
|
510
|
-
await getCurrentTaskType()
|
|
511
|
-
await checkHasNextApprover()
|
|
512
|
-
await checkIsInWhiteList()
|
|
513
|
-
}
|
|
514
|
-
})
|
|
515
|
-
</script>
|
|
516
|
-
|
|
517
|
-
<style scoped>
|
|
518
|
-
.component-base-style {
|
|
519
|
-
margin: 0px;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
.approval-form {
|
|
523
|
-
position: relative;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
.button-group {
|
|
527
|
-
display: flex;
|
|
528
|
-
justify-content: space-between;
|
|
529
|
-
align-items: center;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
.more-actions {
|
|
533
|
-
margin-right: 10px;
|
|
534
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div class="approval-form">
|
|
3
|
+
<t-form labelWidth="100px" labelAlign="right" class="component-base-style" :data="{}">
|
|
4
|
+
<!-- 添加审批人选择组件 -->
|
|
5
|
+
<div v-if="!isInWhiteList && hasNextApprover" style="margin-bottom: 10px;">
|
|
6
|
+
<ebiz-approval :showCC="false" type="all" :showRootOrg="false" class="component-base-style"
|
|
7
|
+
:required="hasNextApprover" v-model:approverList="selectedApprover" :canEdit="hasNextApprover"
|
|
8
|
+
v-model:ccList="selectedCCList">
|
|
9
|
+
<template #title>
|
|
10
|
+
<div></div>
|
|
11
|
+
</template>
|
|
12
|
+
</ebiz-approval>
|
|
13
|
+
</div>
|
|
14
|
+
<t-form-item label="审批意见">
|
|
15
|
+
<t-textarea placeholder="请输入" :maxLength="200" :maxCharacter="true" class="component-base-style"
|
|
16
|
+
v-model="comments"></t-textarea>
|
|
17
|
+
</t-form-item>
|
|
18
|
+
<t-form-item label="附件">
|
|
19
|
+
<ebiz-upload v-model="attachments" :multiple="true" theme="file" />
|
|
20
|
+
</t-form-item>
|
|
21
|
+
<t-form-item>
|
|
22
|
+
<div class="button-group">
|
|
23
|
+
<div class="more-actions">
|
|
24
|
+
<t-dropdown :options="actionOptions" @click="onActionSelected">
|
|
25
|
+
<t-button theme="default" variant="outline">
|
|
26
|
+
<template #icon>
|
|
27
|
+
<t-icon name="ellipsis" size="large" class="component-base-style"></t-icon>
|
|
28
|
+
</template>
|
|
29
|
+
</t-button>
|
|
30
|
+
</t-dropdown>
|
|
31
|
+
</div>
|
|
32
|
+
<div style="display: flex;">
|
|
33
|
+
<t-button theme="primary" type="submit" content="通过" @click="handlePass">
|
|
34
|
+
<template #icon>
|
|
35
|
+
<t-icon name="check" size="large" class="component-base-style"></t-icon>
|
|
36
|
+
</template>
|
|
37
|
+
</t-button>
|
|
38
|
+
<t-button theme="danger" content="拒绝" the type="reset" style="margin-left: 10px" @click="handleReject">
|
|
39
|
+
<template #icon>
|
|
40
|
+
<t-icon name="close" size="large" class="component-base-style"></t-icon>
|
|
41
|
+
</template>
|
|
42
|
+
</t-button>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</t-form-item>
|
|
46
|
+
</t-form>
|
|
47
|
+
|
|
48
|
+
<!-- 转审人员选择 -->
|
|
49
|
+
<t-dialog header="选择转审人" :visible="showTransferDialog" :confirm-btn="{ content: '确定', theme: 'primary' }"
|
|
50
|
+
:cancel-btn="{ content: '取消', theme: 'default' }" @confirm="confirmTransfer" @close="showTransferDialog = false">
|
|
51
|
+
<ebiz-approval
|
|
52
|
+
workFlowKey=""
|
|
53
|
+
:required="true"
|
|
54
|
+
type="all"
|
|
55
|
+
limitedType="role"
|
|
56
|
+
:showRootOrg="true"
|
|
57
|
+
:childDeptEnable="false"
|
|
58
|
+
:showCC="false"
|
|
59
|
+
:canEdit="true"
|
|
60
|
+
v-model:approverList="transferApprover"
|
|
61
|
+
:limitedMap="[]"
|
|
62
|
+
></ebiz-approval>
|
|
63
|
+
</t-dialog>
|
|
64
|
+
|
|
65
|
+
<!-- 转接待人选择 -->
|
|
66
|
+
<t-dialog header="选择接待人" :visible="showReceiverDialog" :confirm-btn="{ content: '确定', theme: 'primary' }"
|
|
67
|
+
:cancel-btn="{ content: '取消', theme: 'default' }" @confirm="confirmReceiver" @close="showReceiverDialog = false">
|
|
68
|
+
<EbizEmployeeSelector v-model="selectedReceiver" :single="true"></EbizEmployeeSelector>
|
|
69
|
+
</t-dialog>
|
|
70
|
+
|
|
71
|
+
<!-- 加签位置选择 -->
|
|
72
|
+
<t-dialog header="加签" :visible="showPositionDialog" :confirm-btn="{ content: '确定', theme: 'primary' }"
|
|
73
|
+
:cancel-btn="{ content: '取消', theme: 'default' }" @confirm="confirmAddSign" @close="showPositionDialog = false">
|
|
74
|
+
<t-radio-group v-model="addSignPosition" style="margin-bottom: 10px;">
|
|
75
|
+
<t-radio value="before">往前加签</t-radio>
|
|
76
|
+
<t-radio value="after">往后加签</t-radio>
|
|
77
|
+
</t-radio-group>
|
|
78
|
+
<ebiz-approval
|
|
79
|
+
workFlowKey=""
|
|
80
|
+
:required="true"
|
|
81
|
+
type="all"
|
|
82
|
+
limitedType="role"
|
|
83
|
+
:showRootOrg="true"
|
|
84
|
+
:childDeptEnable="false"
|
|
85
|
+
:showCC="false"
|
|
86
|
+
:canEdit="true"
|
|
87
|
+
v-model:approverList="selectedAddSignUser"
|
|
88
|
+
:limitedMap="[]"
|
|
89
|
+
></ebiz-approval>
|
|
90
|
+
</t-dialog>
|
|
91
|
+
|
|
92
|
+
<!-- 加签人员选择 -->
|
|
93
|
+
<!-- <t-dialog header="选择加签人员" :visible="showAddSignDialog" :confirm-btn="{ content: '确定', theme: 'primary' }"
|
|
94
|
+
:cancel-btn="{ content: '取消', theme: 'default' }" @confirm="confirmAddSign" @close="showAddSignDialog = false">
|
|
95
|
+
<EbizEmployeeSelector v-model="selectedAddSignUser" :single="true"></EbizEmployeeSelector>
|
|
96
|
+
</t-dialog> -->
|
|
97
|
+
|
|
98
|
+
<!-- 退回确认 -->
|
|
99
|
+
<t-dialog header="退回确认" :visible="showReturnDialog" :confirm-btn="{ content: '确定退回', theme: 'danger' }"
|
|
100
|
+
:cancel-btn="{ content: '取消', theme: 'default' }" @confirm="confirmReturn" @close="showReturnDialog = false">
|
|
101
|
+
<p>确定要退回该审批吗?</p>
|
|
102
|
+
</t-dialog>
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|
|
105
|
+
|
|
106
|
+
<script setup>
|
|
107
|
+
import {
|
|
108
|
+
Form as TForm,
|
|
109
|
+
FormItem as TFormItem,
|
|
110
|
+
Button as TButton,
|
|
111
|
+
Icon as TIcon,
|
|
112
|
+
Textarea as TTextarea,
|
|
113
|
+
Dropdown as TDropdown,
|
|
114
|
+
Dialog as TDialog,
|
|
115
|
+
Select as TSelect,
|
|
116
|
+
RadioGroup as TRadioGroup,
|
|
117
|
+
Radio as TRadio,
|
|
118
|
+
Input as TInput,
|
|
119
|
+
MessagePlugin
|
|
120
|
+
} from 'tdesign-vue-next'
|
|
121
|
+
import { defineProps, defineEmits, ref, reactive, computed, onMounted } from 'vue'
|
|
122
|
+
import { dataService, EbizEmployeeSelector, EbizApproval } from '../index'
|
|
123
|
+
import { EbizUpload } from '../index.js'
|
|
124
|
+
|
|
125
|
+
const request = (params = {}, apiConfig = {}, url = '') => {
|
|
126
|
+
return dataService.fetch(params, apiConfig, url)
|
|
127
|
+
}
|
|
128
|
+
const props = defineProps({
|
|
129
|
+
loading: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: false
|
|
132
|
+
},
|
|
133
|
+
approvalDetail: {
|
|
134
|
+
type: Object,
|
|
135
|
+
default: () => ({})
|
|
136
|
+
},
|
|
137
|
+
taskId: {
|
|
138
|
+
type: String,
|
|
139
|
+
default: ''
|
|
140
|
+
},
|
|
141
|
+
businessKey: {
|
|
142
|
+
type: String,
|
|
143
|
+
default: ''
|
|
144
|
+
},
|
|
145
|
+
processInstanceId: {
|
|
146
|
+
type: String,
|
|
147
|
+
default: ''
|
|
148
|
+
},
|
|
149
|
+
taskDefinitionKey: {
|
|
150
|
+
type: String,
|
|
151
|
+
default: ''
|
|
152
|
+
},
|
|
153
|
+
utils: {
|
|
154
|
+
type: Object,
|
|
155
|
+
default: () => ({})
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
const emit = defineEmits(['pass', 'reject', 'refresh'])
|
|
160
|
+
|
|
161
|
+
// 基础数据
|
|
162
|
+
const comments = ref('')
|
|
163
|
+
const attachments = ref([])
|
|
164
|
+
const showMoreActions = ref(false)
|
|
165
|
+
const taskType = ref('')
|
|
166
|
+
|
|
167
|
+
// 下一步审批人相关
|
|
168
|
+
const hasNextApprover = ref(false)
|
|
169
|
+
const isInWhiteList = ref(false)
|
|
170
|
+
const selectedApprover = ref([])
|
|
171
|
+
const selectedCCList = ref([])
|
|
172
|
+
|
|
173
|
+
// 转审相关
|
|
174
|
+
const showTransferDialog = ref(false)
|
|
175
|
+
const transferApprover = ref([])
|
|
176
|
+
|
|
177
|
+
// 转接待人相关
|
|
178
|
+
const showReceiverDialog = ref(false)
|
|
179
|
+
const selectedReceiver = ref(null)
|
|
180
|
+
|
|
181
|
+
// 加签相关
|
|
182
|
+
const showPositionDialog = ref(false)
|
|
183
|
+
const showAddSignDialog = ref(false)
|
|
184
|
+
const addSignPosition = ref('after')
|
|
185
|
+
const selectedAddSignUser = ref([])
|
|
186
|
+
|
|
187
|
+
// 退回相关
|
|
188
|
+
const showReturnDialog = ref(false)
|
|
189
|
+
const returnReason = ref('')
|
|
190
|
+
|
|
191
|
+
// 员工选择相关
|
|
192
|
+
const employeeLoading = ref(false)
|
|
193
|
+
const employeeOptions = ref([])
|
|
194
|
+
|
|
195
|
+
// 操作选项
|
|
196
|
+
const actionOptions = computed(() => {
|
|
197
|
+
const options = [
|
|
198
|
+
{ content: '转审', value: 'transfer' },
|
|
199
|
+
{ content: '加签', value: 'addSign' },
|
|
200
|
+
{ content: '退回', value: 'return' }
|
|
201
|
+
]
|
|
202
|
+
|
|
203
|
+
// 如果是接待人节点,添加转接待人选项
|
|
204
|
+
if (props.taskDefinitionKey === 'receiver') {
|
|
205
|
+
options.unshift({ content: '转接待人', value: 'changeReceiver' })
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return options
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
// 获取当前任务节点类型
|
|
212
|
+
const getCurrentTaskType = async () => {
|
|
213
|
+
try {
|
|
214
|
+
employeeLoading.value = true
|
|
215
|
+
const res = await request(
|
|
216
|
+
{ taskId: props.taskId },
|
|
217
|
+
{},
|
|
218
|
+
`/tasks/curr-user-task-type`
|
|
219
|
+
)
|
|
220
|
+
taskType.value = res.taskType
|
|
221
|
+
} catch (err) {
|
|
222
|
+
MessagePlugin.error(err.message || '获取任务类型失败')
|
|
223
|
+
} finally {
|
|
224
|
+
employeeLoading.value = false
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// 判断是否需要选择审批人
|
|
229
|
+
const checkHasNextApprover = async () => {
|
|
230
|
+
try {
|
|
231
|
+
const res = await request(
|
|
232
|
+
{ taskId: props.taskId },
|
|
233
|
+
{},
|
|
234
|
+
'/tasks/next-user-task-type'
|
|
235
|
+
)
|
|
236
|
+
hasNextApprover.value = res.hasNextUserTask ? ['sequential', 'parallel'].includes(res.taskType) : false
|
|
237
|
+
} catch (err) {
|
|
238
|
+
MessagePlugin.error(err.message || '获取下一步审批信息失败')
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// 检查是否在白名单中
|
|
243
|
+
const checkIsInWhiteList = async () => {
|
|
244
|
+
if (props.taskDefinitionKey === 'receiver' && props.approvalDetail?.variables?.form?.receiver) {
|
|
245
|
+
try {
|
|
246
|
+
const res = await request(
|
|
247
|
+
{},
|
|
248
|
+
{
|
|
249
|
+
key: 'visitor_whitelist_disenable_pagination',
|
|
250
|
+
apiId: 2282,
|
|
251
|
+
apiType: 0
|
|
252
|
+
},
|
|
253
|
+
''
|
|
254
|
+
)
|
|
255
|
+
isInWhiteList.value = res?.data?.some(item =>
|
|
256
|
+
item.emp_id === Number(props.approvalDetail.variables.form.receiver)
|
|
257
|
+
)
|
|
258
|
+
} catch (err) {
|
|
259
|
+
MessagePlugin.error(err.message || '获取白名单信息失败')
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// 获取员工列表
|
|
265
|
+
const getEmployeeList = async () => {
|
|
266
|
+
try {
|
|
267
|
+
employeeLoading.value = true
|
|
268
|
+
const res = await request(
|
|
269
|
+
{},
|
|
270
|
+
{ key: 'approval_employee_list', apiId: 2269, apiType: '0' },
|
|
271
|
+
''
|
|
272
|
+
)
|
|
273
|
+
employeeOptions.value = (res.data || []).map(item => ({
|
|
274
|
+
label: item.name,
|
|
275
|
+
value: item.id
|
|
276
|
+
}))
|
|
277
|
+
} catch (err) {
|
|
278
|
+
MessagePlugin.error(err.message || '获取员工列表失败')
|
|
279
|
+
} finally {
|
|
280
|
+
employeeLoading.value = false
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// 显示更多操作菜单
|
|
285
|
+
const onShowMore = () => {
|
|
286
|
+
showMoreActions.value = true
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// 选择操作
|
|
290
|
+
const onActionSelected = ({ value }) => {
|
|
291
|
+
switch (value) {
|
|
292
|
+
case 'transfer':
|
|
293
|
+
showTransferDialog.value = true
|
|
294
|
+
getEmployeeList()
|
|
295
|
+
break
|
|
296
|
+
case 'changeReceiver':
|
|
297
|
+
showReceiverDialog.value = true
|
|
298
|
+
getEmployeeList()
|
|
299
|
+
break
|
|
300
|
+
case 'addSign':
|
|
301
|
+
if (taskType.value === 'sequential') {
|
|
302
|
+
showPositionDialog.value = true
|
|
303
|
+
} else {
|
|
304
|
+
MessagePlugin.warning('加签仅支持会签模式')
|
|
305
|
+
}
|
|
306
|
+
break
|
|
307
|
+
case 'return':
|
|
308
|
+
showReturnDialog.value = true
|
|
309
|
+
break
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// 通过审批
|
|
314
|
+
const handlePass = async () => {
|
|
315
|
+
console.log("selectedApprover", selectedApprover.value)
|
|
316
|
+
// 检查是否需要选择下一步审批人
|
|
317
|
+
if (!isInWhiteList.value && hasNextApprover.value && (!Array.isArray(selectedApprover.value) || selectedApprover.value.length === 0)) {
|
|
318
|
+
MessagePlugin.warning('请先选择审批人')
|
|
319
|
+
return
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
const params = {
|
|
323
|
+
taskId: props.taskId,
|
|
324
|
+
comment: comments.value,
|
|
325
|
+
attachments: attachments.value,
|
|
326
|
+
approve: true,
|
|
327
|
+
ccList: selectedCCList.value || []
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
console.log("Array.isArray(selectedApprover.value)", Array.isArray(selectedApprover.value))
|
|
331
|
+
if (Array.isArray(selectedApprover.value) && selectedApprover.value.length > 0) {
|
|
332
|
+
params.approverList = selectedApprover.value
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
try {
|
|
336
|
+
//await emit('pass', params)
|
|
337
|
+
|
|
338
|
+
//通过审批申请
|
|
339
|
+
await request(
|
|
340
|
+
{
|
|
341
|
+
...params
|
|
342
|
+
},
|
|
343
|
+
{},
|
|
344
|
+
`/tasks/${params.taskId}/complete`
|
|
345
|
+
)
|
|
346
|
+
|
|
347
|
+
emit('pass')
|
|
348
|
+
|
|
349
|
+
comments.value = ''
|
|
350
|
+
attachments.value = []
|
|
351
|
+
} catch (err) {
|
|
352
|
+
MessagePlugin.error(err.message || '操作失败')
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// 拒绝审批
|
|
357
|
+
const handleReject = async () => {
|
|
358
|
+
try {
|
|
359
|
+
//await emit('reject', comments.value)
|
|
360
|
+
await request(
|
|
361
|
+
{
|
|
362
|
+
taskId: props.taskId,
|
|
363
|
+
comment: comments.value,
|
|
364
|
+
approve: false
|
|
365
|
+
},
|
|
366
|
+
{},
|
|
367
|
+
`/tasks/${props.taskId}/complete`
|
|
368
|
+
)
|
|
369
|
+
emit('reject')
|
|
370
|
+
comments.value = ''
|
|
371
|
+
attachments.value = []
|
|
372
|
+
} catch (err) {
|
|
373
|
+
MessagePlugin.error(err.message || '操作失败')
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// 确认转审
|
|
378
|
+
const confirmTransfer = async () => {
|
|
379
|
+
if (transferApprover.value.length === 0) {
|
|
380
|
+
MessagePlugin.warning('请选择转审人')
|
|
381
|
+
return
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
const toUserId = Array.isArray(transferApprover.value)
|
|
385
|
+
? transferApprover.value[0]
|
|
386
|
+
: transferApprover.value
|
|
387
|
+
|
|
388
|
+
try {
|
|
389
|
+
const res = await request(
|
|
390
|
+
{
|
|
391
|
+
toUserId: String(toUserId),
|
|
392
|
+
comment: comments.value,
|
|
393
|
+
attachments: attachments.value
|
|
394
|
+
},
|
|
395
|
+
{},
|
|
396
|
+
`/tasks/${props.taskId}/transfer`
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
if (res.success) {
|
|
400
|
+
MessagePlugin.success(res.message || '转审成功')
|
|
401
|
+
showTransferDialog.value = false
|
|
402
|
+
transferApprover.value = []
|
|
403
|
+
emit('refresh')
|
|
404
|
+
}
|
|
405
|
+
} catch (err) {
|
|
406
|
+
MessagePlugin.error(err.message || '转审失败')
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// 确认转接待人
|
|
411
|
+
const confirmReceiver = async () => {
|
|
412
|
+
if (!selectedReceiver.value) {
|
|
413
|
+
MessagePlugin.warning('请选择接待人')
|
|
414
|
+
return
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
try {
|
|
418
|
+
const res = await request(
|
|
419
|
+
{
|
|
420
|
+
saveData: {
|
|
421
|
+
id: props.approvalDetail.variables.form.id,
|
|
422
|
+
receiver: String(selectedReceiver.value),
|
|
423
|
+
taskId: props.taskId,
|
|
424
|
+
comment: comments.value,
|
|
425
|
+
attachments: attachments.value
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
key: 'out_visitor_apply_update_receiver',
|
|
430
|
+
apiId: 2276,
|
|
431
|
+
apiType: 5
|
|
432
|
+
},
|
|
433
|
+
''
|
|
434
|
+
)
|
|
435
|
+
|
|
436
|
+
MessagePlugin.success('转接待人成功')
|
|
437
|
+
|
|
438
|
+
showReceiverDialog.value = false
|
|
439
|
+
selectedReceiver.value = null
|
|
440
|
+
emit('refresh')
|
|
441
|
+
} catch (err) {
|
|
442
|
+
MessagePlugin.error(err.message || '转接待人失败')
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// 确认加签位置
|
|
447
|
+
const confirmPosition = () => {
|
|
448
|
+
showPositionDialog.value = false
|
|
449
|
+
showAddSignDialog.value = true
|
|
450
|
+
getEmployeeList()
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// 确认加签
|
|
454
|
+
const confirmAddSign = async () => {
|
|
455
|
+
if (selectedAddSignUser.value.length === 0) {
|
|
456
|
+
MessagePlugin.warning('请选择加签人员')
|
|
457
|
+
return
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
try {
|
|
461
|
+
const res = await request(
|
|
462
|
+
{
|
|
463
|
+
userIds: selectedAddSignUser.value,
|
|
464
|
+
position: addSignPosition.value,
|
|
465
|
+
comment: comments.value,
|
|
466
|
+
attachments: attachments.value
|
|
467
|
+
},
|
|
468
|
+
{},
|
|
469
|
+
`/tasks/${props.taskId}/addSign`
|
|
470
|
+
)
|
|
471
|
+
|
|
472
|
+
MessagePlugin.success('加签成功')
|
|
473
|
+
|
|
474
|
+
showAddSignDialog.value = false
|
|
475
|
+
selectedAddSignUser.value = []
|
|
476
|
+
|
|
477
|
+
/* if (addSignPosition.value === 'before') {
|
|
478
|
+
emit('refresh')
|
|
479
|
+
} */
|
|
480
|
+
emit('refresh')
|
|
481
|
+
} catch (err) {
|
|
482
|
+
MessagePlugin.error(err.message || '加签失败')
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// 确认退回
|
|
487
|
+
const confirmReturn = async () => {
|
|
488
|
+
try {
|
|
489
|
+
const res = await request(
|
|
490
|
+
{
|
|
491
|
+
comment: comments.value,
|
|
492
|
+
attachments: attachments.value
|
|
493
|
+
},
|
|
494
|
+
{},
|
|
495
|
+
`/tasks/${props.taskId}/return`
|
|
496
|
+
)
|
|
497
|
+
|
|
498
|
+
MessagePlugin.success('退回成功')
|
|
499
|
+
|
|
500
|
+
showReturnDialog.value = false
|
|
501
|
+
returnReason.value = ''
|
|
502
|
+
emit('refresh')
|
|
503
|
+
} catch (err) {
|
|
504
|
+
MessagePlugin.error(err.message || '退回失败')
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
onMounted(async () => {
|
|
509
|
+
if (props.taskId) {
|
|
510
|
+
await getCurrentTaskType()
|
|
511
|
+
await checkHasNextApprover()
|
|
512
|
+
await checkIsInWhiteList()
|
|
513
|
+
}
|
|
514
|
+
})
|
|
515
|
+
</script>
|
|
516
|
+
|
|
517
|
+
<style scoped>
|
|
518
|
+
.component-base-style {
|
|
519
|
+
margin: 0px;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.approval-form {
|
|
523
|
+
position: relative;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.button-group {
|
|
527
|
+
display: flex;
|
|
528
|
+
justify-content: space-between;
|
|
529
|
+
align-items: center;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.more-actions {
|
|
533
|
+
margin-right: 10px;
|
|
534
|
+
}
|
|
535
535
|
</style>
|