Commit 96b2502a by 前端

Merge branch 'hotfix_5.5.4' into 'SAAS+V5.6.2'

上线合并

See merge request !554
2 parents 2f966a89 b76dfb0c
...@@ -258,7 +258,8 @@ export const uploadCustodyAgreement = (data = {}) => { ...@@ -258,7 +258,8 @@ export const uploadCustodyAgreement = (data = {}) => {
*/ */
export const webPayDepositApplication = (data = {}) => { export const webPayDepositApplication = (data = {}) => {
return gscPost("/evalElectronicContract/webPayDepositApplication", data, { return gscPost("/evalElectronicContract/webPayDepositApplication", data, {
timeout: 30000 timeout: 30000,
returnAll: true
}) })
} }
/** /**
...@@ -266,7 +267,8 @@ export const webPayDepositApplication = (data = {}) => { ...@@ -266,7 +267,8 @@ export const webPayDepositApplication = (data = {}) => {
*/ */
export const webPayFinalApplication = (data = {}) => { export const webPayFinalApplication = (data = {}) => {
return gscPost("/evalElectronicContract/webPayFinalApplication", data, { return gscPost("/evalElectronicContract/webPayFinalApplication", data, {
timeout: 30000 timeout: 30000,
returnAll: true
}) })
} }
/** /**
......
...@@ -1828,3 +1828,17 @@ export const signerTypeOpt = [ ...@@ -1828,3 +1828,17 @@ export const signerTypeOpt = [
{ confId: 1, confValue: "企业委托" }, { confId: 1, confValue: "企业委托" },
{ confId: 2, confValue: "企业" } { confId: 2, confValue: "企业" }
] ]
// 企微主体
// 1-惠州广联 3-优加
export const wechatTypeOpt = [
{ confId: 1, confValue: "惠州广联" },
{ confId: 3, confValue: "优加" }
]
// 合同企业主体(内部主体)
// contractOrg: hzglsk-惠州广联、szyjzh-优加
export const contractOrgOpt = [
{ confId: "hzglsk", confValue: "惠州广联" },
{ confId: "szyjzh", confValue: "优加" }
]
...@@ -59,6 +59,19 @@ const PAY_MENTMETHOD_OPTIONS = Object.keys(PAY_MENTMETHOD_MAP).map((key) => { ...@@ -59,6 +59,19 @@ const PAY_MENTMETHOD_OPTIONS = Object.keys(PAY_MENTMETHOD_MAP).map((key) => {
value: key value: key
} }
}) })
// 合同企业主体(内部主体)
// wechatType: 1-惠州广联、3-优加
const wechatType_MAP = {
1: "惠州广联",
3: "优加"
}
const wechatType_OPTIONS = Object.keys(wechatType_MAP).map((key) => {
return {
label: wechatType_MAP[key],
value: key
}
})
module.exports = { module.exports = {
RECEIPT_STATUS, RECEIPT_STATUS,
PUSH_STATUS, PUSH_STATUS,
...@@ -70,5 +83,7 @@ module.exports = { ...@@ -70,5 +83,7 @@ module.exports = {
RECEIPT_STATUS_OPTIONS, RECEIPT_STATUS_OPTIONS,
NB_TRANSFER_STATUS_OPTIONS, NB_TRANSFER_STATUS_OPTIONS,
PAY_MENTMETHOD_OPTIONS, PAY_MENTMETHOD_OPTIONS,
PAY_MENTMETHOD_MAP PAY_MENTMETHOD_MAP,
wechatType_OPTIONS,
wechatType_MAP
} }
...@@ -7,16 +7,14 @@ ...@@ -7,16 +7,14 @@
class="show-search" class="show-search"
:search-form="searchForm" :search-form="searchForm"
:form-data="showFormData" :form-data="showFormData"
label-width="130px" label-width="130px">
>
<template #inputRangeHtml> <template #inputRangeHtml>
<input-range <input-range
start-placeholder="最小金额" start-placeholder="最小金额"
end-placeholder="最大金额" end-placeholder="最大金额"
:display-value="searchForm.amtList" :display-value="searchForm.amtList"
max-length="15" max-length="15"
input-max-length="15" input-max-length="15"></input-range>
></input-range>
</template> </template>
<template #selectDatePickerHtml> <template #selectDatePickerHtml>
<div class="select-date-picker"> <div class="select-date-picker">
...@@ -24,14 +22,12 @@ ...@@ -24,14 +22,12 @@
v-model="searchForm.dateType" v-model="searchForm.dateType"
placeholder="请选择" placeholder="请选择"
@change="searchForm.dateValue = ''" @change="searchForm.dateValue = ''"
class="select" class="select">
>
<el-option <el-option
v-for="(subItem, subIndex) in selectOption" v-for="(subItem, subIndex) in selectOption"
:key="subIndex" :key="subIndex"
:label="subItem.label" :label="subItem.label"
:value="subItem.value" :value="subItem.value" />
/>
</el-select> </el-select>
<el-date-picker <el-date-picker
class="date-picker" class="date-picker"
...@@ -42,8 +38,7 @@ ...@@ -42,8 +38,7 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:picker-options="rangePickerOptions" :picker-options="rangePickerOptions"
:default-time="['00:00:00', '23:59:59']" :default-time="['00:00:00', '23:59:59']" />
/>
</div> </div>
</template> </template>
</d2-search> </d2-search>
...@@ -58,13 +53,11 @@ ...@@ -58,13 +53,11 @@
<d2-table-header> <d2-table-header>
<span <span
data-event-code="usedcar_payment_push_list" data-event-code="usedcar_payment_push_list"
style="margin-right: 10px" style="margin-right: 10px">
>
<auth-button <auth-button
category="Button" category="Button"
:show-btn-ids="['9051401']" :show-btn-ids="['9051401']"
:loading="pushPayBillLoading" :loading="pushPayBillLoading" />
/>
</span> </span>
<span data-event-code="usedcar_payment_management_list_export"> <span data-event-code="usedcar_payment_management_list_export">
<auth-button category="Button" :show-btn-ids="['9051402']" /> <auth-button category="Button" :show-btn-ids="['9051402']" />
...@@ -75,16 +68,14 @@ ...@@ -75,16 +68,14 @@
:search-form="searchFormSearch" :search-form="searchFormSearch"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn">
>
<div slot="statusHtml" slot-scope="scope"> <div slot="statusHtml" slot-scope="scope">
<span <span
class="circle" class="circle"
:style="{ :style="{
background: background:
baseData[scope.columnsObj.colorKey][scope.scope[scope.prop]] baseData[scope.columnsObj.colorKey][scope.scope[scope.prop]]
}" }"></span>
></span>
{{ {{
baseData[scope.columnsObj.enumKey][scope.scope[scope.prop]] || "-" baseData[scope.columnsObj.enumKey][scope.scope[scope.prop]] || "-"
}} }}
...@@ -98,8 +89,7 @@ ...@@ -98,8 +89,7 @@
id: scope.scope.id id: scope.scope.id
}) })
" "
data-event-code="usedcar_payment_detail" data-event-code="usedcar_payment_detail">
>
<auth-button :data="scope.scope" :show-btn-ids="['9051403']" /> <auth-button :data="scope.scope" :show-btn-ids="['9051403']" />
</span> </span>
<!-- 回单 --> <!-- 回单 -->
...@@ -112,8 +102,7 @@ ...@@ -112,8 +102,7 @@
<detailDialog <detailDialog
:visible="detailDialogVisible" :visible="detailDialogVisible"
:params-obj="detailDialogParams" :params-obj="detailDialogParams"
@dialogClose="closeDetailDialog" @dialogClose="closeDetailDialog" />
/>
</d2-container> </d2-container>
</template> </template>
...@@ -135,7 +124,9 @@ import { ...@@ -135,7 +124,9 @@ import {
RECEIPT_STATUS_OPTIONS, RECEIPT_STATUS_OPTIONS,
NB_TRANSFER_STATUS_OPTIONS, NB_TRANSFER_STATUS_OPTIONS,
PAY_MENTMETHOD_OPTIONS, PAY_MENTMETHOD_OPTIONS,
PAY_MENTMETHOD_MAP PAY_MENTMETHOD_MAP,
wechatType_OPTIONS,
wechatType_MAP
} from "./contant" } from "./contant"
import detailDialog from "./components/detailDialog.vue" import detailDialog from "./components/detailDialog.vue"
import { todayEndPickerOptions } from "@/common/format" import { todayEndPickerOptions } from "@/common/format"
...@@ -179,7 +170,8 @@ export default { ...@@ -179,7 +170,8 @@ export default {
amtList: [], amtList: [],
dateType: "payment", dateType: "payment",
dateValue: "", dateValue: "",
paymentMethod: "全部" paymentMethod: "全部",
wechatType: ""
}, },
showFormData: [ showFormData: [
{ {
...@@ -298,6 +290,16 @@ export default { ...@@ -298,6 +290,16 @@ export default {
optionId: "label", optionId: "label",
optionLabel: "label", optionLabel: "label",
optionsName: "PAY_MENTMETHOD_OPTIONS" optionsName: "PAY_MENTMETHOD_OPTIONS"
},
{
label: "内部主体",
name: "wechatType",
type: "select",
isClear: true,
optionList: [],
optionId: "value",
optionLabel: "label",
optionsName: "wechatType_OPTIONS"
} }
], ],
// 基本数据 // 基本数据
...@@ -311,7 +313,9 @@ export default { ...@@ -311,7 +313,9 @@ export default {
pushStatus: deepClone(PUSH_STATUS), pushStatus: deepClone(PUSH_STATUS),
nbTransferStatus: deepClone(NB_TRANSFER_STATUS), nbTransferStatus: deepClone(NB_TRANSFER_STATUS),
PAY_MENTMETHOD_OPTIONS: deepClone(PAY_MENTMETHOD_OPTIONS), PAY_MENTMETHOD_OPTIONS: deepClone(PAY_MENTMETHOD_OPTIONS),
PAY_MENTMETHOD_MAP: deepClone(PAY_MENTMETHOD_MAP) PAY_MENTMETHOD_MAP: deepClone(PAY_MENTMETHOD_MAP),
wechatType_OPTIONS: deepClone(wechatType_OPTIONS),
wechatType_MAP: deepClone(wechatType_MAP)
}, },
getListApi: getUsedCarPaymentList, getListApi: getUsedCarPaymentList,
searchFormSearch: {}, searchFormSearch: {},
...@@ -422,6 +426,14 @@ export default { ...@@ -422,6 +426,14 @@ export default {
label: "付款方式", label: "付款方式",
prop: "paymentMethod", prop: "paymentMethod",
minWidth: 120 minWidth: 120
},
{
label: "内部主体",
prop: "wechatType",
minWidth: 120,
formatter: (cellValue) => {
return this.baseData.wechatType_MAP[cellValue.wechatType] || "-"
}
} }
] ]
}, },
......
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
class="show-search" class="show-search"
:search-form="searchForm" :search-form="searchForm"
:label-width="'120px'" :label-width="'120px'"
:form-data="showFormData" :form-data="showFormData">
>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch"> <el-button size="small" type="primary" @click="handleSearch">
...@@ -22,24 +21,21 @@ ...@@ -22,24 +21,21 @@
<auth-button <auth-button
category="Button" category="Button"
:show-btn-ids="['9200203']" :show-btn-ids="['9200203']"
data-event-code="evaluation_management_list_export" data-event-code="evaluation_management_list_export" />
/>
</d2-table-header> </d2-table-header>
<d2-table <d2-table
ref="table" ref="table"
:get-list-api="getListApi" :get-list-api="getListApi"
:search-form="searchFormSearch" :search-form="searchFormSearch"
:table-params="tableParams" :table-params="tableParams"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn">
>
<div slot="coverImage" slot-scope="scope" class="coverImage-preview"> <div slot="coverImage" slot-scope="scope" class="coverImage-preview">
<glsx-preview <glsx-preview
:image-url-arr=" :image-url-arr="
scope.scope.coverImage ? [scope.scope.coverImage] : [noDataUrl] scope.scope.coverImage ? [scope.scope.coverImage] : [noDataUrl]
" "
:pic-options="picOptions" :pic-options="picOptions"
limit="1" limit="1"></glsx-preview>
></glsx-preview>
</div> </div>
<!-- 评估单状态 --> <!-- 评估单状态 -->
<div slot="statusHtml" slot-scope="scope"> <div slot="statusHtml" slot-scope="scope">
...@@ -48,8 +44,7 @@ ...@@ -48,8 +44,7 @@
class="dot" class="dot"
:style="{ :style="{
background: baseData.evaluationStatusOptMap[scope.scope.status] background: baseData.evaluationStatusOptMap[scope.scope.status]
}" }"></span>
></span>
{{ {{
baseData.evaluationStatusOpt.find( baseData.evaluationStatusOpt.find(
(item) => item.confId == scope.scope.status (item) => item.confId == scope.scope.status
...@@ -72,8 +67,7 @@ ...@@ -72,8 +67,7 @@
id: scope.scope.id id: scope.scope.id
}) })
" "
data-event-code="evaluation_management_image_download" data-event-code="evaluation_management_image_download">
>
<auth-button :data="scope.scope" :show-btn-ids="['9200206']" /> <auth-button :data="scope.scope" :show-btn-ids="['9200206']" />
</span> </span>
</div> </div>
...@@ -94,7 +88,8 @@ import { ...@@ -94,7 +88,8 @@ import {
hasAccidentOpt, hasAccidentOpt,
evaluationStatusOpt, evaluationStatusOpt,
evaluationStatusOptMap, evaluationStatusOptMap,
evaluationSourceOpt evaluationSourceOpt,
contractOrgOpt
} from "@/common/constants.js" } from "@/common/constants.js"
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin" import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
...@@ -286,6 +281,20 @@ export default { ...@@ -286,6 +281,20 @@ export default {
) )
return statusItem ? statusItem.confValue : "-" return statusItem ? statusItem.confValue : "-"
} }
},
{
label: "内部主体",
prop: "contractOrg",
minWidth: 120,
formatter: (cellValue) => {
const statusItem = this.getStatusItem(
this.baseData,
"contractOrgOpt",
cellValue,
"contractOrg"
)
return statusItem ? statusItem.confValue : "-"
}
} }
] ]
}, },
...@@ -309,7 +318,8 @@ export default { ...@@ -309,7 +318,8 @@ export default {
evalOrderTime: [], evalOrderTime: [],
evalOrderNo: "", evalOrderNo: "",
evalOperatorName: "", evalOperatorName: "",
source: "" source: "",
contractOrg: ""
}, },
showFormData: [ showFormData: [
{ {
...@@ -474,6 +484,16 @@ export default { ...@@ -474,6 +484,16 @@ export default {
optionId: "confId", optionId: "confId",
optionLabel: "confValue", optionLabel: "confValue",
optionsName: "evaluationSourceOpt" optionsName: "evaluationSourceOpt"
},
{
label: "内部主体",
name: "contractOrg",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "contractOrgOpt"
} }
], ],
baseData: { baseData: {
...@@ -484,7 +504,8 @@ export default { ...@@ -484,7 +504,8 @@ export default {
hasAccidentOpt: deepClone(hasAccidentOpt), hasAccidentOpt: deepClone(hasAccidentOpt),
evaluationStatusOpt: deepClone(evaluationStatusOpt), evaluationStatusOpt: deepClone(evaluationStatusOpt),
evaluationStatusOptMap: deepClone(evaluationStatusOptMap), evaluationStatusOptMap: deepClone(evaluationStatusOptMap),
evaluationSourceOpt: deepClone(evaluationSourceOpt) evaluationSourceOpt: deepClone(evaluationSourceOpt),
contractOrgOpt: deepClone(contractOrgOpt)
}, },
track_event_code: "evaluation_management" track_event_code: "evaluation_management"
} }
......
...@@ -7,9 +7,36 @@ ...@@ -7,9 +7,36 @@
<div class="item" v-for="(item, index) in configData" :key="index"> <div class="item" v-for="(item, index) in configData" :key="index">
<div class="flex top_box"> <div class="flex top_box">
<div class="title" v-if="item.title">{{ item.title }}</div> <div class="title" v-if="item.title">{{ item.title }}</div>
<el-button class="top-btn" type="primary" size="small" v-if="item.infoData &&detailInfo.paymentType ==1 && activeStep == 0" @click="approve(1)"> 发起定金审批 </el-button> <el-button
<el-button class="top-btn" type="primary" size="small" v-if="item.infoData &&detailInfo.paymentType ==1 && activeStep == 2" @click="approve(2)"> 发起尾款审批 </el-button> class="top-btn"
<el-button class="top-btn" type="primary" size="small" v-if="item.infoData &&detailInfo.paymentType ==2 && activeStep == 2 " @click="approve(2)"> 发起全款审批 </el-button> type="primary"
size="small"
v-preventReClick
:loading="approveLoading.deposit"
v-if="item.infoData && detailInfo.paymentType == 1 && activeStep == 0"
@click="approve(1)">
发起定金审批
</el-button>
<el-button
class="top-btn"
type="primary"
size="small"
v-preventReClick
:loading="approveLoading.final"
v-if="item.infoData && detailInfo.paymentType == 1 && activeStep == 2"
@click="approve(2)">
发起尾款审批
</el-button>
<el-button
class="top-btn"
type="primary"
size="small"
v-preventReClick
:loading="approveLoading.final"
v-if="item.infoData && detailInfo.paymentType == 2 && activeStep == 2"
@click="approve(2)">
发起全款审批
</el-button>
</div> </div>
<div class="detail-content"> <div class="detail-content">
...@@ -377,6 +404,10 @@ export default { ...@@ -377,6 +404,10 @@ export default {
videoStr: "?x-oss-process=video/snapshot,t_7000,f_jpg,w_800,h_600,m_fast", videoStr: "?x-oss-process=video/snapshot,t_7000,f_jpg,w_800,h_600,m_fast",
btnLoding: false, btnLoding: false,
loading: false, loading: false,
approveLoading: {
deposit: false, // 定金审批loading
final: false // 尾款/全款审批loading
},
id: this.$route.query.id, id: this.$route.query.id,
rules: { rules: {
description: [ description: [
...@@ -1041,13 +1072,36 @@ export default { ...@@ -1041,13 +1072,36 @@ export default {
if (res.data.code == 0 && res.data.data == 2) { if (res.data.code == 0 && res.data.data == 2) {
const params = { contractNo: this.detailInfo.contractNo, evalOrderNo: this.detailInfo.evalOrderNo } const params = { contractNo: this.detailInfo.contractNo, evalOrderNo: this.detailInfo.evalOrderNo }
if (type == 1) { if (type == 1) {
await webPayDepositApplication(params) this.approveLoading.deposit = true
this.handleCancel() try {
this.$message.success("操作成功") const res1 = await webPayDepositApplication(params)
console.log(res1, '78787')
if (res1.data.code == 0) {
this.handleCancel()
this.$message.success("操作成功")
} else {
this.$message.error(res1.data.msg)
}
} catch (error) {
this.$message.error("操作失败")
} finally {
this.approveLoading.deposit = false
}
} else if (type == 2) { } else if (type == 2) {
await webPayFinalApplication(params) this.approveLoading.final = true
this.handleCancel() try {
this.$message.success("操作成功") const res2 = await webPayFinalApplication(params)
if (res2.data.code == 0) {
this.handleCancel()
this.$message.success("操作成功")
} else {
this.$message.error(res2.data.msg)
}
} catch (error) {
this.$message.error("操作失败")
} finally {
this.approveLoading.final = false
}
} }
} else { } else {
this.$message.error('暂时无法审批') this.$message.error('暂时无法审批')
......
  • @limin
    commented
    Owner

    你好,我是负责此次代码审查的软件开发工程师。

    你提交的代码主要涉及二手车管理和财务管理模块的功能增强(新增内部主体筛选)以及合同审批逻辑的优化。代码整体结构清晰,但在 API 接口的兼容性设计、调试代码残留以及异常处理机制上存在需要改进的地方。

    以下是我的审查结果与建议:

    一、关键问题与优化建议(Top 3)

    1. 公共 API 接口变更引发的潜在回归风险(High)

    • 问题描述:在 src/api/usedCarManagement.js 中,你修改了 webPayDepositApplication 和 webPayFinalApplication 方法,增加了 { returnAll: true } 配置。
    • 影响分析:通常 returnAll: true 会改变底层请求库(如 axios 封装)的返回值结构(例如从返回 data.data 变为返回完整的 response 对象)。如果项目中其他页面或组件也引用了这两个 API,且未同步修改调用逻辑,会导致这些原有功能因无法获取预期的数据结构而报错(如 undefined 异常)。
    • 优化建议:
      • 方案 A(推荐):如果其他地方也使用了该 API,请检查并适配所有调用点。
      • 方案 B:如果仅当前业务场景需要完整响应对象,建议新建一个专用 API 方法(如 webPayDepositApplicationWithFullResponse),保持原有 API 契约不变,遵循开闭原则。

    2. 生产环境残留调试代码(Medium)

    • 问题描述:在 src/views/usedCarManagement/operateManagement/components/contract/edit.vue 第 1078 行发现 console.log(res1, '78787')。
    • 影响分析:这是典型的调试代码残留,不仅污染浏览器控制台输出,显得不专业,还可能在某些情况下意外泄露接口返回的敏感数据结构。
    • 优化建议:务必在提交前删除所有 console.log 调试语句。建议在 CI/CD 流水线或本地 ESLint 中配置 no-console 规则进行自动拦截。

    3. 异常处理逻辑掩盖了真实错误信息(Medium)

    • 问题描述:在 edit.vue 的审批逻辑中,catch (error) 捕获异常后,直接弹窗提示硬编码的 "操作失败"。 javascript } catch (error) { this.$message.error("操作失败") // 丢失了原始错误信息 }
    • 影响分析:当发生网络超时、服务器 500 或业务校验不通过(如果拦截器抛出错误)时,用户和开发人员只能看到“操作失败”,无法得知具体原因,极大增加了排查问题的难度。
    • 优化建议:优先展示服务端返回的错误信息,或保留错误堆栈。 javascript } catch (error) { // 优先使用接口返回的 msg,其次使用 error.message,最后兜底 const errorMsg = error.msg || error.message || "操作失败"; this.$message.error(errorMsg); console.error("审批异常:", error); // 仅在开发环境或日志监控中记录 }

    二、评分明细

    1. 功能实现的正确性与健壮性(32/40)

      • 扣分点:API 的修改破坏了原有契约,存在回归风险;异常处理过于粗暴,掩盖了错误细节。
      • 优点:增加了 loading 状态防止重复点击,使用了 v-preventReClick,交互逻辑有所增强。
    2. 安全性与潜在风险(28/30)

      • 扣分点:残留的 console.log 存在微小的敏感信息泄露风险。
      • 优点:未发现明显的 XSS 或 SQL 注入风险。
    3. 最佳实践与可维护性(14/20)

      • 扣分点:
        • 包含大量仅涉及换行和空格的格式化变更(如 > 换行),干扰了 Code Review 的视线,建议提交前统一 Prettier 配置。
        • 硬编码字符串(如 "惠州广联")分散在多个文件中,虽然提取了常量,但在某些 formatter 中仍有硬编码迹象。
      • 优点:常量提取(contractOrgOpt 等)做得较好,代码复用意识尚可。
    4. 性能与资源利用(5/5)

      • 优点:无明显的性能瓶颈,资源释放正常。
    5. 提交信息质量(5/5)

      • 优点:Commit message 格式规范(feat/fix),描述清晰,能够准确反映变更内容。

    三、总分

    总分:84分

Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!