yanghao 2 недель назад
Родитель
Сommit
f93cc9d0e6

+ 5 - 0
src/api/pms/qhse/index.ts

@@ -568,6 +568,11 @@ export const QhseMonthReportApi = {
   // 导出QHSE月报 Excel
   exportQhseMonthReport: async (params) => {
     return await request.download({ url: `/rq/qhse-month-report/export-excel`, params })
+  },
+
+  // 提交审批
+  submitForApproval: async (id) => {
+    return await request.post({ url: `/rq/qhse-month-report/approving/${id}` })
   }
 }
 

+ 3 - 3
src/views/pms/qhse/monthlyReport/MonthlyReportAdd.vue

@@ -449,7 +449,7 @@
       <!-- 操作按钮 -->
       <div class="form-actions">
         <el-button @click="handleCancel">取消</el-button>
-        <el-button type="primary" @click="handleSubmit" :loading="submitLoading"> 提交 </el-button>
+        <el-button type="primary" @click="handleSubmit" :loading="submitLoading"> 保存 </el-button>
       </div>
     </el-form>
   </div>
@@ -571,12 +571,12 @@ const handleSubmit = async () => {
   submitLoading.value = true
   try {
     await QhseMonthReportApi.updateQhseMonthReport(reportInfo)
-    message.success('提交成功')
+    message.success('保存成功')
     // 返回列表页或上一页
     delView(unref(router.currentRoute))
     router.push({ name: 'QhseMonthlyReport', params: {} })
   } catch (error) {
-    console.error('提交失败:', error)
+    console.error('保存失败:', error)
   } finally {
     submitLoading.value = false
   }

+ 26 - 2
src/views/pms/qhse/monthlyReport/index.vue

@@ -52,16 +52,23 @@
             fixed="left"
             show-overflow-tooltip />
           <zm-table-column prop="personName" label="工单填报人" align="center" />
+          <zm-table-column prop="auditStatus" label="审批状态" align="center">
+            <template #default="{ row }">
+              <dict-tag :type="DICT_TYPE.QHSE_AUDIT_STATUS" :value="row.status" />
+            </template>
+          </zm-table-column>
+          <zm-table-column prop="rejectDesc" label="拒绝原因" align="center" />
           <zm-table-column label="创建日期" prop="createTime" align="center">
             <template #default="{ row }">
               {{ formatDate(row.createTime) }}
             </template>
           </zm-table-column>
 
-          <zm-table-column label="操作" width="150" align="center" fixed="right" action>
+          <zm-table-column label="操作" width="180" align="center" fixed="right" action>
             <template #default="{ row }">
-              <div class="flex gap-1 justify-center">
+              <div class="flex justify-center">
                 <el-button text type="primary" @click="add(row)"> 填报 </el-button>
+                <el-button text type="primary" @click="submit(row)"> 提交 </el-button>
                 <el-button text size="small" type="success" @click="detail(row)"> 查看 </el-button>
               </div>
             </template>
@@ -227,6 +234,23 @@ const add = (row) => {
   })
 }
 
+const submit = async (row) => {
+  try {
+    await ElMessageBox.confirm('确认提交吗?', '提示', {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning'
+    })
+    await QhseMonthReportApi.submitForApproval(row.id)
+    ElMessage.success('提交成功')
+    loadTableData()
+  } catch (error) {
+    if (error !== 'cancel') {
+      ElMessage.error('提交失败')
+    }
+  }
+}
+
 const detail = (row) => {
   // if (row.dutyPerson !== userInfo.value.id && userInfo.value.username !== 'admin') {
   //   ElMessage.error('您没有权限进行此操作')

+ 2 - 2
src/views/pms/qhse/reportReview/index.vue

@@ -46,9 +46,9 @@
             fixed="left"
             show-overflow-tooltip />
           <zm-table-column prop="personName" label="工单填报人" align="center" />
-          <zm-table-column prop="auditStatus" label="审状态" align="center">
+          <zm-table-column prop="auditStatus" label="审状态" align="center">
             <template #default="{ row }">
-              <dict-tag :type="DICT_TYPE.QHSE_AUDIT_STATUS" :value="row.auditStatus" />
+              <dict-tag :type="DICT_TYPE.QHSE_AUDIT_STATUS" :value="row.status" />
             </template>
           </zm-table-column>
           <zm-table-column label="创建日期" prop="createTime" align="center">