Explorar o código

feat:我的材料缴交添加查看

DESKTOP-USV654P\pc hai 4 meses
pai
achega
c002daaa35

+ 1 - 1
src/views/materialManager/myTodoList/components/data.config.ts

@@ -54,7 +54,7 @@ export const TableColumns: BasicColumn[] = [
     dataIndex: 'action',
     slots: { customRender: 'action' },
     align: 'center',
-    width: 100,
+    width: 150,
   },
 ];
 export const RulesColumns: BasicColumn[] = [

+ 15 - 3
src/views/materialManager/myTodoList/components/viewModal.vue

@@ -21,6 +21,7 @@
 
   const taskDataInfo = ref<Recordable>({});
   const isUpdate = ref(true);
+  const isView = ref(false);
 
   const folderId = ref('');
   const fileList = ref([]);
@@ -41,7 +42,8 @@
   });
 
   const [registerModal, { closeModal, setModalProps }] = useModalInner(async (data) => {
-    setModalProps({ confirmLoading: false });
+    isView.value = !!data?.isView;
+    setModalProps({ confirmLoading: false, showOkBtn: !isView.value });
 
     isUpdate.value = !!data?.isUpdate;
 
@@ -51,7 +53,12 @@
       assignId: data.baseData.assignId,
       materialId: data.baseData.assignId,
     };
-    folderId.value = '';
+    if (unref(isView)) {
+      folderId.value = resData.files ? resData.files[0]?.folderId : '';
+    } else {
+      folderId.value = '';
+    }
+
     if (taskDataInfo.value?.materialCategory === 'MT0002') {
       await initForm(taskDataInfo.value.formReleaseId);
     }
@@ -259,7 +266,12 @@
             <span style="margin-bottom: 12px; font-size: 16px; color: black; margin-left: 12px">
               材料附件上传:
             </span>
-            <Upload style="margin-left: 12px" v-model:value="folderId" @reload="handleSuccess" />
+            <Upload
+              style="margin-left: 12px"
+              v-model:value="folderId"
+              @reload="handleSuccess"
+              :disabled="isView"
+            />
           </div>
         </template>
         <template v-else>

+ 11 - 4
src/views/materialManager/myTodoList/index.vue

@@ -2,18 +2,18 @@
   import { PageWrapper } from '/@/components/Page';
   import { TableAction, useTable } from '/@/components/Table';
   import BasicTable from '/@/components/Table/src/BasicTable.vue';
-  import formEdit from './components/formEdit.vue';
   import { SearchSchema, TableColumns } from './components/data.config';
   import { getMaterialtaskWaitPage } from '/@/services/apis/MaterialTaskController';
   import viewModal from './components/viewModal.vue';
   import { useModal } from '/@/components/Modal';
+  import { is } from '/@/utils/is';
   const [registerTable, { reload }] = useTable({
     title: '待交材料缴交任务列表',
     api: getMaterialtaskWaitPage,
     rowKey: 'id',
     columns: TableColumns,
     formConfig: {
-      labelWidth: 120,
+      labelWidth: 100,
       schemas: SearchSchema,
     },
     useSearchForm: true,
@@ -30,22 +30,29 @@
   const handleCurrentView = (record: any) => {
     openModal(true, { isUpdate: record.processStatus === 4, baseData: { ...record } });
   };
+
+  const handleView = (record: any) => {
+    openModal(true, { isUpdate: true, isView: true, baseData: { ...record } });
+  };
 </script>
 
 <template>
   <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
     <BasicTable @register="registerTable">
       <template #action="{ record }">
-        <div style="display: flex; justify-content: center;">
+        <div style="display: flex; justify-content: center">
           <TableAction
             :actions="[
               {
                 label: '提交材料',
-                icon: 'clarity:note-edit-line',
                 disabled:
                   record.status !== 2 || record.processStatus === 2 || record.processStatus === 3,
                 onClick: handleCurrentView.bind(null, record),
               },
+              {
+                label: '查看',
+                onClick: handleView.bind(null, record),
+              },
             ]"
           />
         </div>