Bladeren bron

审批家属名称问题

chenjun 1 maand geleden
bovenliggende
commit
6b191b91c2

+ 23 - 1
src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue

@@ -67,7 +67,9 @@ defineOptions({ name: 'BpmProcessInstanceTaskList' })
 
 const props = defineProps({
   loading: propTypes.bool.def(false), // 是否加载中
-  id: propTypes.string // 流程实例的编号
+  id: propTypes.string, // 流程实例的编号
+  path: propTypes.string,
+  name: propTypes.string
 })
 const tasks = ref([]) // 流程任务的数组
 
@@ -91,14 +93,34 @@ const handleFormDetail = async (row: any) => {
   fApi.value?.fapi?.disabled(true)
 }
 
+let nikeName = ''
+
 /** 只有 loading 完成时,才去加载流程列表 */
 watch(
   () => props.loading,
   async (value) => {
     if (value) {
       tasks.value = await TaskApi.getTaskListByProcessInstanceId(props.id)
+
+      if (props.path == 'elderly/elder/outward-registration/ProcessForm') {
+        if (tasks.value && tasks.value.length > 0) {
+          tasks.value[0].assigneeUser.nickname = nikeName
+        }
+      }
     }
   },
   { immediate: true }
 )
+
+const setInfo = (name) => {
+  nikeName  = name
+
+  if (props.path == 'elderly/elder/outward-registration/ProcessForm') {
+    if (tasks.value && tasks.value.length > 0) {
+      tasks.value[0].assigneeUser.nickname = nikeName
+    }
+  }
+}
+
+defineExpose({ setInfo })
 </script>

+ 26 - 5
src/views/bpm/task/process-list/detail.vue

@@ -49,13 +49,19 @@
         <BusinessFormComponent
           class="process-info"
           :id="processInstance.businessKey"
+          @up-name="getInfos"
           ref="formRef"
         />
       </template>
     </div>
 
     <p class="title" id="detail">审批记录</p>
-    <ProcessInstanceTaskList :loading="processInstanceLoading" :id="props.id" />
+    <ProcessInstanceTaskList
+      :loading="processInstanceLoading"
+      :id="props.id"
+      :path="pathA"
+      ref="taskTaskList"
+    />
     <div class="pb10"></div>
   </el-scrollbar>
   <template v-else>
@@ -74,6 +80,7 @@
       <template v-if="processDefinition?.formType === BpmModelFormType.CUSTOM">
         <BusinessFormComponent
           class="process-info"
+          @up-name="getInfos"
           :id="processInstance.businessKey"
           ref="formRef"
         />
@@ -81,7 +88,12 @@
     </div>
 
     <p class="title" id="detail">审批记录</p>
-    <ProcessInstanceTaskList :loading="processInstanceLoading" :id="props.id" />
+    <ProcessInstanceTaskList
+      :loading="processInstanceLoading"
+      :id="props.id"
+      :path="pathA"
+      ref="taskTaskList"
+    />
     <div class="pb10"></div>
   </template>
 
@@ -115,6 +127,7 @@ import runningSvg from '@/assets/svgs/bpm/running.svg'
 import approveSvg from '@/assets/svgs/bpm/approve.svg'
 import rejectSvg from '@/assets/svgs/bpm/reject.svg'
 import cancelSvg from '@/assets/svgs/bpm/cancel.svg'
+import { setConfAndFields2 } from '@/utils/formCreate'
 defineOptions({ name: 'BpmProcessDetail' })
 const props = defineProps<{
   id: string // 流程实例的编号
@@ -126,7 +139,8 @@ const props = defineProps<{
 const writableFields: Array<string> = [] // 表单可以编辑的字段
 const activeTab = ref('form')
 const message = useMessage() // 消息弹窗
-
+const formRef = ref('')
+const taskTaskList = ref('')
 const processInstance = ref<any>({}) // 流程实例
 const processDefinition = ref<any>({}) // 流程定义
 
@@ -147,9 +161,14 @@ const detailForm = ref({
   value: {}
 }) // 流程实例的表单详情
 
+const getInfos = (name) => {
+  console.log('nada', name)
+  taskTaskList.value.setInfo(name.outPerson)
+}
+
 /** 初始化 */
 const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
-
+let pathA = undefined
 const processInstanceLoading = ref(false)
 const taskLoading = ref(false)
 /** 加载流程实例 */
@@ -214,10 +233,13 @@ const getApprovalDetail = async () => {
         path = '/changes/ChangeFood/ProcessForm'
       }
       BusinessFormComponent.value = registerComponent(path)
+      pathA = path
+
     }
 
     // 获取审批节点,显示 Timeline 的数据
     activityNodes.value = data.activityNodes
+    console.log('BusinessFormComponent.value', activityNodes.value)
 
     // 获取待办任务显示操作按钮
     operationButtonRef.value?.loadTodoTask(data.todoTask)
@@ -280,7 +302,6 @@ watch(
   }
 )
 
-const formRef = ref('')
 watch(
   () => formRef.value,
   (val) => {

+ 7 - 1
src/views/elderly/elder/outward-registration/ProcessForm.vue

@@ -241,6 +241,7 @@ const init = async (id?: any, detail: boolean = false) => {
     const res = await getAskLeave(id)
     normalizeDetail(res)
     await getOutboundRefundConfigListFun(dataForm.value.tenantId)
+    emits('upName',res)
   } catch (_) {}
 }
 
@@ -271,7 +272,12 @@ const setTenantId = (tId: any) => {
   dataForm.value.tenantId = resolveTenantId(tId)
 }
 
-defineExpose({ init, submitForm, getProcess, resetForm, setTenantId })
+const getInfo = () => {
+  return 'AAAA'
+}
+const emits = defineEmits(['upName']) // 定义 emits
+
+defineExpose({ init, submitForm, getProcess, resetForm, setTenantId, getInfo })
 </script>
 
 <style lang="scss" scoped>