diff --git a/chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuUserController.java b/chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuUserController.java index a3e47a1..b793b23 100644 --- a/chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuUserController.java +++ b/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 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)); + } } diff --git a/chenhai-system/src/main/java/com/chenhai/system/mapper/SysUserMapper.java b/chenhai-system/src/main/java/com/chenhai/system/mapper/SysUserMapper.java index ccd832b..140f7ef 100644 --- a/chenhai-system/src/main/java/com/chenhai/system/mapper/SysUserMapper.java +++ b/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); } diff --git a/chenhai-system/src/main/java/com/chenhai/system/service/ISysUserService.java b/chenhai-system/src/main/java/com/chenhai/system/service/ISysUserService.java index 818753a..3147935 100644 --- a/chenhai-system/src/main/java/com/chenhai/system/service/ISysUserService.java +++ b/chenhai-system/src/main/java/com/chenhai/system/service/ISysUserService.java @@ -231,4 +231,5 @@ public interface ISysUserService */ public String importUser(List userList, Boolean isUpdateSupport, String operName); + public int updateUserAreaCode(Long userId, String areaCode); } diff --git a/chenhai-system/src/main/java/com/chenhai/system/service/impl/SysUserServiceImpl.java b/chenhai-system/src/main/java/com/chenhai/system/service/impl/SysUserServiceImpl.java index ab6fbe5..93994cf 100644 --- a/chenhai-system/src/main/java/com/chenhai/system/service/impl/SysUserServiceImpl.java +++ b/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); + } } diff --git a/chenhai-system/src/main/resources/mapper/system/SysUserMapper.xml b/chenhai-system/src/main/resources/mapper/system/SysUserMapper.xml index 716f1cf..c27a160 100644 --- a/chenhai-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/chenhai-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -282,4 +282,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + update sys_user set area_code = #{areaCode} where user_id = #{userId} + + \ No newline at end of file diff --git a/chenhai-ui/src/views/system/vet/aduit/index.vue b/chenhai-ui/src/views/system/vet/aduit/index.vue index fb56f14..04d9010 100644 --- a/chenhai-ui/src/views/system/vet/aduit/index.vue +++ b/chenhai-ui/src/views/system/vet/aduit/index.vue @@ -287,9 +287,9 @@
@@ -297,12 +297,6 @@
图片加载失败
- 查看大图
@@ -368,28 +362,6 @@ {{ submittingAll ? '提交中...' : '提交审核' }} - - - - -
- -
图片加载失败
-
-
- - 关 闭 - -
@@ -439,85 +411,72 @@ -
- -
加载证书信息...
-
+
+

资质证书列表(共 {{ detailCertificates.length }} 个证书)

-
-
-

资质证书列表(共 {{ detailCertificates.length }} 个证书)

- - - -
-
-
- {{ cert.certName || cert.qualificationType || '未命名证书' }} - ✓ 已通过 - ✗ 未通过 - 待审核 + + +
+
+
+ {{ cert.certName || cert.qualificationType || '未命名证书' }} + ✓ 已通过 + ✗ 未通过 + 待审核 +
+
+ 证书编号:{{ cert.certificateNo || '-' }} + 发证机构:{{ cert.issueOrg || '-' }} + 资质类型:{{ cert.qualificationType || '-' }} + 证书类型:{{ cert.certType || '-' }} + 颁发日期:{{ parseTime(cert.issueDate, '{y}-{m}-{d}') || '-' }} + 到期日期:{{ parseTime(cert.expireDate, '{y}-{m}-{d}') || '-' }} + 证书状态:{{ cert.certStatus || '-' }} + 审核状态: + + {{ getAuditStatusText(cert.auditStatus) }} + + + 审核意见:{{ cert.auditOpinion || '-' }} + 审核时间:{{ parseTime(cert.auditTime) || '-' }} +
+ +
+
+ 证书图片:
-
- 证书编号:{{ cert.certificateNo || '-' }} - 发证机构:{{ cert.issueOrg || '-' }} - 资质类型:{{ cert.qualificationType || '-' }} - 证书类型:{{ cert.certType || '-' }} - 颁发日期:{{ parseTime(cert.issueDate, '{y}-{m}-{d}') || '-' }} - 到期日期:{{ parseTime(cert.expireDate, '{y}-{m}-{d}') || '-' }} - 证书状态:{{ cert.certStatus || '-' }} - 审核状态: - - {{ getAuditStatusText(cert.auditStatus) }} - - - 审核意见:{{ cert.auditOpinion || '-' }} - 审核时间:{{ parseTime(cert.auditTime) || '-' }} +
+ +
+ +
图片加载失败
+
+
+
-
-
- 证书图片: -
-
- -
- -
图片加载失败
-
-
- 查看大图 -
+
+
+ 其他附件:
- -
-
- 其他附件: -
-
- {{ cert.certificateFiles }} -
+
+ {{ cert.certificateFiles }}
- - -
+
+ +
@@ -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;