duy 3 өдөр өмнө
parent
commit
c22109a154
1 өөрчлөгдсөн 11 нэмэгдсэн , 4 устгасан
  1. 11 4
      src/views/tasks/flow.vue

+ 11 - 4
src/views/tasks/flow.vue

@@ -13,7 +13,7 @@
             <template #extra>
                 <el-alert :closable="false" title="同一合同段内,只需要设置重复岗位的流程即可,其他任务岗位,系统将自动推送,无需创建更多任务流" type="error" />
             </template>
-            <hc-table :column="tableListColumn" :datas="tableListData" :loading="tableLoading" is-new :index-style="{ width: 60 }">
+            <hc-table ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading" is-new :index-style="{ width: 60 }">
                 <template #action="{ row }">
                     <hc-tooltip keys="tasks_flow_edit">
                         <el-button plain size="small" type="primary" :disabled="!row.deletedIs" @click="handleTableEdit(row)">编辑</el-button>
@@ -121,6 +121,7 @@ const pageChange = ({ current, size }) => {
 //获取数据
 const tableLoading = ref(false)
 const tableListData = ref([])
+const tableListRef = ref(null)
 
 const tableListColumn = ref([
     { key: 'fixedFlowName', name: '流程名称' },
@@ -152,7 +153,7 @@ const handleCopyEditLoad = ref(false)
 const handleCopyEdit = async (row) => {
     handleCopyEditLoad.value = true
 
-    const { error, code, msg } = await tasksFlowApi.copyFixedFlowData(
+    const { error, code, msg, data } = await tasksFlowApi.copyFixedFlowData(
         {   
             ids: row.id,
         },
@@ -160,7 +161,12 @@ const handleCopyEdit = async (row) => {
         handleCopyEditLoad.value = false
     if (!error && code === 200) {
         window.$message?.success(msg)
-        getTableData().then()
+       await getTableData().then()
+           const targetId = data
+            nextTick(() => {
+               
+                tableListRef.value?.setCurrentRowByRowId(targetId)
+            })
     } 
 }
 
@@ -240,7 +246,7 @@ const saveFormClick = async () => {
     form.fixedBranchList = fixedBranchList
     if (!form.id && !form.fixedFlowId) {
         sevaLoading.value = true
-        const { error, code } = await tasksFlowApi.saveFixedFlow({
+        const { error, code, data } = await tasksFlowApi.saveFixedFlow({
             ...form,
             projectId: projectId.value,
             contractId: contractId.value,
@@ -251,6 +257,7 @@ const saveFormClick = async () => {
             showEditModal.value = false
             window?.$message?.success('保存成功')
             getTableData().then()
+         
         }
     } else {
         sevaLoading.value = true