| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397 |
- <template>
- <view>
- <u-popup
- :show="visible"
- mode="center"
- width="100%"
- height="90%"
- border-radius="12"
- @close="cancel"
- :custom-style="{ width: '90vw', maxHeight: '90vh', overflow: 'auto' }"
- >
- <view class="submit-verify-container">
- <view class="header">
- <text class="title">{{ dialog.title }}</text>
- <u-icon name="close" size="24" @click="cancel" />
- </view>
- <scroll-view scroll-y class="content" :show-scrollbar="false">
- <!-- 消息提醒 -->
- <!-- <view class="form-item">
- <text class="label">消息提醒</text>
- <u-checkbox-group
- v-model="form.messageType"
- @change="handleMessageTypeChange"
- >
- <view class="checkbox-row">
- <u-checkbox
- name="1"
- :checked="true"
- :disabled="true"
- activeColor="#2979ff"
- >
- 站内信
- </u-checkbox>
- <u-checkbox name="2" activeColor="#2979ff">邮件</u-checkbox>
- <u-checkbox name="3" activeColor="#2979ff">短信</u-checkbox>
- </view>
- </u-checkbox-group>
- </view> -->
- <!-- 附件上传 -->
- <view class="form-item">
- <text class="label">附件</text>
- <FileUpload
- v-model="form.fileId"
- :file-type="[
- 'png',
- 'jpg',
- 'jpeg',
- 'doc',
- 'docx',
- 'xlsx',
- 'xls',
- 'ppt',
- 'txt',
- 'pdf',
- ]"
- :file-size="20"
- />
- </view>
- <!-- 抄送 -->
- <view v-if="buttonObj.copy" class="form-item">
- <text class="label">抄送</text>
- <view class="copy-section">
- <u-button
- type="primary"
- plain
- size="mini"
- icon="plus"
- @click="openUserSelectCopy"
- class="add-copy-btn"
- >
- 添加抄送人
- </u-button>
- <view v-if="selectCopyUserList.length > 0" class="copy-users">
- <u-tag
- v-for="user in selectCopyUserList"
- :key="user.userId"
- :text="user.nickName"
- :type="getCopyUserType()"
- size="mini"
- closable
- @close="handleCopyCloseTag(user)"
- class="copy-tag"
- />
- </view>
- </view>
- </view>
- <!-- 下一步审批人 -->
- <view
- v-if="buttonObj.pop && nestNodeList && nestNodeList.length > 0"
- class="form-item"
- >
- <text class="label">下一步审批人</text>
- <view class="next-approver-section">
- <view
- v-for="(item, index) in nestNodeList"
- :key="index"
- class="approver-item"
- >
- <text class="node-name">【{{ item.nodeName }}】</text>
- <view class="approver-select">
- <u-input
- v-model="nickName[item.nodeCode]"
- placeholder="请选择审批人"
- readonly
- suffix-icon="arrow-right"
- @click="choosePeople(item)"
- />
- </view>
- </view>
- </view>
- </view>
- <!-- 审批意见 -->
- <view v-if="task.flowStatus === 'waiting'" class="form-item">
- <text class="label">审批意见</text>
- <u-textarea
- v-model="form.message"
- placeholder="请输入审批意见"
- :maxlength="500"
- height="120"
- count
- />
- </view>
- </scroll-view>
- <!-- 底部操作按钮 -->
- <view class="footer">
- <view class="buttons-grid">
- <u-button
- type="primary"
- plain
- :loading="buttonDisabled"
- @click="handleCompleteTask"
- class="action-btn"
- >
- 提交
- </u-button>
- <!-- <u-button
- v-if="task.flowStatus === 'waiting' && buttonObj.trust"
- type="warning"
- :loading="buttonDisabled"
- @click="openDelegateTask"
- class="action-btn"
- >
- 委托
- </u-button>
- <u-button
- v-if="task.flowStatus === 'waiting' && buttonObj.transfer"
- type="warning"
- :loading="buttonDisabled"
- @click="openTransferTask"
- class="action-btn"
- >
- 转办
- </u-button>
- <u-button
- v-if="
- task.flowStatus === 'waiting' &&
- Number(task.nodeRatio) > 0 &&
- buttonObj.addSign
- "
- type="warning"
- :loading="buttonDisabled"
- @click="openMultiInstanceUser"
- class="action-btn"
- >
- 加签
- </u-button>
- <u-button
- v-if="
- task.flowStatus === 'waiting' &&
- Number(task.nodeRatio) > 0 &&
- buttonObj.subSign
- "
- type="warning"
- :loading="buttonDisabled"
- @click="handleTaskUser"
- class="action-btn"
- >
- 减签
- </u-button> -->
- <u-button
- v-if="task.flowStatus === 'waiting' && buttonObj.termination"
- type="error"
- plain
- :loading="buttonDisabled"
- @click="handleTerminationTask"
- class="action-btn"
- >
- 终止
- </u-button>
- <u-button
- v-if="task.flowStatus === 'waiting' && buttonObj.back"
- type="warning"
- shape="round"
- plain
- :loading="buttonDisabled"
- @click="handleBackProcessOpen"
- class="action-btn"
- >
- 退回
- </u-button>
- <!-- <u-button type="info" @click="cancel" class="action-btn">取消</u-button> -->
- </view>
- </view>
- </view>
- <!-- 抄送用户选择 -->
- <UserSelect
- ref="userSelectCopyRef"
- :multiple="true"
- :data="selectCopyUserIds"
- @confirmCallBack="userSelectCopyCallBack"
- />
- <!-- 转办用户选择 -->
- <UserSelect
- ref="transferTaskRef"
- :multiple="false"
- @confirmCallBack="handleTransferTask"
- />
- <!-- 委托用户选择 -->
- <UserSelect
- ref="delegateTaskRef"
- :multiple="false"
- @confirmCallBack="handleDelegateTask"
- />
- <!-- 加签用户选择 -->
- <UserSelect
- ref="multiInstanceUserRef"
- :multiple="true"
- @confirmCallBack="addMultiInstanceUser"
- />
- <!-- 下一步审批人选择 -->
- <UserSelect
- ref="porUserRef"
- :multiple="true"
- :userIds="popUserIds"
- @confirmCallBack="handlePopUser"
- />
- </u-popup>
- <!-- 退回弹窗 -->
- <u-popup
- :show="backVisible"
- mode="center"
- width="80%"
- height="70%"
- border-radius="12"
- z-index="20080"
- @close="closeBackDialog"
- :custom-style="{ width: '90vw' }"
- >
- <view class="back-container">
- <view class="header">
- <text class="title">驳回</text>
- <u-icon name="close" size="24" @click="closeBackDialog" />
- </view>
- <scroll-view scroll-y class="content" :show-scrollbar="false">
- <!-- 驳回节点 -->
- <view class="form-item horizontal-item">
- <text class="label horizontal-label">驳回节点</text>
- <view class="horizontal-control">
- <u-picker
- :columns="[taskNodeList]"
- keyName="nodeName"
- :defaultIndex="[selectedBackNodeIndex]"
- :show="showBackNodePicker"
- :closeOnClickOverlay="true"
- @confirm="onBackNodeConfirm"
- @cancel="onBackNodeClose"
- ></u-picker>
- <view class="picker-input" @click="showBackNodePicker = true">
- <text class="picker-text">
- {{ selectedBackNodeName || '请选择驳回节点' }}
- </text>
- <u-icon name="arrow-down" size="16" color="#c0c4cc"></u-icon>
- </view>
- </view>
- </view>
- <!-- 消息提醒 -->
- <!-- <view class="form-item">
- <text class="label">消息提醒</text>
- <u-checkbox-group v-model="backForm.messageType">
- <view class="checkbox-row">
- <u-checkbox
- name="1"
- :checked="true"
- :disabled="true"
- activeColor="#2979ff"
- >
- 站内信
- </u-checkbox>
- <u-checkbox name="2" activeColor="#2979ff">邮件</u-checkbox>
- <u-checkbox name="3" activeColor="#2979ff">短信</u-checkbox>
- </view>
- </u-checkbox-group>
- </view> -->
- <!-- 附件 -->
- <view class="form-item">
- <text class="label">附件</text>
- <FileUpload
- v-model="backForm.fileId"
- :file-type="[
- 'png',
- 'jpg',
- 'jpeg',
- 'doc',
- 'docx',
- 'xlsx',
- 'xls',
- 'ppt',
- 'txt',
- 'pdf',
- ]"
- :file-size="20"
- />
- </view>
- <!-- 审批意见 -->
- <view class="form-item">
- <text class="label">审批意见</text>
- <u-textarea
- v-model="backForm.message"
- placeholder="请输入审批意见"
- :maxlength="500"
- height="120"
- count
- />
- </view>
- </scroll-view>
- <view class="footer">
- <view class="buttons-grid">
- <u-button
- type="primary"
- plain
- :loading="backButtonDisabled"
- @click="handleBackProcess"
- class="action-btn"
- >
- 确认
- </u-button>
- <u-button
- type="info"
- plain
- @click="closeBackDialog"
- class="action-btn cancel-btn"
- >
- 取消
- </u-button>
- </view>
- </view>
- </view>
- </u-popup>
- <!-- 减签弹窗 -->
- <u-popup
- :show="deleteSignatureVisible"
- mode="center"
- width="90%"
- height="60%"
- border-radius="12"
- z-index="20080"
- @close="deleteSignatureVisible = false"
- >
- <view class="delete-signature-container">
- <view class="header">
- <text class="title">减签人员</text>
- <u-icon name="close" size="24" @click="deleteSignatureVisible = false" />
- </view>
- <scroll-view scroll-y class="content" :show-scrollbar="false">
- <view v-if="deleteUserList.length === 0" class="empty-data">
- <u-empty text="暂无可减签人员" mode="data" />
- </view>
- <view v-else class="user-list">
- <view v-for="user in deleteUserList" :key="user.userId" class="user-item">
- <view class="user-info">
- <text class="task-name">{{ user.nodeName }}</text>
- <text class="user-name">{{ user.nickName }}</text>
- </view>
- <u-button
- type="error"
- plain
- size="mini"
- @click="deleteMultiInstanceUser(user)"
- class="delete-btn"
- >
- 删除
- </u-button>
- </view>
- </view>
- </scroll-view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import { request } from '@/common/request.js';
- import UserSelect from '@/components/UserSelect/index.vue';
- import FileUpload from '@/components/FileUpload/index.vue';
- export default {
- name: 'SubmitVerify',
- components: {
- UserSelect,
- FileUpload,
- },
- props: {
- taskVariables: {
- type: Object,
- default: () => ({}),
- },
- },
- data() {
- return {
- visible: false,
- loading: true,
- buttonDisabled: true,
- taskId: '',
- selectCopyUserList: [],
- selectCopyUserIds: undefined,
- deleteUserList: [],
- popUserIds: [],
- backVisible: false,
- backLoading: true,
- backButtonDisabled: true,
- taskNodeList: [],
- selectedBackNodeName: '',
- selectedBackNodeIndex: 0,
- showBackNodePicker: false,
- nickName: {},
- nodeCode: '',
- buttonObj: {
- pop: false,
- trust: false,
- transfer: false,
- addSign: false,
- subSign: false,
- termination: false,
- back: false,
- copy: false,
- },
- nestNodeList: [],
- task: {
- id: undefined,
- createTime: undefined,
- updateTime: undefined,
- tenantId: undefined,
- definitionId: undefined,
- instanceId: undefined,
- flowName: undefined,
- businessId: undefined,
- nodeCode: undefined,
- nodeName: undefined,
- flowCode: undefined,
- flowStatus: undefined,
- formCustom: undefined,
- formPath: undefined,
- nodeType: undefined,
- nodeRatio: undefined,
- applyNode: false,
- buttonList: [],
- },
- dialog: {
- visible: false,
- title: '提示',
- },
- deleteSignatureVisible: false,
- form: {
- taskId: undefined,
- message: undefined,
- assigneeMap: {},
- variables: {},
- messageType: ['1'],
- flowCopyList: [],
- fileId: undefined,
- },
- backForm: {
- taskId: undefined,
- nodeCode: undefined,
- message: undefined,
- variables: {},
- messageType: ['1'],
- fileId: undefined,
- },
- };
- },
- methods: {
- // 打开弹窗
- async openDialog(id) {
- this.selectCopyUserIds = undefined;
- this.selectCopyUserList = [];
- this.form.fileId = undefined;
- this.taskId = id;
- this.form.message = undefined;
- this.visible = true;
- this.loading = true;
- this.buttonDisabled = true;
- try {
- const response = await request({
- url: `/workflow/task/getTask/${this.taskId}`,
- method: 'GET',
- });
- if (response.code === 200) {
- this.task = response.data;
- this.buttonObj = {};
- this.task.buttonList.forEach((e) => {
- this.buttonObj[e.code] = e.show;
- });
- this.buttonDisabled = false;
- const data = {
- taskId: this.taskId,
- variables: this.taskVariables,
- };
- const nextData = await request({
- url: '/workflow/task/getNextNodeList',
- method: 'POST',
- data: data,
- });
- if (nextData.code === 200) {
- this.nestNodeList = nextData.data;
- }
- }
- } catch (error) {
- console.error('获取任务信息失败:', error);
- uni.showToast({
- title: '获取任务信息失败',
- icon: 'none',
- });
- } finally {
- this.loading = false;
- }
- },
- // 关闭弹窗
- cancel() {
- this.visible = false;
- this.buttonDisabled = false;
- this.nickName = {};
- this.form.assigneeMap = {};
- this.$emit('cancelCallback');
- },
- // 消息类型变化
- handleMessageTypeChange(values) {
- // 确保站内信始终选中
- if (!values.includes('1')) {
- values.push('1');
- }
- this.form.messageType = values;
- },
- // 办理流程
- async handleCompleteTask() {
- this.form.taskId = this.taskId;
- this.form.taskVariables = this.taskVariables;
- let verify = false;
- if (this.buttonObj.pop && this.nestNodeList && this.nestNodeList.length > 0) {
- this.nestNodeList.forEach((e) => {
- if (
- Object.keys(this.form.assigneeMap).length === 0 ||
- this.form.assigneeMap[e.nodeCode] === '' ||
- this.form.assigneeMap[e.nodeCode] === null ||
- this.form.assigneeMap[e.nodeCode] === undefined
- ) {
- verify = true;
- }
- });
- if (verify) {
- uni.showToast({
- title: '请选择审批人!',
- icon: 'none',
- });
- return false;
- }
- } else {
- this.form.assigneeMap = {};
- }
- if (this.selectCopyUserList && this.selectCopyUserList.length > 0) {
- const flowCopyList = [];
- this.selectCopyUserList.forEach((e) => {
- const copyUser = {
- userId: e.userId,
- userName: e.nickName,
- };
- flowCopyList.push(copyUser);
- });
- this.form.flowCopyList = flowCopyList;
- }
- try {
- const result = await this.showConfirm('是否确认提交?');
- if (result.confirm) {
- this.loading = true;
- this.buttonDisabled = true;
- console.log('longwu---form', this.form);
- const response = await request({
- url: '/workflow/task/completeTask',
- method: 'POST',
- data: this.form,
- });
- if (response.code === 200) {
- this.visible = false;
- this.$emit('submit-callback');
- uni.showToast({
- title: '操作成功',
- icon: 'success',
- });
- } else {
- uni.showToast({
- title: response.msg || '操作失败',
- icon: 'none',
- });
- }
- }
- } catch (error) {
- console.error('提交失败:', error);
- uni.showToast({
- title: '操作失败',
- icon: 'none',
- });
- } finally {
- this.loading = false;
- this.buttonDisabled = false;
- }
- },
- // 退回弹窗打开
- async handleBackProcessOpen() {
- this.backForm = {};
- this.backForm.messageType = ['1'];
- this.backVisible = true;
- this.backLoading = true;
- this.backButtonDisabled = true;
- try {
- const response = await request({
- url: `/workflow/task/getBackTaskNode/${this.task.definitionId}/${this.task.nodeCode}`,
- method: 'GET',
- });
- if (response.code === 200) {
- this.taskNodeList = response.data;
- this.backLoading = false;
- this.backButtonDisabled = false;
- if (this.taskNodeList.length > 0) {
- this.selectedBackNodeIndex = 0;
- this.backForm.nodeCode = this.taskNodeList[0].nodeCode;
- this.selectedBackNodeName = this.taskNodeList[0].nodeName;
- }
- }
- } catch (error) {
- console.error('获取退回节点失败:', error);
- uni.showToast({
- title: '获取退回节点失败',
- icon: 'none',
- });
- }
- },
- // 确认选择驳回节点
- onBackNodeConfirm(e) {
- const { indexs, value } = e;
- this.selectedBackNodeIndex = indexs[0];
- this.backForm.nodeCode = value[0].nodeCode;
- this.selectedBackNodeName = value[0].nodeName;
- this.showBackNodePicker = false;
- },
- // 取消选择驳回节点
- onBackNodeClose() {
- this.showBackNodePicker = false;
- },
- // 关闭退回弹窗
- closeBackDialog() {
- this.backVisible = false;
- this.showBackNodePicker = false;
- this.selectedBackNodeIndex = 0;
- this.selectedBackNodeName = '';
- },
- // 退回流程
- async handleBackProcess() {
- this.backForm.taskId = this.taskId;
- try {
- const result = await this.showConfirm('是否确认驳回?');
- if (result.confirm) {
- this.loading = true;
- this.backLoading = true;
- this.backButtonDisabled = true;
- const response = await request({
- url: '/workflow/task/backProcess',
- method: 'POST',
- data: this.backForm,
- });
- if (response.code === 200) {
- this.visible = false;
- this.closeBackDialog();
- console.log('驳回成功');
- this.$emit('submit-callback');
- uni.showToast({
- title: '操作成功',
- icon: 'success',
- });
- } else {
- uni.showToast({
- title: response.msg || '操作失败',
- icon: 'none',
- });
- }
- }
- } catch (error) {
- console.error('退回失败:', error);
- uni.showToast({
- title: '操作失败',
- icon: 'none',
- });
- } finally {
- this.loading = false;
- this.backLoading = false;
- this.backButtonDisabled = false;
- }
- },
- // 打开抄送人员
- openUserSelectCopy() {
- this.$refs.userSelectCopyRef.open();
- },
- // 确认抄送人员
- userSelectCopyCallBack(data) {
- if (data && data.length > 0) {
- this.selectCopyUserList = data;
- this.selectCopyUserIds = this.selectCopyUserList
- .map((item) => item.userId)
- .join(',');
- }
- },
- // 删除抄送人员
- handleCopyCloseTag(user) {
- const userId = user.userId;
- const index = this.selectCopyUserList.findIndex((item) => item.userId === userId);
- this.selectCopyUserList.splice(index, 1);
- this.selectCopyUserIds = this.selectCopyUserList.map((item) => item.userId).join(',');
- },
- // 加签
- openMultiInstanceUser() {
- this.$refs.multiInstanceUserRef.open();
- },
- // 加签确认
- async addMultiInstanceUser(data) {
- if (data && data.length > 0) {
- const taskOperationBo = {
- userIds: data.map((e) => e.userId),
- taskId: this.taskId,
- message: this.form.message,
- };
- try {
- const result = await this.showConfirm('是否确认提交?');
- if (result.confirm) {
- this.loading = true;
- this.buttonDisabled = true;
- const response = await request({
- url: '/workflow/task/taskOperation/addSignature',
- method: 'POST',
- data: taskOperationBo,
- });
- if (response.code === 200) {
- this.visible = false;
- this.$emit('submit-callback');
- uni.showToast({
- title: '操作成功',
- icon: 'success',
- });
- } else {
- uni.showToast({
- title: response.msg || '操作失败',
- icon: 'none',
- });
- }
- }
- } catch (error) {
- console.error('加签失败:', error);
- uni.showToast({
- title: '操作失败',
- icon: 'none',
- });
- } finally {
- this.loading = false;
- this.buttonDisabled = false;
- }
- } else {
- uni.showToast({
- title: '请选择用户!',
- icon: 'none',
- });
- }
- },
- // 减签
- async deleteMultiInstanceUser(row) {
- try {
- const result = await this.showConfirm('是否确认提交?');
- if (result.confirm) {
- this.loading = true;
- this.buttonDisabled = true;
- const taskOperationBo = {
- userIds: [row.userId],
- taskId: this.taskId,
- message: this.form.message,
- };
- const response = await request({
- url: '/workflow/task/taskOperation/reductionSignature',
- method: 'POST',
- data: taskOperationBo,
- });
- if (response.code === 200) {
- this.visible = false;
- this.deleteSignatureVisible = false;
- this.$emit('submit-callback');
- uni.showToast({
- title: '操作成功',
- icon: 'success',
- });
- } else {
- uni.showToast({
- title: response.msg || '操作失败',
- icon: 'none',
- });
- }
- }
- } catch (error) {
- console.error('减签失败:', error);
- uni.showToast({
- title: '操作失败',
- icon: 'none',
- });
- } finally {
- this.loading = false;
- this.buttonDisabled = false;
- }
- },
- // 打开转办
- openTransferTask() {
- this.$refs.transferTaskRef.open();
- },
- // 转办
- async handleTransferTask(data) {
- if (data && data.length > 0) {
- const taskOperationBo = {
- userId: data[0].userId,
- taskId: this.taskId,
- message: this.form.message,
- };
- try {
- const result = await this.showConfirm('是否确认提交?');
- if (result.confirm) {
- this.loading = true;
- this.buttonDisabled = true;
- const response = await request({
- url: '/workflow/task/taskOperation/transferTask',
- method: 'POST',
- data: taskOperationBo,
- });
- if (response.code === 200) {
- this.visible = false;
- this.$emit('submit-callback');
- uni.showToast({
- title: '操作成功',
- icon: 'success',
- });
- } else {
- uni.showToast({
- title: response.msg || '操作失败',
- icon: 'none',
- });
- }
- }
- } catch (error) {
- console.error('转办失败:', error);
- uni.showToast({
- title: '操作失败',
- icon: 'none',
- });
- } finally {
- this.loading = false;
- this.buttonDisabled = false;
- }
- } else {
- uni.showToast({
- title: '请选择用户!',
- icon: 'none',
- });
- }
- },
- // 打开委托
- openDelegateTask() {
- this.$refs.delegateTaskRef.open();
- },
- // 委托
- async handleDelegateTask(data) {
- if (data && data.length > 0) {
- const taskOperationBo = {
- userId: data[0].userId,
- taskId: this.taskId,
- message: this.form.message,
- };
- try {
- const result = await this.showConfirm('是否确认提交?');
- if (result.confirm) {
- this.loading = true;
- this.buttonDisabled = true;
- const response = await request({
- url: '/workflow/task/taskOperation/delegateTask',
- method: 'POST',
- data: taskOperationBo,
- });
- if (response.code === 200) {
- this.visible = false;
- this.$emit('submit-callback');
- uni.showToast({
- title: '操作成功',
- icon: 'success',
- });
- } else {
- uni.showToast({
- title: response.msg || '操作失败',
- icon: 'none',
- });
- }
- }
- } catch (error) {
- console.error('委托失败:', error);
- uni.showToast({
- title: '操作失败',
- icon: 'none',
- });
- } finally {
- this.loading = false;
- this.buttonDisabled = false;
- }
- } else {
- uni.showToast({
- title: '请选择用户!',
- icon: 'none',
- });
- }
- },
- // 终止任务
- async handleTerminationTask() {
- const params = {
- taskId: this.taskId,
- comment: this.form.message,
- };
- try {
- const result = await this.showConfirm('是否确认终止?');
- if (result.confirm) {
- this.loading = true;
- this.buttonDisabled = true;
- const response = await request({
- url: '/workflow/task/terminationTask',
- method: 'POST',
- data: params,
- });
- if (response.code === 200) {
- this.visible = false;
- this.$emit('submit-callback');
- uni.showToast({
- title: '操作成功',
- icon: 'success',
- });
- } else {
- uni.showToast({
- title: response.msg || '操作失败',
- icon: 'none',
- });
- }
- }
- } catch (error) {
- console.error('终止失败:', error);
- uni.showToast({
- title: '操作失败',
- icon: 'none',
- });
- } finally {
- this.loading = false;
- this.buttonDisabled = false;
- }
- },
- // 获取减签用户
- async handleTaskUser() {
- try {
- const response = await request({
- url: `/workflow/task/currentTaskAllUser/${this.taskId}`,
- method: 'GET',
- });
- if (response.code === 200) {
- this.deleteUserList = response.data;
- if (this.deleteUserList && this.deleteUserList.length > 0) {
- this.deleteUserList.forEach((e) => {
- e.nodeName = this.task.nodeName;
- });
- }
- this.deleteSignatureVisible = true;
- }
- } catch (error) {
- console.error('获取减签用户失败:', error);
- uni.showToast({
- title: '获取减签用户失败',
- icon: 'none',
- });
- }
- },
- // 选择人员
- choosePeople(data) {
- if (!data.permissionFlag) {
- uni.showToast({
- title: '没有可选择的人员,请联系管理员!',
- icon: 'none',
- });
- return;
- }
- this.popUserIds = data.permissionFlag;
- this.nodeCode = data.nodeCode;
- this.$refs.porUserRef.open();
- },
- // 确认选择人员
- handlePopUser(userList) {
- const userIds = userList.map((item) => item.userId);
- const nickNames = userList.map((item) => item.nickName);
- this.form.assigneeMap[this.nodeCode] = userIds.join(',');
- this.nickName[this.nodeCode] = nickNames.join(',');
- },
- // 显示确认对话框
- showConfirm(content) {
- return new Promise((resolve) => {
- // 临时隐藏所有弹窗,避免层级冲突
- const originalVisible = this.visible;
- const originalBackVisible = this.backVisible;
- const originalDeleteSignatureVisible = this.deleteSignatureVisible;
- this.visible = false;
- this.backVisible = false;
- this.deleteSignatureVisible = false;
- uni.showModal({
- title: '提示',
- content,
- success: (res) => {
- // 恢复所有弹窗显示状态
- this.visible = originalVisible;
- this.backVisible = originalBackVisible;
- this.deleteSignatureVisible = originalDeleteSignatureVisible;
- resolve(res);
- },
- fail: () => {
- // 恢复所有弹窗显示状态
- this.visible = originalVisible;
- this.backVisible = originalBackVisible;
- this.deleteSignatureVisible = originalDeleteSignatureVisible;
- resolve({ confirm: false });
- },
- });
- });
- },
- // 获取抄送用户标签类型
- getCopyUserType() {
- return 'primary'; // 抄送用户使用主要样式
- },
- },
- };
- </script>
- <style scoped>
- .submit-verify-container {
- height: 100%;
- display: flex;
- flex-direction: column;
- background: #fff;
- border-radius: 12rpx;
- }
- .header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 30rpx;
- border-bottom: 1rpx solid #f0f0f0;
- }
- .title {
- font-size: 32rpx;
- font-weight: 600;
- color: #333;
- }
- .content {
- flex: 1;
- padding: 30rpx;
- width: 90% !important;
- }
- .form-item {
- margin-bottom: 40rpx;
- }
- .label {
- display: block;
- font-size: 28rpx;
- font-weight: 500;
- color: #333;
- margin-bottom: 16rpx;
- }
- .checkbox-row {
- display: flex;
- gap: 40rpx;
- flex-wrap: wrap;
- }
- .copy-section {
- width: 100%;
- }
- .add-copy-btn {
- width: 200rpx;
- height: 60rpx;
- font-size: 24rpx;
- margin-bottom: 20rpx;
- }
- .copy-users {
- display: flex;
- flex-wrap: wrap;
- gap: 16rpx;
- max-height: 200rpx;
- overflow-y: auto;
- padding: 8rpx;
- border: 1rpx solid #e6e6e6;
- border-radius: 8rpx;
- background-color: #fafafa;
- }
- .copy-tag {
- margin: 4rpx 8rpx 4rpx 0;
- }
- .next-approver-section {
- width: 100%;
- }
- .approver-item {
- margin-bottom: 20rpx;
- }
- .node-name {
- display: block;
- font-size: 24rpx;
- color: #666;
- margin-bottom: 8rpx;
- }
- .approver-select {
- width: 100%;
- }
- .footer {
- padding: 30rpx;
- border-top: 1rpx solid #f0f0f0;
- background: #fff;
- }
- .buttons-grid {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 20rpx;
- width: 100%;
- direction: rtl;
- }
- .action-btn {
- height: 80rpx;
- border-radius: 40rpx;
- font-size: 28rpx;
- font-weight: 500;
- min-width: 0;
- direction: ltr;
- }
- .submit-btn {
- background: linear-gradient(
- 135deg,
- rgb(0, 81, 217) 0%,
- rgb(51, 122, 235) 50%,
- rgb(102, 163, 255) 100%
- ) !important;
- color: #fff;
- border: none;
- }
- .submit-btn::after {
- border: none;
- }
- .submit-btn:not([disabled]):active {
- background: linear-gradient(
- 135deg,
- rgb(0, 71, 197) 0%,
- rgb(41, 112, 225) 50%,
- rgb(92, 153, 245) 100%
- ) !important;
- }
- .back-container,
- .delete-signature-container {
- height: 100%;
- display: flex;
- flex-direction: column;
- background: #fff;
- border-radius: 12rpx;
- }
- .confirm-btn {
- background: linear-gradient(
- 135deg,
- rgb(0, 81, 217) 0%,
- rgb(51, 122, 235) 50%,
- rgb(102, 163, 255) 100%
- ) !important;
- color: #fff;
- border: none;
- }
- .confirm-btn::after {
- border: none;
- }
- .confirm-btn:not([disabled]):active {
- background: linear-gradient(
- 135deg,
- rgb(0, 71, 197) 0%,
- rgb(41, 112, 225) 50%,
- rgb(92, 153, 245) 100%
- ) !important;
- }
- .cancel-btn {
- flex: 1;
- height: 80rpx;
- border-radius: 40rpx;
- font-size: 28rpx;
- font-weight: 500;
- }
- .empty-data {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 300rpx;
- }
- .user-list {
- width: 100%;
- }
- .user-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 24rpx 0;
- border-bottom: 1rpx solid #f0f0f0;
- }
- .user-info {
- flex: 1;
- }
- .task-name {
- display: block;
- font-size: 28rpx;
- font-weight: 500;
- color: #333;
- margin-bottom: 8rpx;
- }
- .user-name {
- font-size: 24rpx;
- color: #666;
- }
- .delete-btn {
- height: 60rpx;
- padding: 0 24rpx;
- font-size: 24rpx;
- }
- .picker-input {
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 80rpx;
- padding: 0 24rpx;
- background-color: #f8f9fa;
- border: 1rpx solid #e6e6e6;
- border-radius: 8rpx;
- cursor: pointer;
- }
- .picker-input:active {
- background-color: #f0f0f0;
- }
- .picker-text {
- flex: 1;
- font-size: 28rpx;
- color: #333;
- }
- .picker-text:empty::before {
- content: attr(placeholder);
- color: #999;
- }
- .horizontal-item {
- display: flex;
- align-items: center;
- gap: 20rpx;
- }
- .horizontal-label {
- flex-shrink: 0;
- }
- .horizontal-control {
- flex: 1;
- width: 100%;
- }
- .horizontal-control .picker-input {
- width: 80% !important;
- }
- </style>
|