Commit a612c0b5 by Jaxon

Merge remote-tracking branch 'origin/SAAS+V5.6.1' into SAAS+V5.6.1

2 parents 1ac60e7f d98fc3c6
......@@ -258,7 +258,8 @@ export const uploadCustodyAgreement = (data = {}) => {
*/
export const webPayDepositApplication = (data = {}) => {
return gscPost("/evalElectronicContract/webPayDepositApplication", data, {
timeout: 30000
timeout: 30000,
returnAll: true
})
}
/**
......@@ -266,7 +267,8 @@ export const webPayDepositApplication = (data = {}) => {
*/
export const webPayFinalApplication = (data = {}) => {
return gscPost("/evalElectronicContract/webPayFinalApplication", data, {
timeout: 30000
timeout: 30000,
returnAll: true
})
}
/**
......
......@@ -1844,6 +1844,7 @@ export const signerTypeOpt = [
{ confId: 1, confValue: "企业委托" },
{ confId: 2, confValue: "企业" }
]
<<<<<<< HEAD
export const reviewStatusOpts = [
{
confId: 0,
......@@ -1934,5 +1935,18 @@ export const goodsAuditStatusList = [
{
confId: '4',
confLabel: '审批驳回'
}
}]
// 企微主体
// 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) => {
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 = {
RECEIPT_STATUS,
PUSH_STATUS,
......@@ -70,5 +83,7 @@ module.exports = {
RECEIPT_STATUS_OPTIONS,
NB_TRANSFER_STATUS_OPTIONS,
PAY_MENTMETHOD_OPTIONS,
PAY_MENTMETHOD_MAP
PAY_MENTMETHOD_MAP,
wechatType_OPTIONS,
wechatType_MAP
}
......@@ -7,16 +7,14 @@
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
label-width="130px"
>
label-width="130px">
<template #inputRangeHtml>
<input-range
start-placeholder="最小金额"
end-placeholder="最大金额"
:display-value="searchForm.amtList"
max-length="15"
input-max-length="15"
></input-range>
input-max-length="15"></input-range>
</template>
<template #selectDatePickerHtml>
<div class="select-date-picker">
......@@ -24,14 +22,12 @@
v-model="searchForm.dateType"
placeholder="请选择"
@change="searchForm.dateValue = ''"
class="select"
>
class="select">
<el-option
v-for="(subItem, subIndex) in selectOption"
:key="subIndex"
:label="subItem.label"
:value="subItem.value"
/>
:value="subItem.value" />
</el-select>
<el-date-picker
class="date-picker"
......@@ -42,8 +38,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="rangePickerOptions"
:default-time="['00:00:00', '23:59:59']"
/>
:default-time="['00:00:00', '23:59:59']" />
</div>
</template>
</d2-search>
......@@ -58,13 +53,11 @@
<d2-table-header>
<span
data-event-code="usedcar_payment_push_list"
style="margin-right: 10px"
>
style="margin-right: 10px">
<auth-button
category="Button"
:show-btn-ids="['9051401']"
:loading="pushPayBillLoading"
/>
:loading="pushPayBillLoading" />
</span>
<span data-event-code="usedcar_payment_management_list_export">
<auth-button category="Button" :show-btn-ids="['9051402']" />
......@@ -75,16 +68,14 @@
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
>
:before-search-fn="beforeSearchFn">
<div slot="statusHtml" slot-scope="scope">
<span
class="circle"
:style="{
background:
baseData[scope.columnsObj.colorKey][scope.scope[scope.prop]]
}"
></span>
}"></span>
{{
baseData[scope.columnsObj.enumKey][scope.scope[scope.prop]] || "-"
}}
......@@ -98,8 +89,7 @@
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']" />
</span>
<!-- 回单 -->
......@@ -112,8 +102,7 @@
<detailDialog
:visible="detailDialogVisible"
:params-obj="detailDialogParams"
@dialogClose="closeDetailDialog"
/>
@dialogClose="closeDetailDialog" />
</d2-container>
</template>
......@@ -135,7 +124,9 @@ import {
RECEIPT_STATUS_OPTIONS,
NB_TRANSFER_STATUS_OPTIONS,
PAY_MENTMETHOD_OPTIONS,
PAY_MENTMETHOD_MAP
PAY_MENTMETHOD_MAP,
wechatType_OPTIONS,
wechatType_MAP
} from "./contant"
import detailDialog from "./components/detailDialog.vue"
import { todayEndPickerOptions } from "@/common/format"
......@@ -179,7 +170,8 @@ export default {
amtList: [],
dateType: "payment",
dateValue: "",
paymentMethod: "全部"
paymentMethod: "全部",
wechatType: ""
},
showFormData: [
{
......@@ -298,6 +290,16 @@ export default {
optionId: "label",
optionLabel: "label",
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 {
pushStatus: deepClone(PUSH_STATUS),
nbTransferStatus: deepClone(NB_TRANSFER_STATUS),
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,
searchFormSearch: {},
......@@ -422,6 +426,14 @@ export default {
label: "付款方式",
prop: "paymentMethod",
minWidth: 120
},
{
label: "内部主体",
prop: "wechatType",
minWidth: 120,
formatter: (cellValue) => {
return this.baseData.wechatType_MAP[cellValue.wechatType] || "-"
}
}
]
},
......
......@@ -90,6 +90,25 @@ export default {
handleAppendTableRow() {
const templateType = this.curParamsConfig.templateType;
// 检查现有数据,确保没有初始值或结束值为空的行
const existingRows = this.curParamsConfig[templateType] || [];
for (let i = 0; i < existingRows.length; i++) {
const row = existingRows[i];
const priceRange = row?.priceRange || [];
const startValue = priceRange[0];
const endValue = priceRange[1];
// 检查初始值或结束值是否为空(undefined、null、空字符串)
if (startValue === undefined || startValue === null || startValue === "") {
this.$message.warning("存在初始值为空的行,请先完善数据后再新增");
return;
}
if (endValue === undefined || endValue === null || endValue === "") {
this.$message.warning("存在结束值为空的行,请先完善数据后再新增");
return;
}
}
const lastPriceRange = last(this.curParamsConfig[templateType])?.priceRange || [0, 0];
const nPriceRange = [undefined, undefined];
if (lastPriceRange && lastPriceRange[1]) {
......
<template>
<template>
<div class="params-config-table">
<el-table border
class="params-config-table"
......@@ -15,7 +15,8 @@
:controls="false"
:disabled="$index === 0"
type="number"
v-bind="curParamsConfig.priceRangeProps">
v-bind="curParamsConfig.priceRangeProps"
@change="handlePriceRangeChange($index, 0)">
</EditableText>
<div class="tag">
-
......@@ -23,7 +24,8 @@
<EditableText v-model="curParamsConfig.ParamsType1[$index].priceRange[1]"
:controls="false"
type="number"
v-bind="curParamsConfig.priceRangeProps">
v-bind="curParamsConfig.priceRangeProps"
@change="handlePriceRangeChange($index, 1)">
</EditableText>
</div>
</template>
......@@ -134,6 +136,8 @@ export default {
data() {
return {
commissionTypeEnum,
// 记录已提示过的行索引,确保每行只提示一次
validatedRows: new Set(),
};
},
computed: {
......@@ -197,6 +201,31 @@ export default {
},
methods: {
// 验证价格范围:结束值必须大于起始值
handlePriceRangeChange(rowIndex, rangeIndex) {
console.log("asda");
const priceRange = this.curParamsConfig.ParamsType1[rowIndex].priceRange;
const startValue = Number(priceRange[0]);
const endValue = Number(priceRange[1]);
// 检查值是否有效
if (isNaN(startValue) || isNaN(endValue) || startValue === null || endValue === null || startValue === undefined || endValue === undefined) {
return;
}
// 验证结束值必须大于起始值
if (endValue <= startValue) {
// 确保每行只提示一次
if (!this.validatedRows.has(rowIndex)) {
this.validatedRows.add(rowIndex);
this.$message.warning("结束值必须大于起始值,且不可等于起始值");
}
} else {
// 如果验证通过,从 Set 中移除该行索引,允许下次再次提示
this.validatedRows.delete(rowIndex);
}
},
handleProductChange(value) {
console.log("product change", value);
},
......
......@@ -7,8 +7,7 @@
class="show-search"
:search-form="searchForm"
:label-width="'120px'"
:form-data="showFormData"
>
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
......@@ -22,24 +21,21 @@
<auth-button
category="Button"
:show-btn-ids="['9200203']"
data-event-code="evaluation_management_list_export"
/>
data-event-code="evaluation_management_list_export" />
</d2-table-header>
<d2-table
ref="table"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
:before-search-fn="beforeSearchFn">
<div slot="coverImage" slot-scope="scope" class="coverImage-preview">
<glsx-preview
:image-url-arr="
scope.scope.coverImage ? [scope.scope.coverImage] : [noDataUrl]
"
:pic-options="picOptions"
limit="1"
></glsx-preview>
limit="1"></glsx-preview>
</div>
<!-- 评估单状态 -->
<div slot="statusHtml" slot-scope="scope">
......@@ -48,8 +44,7 @@
class="dot"
:style="{
background: baseData.evaluationStatusOptMap[scope.scope.status]
}"
></span>
}"></span>
{{
baseData.evaluationStatusOpt.find(
(item) => item.confId == scope.scope.status
......@@ -72,8 +67,7 @@
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']" />
</span>
</div>
......@@ -94,7 +88,8 @@ import {
hasAccidentOpt,
evaluationStatusOpt,
evaluationStatusOptMap,
evaluationSourceOpt
evaluationSourceOpt,
contractOrgOpt
} from "@/common/constants.js"
import { Util, deepClone } from "@/common/util"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
......@@ -286,6 +281,20 @@ export default {
)
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 {
evalOrderTime: [],
evalOrderNo: "",
evalOperatorName: "",
source: ""
source: "",
contractOrg: ""
},
showFormData: [
{
......@@ -474,6 +484,16 @@ export default {
optionId: "confId",
optionLabel: "confValue",
optionsName: "evaluationSourceOpt"
},
{
label: "内部主体",
name: "contractOrg",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "contractOrgOpt"
}
],
baseData: {
......@@ -484,7 +504,8 @@ export default {
hasAccidentOpt: deepClone(hasAccidentOpt),
evaluationStatusOpt: deepClone(evaluationStatusOpt),
evaluationStatusOptMap: deepClone(evaluationStatusOptMap),
evaluationSourceOpt: deepClone(evaluationSourceOpt)
evaluationSourceOpt: deepClone(evaluationSourceOpt),
contractOrgOpt: deepClone(contractOrgOpt)
},
track_event_code: "evaluation_management"
}
......
......@@ -7,9 +7,36 @@
<div class="item" v-for="(item, index) in configData" :key="index">
<div class="flex top_box">
<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 class="top-btn" type="primary" size="small" v-if="item.infoData &&detailInfo.paymentType ==1 && activeStep == 2" @click="approve(2)"> 发起尾款审批 </el-button>
<el-button class="top-btn" type="primary" size="small" v-if="item.infoData &&detailInfo.paymentType ==2 && activeStep == 2 " @click="approve(2)"> 发起全款审批 </el-button>
<el-button
class="top-btn"
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 class="detail-content">
......@@ -377,6 +404,10 @@ export default {
videoStr: "?x-oss-process=video/snapshot,t_7000,f_jpg,w_800,h_600,m_fast",
btnLoding: false,
loading: false,
approveLoading: {
deposit: false, // 定金审批loading
final: false // 尾款/全款审批loading
},
id: this.$route.query.id,
rules: {
description: [
......@@ -1041,13 +1072,36 @@ export default {
if (res.data.code == 0 && res.data.data == 2) {
const params = { contractNo: this.detailInfo.contractNo, evalOrderNo: this.detailInfo.evalOrderNo }
if (type == 1) {
await webPayDepositApplication(params)
this.handleCancel()
this.$message.success("操作成功")
this.approveLoading.deposit = true
try {
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) {
await webPayFinalApplication(params)
this.handleCancel()
this.$message.success("操作成功")
this.approveLoading.final = true
try {
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 {
this.$message.error('暂时无法审批')
......
  • @limin
    commented
    Owner

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

    你提交的 src/main.js 变更涉及核心启动逻辑、配置加载及代码格式化。虽然代码风格得到了统一,但在异常处理逻辑和初始化流程上存在明显的风险,可能导致应用在特定网络环境下无法启动或功能缺失。

    以下是本次审查的核心问题与优化建议:

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

    1. 严重的 Promise 链异常处理逻辑缺陷(功能正确性)

    • 问题描述:在 fetch 的第一个 .then 中,你定义了第二个参数 (error) => { console.log(error); } 来捕获网络错误。当网络请求失败时,该函数执行并隐式返回 undefined。Promise 链会继续执行下一个 .then((response) => ...),此时 response 为 undefined,导致 const { code, data } = response 抛出 TypeError,中断后续逻辑。
    • 影响分析:一旦配置接口请求失败(如网络抖动),页面将直接白屏报错,而不是进入 finally 或执行容错逻辑。
    • 优化建议:应在 catch 中处理错误,或在 reject 处理函数中抛出错误以便中断链条。 ```javascript // ❌由于 swallow 了错误,导致后续 crash // .then(res => res.json(), err => console.log(err))

    // ✅ 建议修改为: fetch(url) .then(response => response.json()) .catch(error => { console.error("Config Load Error:", error); // 返回默认配置或 null,确保后续逻辑能判断 return null; }) .then(response => { if (!response) return; // 阻断后续解构 const { code, data } = response; // ... })

    
    **2. 初始化逻辑分支不一致,存在功能缺失风险(功能正确性)**
    - **问题描述**:在配置加载的逻辑中,`if (code == "200")` 分支仅设置了 `baseConfig`,而 `else` 分支不仅设置了 `baseConfig`,还初始化了 `window.$gscApi` 并绑定了登出逻辑。
    - **影响分析**:如果后端正常返回 200(预期成功场景),`window.$gscApi` 将**不会被初始化**。如果应用后续依赖此全局对象发起请求,会导致功能完全不可用。这是一个极高风险的逻辑回归。
    - **优化建议**:请确认 `$gscApi` 的初始化是否应该提取到 `if/else` 之外,或者 200 分支确实不需要它。同时,移除遗留的调试代码 `console.log(window.$gscApi, "========")`。
    
    **3. 代码提交包含大量格式化噪音(最佳实践)**
    - **问题描述**:本次提交将核心逻辑变更(URL 修改、初始化逻辑)与全文件的代码格式化(分号移除、缩进调整)混合在一起。
    - **影响分析**:这导致 Diff 极其混乱,极难识别真正的业务逻辑变更,掩盖了上述两个严重逻辑缺陷,且破坏了 Git Blame 的可追溯性。
    - **优化建议**:
        1.  **必须拆分提交**:一个 Commit 仅做代码格式化(Refactor),另一个 Commit 仅做业务逻辑修改(Feat/Fix)。
        2.  清理代码中的 `console.log` 调试语句(如 `console.log("response", code, response)`)。
    
    ---
    
    #### 二、评分明细
    
    1.  **功能实现的正确性与健壮性(15/40分)**
        *   **扣分理由**:存在导致应用崩溃的 Promise 错误处理逻辑;成功分支下缺少全局对象 `$gscApi` 的初始化,逻辑存在严重漏洞。
    
    2.  **安全性与潜在风险(28/30分)**
        *   **扣分理由**:配置中心 URL 和 Sentry DSN 硬编码在前端代码中(属常规操作但非最优解),无明显 XSS/注入风险。
    
    3.  **最佳实践与可维护性(10/20分)**
        *   **扣分理由**:格式化变更与逻辑变更混合,严重影响 Code Review 效率;生产环境代码中残留了多处 `console.log`。
    
    4.  **性能与资源利用(5/5分)**
        *   **理由**:资源加载逻辑正常,无明显性能瓶颈。
    
    5.  **提交信息质量(4/5分)**
        *   **理由**:Commit 信息清晰描述了重构和 URL 更新,但未能反映出将两类不同性质的变更混合提交的坏处。
    
    ---
    
    #### 三、总分
    总分:62分
    
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!