CRM_26-08-13#story#9201,新增调度APP通过复制快速新增车辆的功能
This commit is contained in:
@@ -750,8 +750,37 @@ export default {
|
||||
liabilityInsuranceEndTime:'',
|
||||
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() {
|
||||
if( this.id ) { // 修改
|
||||
if( this.permissonList.includes('hasInsuranceAudit') ) {
|
||||
|
||||
Reference in New Issue
Block a user