CRM_26-08-13#story#9201,新增调度APP通过复制快速新增车辆的功能
This commit is contained in:
@@ -750,8 +750,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') ) {
|
||||||
|
|||||||
@@ -82,8 +82,12 @@
|
|||||||
<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">
|
||||||
|
<!-- v-if="permissonList.includes('vehicleAddBtn')"-->
|
||||||
|
<div class="codeRight" @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 +364,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 +462,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;
|
||||||
|
|||||||
Reference in New Issue
Block a user