|
@@ -0,0 +1,236 @@
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div class="calBack_box">
|
|
|
+ <div class="card">
|
|
|
+ <h4>{{callbackTitle}}</h4>
|
|
|
+ <ul class="callback_process">
|
|
|
+ <li
|
|
|
+ v-for="(item, index) in callbacks"
|
|
|
+ :key="index"
|
|
|
+ :class="{ active: backActivityIndex === index }"
|
|
|
+ @click="selectCActivityHandle(item, index)"
|
|
|
+ >
|
|
|
+ <el-icon style="margin-right: 2px">
|
|
|
+ <DArrowRight />
|
|
|
+ </el-icon>
|
|
|
+ <span>{{ item['name'] }}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="card">
|
|
|
+ <h4>退回原因</h4>
|
|
|
+ <van-form required="auto" class="form">
|
|
|
+ <van-field
|
|
|
+ v-model="callbackForm.callbackRemark"
|
|
|
+ name=""
|
|
|
+ label=""
|
|
|
+ placeholder="请填写退回原因"
|
|
|
+ type="textarea"
|
|
|
+ rows="5"
|
|
|
+ autosize
|
|
|
+ />
|
|
|
+ </van-form>
|
|
|
+ </div>
|
|
|
+ <div class="fixed-btn">
|
|
|
+ <div>
|
|
|
+ <van-button round block type="primary" @click="toBackHandle">
|
|
|
+ 取消
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <van-button round block type="warning" @click="callbackSumbit">
|
|
|
+ 退回
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { showDialog, closeDialog } from 'vant';
|
|
|
+import { CallbackFormType, getCalBackActivityNew, checkReturnMethod, callbackActivitySure } from '@/service/flow';
|
|
|
+
|
|
|
+defineOptions({
|
|
|
+ name: 'CalBack'
|
|
|
+})
|
|
|
+const props = defineProps<{
|
|
|
+ data: {
|
|
|
+ FLOWINSID: string
|
|
|
+ ACTIVITYINSID: string
|
|
|
+ }
|
|
|
+}>();
|
|
|
+const emit = defineEmits<{
|
|
|
+ (e: 'close', payload?: any):void
|
|
|
+}>();
|
|
|
+const backActivityIndex = ref<number>(0)
|
|
|
+const selectCActivityHandle = (item, index) => {
|
|
|
+ backActivityIndex.value = index
|
|
|
+}
|
|
|
+const toBackHandle = () => {
|
|
|
+ emit('close')
|
|
|
+}
|
|
|
+/**
|
|
|
+ * 退回
|
|
|
+ */
|
|
|
+const callbackTitle = ref<string>('退回至当前流程环节')
|
|
|
+const callbacks = ref<any[]>([])
|
|
|
+const callbackForm = reactive<CallbackFormType>({
|
|
|
+ flowInsId: '',
|
|
|
+ currentActInsId: '',
|
|
|
+ currentActTempId: '',
|
|
|
+ participantId: '',
|
|
|
+ position: '',
|
|
|
+ callbackRemark: '',
|
|
|
+ iBranchReturn: ''
|
|
|
+})
|
|
|
+const initCallbackFormData = (item: any) => {
|
|
|
+ callbackForm.flowInsId = item['flowInstanceId']
|
|
|
+ callbackForm.currentActInsId = item['currentActInsId']
|
|
|
+ callbackForm.currentActTempId = item['currentActTempId']
|
|
|
+ callbackForm.participantId = ''
|
|
|
+ callbackForm.position = ''
|
|
|
+ callbackForm.callbackRemark = ''
|
|
|
+}
|
|
|
+const callbackActivity = (item: any) => {
|
|
|
+ getCalBackActivityNew({
|
|
|
+ activityInstanceId: item['ACTIVITYINSID'],
|
|
|
+ flowInsId: item['FLOWINSID']
|
|
|
+ }).then((result: any) => {
|
|
|
+ initCallbackFormData(result)
|
|
|
+ if (result.callbackParentNode.length > 0) {
|
|
|
+ callbackTitle.value = '退回至父流程环节'
|
|
|
+ callbacks.value = result.callbackParentNode
|
|
|
+ } else if (result.callbackNode.length > 0) {
|
|
|
+ callbackTitle.value = '退回至当前流程环节'
|
|
|
+ callbacks.value = result.callbackNode
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+console.log("props------------------")
|
|
|
+console.log(props.data)
|
|
|
+callbackActivity(props.data);
|
|
|
+//提交退回
|
|
|
+const callbackSumbit = () => {
|
|
|
+ const item = callbacks.value[backActivityIndex.value]
|
|
|
+ const backToActivitys = [
|
|
|
+ {
|
|
|
+ callbackActTempId: item['activityTemplateId'],
|
|
|
+ callbackActInsId: item['id']
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ checkReturnMethod({
|
|
|
+ paramMap: JSON.stringify(callbackForm),
|
|
|
+ backToActivitys: JSON.stringify(backToActivitys)
|
|
|
+ }).then((res: any) => {
|
|
|
+ if (res && !res.msg) {
|
|
|
+ callbackForm['iBranchReturn'] = res.isReturnAllSameLevelNode ? 'false' : 'true'
|
|
|
+ if (
|
|
|
+ res.isReturnAllSameLevelNode ||
|
|
|
+ res.isChildToParent == 1 ||
|
|
|
+ res.isBackToChild == 1 ||
|
|
|
+ res.isHaveChild == 1
|
|
|
+ ) {
|
|
|
+ let confirmTip = '此退件将退回所有同级办理环节,是否确认退件?'
|
|
|
+ if (res.isChildToParent == 1) {
|
|
|
+ confirmTip = '此退件将退回至父流程,是否确认退件?'
|
|
|
+ } else if (res.isBackToChild == 1) {
|
|
|
+ confirmTip = '此退件将退回至子流程,是否确认退件?'
|
|
|
+ } else if (res.isHaveChild == 1) {
|
|
|
+ confirmTip = '此退件包含子流程退回,是否确认退件?'
|
|
|
+ } else if (res.isSameReturn == 1) {
|
|
|
+ confirmTip = '是否确认同级退件?'
|
|
|
+ }
|
|
|
+ showDialog({
|
|
|
+ message: confirmTip,
|
|
|
+ showCancelButton: true,
|
|
|
+ confirmButtonText: '退回',
|
|
|
+ beforeClose: function(action: string) {
|
|
|
+ closeDialog()
|
|
|
+ if (action === 'confirm') {
|
|
|
+ callbackActivitySure({
|
|
|
+ paramMap: JSON.stringify(callbackForm),
|
|
|
+ backToActivitys: JSON.stringify(backToActivitys)
|
|
|
+ }).then((res: any) => {
|
|
|
+ if (res) {
|
|
|
+ emit('close', true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ callbackActivitySure({
|
|
|
+ paramMap: JSON.stringify(callbackForm),
|
|
|
+ backToActivitys: JSON.stringify(backToActivitys)
|
|
|
+ }).then((res: any) => {
|
|
|
+ if (res) {
|
|
|
+ emit('close', true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.calBack_box {
|
|
|
+ background-color: #f7f8fa;
|
|
|
+ padding: 10px;
|
|
|
+ height: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ >.card {
|
|
|
+ background: #fff;
|
|
|
+ padding: 10px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ border-radius: 5px;
|
|
|
+ >h4 {
|
|
|
+ font-size: 17px;
|
|
|
+ padding: 5px 0px;
|
|
|
+ margin: 0px;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ >.form {
|
|
|
+ border-radius: 3px;
|
|
|
+ border: 1px solid #eff1f5 !important;
|
|
|
+ :deep(.van-field__control) {
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ >.callback_process {
|
|
|
+ font-size: 16px;
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(3, 1fr);
|
|
|
+ grid-gap: 10px;
|
|
|
+ >li {
|
|
|
+ align-items: center;
|
|
|
+ border: 1px solid #409eff;
|
|
|
+ color: #409eff;
|
|
|
+ padding: 5px 12px;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 14px;
|
|
|
+ border-radius: 4px;
|
|
|
+ cursor: pointer;
|
|
|
+ &.active {
|
|
|
+ background-color: #409eff;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ >.fixed-btn {
|
|
|
+ padding: 10px 10px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ position: fixed;
|
|
|
+ left: 0px;
|
|
|
+ right: 0px;
|
|
|
+ bottom: 0px;
|
|
|
+ margin: auto;
|
|
|
+ >div {
|
|
|
+ flex: 1;
|
|
|
+ margin: 0px 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|