|
@@ -1,92 +1,83 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="p-2">
|
|
|
|
|
|
|
+ <div class="page-container work-report-page">
|
|
|
|
|
+ <div class="page-header flex items-center justify-between">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="page-title">作业上报</div>
|
|
|
|
|
+ <div class="page-desc">管理施工项目作业上报信息</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <el-button v-has-permi="['riskctrl:workReport:add']" type="primary" icon="Plus" @click="handleAdd()"> 新增上报 </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<!-- 搜索区域 -->
|
|
<!-- 搜索区域 -->
|
|
|
- <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
|
|
- <div v-show="showSearch" class="mb-[10px]">
|
|
|
|
|
- <el-card shadow="hover">
|
|
|
|
|
- <el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
|
|
|
- <el-form-item label="上报编号" prop="reportNo">
|
|
|
|
|
- <el-input v-model="queryParams.reportNo" placeholder="请输入上报编号" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ <el-card shadow="hover" class="search-card mb-[12px]">
|
|
|
|
|
+ <el-form ref="queryFormRef" :model="queryParams" :inline="false" class="search-form">
|
|
|
|
|
+ <el-row :gutter="12">
|
|
|
|
|
+ <el-col :xs="24" :sm="12" :md="8">
|
|
|
<el-form-item label="作业类型" prop="workType">
|
|
<el-form-item label="作业类型" prop="workType">
|
|
|
- <el-select v-model="queryParams.workType" placeholder="请选择作业类型" clearable>
|
|
|
|
|
|
|
+ <el-select v-model="queryParams.workType" placeholder="全部类型" clearable class="w-full">
|
|
|
<el-option label="临时施工上报" value="临时施工上报" />
|
|
<el-option label="临时施工上报" value="临时施工上报" />
|
|
|
<el-option label="改造工程上报" value="改造工程上报" />
|
|
<el-option label="改造工程上报" value="改造工程上报" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :xs="24" :sm="12" :md="8">
|
|
|
<el-form-item label="项目名称" prop="projectName">
|
|
<el-form-item label="项目名称" prop="projectName">
|
|
|
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
|
|
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="审核状态" prop="auditStatus">
|
|
|
|
|
- <el-select v-model="queryParams.auditStatus" placeholder="请选择审核状态" clearable>
|
|
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :xs="24" :sm="12" :md="8">
|
|
|
|
|
+ <el-form-item label="状态" prop="auditStatus">
|
|
|
|
|
+ <el-select v-model="queryParams.auditStatus" placeholder="全部状态" clearable class="w-full">
|
|
|
|
|
+ <el-option label="审核通过" value="0" />
|
|
|
<el-option label="待审核" value="1" />
|
|
<el-option label="待审核" value="1" />
|
|
|
- <el-option label="已通过" value="0" />
|
|
|
|
|
- <el-option label="已驳回" value="2" />
|
|
|
|
|
|
|
+ <el-option label="审核不通过" value="2" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
|
|
- <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- </el-card>
|
|
|
|
|
- </div>
|
|
|
|
|
- </transition>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 列表区域 -->
|
|
|
|
|
- <el-card shadow="hover">
|
|
|
|
|
- <template #header>
|
|
|
|
|
- <el-row :gutter="10">
|
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
- <el-button v-has-permi="['riskctrl:workReport:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增作业上报</el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
- <el-button v-has-permi="['riskctrl:workReport:edit']" type="success" plain :disabled="single" icon="Edit" @click="handleUpdate()">修改</el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
- <el-button type="info" plain :disabled="single" icon="View" @click="handleDetail()">详情</el-button>
|
|
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
- <el-button v-has-permi="['riskctrl:workReport:remove']" type="danger" plain :disabled="multiple" icon="Delete" @click="handleDelete()">删除</el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
- <el-button v-has-permi="['riskctrl:workReport:audit']" type="warning" plain :disabled="single" icon="Select" @click="handleAudit()">审核</el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <right-toolbar v-model:show-search="showSearch" :columns="columns" :search="true" @query-table="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- </template>
|
|
|
|
|
|
|
|
|
|
- <el-table v-loading="loading" border :data="reportList" @selection-change="handleSelectionChange">
|
|
|
|
|
- <el-table-column type="selection" width="50" align="center" />
|
|
|
|
|
- <el-table-column v-if="columns[0].visible" key="reportNo" label="上报编号" align="center" prop="reportNo" width="160" />
|
|
|
|
|
- <el-table-column v-if="columns[1].visible" key="workType" label="作业类型" align="center" prop="workType" width="120" />
|
|
|
|
|
- <el-table-column v-if="columns[2].visible" key="projectName" label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true" />
|
|
|
|
|
- <el-table-column v-if="columns[3].visible" key="startTime" label="施工开始时间" align="center" prop="startTime" width="160" />
|
|
|
|
|
- <el-table-column v-if="columns[4].visible" key="endTime" label="施工结束时间" align="center" prop="endTime" width="160" />
|
|
|
|
|
- <el-table-column v-if="columns[5].visible" key="safetyOfficer" label="现场安全员" align="center" prop="safetyOfficer" width="120" />
|
|
|
|
|
- <el-table-column v-if="columns[6].visible" key="contactPhone" label="联系电话" align="center" prop="contactPhone" width="130" />
|
|
|
|
|
- <el-table-column v-if="columns[7].visible" key="auditStatus" label="审核状态" align="center" prop="auditStatus" width="100">
|
|
|
|
|
|
|
+ <div class="search-actions">
|
|
|
|
|
+ <el-button @click="resetQuery">重置</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 列表区域 -->
|
|
|
|
|
+ <el-card shadow="hover" class="table-card">
|
|
|
|
|
+ <el-table v-loading="loading" border :data="reportList">
|
|
|
|
|
+ <el-table-column type="index" label="序号" width="70" align="center" />
|
|
|
|
|
+ <el-table-column label="作业类型" align="center" prop="workType" width="130">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <el-tag v-if="scope.row.auditStatus === '0'" type="success">已通过</el-tag>
|
|
|
|
|
- <el-tag v-else-if="scope.row.auditStatus === '1'" type="warning">待审核</el-tag>
|
|
|
|
|
- <el-tag v-else-if="scope.row.auditStatus === '2'" type="danger">已驳回</el-tag>
|
|
|
|
|
|
|
+ <span class="tag-pill work-type" :class="scope.row.workType === '临时施工上报' ? 'work-temp' : 'work-reform'">
|
|
|
|
|
+ {{ scope.row.workType }}
|
|
|
|
|
+ </span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column v-if="columns[8].visible" label="创建时间" align="center" prop="createTime" width="160" />
|
|
|
|
|
- <el-table-column label="操作" fixed="right" width="260" class-name="small-padding fixed-width">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true" />
|
|
|
|
|
+ <el-table-column label="施工开始时间" align="center" prop="startTime" width="160" />
|
|
|
|
|
+ <el-table-column label="施工结束时间" align="center" prop="endTime" width="160" />
|
|
|
|
|
+ <el-table-column label="现场安全员" align="center" prop="safetyOfficer" width="120" />
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="状态" align="center" prop="auditStatus" width="110">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <el-tooltip content="详情" placement="top">
|
|
|
|
|
- <el-button link type="info" icon="View" @click="handleDetail(scope.row)"></el-button>
|
|
|
|
|
- </el-tooltip>
|
|
|
|
|
- <el-tooltip content="修改" placement="top">
|
|
|
|
|
- <el-button v-has-permi="['riskctrl:workReport:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
|
|
|
|
- </el-tooltip>
|
|
|
|
|
- <el-tooltip content="审核" placement="top">
|
|
|
|
|
- <el-button v-has-permi="['riskctrl:workReport:audit']" link type="warning" icon="Select" @click="handleAudit(scope.row)"></el-button>
|
|
|
|
|
- </el-tooltip>
|
|
|
|
|
- <el-tooltip content="删除" placement="top">
|
|
|
|
|
- <el-button v-has-permi="['riskctrl:workReport:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
|
|
|
|
- </el-tooltip>
|
|
|
|
|
|
|
+ <span class="tag-pill" :class="getAuditClass(scope.row.auditStatus)">
|
|
|
|
|
+ {{ getAuditText(scope.row.auditStatus) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="操作" fixed="right" width="240" align="center" header-align="center" class-name="operation-col">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div class="operation-actions">
|
|
|
|
|
+ <el-button link type="primary" @click="handleDetail(scope.row)">查看详情</el-button>
|
|
|
|
|
+ <el-button v-if="scope.row.auditStatus === '1'" link type="warning" @click="handleAudit(scope.row)">审核</el-button>
|
|
|
|
|
+ <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -112,6 +103,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+
|
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="施工开始时间" prop="startTime">
|
|
<el-form-item label="施工开始时间" prop="startTime">
|
|
@@ -138,6 +130,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+
|
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="现场安全员" prop="safetyOfficer">
|
|
<el-form-item label="现场安全员" prop="safetyOfficer">
|
|
@@ -150,13 +143,14 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+
|
|
|
<el-form-item label="现场施工图片" prop="workImages">
|
|
<el-form-item label="现场施工图片" prop="workImages">
|
|
|
<el-upload
|
|
<el-upload
|
|
|
v-model:file-list="workImageList"
|
|
v-model:file-list="workImageList"
|
|
|
:action="uploadUrl"
|
|
:action="uploadUrl"
|
|
|
:headers="uploadHeaders"
|
|
:headers="uploadHeaders"
|
|
|
list-type="picture-card"
|
|
list-type="picture-card"
|
|
|
- :accept="'image/jpeg,image/png'"
|
|
|
|
|
|
|
+ accept="image/jpeg,image/png"
|
|
|
:limit="5"
|
|
:limit="5"
|
|
|
:on-success="handleWorkImageSuccess"
|
|
:on-success="handleWorkImageSuccess"
|
|
|
:on-remove="handleWorkImageRemove"
|
|
:on-remove="handleWorkImageRemove"
|
|
@@ -169,13 +163,14 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+
|
|
|
<el-form-item label="施工证件" prop="permitFiles">
|
|
<el-form-item label="施工证件" prop="permitFiles">
|
|
|
<el-upload
|
|
<el-upload
|
|
|
ref="permitUploadRef"
|
|
ref="permitUploadRef"
|
|
|
v-model:file-list="permitFileList"
|
|
v-model:file-list="permitFileList"
|
|
|
:action="uploadUrl"
|
|
:action="uploadUrl"
|
|
|
:headers="uploadHeaders"
|
|
:headers="uploadHeaders"
|
|
|
- :accept="'.pdf,.jpg,.jpeg,.png'"
|
|
|
|
|
|
|
+ accept=".pdf,.jpg,.jpeg,.png"
|
|
|
:limit="1"
|
|
:limit="1"
|
|
|
:on-success="handlePermitFileSuccess"
|
|
:on-success="handlePermitFileSuccess"
|
|
|
:on-remove="handlePermitFileRemove"
|
|
:on-remove="handlePermitFileRemove"
|
|
@@ -187,8 +182,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
<template #file="{ file }">
|
|
<template #file="{ file }">
|
|
|
<div class="permit-file-item">
|
|
<div class="permit-file-item">
|
|
|
- <el-icon style="margin-right: 8px;"><Document /></el-icon>
|
|
|
|
|
- <el-link type="primary" :href="file.url || file.response?.data?.url" target="_blank" :underline="false">
|
|
|
|
|
|
|
+ <el-icon style="margin-right: 8px"><Document /></el-icon>
|
|
|
|
|
+ <el-link type="primary" :href="getFileUrl(file)" target="_blank" :underline="false">
|
|
|
{{ file.name }}
|
|
{{ file.name }}
|
|
|
</el-link>
|
|
</el-link>
|
|
|
<span class="permit-file-remove" @click="handlePermitFileRemove(file)">
|
|
<span class="permit-file-remove" @click="handlePermitFileRemove(file)">
|
|
@@ -198,6 +193,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+
|
|
|
<el-form-item label="施工说明" prop="workDesc">
|
|
<el-form-item label="施工说明" prop="workDesc">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="form.workDesc"
|
|
v-model="form.workDesc"
|
|
@@ -208,10 +204,12 @@
|
|
|
show-word-limit
|
|
show-word-limit
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+
|
|
|
<el-form-item label="备注" prop="remark">
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入备注" maxlength="500" show-word-limit />
|
|
<el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入备注" maxlength="500" show-word-limit />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
+
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
|
<el-button type="primary" :loading="buttonLoading" @click="submitForm">确 定</el-button>
|
|
<el-button type="primary" :loading="buttonLoading" @click="submitForm">确 定</el-button>
|
|
@@ -229,10 +227,12 @@
|
|
|
<el-radio value="2">审核不通过</el-radio>
|
|
<el-radio value="2">审核不通过</el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="审核意见" prop="auditComment">
|
|
|
|
|
- <el-input v-model="auditForm.auditComment" type="textarea" :rows="4" placeholder="请输入审核意见" maxlength="500" show-word-limit />
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item v-if="auditForm.auditStatus === '2'" label="不通过原因" prop="auditComment">
|
|
|
|
|
+ <el-input v-model="auditForm.auditComment" type="textarea" :rows="4" placeholder="请输入审核不通过原因" maxlength="500" show-word-limit />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
+
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitAudit">确 定</el-button>
|
|
<el-button type="primary" @click="submitAudit">确 定</el-button>
|
|
@@ -242,27 +242,31 @@
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
<!-- 详情弹窗 -->
|
|
<!-- 详情弹窗 -->
|
|
|
- <el-dialog v-model="detailOpen" title="作业上报详情" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close>
|
|
|
|
|
- <el-descriptions :column="2" border size="default">
|
|
|
|
|
- <el-descriptions-item label="上报编号">{{ detailData.reportNo }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="作业类型">{{ detailData.workType }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="项目名称">{{ detailData.projectName }}</el-descriptions-item>
|
|
|
|
|
|
|
+ <el-dialog v-model="detailOpen" title="作业上报详情" width="780px" append-to-body :close-on-click-modal="false" destroy-on-close>
|
|
|
|
|
+ <el-descriptions :column="2" border class="detail-desc">
|
|
|
|
|
+ <el-descriptions-item label="作业类型">{{ detailData.workType || '-' }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="项目名称">{{ detailData.projectName || '-' }}</el-descriptions-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-descriptions-item label="施工开始时间">{{ detailData.startTime || '-' }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="施工结束时间">{{ detailData.endTime || '-' }}</el-descriptions-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-descriptions-item label="现场安全员">{{ detailData.safetyOfficer || '-' }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="联系电话">{{ detailData.contactPhone || '-' }}</el-descriptions-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-descriptions-item label="申报时间">{{ detailData.createTime || '-' }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="审核状态">
|
|
<el-descriptions-item label="审核状态">
|
|
|
- <el-tag v-if="detailData.auditStatus === '0'" type="success">已通过</el-tag>
|
|
|
|
|
- <el-tag v-else-if="detailData.auditStatus === '1'" type="warning">待审核</el-tag>
|
|
|
|
|
- <el-tag v-else-if="detailData.auditStatus === '2'" type="danger">已驳回</el-tag>
|
|
|
|
|
|
|
+ <span class="tag-pill" :class="getAuditClass(detailData.auditStatus || '')">
|
|
|
|
|
+ {{ getAuditText(detailData.auditStatus || '') }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-descriptions-item label="施工说明" :span="2">
|
|
|
|
|
+ {{ detailData.workDesc || '-' }}
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
- <el-descriptions-item label="施工开始时间">{{ detailData.startTime }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="施工结束时间">{{ detailData.endTime }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="现场安全员">{{ detailData.safetyOfficer }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="联系电话">{{ detailData.contactPhone }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item v-if="detailData.auditStatus !== '1'" label="审核意见" :span="2">{{ detailData.auditComment || '-' }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="施工说明" :span="2">{{ detailData.workDesc || '-' }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="备注" :span="2">{{ detailData.remark || '-' }}</el-descriptions-item>
|
|
|
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
<el-divider content-position="left">现场施工图片</el-divider>
|
|
<el-divider content-position="left">现场施工图片</el-divider>
|
|
|
- <div v-if="detailImageUrls.length > 0" style="display: flex; flex-wrap: wrap; gap: 10px;">
|
|
|
|
|
|
|
+ <div v-if="detailImageUrls.length > 0" class="detail-image-list">
|
|
|
<el-image
|
|
<el-image
|
|
|
v-for="(url, idx) in detailImageUrls"
|
|
v-for="(url, idx) in detailImageUrls"
|
|
|
:key="idx"
|
|
:key="idx"
|
|
@@ -270,27 +274,25 @@
|
|
|
:preview-src-list="detailImageUrls"
|
|
:preview-src-list="detailImageUrls"
|
|
|
:initial-index="idx"
|
|
:initial-index="idx"
|
|
|
fit="cover"
|
|
fit="cover"
|
|
|
- style="width: 120px; height: 120px; border-radius: 6px; cursor: pointer;"
|
|
|
|
|
|
|
+ class="detail-image-item"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<el-empty v-else description="暂无施工图片" :image-size="60" />
|
|
<el-empty v-else description="暂无施工图片" :image-size="60" />
|
|
|
|
|
|
|
|
<el-divider content-position="left">施工证件</el-divider>
|
|
<el-divider content-position="left">施工证件</el-divider>
|
|
|
- <div v-if="detailPermitUrls.length > 0">
|
|
|
|
|
- <div v-for="(url, idx) in detailPermitUrls" :key="idx" style="margin-bottom: 8px;">
|
|
|
|
|
- <el-link type="primary" :href="url" target="_blank">
|
|
|
|
|
- <el-icon><Document /></el-icon>
|
|
|
|
|
- {{ getFileNameFromUrl(url) }}
|
|
|
|
|
- </el-link>
|
|
|
|
|
- <el-tag v-if="isPdfUrl(url)" size="small" type="info" style="margin-left: 8px;">PDF</el-tag>
|
|
|
|
|
- <el-tag v-else size="small" type="success" style="margin-left: 8px;">图片</el-tag>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div v-if="detailPermitUrls.length > 0" class="permit-card-list">
|
|
|
|
|
+ <a v-for="(url, idx) in detailPermitUrls" :key="idx" class="permit-card" :href="url" target="_blank" rel="noreferrer">
|
|
|
|
|
+ <el-icon class="permit-card-icon">
|
|
|
|
|
+ <Document />
|
|
|
|
|
+ </el-icon>
|
|
|
|
|
+ <span class="permit-card-name">{{ getFileNameFromUrl(url) }}</span>
|
|
|
|
|
+ </a>
|
|
|
</div>
|
|
</div>
|
|
|
<el-empty v-else description="暂无施工证件" :image-size="60" />
|
|
<el-empty v-else description="暂无施工证件" :image-size="60" />
|
|
|
|
|
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
|
- <el-button @click="detailOpen = false">关 闭</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="detailOpen = false">关闭</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -298,15 +300,11 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="WorkReport" lang="ts">
|
|
<script setup name="WorkReport" lang="ts">
|
|
|
-import { ref, reactive, onMounted, nextTick } from 'vue';
|
|
|
|
|
|
|
+import { ref, reactive, onMounted, nextTick, computed, getCurrentInstance } from 'vue';
|
|
|
import type { ComponentInternalInstance } from 'vue';
|
|
import type { ComponentInternalInstance } from 'vue';
|
|
|
-import type { ElFormInstance } from 'element-plus';
|
|
|
|
|
|
|
+import type { FormInstance } from 'element-plus';
|
|
|
import { Plus, Document, Close } from '@element-plus/icons-vue';
|
|
import { Plus, Document, Close } from '@element-plus/icons-vue';
|
|
|
-import { getCurrentInstance } from 'vue';
|
|
|
|
|
-import {
|
|
|
|
|
- listWorkReport, getWorkReport, delWorkReport,
|
|
|
|
|
- addWorkReport, updateWorkReport, auditWorkReport
|
|
|
|
|
-} from '@/api/riskctrl/workReport';
|
|
|
|
|
|
|
+import { listWorkReport, getWorkReport, delWorkReport, addWorkReport, updateWorkReport, auditWorkReport } from '@/api/riskctrl/workReport';
|
|
|
import type { WorkReportVO } from '@/api/riskctrl/workReport/types';
|
|
import type { WorkReportVO } from '@/api/riskctrl/workReport/types';
|
|
|
import { getToken } from '@/utils/auth';
|
|
import { getToken } from '@/utils/auth';
|
|
|
|
|
|
|
@@ -315,21 +313,21 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const reportList = ref<WorkReportVO[]>([]);
|
|
const reportList = ref<WorkReportVO[]>([]);
|
|
|
const loading = ref(true);
|
|
const loading = ref(true);
|
|
|
const buttonLoading = ref(false);
|
|
const buttonLoading = ref(false);
|
|
|
-const showSearch = ref(true);
|
|
|
|
|
-const ids = ref<Array<string | number>>([]);
|
|
|
|
|
-const single = ref(true);
|
|
|
|
|
-const multiple = ref(true);
|
|
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
const title = ref('');
|
|
const title = ref('');
|
|
|
const open = ref(false);
|
|
const open = ref(false);
|
|
|
const auditOpen = ref(false);
|
|
const auditOpen = ref(false);
|
|
|
|
|
+const detailOpen = ref(false);
|
|
|
|
|
|
|
|
-const queryFormRef = ref<ElFormInstance>();
|
|
|
|
|
-const reportFormRef = ref<ElFormInstance>();
|
|
|
|
|
-const auditFormRef = ref<ElFormInstance>();
|
|
|
|
|
|
|
+const queryFormRef = ref<FormInstance>();
|
|
|
|
|
+const reportFormRef = ref<FormInstance>();
|
|
|
|
|
+const auditFormRef = ref<FormInstance>();
|
|
|
|
|
|
|
|
const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + '/resource/oss/upload');
|
|
const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + '/resource/oss/upload');
|
|
|
-const uploadHeaders = ref({ Authorization: 'Bearer ' + getToken(), clientid: import.meta.env.VITE_APP_CLIENT_ID });
|
|
|
|
|
|
|
+const uploadHeaders = ref({
|
|
|
|
|
+ Authorization: 'Bearer ' + getToken(),
|
|
|
|
|
+ clientid: import.meta.env.VITE_APP_CLIENT_ID
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
const workImageList = ref<any[]>([]);
|
|
const workImageList = ref<any[]>([]);
|
|
|
const permitFileList = ref<any[]>([]);
|
|
const permitFileList = ref<any[]>([]);
|
|
@@ -394,13 +392,20 @@ const auditForm = reactive<AuditFormType>({
|
|
|
auditComment: ''
|
|
auditComment: ''
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-// 详情弹窗
|
|
|
|
|
-const detailOpen = ref(false);
|
|
|
|
|
-const detailData = ref<WorkReportVO>({});
|
|
|
|
|
|
|
+type OssUploadResponse = {
|
|
|
|
|
+ data?: {
|
|
|
|
|
+ url?: string;
|
|
|
|
|
+ };
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const getFileUrl = (file: any) => {
|
|
|
|
|
+ return file?.url || (file?.response as OssUploadResponse | undefined)?.data?.url || '';
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const detailData = ref<Partial<WorkReportVO>>({});
|
|
|
const detailImageUrls = ref<string[]>([]);
|
|
const detailImageUrls = ref<string[]>([]);
|
|
|
const detailPermitUrls = ref<string[]>([]);
|
|
const detailPermitUrls = ref<string[]>([]);
|
|
|
|
|
|
|
|
-/** 手机号/固话验证 */
|
|
|
|
|
const validatePhone = (_rule: any, value: string, callback: any) => {
|
|
const validatePhone = (_rule: any, value: string, callback: any) => {
|
|
|
if (!value) {
|
|
if (!value) {
|
|
|
callback();
|
|
callback();
|
|
@@ -433,28 +438,52 @@ const rules = {
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
safetyOfficer: [{ required: true, message: '请输入现场安全员姓名', trigger: 'blur' }],
|
|
safetyOfficer: [{ required: true, message: '请输入现场安全员姓名', trigger: 'blur' }],
|
|
|
- contactPhone: [{ validator: validatePhone, trigger: 'blur' }]
|
|
|
|
|
|
|
+ contactPhone: [{ validator: validatePhone, trigger: 'blur' }],
|
|
|
|
|
+ workDesc: [
|
|
|
|
|
+ {
|
|
|
|
|
+ validator: (_rule: any, value: string, callback: any) => {
|
|
|
|
|
+ if ((value || '').length > 500) {
|
|
|
|
|
+ callback(new Error('施工说明不能超过 500 字'));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ callback();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const auditRules = computed(() => ({
|
|
|
|
|
+ auditStatus: [{ required: true, message: '请选择审核结果', trigger: 'change' }],
|
|
|
|
|
+ auditComment: auditForm.auditStatus === '2' ? [{ required: true, message: '请输入审核不通过原因', trigger: 'blur' }] : []
|
|
|
|
|
+}));
|
|
|
|
|
+
|
|
|
|
|
+/** 作业类型标签 */
|
|
|
|
|
+const getWorkTypeClass = (workType: string) => {
|
|
|
|
|
+ return workType === '临时施工上报' ? 'work-temp' : 'work-reform';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const auditRules = {
|
|
|
|
|
- auditStatus: [{ required: true, message: '请选择审核结果', trigger: 'change' }]
|
|
|
|
|
|
|
+/** 审核状态标签 */
|
|
|
|
|
+const getAuditText = (status: string) => {
|
|
|
|
|
+ const map: Record<string, string> = {
|
|
|
|
|
+ '0': '审核通过',
|
|
|
|
|
+ '1': '待审核',
|
|
|
|
|
+ '2': '审核不通过'
|
|
|
|
|
+ };
|
|
|
|
|
+ return map[status] || '-';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const columns = ref([
|
|
|
|
|
- { key: 0, label: '上报编号', visible: true },
|
|
|
|
|
- { key: 1, label: '作业类型', visible: true },
|
|
|
|
|
- { key: 2, label: '项目名称', visible: true },
|
|
|
|
|
- { key: 3, label: '施工开始时间', visible: true },
|
|
|
|
|
- { key: 4, label: '施工结束时间', visible: true },
|
|
|
|
|
- { key: 5, label: '现场安全员', visible: true },
|
|
|
|
|
- { key: 6, label: '联系电话', visible: true },
|
|
|
|
|
- { key: 7, label: '审核状态', visible: true },
|
|
|
|
|
- { key: 8, label: '创建时间', visible: true }
|
|
|
|
|
-]);
|
|
|
|
|
-
|
|
|
|
|
-/** 施工开始时间禁用未来日期(可选:不晚于当前时间) */
|
|
|
|
|
|
|
+const getAuditClass = (status: string) => {
|
|
|
|
|
+ const map: Record<string, string> = {
|
|
|
|
|
+ '0': 'audit-success',
|
|
|
|
|
+ '1': 'audit-pending',
|
|
|
|
|
+ '2': 'audit-reject'
|
|
|
|
|
+ };
|
|
|
|
|
+ return map[status] || 'audit-pending';
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/** 施工开始时间禁用未来日期 */
|
|
|
const startDisabledDate = (date: Date) => {
|
|
const startDisabledDate = (date: Date) => {
|
|
|
- // return date.getTime() > Date.now(); // 开启则禁止选择未来时间
|
|
|
|
|
return false;
|
|
return false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -466,7 +495,6 @@ const endDisabledDate = (date: Date) => {
|
|
|
return false;
|
|
return false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 获取列表 */
|
|
|
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
try {
|
|
try {
|
|
@@ -475,6 +503,8 @@ const getList = async () => {
|
|
|
total.value = res.total || 0;
|
|
total.value = res.total || 0;
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.error('加载作业上报列表失败', e);
|
|
console.error('加载作业上报列表失败', e);
|
|
|
|
|
+ reportList.value = [];
|
|
|
|
|
+ total.value = 0;
|
|
|
} finally {
|
|
} finally {
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
}
|
|
}
|
|
@@ -501,7 +531,7 @@ const reset = () => {
|
|
|
workImageList.value = [];
|
|
workImageList.value = [];
|
|
|
permitFileList.value = [];
|
|
permitFileList.value = [];
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
- reportFormRef.value?.resetFields();
|
|
|
|
|
|
|
+ reportFormRef.value?.clearValidate();
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -512,135 +542,168 @@ const handleQuery = () => {
|
|
|
|
|
|
|
|
const resetQuery = () => {
|
|
const resetQuery = () => {
|
|
|
queryFormRef.value?.resetFields();
|
|
queryFormRef.value?.resetFields();
|
|
|
- handleQuery();
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const handleSelectionChange = (selection: WorkReportVO[]) => {
|
|
|
|
|
- ids.value = selection.map((item) => item.reportId);
|
|
|
|
|
- single.value = selection.length !== 1;
|
|
|
|
|
- multiple.value = !selection.length;
|
|
|
|
|
|
|
+ queryParams.pageNum = 1;
|
|
|
|
|
+ queryParams.reportNo = undefined;
|
|
|
|
|
+ queryParams.projectName = undefined;
|
|
|
|
|
+ queryParams.workType = undefined;
|
|
|
|
|
+ queryParams.auditStatus = undefined;
|
|
|
|
|
+ getList();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 新增 */
|
|
|
|
|
const handleAdd = () => {
|
|
const handleAdd = () => {
|
|
|
reset();
|
|
reset();
|
|
|
open.value = true;
|
|
open.value = true;
|
|
|
title.value = '新增作业上报表单';
|
|
title.value = '新增作业上报表单';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 修改 */
|
|
|
|
|
|
|
+const handleDetail = async (row?: WorkReportVO) => {
|
|
|
|
|
+ const reportId = row?.reportId;
|
|
|
|
|
+ if (!reportId) return;
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res: any = await getWorkReport(reportId);
|
|
|
|
|
+ const data = res.data || res;
|
|
|
|
|
+ detailData.value = data;
|
|
|
|
|
+ detailImageUrls.value = data.workImages ? data.workImages.split(',').filter(Boolean) : [];
|
|
|
|
|
+ detailPermitUrls.value = data.permitFiles ? data.permitFiles.split(',').filter(Boolean) : [];
|
|
|
|
|
+ detailOpen.value = true;
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('获取详情失败', e);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const handleUpdate = async (row?: WorkReportVO) => {
|
|
const handleUpdate = async (row?: WorkReportVO) => {
|
|
|
reset();
|
|
reset();
|
|
|
- const reportId = row?.reportId || ids.value[0];
|
|
|
|
|
|
|
+ const reportId = row?.reportId;
|
|
|
|
|
+ if (!reportId) return;
|
|
|
|
|
+
|
|
|
const res: any = await getWorkReport(reportId);
|
|
const res: any = await getWorkReport(reportId);
|
|
|
- const data = res.data;
|
|
|
|
|
|
|
+ const data = res.data || res;
|
|
|
Object.assign(form, data);
|
|
Object.assign(form, data);
|
|
|
- // 回显图片列表
|
|
|
|
|
|
|
+
|
|
|
if (data.workImages) {
|
|
if (data.workImages) {
|
|
|
const urls = data.workImages.split(',').filter(Boolean);
|
|
const urls = data.workImages.split(',').filter(Boolean);
|
|
|
workImageList.value = urls.map((url: string, idx: number) => ({
|
|
workImageList.value = urls.map((url: string, idx: number) => ({
|
|
|
name: 'image_' + idx,
|
|
name: 'image_' + idx,
|
|
|
- url: url,
|
|
|
|
|
- response: { data: { url: url } }
|
|
|
|
|
|
|
+ url,
|
|
|
|
|
+ response: { data: { url } }
|
|
|
}));
|
|
}));
|
|
|
}
|
|
}
|
|
|
- // 回显证件列表
|
|
|
|
|
|
|
+
|
|
|
if (data.permitFiles) {
|
|
if (data.permitFiles) {
|
|
|
const urls = data.permitFiles.split(',').filter(Boolean);
|
|
const urls = data.permitFiles.split(',').filter(Boolean);
|
|
|
permitFileList.value = urls.map((url: string, idx: number) => ({
|
|
permitFileList.value = urls.map((url: string, idx: number) => ({
|
|
|
name: 'permit_' + idx,
|
|
name: 'permit_' + idx,
|
|
|
- url: url,
|
|
|
|
|
- response: { data: { url: url } }
|
|
|
|
|
|
|
+ url,
|
|
|
|
|
+ response: { data: { url } }
|
|
|
}));
|
|
}));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
open.value = true;
|
|
open.value = true;
|
|
|
title.value = '修改作业上报';
|
|
title.value = '修改作业上报';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 详情查看 */
|
|
|
|
|
-const handleDetail = async (row?: WorkReportVO) => {
|
|
|
|
|
- const reportId = row?.reportId || ids.value[0];
|
|
|
|
|
|
|
+const handleAudit = async (row?: WorkReportVO) => {
|
|
|
|
|
+ const reportId = row?.reportId;
|
|
|
|
|
+ if (!reportId) return;
|
|
|
|
|
+
|
|
|
|
|
+ const res: any = await getWorkReport(reportId);
|
|
|
|
|
+ const data = res.data || res;
|
|
|
|
|
+ auditForm.reportId = data.reportId;
|
|
|
|
|
+ auditForm.auditStatus = '';
|
|
|
|
|
+ auditForm.auditComment = '';
|
|
|
|
|
+ auditOpen.value = true;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const submitForm = () => {
|
|
|
|
|
+ reportFormRef.value?.validate(async (valid: boolean) => {
|
|
|
|
|
+ if (!valid) return;
|
|
|
|
|
+
|
|
|
|
|
+ buttonLoading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ form.workImages = workImageList.value
|
|
|
|
|
+ .filter((f: any) => f.response?.data?.url || f.url)
|
|
|
|
|
+ .map((f: any) => f.response?.data?.url || f.url)
|
|
|
|
|
+ .join(',');
|
|
|
|
|
+
|
|
|
|
|
+ form.permitFiles = permitFileList.value
|
|
|
|
|
+ .filter((f: any) => f.response?.data?.url || f.url)
|
|
|
|
|
+ .map((f: any) => f.response?.data?.url || f.url)
|
|
|
|
|
+ .join(',');
|
|
|
|
|
+
|
|
|
|
|
+ if (form.reportId) {
|
|
|
|
|
+ await updateWorkReport(form as any);
|
|
|
|
|
+ proxy?.$modal.msgSuccess('修改成功');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ await addWorkReport(form as any);
|
|
|
|
|
+ proxy?.$modal.msgSuccess('新增成功');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ open.value = false;
|
|
|
|
|
+ await getList();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('提交失败', e);
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ buttonLoading.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const submitAudit = () => {
|
|
|
|
|
+ auditFormRef.value?.validate(async (valid: boolean) => {
|
|
|
|
|
+ if (!valid) return;
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ await auditWorkReport({
|
|
|
|
|
+ reportId: auditForm.reportId,
|
|
|
|
|
+ auditStatus: auditForm.auditStatus,
|
|
|
|
|
+ auditComment: auditForm.auditStatus === '2' ? auditForm.auditComment : ''
|
|
|
|
|
+ } as any);
|
|
|
|
|
+ proxy?.$modal.msgSuccess('审核完成');
|
|
|
|
|
+ auditOpen.value = false;
|
|
|
|
|
+ await getList();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('审核失败', e);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const handleDelete = async (row?: WorkReportVO) => {
|
|
|
|
|
+ const reportId = row?.reportId;
|
|
|
|
|
+ if (!reportId) return;
|
|
|
|
|
+
|
|
|
|
|
+ await proxy?.$modal.confirm('是否确认删除该作业上报数据?');
|
|
|
try {
|
|
try {
|
|
|
- const res: any = await getWorkReport(reportId);
|
|
|
|
|
- detailData.value = res.data;
|
|
|
|
|
- // 解析图片和证件URL
|
|
|
|
|
- detailImageUrls.value = res.data.workImages
|
|
|
|
|
- ? res.data.workImages.split(',').filter(Boolean)
|
|
|
|
|
- : [];
|
|
|
|
|
- detailPermitUrls.value = res.data.permitFiles
|
|
|
|
|
- ? res.data.permitFiles.split(',').filter(Boolean)
|
|
|
|
|
- : [];
|
|
|
|
|
- detailOpen.value = true;
|
|
|
|
|
|
|
+ await delWorkReport(reportId);
|
|
|
|
|
+ proxy?.$modal.msgSuccess('删除成功');
|
|
|
|
|
+ await getList();
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- console.error('获取详情失败', e);
|
|
|
|
|
|
|
+ console.error('删除失败', e);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 从URL提取文件名 */
|
|
|
|
|
const getFileNameFromUrl = (url: string) => {
|
|
const getFileNameFromUrl = (url: string) => {
|
|
|
if (!url) return '未知文件';
|
|
if (!url) return '未知文件';
|
|
|
const parts = url.split('/');
|
|
const parts = url.split('/');
|
|
|
return parts[parts.length - 1] || '未知文件';
|
|
return parts[parts.length - 1] || '未知文件';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 判断是否为PDF文件 */
|
|
|
|
|
const isPdfUrl = (url: string) => {
|
|
const isPdfUrl = (url: string) => {
|
|
|
return url?.toLowerCase().endsWith('.pdf');
|
|
return url?.toLowerCase().endsWith('.pdf');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 提交表单 */
|
|
|
|
|
-const submitForm = () => {
|
|
|
|
|
- reportFormRef.value?.validate(async (valid: boolean) => {
|
|
|
|
|
- if (valid) {
|
|
|
|
|
- buttonLoading.value = true;
|
|
|
|
|
- try {
|
|
|
|
|
- // 拼接图片路径
|
|
|
|
|
- form.workImages = workImageList.value
|
|
|
|
|
- .filter((f: any) => f.response?.data?.url || f.url)
|
|
|
|
|
- .map((f: any) => f.response?.data?.url || f.url)
|
|
|
|
|
- .join(',');
|
|
|
|
|
- // 拼接证件路径
|
|
|
|
|
- form.permitFiles = permitFileList.value
|
|
|
|
|
- .filter((f: any) => f.response?.data?.url || f.url)
|
|
|
|
|
- .map((f: any) => f.response?.data?.url || f.url)
|
|
|
|
|
- .join(',');
|
|
|
|
|
-
|
|
|
|
|
- if (form.reportId) {
|
|
|
|
|
- await updateWorkReport(form as any);
|
|
|
|
|
- proxy?.$modal.msgSuccess('修改成功');
|
|
|
|
|
- } else {
|
|
|
|
|
- await addWorkReport(form as any);
|
|
|
|
|
- proxy?.$modal.msgSuccess('新增成功');
|
|
|
|
|
- }
|
|
|
|
|
- open.value = false;
|
|
|
|
|
- await getList();
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error('提交失败', e);
|
|
|
|
|
- } finally {
|
|
|
|
|
- buttonLoading.value = false;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-/** 图片上传成功 */
|
|
|
|
|
-const handleWorkImageSuccess = (response: any, _file: any) => {
|
|
|
|
|
|
|
+const handleWorkImageSuccess = (response: any) => {
|
|
|
if (response.code !== 200) {
|
|
if (response.code !== 200) {
|
|
|
proxy?.$modal.msgError(response.msg || '上传失败');
|
|
proxy?.$modal.msgError(response.msg || '上传失败');
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 图片移除 */
|
|
|
|
|
-const handleWorkImageRemove = (_file: any) => {
|
|
|
|
|
- // 从列表中移除
|
|
|
|
|
-};
|
|
|
|
|
|
|
+const handleWorkImageRemove = (_file?: any) => {};
|
|
|
|
|
|
|
|
-/** 超出图片数量限制 */
|
|
|
|
|
const handleImageExceed = () => {
|
|
const handleImageExceed = () => {
|
|
|
proxy?.$modal.msgError('最多只能上传 5 张图片');
|
|
proxy?.$modal.msgError('最多只能上传 5 张图片');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 图片上传前校验 */
|
|
|
|
|
const beforeWorkImageUpload = (file: any) => {
|
|
const beforeWorkImageUpload = (file: any) => {
|
|
|
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
|
if (!isJpgOrPng) {
|
|
if (!isJpgOrPng) {
|
|
@@ -655,17 +718,14 @@ const beforeWorkImageUpload = (file: any) => {
|
|
|
return true;
|
|
return true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 证件上传成功 */
|
|
|
|
|
-const handlePermitFileSuccess = (response: any, _file: any) => {
|
|
|
|
|
|
|
+const handlePermitFileSuccess = (response: any) => {
|
|
|
if (response.code !== 200) {
|
|
if (response.code !== 200) {
|
|
|
proxy?.$modal.msgError(response.msg || '上传失败');
|
|
proxy?.$modal.msgError(response.msg || '上传失败');
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 证件移除 */
|
|
|
|
|
-const handlePermitFileRemove = (_file: any) => {};
|
|
|
|
|
|
|
+const handlePermitFileRemove = (_file?: any) => {};
|
|
|
|
|
|
|
|
-/** 证件上传前校验 */
|
|
|
|
|
const beforePermitFileUpload = (file: any) => {
|
|
const beforePermitFileUpload = (file: any) => {
|
|
|
const allowedTypes = ['application/pdf', 'image/jpeg', 'image/png'];
|
|
const allowedTypes = ['application/pdf', 'image/jpeg', 'image/png'];
|
|
|
if (!allowedTypes.includes(file.type)) {
|
|
if (!allowedTypes.includes(file.type)) {
|
|
@@ -680,56 +740,182 @@ const beforePermitFileUpload = (file: any) => {
|
|
|
return true;
|
|
return true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 审核 */
|
|
|
|
|
-const handleAudit = async (row?: WorkReportVO) => {
|
|
|
|
|
- const reportId = row?.reportId || ids.value[0];
|
|
|
|
|
- const res: any = await getWorkReport(reportId);
|
|
|
|
|
- auditForm.reportId = res.data.reportId;
|
|
|
|
|
- auditForm.auditStatus = '';
|
|
|
|
|
- auditForm.auditComment = '';
|
|
|
|
|
- auditOpen.value = true;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-/** 提交审核 */
|
|
|
|
|
-const submitAudit = () => {
|
|
|
|
|
- auditFormRef.value?.validate(async (valid: boolean) => {
|
|
|
|
|
- if (valid) {
|
|
|
|
|
- try {
|
|
|
|
|
- await auditWorkReport({
|
|
|
|
|
- reportId: auditForm.reportId,
|
|
|
|
|
- auditStatus: auditForm.auditStatus,
|
|
|
|
|
- auditComment: auditForm.auditComment
|
|
|
|
|
- } as any);
|
|
|
|
|
- proxy?.$modal.msgSuccess('审核完成');
|
|
|
|
|
- auditOpen.value = false;
|
|
|
|
|
- await getList();
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error('审核失败', e);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-/** 删除 */
|
|
|
|
|
-const handleDelete = async (row?: WorkReportVO) => {
|
|
|
|
|
- const reportIds = row?.reportId || ids.value;
|
|
|
|
|
- await proxy?.$modal.confirm('是否确认删除选中的作业上报数据?');
|
|
|
|
|
- try {
|
|
|
|
|
- await delWorkReport(reportIds);
|
|
|
|
|
- proxy?.$modal.msgSuccess('删除成功');
|
|
|
|
|
- await getList();
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error('删除失败', e);
|
|
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
getList();
|
|
getList();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
-<style scoped>
|
|
|
|
|
-.permit-file-item {
|
|
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
|
+.work-report-page {
|
|
|
|
|
+ padding: 16px;
|
|
|
|
|
+ background: #f5f7fb;
|
|
|
|
|
+ min-height: calc(100vh - 50px);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.page-header {
|
|
|
|
|
+ margin-bottom: 16px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.page-title {
|
|
|
|
|
+ font-size: 22px;
|
|
|
|
|
+ font-weight: 700;
|
|
|
|
|
+ color: #1f2937;
|
|
|
|
|
+ margin-bottom: 6px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.page-desc {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.search-card,
|
|
|
|
|
+.table-card {
|
|
|
|
|
+ border-radius: 14px;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ margin-bottom: 16px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.search-form {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.search-actions {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
|
+ gap: 10px;
|
|
|
|
|
+ margin-top: 6px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.dialog-footer {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
|
+ gap: 10px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.tag-pill {
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ min-width: 72px;
|
|
|
|
|
+ height: 28px;
|
|
|
|
|
+ padding: 0 12px;
|
|
|
|
|
+ border-radius: 999px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ line-height: 1;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.work-type {
|
|
|
|
|
+ min-width: 92px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.work-temp {
|
|
|
|
|
+ background: #e0ecff;
|
|
|
|
|
+ color: #2563eb;
|
|
|
|
|
+ border: 1px solid #bfdbfe;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.work-reform {
|
|
|
|
|
+ background: #fff1e0;
|
|
|
|
|
+ color: #ea580c;
|
|
|
|
|
+ border: 1px solid #fed7aa;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.audit-success {
|
|
|
|
|
+ background: #dcfce7;
|
|
|
|
|
+ color: #16a34a;
|
|
|
|
|
+ border: 1px solid #bbf7d0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.audit-pending {
|
|
|
|
|
+ background: #fef3c7;
|
|
|
|
|
+ color: #ca8a04;
|
|
|
|
|
+ border: 1px solid #fde68a;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.audit-reject {
|
|
|
|
|
+ background: #fee2e2;
|
|
|
|
|
+ color: #dc2626;
|
|
|
|
|
+ border: 1px solid #fecaca;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.operation-actions {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ gap: 14px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-image-list {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ gap: 10px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-image-item {
|
|
|
|
|
+ width: 120px;
|
|
|
|
|
+ height: 120px;
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ border: 1px solid #e5e7eb;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-desc {
|
|
|
|
|
+ margin-bottom: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-image-list {
|
|
|
|
|
+ display: grid;
|
|
|
|
|
+ grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
|
|
|
+ gap: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-image-item {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 132px;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ border: 1px solid #e5e7eb;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.permit-card-list {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ gap: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.permit-card {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 10px;
|
|
|
|
|
+ min-width: 180px;
|
|
|
|
|
+ padding: 12px 14px;
|
|
|
|
|
+ border: 1px solid #e5e7eb;
|
|
|
|
|
+ border-radius: 10px;
|
|
|
|
|
+ background: #f8fafc;
|
|
|
|
|
+ color: #1f2937;
|
|
|
|
|
+ text-decoration: none;
|
|
|
|
|
+ transition: all 0.2s ease;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.permit-card:hover {
|
|
|
|
|
+ border-color: #c7d2fe;
|
|
|
|
|
+ background: #eff6ff;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.permit-card-icon {
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ color: #2563eb;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.permit-card-name {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ word-break: break-all;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.permit-file-item,
|
|
|
|
|
+.permit-view-item {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
padding: 6px 10px;
|
|
padding: 6px 10px;
|
|
@@ -738,17 +924,21 @@ onMounted(() => {
|
|
|
margin-top: 6px;
|
|
margin-top: 6px;
|
|
|
background: var(--el-fill-color-light);
|
|
background: var(--el-fill-color-light);
|
|
|
}
|
|
}
|
|
|
-.permit-file-item .el-link {
|
|
|
|
|
|
|
+
|
|
|
|
|
+.permit-file-item .el-link,
|
|
|
|
|
+.permit-view-item .el-link {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.permit-file-remove {
|
|
.permit-file-remove {
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
color: var(--el-text-color-secondary);
|
|
color: var(--el-text-color-secondary);
|
|
|
margin-left: 8px;
|
|
margin-left: 8px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.permit-file-remove:hover {
|
|
.permit-file-remove:hover {
|
|
|
color: var(--el-color-danger);
|
|
color: var(--el-color-danger);
|
|
|
}
|
|
}
|