Kaynağa Gözat

Merge branch 'feat/production-safety' of http://14.103.151.10:8888/product-group-fe/sfy-safety-group/sfy-safety into feat/production-safety

sunqijun 3 hafta önce
ebeveyn
işleme
fa25b66334

+ 28 - 28
src/router/routers/production-safety-router/hiddenTroubleInvestigationAndGovernance.ts

@@ -267,34 +267,34 @@
           noCache: false,
         },
       },
-      {
-        id: 900409,
-        parentId: 9004,
-        name: 'areaCheckPlanTask',
-        path: 'area-check-plan-task',
-        component: '/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanTask/areaCheckPlanTask',
-        meta: {
-          title: '区域检查计划任务(管理员)',
-          icon: 'OverviewIcon',
-          isRoot: false,
-          hidden: false,
-          noCache: false,
-        },
-      },
-      {
-        id: 90040901,
-        parentId: 900409,
-        name: 'areaCheckPlanTaskItem',
-        path: 'area-check-plan-task-item',
-        component: '/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanTask/areaCheckPlanTaskItem',
-        meta: {
-          title: '区域检查计划任务(管理员)详情',
-          icon: 'OverviewIcon',
-          isRoot: false,
-          hidden: true,
-          noCache: false,
-        },
-      },
+      // {
+      //   id: 900409,
+      //   parentId: 9004,
+      //   name: 'areaCheckPlanTask',
+      //   path: 'area-check-plan-task',
+      //   component: '/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanTask/areaCheckPlanTask',
+      //   meta: {
+      //     title: '区域检查计划任务(管理员)',
+      //     icon: 'OverviewIcon',
+      //     isRoot: false,
+      //     hidden: false,
+      //     noCache: false,
+      //   },
+      // },
+      // {
+      //   id: 90040901,
+      //   parentId: 900409,
+      //   name: 'areaCheckPlanTaskItem',
+      //   path: 'area-check-plan-task-item',
+      //   component: '/production-safety/hiddenTroubleInvestigationAndGovernance/areaCheckPlanTask/areaCheckPlanTaskItem',
+      //   meta: {
+      //     title: '区域检查计划任务(管理员)详情',
+      //     icon: 'OverviewIcon',
+      //     isRoot: false,
+      //     hidden: true,
+      //     noCache: false,
+      //   },
+      // },
       // {
       //   id: 900409,
       //   parentId: 9004,

+ 21 - 0
src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/list.vue

@@ -45,6 +45,18 @@
                   clearable
                 /> 
               </div>
+              <div class="select-box--item">
+                <span>申请时间:</span>
+                <el-date-picker
+                  v-model="dateRange"
+                  type="daterange"
+                  range-separator="-"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  value-format="YYYY-MM-DD"
+                  format="YYYY-MM-DD"
+                />
+              </div>
             </section>
             <section class="search-btn">
               <el-button type="primary" @click="handleSearch">查询</el-button>
@@ -129,6 +141,7 @@
   );
 
   const tableData = ref<PpePurchaseApply[]>([]);
+  const dateRange = ref<[string, string] | null>(null);
 
   const tableQuery = reactive<QueryPageRequest<QueryPurchaseApplyPageReq>>({
     pageNumber: pagination.pageNumber,
@@ -188,6 +201,13 @@
   }
 
   const handleSearch = () => {
+    if (dateRange.value && dateRange.value.length === 2) {
+      tableQuery.queryParam.startTime = dateRange.value[0];
+      tableQuery.queryParam.endTime = dateRange.value[1];
+    } else {
+      tableQuery.queryParam.startTime = '';
+      tableQuery.queryParam.endTime = '';
+    }
     pagination.pageNumber = 1;
     tableQuery.pageNumber = 1;
     getTableData();
@@ -198,6 +218,7 @@
     tableQuery.queryParam.status = undefined;
     tableQuery.queryParam.applyDeptCode = '';
     tableQuery.queryParam.applyDeptName = '';
+    dateRange.value = null;
     handleSearch();
   };
 

+ 30 - 0
src/views/production-safety/risk-identification-and-control/risk-manage/list.vue

@@ -64,6 +64,16 @@
               <el-option :value="3" label="低" />
             </el-select>
           </el-form-item>
+          <el-form-item label="责任人" prop="roomSafetyResponsible">
+          <el-select
+            v-model="queryParams.queryParam.roomSafetyResponsible"
+            placeholder="责任人"
+            style="width: 330px"
+            filterable
+          >
+            <el-option v-for="item in userOptions" :key="item.value" :label="item.label" :value="item.value" />
+          </el-select>
+        </el-form-item>
         </el-form>
 
         <div>
@@ -163,6 +173,7 @@
   import { Plus } from '@element-plus/icons-vue';
   import { useRouter } from 'vue-router';
   import {
+    queryAvailableUserList,
     safetyRiskListQueryPage,
     safetyRiskListDelete,
     safetyRiskListApprove,
@@ -182,6 +193,7 @@
   const router = useRouter();
   const { id } = useUserInfoHook();
   const firstLevelDepts = ref<any[]>([]);
+  const userOptions = ref<any[]>([]);
   const cascaderProp = {
     expandTrigger: 'click',
     checkStrictly: true,
@@ -220,10 +232,27 @@
       firstLevelDepts.value = formatDeptTree(res);
     });
   };
+
+  const handleQueryAvailableUserList = (deptName, realname = '') => {
+    queryAvailableUserList({
+      pageNumber: 1,
+      pageSize: 200,
+      queryParam: {
+        deptName,
+        realname,
+      },
+    }).then((res: any) => {
+      userOptions.value = (res.records || []).map((u: any) => ({
+        value: u.userId || u.id,
+        label: u.realname,
+      }));
+    });
+  };
   const handleChangeDept = () => {
     const deptInfo = cascaderRef.value?.getCheckedNodes();
     if (deptInfo?.[0]) {
       queryParams.queryParam.responsibleDepartment = deptInfo[0].label;
+      handleQueryAvailableUserList(deptInfo[0].label, 'responsibleDepartment');
     }
   };
   const handleView = (id)=>{
@@ -313,6 +342,7 @@
 
   onMounted(async () => {
     await getDeptData();
+    handleQueryAvailableUserList()
     queryTableList();
   });
 </script>

+ 153 - 92
src/views/production-safety/risk-identification-and-control/work-injury-apply-manage/components/detail.vue

@@ -57,18 +57,6 @@
             </span>
           </div>
         </div>
-        <span class="detail-reject-alert-content-download" @click="downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', '事故报告模板')">
-            事故报告  下载
-        </span>
-        <span class="detail-reject-alert-content-download" @click="downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', '委托书模板')">
-            委托书  下载
-        </span>
-        <span class="detail-reject-alert-content-download" @click="downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', '地址确认书模板')">
-            地址确认书  下载
-        </span>
-        <span class="detail-reject-alert-content-download" @click="downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', '申请表模板')">
-            申请表  下载
-        </span>
       </div>
     </div>
     <BasicForm
@@ -104,108 +92,128 @@
       </template>
 
       <template #accidentReport>
-        <UploadFiles
-          v-if="!isViewMode && !isAuditMode"
-          label="上传事故报告"
-          :maxCount="1"
-          :file-list="accidentCertUrl"
-          :disabled="isViewMode || isAuditMode"
-          @uploadSuccess="handleAccidentReportUploadSuccess"
-        />
-        <div class="file-list" v-else>
-          <div v-if="accidentCertUrl && accidentCertUrl.length > 0">
-            <div class="file-item" v-for="file in accidentCertUrl" :key="file.fileId">
-              <span class="file-item--name">{{ file.fileName }}</span>
-              <div class="file-item--footer">
-                <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
-                  >预览</el-button
-                >
-                <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
-                  >下载</el-button
-                >
+        <div class="flexBox">
+          <UploadFiles
+            v-if="!isViewMode && !isAuditMode"
+            label="上传事故报告"
+            :maxCount="1"
+            :file-list="accidentCertUrl"
+            :disabled="isViewMode || isAuditMode"
+            @uploadSuccess="handleAccidentReportUploadSuccess"
+          />
+          <div class="file-list" v-else>
+            <div v-if="accidentCertUrl && accidentCertUrl.length > 0">
+              <div class="file-item" v-for="file in accidentCertUrl" :key="file.fileId">
+                <span class="file-item--name">{{ file.fileName }}</span>
+                <div class="file-item--footer">
+                  <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
+                    >预览</el-button
+                  >
+                  <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
+                    >下载</el-button
+                  >
+                </div>
               </div>
             </div>
+            <div v-else class="no-attachment">暂无附件</div>
           </div>
-          <div v-else class="no-attachment">暂无附件</div>
+          <span class="detail-reject-alert-content-download" @click="downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', '事故报告模板')">
+              事故报告  下载
+          </span>
         </div>
       </template>
 
       <template #powerOfAttorney>
-        <UploadFiles
-          v-if="!isViewMode && !isAuditMode"
-          label="上传委托书"
-          :maxCount="1"
-          :file-list="powerAttorneyUrl"
-          :disabled="isViewMode || isAuditMode"
-          @uploadSuccess="handlePowerOfAttorneyUploadSuccess"
-        />
-        <div class="file-list" v-else>
-          <div v-if="powerAttorneyUrl && powerAttorneyUrl.length > 0">
-            <div class="file-item" v-for="file in powerAttorneyUrl" :key="file.fileId">
-              <span class="file-item--name">{{ file.fileName }}</span>
-              <div class="file-item--footer">
-                <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
-                  >预览</el-button
-                >
-                <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
-                  >下载</el-button
-                >
+        <div class="flexBox">
+          <UploadFiles
+            v-if="!isViewMode && !isAuditMode"
+            label="上传委托书"
+            :maxCount="1"
+            :file-list="powerAttorneyUrl"
+            :disabled="isViewMode || isAuditMode"
+            @uploadSuccess="handlePowerOfAttorneyUploadSuccess"
+          />
+          <div class="file-list" v-else>
+            <div v-if="powerAttorneyUrl && powerAttorneyUrl.length > 0">
+              <div class="file-item" v-for="file in powerAttorneyUrl" :key="file.fileId">
+                <span class="file-item--name">{{ file.fileName }}</span>
+                <div class="file-item--footer">
+                  <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
+                    >预览</el-button
+                  >
+                  <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
+                    >下载</el-button
+                  >
+                </div>
               </div>
             </div>
+            <div v-else class="no-attachment">暂无附件</div>
           </div>
-          <div v-else class="no-attachment">暂无附件</div>
+          <span class="detail-reject-alert-content-download" @click="downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', '委托书模板')">
+              委托书  下载
+          </span>
         </div>
       </template>
       <template #addressConfirmation>
-        <UploadFiles
-          v-if="!isViewMode && !isAuditMode"
-          label="上传地址确认书"
-          :maxCount="1"
-          :file-list="addressConfirmUrl"
-          :disabled="isViewMode || isAuditMode"
-          @uploadSuccess="handleAddressConfirmationUploadSuccess"
-        />
-        <div class="file-list" v-else>
-          <div v-if="addressConfirmUrl && addressConfirmUrl.length > 0">
-            <div class="file-item" v-for="file in addressConfirmUrl" :key="file.fileId">
-              <span class="file-item--name">{{ file.fileName }}</span>
-              <div class="file-item--footer">
-                <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
-                  >预览</el-button
-                >
-                <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
-                  >下载</el-button
-                >
+        <div class="flexBox">
+          <UploadFiles
+            v-if="!isViewMode && !isAuditMode"
+            label="上传地址确认书"
+            :maxCount="1"
+            :file-list="addressConfirmUrl"
+            :disabled="isViewMode || isAuditMode"
+            @uploadSuccess="handleAddressConfirmationUploadSuccess"
+          />
+          <div class="file-list" v-else>
+            <div v-if="addressConfirmUrl && addressConfirmUrl.length > 0">
+              <div class="file-item" v-for="file in addressConfirmUrl" :key="file.fileId">
+                <span class="file-item--name">{{ file.fileName }}</span>
+                <div class="file-item--footer">
+                  <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
+                    >预览</el-button
+                  >
+                  <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
+                    >下载</el-button
+                  >
+                </div>
               </div>
             </div>
+            <div v-else class="no-attachment">暂无附件</div>
           </div>
-          <div v-else class="no-attachment">暂无附件</div>
+          <span class="detail-reject-alert-content-download" @click="downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', '地址确认书模板')">
+            地址确认书  下载
+          </span>
         </div>
       </template>
       <template #applicationForm>
-        <UploadFiles
-          v-if="!isViewMode && !isAuditMode"
-          label="上传申请表"
-          :maxCount="1"
-          :file-list="applicationFormUrl"
-          :disabled="isViewMode || isAuditMode"
-          @uploadSuccess="handleApplicationFormUploadSuccess"
-        />
-        <div class="file-list" v-else>
-          <div v-if="applicationFormUrl && applicationFormUrl.length > 0">
-            <div class="file-item" v-for="file in applicationFormUrl" :key="file.fileId">
-              <span class="file-item--name">{{ file.fileName }}</span>
-              <div class="file-item--footer">
-                <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
-                  >预览</el-button
-                >
-                <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
-                  >下载</el-button
-                >
+        <div class="flexBox">
+          <UploadFiles
+            v-if="!isViewMode && !isAuditMode"
+            label="上传申请表"
+            :maxCount="1"
+            :file-list="applicationFormUrl"
+            :disabled="isViewMode || isAuditMode"
+            @uploadSuccess="handleApplicationFormUploadSuccess"
+          />
+          <div class="file-list" v-else>
+            <div v-if="applicationFormUrl && applicationFormUrl.length > 0">
+              <div class="file-item" v-for="file in applicationFormUrl" :key="file.fileId">
+                <span class="file-item--name">{{ file.fileName }}</span>
+                <div class="file-item--footer">
+                  <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
+                    >预览</el-button
+                  >
+                  <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
+                    >下载</el-button
+                  >
+                </div>
               </div>
             </div>
+            <div v-else class="no-attachment">暂无附件</div>
           </div>
-          <div v-else class="no-attachment">暂无附件</div>
+          <span class="detail-reject-alert-content-download" @click="downloadFile('./skyeye-file-upload/sfysecurity/TEMPLATE/施工证申请表.doc', '申请表模板')">
+            申请表  下载
+          </span>
         </div>
       </template>
       <template #idCard>
@@ -312,6 +320,32 @@
           <div v-else class="no-attachment">暂无附件</div>
         </div>
       </template>
+      <template #otherMaterials>
+        <UploadFiles
+          v-if="!isViewMode && !isAuditMode"
+          label="上传其它资料"
+          :maxCount="1"
+          :file-list="other"
+          :disabled="isViewMode || isAuditMode"
+          @uploadSuccess="handleOtherMaterialsUploadSuccess"
+        />
+        <div class="file-list" v-else>
+          <div v-if="other && other.length > 0">
+            <div class="file-item" v-for="file in other" :key="file.fileId">
+              <span class="file-item--name">{{ file.fileName }}</span>
+              <div class="file-item--footer">
+                <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
+                  >预览</el-button
+                >
+                <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
+                  >下载</el-button
+                >
+              </div>
+            </div>
+          </div>
+          <div v-else class="no-attachment">暂无附件</div>
+        </div>
+      </template>
       <template #status>
         <el-radio-group v-model="ruleFormData.status" :disabled="isViewMode">
           <el-radio label="ENABLE">启用</el-radio>
@@ -544,6 +578,7 @@
       ruleFormData.laborContractUrl = res.laborContractUrl || ''; // 劳动合同
       ruleFormData.initialMedicalCertUrl = res.initialMedicalCertUrl || ''; // 初次医疗证明
       ruleFormData.trusteeIdCardUrl = res.trusteeIdCardUrl || ''; // 被委托人员身份证正反面
+      ruleFormData.other = res.other || ''; // 其它资料
       ruleFormData.departmentCode = JSON.parse(res.departmentCode || '[]') || ''; // 部门编码
       ruleFormData.departmentName = res.departmentName || ''; // 添加这一行,设置部门名称
       ruleFormData.approvalTemplateId = res.templateId || ''; // 审批模板ID
@@ -575,6 +610,7 @@
         laborContractUrl: ruleFormData.laborContractUrl,
         initialMedicalCertUrl: ruleFormData.initialMedicalCertUrl,
         trusteeIdCardUrl: ruleFormData.trusteeIdCardUrl,
+        other: ruleFormData.other,
         departmentName: ruleFormData.departmentName || '',
         departmentCode: ruleFormData.departmentCode || '',
         templateId: Number(ruleFormData.approvalTemplateId),
@@ -651,6 +687,7 @@
   const laborContractUrl = computed(() => convertAttachmentJsonToFileItems(ruleFormData.laborContractUrl || ''));
   const initialMedicalCertUrl = computed(() => convertAttachmentJsonToFileItems(ruleFormData.initialMedicalCertUrl || ''));
   const trusteeIdCardUrl = computed(() => convertAttachmentJsonToFileItems(ruleFormData.trusteeIdCardUrl || ''));
+  const other = computed(() => convertAttachmentJsonToFileItems(ruleFormData.other || ''));
 
   async function handleAccidentReportUploadSuccess(files: FileItem[]) {
     if (!files?.length) {
@@ -819,6 +856,26 @@
       ElMessage.error(e?.message || e?.data || '被委托人员身份证正反面上传失败,请重试');
     }
   }
+  async function handleOtherMaterialsUploadSuccess(files: FileItem[]) {
+    if (!files?.length) {
+      ruleFormData.other = '';
+      return;
+    }
+    try {
+      const list = await formatAttachmentList(files);
+      const jsonArr = (list || []).map((r) => ({
+        file_name: r.fileName,
+        fileId: r.fileId || '',
+        fileSize: r.fileSize || '',
+        fileType: r.fileType || '',
+        fileUrl: r.fileUrl || '',
+      })).filter((x) => x.fileId);
+      ruleFormData.other = JSON.stringify(jsonArr);
+    } catch (e) {
+      console.error('被委托人员身份证正反面上传失败:', e);
+      ElMessage.error(e?.message || e?.data || '被委托人员身份证正反面上传失败,请重试');
+    }
+  }
 
   const getDeptData = () => {
     getAllDepartments().then((res) => {
@@ -932,10 +989,14 @@
     color: #409eff;
     margin-right: 15px;
     cursor: pointer;
+    white-space:nowrap;
   }
   .more-text-btn{
     cursor: pointer;
     color: #409eff;
 
   }
+  .flexBox{
+    display:flex;
+  }
 </style>

+ 6 - 0
src/views/production-safety/risk-identification-and-control/work-injury-apply-manage/configs/form.ts

@@ -87,6 +87,11 @@ export const INVENTORY_FORM_CONFIG: FormConfig[] = [
     label: '被委托人员身份证正反面:',
     slot: 'agentIdCard',
   },
+  {
+    prop: 'other',
+    label: '其他材料:',
+    slot: 'otherMaterials',
+  },
 ];
 
 export const INVENTORY_FORM_DATA = {
@@ -102,6 +107,7 @@ export const INVENTORY_FORM_DATA = {
   laborContractUrl: '',
   initialMedicalCertUrl: '',
   trusteeIdCardUrl: '',
+  other: '',
   applicantName: '',
   applicantCode: '',
   departmentCode: '',