Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e14bd71234 | ||
|
|
d23f7bea35 | ||
|
|
9d30a6b882 | ||
|
|
a1e9e4cecb | ||
|
|
7604c8c224 | ||
|
|
04befddf8a | ||
|
|
6bdb750fb7 | ||
|
|
2a1a219b2d | ||
|
|
89dfb7a954 | ||
|
|
945b60403a | ||
|
|
d92f28a03e | ||
|
|
e04be176fa | ||
|
|
a6be6d36e0 | ||
|
|
7df67ee75a | ||
|
|
137a1b943e |
@@ -18,6 +18,14 @@ export function saveVehicle(data){
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//车辆属性预判(行驶证OCR识别出车辆所有人后调用,命中服务商信息则锁定为自有车辆)
|
||||||
|
export function preJudgeVirtualVehicle(data){
|
||||||
|
return request({
|
||||||
|
url:'/supplierAppV2/dispatchApp/user/preJudgeVirtualVehicle',
|
||||||
|
method:'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
//提交审批车辆信息
|
//提交审批车辆信息
|
||||||
export function saveSupplierApproval(data){
|
export function saveSupplierApproval(data){
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
const kpiRouter = [
|
const kpiRouter = [
|
||||||
{
|
/* {
|
||||||
path: '/kpiIndex',
|
path: '/kpiIndex',
|
||||||
name: 'kpiIndex',
|
name: 'kpiIndex',
|
||||||
component: () => import('@/views/kpi/kpiIndex'),
|
component: () => import('@/views/kpi/kpiIndex'),
|
||||||
meta:{
|
meta:{
|
||||||
title: 'kpi首页',
|
title: 'kpi首页',
|
||||||
}
|
}
|
||||||
},
|
},*/
|
||||||
{
|
{
|
||||||
path: '/kpiCaseNew',
|
path: '/kpiCaseNew',
|
||||||
name: 'kpiCaseNew',
|
name: 'kpiCaseNew',
|
||||||
@@ -15,5 +15,13 @@ const kpiRouter = [
|
|||||||
title: 'kpi服务商案件&车辆情况',
|
title: 'kpi服务商案件&车辆情况',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/kpiIndex',
|
||||||
|
name: 'kpiAssess',
|
||||||
|
component: () => import('@/views/kpi/kpiAssess'),
|
||||||
|
meta:{
|
||||||
|
title: 'kpi首页',
|
||||||
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
export default kpiRouter
|
export default kpiRouter
|
||||||
|
|||||||
@@ -72,13 +72,13 @@
|
|||||||
async nextStep() {
|
async nextStep() {
|
||||||
if (!this.clickFlag) return;
|
if (!this.clickFlag) return;
|
||||||
if(!this.wechatId) {
|
if(!this.wechatId) {
|
||||||
let res = await getContactQrCodeResult({ configId: this.configId, name: this.name });
|
let res = await getContactQrCodeResult({ configId: this.configId, name: this.name, phone: this.formPayload.linkPhone });
|
||||||
this.wechatId = res?.data?.wechatId;
|
this.wechatId = res?.data?.wechatId;
|
||||||
}
|
}
|
||||||
if (!this.wechatId) {
|
/*if (!this.wechatId) {
|
||||||
Toast('请先添加企微再继续');
|
Toast('请先添加企微再继续');
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
try {
|
try {
|
||||||
this.clickFlag = false;
|
this.clickFlag = false;
|
||||||
const res = await saveSupplier({
|
const res = await saveSupplier({
|
||||||
|
|||||||
@@ -131,12 +131,13 @@
|
|||||||
<img class="startImg" src="@/assets/start.png" />
|
<img class="startImg" src="@/assets/start.png" />
|
||||||
<span>车辆属性</span>
|
<span>车辆属性</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="virtualVehicleField">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="virtualVehicle"
|
v-model="virtualVehicle"
|
||||||
value-key="name"
|
value-key="name"
|
||||||
class="elSelect"
|
class="elSelect"
|
||||||
collapse-tags="collapse-tags"
|
collapse-tags="collapse-tags"
|
||||||
:disabled="vehicleInfoDisabled"
|
:disabled="vehicleInfoDisabled || virtualVehicleLocked"
|
||||||
placeholder="请选择" style="width: 55%"
|
placeholder="请选择" style="width: 55%"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@@ -147,7 +148,12 @@
|
|||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<span class="matchRoleArrow" :class="{expanded: matchRoleExpand}"
|
||||||
|
@click="matchRoleExpand = !matchRoleExpand">▾</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="matchRoleExpand" class="matchRolePanel">
|
||||||
|
匹配角色:{{ virtualVehicleMatchRole || '—' }}
|
||||||
</div>
|
</div>
|
||||||
<div class="lineBot"></div>
|
<div class="lineBot"></div>
|
||||||
<div class="itemContent">
|
<div class="itemContent">
|
||||||
@@ -463,7 +469,7 @@
|
|||||||
import {formatDate1} from "@/utils/common"
|
import {formatDate1} from "@/utils/common"
|
||||||
import {myMixins} from "@/utils/myMixins"
|
import {myMixins} from "@/utils/myMixins"
|
||||||
import {vehicleTypeList,saveVehicle,getInfoById,supplierServiceTree, uploadImage, ocrHandler,
|
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 TwoCommonBtn from "@/components/twoBtnCommon.vue"
|
||||||
import CellGroup from "@/components/cellGroup.vue";
|
import CellGroup from "@/components/cellGroup.vue";
|
||||||
export default {
|
export default {
|
||||||
@@ -515,6 +521,9 @@ export default {
|
|||||||
vehicleLicenseInfo: {},
|
vehicleLicenseInfo: {},
|
||||||
vehicleLicenseBackOcrFlag: false, // 行驶证副页 修改时默认不需要 ocr识别
|
vehicleLicenseBackOcrFlag: false, // 行驶证副页 修改时默认不需要 ocr识别
|
||||||
isMultiple: false, // 是否支持多选
|
isMultiple: false, // 是否支持多选
|
||||||
|
virtualVehicleLocked: false, // 车辆属性锁定(OCR所有人命中服务商信息时锁定为自有车辆)
|
||||||
|
virtualVehicleMatchRole: '', // 车辆属性自动判定命中的匹配角色
|
||||||
|
matchRoleExpand: false, // 匹配角色面板展开状态
|
||||||
vehicleLicense:'',//牌照
|
vehicleLicense:'',//牌照
|
||||||
vehicleFrontLicensePlate:'',//车头照车牌号码
|
vehicleFrontLicensePlate:'',//车头照车牌号码
|
||||||
insuranceCorp: '',
|
insuranceCorp: '',
|
||||||
@@ -527,7 +536,9 @@ export default {
|
|||||||
name: '一般平板车',
|
name: '一般平板车',
|
||||||
value: 2
|
value: 2
|
||||||
},{
|
},{
|
||||||
name: '落地平板车',
|
name:'斜落一体平板车',
|
||||||
|
value: 11 },{
|
||||||
|
name: '全落地平板车',
|
||||||
value: 3
|
value: 3
|
||||||
},{
|
},{
|
||||||
name: '地库车',
|
name: '地库车',
|
||||||
@@ -560,8 +571,11 @@ export default {
|
|||||||
name: '黄牌',
|
name: '黄牌',
|
||||||
value: 2
|
value: 2
|
||||||
}, {
|
}, {
|
||||||
name: '新能源',
|
name: '绿牌',
|
||||||
value: 3
|
value: 3
|
||||||
|
}, {
|
||||||
|
name: '黄绿牌',
|
||||||
|
value: 6
|
||||||
}, {
|
}, {
|
||||||
name: '临牌',
|
name: '临牌',
|
||||||
value: 4
|
value: 4
|
||||||
@@ -674,6 +688,7 @@ export default {
|
|||||||
this.vehicleTypes[7].disabled=true
|
this.vehicleTypes[7].disabled=true
|
||||||
this.vehicleTypes[8].disabled=true
|
this.vehicleTypes[8].disabled=true
|
||||||
this.vehicleTypes[9].disabled=true
|
this.vehicleTypes[9].disabled=true
|
||||||
|
this.vehicleTypes[10].disabled=true
|
||||||
}else{
|
}else{
|
||||||
this.isMultiple = false
|
this.isMultiple = false
|
||||||
this.vehicleTypes[2].disabled=false
|
this.vehicleTypes[2].disabled=false
|
||||||
@@ -682,6 +697,7 @@ export default {
|
|||||||
this.vehicleTypes[7].disabled=false
|
this.vehicleTypes[7].disabled=false
|
||||||
this.vehicleTypes[8].disabled=false
|
this.vehicleTypes[8].disabled=false
|
||||||
this.vehicleTypes[9].disabled=false
|
this.vehicleTypes[9].disabled=false
|
||||||
|
this.vehicleTypes[10].disabled=false
|
||||||
}
|
}
|
||||||
if (newVal == 1 || newVal == 7 || newVal == 9){
|
if (newVal == 1 || newVal == 7 || newVal == 9){
|
||||||
let arr = []
|
let arr = []
|
||||||
@@ -750,8 +766,37 @@ export default {
|
|||||||
liabilityInsuranceEndTime:'',
|
liabilityInsuranceEndTime:'',
|
||||||
insurancePicturePhoto:''
|
insurancePicturePhoto:''
|
||||||
}
|
}
|
||||||
|
// 复制新增:从 query 预填类别/属性/服务种类(id 为空,提交仍走新增分支)
|
||||||
|
this.prefillFromQuery()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 复制新增:从 query 解析并回填车辆类别/属性/服务种类 3 项,不调任何接口;
|
||||||
|
// 字段缺失或为空时等价普通新增兜底;其余字段(照片/OCR/责任险/保单/车辆状态)保持重置后的空值
|
||||||
|
// 注意:SPA 内 $router.push 跳转时 $route.query 保留原始类型(copyFlag 为数字 1),
|
||||||
|
// 整页加载/刷新时则为字符串 "1",此处统一 String() 兼容两种来源
|
||||||
|
prefillFromQuery() {
|
||||||
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
const copyFlag = this.$route.query.copyFlag || urlParams.get('copyFlag');
|
||||||
|
if (String(copyFlag) !== '1') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const vehicleType = this.$route.query.vehicleType || urlParams.get('vehicleType');
|
||||||
|
const virtualVehicle = this.$route.query.virtualVehicle || urlParams.get('virtualVehicle');
|
||||||
|
const serviceIds = this.$route.query.serviceIds || urlParams.get('serviceIds');
|
||||||
|
if (vehicleType) {
|
||||||
|
this.selectedOption = String(vehicleType).split(',').map(Number)
|
||||||
|
}
|
||||||
|
if (virtualVehicle) {
|
||||||
|
this.virtualVehicle = Number(virtualVehicle)
|
||||||
|
}
|
||||||
|
// selectedOption 赋值触发 watch(类别 disabled 重置、小修车过滤拖车服务节点、setDefault),
|
||||||
|
// 服务树勾选必须在 watch 过滤之后执行,$nextTick 回调注册顺序保证清空勾选 → watch 过滤 → 预填勾选
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (serviceIds) {
|
||||||
|
this.$refs.tree && this.$refs.tree.setCheckedKeys(String(serviceIds).split(',').map(Number))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
showDateHandler() {
|
showDateHandler() {
|
||||||
if( this.id ) { // 修改
|
if( this.id ) { // 修改
|
||||||
if( this.permissonList.includes('hasInsuranceAudit') ) {
|
if( this.permissonList.includes('hasInsuranceAudit') ) {
|
||||||
@@ -823,12 +868,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getVehicleLicense(color) {
|
getVehicleLicense(color) {
|
||||||
|
color = color || ''
|
||||||
if( color == '蓝' ) {
|
if( color == '蓝' ) {
|
||||||
this.vehicleLicense = 1
|
this.vehicleLicense = 1
|
||||||
} else if(color == '黄') {
|
} else if(color == '黄') {
|
||||||
this.vehicleLicense = 2
|
this.vehicleLicense = 2
|
||||||
} else if(color == '临牌') {
|
} else if(color == '临牌') {
|
||||||
this.vehicleLicense = 4
|
this.vehicleLicense = 4
|
||||||
|
} else if(color.includes('黄绿')) {
|
||||||
|
this.vehicleLicense = 6
|
||||||
} else if(color.includes('绿')) {
|
} else if(color.includes('绿')) {
|
||||||
this.vehicleLicense = 3
|
this.vehicleLicense = 3
|
||||||
} else {
|
} else {
|
||||||
@@ -1162,7 +1210,7 @@ export default {
|
|||||||
cardSide: 'FRONT'
|
cardSide: 'FRONT'
|
||||||
});
|
});
|
||||||
this.vehicleFrontLicensePlate=res.data?.number
|
this.vehicleFrontLicensePlate=res.data?.number
|
||||||
this.getVehicleLicense(res.data.color)
|
this.getVehicleLicense(res.data?.color)
|
||||||
},
|
},
|
||||||
async vehicleOcrHandler() { // 行驶证首页 ocr 识别
|
async vehicleOcrHandler() { // 行驶证首页 ocr 识别
|
||||||
this.vehicleLicenseInfo.licensePlateNumber = '';
|
this.vehicleLicenseInfo.licensePlateNumber = '';
|
||||||
@@ -1187,6 +1235,8 @@ export default {
|
|||||||
this.vehicleLicenseInfo.licensePlateNumber = frontInfo?.plateNo;
|
this.vehicleLicenseInfo.licensePlateNumber = frontInfo?.plateNo;
|
||||||
this.vehicleLicenseInfo.vehicleType = frontInfo?.vehicleType;
|
this.vehicleLicenseInfo.vehicleType = frontInfo?.vehicleType;
|
||||||
this.vehicleLicenseInfo.owner = frontInfo?.owner;
|
this.vehicleLicenseInfo.owner = frontInfo?.owner;
|
||||||
|
// 行驶证所有人识别成功后,预判车辆属性(命中服务商信息则锁定为自有车辆)
|
||||||
|
this.preJudgeVirtualVehicle();
|
||||||
this.vehicleLicenseInfo.address = frontInfo?.address;
|
this.vehicleLicenseInfo.address = frontInfo?.address;
|
||||||
this.vehicleLicenseInfo.useNature = frontInfo?.useCharacter;
|
this.vehicleLicenseInfo.useNature = frontInfo?.useCharacter;
|
||||||
this.vehicleLicenseInfo.model = frontInfo?.model;
|
this.vehicleLicenseInfo.model = frontInfo?.model;
|
||||||
@@ -1211,6 +1261,33 @@ export default {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
// 车辆属性预判:行驶证所有人与车辆归属服务商的名称/法人/关联人员比对,命中自有则锁定选择器
|
||||||
|
async preJudgeVirtualVehicle() {
|
||||||
|
const wasLocked = this.virtualVehicleLocked;
|
||||||
|
this.virtualVehicleLocked = false;
|
||||||
|
this.virtualVehicleMatchRole = '';
|
||||||
|
// 之前命中自有自动填入的值,本次未命中/识别失败则清空(自有车辆不可手动选),由操作人员手动选择 2/3/4
|
||||||
|
if (wasLocked && this.virtualVehicle === 1) {
|
||||||
|
this.virtualVehicle = '';
|
||||||
|
}
|
||||||
|
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 识别
|
async vehicleBackOcrHandler() { // 行驶证副页 ocr 识别
|
||||||
this.vehicleLicenseInfo.recordNumber = '';
|
this.vehicleLicenseInfo.recordNumber = '';
|
||||||
this.vehicleLicenseInfo.passengerCapacity = '';
|
this.vehicleLicenseInfo.passengerCapacity = '';
|
||||||
@@ -1289,6 +1366,9 @@ export default {
|
|||||||
});
|
});
|
||||||
this.auditStatus = result.auditStatus;
|
this.auditStatus = result.auditStatus;
|
||||||
this.virtualVehicle = result.virtualVehicle;
|
this.virtualVehicle = result.virtualVehicle;
|
||||||
|
// 车辆属性溯源:编辑场景初始化匹配角色,已是自有车辆且命中角色时锁定选择器
|
||||||
|
this.virtualVehicleMatchRole = result.virtualVehicleMatchRole || '';
|
||||||
|
this.virtualVehicleLocked = !!(result.virtualVehicleMatchRole && result.virtualVehicle === 1);
|
||||||
this.$refs.tree.setCheckedKeys(result.serviceIds)
|
this.$refs.tree.setCheckedKeys(result.serviceIds)
|
||||||
this.vehicleStatus = result.vehicleStatus
|
this.vehicleStatus = result.vehicleStatus
|
||||||
this.vehicleLicenseFront = result.vehicleLicenseFront;
|
this.vehicleLicenseFront = result.vehicleLicenseFront;
|
||||||
@@ -1860,6 +1940,37 @@ export default {
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
opacity: 0.6;
|
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;
|
||||||
|
font-size: 22px;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 4px;
|
||||||
|
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 {
|
.pop_wrap {
|
||||||
width: 340px;
|
width: 340px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@@ -82,8 +82,11 @@
|
|||||||
<div class="codeLeft">{{item.plateNumber}} / {{item.vehicleTypeString}}
|
<div class="codeLeft">{{item.plateNumber}} / {{item.vehicleTypeString}}
|
||||||
<span class="ml10" :class="{'insuranceSuccess': item.vehicleStatus == 1, 'insuranceDanger': item.vehicleStatus == 2 ,'insuranceGray': !item.vehicleStatus }">{{ item.vehicleStatus == 1 ? '启用' :( item.vehicleStatus == 2 ? '停用' : ( item.vehicleStatus == 12 ? '否-服务商停用' : '无状态')) }} </span>
|
<span class="ml10" :class="{'insuranceSuccess': item.vehicleStatus == 1, 'insuranceDanger': item.vehicleStatus == 2 ,'insuranceGray': !item.vehicleStatus }">{{ item.vehicleStatus == 1 ? '启用' :( item.vehicleStatus == 2 ? '停用' : ( item.vehicleStatus == 12 ? '否-服务商停用' : '无状态')) }} </span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="btnWrap">
|
||||||
|
<div class="codeRight" v-if="permissonList.includes('vehicleAddBtn') || supplierId" @click.stop="copyAddVehicle(item)">复制新增</div>
|
||||||
<div class="codeRight" v-if="item.vehicleStatus == 1" @click.stop="updateStatus(item)">停用</div>
|
<div class="codeRight" v-if="item.vehicleStatus == 1" @click.stop="updateStatus(item)">停用</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="juhe flex-between">
|
<div class="juhe flex-between">
|
||||||
<span class="zdJuhe">核验认证</span>
|
<span class="zdJuhe">核验认证</span>
|
||||||
<span class="flex-right">
|
<span class="flex-right">
|
||||||
@@ -360,6 +363,19 @@ export default {
|
|||||||
// on cancel
|
// on cancel
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
copyAddVehicle(item){//复制新增:把源车的类别/属性/服务种类通过 query 带入新增页(后端未返回新字段时为空,新增页按普通新增兜底)
|
||||||
|
const query = {
|
||||||
|
copyFlag: 1,
|
||||||
|
vehicleType: item.vehicleType || '',
|
||||||
|
virtualVehicle: item.virtualVehicle || '',
|
||||||
|
serviceIds: (item.serviceIds || []).join(','),
|
||||||
|
}
|
||||||
|
if (this.supplierId) {//潜在服务商流程,与「添加」按钮保持一致
|
||||||
|
query.supplierId = this.supplierId
|
||||||
|
query.potentialFlag = this.potentialFlag
|
||||||
|
}
|
||||||
|
this.goPage('vehicleAdd', query)
|
||||||
|
},
|
||||||
updateVehicle(item){//修改
|
updateVehicle(item){//修改
|
||||||
if( this.permissonList.includes('vehicleModifyBtn') ) {
|
if( this.permissonList.includes('vehicleModifyBtn') ) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
@@ -445,6 +461,13 @@ export default {
|
|||||||
.codeLeft{
|
.codeLeft{
|
||||||
@include fontWeightSize(bold,14px)
|
@include fontWeightSize(bold,14px)
|
||||||
}
|
}
|
||||||
|
.btnWrap{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.codeRight + .codeRight{
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.codeRight{
|
.codeRight{
|
||||||
padding: 2px 8px;
|
padding: 2px 8px;
|
||||||
border: 1px solid #DDDDDD;
|
border: 1px solid #DDDDDD;
|
||||||
|
|||||||
@@ -0,0 +1,340 @@
|
|||||||
|
<template>
|
||||||
|
<div class="wrap">
|
||||||
|
<div v-loading="loadingData" class="contentWrap">
|
||||||
|
<!-- 统计年月 -->
|
||||||
|
<div class="monthBar">
|
||||||
|
<span class="monthTag">统计年月:<b>{{ currentMonth }}</b></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 总览卡片 -->
|
||||||
|
<div class="cardRow">
|
||||||
|
<div class="card">
|
||||||
|
<div class="iconWrap trophy"><i class="el-icon-trophy"></i></div>
|
||||||
|
<div class="cardInfo">
|
||||||
|
<div class="num">{{ monthData && monthData.score != null ? Number(monthData.score).toFixed(1) : '-' }}</div>
|
||||||
|
<div class="label">本服务商总分</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="iconWrap truck"><i class="el-icon-document-copy"></i></div>
|
||||||
|
<div class="cardInfo">
|
||||||
|
<div class="num">{{ monthData && monthData.receiveOrderCount != null ? monthData.receiveOrderCount : '-' }}</div>
|
||||||
|
<div class="label">承接案件量</div>
|
||||||
|
<div class="subLabel">{{ currentMonth }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 考核指标明细 -->
|
||||||
|
<div class="tableCard">
|
||||||
|
<div class="tableTitle"><i class="el-icon-tickets"></i> 考核指标明细</div>
|
||||||
|
<div class="tableBody">
|
||||||
|
<div class="tr th">
|
||||||
|
<div class="td name">考核指标</div>
|
||||||
|
<div class="td value">指标值</div>
|
||||||
|
<div class="td score">得分</div>
|
||||||
|
</div>
|
||||||
|
<div class="tr" v-for="(item, index) in indicatorList" :key="index">
|
||||||
|
<div class="td name">{{ item.name }}</div>
|
||||||
|
<div class="td value">{{ item.value }}</div>
|
||||||
|
<div class="td score">{{ item.score }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import { getStatisticsKpi } from "@/api/kpi.js"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "kpiAssess",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
supplierId: '',
|
||||||
|
currentMonth: '',
|
||||||
|
startTime: '',
|
||||||
|
endTime: '',
|
||||||
|
loadingData: false,
|
||||||
|
monthData: null,
|
||||||
|
// 考核指标配置:name 指标名称,valueKey 指标值字段,scoreKey 得分字段,type 格式化类型
|
||||||
|
indicatorConfig: [
|
||||||
|
{ name: '拒单超时率', valueKey: 'refuseOrderRate', scoreKey: 'refuseOrderScore', type: 'percent' },
|
||||||
|
{ name: '平均接单时效', valueKey: 'receiving', scoreKey: 'orderAgeingScore', type: 'minute' },
|
||||||
|
{ name: '平均到达时效', valueKey: 'arriving', scoreKey: 'arriveAgeingScore', type: 'minute' },
|
||||||
|
{ name: '上游聚合成功率', valueKey: 'wholeJuheSuccessRate', scoreKey: 'polymerizationSuccessScore', type: 'percent' },
|
||||||
|
{ name: 'APP正确使用率', valueKey: 'appRate', scoreKey: 'appUseScore', type: 'percent' },
|
||||||
|
{ name: '催促率', valueKey: 'urgeRate', scoreKey: 'urgeScore', type: 'percent' },
|
||||||
|
{ name: '投诉率', valueKey: 'complainOrderRate', scoreKey: 'complainScore', type: 'percent' },
|
||||||
|
{ name: '日间在线率', valueKey: 'daytimeOnlineRate', scoreKey: 'daytimeOnlineScore', type: 'percent' },
|
||||||
|
{ name: '自解紧急率', valueKey: 'zijieRate', scoreKey: 'zijieScore', type: 'percent' },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
indicatorList() {
|
||||||
|
return this.indicatorConfig.map(cfg => {
|
||||||
|
const data = this.monthData || {};
|
||||||
|
return {
|
||||||
|
name: cfg.name,
|
||||||
|
value: this.formatValue(data[cfg.valueKey], cfg.type),
|
||||||
|
score: this.formatScore(data[cfg.scoreKey]),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
this.supplierId = urlParams?.get('supplierId') || ''
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
await this.initDate();
|
||||||
|
await this.getData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 初始化获取当月日期(与 kpiIndex 保持一致:1号默认取上月)
|
||||||
|
initDate() {
|
||||||
|
const today = dayjs();
|
||||||
|
let targetMonth = today;
|
||||||
|
if (today.date() === 1) {
|
||||||
|
targetMonth = today.subtract(1, 'month');
|
||||||
|
}
|
||||||
|
this.currentMonth = targetMonth.format('YYYY-MM');
|
||||||
|
this.startTime = targetMonth.startOf('month').format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
let endTime;
|
||||||
|
if (targetMonth.isSame(today, 'month')) {
|
||||||
|
endTime = today.subtract(1, 'day').endOf('day');
|
||||||
|
} else {
|
||||||
|
endTime = targetMonth.endOf('month');
|
||||||
|
}
|
||||||
|
this.endTime = endTime.format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
},
|
||||||
|
async getData() {
|
||||||
|
try {
|
||||||
|
this.loadingData = true
|
||||||
|
this.monthData = null
|
||||||
|
let res = await getStatisticsKpi({
|
||||||
|
startTime: this.startTime,
|
||||||
|
endTime: this.endTime,
|
||||||
|
statisticsType: 1,
|
||||||
|
supplierId: this.supplierId,
|
||||||
|
})
|
||||||
|
let list = res.data || []
|
||||||
|
// 取统计年月对应的那一条月统计数据
|
||||||
|
this.monthData = list.find(item => dayjs(item.statisticsDate).format('YYYY-MM') === this.currentMonth) || list[0] || null
|
||||||
|
} finally {
|
||||||
|
this.loadingData = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formatValue(value, type) {
|
||||||
|
if (value == null || value === '') return '-';
|
||||||
|
if (type === 'percent') {
|
||||||
|
return (Number(value) * 100).toFixed(2) + '%';
|
||||||
|
}
|
||||||
|
if (type === 'minute') {
|
||||||
|
return Number(value).toFixed(1) + ' 分钟';
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
formatScore(value) {
|
||||||
|
if (value == null || value === '') return '-';
|
||||||
|
return Number(value).toFixed(2);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import "@/styles/mixin.scss";
|
||||||
|
@import "@/styles/common.scss";
|
||||||
|
|
||||||
|
.wrap {
|
||||||
|
@include wh(100%, 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.contentWrap {
|
||||||
|
@include wh(100%, 100%);
|
||||||
|
overflow-y: auto;
|
||||||
|
background: #EFF2F8;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 统计年月 */
|
||||||
|
.monthBar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
|
||||||
|
.monthTag {
|
||||||
|
display: inline-block;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 8px 14px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #4E5969;
|
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
||||||
|
|
||||||
|
b {
|
||||||
|
color: #1D2129;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 总览卡片 */
|
||||||
|
.cardRow {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
|
||||||
|
.card {
|
||||||
|
flex: 1;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
||||||
|
|
||||||
|
.iconWrap {
|
||||||
|
@include wh(48px, 48px);
|
||||||
|
border-radius: 8px;
|
||||||
|
@include flexCenter;
|
||||||
|
font-size: 24px;
|
||||||
|
margin-right: 14px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
justify-content: center;
|
||||||
|
&.trophy {
|
||||||
|
background: #E8F3FF;
|
||||||
|
color: #165DFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.truck {
|
||||||
|
background: #E8FFFB;
|
||||||
|
color: #0FC6C2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cardInfo {
|
||||||
|
.num {
|
||||||
|
font-size: 26px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #1D2129;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #86909C;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subLabel {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #C9CDD4;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 明细表格 */
|
||||||
|
.tableCard {
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 16px 20px;
|
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
||||||
|
|
||||||
|
.tableTitle {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #1D2129;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
color: #165DFF;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableBody {
|
||||||
|
.tr {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12px 8px;
|
||||||
|
border-bottom: 1px solid #F2F3F5;
|
||||||
|
font-size: 13px;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.th {
|
||||||
|
color: #86909C;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.td {
|
||||||
|
&.name {
|
||||||
|
flex: 1.5;
|
||||||
|
text-align: center;
|
||||||
|
color: #1D2129;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.value {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
color: #4E5969;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.score {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
color: #165DFF;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.th .td {
|
||||||
|
&.name, &.value, &.score {
|
||||||
|
color: #86909C;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 移动端适配 */
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
.contentWrap {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cardRow {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableCard {
|
||||||
|
padding: 12px;
|
||||||
|
|
||||||
|
.tableBody .tr .td {
|
||||||
|
&.name {
|
||||||
|
flex: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.value {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.score {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user