Sfoglia il codice sorgente

查看流程修改

duy 1 settimana fa
parent
commit
b248e26733
1 ha cambiato i file con 41 aggiunte e 2 eliminazioni
  1. 41 2
      src/views/tasks/flow.vue

+ 41 - 2
src/views/tasks/flow.vue

@@ -13,8 +13,10 @@
             <template #extra>
                 <el-alert :closable="false" title="同一合同段内,只需要设置重复岗位的流程即可,其他任务岗位,系统将自动推送,无需创建更多任务流" type="error" />
             </template>
-            <hc-table ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading" is-new :index-style="{ width: 60 }">
+            <hc-table ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading" is-new>
                 <template #action="{ row }">
+                    <el-button plain size="small" type="primary" @click="handleTableView(row)">查看</el-button>
+                 
                     <hc-tooltip keys="tasks_flow_edit">
                         <el-button plain size="small" type="primary" :disabled="!row.deletedIs" @click="handleTableEdit(row)">编辑</el-button>
                     </hc-tooltip>
@@ -84,6 +86,18 @@
                 </el-button>
             </template>
         </hc-new-dialog>
+        <!-- 查看流程弹窗 -->
+         
+        <hc-new-dialog v-model="viewModal" :title="`${flowFormData.id ? '编辑' : '新增'}流程`" widths="40rem">
+            <el-form
+                ref="formFlowRef" class="p-4" :model="flowFormData" :rules="formFlowRules" label-width="auto"
+                size="large"
+            >
+                <el-form-item label="选择任务人" prop="fixedBranchList">
+                    <HcTasksUser ref="viewPeopleRef" :data="flowFormData.fixedBranchList" :datas="fixedData" ui="w-full" :is-view="true" @change="flowFormChange" @close="flowClose" />
+                </el-form-item>
+            </el-form>
+        </hc-new-dialog>
     </div>
 </template>
 
@@ -126,7 +140,7 @@ const tableListRef = ref(null)
 const tableListColumn = ref([
     { key: 'fixedFlowName', name: '流程名称' },
     { key: 'linkUserJoinString', name: '流程详情' },
-    { key: 'action', name: '操作', width: '200', align: 'center' },
+    { key: 'action', name: '操作', width: '250', align: 'center' },
 ])
 
 const getTableData = async () => {
@@ -193,6 +207,24 @@ const handleTableEdit = async (row) => {
     }
     showEditModal.value = true
     getFlowDetail().then()
+}
+const handleTableView = async (row) => {
+    
+     changeId.value = row.id
+    fixedData.value = {
+        id: row.id,
+        projectId: projectId.value,
+        contractId: contractId.value,
+    }
+
+    getFlowDetail().then()
+    viewModal.value = true
+    await nextTick()
+    viewPeopleRef.value.userShowModal()
+   
+    
+
+
 }
 
 const getFlowDetail = async () => {
@@ -213,6 +245,8 @@ const getFlowDetail = async () => {
 
 //新增编辑数据
 const showEditModal = ref(false)
+const viewModal = ref(false)
+const viewPeopleRef = ref(null)
 const formFlowRef = ref(null)
 const flowFormData = ref({ id: '', fixedName: '', fixedBranchList: [] })
 const formFlowRules = {
@@ -232,6 +266,11 @@ const formFlowRules = {
 const flowFormChange = (data) => {
     flowFormData.value.fixedBranchList = getArrValue(data)
 }
+const flowClose = ()=>{
+    if (viewModal.value) {
+       viewModal.value = false
+    }
+}
 
 //提交保存
 const sevaLoading = ref(false)