xiaweibo 2 месяцев назад
Родитель
Сommit
a1188f8c0f

+ 124 - 58
src/api/production-safety/personal-protective-equipment-purchase-apply.ts

@@ -3,115 +3,181 @@ import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
 
 
 /**
 /**
  * 劳防用品采购申请 - 实体与接口
  * 劳防用品采购申请 - 实体与接口
+ * 基础路径: /api/ppePurchaseApply
  * 状态:0-待审核,1-审核通过,-1-审核不通过
  * 状态:0-待审核,1-审核通过,-1-审核不通过
+ * 申请状态:1-待提交,2-待审批,3-已完成
+ * 审批状态:1-待审批,2-已审批,3-退回
  */
  */
 
 
-/** 采购申请明细行(劳防用品项) */
-export interface PurchaseApplyItem {
-  id?: number;
-  ppeName?: string; // 劳防用品名称
-  ppeId?: number; // 劳防用品ID(下拉选择)
-  stylePhoto?: string; // 样式照片(附件URL或JSON)
-  sizeOrShoeSize?: string; // 物品尺寸/鞋码
-  requiredQty?: number | string; // 需求数量
-  specModelType?: string; // 规格、型号、类型
-  unitPrice?: number | string; // 单价/元
-  productNo?: string; // 商品编号
-  remark?: string; // 备注
+/** 采购申请主表(列表项 / 提交用) */
+export interface PpePurchaseApply {
+  id?: number; // 采购申请主表唯一ID
+  applyCode?: number; // 申请单号(业务唯一)
+  applicantCode?: number; // 申请人编码
+  applicantName?: string; // 申请人名称
+  deptCode?: number; // 申请部门编码
+  deptName?: string; // 申请部门名称
+  status?: number; // 0-待审核/1-审核通过/-1审核不通过
+  statusName?: string; // 申请状态:1-待提交,2-待审批,3-已完成
+  nodeDescription?: string; // 当前节点名称
+  isDeleted?: number;
+  createdAt?: string;
+  updatedAt?: string;
+  templateId?: number; // 审核模板ID
+  approvalStatus?: number; // 1-待审批,2-已审批,3-退回
+  approvalOrder?: number; // 审批顺序
+  rejectReason?: string; // 退回原因
   [key: string]: any;
   [key: string]: any;
 }
 }
 
 
-export interface PersonalProtectiveEquipmentPurchaseApply {
-  id?: number;
-  applyNo?: string; // 申请单号
-  applicantName?: string; // 申请人
-  applicantDeptCode?: string; // 申请人部门编码
-  applicantDeptName?: string; // 申请人部门
-  ppeName?: string; // 用品名称(主表冗余,列表用)
-  status?: number; // 0-待审核,1-审核通过,-1-审核不通过
-  statusName?: string; // 状态名称
-  currentNodeName?: string; // 当前流程节点
-  auditDeptCode?: string; // 审核部门编码
-  auditDeptName?: string; // 审核部门名称
-  remark?: string;
-  /** 明细列表(劳防用品项) */
-  itemList?: PurchaseApplyItem[];
-  isDeleted?: string | number;
+/** 采购申请明细(劳防用品项)- 后端 PpePurchaseApplyDetail */
+export interface PpePurchaseApplyDetail {
+  id?: number; // 采购申请物品唯一ID
+  ppeApplyId?: number; // 关联的劳防采购申请单ID
+  equipmentId?: number; // 劳防用品ID(关联ppe表的id)
+  equipmentName?: string; // 劳防用品名称
+  specSize?: string; // 规格/尺寸/鞋码
+  applyNum?: number; // 需求数量
+  model?: string; // 产品型号/品类类型
+  unitPrice?: number; // 单价(元)
+  pictureUrl?: string; // 样式照片URL
+  remark?: string; // 申请备注
+  isDeleted?: number;
   createdAt?: string;
   createdAt?: string;
   updatedAt?: string;
   updatedAt?: string;
   [key: string]: any;
   [key: string]: any;
 }
 }
 
 
-/** 分页查询请求 - 查询条件 */
+/** 兼容旧组件:明细行(表单用,可同时兼容后端字段名) */
+export interface PurchaseApplyItem extends PpePurchaseApplyDetail {
+  ppeName?: string; // 同 equipmentName
+  ppeId?: number; // 同 equipmentId
+  stylePhoto?: string; // 同 pictureUrl 或附件 JSON
+  sizeOrShoeSize?: string; // 同 specSize
+  requiredQty?: number; // 同 applyNum
+  specModelType?: string; // 同 model
+  productNo?: string;
+  [key: string]: any;
+}
+
+/** 兼容旧组件:列表与表单主表 */
+export type PersonalProtectiveEquipmentPurchaseApply = PpePurchaseApply & {
+  applyNo?: string; // 展示用,可与 applyCode 互转
+  itemList?: PurchaseApplyItem[];
+  applicantDeptCode?: string;
+  applicantDeptName?: string;
+  currentNodeName?: string;
+};
+
+/** 分页查询请求 - 查询条件 QueryPersonalProtectiveEquipmentCommonPageReq */
 export interface QueryPurchaseApplyPageReq {
 export interface QueryPurchaseApplyPageReq {
-  /** 用品名称 或 申请人(模糊) */
-  keyword?: string;
+  /** 标题/搜索用品名称/申请人 */
+  name?: string;
   /** 状态:0-待审核,1-审核通过,-1-审核不通过 */
   /** 状态:0-待审核,1-审核通过,-1-审核不通过 */
-  status?: number;
-  /** 审核部门编码或名称 */
-  auditDeptCode?: string;
-  auditDeptName?: string;
+  status?: number | string;
+  /** 申请人部门CODE/申请部门编码 */
+  applyDeptCode?: string;
+  /** 申请人部门名称 */
+  applyDeptName?: string;
 }
 }
 
 
 /** 分页查询劳防用品采购申请列表 */
 /** 分页查询劳防用品采购申请列表 */
 export function queryPurchaseApplyList(
 export function queryPurchaseApplyList(
   query: QueryPageRequest<QueryPurchaseApplyPageReq>,
   query: QueryPageRequest<QueryPurchaseApplyPageReq>,
 ) {
 ) {
-  return http.request<QueryPageResponse<PersonalProtectiveEquipmentPurchaseApply>>({
-    url: '/personalProtectiveEquipmentPurchaseApply/queryPurchaseApplyList',
+  return http.request<QueryPageResponse<PpePurchaseApply>>({
+    url: '/ppePurchaseApply/queryPpePurchaseApplyList',
     method: 'post',
     method: 'post',
     data: query,
     data: query,
   });
   });
 }
 }
 
 
-/** 查询劳防用品采购申请详情 */
+/** 查询劳防用品详细内容(返回明细列表) */
 export function queryPurchaseApplyDetail(id: number) {
 export function queryPurchaseApplyDetail(id: number) {
-  return http.request<PersonalProtectiveEquipmentPurchaseApply>({
-    url: '/personalProtectiveEquipmentPurchaseApply/queryPurchaseApplyDetail',
+  return http.request<PpePurchaseApplyDetail[]>({
+    url: '/ppePurchaseApply/queryPpePurchaseApplyDetail',
     method: 'post',
     method: 'post',
     params: { id },
     params: { id },
   });
   });
 }
 }
 
 
-/** 新增劳防用品采购申请 */
-export function savePurchaseApply(data: PersonalProtectiveEquipmentPurchaseApply) {
+/** 删除劳防用品采购申请 */
+export function deletePurchaseApply(id: number) {
   return http.request({
   return http.request({
-    url: '/personalProtectiveEquipmentPurchaseApply/savePurchaseApply',
-    method: 'post',
+    url: '/ppePurchaseApply/deletePpePurchaseApply',
+    method: 'delete',
+    params: { id },
+  });
+}
+
+/** 审批信息项 */
+export interface ApprovalInfoItem {
+  approvalOrder?: number;
+  approverIdList?: string; // "1002,1003"
+}
+
+/** 编辑/提交请求体 SavePpePurchaseApplyReq */
+export interface SavePpePurchaseApplyReq extends PpePurchaseApply {
+  /** 保存或提交:0-保存 1-提交 */
+  saveOrSubmit?: number;
+  /** 审批描述 */
+  approvalDescription?: string;
+  /** 审批信息列表 */
+  approvalInfoList?: ApprovalInfoItem[];
+  /** 劳防采购申请列表详情 */
+  ppePurchaseApplyDetails?: PpePurchaseApplyDetail[];
+}
+
+/** 编辑劳防用品采购申请(保存/提交,带审批信息) */
+export function updatePurchaseApply(data: SavePpePurchaseApplyReq) {
+  return http.request({
+    url: '/ppePurchaseApply/submit',
+    method: 'put',
     data,
     data,
   });
   });
 }
 }
 
 
-/** 编辑劳防用品采购申请 */
-export function updatePurchaseApply(data: PersonalProtectiveEquipmentPurchaseApply) {
+/** 新增时也可走同一提交接口(无 id 或 saveOrSubmit=1) */
+export function savePurchaseApply(data: SavePpePurchaseApplyReq) {
   return http.request({
   return http.request({
-    url: '/personalProtectiveEquipmentPurchaseApply/updatePurchaseApply',
+    url: '/ppePurchaseApply/submit',
     method: 'put',
     method: 'put',
     data,
     data,
   });
   });
 }
 }
 
 
-/** 删除劳防用品采购申请 */
-export function deletePurchaseApply(id: number) {
+/** 提交审批 - 通过/退回 SaveApprovalReq */
+export interface SaveApprovalReq {
+  id: number;
+  approvalOrder?: number;
+  /** 审批状态: 1-待审批,2-已审批,3-退回 */
+  approvalStatus: number;
+  /** 退回原因 */
+  returnReason?: string;
+}
+
+/** 提交审批(通过/退回) */
+export function saveApproval(data: SaveApprovalReq) {
   return http.request({
   return http.request({
-    url: `/personalProtectiveEquipmentPurchaseApply/deletePurchaseApply?id=${id}`,
+    url: '/ppePurchaseApply/saveApproval',
     method: 'delete',
     method: 'delete',
+    data,
   });
   });
 }
 }
 
 
-/** 审核参数 */
+/** 审核参数(兼容旧调用:映射到 SaveApprovalReq) */
 export interface AuditPurchaseApplyParam {
 export interface AuditPurchaseApplyParam {
   id: number;
   id: number;
-  /** 1-审核通过,-1-审核不通过 */
+  /** 1-审核通过,-1-审核不通过 → 映射 approvalStatus 2/3 */
   status: number;
   status: number;
-  rejectReason?: string; // 审核不通过原因
+  rejectReason?: string; // 同 returnReason
 }
 }
 
 
-/** 审核劳防用品采购申请 */
+/** 审核劳防用品采购申请(通过/退回)- 兼容旧接口,内部调 saveApproval */
 export function auditPurchaseApply(data: AuditPurchaseApplyParam) {
 export function auditPurchaseApply(data: AuditPurchaseApplyParam) {
-  return http.request({
-    url: '/personalProtectiveEquipmentPurchaseApply/auditPurchaseApply',
-    method: 'post',
-    data,
+  return saveApproval({
+    id: data.id,
+    approvalStatus: data.status === 1 ? 2 : 3, // 1 通过→2 已审批,-1 不通过→3 退回
+    returnReason: data.rejectReason,
   });
   });
 }
 }

+ 1 - 1
src/router/routers/production-safety-router/safetyAssessment.ts

@@ -63,7 +63,7 @@
         path: 'receipt-record-administrator-review',
         path: 'receipt-record-administrator-review',
         component: '/production-safety/safetyAssessment/receiptRecord/receiptRecordAdministratorReview',
         component: '/production-safety/safetyAssessment/receiptRecord/receiptRecordAdministratorReview',
         meta: {
         meta: {
-          title: '物品领取记录管理(管理员审核)',
+          title: '物品领取审核列表',
           icon: 'OverviewIcon',
           icon: 'OverviewIcon',
           isRoot: false,
           isRoot: false,
           hidden: true,
           hidden: true,

+ 39 - 1
src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/Item.vue

@@ -1,7 +1,45 @@
 <template>
 <template>
-  <Detail />
+  <div class="safety-platform-container">
+    <header class="safety-platform-container__header">
+      <BreadcrumbBack />
+      <span class="breadcrumb-title">{{ headerTitle }}</span>
+    </header>
+    <Detail />
+  </div>
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
+  import { computed } from 'vue';
+  import { useRoute } from 'vue-router';
+  import BreadcrumbBack from '@/components/BreadcrumbBack.vue';
   import Detail from './components/detail.vue';
   import Detail from './components/detail.vue';
+
+  const route = useRoute();
+  const operate = (route.query.operate as string) || 'inventory-create';
+
+  const headerTitle = computed(() => {
+    switch (operate) {
+      case 'inventory-create':
+        return '新增劳防用品采购申请';
+      case 'inventory-edit':
+        return '编辑劳防用品采购申请';
+      case 'inventory-view':
+        return '查看劳防用品采购申请';
+      case 'audit':
+        return '审核劳防用品采购申请';
+      default:
+        return '劳防用品采购申请详情';
+    }
+  });
 </script>
 </script>
+
+<style scoped lang="scss">
+  @use '@/styles/page-details-layout.scss' as *;
+  @use '@/styles/page-main-layout.scss' as *;
+
+  .safety-platform-container__header {
+    flex-direction: row !important;
+    justify-content: flex-start !important;
+    gap: 8px !important;
+  }
+</style>

+ 97 - 68
src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/components/detail.vue

@@ -1,10 +1,5 @@
 <template>
 <template>
-  <div class="safety-platform-container">
-    <header class="safety-platform-container__header">
-      <BreadcrumbBack />
-      <span class="breadcrumb-title">{{ headerTitle }}</span>
-    </header>
-    <main class="safety-platform-container__main">
+  <main class="safety-platform-container__main">
     <el-form
     <el-form
       ref="formRef"
       ref="formRef"
       :model="form"
       :model="form"
@@ -30,7 +25,7 @@
           <el-table-column type="index" label="编号" width="100" align="center" />
           <el-table-column type="index" label="编号" width="100" align="center" />
           <el-table-column label="劳防用品名称" min-width="140">
           <el-table-column label="劳防用品名称" min-width="140">
             <template #default="{ row }">
             <template #default="{ row }">
-              <span v-if="isViewMode || isAuditMode">{{ row.ppeName || '-' }}</span>
+              <span v-if="isViewMode || isAuditMode">{{ row.ppeName || row.equipmentName || '-' }}</span>
               <el-select
               <el-select
                 v-else
                 v-else
                 v-model="row.ppeName"
                 v-model="row.ppeName"
@@ -63,7 +58,7 @@
           </el-table-column>
           </el-table-column>
           <el-table-column label="物品尺寸/鞋码" min-width="150">
           <el-table-column label="物品尺寸/鞋码" min-width="150">
             <template #default="{ row }">
             <template #default="{ row }">
-              <span v-if="isViewMode || isAuditMode">{{ row.sizeOrShoeSize || '-' }}</span>
+              <span v-if="isViewMode || isAuditMode">{{ row.sizeOrShoeSize || row.specSize || '-' }}</span>
               <el-input
               <el-input
                 v-else
                 v-else
                 v-model="row.sizeOrShoeSize"
                 v-model="row.sizeOrShoeSize"
@@ -74,7 +69,7 @@
           </el-table-column>
           </el-table-column>
           <el-table-column label="需求数量" min-width="150">
           <el-table-column label="需求数量" min-width="150">
             <template #default="{ row }">
             <template #default="{ row }">
-              <span v-if="isViewMode || isAuditMode">{{ row.requiredQty ?? '-' }}</span>
+              <span v-if="isViewMode || isAuditMode">{{ row.requiredQty ?? row.applyNum ?? '-' }}</span>
               <el-input-number
               <el-input-number
                 v-else
                 v-else
                 v-model="row.requiredQty"
                 v-model="row.requiredQty"
@@ -88,7 +83,7 @@
           </el-table-column>
           </el-table-column>
           <el-table-column label="规格、型号、类型" min-width="200">
           <el-table-column label="规格、型号、类型" min-width="200">
             <template #default="{ row }">
             <template #default="{ row }">
-              <span v-if="isViewMode || isAuditMode">{{ row.specModelType || '-' }}</span>
+              <span v-if="isViewMode || isAuditMode">{{ row.specModelType || row.model || '-' }}</span>
               <el-input
               <el-input
                 v-else
                 v-else
                 v-model="row.specModelType"
                 v-model="row.specModelType"
@@ -170,24 +165,23 @@
         </el-button>
         </el-button>
       </template>
       </template>
     </el-dialog>
     </el-dialog>
-    </main>
-    <footer class="safety-platform-container__footer">
-      <el-button @click="router.back()">返回</el-button>
-      <template v-if="isCreateMode || isEditMode">
-        <el-button type="primary" :loading="submitting" @click="handleSubmit">
-          {{ isCreateMode ? '提交' : '保存' }}
-        </el-button>
-      </template>
-      <template v-if="isAuditMode">
-        <el-button type="success" :loading="auditSubmitting" @click="handleAuditPass">
-          审核通过
-        </el-button>
-        <el-button type="danger" :loading="auditSubmitting" @click="showRejectDialog = true">
-          审核不通过
-        </el-button>
-      </template>
-    </footer>
-  </div>
+  </main>
+  <footer class="safety-platform-container__footer">
+    <el-button @click="router.back()">返回</el-button>
+    <template v-if="isCreateMode || isEditMode">
+      <el-button type="primary" :loading="submitting" @click="handleSubmit">
+        {{ isCreateMode ? '提交' : '保存' }}
+      </el-button>
+    </template>
+    <template v-if="isAuditMode">
+      <el-button type="success" :loading="auditSubmitting" @click="handleAuditPass">
+        审核通过
+      </el-button>
+      <el-button type="danger" :loading="auditSubmitting" @click="showRejectDialog = true">
+        审核不通过
+      </el-button>
+    </template>
+  </footer>
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
@@ -196,7 +190,6 @@
   import { ElMessage } from 'element-plus';
   import { ElMessage } from 'element-plus';
   import type { FormInstance, FormRules } from 'element-plus';
   import type { FormInstance, FormRules } from 'element-plus';
   import { Plus, Minus } from '@element-plus/icons-vue';
   import { Plus, Minus } from '@element-plus/icons-vue';
-  import BreadcrumbBack from '@/components/BreadcrumbBack.vue';
   import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
   import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
   import type { FileItem } from '@/components/UploadFiles/types';
   import type { FileItem } from '@/components/UploadFiles/types';
   import { queryPersonalProtectiveEquipmentList } from '@/api/production-safety/personal-protective-equipment';
   import { queryPersonalProtectiveEquipmentList } from '@/api/production-safety/personal-protective-equipment';
@@ -208,6 +201,8 @@
     auditPurchaseApply,
     auditPurchaseApply,
     type PersonalProtectiveEquipmentPurchaseApply,
     type PersonalProtectiveEquipmentPurchaseApply,
     type PurchaseApplyItem,
     type PurchaseApplyItem,
+    type PpePurchaseApplyDetail,
+    type SavePpePurchaseApplyReq,
   } from '@/api/production-safety/personal-protective-equipment-purchase-apply';
   } from '@/api/production-safety/personal-protective-equipment-purchase-apply';
   import type { QueryPageRequest } from '@/types/basic-query';
   import type { QueryPageRequest } from '@/types/basic-query';
 
 
@@ -221,21 +216,12 @@
 
 
   const operate = computed(() => (route.query.operate as string) || 'inventory-create');
   const operate = computed(() => (route.query.operate as string) || 'inventory-create');
   const currentId = computed(() => Number(route.query.id));
   const currentId = computed(() => Number(route.query.id));
-
-  const headerTitle = computed(() => {
-    switch (operate.value) {
-      case 'inventory-create':
-        return '新增劳防用品采购申请';
-      case 'inventory-edit':
-        return '编辑劳防用品采购申请';
-      case 'inventory-view':
-        return '查看劳防用品采购申请';
-      case 'audit':
-        return '审核劳防用品采购申请';
-      default:
-        return '劳防用品采购申请详情';
-    }
-  });
+  /** 从列表带入的申请单号/申请人/部门(无主表查询接口时用于展示) */
+  const mainFromQuery = computed(() => ({
+    applyCode: route.query.applyCode as string | undefined,
+    applicantName: route.query.applicantName as string | undefined,
+    deptName: route.query.deptName as string | undefined,
+  }));
 
 
   const isCreateMode = computed(() => operate.value === 'inventory-create');
   const isCreateMode = computed(() => operate.value === 'inventory-create');
   const isEditMode = computed(() => operate.value === 'inventory-edit');
   const isEditMode = computed(() => operate.value === 'inventory-edit');
@@ -266,14 +252,17 @@
   };
   };
 
 
   function getRowFileList(row: PurchaseApplyItem): FileItem[] {
   function getRowFileList(row: PurchaseApplyItem): FileItem[] {
+    if (row.pictureUrl && typeof row.pictureUrl === 'string') {
+      return [{ fileId: 0, fileName: '样式图', fileType: 'image', fileSize: '', fileUrl: row.pictureUrl }];
+    }
     if (!row.stylePhoto) return [];
     if (!row.stylePhoto) return [];
     try {
     try {
       const parsed = typeof row.stylePhoto === 'string' ? JSON.parse(row.stylePhoto) : row.stylePhoto;
       const parsed = typeof row.stylePhoto === 'string' ? JSON.parse(row.stylePhoto) : row.stylePhoto;
       const arr = Array.isArray(parsed) ? parsed : [parsed];
       const arr = Array.isArray(parsed) ? parsed : [parsed];
       return arr.map((f: any) => ({
       return arr.map((f: any) => ({
         fileId: f.fileId ?? 0,
         fileId: f.fileId ?? 0,
-        fileName: f.fileName ?? '',
-        fileType: f.fileType ?? 'pdf',
+        fileName: f.fileName ?? '样式图',
+        fileType: f.fileType ?? 'image',
         fileSize: f.fileSize ?? '',
         fileSize: f.fileSize ?? '',
         fileUrl: f.fileUrl,
         fileUrl: f.fileUrl,
       }));
       }));
@@ -282,8 +271,9 @@
     }
     }
   }
   }
 
 
-  /** 查看/审核时样式照片列仅显示文件名文本 */
+  /** 查看/审核时样式照片列仅显示文件名或链接文本 */
   function getStylePhotoDisplay(row: PurchaseApplyItem): string {
   function getStylePhotoDisplay(row: PurchaseApplyItem): string {
+    if (row.pictureUrl) return row.pictureUrl;
     const list = getRowFileList(row);
     const list = getRowFileList(row);
     if (!list.length) return '-';
     if (!list.length) return '-';
     return list.map((f) => f.fileName).filter(Boolean).join('、') || '-';
     return list.map((f) => f.fileName).filter(Boolean).join('、') || '-';
@@ -295,9 +285,51 @@
     );
     );
   }
   }
 
 
+  /** 后端明细行 → 表单行 */
+  function detailToItem(d: PpePurchaseApplyDetail): PurchaseApplyItem {
+    return {
+      ...defaultItem(),
+      id: d.id,
+      ppeApplyId: d.ppeApplyId,
+      equipmentId: d.equipmentId,
+      equipmentName: d.equipmentName,
+      ppeName: d.equipmentName,
+      ppeId: d.equipmentId,
+      specSize: d.specSize,
+      sizeOrShoeSize: d.specSize,
+      applyNum: d.applyNum,
+      requiredQty: d.applyNum,
+      model: d.model,
+      specModelType: d.model,
+      unitPrice: d.unitPrice,
+      pictureUrl: d.pictureUrl,
+      stylePhoto: d.pictureUrl ?? '',
+      remark: d.remark,
+    };
+  }
+
+  /** 表单行 → 后端明细行 */
+  function itemToDetail(it: PurchaseApplyItem): PpePurchaseApplyDetail {
+    return {
+      id: it.id,
+      ppeApplyId: it.ppeApplyId ?? currentId.value,
+      equipmentId: it.equipmentId ?? it.ppeId,
+      equipmentName: it.equipmentName ?? it.ppeName,
+      specSize: it.specSize ?? it.sizeOrShoeSize,
+      applyNum: it.applyNum ?? it.requiredQty,
+      model: it.model ?? it.specModelType,
+      unitPrice: it.unitPrice,
+      pictureUrl: it.pictureUrl ?? (typeof it.stylePhoto === 'string' ? it.stylePhoto : undefined),
+      remark: it.remark,
+    };
+  }
+
   function onPpeSelect(row: PurchaseApplyItem, ppeName: string) {
   function onPpeSelect(row: PurchaseApplyItem, ppeName: string) {
     const found = ppeOptions.value.find((p) => p.ppeName === ppeName);
     const found = ppeOptions.value.find((p) => p.ppeName === ppeName);
-    if (found?.id) row.ppeId = found.id;
+    if (found?.id) {
+      row.ppeId = found.id;
+      row.equipmentId = found.id;
+    }
   }
   }
 
 
   function addRow() {
   function addRow() {
@@ -326,10 +358,12 @@
   async function getDetail() {
   async function getDetail() {
     if (!currentId.value) return;
     if (!currentId.value) return;
     try {
     try {
+      form.applyNo = mainFromQuery.value.applyCode ?? '';
       const res = await queryPurchaseApplyDetail(currentId.value);
       const res = await queryPurchaseApplyDetail(currentId.value);
-      if (res) {
-        form.applyNo = res.applyNo ?? '';
-        form.itemList = (res.itemList && res.itemList.length) ? res.itemList.map((it) => ({ ...defaultItem(), ...it })) : [defaultItem()];
+      if (res && Array.isArray(res) && res.length) {
+        form.itemList = res.map((d) => detailToItem(d));
+      } else if (res && Array.isArray(res)) {
+        form.itemList = [defaultItem()];
       }
       }
     } catch (e) {
     } catch (e) {
       console.error('获取采购申请详情失败:', e);
       console.error('获取采购申请详情失败:', e);
@@ -337,29 +371,24 @@
     }
     }
   }
   }
 
 
-  function buildSubmitPayload() {
-    const itemList = form.itemList.map((it) => ({
-      ppeName: it.ppeName,
-      ppeId: it.ppeId,
-      stylePhoto: it.stylePhoto,
-      sizeOrShoeSize: it.sizeOrShoeSize,
-      requiredQty: it.requiredQty,
-      specModelType: it.specModelType,
-      unitPrice: it.unitPrice,
-      productNo: it.productNo,
-      remark: it.remark,
-    }));
+  function buildSubmitPayload(): SavePpePurchaseApplyReq {
+    const ppePurchaseApplyDetails = form.itemList
+      .filter((it) => it.ppeName || it.equipmentName)
+      .map((it) => itemToDetail(it));
     return {
     return {
       id: currentId.value || undefined,
       id: currentId.value || undefined,
-      applyNo: form.applyNo || undefined,
-      itemList,
+      applyCode: form.applyNo ? Number(form.applyNo) : undefined,
+      applicantName: mainFromQuery.value.applicantName,
+      deptName: mainFromQuery.value.deptName,
+      saveOrSubmit: isCreateMode.value ? 1 : 0,
+      ppePurchaseApplyDetails,
     };
     };
   }
   }
 
 
   async function handleSubmit() {
   async function handleSubmit() {
     const valid = await formRef.value?.validate().catch(() => false);
     const valid = await formRef.value?.validate().catch(() => false);
     if (!valid) return;
     if (!valid) return;
-    if (!form.itemList.length || form.itemList.every((it) => !it.ppeName)) {
+    if (!form.itemList.length || form.itemList.every((it) => !it.ppeName && !it.equipmentName)) {
       ElMessage.warning('请至少填写一条劳防用品明细');
       ElMessage.warning('请至少填写一条劳防用品明细');
       return;
       return;
     }
     }
@@ -367,10 +396,10 @@
     try {
     try {
       const payload = buildSubmitPayload();
       const payload = buildSubmitPayload();
       if (isCreateMode.value) {
       if (isCreateMode.value) {
-        await savePurchaseApply(payload as PersonalProtectiveEquipmentPurchaseApply);
+        await savePurchaseApply(payload);
         ElMessage.success('提交成功');
         ElMessage.success('提交成功');
       } else {
       } else {
-        await updatePurchaseApply(payload as PersonalProtectiveEquipmentPurchaseApply);
+        await updatePurchaseApply(payload);
         ElMessage.success('保存成功');
         ElMessage.success('保存成功');
       }
       }
       router.back();
       router.back();

+ 5 - 5
src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/configs/tables.ts

@@ -6,7 +6,7 @@ const TABLE_OPTIONS = {
   maxHeight: 'calc(70vh - 150px)',
   maxHeight: 'calc(70vh - 150px)',
 };
 };
 
 
-/** 劳防用品采购申请列表列:申请单号、申请人、申请人部门、状态、当前流程节点、操作 */
+/** 劳防用品采购申请列表列:申请单号、申请人、申请人部门、状态、当前流程节点、操作(后端字段:applyCode, applicantName, deptName, statusName, nodeDescription) */
 const PURCHASE_APPLY_TABLE_COLUMNS: TableColumnProps[] = [
 const PURCHASE_APPLY_TABLE_COLUMNS: TableColumnProps[] = [
   {
   {
     label: '编号',
     label: '编号',
@@ -16,7 +16,7 @@ const PURCHASE_APPLY_TABLE_COLUMNS: TableColumnProps[] = [
   },
   },
   {
   {
     label: '申请单号',
     label: '申请单号',
-    prop: 'applyNo',
+    prop: 'applyCode',
     align: 'left',
     align: 'left',
     minWidth: '140px',
     minWidth: '140px',
   },
   },
@@ -27,8 +27,8 @@ const PURCHASE_APPLY_TABLE_COLUMNS: TableColumnProps[] = [
     minWidth: '100px',
     minWidth: '100px',
   },
   },
   {
   {
-    label: '申请部门',
-    prop: 'applicantDeptName',
+    label: '申请部门',
+    prop: 'deptName',
     align: 'left',
     align: 'left',
     minWidth: '140px',
     minWidth: '140px',
   },
   },
@@ -41,7 +41,7 @@ const PURCHASE_APPLY_TABLE_COLUMNS: TableColumnProps[] = [
   },
   },
   {
   {
     label: '当前流程节点',
     label: '当前流程节点',
-    prop: 'currentNodeName',
+    prop: 'nodeDescription',
     align: 'left',
     align: 'left',
     minWidth: '140px',
     minWidth: '140px',
   },
   },

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

@@ -17,7 +17,7 @@
               <div class="select-box--item">
               <div class="select-box--item">
                 <span>用品名称/申请人:</span>
                 <span>用品名称/申请人:</span>
                 <el-input
                 <el-input
-                  v-model="tableQuery.queryParam.keyword"
+                  v-model="tableQuery.queryParam.name"
                   placeholder="请输入用品名称或申请人"
                   placeholder="请输入用品名称或申请人"
                   class="act-search-input"
                   class="act-search-input"
                   clearable
                   clearable
@@ -37,10 +37,10 @@
                 </el-select>
                 </el-select>
               </div>
               </div>
               <div class="select-box--item">
               <div class="select-box--item">
-                <span>审核部门:</span>
+                <span>申请部门:</span>
                 <el-input
                 <el-input
-                  v-model="tableQuery.queryParam.auditDeptName"
-                  placeholder="请输入审核部门"
+                  v-model="tableQuery.queryParam.applyDeptName"
+                  placeholder="请输入申请部门名称"
                   class="act-search-input"
                   class="act-search-input"
                   clearable
                   clearable
                 />
                 />
@@ -63,32 +63,32 @@
           >
           >
             <template #status="scope">
             <template #status="scope">
               <span>
               <span>
-                {{ getStatusText(scope.row.status) }}
+                {{ scope.row.statusName || getStatusText(scope.row.status) }}
               </span>
               </span>
             </template>
             </template>
             <template #action="scope">
             <template #action="scope">
               <div class="action-container--div" style="justify-content: left">
               <div class="action-container--div" style="justify-content: left">
                 <!-- 待审核:查看、审核 -->
                 <!-- 待审核:查看、审核 -->
                 <template v-if="scope.row.status === 0 || scope.row.status === '0'">
                 <template v-if="scope.row.status === 0 || scope.row.status === '0'">
-                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
-                  <ActionButton text="审核" @click="handleAudit(scope.row.id)" />
+                  <ActionButton text="查看" @click="handleView(scope.row.id!, scope.row)" />
+                  <ActionButton text="审核" @click="handleAudit(scope.row.id!, scope.row)" />
                 </template>
                 </template>
                 <!-- 审核通过:查看 -->
                 <!-- 审核通过:查看 -->
                 <template v-else-if="scope.row.status === 1 || scope.row.status === '1'">
                 <template v-else-if="scope.row.status === 1 || scope.row.status === '1'">
-                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
+                  <ActionButton text="查看" @click="handleView(scope.row.id!, scope.row)" />
                 </template>
                 </template>
                 <!-- 审核不通过:编辑、删除、查看 -->
                 <!-- 审核不通过:编辑、删除、查看 -->
                 <template v-else-if="scope.row.status === -1 || scope.row.status === '-1'">
                 <template v-else-if="scope.row.status === -1 || scope.row.status === '-1'">
-                  <ActionButton text="编辑" @click="handleEdit(scope.row.id)" />
+                  <ActionButton text="编辑" @click="handleEdit(scope.row.id!, scope.row)" />
                   <ActionButton
                   <ActionButton
                     text="删除"
                     text="删除"
                     :popconfirm="{ title: '确定要删除该申请吗?' }"
                     :popconfirm="{ title: '确定要删除该申请吗?' }"
-                    @confirm="handleDelete(scope.row.id)"
+                    @confirm="handleDelete(scope.row.id!)"
                   />
                   />
-                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
+                  <ActionButton text="查看" @click="handleView(scope.row.id!, scope.row)" />
                 </template>
                 </template>
                 <template v-else>
                 <template v-else>
-                  <ActionButton text="查看" @click="handleView(scope.row.id)" />
+                  <ActionButton text="查看" @click="handleView(scope.row.id!, scope.row)" />
                 </template>
                 </template>
               </div>
               </div>
             </template>
             </template>
@@ -111,7 +111,7 @@
   import {
   import {
     queryPurchaseApplyList,
     queryPurchaseApplyList,
     deletePurchaseApply,
     deletePurchaseApply,
-    type PersonalProtectiveEquipmentPurchaseApply,
+    type PpePurchaseApply,
     type QueryPurchaseApplyPageReq,
     type QueryPurchaseApplyPageReq,
   } from '@/api/production-safety/personal-protective-equipment-purchase-apply';
   } from '@/api/production-safety/personal-protective-equipment-purchase-apply';
 
 
@@ -123,15 +123,16 @@
     TABLE_OPTIONS,
     TABLE_OPTIONS,
   );
   );
 
 
-  const tableData = ref<PersonalProtectiveEquipmentPurchaseApply[]>([]);
+  const tableData = ref<PpePurchaseApply[]>([]);
 
 
   const tableQuery = reactive<QueryPageRequest<QueryPurchaseApplyPageReq>>({
   const tableQuery = reactive<QueryPageRequest<QueryPurchaseApplyPageReq>>({
     pageNumber: pagination.pageNumber,
     pageNumber: pagination.pageNumber,
     pageSize: pagination.pageSize,
     pageSize: pagination.pageSize,
     queryParam: {
     queryParam: {
-      keyword: '',
+      name: '',
       status: undefined,
       status: undefined,
-      auditDeptName: '',
+      applyDeptCode: '',
+      applyDeptName: '',
     },
     },
   });
   });
 
 
@@ -159,7 +160,7 @@
     try {
     try {
       const res = await queryPurchaseApplyList(tableQuery);
       const res = await queryPurchaseApplyList(tableQuery);
       if (res) {
       if (res) {
-        tableData.value = (res?.records ?? res?.list ?? []) as PersonalProtectiveEquipmentPurchaseApply[];
+        tableData.value = (res?.records ?? res?.list ?? []) as PpePurchaseApply[];
         pagination.total = res?.totalRow ?? res?.total ?? 0;
         pagination.total = res?.totalRow ?? res?.total ?? 0;
       }
       }
     } catch (e) {
     } catch (e) {
@@ -178,9 +179,10 @@
   };
   };
 
 
   const handleReset = () => {
   const handleReset = () => {
-    tableQuery.queryParam.keyword = '';
+    tableQuery.queryParam.name = '';
     tableQuery.queryParam.status = undefined;
     tableQuery.queryParam.status = undefined;
-    tableQuery.queryParam.auditDeptName = '';
+    tableQuery.queryParam.applyDeptCode = '';
+    tableQuery.queryParam.applyDeptName = '';
     handleSearch();
     handleSearch();
   };
   };
 
 
@@ -191,10 +193,18 @@
     });
     });
   };
   };
 
 
-  const handleEdit = (id: number) => {
+  const handleEdit = (id: number, row?: PpePurchaseApply) => {
     router.push({
     router.push({
       name: 'laborProductsPurchaseApplyManageItem',
       name: 'laborProductsPurchaseApplyManageItem',
-      query: { id: String(id), operate: 'inventory-edit' },
+      query: {
+        id: String(id),
+        operate: 'inventory-edit',
+        ...(row && {
+          applyCode: String(row.applyCode ?? ''),
+          applicantName: row.applicantName ?? '',
+          deptName: row.deptName ?? '',
+        }),
+      },
     });
     });
   };
   };
 
 
@@ -209,17 +219,33 @@
     }
     }
   };
   };
 
 
-  const handleView = (id: number) => {
+  const handleView = (id: number, row?: PpePurchaseApply) => {
     router.push({
     router.push({
       name: 'laborProductsPurchaseApplyManageItem',
       name: 'laborProductsPurchaseApplyManageItem',
-      query: { id: String(id), operate: 'inventory-view' },
+      query: {
+        id: String(id),
+        operate: 'inventory-view',
+        ...(row && {
+          applyCode: String(row.applyCode ?? ''),
+          applicantName: row.applicantName ?? '',
+          deptName: row.deptName ?? '',
+        }),
+      },
     });
     });
   };
   };
 
 
-  const handleAudit = (id: number) => {
+  const handleAudit = (id: number, row?: PpePurchaseApply) => {
     router.push({
     router.push({
       name: 'laborProductsPurchaseApplyManageItem',
       name: 'laborProductsPurchaseApplyManageItem',
-      query: { id: String(id), operate: 'audit' },
+      query: {
+        id: String(id),
+        operate: 'audit',
+        ...(row && {
+          applyCode: String(row.applyCode ?? ''),
+          applicantName: row.applicantName ?? '',
+          deptName: row.deptName ?? '',
+        }),
+      },
     });
     });
   };
   };
 
 

+ 1 - 1
src/views/production-safety/safetyAssessment/receiptRecord/receiptRecordAdministratorReview.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div class="safety-platform-container">
   <div class="safety-platform-container">
     <header class="safety-platform-container__header">
     <header class="safety-platform-container__header">
-      <div class="breadcrumb-title"> 物品领取记录管理(管理员审核) </div>
+      <div class="breadcrumb-title"> 物品领取审核列表 </div>
     </header>
     </header>
     <main class="safety-platform-container__main">
     <main class="safety-platform-container__main">
       <div class="search-table-container">
       <div class="search-table-container">