Commit 18a314eb by zhangxw

需求开发

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