Browse Source

feat: 获取展示下一个节点的接口 - 20%

luoyali 6 months ago
parent
commit
b9dec00534
1 changed files with 36 additions and 8 deletions
  1. 36 8
      src/views/approve/components/consentOrRefuseDialog.vue

+ 36 - 8
src/views/approve/components/consentOrRefuseDialog.vue

@@ -17,6 +17,12 @@
 				<el-input v-model="form.content" type="textarea" placeholder="请输入内容" maxlength="64" show-word-limit> </el-input>
 				<el-input v-model="form.content" type="textarea" placeholder="请输入内容" maxlength="64" show-word-limit> </el-input>
 			</el-form-item>
 			</el-form-item>
 
 
+			<el-form-item label="下一节点审批人" prop="assigneeMap" v-if="nodeModels.length">
+				<div v-for="(item, index) in nodeModels" :key="index">
+					<FlowNodeAvatar v-for="(childItem, childIndex) in item.nodeAssigneeList" :key="childIndex" :name="childItem.name" style="margin-top: 5px" />
+				</div>
+			</el-form-item>
+
 			<el-form-item v-if="currentType !== 'reject'" label="推荐回复">
 			<el-form-item v-if="currentType !== 'reject'" label="推荐回复">
 				<el-tag v-for="(label, index) in buttonLabels" :key="index" type="info" class="ml-2 cursor-pointer" @click="appendToApprovalComments(label)">
 				<el-tag v-for="(label, index) in buttonLabels" :key="index" type="info" class="ml-2 cursor-pointer" @click="appendToApprovalComments(label)">
 					{{ label }}
 					{{ label }}
@@ -48,8 +54,9 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { computed, onMounted, reactive, ref, watch } from 'vue'
+import { computed, reactive, ref, watch, toRefs } from 'vue'
 import FileUpload from '@/components/FileUpload.vue'
 import FileUpload from '@/components/FileUpload.vue'
+import FlowNodeAvatar from '@/components/Flow/FlowNodeAvatar.vue'
 import { nextNodesApi, processConsentTaskApi, processPreviousNodeNameApi, processRejectionTaskApi } from '@/api/flow/processTask'
 import { nextNodesApi, processConsentTaskApi, processPreviousNodeNameApi, processRejectionTaskApi } from '@/api/flow/processTask'
 import { ElMessage } from 'element-plus'
 import { ElMessage } from 'element-plus'
 import { debounce } from 'lodash-es'
 import { debounce } from 'lodash-es'
@@ -86,15 +93,20 @@ const props = defineProps({
 	}
 	}
 })
 })
 const buttonLabels = ['同意', '已阅', '收到', '已核对', '合格', '情况属实', '确认', '已复核', '知悉', '辛苦了', '已安排']
 const buttonLabels = ['同意', '已阅', '收到', '已核对', '合格', '情况属实', '确认', '已复核', '知悉', '辛苦了', '已安排']
-const btnDisabled = ref(false)
 const form = reactive({
 const form = reactive({
 	nodeKey: undefined,
 	nodeKey: undefined,
 	content: ''
 	content: ''
 	// attachment: []
 	// attachment: []
 })
 })
-const formRef = ref(null)
-const uploadLoading = ref(false)
-const rollbackOptions = ref([])
+const datas = reactive({
+	formRef: null,
+	uploadLoading: false,
+	rollbackOptions: [],
+	btnDisabled: false,
+	nodeModels: []
+})
+const { formRef, uploadLoading, rollbackOptions, btnDisabled, nodeModels } = toRefs(datas)
+
 const $myEmit = defineEmits(['update:modelValue', 'successCb'])
 const $myEmit = defineEmits(['update:modelValue', 'successCb'])
 
 
 const submitForm = debounce(() => {
 const submitForm = debounce(() => {
@@ -161,8 +173,24 @@ const appendToApprovalComments = label => {
 }
 }
 
 
 const getNextNodesEv = async params => {
 const getNextNodesEv = async params => {
-	const data = await nextNodesApi(params)
-	console.log(data, 'data')
+	const { nodeModels } = await nextNodesApi(params)
+	nodeModels.value = (nodeModels.length && nodeModels) || []
+	/**
+	 * "nodeModels": [
+            {
+                "nodeName": "CEO审批",
+                "nodeKey": "flk1720532364452",
+                "nodeAssigneeList": [
+                    {
+                        "id": "0",
+                        "name": "CEO"
+                    }
+                ],
+                "selectMode": 1
+            },
+        ],
+        "nodeType": 1
+	 */
 }
 }
 
 
 // 驳回 && rejectStrategy === 3
 // 驳回 && rejectStrategy === 3
@@ -180,7 +208,7 @@ watch(
 
 
 watch(
 watch(
 	() => operaVisibleDialog.value,
 	() => operaVisibleDialog.value,
-	(newVal, oldVal) => {
+	newVal => {
 		if (newVal && props.currentType === 'agree') {
 		if (newVal && props.currentType === 'agree') {
 			const t = JSON.parse(props.formData.processForm || '{}')?.formData
 			const t = JSON.parse(props.formData.processForm || '{}')?.formData
 			const _param = {
 			const _param = {