Browse Source

1.兽医管理入驻审核页面图片显示功能

2.牧户行政区划保存接口优化
master
ma-zhongxu 3 months ago
parent
commit
ddfd6bf568
  1. 16
      chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuUserController.java
  2. 2
      chenhai-system/src/main/java/com/chenhai/system/mapper/SysUserMapper.java
  3. 1
      chenhai-system/src/main/java/com/chenhai/system/service/ISysUserService.java
  4. 5
      chenhai-system/src/main/java/com/chenhai/system/service/impl/SysUserServiceImpl.java
  5. 4
      chenhai-system/src/main/resources/mapper/system/SysUserMapper.xml
  6. 266
      chenhai-ui/src/views/system/vet/aduit/index.vue

16
chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuUserController.java

@ -4,12 +4,10 @@ import com.chenhai.common.core.controller.BaseController;
import com.chenhai.common.core.domain.AjaxResult;
import com.chenhai.common.core.domain.entity.SysArea;
import com.chenhai.system.service.ISysAreaService;
import com.chenhai.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -26,6 +24,9 @@ public class MuhuUserController extends BaseController
@Autowired
private ISysAreaService sysAreaService;
@Autowired
private ISysUserService sysUserService;
@PreAuthorize("@ss.hasRole('muhu')")
@GetMapping("/areaChildren")
public AjaxResult getAreaChildren(@RequestParam(value = "parentCode", required = false, defaultValue = "152900") String parentCode) {
@ -35,4 +36,11 @@ public class MuhuUserController extends BaseController
List<SysArea> list = sysAreaService.selectSysAreaList(query);
return success(list);
}
@PreAuthorize("@ss.hasRole('muhu')")
@PutMapping("/saveUserAreaCode")
public AjaxResult getArea(@RequestParam(value = "areaCode") String areaCode) {
Long userId = getUserId();
return toAjax(sysUserService.updateUserAreaCode(userId, areaCode));
}
}

2
chenhai-system/src/main/java/com/chenhai/system/mapper/SysUserMapper.java

@ -154,4 +154,6 @@ public interface SysUserMapper
* @return 结果
*/
public SysUser checkEmailUnique(String email);
public int updateUserAreaCode(@Param("userId") Long userId, @Param("areaCode") String areaCode);
}

1
chenhai-system/src/main/java/com/chenhai/system/service/ISysUserService.java

@ -231,4 +231,5 @@ public interface ISysUserService
*/
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
public int updateUserAreaCode(Long userId, String areaCode);
}

5
chenhai-system/src/main/java/com/chenhai/system/service/impl/SysUserServiceImpl.java

@ -574,4 +574,9 @@ public class SysUserServiceImpl implements ISysUserService
}
return successMsg.toString();
}
@Override
public int updateUserAreaCode(Long userId, String areaCode) {
return userMapper.updateUserAreaCode(userId, areaCode);
}
}

4
chenhai-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -282,4 +282,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<update id="updateUserAreaCode">
update sys_user set area_code = #{areaCode} where user_id = #{userId}
</update>
</mapper>

266
chenhai-ui/src/views/system/vet/aduit/index.vue

@ -287,9 +287,9 @@
</div>
<div class="image-preview">
<el-image
style="width: 200px; height: 150px; margin-right: 15px;"
:src="getImageUrl(cert.certImage)"
:preview-src-list="[getImageUrl(cert.certImage)]"
style="width: 200px; height: 150px;"
:src="baseUrl + cert.certImage"
:preview-src-list="[baseUrl + cert.certImage]"
fit="contain"
>
<div slot="error" class="image-slot">
@ -297,12 +297,6 @@
<div>图片加载失败</div>
</div>
</el-image>
<el-button
type="primary"
size="mini"
@click="viewImage(cert.certImage)"
icon="el-icon-zoom-in"
>查看大图</el-button>
</div>
</div>
@ -368,28 +362,6 @@
{{ submittingAll ? '提交中...' : '提交审核' }}
</el-button>
</div>
<!-- 图片预览对话框 -->
<el-dialog
:visible.sync="imagePreviewVisible"
width="80%"
append-to-body
class="image-preview-dialog"
>
<el-image
style="width: 100%; max-height: 70vh;"
:src="previewImageUrl"
fit="contain"
>
<div slot="error" class="image-slot-large">
<i class="el-icon-picture-outline"></i>
<div>图片加载失败</div>
</div>
</el-image>
<span slot="footer" class="dialog-footer">
<el-button @click="imagePreviewVisible = false"> </el-button>
</span>
</el-dialog>
</el-dialog>
<!-- 详情对话框 -->
@ -439,85 +411,72 @@
</el-tab-pane>
<el-tab-pane label="资质证书" name="certificates" v-if="detailCertificates && detailCertificates.length > 0">
<div v-if="loadingCertDetail" class="tab-loading">
<i class="el-icon-loading"></i>
<div>加载证书信息...</div>
</div>
<div class="certificate-section">
<h3>资质证书列表 {{ detailCertificates.length }} 个证书</h3>
<div v-else>
<div class="certificate-section">
<h3>资质证书列表 {{ detailCertificates.length }} 个证书</h3>
<el-tabs v-model="detailCertActiveTab" type="card" class="cert-tabs">
<el-tab-pane
v-for="(cert, index) in detailCertificates"
:key="cert.qualificationId"
:label="cert.certName || cert.qualificationType || `证书${index + 1}`"
:name="'detailCert' + cert.qualificationId"
>
<div class="certificate-item view-only">
<div class="cert-header">
<div class="cert-title">
<span>{{ cert.certName || cert.qualificationType || '未命名证书' }}</span>
<el-tag v-if="cert.auditStatus === '1'" type="success" size="mini"> 已通过</el-tag>
<el-tag v-if="cert.auditStatus === '2'" type="danger" size="mini"> 未通过</el-tag>
<el-tag v-if="!cert.auditStatus || cert.auditStatus === '0'" type="warning" size="mini">待审核</el-tag>
<el-tabs v-model="detailCertActiveTab" type="card" class="cert-tabs">
<el-tab-pane
v-for="(cert, index) in detailCertificates"
:key="cert.qualificationId"
:label="cert.certName || cert.qualificationType || `证书${index + 1}`"
:name="'detailCert' + cert.qualificationId"
>
<div class="certificate-item view-only">
<div class="cert-header">
<div class="cert-title">
<span>{{ cert.certName || cert.qualificationType || '未命名证书' }}</span>
<el-tag v-if="cert.auditStatus === '1'" type="success" size="mini"> 已通过</el-tag>
<el-tag v-if="cert.auditStatus === '2'" type="danger" size="mini"> 未通过</el-tag>
<el-tag v-if="!cert.auditStatus || cert.auditStatus === '0'" type="warning" size="mini">待审核</el-tag>
</div>
<div class="cert-info">
<span><strong>证书编号</strong>{{ cert.certificateNo || '-' }}</span>
<span><strong>发证机构</strong>{{ cert.issueOrg || '-' }}</span>
<span><strong>资质类型</strong>{{ cert.qualificationType || '-' }}</span>
<span><strong>证书类型</strong>{{ cert.certType || '-' }}</span>
<span><strong>颁发日期</strong>{{ parseTime(cert.issueDate, '{y}-{m}-{d}') || '-' }}</span>
<span><strong>到期日期</strong>{{ parseTime(cert.expireDate, '{y}-{m}-{d}') || '-' }}</span>
<span><strong>证书状态</strong>{{ cert.certStatus || '-' }}</span>
<span><strong>审核状态</strong>
<el-tag :type="getAuditStatusTagType(cert.auditStatus)" size="small">
{{ getAuditStatusText(cert.auditStatus) }}
</el-tag>
</span>
<span><strong>审核意见</strong>{{ cert.auditOpinion || '-' }}</span>
<span><strong>审核时间</strong>{{ parseTime(cert.auditTime) || '-' }}</span>
</div>
<div v-if="cert.certImage" class="cert-image-section">
<div class="image-title">
<strong>证书图片</strong>
</div>
<div class="cert-info">
<span><strong>证书编号</strong>{{ cert.certificateNo || '-' }}</span>
<span><strong>发证机构</strong>{{ cert.issueOrg || '-' }}</span>
<span><strong>资质类型</strong>{{ cert.qualificationType || '-' }}</span>
<span><strong>证书类型</strong>{{ cert.certType || '-' }}</span>
<span><strong>颁发日期</strong>{{ parseTime(cert.issueDate, '{y}-{m}-{d}') || '-' }}</span>
<span><strong>到期日期</strong>{{ parseTime(cert.expireDate, '{y}-{m}-{d}') || '-' }}</span>
<span><strong>证书状态</strong>{{ cert.certStatus || '-' }}</span>
<span><strong>审核状态</strong>
<el-tag :type="getAuditStatusTagType(cert.auditStatus)" size="small">
{{ getAuditStatusText(cert.auditStatus) }}
</el-tag>
</span>
<span><strong>审核意见</strong>{{ cert.auditOpinion || '-' }}</span>
<span><strong>审核时间</strong>{{ parseTime(cert.auditTime) || '-' }}</span>
<div class="image-preview">
<el-image
style="width: 200px; height: 150px;"
:src="baseUrl + cert.certImage"
:preview-src-list="[baseUrl + cert.certImage]"
fit="contain"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
<div>图片加载失败</div>
</div>
</el-image>
</div>
</div>
<div v-if="cert.certImage" class="cert-image-section">
<div class="image-title">
<strong>证书图片</strong>
</div>
<div class="image-preview">
<el-image
style="width: 200px; height: 150px; margin-right: 15px;"
:src="getImageUrl(cert.certImage)"
:preview-src-list="[getImageUrl(cert.certImage)]"
fit="contain"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
<div>图片加载失败</div>
</div>
</el-image>
<el-button
type="primary"
size="mini"
@click="viewImage(cert.certImage)"
icon="el-icon-zoom-in"
>查看大图</el-button>
</div>
<div v-if="cert.certificateFiles" class="cert-files-section">
<div class="files-title">
<strong>其他附件</strong>
</div>
<div v-if="cert.certificateFiles" class="cert-files-section">
<div class="files-title">
<strong>其他附件</strong>
</div>
<div class="files-list">
<span>{{ cert.certificateFiles }}</span>
</div>
<div class="files-list">
<span>{{ cert.certificateFiles }}</span>
</div>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-tab-pane>
</el-tabs>
@ -545,6 +504,7 @@ export default {
showSearch: true,
total: 0,
infoList: [],
baseUrl: process.env.VUE_APP_BASE_API,
detailTitle: "",
detailVisible: false,
@ -862,19 +822,6 @@ export default {
return `${total} 个证书,已审核 ${audited} 个,其中通过 ${passed} 个,不通过 ${failed}`
},
viewImage(imagePath) {
this.previewImageUrl = this.getImageUrl(imagePath)
this.imagePreviewVisible = true
},
getImageUrl(path) {
if (!path) return ''
if (path.startsWith('/')) {
return process.env.VUE_APP_BASE_API + path
}
return path
},
resetAuditData() {
this.basicInfo = {}
this.basicAuditForm = {
@ -904,44 +851,40 @@ export default {
if (response.code === 200) {
this.detailData = response.data
this.loadDetailCertificates(response.data.userId)
// 使
if (response.data.userId) {
const queryParams = {
userId: response.data.userId,
pageNum: 1,
pageSize: 1000
}
listQualification(queryParams).then(certResponse => {
if (certResponse.code === 200) {
this.detailCertificates = certResponse.rows || []
if (this.detailCertificates.length > 0) {
this.detailCertActiveTab = 'detailCert' + this.detailCertificates[0].qualificationId
}
}
}).catch(error => {
console.error('加载证书详情失败:', error)
}).finally(() => {
this.loadingDetail = false
})
} else {
this.loadingDetail = false
}
} else {
this.$message.error(response.msg || '获取详情失败')
this.loadingDetail = false
}
}).catch(error => {
console.error('获取详情失败:', error)
this.$message.error('获取详情失败')
}).finally(() => {
this.loadingDetail = false
})
},
loadDetailCertificates(userId) {
if (!userId) return
this.loadingCertDetail = true
const queryParams = {
userId: userId,
pageNum: 1,
pageSize: 1000
}
listQualification(queryParams).then(response => {
if (response.code === 200) {
this.detailCertificates = response.rows || []
if (this.detailCertificates.length > 0) {
this.detailCertActiveTab = 'detailCert' + this.detailCertificates[0].qualificationId
}
}
}).catch(error => {
console.error('加载证书详情失败:', error)
this.$message.error('加载证书详情失败')
}).finally(() => {
this.loadingCertDetail = false
})
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
@ -1255,9 +1198,6 @@ export default {
}
.image-preview {
display: flex;
align-items: center;
.el-image {
border: 1px solid #dcdfe6;
border-radius: 4px;
@ -1306,40 +1246,6 @@ export default {
}
}
.image-preview-dialog {
:deep(.el-dialog__body) {
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
min-height: 400px;
.el-image {
max-height: 70vh;
}
.image-slot-large {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 400px;
background: #f5f7fa;
color: #909399;
i {
font-size: 40px;
margin-bottom: 10px;
}
div {
font-size: 14px;
}
}
}
}
.cert-audit-form {
margin-top: 20px;
padding-top: 20px;

Loading…
Cancel
Save