Browse Source

电子发放

xuzhancheng 2 weeks ago
parent
commit
e8a0f08073

+ 10 - 0
yudao-ui-admin-vue3/src/views/pressure2/boilerElectronIssueReview/index.api.ts

@@ -0,0 +1,10 @@
+import request from '@/config/axios'
+
+const { get, post } = request
+
+export default {
+  // 锅炉电子发放审核列表
+  getPage: (params: any) => get({ url: '/pressure2/boiler-electronic-report-audit-record/page', params }),
+  // 锅炉电子发放审核(通过/拒绝)
+  auditItem: (data) => post({ url: '/pressure2/boiler-electronic-report-audit-record/electronicReportAudit', data })
+}

+ 444 - 0
yudao-ui-admin-vue3/src/views/pressure2/boilerElectronIssueReview/index.vue

@@ -0,0 +1,444 @@
+<!--
+ * @Author: zhuMingXi
+ * @Date: 2025/12/20 16:57:30
+ * @LastEditors: zhuMingXi
+ * @LastEditTime: 2025/12/20 16:57:30
+ * @Description: 锅炉电子发放审核
+ * @FilePath:  FilePath
+ -->
+
+<template>
+  <SmartTable
+    ref="smartTableRef"
+    v-model:pageNo="pageNo"
+    v-model:pageSize="pageSize"
+    v-model:total="total"
+    v-model:columns="columns"
+    :showSettingTools="false"
+    :data="tableData"
+    :show-refresh="false"
+    :page-sizes="[20, 30, 50, 100]"
+    :custom-height="true"
+    :height="calcTableHeight"
+    @on-page-no-change="() => getListPageFn()"
+    @on-page-size-change="() => getListPageFn()"
+    @on-reset="() => resetQuery()"
+    @on-search="() => getListPageFn()"
+    @refresh="() => getListPageFn()"
+    @expand-change="getCalcHeight"
+  >
+    <template #toolbarRowExtra>
+      <el-radio-group v-model="auditStatus" @change="handleQuery">
+        <el-radio-button label="全部" value="all" />
+        <el-radio-button
+          v-for="item in auditStatusMap"
+          :label="item.label"
+          :value="item.value"
+          :key="item.value"
+        />
+      </el-radio-group>
+    </template>
+  </SmartTable>
+
+  <CustomDialog
+    :close-on-click-modal="false"
+    :modelValue="visible"
+    title="拒绝原因"
+    width="400px"
+    @close="handleClose"
+  >
+    <el-form :rules="rules" :model="formData" ref="formRef">
+      <el-form-item label="拒绝原因" prop="rejectiveDist">
+        <el-input type="textarea" v-model="formData.rejectiveDist" />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <el-button @click="handleClose">取消</el-button>
+      <el-button type="primary" :loading="btnLoading" @click="handleConfirm">确定</el-button>
+    </template>
+  </CustomDialog>
+ <unitContainerForm ref="unitContainerFormRef" />
+</template>
+<script lang="tsx" setup>
+import SmartTable from '@/components/SmartTable/SmartTable'
+import FetchApis from './index.api'
+import unitContainerForm from '@/components/unitContainerForm/index.vue'
+import { cloneDeep } from 'lodash-es'
+import { SmartInstanceExpose, SmartTableColumn } from '@/types/table'
+import { usePageLoading } from '@/hooks/web/usePageLoading'
+import { formatArrayDate, formatDate } from '@/utils/formatTime'
+import { isEmpty } from '@/utils/is'
+import dayjs from 'dayjs'
+import { useRouter } from 'vue-router'
+import { useEmitt } from '@/hooks/web/useEmitt'
+import CustomDialog from '@/components/CustomDialog/index.vue'
+import { ElMessageBox, FormInstance } from 'element-plus'
+
+defineOptions({
+  name: 'BoilerElectronIssueReviewIndex'
+})
+
+const { loadDone, loadStart } = usePageLoading()
+const unitContainerFormRef = ref<InstanceType<typeof unitContainerForm>>()
+const smartTableRef = ref<SmartInstanceExpose>()
+const router = useRouter()
+
+const checkTypeMap = {
+  100: '定期检验',
+  200: '年度检查',
+  300: '超年限检验'
+}
+;('/pressure2/boilerElectronIssueReview/index')
+
+const onLineStatusMap = {
+  0: '待约检',
+  1: '已约检',
+  2: '已拒绝',
+  3: '已作废'
+}
+
+const auditStatusMap = [
+  { label: '审核中', value: 0 },
+  { label: '通过', value: 1 },
+  { label: '拒绝', value: 2 }
+]
+const cols: SmartTableColumn[] = [
+  {
+    label: '任务单号',
+    prop: 'orderNo',
+    search: {
+      type: 'input',
+      fieldProps: {
+        placeholder: '请输入任务单号'
+      },
+      sort: 1
+    },
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    }
+  },
+  {
+    label: '使用单位',
+    prop: 'useUnitName',
+    search: {
+      type: 'input',
+      fieldProps: {
+        placeholder: '请输入使用单位'
+      },
+      sort: 2,
+    },
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    },
+   render: (row, value) => <div  style="color: #015293; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" onClick={()=>handleUnitCodeFn(row.useUnitName)}>{value || '-'}</div>
+  },
+  {
+    label: '检验时间',
+    prop: 'checkDate',
+    search: {
+      type: 'daterange',
+      fieldProps: {
+        type: 'daterange',
+        valueFormat: 'YYYY-MM-DD',
+        format: 'YYYY-MM-DD',
+        placeholder: '请选择检验时间'
+      },
+      sort: 3
+    },
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    },
+    render: (_row, value) => {
+      return formatArrayDate(value)
+    }
+  },
+  {
+    label: '设备注册代码',
+    prop: 'equipCodes',
+    fieldProps: {
+      align: 'center',
+      minWidth: 200,
+      showOverflowTooltip: true
+    }
+  },
+  {
+    label: '发放原因',
+    prop: 'reasonDist',
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    },
+    render: (_row, value) => {
+      return value || '-'
+    }
+  },
+  {
+    label: '审核人',
+    prop: 'reportAuditName',
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    },
+    render: (_row, value) => {
+      return value || '-'
+    }
+  },
+  {
+    label: '状态',
+    prop: 'auditStatus',
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    },
+    render: (_row, value) => {
+      return auditStatusMap.find((item) => item.value === value)?.label || '-'
+    }
+  },
+  {
+    label: '拒绝原因',
+    prop: 'rejectiveDist',
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    }
+  },
+  {
+    label: '提交人',
+    prop: 'submitName',
+    search: {
+      prop: 'submitId',
+      type: 'selectUserModal',
+      fieldProps: {
+        placeholder: '请选择提交人'
+      },
+      sort: 10
+    },
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    }
+  },
+  {
+    label: '提交时间',
+    prop: 'submitTime',
+    search: {
+      type: 'daterange',
+      fieldProps: {
+        type: 'daterange',
+        valueFormat: 'YYYY-MM-DD',
+        format: 'YYYY-MM-DD',
+        placeholder: '请选择提交时间'
+      },
+      sort: 11
+    },
+    fieldProps: {
+      align: 'center',
+      minWidth: 175,
+      showOverflowTooltip: true
+    },
+    render: (_row, value) => {
+      return formatDate(value)
+    }
+  },
+  {
+    label: '操作',
+    prop: 'operation',
+    fieldProps: {
+      align: 'center',
+      width: 120,
+      fixed: 'right'
+    },
+    render: (row) => {
+      return (
+        <>
+          <el-button type="primary" link onClick={() => handleApprove(row, 1)}>
+            通过
+          </el-button>
+          <el-button type="primary" link onClick={() => handleApprove(row, 2)}>
+            拒绝
+          </el-button>
+        </>
+      )
+    }
+  }
+]
+
+type AuditStatus = 0 | 1 | 2 | 'all'
+const auditStatus = ref<AuditStatus>(0)
+
+const columns = computed(() => {
+  if (auditStatus.value === 0) {
+    return cols
+  } else {
+    return cols.filter((item) => item.prop !== 'operation')
+  }
+})
+const tableData = ref<Recordable[]>([])
+
+const pageNo = ref(1)
+const pageSize = ref(20)
+const total = ref(0)
+
+const getPageParams = () => {
+  if (!smartTableRef.value) return {}
+  const result: Recordable = cloneDeep(smartTableRef.value.getSearchForm())
+  if (auditStatus.value == 'all') {
+    // 清除状态筛选
+    delete result.auditStatus
+  } else {
+    // 设置状态筛选
+    result.auditStatus = auditStatus.value
+  }
+  const arrFields: string[] = ['submitTime']
+  for (const key in result) {
+    if (isEmpty(result[key])) {
+      delete result[key]
+      continue
+    }
+    if (Array.isArray(result[key]) && result[key].length === 2 && arrFields.includes(key)) {
+      const [startTime, endTime] = result[key]
+      result[key][0] = dayjs(startTime).startOf('day').format('YYYY-MM-DD HH:mm:ss')
+      result[key][1] = dayjs(endTime).endOf('day').format('YYYY-MM-DD HH:mm:ss')
+    }
+  }
+  return result
+}
+
+const handleQuery = () => {
+  // 重置页码并触发查询
+  pageNo.value = 1
+  getListPageFn()
+}
+
+const resetQuery = () => {
+  auditStatus.value = 0
+  handleQuery()
+}
+
+const calcTableHeight = ref('calc(100vh - 300px)')
+const getCalcHeight = () => {
+  setTimeout(() => {
+    nextTick(() => {
+      const top = smartTableRef.value?.getTableRef()?.$el?.getBoundingClientRect()?.top || 350
+      const h = top + 125
+      calcTableHeight.value = `calc(100vh - ${h}px)`
+    })
+  }, 300)
+}
+
+const getListPageFn = async () => {
+  loadStart()
+  let params = {
+    ...getPageParams(),
+    pageNo: pageNo.value,
+    pageSize: pageSize.value
+  }
+  FetchApis.getPage(params)
+    .then((result) => {
+      tableData.value = result?.list || []
+      total.value = result?.total || 0
+    })
+    .finally(() => {
+      loadDone()
+    })
+}
+const handleUnitCodeFn = (code) => {
+  if (!code) {
+    return ElMessage.warning('该单位信息异常!')
+  }
+  unitContainerFormRef.value?.open('', code, true)
+}
+// 审批通过拒绝
+const visible = ref<any>(false)
+const formRef = ref<FormInstance>()
+const formData = ref<Recordable>({
+  id: undefined,
+  auditStatus: undefined,
+  rejectiveDist: ''
+})
+
+const rules = ref({
+  rejectiveDist: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]
+})
+const handleClose = () => {
+  visible.value = false
+}
+const btnLoading = ref(false)
+const handleConfirm = async () => {
+  if (!formRef.value) return
+  formRef.value
+    .validate()
+    .then(() => {
+      // 校验通过,提交表单
+      submitForm()
+    })
+    .catch(() => {})
+}
+
+const msgMap = {
+  1: '通过',
+  2: '拒绝'
+}
+
+const submitForm = () => {
+  btnLoading.value = true
+  FetchApis.auditItem(formData.value)
+    .then(() => {
+      const msg = msgMap[formData.value.auditStatus] || '操作'
+      handleClose()
+      // 提交成功,刷新列表
+      ElMessage.success(`${msg}成功`)
+      getListPageFn()
+    })
+    .finally(() => {
+      btnLoading.value = false
+    })
+}
+
+const handleApprove = (row, auditStatus: AuditStatus) => {
+  formData.value.id = row.id
+  formData.value.auditStatus = auditStatus
+  formData.value.rejectiveDist = ''
+  if (auditStatus === 2) {
+    visible.value = true
+    nextTick(() => {
+      formRef.value?.clearValidate()
+    })
+  } else {
+    ElMessageBox.confirm('确认通过吗?', '提示', {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning'
+    }).then(() => {
+      submitForm()
+    })
+  }
+}
+const init = () => {
+  getCalcHeight()
+  getListPageFn()
+}
+useEmitt({ name: 'refresh-list', callback: init })
+
+onMounted(() => {
+  init()
+})
+</script>
+<style scoped lang="scss">
+:deep(.el-table) {
+  .el-table__row {
+    cursor: pointer;
+  }
+}
+</style>

+ 10 - 0
yudao-ui-admin-vue3/src/views/pressure2/pipeElectronIssueReview/index.api.ts

@@ -0,0 +1,10 @@
+import request from '@/config/axios'
+
+const { get, post } = request
+
+export default {
+  // 管道电子发放审核列表
+  getPage: (params: any) => get({ url: '/pressure2/pipe-electronic-report-audit-record/page', params }),
+  // 管道电子发放审核(通过/拒绝)
+  auditItem: (data) => post({ url: '/pressure2/pipe-electronic-report-audit-record/electronicReportAudit', data })
+}

+ 444 - 0
yudao-ui-admin-vue3/src/views/pressure2/pipeElectronIssueReview/index.vue

@@ -0,0 +1,444 @@
+<!--
+ * @Author: zhuMingXi
+ * @Date: 2025/12/20 16:57:30
+ * @LastEditors: zhuMingXi
+ * @LastEditTime: 2025/12/20 16:57:30
+ * @Description: 管道电子发放审核
+ * @FilePath:  FilePath
+ -->
+
+<template>
+  <SmartTable
+    ref="smartTableRef"
+    v-model:pageNo="pageNo"
+    v-model:pageSize="pageSize"
+    v-model:total="total"
+    v-model:columns="columns"
+    :showSettingTools="false"
+    :data="tableData"
+    :show-refresh="false"
+    :page-sizes="[20, 30, 50, 100]"
+    :custom-height="true"
+    :height="calcTableHeight"
+    @on-page-no-change="() => getListPageFn()"
+    @on-page-size-change="() => getListPageFn()"
+    @on-reset="() => resetQuery()"
+    @on-search="() => getListPageFn()"
+    @refresh="() => getListPageFn()"
+    @expand-change="getCalcHeight"
+  >
+    <template #toolbarRowExtra>
+      <el-radio-group v-model="auditStatus" @change="handleQuery">
+        <el-radio-button label="全部" value="all" />
+        <el-radio-button
+          v-for="item in auditStatusMap"
+          :label="item.label"
+          :value="item.value"
+          :key="item.value"
+        />
+      </el-radio-group>
+    </template>
+  </SmartTable>
+
+  <CustomDialog
+    :close-on-click-modal="false"
+    :modelValue="visible"
+    title="拒绝原因"
+    width="400px"
+    @close="handleClose"
+  >
+    <el-form :rules="rules" :model="formData" ref="formRef">
+      <el-form-item label="拒绝原因" prop="rejectiveDist">
+        <el-input type="textarea" v-model="formData.rejectiveDist" />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <el-button @click="handleClose">取消</el-button>
+      <el-button type="primary" :loading="btnLoading" @click="handleConfirm">确定</el-button>
+    </template>
+  </CustomDialog>
+ <unitContainerForm ref="unitContainerFormRef" />
+</template>
+<script lang="tsx" setup>
+import SmartTable from '@/components/SmartTable/SmartTable'
+import FetchApis from './index.api'
+import unitContainerForm from '@/components/unitContainerForm/index.vue'
+import { cloneDeep } from 'lodash-es'
+import { SmartInstanceExpose, SmartTableColumn } from '@/types/table'
+import { usePageLoading } from '@/hooks/web/usePageLoading'
+import { formatArrayDate, formatDate } from '@/utils/formatTime'
+import { isEmpty } from '@/utils/is'
+import dayjs from 'dayjs'
+import { useRouter } from 'vue-router'
+import { useEmitt } from '@/hooks/web/useEmitt'
+import CustomDialog from '@/components/CustomDialog/index.vue'
+import { ElMessageBox, FormInstance } from 'element-plus'
+
+defineOptions({
+  name: 'PipeElectronIssueReviewIndex'
+})
+
+const { loadDone, loadStart } = usePageLoading()
+const unitContainerFormRef = ref<InstanceType<typeof unitContainerForm>>()
+const smartTableRef = ref<SmartInstanceExpose>()
+const router = useRouter()
+
+const checkTypeMap = {
+  100: '定期检验',
+  200: '年度检查',
+  300: '超年限检验'
+}
+;('/pressure2/pipeElectronIssueReview/index')
+
+const onLineStatusMap = {
+  0: '待约检',
+  1: '已约检',
+  2: '已拒绝',
+  3: '已作废'
+}
+
+const auditStatusMap = [
+  { label: '审核中', value: 0 },
+  { label: '通过', value: 1 },
+  { label: '拒绝', value: 2 }
+]
+const cols: SmartTableColumn[] = [
+  {
+    label: '任务单号',
+    prop: 'orderNo',
+    search: {
+      type: 'input',
+      fieldProps: {
+        placeholder: '请输入任务单号'
+      },
+      sort: 1
+    },
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    }
+  },
+  {
+    label: '使用单位',
+    prop: 'useUnitName',
+    search: {
+      type: 'input',
+      fieldProps: {
+        placeholder: '请输入使用单位'
+      },
+      sort: 2,
+    },
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    },
+   render: (row, value) => <div  style="color: #015293; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" onClick={()=>handleUnitCodeFn(row.useUnitName)}>{value || '-'}</div>
+  },
+  {
+    label: '检验时间',
+    prop: 'checkDate',
+    search: {
+      type: 'daterange',
+      fieldProps: {
+        type: 'daterange',
+        valueFormat: 'YYYY-MM-DD',
+        format: 'YYYY-MM-DD',
+        placeholder: '请选择检验时间'
+      },
+      sort: 3
+    },
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    },
+    render: (_row, value) => {
+      return formatArrayDate(value)
+    }
+  },
+  {
+    label: '设备注册代码',
+    prop: 'equipCodes',
+    fieldProps: {
+      align: 'center',
+      minWidth: 200,
+      showOverflowTooltip: true
+    }
+  },
+  {
+    label: '发放原因',
+    prop: 'reasonDist',
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    },
+    render: (_row, value) => {
+      return value || '-'
+    }
+  },
+  {
+    label: '审核人',
+    prop: 'reportAuditName',
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    },
+    render: (_row, value) => {
+      return value || '-'
+    }
+  },
+  {
+    label: '状态',
+    prop: 'auditStatus',
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    },
+    render: (_row, value) => {
+      return auditStatusMap.find((item) => item.value === value)?.label || '-'
+    }
+  },
+  {
+    label: '拒绝原因',
+    prop: 'rejectiveDist',
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    }
+  },
+  {
+    label: '提交人',
+    prop: 'submitName',
+    search: {
+      prop: 'submitId',
+      type: 'selectUserModal',
+      fieldProps: {
+        placeholder: '请选择提交人'
+      },
+      sort: 10
+    },
+    fieldProps: {
+      align: 'center',
+      minWidth: 150,
+      showOverflowTooltip: true
+    }
+  },
+  {
+    label: '提交时间',
+    prop: 'submitTime',
+    search: {
+      type: 'daterange',
+      fieldProps: {
+        type: 'daterange',
+        valueFormat: 'YYYY-MM-DD',
+        format: 'YYYY-MM-DD',
+        placeholder: '请选择提交时间'
+      },
+      sort: 11
+    },
+    fieldProps: {
+      align: 'center',
+      minWidth: 175,
+      showOverflowTooltip: true
+    },
+    render: (_row, value) => {
+      return formatDate(value)
+    }
+  },
+  {
+    label: '操作',
+    prop: 'operation',
+    fieldProps: {
+      align: 'center',
+      width: 120,
+      fixed: 'right'
+    },
+    render: (row) => {
+      return (
+        <>
+          <el-button type="primary" link onClick={() => handleApprove(row, 1)}>
+            通过
+          </el-button>
+          <el-button type="primary" link onClick={() => handleApprove(row, 2)}>
+            拒绝
+          </el-button>
+        </>
+      )
+    }
+  }
+]
+
+type AuditStatus = 0 | 1 | 2 | 'all'
+const auditStatus = ref<AuditStatus>(0)
+
+const columns = computed(() => {
+  if (auditStatus.value === 0) {
+    return cols
+  } else {
+    return cols.filter((item) => item.prop !== 'operation')
+  }
+})
+const tableData = ref<Recordable[]>([])
+
+const pageNo = ref(1)
+const pageSize = ref(20)
+const total = ref(0)
+
+const getPageParams = () => {
+  if (!smartTableRef.value) return {}
+  const result: Recordable = cloneDeep(smartTableRef.value.getSearchForm())
+  if (auditStatus.value == 'all') {
+    // 清除状态筛选
+    delete result.auditStatus
+  } else {
+    // 设置状态筛选
+    result.auditStatus = auditStatus.value
+  }
+  const arrFields: string[] = ['submitTime']
+  for (const key in result) {
+    if (isEmpty(result[key])) {
+      delete result[key]
+      continue
+    }
+    if (Array.isArray(result[key]) && result[key].length === 2 && arrFields.includes(key)) {
+      const [startTime, endTime] = result[key]
+      result[key][0] = dayjs(startTime).startOf('day').format('YYYY-MM-DD HH:mm:ss')
+      result[key][1] = dayjs(endTime).endOf('day').format('YYYY-MM-DD HH:mm:ss')
+    }
+  }
+  return result
+}
+
+const handleQuery = () => {
+  // 重置页码并触发查询
+  pageNo.value = 1
+  getListPageFn()
+}
+
+const resetQuery = () => {
+  auditStatus.value = 0
+  handleQuery()
+}
+
+const calcTableHeight = ref('calc(100vh - 300px)')
+const getCalcHeight = () => {
+  setTimeout(() => {
+    nextTick(() => {
+      const top = smartTableRef.value?.getTableRef()?.$el?.getBoundingClientRect()?.top || 350
+      const h = top + 125
+      calcTableHeight.value = `calc(100vh - ${h}px)`
+    })
+  }, 300)
+}
+
+const getListPageFn = async () => {
+  loadStart()
+  let params = {
+    ...getPageParams(),
+    pageNo: pageNo.value,
+    pageSize: pageSize.value
+  }
+  FetchApis.getPage(params)
+    .then((result) => {
+      tableData.value = result?.list || []
+      total.value = result?.total || 0
+    })
+    .finally(() => {
+      loadDone()
+    })
+}
+const handleUnitCodeFn = (code) => {
+  if (!code) {
+    return ElMessage.warning('该单位信息异常!')
+  }
+  unitContainerFormRef.value?.open('', code, true)
+}
+// 审批通过拒绝
+const visible = ref<any>(false)
+const formRef = ref<FormInstance>()
+const formData = ref<Recordable>({
+  id: undefined,
+  auditStatus: undefined,
+  rejectiveDist: ''
+})
+
+const rules = ref({
+  rejectiveDist: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]
+})
+const handleClose = () => {
+  visible.value = false
+}
+const btnLoading = ref(false)
+const handleConfirm = async () => {
+  if (!formRef.value) return
+  formRef.value
+    .validate()
+    .then(() => {
+      // 校验通过,提交表单
+      submitForm()
+    })
+    .catch(() => {})
+}
+
+const msgMap = {
+  1: '通过',
+  2: '拒绝'
+}
+
+const submitForm = () => {
+  btnLoading.value = true
+  FetchApis.auditItem(formData.value)
+    .then(() => {
+      const msg = msgMap[formData.value.auditStatus] || '操作'
+      handleClose()
+      // 提交成功,刷新列表
+      ElMessage.success(`${msg}成功`)
+      getListPageFn()
+    })
+    .finally(() => {
+      btnLoading.value = false
+    })
+}
+
+const handleApprove = (row, auditStatus: AuditStatus) => {
+  formData.value.id = row.id
+  formData.value.auditStatus = auditStatus
+  formData.value.rejectiveDist = ''
+  if (auditStatus === 2) {
+    visible.value = true
+    nextTick(() => {
+      formRef.value?.clearValidate()
+    })
+  } else {
+    ElMessageBox.confirm('确认通过吗?', '提示', {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning'
+    }).then(() => {
+      submitForm()
+    })
+  }
+}
+const init = () => {
+  getCalcHeight()
+  getListPageFn()
+}
+useEmitt({ name: 'refresh-list', callback: init })
+
+onMounted(() => {
+  init()
+})
+</script>
+<style scoped lang="scss">
+:deep(.el-table) {
+  .el-table__row {
+    cursor: pointer;
+  }
+}
+</style>