|
@@ -67,33 +67,55 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 3、底部操作按钮 -->
|
|
<!-- 3、底部操作按钮 -->
|
|
|
|
+ <!--
|
|
|
|
+ 1、已审批的任务不显示操作按钮
|
|
|
|
+ 2、我的申请显示撤回按钮
|
|
|
|
+ 3、认领任务显示认领按钮
|
|
|
|
+ 4、我收到的任务显示评论
|
|
|
|
+ -->
|
|
<div class="flow-actions">
|
|
<div class="flow-actions">
|
|
<el-button :icon="ChatLineSquare" @click="openComment('reviewVisible')">评论</el-button>
|
|
<el-button :icon="ChatLineSquare" @click="openComment('reviewVisible')">评论</el-button>
|
|
- <el-button :icon="Check" type="success" @click="openComment('consentOrRefuseVisible', 'agree')">同意</el-button>
|
|
|
|
- <el-button :icon="Close" type="danger" @click="openComment('consentOrRefuseVisible', 'reject')">拒绝</el-button>
|
|
|
|
- <el-dropdown style="margin-left: 12px">
|
|
|
|
- <el-button :icon="More">更多</el-button>
|
|
|
|
- <template #dropdown>
|
|
|
|
- <el-dropdown-menu>
|
|
|
|
- <el-dropdown-item @click.native="openComment('deliverToReviewVisible')">
|
|
|
|
- <el-icon><DArrowLeft /></el-icon>
|
|
|
|
- 转交
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- <el-dropdown-item @click.native="openComment('rollbackVisible')">
|
|
|
|
- <el-icon><Switch /></el-icon>
|
|
|
|
- 回退
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- <el-dropdown-item @click.native="openComment('addSignVisible')">
|
|
|
|
- <el-icon><Plus /></el-icon>
|
|
|
|
- 加签
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- <el-dropdown-item @click.native="openComment('loseSignVisible')">
|
|
|
|
- <el-icon><Minus /></el-icon>
|
|
|
|
- 减签
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- </el-dropdown-menu>
|
|
|
|
- </template>
|
|
|
|
- </el-dropdown>
|
|
|
|
|
|
+ <template v-if="currentTaskType !== 'myReceived' || currentTaskType !== 'approved'">
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="currentTaskType === 'pendingApproval'"
|
|
|
|
+ :icon="Check"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="openComment('consentOrRefuseVisible', 'agree')"
|
|
|
|
+ >同意</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="currentTaskType === 'pendingApproval'"
|
|
|
|
+ :icon="Close"
|
|
|
|
+ type="danger"
|
|
|
|
+ @click="openComment('consentOrRefuseVisible', 'reject')"
|
|
|
|
+ >拒绝</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button v-if="currentTaskType === 'myApplication'" :icon="Close" @click="withDrawTaskEv">撤回</el-button>
|
|
|
|
+ <el-button v-if="currentTaskType === 'pendingClaim'" :icon="Close" @click="claimTaskEv">认领</el-button>
|
|
|
|
+ <el-dropdown v-if="currentTaskType === 'pendingApproval'" style="margin-left: 12px">
|
|
|
|
+ <el-button :icon="More">更多</el-button>
|
|
|
|
+ <template #dropdown>
|
|
|
|
+ <el-dropdown-menu>
|
|
|
|
+ <el-dropdown-item @click.native="openComment('deliverToReviewVisible')">
|
|
|
|
+ <el-icon><DArrowLeft /></el-icon>
|
|
|
|
+ 转交
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ <el-dropdown-item @click.native="openComment('rollbackVisible')">
|
|
|
|
+ <el-icon><Switch /></el-icon>
|
|
|
|
+ 回退
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ <el-dropdown-item @click.native="openComment('addSignVisible')">
|
|
|
|
+ <el-icon><Plus /></el-icon>
|
|
|
|
+ 加签
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ <el-dropdown-item @click.native="openComment('loseSignVisible')">
|
|
|
|
+ <el-icon><Minus /></el-icon>
|
|
|
|
+ 减签
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dropdown>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
@@ -109,7 +131,8 @@
|
|
v-if="consentOrRefuseVisible"
|
|
v-if="consentOrRefuseVisible"
|
|
v-model="consentOrRefuseVisible"
|
|
v-model="consentOrRefuseVisible"
|
|
:task-id="taskId"
|
|
:task-id="taskId"
|
|
- :current-type="currentDialog"
|
|
|
|
|
|
+ :current-type="currentType"
|
|
|
|
+ :form-data="currentFormData"
|
|
@success-cb="closeDetailEv"
|
|
@success-cb="closeDetailEv"
|
|
></consent-or-refuse-dialog>
|
|
></consent-or-refuse-dialog>
|
|
|
|
|
|
@@ -137,7 +160,7 @@ import FlowStatusTag from '@/components/Flow/FlowStatusTag.vue'
|
|
import FlowNodeAvatar from '@/components/Flow/FlowNodeAvatar.vue'
|
|
import FlowNodeAvatar from '@/components/Flow/FlowNodeAvatar.vue'
|
|
import FlowTypeDot from '@/components/Flow/FlowTypeDot.vue'
|
|
import FlowTypeDot from '@/components/Flow/FlowTypeDot.vue'
|
|
import { ChatLineSquare, Check, Close, Switch, DArrowLeft, Plus, Minus, More } from '@element-plus/icons-vue'
|
|
import { ChatLineSquare, Check, Close, Switch, DArrowLeft, Plus, Minus, More } from '@element-plus/icons-vue'
|
|
-import { processApprovalInfoApi, processTaskApprovalInfo } from '@/api/flow/processTask'
|
|
|
|
|
|
+import { processApprovalInfoApi, processTaskApprovalInfo, processClaimTaskApi, processWithDrawTaskApi } from '@/api/flow/processTask'
|
|
import { formatTimestamp } from '@/utils/datetime'
|
|
import { formatTimestamp } from '@/utils/datetime'
|
|
import ReviewDialog from './reviewDialog'
|
|
import ReviewDialog from './reviewDialog'
|
|
import AddSignDialog from './addSignDialog'
|
|
import AddSignDialog from './addSignDialog'
|
|
@@ -148,6 +171,20 @@ import RollbackDialog from './rollbackDialog'
|
|
import viewForm from '@/utils/form'
|
|
import viewForm from '@/utils/form'
|
|
import { storeToRefs } from 'pinia'
|
|
import { storeToRefs } from 'pinia'
|
|
|
|
|
|
|
|
+const props = defineProps({
|
|
|
|
+ /**
|
|
|
|
+ * pendingApproval 待审批
|
|
|
|
+ * myApplication 我的申请
|
|
|
|
+ * myReceived 我收到的
|
|
|
|
+ * pendingClaim 认领任务
|
|
|
|
+ * approved 已审批
|
|
|
|
+ */
|
|
|
|
+ currentTaskType: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: ''
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+
|
|
// store值
|
|
// store值
|
|
const taskProcessInfo = useTaskProcessStore()
|
|
const taskProcessInfo = useTaskProcessStore()
|
|
const { currentTaskRow } = storeToRefs(taskProcessInfo)
|
|
const { currentTaskRow } = storeToRefs(taskProcessInfo)
|
|
@@ -161,8 +198,10 @@ const loseSignVisible = ref(false)
|
|
const rollbackVisible = ref(false)
|
|
const rollbackVisible = ref(false)
|
|
// 各种操作弹窗显示隐藏 end
|
|
// 各种操作弹窗显示隐藏 end
|
|
const activeData = ref([])
|
|
const activeData = ref([])
|
|
-const currentDialog = ref(null)
|
|
|
|
-
|
|
|
|
|
|
+const currentType = ref(null)
|
|
|
|
+const currentFormData = ref({})
|
|
|
|
+// 当前form 表单数据字符串
|
|
|
|
+let cur_processForm_str = '[]'
|
|
const taskId = computed(() => {
|
|
const taskId = computed(() => {
|
|
return currentTaskRow.value.taskId || ''
|
|
return currentTaskRow.value.taskId || ''
|
|
})
|
|
})
|
|
@@ -183,31 +222,16 @@ const validateForm = ref({
|
|
const closeDetailEv = () => {
|
|
const closeDetailEv = () => {
|
|
// 存储表单 todo.....
|
|
// 存储表单 todo.....
|
|
// 如果这里有表单,是否要把所有表单的内容进行存储,存储完毕后,才能关闭这个详情,刷新左侧的列表 todo
|
|
// 如果这里有表单,是否要把所有表单的内容进行存储,存储完毕后,才能关闭这个详情,刷新左侧的列表 todo
|
|
- // return todo
|
|
|
|
- debugger
|
|
|
|
taskProcessInfo.refresh = true
|
|
taskProcessInfo.refresh = true
|
|
- taskProcessInfo.setCurrentTaskRow({})
|
|
|
|
|
|
+ // taskProcessInfo.setCurrentTaskRow({})
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 详情按钮各个操作弹窗
|
|
* 详情按钮各个操作弹窗
|
|
- * @param type 评论 拒绝 同意等
|
|
|
|
|
|
+ * @param visibleType 评论 拒绝 同意等
|
|
*/
|
|
*/
|
|
-const openComment = (type, item) => {
|
|
|
|
- // 验证表单 todo...
|
|
|
|
- const api = validateForm.value.api
|
|
|
|
- api.validate((valid, fail) => {
|
|
|
|
- if (valid) {
|
|
|
|
- const values = api.formData()
|
|
|
|
- console.warn(values, 'values')
|
|
|
|
- //todo 表单验证通过
|
|
|
|
- } else {
|
|
|
|
- //todo 表单验证未通过
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- // return
|
|
|
|
-
|
|
|
|
- switch (type) {
|
|
|
|
|
|
+const openComment = async (visibleType, item) => {
|
|
|
|
+ switch (visibleType) {
|
|
case 'reviewVisible':
|
|
case 'reviewVisible':
|
|
reviewVisible.value = !reviewVisible.value
|
|
reviewVisible.value = !reviewVisible.value
|
|
break
|
|
break
|
|
@@ -215,7 +239,28 @@ const openComment = (type, item) => {
|
|
addSignVisible.value = !addSignVisible.value
|
|
addSignVisible.value = !addSignVisible.value
|
|
break
|
|
break
|
|
case 'consentOrRefuseVisible':
|
|
case 'consentOrRefuseVisible':
|
|
- currentDialog.value = item
|
|
|
|
|
|
+ currentFormData.value = {}
|
|
|
|
+ // 点击同意
|
|
|
|
+ let bool = true
|
|
|
|
+ if (item === 'agree') {
|
|
|
|
+ const api = validateForm.value.api
|
|
|
|
+ bool = await api.validate((valid, fail) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ // 表单验证通过
|
|
|
|
+ const values = api.formData()
|
|
|
|
+ const processForm = JSON.parse(cur_processForm_str)
|
|
|
|
+ processForm.forEach(v => {
|
|
|
|
+ // 填写的数据存储(local_: 本地数据处理标识)
|
|
|
|
+ v.local_value = values[v.field]
|
|
|
|
+ })
|
|
|
|
+ console.warn(processForm, 'processForm')
|
|
|
|
+ // 流程表单JSON内容 & local_value 保存
|
|
|
|
+ currentFormData.value = { processForm: JSON.stringify(processForm) }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (!bool) return
|
|
|
|
+ currentType.value = item
|
|
consentOrRefuseVisible.value = !consentOrRefuseVisible.value
|
|
consentOrRefuseVisible.value = !consentOrRefuseVisible.value
|
|
break
|
|
break
|
|
case 'deliverToReviewVisible':
|
|
case 'deliverToReviewVisible':
|
|
@@ -267,6 +312,7 @@ const getTaskDetail = () => {
|
|
}
|
|
}
|
|
})*/
|
|
})*/
|
|
const forms = JSON.parse(data.formContent)
|
|
const forms = JSON.parse(data.formContent)
|
|
|
|
+ cur_processForm_str = data.formContent
|
|
if (Array.isArray(forms)) {
|
|
if (Array.isArray(forms)) {
|
|
validateForm.value.rule = forms
|
|
validateForm.value.rule = forms
|
|
const api = validateForm.value.api
|
|
const api = validateForm.value.api
|
|
@@ -292,6 +338,18 @@ const getTaskDetail = () => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/** 认领任务 **/
|
|
|
|
+const claimTaskEv = async () => {
|
|
|
|
+ const res = await processClaimTaskApi(currentTaskRow.value.taskId)
|
|
|
|
+ console.log(res, 'res====')
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/** 撤回审批 **/
|
|
|
|
+const withDrawTaskEv = async () => {
|
|
|
|
+ const res = await processWithDrawTaskApi(currentTaskRow.value.taskId)
|
|
|
|
+ console.log(res)
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 监听同级子组件的taskId的值变化
|
|
* 监听同级子组件的taskId的值变化
|
|
* 1、监听taskId的值变化,如果值有变化,则重新获取审批详情
|
|
* 1、监听taskId的值变化,如果值有变化,则重新获取审批详情
|
|
@@ -326,6 +384,7 @@ watch(
|
|
position: absolute;
|
|
position: absolute;
|
|
right: 30px;
|
|
right: 30px;
|
|
top: 30px;
|
|
top: 30px;
|
|
|
|
+ z-index: 999;
|
|
}
|
|
}
|
|
|
|
|
|
// 头部
|
|
// 头部
|
|
@@ -390,7 +449,7 @@ watch(
|
|
.area-divider {
|
|
.area-divider {
|
|
border-bottom: 1px solid rgba(229, 230, 235, 1);
|
|
border-bottom: 1px solid rgba(229, 230, 235, 1);
|
|
margin: 20px 0;
|
|
margin: 20px 0;
|
|
- position: relative;
|
|
|
|
|
|
+ //position: relative;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -401,7 +460,7 @@ watch(
|
|
justify-content: flex-end;
|
|
justify-content: flex-end;
|
|
height: 52px;
|
|
height: 52px;
|
|
//border-top: 1px solid var(--color-neutral-3);
|
|
//border-top: 1px solid var(--color-neutral-3);
|
|
- border-top: 1px solid black;
|
|
|
|
|
|
+ border-top: 1px solid #e5e6ec;
|
|
padding: 0 20px;
|
|
padding: 0 20px;
|
|
}
|
|
}
|
|
}
|
|
}
|