CRM_26-08-13#story#9187,服务商新增车辆规则调整

This commit is contained in:
zlf
2026-08-12 13:41:26 +08:00
parent a6be6d36e0
commit e04be176fa
2 changed files with 89 additions and 17 deletions
+81 -17
View File
@@ -131,23 +131,29 @@
<img class="startImg" src="@/assets/start.png" />
<span>车辆属性</span>
</div>
<el-select
v-model="virtualVehicle"
value-key="name"
class="elSelect"
collapse-tags="collapse-tags"
:disabled="vehicleInfoDisabled"
placeholder="请选择" style="width: 55%"
>
<el-option
v-for="item in virtualVehicleOptions"
:key="item.name"
:label="item.name"
:value="item.value"
<div class="virtualVehicleField">
<el-select
v-model="virtualVehicle"
value-key="name"
class="elSelect"
collapse-tags="collapse-tags"
:disabled="vehicleInfoDisabled || virtualVehicleLocked"
placeholder="请选择" style="width: 55%"
>
</el-option>
</el-select>
<el-option
v-for="item in virtualVehicleOptions"
:key="item.name"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
<span class="matchRoleArrow" :class="{expanded: matchRoleExpand}"
@click="matchRoleExpand = !matchRoleExpand"></span>
</div>
</div>
<div v-if="matchRoleExpand" class="matchRolePanel">
匹配角色{{ virtualVehicleMatchRole || '' }}
</div>
<div class="lineBot"></div>
<div class="itemContent">
@@ -463,7 +469,7 @@
import {formatDate1} from "@/utils/common"
import {myMixins} from "@/utils/myMixins"
import {vehicleTypeList,saveVehicle,getInfoById,supplierServiceTree, uploadImage, ocrHandler,
userOperationPermissions,saveSupplierApproval} from "@/api/mine"
userOperationPermissions,saveSupplierApproval,preJudgeVirtualVehicle as preJudgeVirtualVehicleApi} from "@/api/mine"
import TwoCommonBtn from "@/components/twoBtnCommon.vue"
import CellGroup from "@/components/cellGroup.vue";
export default {
@@ -515,6 +521,9 @@ export default {
vehicleLicenseInfo: {},
vehicleLicenseBackOcrFlag: false, // 行驶证副页 修改时默认不需要 ocr识别
isMultiple: false, // 是否支持多选
virtualVehicleLocked: false, // 车辆属性锁定(OCR所有人命中服务商信息时锁定为自有车辆)
virtualVehicleMatchRole: '', // 车辆属性自动判定命中的匹配角色
matchRoleExpand: false, // 匹配角色面板展开状态
vehicleLicense:'',//牌照
vehicleFrontLicensePlate:'',//车头照车牌号码
insuranceCorp: '',
@@ -1221,6 +1230,8 @@ export default {
this.vehicleLicenseInfo.licensePlateNumber = frontInfo?.plateNo;
this.vehicleLicenseInfo.vehicleType = frontInfo?.vehicleType;
this.vehicleLicenseInfo.owner = frontInfo?.owner;
// 行驶证所有人识别成功后,预判车辆属性(命中服务商信息则锁定为自有车辆)
this.preJudgeVirtualVehicle();
this.vehicleLicenseInfo.address = frontInfo?.address;
this.vehicleLicenseInfo.useNature = frontInfo?.useCharacter;
this.vehicleLicenseInfo.model = frontInfo?.model;
@@ -1245,6 +1256,28 @@ export default {
}
return true
},
// 车辆属性预判:行驶证所有人与车辆归属服务商的名称/法人/关联人员比对,命中自有则锁定选择器
async preJudgeVirtualVehicle() {
this.virtualVehicleLocked = false;
this.virtualVehicleMatchRole = '';
const owner = (this.vehicleLicenseInfo.owner || '').trim();
if (!owner) {
return;
}
try {
const res = await preJudgeVirtualVehicleApi({
owner,
supplierId: this.supplierId || undefined // 车辆归属服务商ID,自录场景为空由后端取当前用户服务商
});
if (res?.data?.locked) {
this.virtualVehicleLocked = true;
this.virtualVehicleMatchRole = res.data.matchRole || '';
this.virtualVehicle = 1;
}
} catch (e) {
// 预判失败不影响保存,选择器保持可编辑
}
},
async vehicleBackOcrHandler() { // 行驶证副页 ocr 识别
this.vehicleLicenseInfo.recordNumber = '';
this.vehicleLicenseInfo.passengerCapacity = '';
@@ -1323,6 +1356,9 @@ export default {
});
this.auditStatus = result.auditStatus;
this.virtualVehicle = result.virtualVehicle;
// 车辆属性溯源:编辑场景初始化匹配角色,已是自有车辆且命中角色时锁定选择器
this.virtualVehicleMatchRole = result.virtualVehicleMatchRole || '';
this.virtualVehicleLocked = !!(result.virtualVehicleMatchRole && result.virtualVehicle === 1);
this.$refs.tree.setCheckedKeys(result.serviceIds)
this.vehicleStatus = result.vehicleStatus
this.vehicleLicenseFront = result.vehicleLicenseFront;
@@ -1894,6 +1930,34 @@ export default {
pointer-events: none;
opacity: 0.6;
}
/* 车辆属性-匹配角色溯源 */
.virtualVehicleField {
display: flex;
align-items: center;
justify-content: flex-end;
.matchRoleArrow {
margin-left: 6px;
cursor: pointer;
color: #909399;
user-select: none;
display: inline-block;
transition: transform .2s;
&.expanded {
transform: rotate(180deg);
color: #354D93;
}
}
}
.matchRolePanel {
margin: 0 25px 6px 0;
padding: 4px 10px;
font-size: 12px;
color: #606266;
background: #f4f4f5;
border-radius: 4px;
line-height: 1.6;
text-align: right;
}
.pop_wrap {
width: 340px;
box-sizing: border-box;