Commit 18a314eb by zhangxw

需求开发

1 parent 4a574033
......@@ -224,7 +224,13 @@
</el-select>
</template>
<template v-if="attr.attributeType == 'datePicker'">
<el-date-picker class="arrt_pannel" :picker-options="limitData.includes(attr.attributeName) ? pickerOptions2 : pickerOptions" :disabled="disabled || attr.disabled" @change="getCurChangeDate($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
<el-date-picker class="arrt_pannel" :picker-options="attr.attributeName == 'vehicle_begin_date' ? '' : limitData.includes(attr.attributeName) ? pickerOptions2 : pickerOptions" :disabled="disabled || attr.disabled" @change="getCurChangeDate($event, item, attr)" v-model="productModal[item.idName][attr.attributeName]" size="small" type="date" :placeholder="'请选择' + attr.attributeDesc"></el-date-picker>
</template>
<template v-if="attr.attributeType == 'selectInput'">
<el-select :allow-create="attr.attributeName == 'gearbox'" :remote="attr.attributeName == 'gearbox'" :filterable="attr.attributeName == 'gearbox'" class="arrt_pannel wid_144" :disabled="disabled || attr.disabled" size="small" @change="getCurChangeSelect($event, item, attr)" v-model="displacementPowerObj[item.packageCode]['vehicle_displacement_power']" :placeholder="'请选择' + attr.attributeDesc">
<el-option v-for="option in baseData.dynamicTypeList" :key="option.value" :label="option.label" :value="option.value"></el-option>
</el-select>
<FormatInput class="arrt_pannel wid_288" :disabled="disabled || attr.disabled || (attr.attributeName == 'compensation_name' && compensationNameDisable)" @input="getCurChangeInput($event, item, attr, index, attrindex, 2)" v-model="displacementPowerObj[item.packageCode]['vehicle_displacement_power_value']" size="small" :maxlength="attr.maxLength" clearable :placeholder="'请输入' + `${displacementPowerObj[item.packageCode]['vehicle_displacement_power'] == 0 ? '排量' : '功率'}`" precise="2" intDigit="10"></FormatInput>
</template>
</div>
</div>
......@@ -310,6 +316,10 @@ const TDO_OBJ = {
3: ''
}
}
const DISPLACEMENT_POWER_OBJ = {
vehicle_displacement_power: '0',
vehicle_displacement_power_value: ''
}
import * as dayjs from 'dayjs'
import { limitPrice } from '@/common/constant'
import glsxCombiForm from '@/components/glsx-combi-form'
......@@ -865,6 +875,16 @@ export default {
label: '全款车'
}
],
dynamicTypeList: [
{
value: '0',
label: '排量(L)'
},
{
value: '1',
label: '功率(KW)'
}
],
agreeList: []
},
allCarChildList: [],
......@@ -891,7 +911,7 @@ export default {
dataSourceDisable: false,
showUploadInfo: false,
// 日期限制属性
limitData: ['vehicle_registration_date', 'additional_date'],
limitData: ['vehicle_registration_date', 'additional_date', 'vehicle_buy_date'],
// 上传资料默认属性
uploadMessage: {
buyCar: [],
......@@ -936,7 +956,8 @@ export default {
label: '营运'
}
],
limitAttrName: ['warranty_km', 'vehicle_displacement', 'mileage', 'warranty_period']
limitAttrName: ['warranty_km', 'vehicle_displacement', 'mileage', 'warranty_period'],
displacementPowerObj: {}
}
},
......@@ -1192,6 +1213,10 @@ export default {
if (_haveTableTarget && !this.TDOTableData[v.idName]) {
this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
const _haveSelectInputTarget = v?.groupAttributeList.find(item => item.attributeDesc == '排量或功率')
if (_haveSelectInputTarget && !this.displacementPowerObj[v.idName]) {
this.$set(this.displacementPowerObj, v.packageCode, JSON.parse(JSON.stringify(DISPLACEMENT_POWER_OBJ)))
}
for (let key in this.productModal[v.idName]) {
v.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
......@@ -1227,6 +1252,10 @@ export default {
if (_haveTableTarget && !this.TDOTableData[item.idName]) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
const _haveSelectInputTarget = item?.groupAttributeList.find(item => item.attributeDesc == '排量或功率')
if (_haveSelectInputTarget && !this.displacementPowerObj[item.idName]) {
this.$set(this.displacementPowerObj, item.packageCode, JSON.parse(JSON.stringify(DISPLACEMENT_POWER_OBJ)))
}
this.checkCodeList.push(item.packageCode)
this.packageCodeList.push(item.packageCode)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
......@@ -1275,6 +1304,10 @@ export default {
if (_haveTableTarget && !this.TDOTableData[v.idName]) {
this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
const _haveSelectInputTarget = v?.groupAttributeList.find(item => item.attributeDesc == '排量或功率')
if (_haveSelectInputTarget && !this.displacementPowerObj[v.idName]) {
this.$set(this.displacementPowerObj, v.packageCode, JSON.parse(JSON.stringify(DISPLACEMENT_POWER_OBJ)))
}
for (let key in this.productModal[v.idName]) {
v.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
......@@ -1319,6 +1352,10 @@ export default {
if (_haveTableTarget && !this.TDOTableData[item.idName]) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
const _haveSelectInputTarget = item?.groupAttributeList.find(item => item.attributeDesc == '排量或功率')
if (_haveSelectInputTarget && !this.displacementPowerObj[item.idName]) {
this.$set(this.displacementPowerObj, item.packageCode, JSON.parse(JSON.stringify(DISPLACEMENT_POWER_OBJ)))
}
this.checkCodeList.push(item.packageCode)
this.autoPackageCodeList.push(item.packageCode)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
......@@ -1489,7 +1526,7 @@ export default {
},
// 处理数据结构对比后台所需的参数
handleProductArrParam(arr, codearr, isGetDetail = false) {
arr = arr.filter(item => item?.attributeGroup != 'tireBatchNew' && item?.attributeGroup != 'tireDTONew')
arr = arr.filter(item => item?.attributeGroup != 'tireBatchNew' && item?.attributeGroup != 'tireDTONew' && item?.attributeGroup != 'vehicle_displacement_power' && item?.attributeGroup != 'vehicle_displacement_power_value')
let newArr = [],
filterList = []
const codeList = Array.from(new Set(codearr))
......@@ -1563,6 +1600,21 @@ export default {
}
}
}
if (this.displacementPowerObj[item]) {
for (let key in this.displacementPowerObj[item]) {
let _obj = {
name: item,
index: index,
value: {
attributeGroup: key,
attributeName: key,
attributeValue: this.displacementPowerObj[item][key],
sort: 0
}
}
blackArr[index].push(_obj)
}
}
})
// codeList为已选中产品的packageCode
for (let i = 0; i < blackArr.length; i++) {
......@@ -1865,6 +1917,15 @@ export default {
copyItem.attributeType = 'table'
newGroupObj.attributeList.push(copyItem)
}
if (e.groupName == 'vehicle_displacement_power' || e.groupName == 'vehicle_displacement_power_value') {
newGroupObj.groupName = 'newDisplacementPower'
newGroupObj.num = 1
const copyItem = JSON.parse(JSON.stringify(e?.attributeList?.[0] || {}))
copyItem.attributeDesc = '排量或功率'
copyItem.attributeType = 'selectInput'
copyItem.required = true
newGroupObj.attributeList.push(copyItem)
}
})
if (id > -1) item.groupAttributeList.splice(id + 1, 0, obj)
item.groupAttributeList.push(newGroupObj)
......@@ -1872,6 +1933,10 @@ export default {
if (_tireBatchNewIdx > -1) item.groupAttributeList.splice(_tireBatchNewIdx, 1)
const _tireDTONewIdx = item?.groupAttributeList?.findIndex(ele => ele.groupName == 'tireDTONew')
if (_tireDTONewIdx > -1) item.groupAttributeList.splice(_tireDTONewIdx, 1)
const _displacement = item?.groupAttributeList?.findIndex(ele => ele.groupName == 'vehicle_displacement_power')
if (_displacement > -1) item.groupAttributeList.splice(_displacement, 1)
const _power = item?.groupAttributeList?.findIndex(ele => ele.groupName == 'vehicle_displacement_power_value')
if (_power > -1) item.groupAttributeList.splice(_power, 1)
})
this.toGetProductData(res)
})
......@@ -2048,10 +2113,17 @@ export default {
if (hasTire && !this.TDOTableData[item.packageCode]) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
const hasDisplacementPower = _curProdTarget?.groupAttributeList?.find(el => el.attributeGroup == 'vehicle_displacement_power_value' || el.attributeGroup == 'vehicle_displacement_power')
if (hasDisplacementPower && !this.displacementPowerObj[item.packageCode]) {
this.$set(this.displacementPowerObj, item.packageCode, JSON.parse(JSON.stringify(DISPLACEMENT_POWER_OBJ)))
}
item.attributeDTOList.forEach(el => {
if (this.TDOTableData[item.packageCode] && (el.attributeGroup == 'tireDTONew' || el.attributeGroup == 'tireBatchNew')) {
this.$set(this.TDOTableData[item.packageCode][el.attributeGroup], el.sort, el.attributeValue)
}
if (this.displacementPowerObj[item.packageCode] && (el.attributeGroup == 'vehicle_displacement_power_value' || el.attributeGroup == 'vehicle_displacement_power')) {
this.$set(this.displacementPowerObj[item.packageCode], el.attributeGroup, el.attributeValue)
}
attrList.push({
...el,
packageCode: item.packageCode,
......@@ -2223,9 +2295,10 @@ export default {
// 获取车型
getCarTypeList(isRecovery = false) {
if (!isRecovery) {
this.editForm.vehicle.vehicleShapeId = ''
this.baseData.carTypeOptions = []
}
// 将车型清空
this.editForm.vehicle.vehicleShapeId = ''
const params = {
carSeriesId: this.editForm.vehicle.vehicleSeriesId
}
......@@ -2381,7 +2454,7 @@ export default {
for (let j = 0; j < vaidArr[i].groupAttributeList.length; j++) {
if (vaidArr[i].groupAttributeList[j].required == 1) {
let packcode = vaidArr[i].packageCode
if (!this.productModal[vaidArr[i].idName][vaidArr[i].groupAttributeList[j].attributeName] && this.checkCodeList.includes(packcode) && vaidArr[i].groupAttributeList[j].attributeDesc != '轮胎参数') {
if (!this.productModal[vaidArr[i].idName][vaidArr[i].groupAttributeList[j].attributeName] && this.checkCodeList.includes(packcode) && vaidArr[i].groupAttributeList[j].attributeDesc != '轮胎参数' && vaidArr[i].groupAttributeList[j].attributeDesc != '排量或功率') {
let str = `请填写${vaidArr[i].packageName}的${vaidArr[i].groupAttributeList[j].attributeDesc}`
this.$message({ message: str, type: 'error' })
this.submit = false
......@@ -2391,6 +2464,23 @@ export default {
}
}
},
// 检查排量或功率信息是否已填
checkDisplacementPowerFn() {
const allPageCodeList = this.equityRadio == 1 ? this.packageCodeList : this.autoPackageCodeList
let isEmpty = false
try {
allPageCodeList.forEach(item => {
if (this.displacementPowerObj[item]) {
if (!this.displacementPowerObj[item]['vehicle_displacement_power'] || !this.displacementPowerObj[item]['vehicle_displacement_power_value']) {
throw new Error(true)
}
}
})
} catch (error) {
isEmpty = error.message == 'true'
}
return isEmpty
},
// 检查轮胎信息是否已填
checkTDOTableDataFn() {
const allPageCodeList = this.equityRadio == 1 ? this.packageCodeList : this.autoPackageCodeList
......@@ -2509,6 +2599,7 @@ export default {
if (productflag) {
return
}
if (this.checkDisplacementPowerFn()) return this.$message.error('请填写排量或功率')
params = {
...params,
...vaidObj
......@@ -2784,7 +2875,7 @@ export default {
margin-bottom: 20px;
margin-right: 30px;
.attr_label {
width: 154px;
width: 174px;
white-space: nowrap;
text-align: right;
box-sizing: border-box;
......@@ -2798,6 +2889,12 @@ export default {
width: 432px;
position: relative;
}
.wid_144 {
width: 144px;
}
.wid_288 {
width: 288px;
}
}
}
.custom-made {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!