|
@@ -2,12 +2,12 @@
|
|
|
<div class="flow-detail-content">
|
|
|
<div class="flow-detail-container">
|
|
|
<!-- 值为空 -->
|
|
|
- <div v-if="!visibleDialog" class="flow-empty-detail-box">
|
|
|
+ <div v-if="!currentTaskRow.taskId" class="flow-empty-detail-box">
|
|
|
<el-empty description="暂无数据" />
|
|
|
</div>
|
|
|
|
|
|
<!-- 值不为空 -->
|
|
|
- <template v-if="visibleDialog">
|
|
|
+ <template v-if="currentTaskRow.taskId">
|
|
|
<!-- 1、头部信息 -->
|
|
|
<div class="flow-status-stamp">
|
|
|
<div class="flow-stamp-container">
|
|
@@ -16,7 +16,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="flow-header-box">
|
|
|
- <div class="flow-no">编号:1759387444983226369</div>
|
|
|
+ <div class="flow-no">编号:{{ currentTaskRow.taskId }}</div>
|
|
|
<div class="action-area">
|
|
|
<div class="action-item"></div>
|
|
|
</div>
|
|
@@ -26,12 +26,12 @@
|
|
|
<!--头部-->
|
|
|
<div class="header-box">
|
|
|
<div class="summary-info">
|
|
|
- <div class="title">{{ taskObj.processName }}</div>
|
|
|
+ <div class="title">{{ currentTaskRow.processName }}</div>
|
|
|
<FlowStatusTag :status="0" />
|
|
|
</div>
|
|
|
<div class="initiator-info">
|
|
|
<FlowNodeAvatar id="1" />
|
|
|
- <div class="begin-time">{{ taskObj.createTime }} 提交</div>
|
|
|
+ <div class="begin-time">{{ currentTaskRow.createTime }} 提交</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="area-divider"></div>
|
|
@@ -83,7 +83,7 @@
|
|
|
<el-icon><Switch /></el-icon>
|
|
|
回退
|
|
|
</el-dropdown-item>
|
|
|
- <el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="openComment('addSignVisible')">
|
|
|
<el-icon><Plus /></el-icon>
|
|
|
加签
|
|
|
</el-dropdown-item>
|
|
@@ -99,10 +99,10 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 评论弹窗-->
|
|
|
- <review-dialog v-if="reviewVisible" v-model="reviewVisible" :task-id="taskId"></review-dialog>
|
|
|
+ <review-dialog v-if="reviewVisible" v-model="reviewVisible" :task-id="taskId" @success-cb="closeDetailEv"></review-dialog>
|
|
|
|
|
|
<!-- 加签弹窗 -->
|
|
|
- <add-sign-dialog v-if="addSignVisible" v-model="addSignVisible" :task-id="taskId"></add-sign-dialog>
|
|
|
+ <add-sign-dialog v-if="addSignVisible" v-model="addSignVisible" :task-id="taskId" @success-cb="closeDetailEv"></add-sign-dialog>
|
|
|
|
|
|
<!-- 同意或拒绝弹窗 -->
|
|
|
<consent-or-refuse-dialog
|
|
@@ -110,21 +110,28 @@
|
|
|
v-model="consentOrRefuseVisible"
|
|
|
:task-id="taskId"
|
|
|
:current-type="currentDialog"
|
|
|
+ @success-cb="closeDetailEv"
|
|
|
></consent-or-refuse-dialog>
|
|
|
|
|
|
<!-- 转交审批弹窗 -->
|
|
|
- <deliver-to-review-dialog v-if="deliverToReviewVisible" v-model="deliverToReviewVisible" :task-id="taskId"></deliver-to-review-dialog>
|
|
|
+ <deliver-to-review-dialog
|
|
|
+ v-if="deliverToReviewVisible"
|
|
|
+ v-model="deliverToReviewVisible"
|
|
|
+ :task-id="taskId"
|
|
|
+ @success-cb="closeDetailEv"
|
|
|
+ ></deliver-to-review-dialog>
|
|
|
|
|
|
<!-- 减签弹窗 -->
|
|
|
- <lose-sign-dialog v-if="loseSignVisible" v-model="loseSignVisible" :task-id="taskId"></lose-sign-dialog>
|
|
|
+ <lose-sign-dialog v-if="loseSignVisible" v-model="loseSignVisible" :task-id="taskId" @success-cb="closeDetailEv"></lose-sign-dialog>
|
|
|
|
|
|
<!-- 回退弹窗 -->
|
|
|
- <rollback-dialog v-if="rollbackVisible" v-model="rollbackVisible" :task-id="taskId"></rollback-dialog>
|
|
|
+ <rollback-dialog v-if="rollbackVisible" v-model="rollbackVisible" :task-id="taskId" @success-cb="closeDetailEv"></rollback-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { computed, ref, onMounted, nextTick } from 'vue'
|
|
|
+import useTaskProcessStore from '@/store/modules/taskProcess'
|
|
|
+import { computed, ref, onMounted, nextTick, watch } from 'vue'
|
|
|
import FlowStatusStamp from '@/components/Flow/FlowStatusStamp.vue'
|
|
|
import FlowStatusTag from '@/components/Flow/FlowStatusTag.vue'
|
|
|
import FlowNodeAvatar from '@/components/Flow/FlowNodeAvatar.vue'
|
|
@@ -139,18 +146,11 @@ import DeliverToReviewDialog from './deliverToReviewDialog'
|
|
|
import LoseSignDialog from './loseSignDialog'
|
|
|
import RollbackDialog from './rollbackDialog'
|
|
|
import viewForm from '@/utils/form'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
|
|
|
-const props = defineProps({
|
|
|
- modelValue: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
- },
|
|
|
- taskObj: {
|
|
|
- type: Object,
|
|
|
- default: () => ({})
|
|
|
- }
|
|
|
-})
|
|
|
-const emit = defineEmits(['update:modelValue', 'successFn'])
|
|
|
+// store值
|
|
|
+const taskProcessInfo = useTaskProcessStore()
|
|
|
+const { currentTaskRow } = storeToRefs(taskProcessInfo)
|
|
|
|
|
|
// 各种操作弹窗显示隐藏 start
|
|
|
const reviewVisible = ref(false)
|
|
@@ -163,18 +163,10 @@ const rollbackVisible = ref(false)
|
|
|
const activeData = ref([])
|
|
|
const currentDialog = ref(null)
|
|
|
|
|
|
-const visibleDialog = computed({
|
|
|
- get() {
|
|
|
- return props.modelValue
|
|
|
- },
|
|
|
- set(val) {
|
|
|
- emit('update:modelValue', val)
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
const taskId = computed(() => {
|
|
|
- return props.taskObj.taskId || ''
|
|
|
+ return currentTaskRow.value.taskId || ''
|
|
|
})
|
|
|
+
|
|
|
const FormCreate = viewForm.$form()
|
|
|
const validateForm = ref({
|
|
|
api: {},
|
|
@@ -185,18 +177,36 @@ const validateForm = ref({
|
|
|
loading: false
|
|
|
})
|
|
|
|
|
|
-// 关闭按钮
|
|
|
-const closeDrawer = () => {
|
|
|
- emit('successFn')
|
|
|
- emit('update:modelValue', false)
|
|
|
-}
|
|
|
-
|
|
|
-const handleCancel = () => {
|
|
|
- closeDrawer()
|
|
|
+/**
|
|
|
+ * 拿到当前关闭详情弹窗
|
|
|
+ */
|
|
|
+const closeDetailEv = () => {
|
|
|
+ // 存储表单 todo.....
|
|
|
+ // 如果这里有表单,是否要把所有表单的内容进行存储,存储完毕后,才能关闭这个详情,刷新左侧的列表 todo
|
|
|
+ // return todo
|
|
|
+ debugger
|
|
|
+ taskProcessInfo.refresh = true
|
|
|
+ taskProcessInfo.setCurrentTaskRow({})
|
|
|
}
|
|
|
|
|
|
-// 操作按钮
|
|
|
+/**
|
|
|
+ * 详情按钮各个操作弹窗
|
|
|
+ * @param type 评论 拒绝 同意等
|
|
|
+ */
|
|
|
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) {
|
|
|
case 'reviewVisible':
|
|
|
reviewVisible.value = !reviewVisible.value
|
|
@@ -205,22 +215,6 @@ const openComment = (type, item) => {
|
|
|
addSignVisible.value = !addSignVisible.value
|
|
|
break
|
|
|
case 'consentOrRefuseVisible':
|
|
|
- // 点击同意
|
|
|
- if (item === 'agree') {
|
|
|
- debugger
|
|
|
- // 验证表单 todo...
|
|
|
- const api = validateForm.value.api
|
|
|
- api.validate((valid, fail) => {
|
|
|
- if (valid) {
|
|
|
- const values = api.formData()
|
|
|
- console.warn(values, 'values')
|
|
|
- //todo 表单验证通过
|
|
|
- } else {
|
|
|
- //todo 表单验证未通过
|
|
|
- }
|
|
|
- })
|
|
|
- // return
|
|
|
- }
|
|
|
currentDialog.value = item
|
|
|
consentOrRefuseVisible.value = !consentOrRefuseVisible.value
|
|
|
break
|
|
@@ -236,9 +230,11 @@ const openComment = (type, item) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-nextTick(() => {
|
|
|
- if(!visibleDialog.value) return
|
|
|
- const cur = props.taskObj || {}
|
|
|
+/**
|
|
|
+ * 获取taskId对应的详情
|
|
|
+ */
|
|
|
+const getTaskDetail = () => {
|
|
|
+ const cur = currentTaskRow.value || {}
|
|
|
processApprovalInfoApi(cur.taskId).then(data => {
|
|
|
// console.log(JSON.stringify(data))
|
|
|
activeData.value = data
|
|
@@ -294,7 +290,22 @@ nextTick(() => {
|
|
|
.finally(() => {
|
|
|
validateForm.value.loading = false
|
|
|
})
|
|
|
-})
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 监听同级子组件的taskId的值变化
|
|
|
+ * 1、监听taskId的值变化,如果值有变化,则重新获取审批详情
|
|
|
+ * 2、如果taskId没有值,则不请求接口,暂时暂无数据img
|
|
|
+ */
|
|
|
+watch(
|
|
|
+ () => currentTaskRow.value.taskId,
|
|
|
+ (nValue, oValue) => {
|
|
|
+ if (!nValue) return
|
|
|
+ nextTick(() => {
|
|
|
+ getTaskDetail()
|
|
|
+ })
|
|
|
+ }
|
|
|
+)
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|