Commit 32c8c682 by 张立顺

fix bug

1 parent 387638e1
...@@ -75,8 +75,13 @@ export default { ...@@ -75,8 +75,13 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
::v-deep .el-dialog__header {
font-size: 16px;
font-weight: 600;
}
.dialog-sub-title { .dialog-sub-title {
font-size: 12px; font-size: 20px;
font-weight: 600;
color: #666666; color: #666666;
} }
</style> </style>
...@@ -44,6 +44,42 @@ Vue.directive('preventReClick', { ...@@ -44,6 +44,42 @@ Vue.directive('preventReClick', {
) )
} }
}) })
function adjustColumnWidth(table) {
const colgroup = table.querySelector('colgroup')
const colDefs = [...colgroup.querySelectorAll('col')]
colDefs.forEach(col => {
const clsName = col.getAttribute('name')
const cells = [...table.querySelectorAll(`td.${clsName}`), ...table.querySelectorAll(`th.${clsName}`)]
// 忽略加了"leave-alone"类的列
if (cells[0]?.classList?.contains?.('leave-alone')) {
return
}
const widthList = cells.map(el => {
return el.querySelector('.cell')?.scrollWidth || 0
})
const max = Math.max(...widthList)
const padding = 32
table.querySelectorAll(`col[name=${clsName}]`).forEach(el => {
el.setAttribute('width', max + padding)
})
})
}
Vue.directive('fit-columns', {
update() {},
bind() {},
inserted(el) {
setTimeout(() => {
adjustColumnWidth(el)
}, 300)
},
componentUpdated(el) {
el.classList.add('r-table')
setTimeout(() => {
adjustColumnWidth(el)
}, 300)
},
unbind() {}
})
start() start()
export { bootstrap, mount, unmount } from '@/setup' export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
......
...@@ -1908,28 +1908,36 @@ export default { ...@@ -1908,28 +1908,36 @@ export default {
} }
} }
}) })
this.customProductList = _list console.log(_list, '_list')
let list2 = []
if (this.editForm.vehicle.vehicleSeriesId) {
let cartype = this.editForm.vehicle.vehicleSeriesId
// let _price = this.editForm.vehicle.invoicePrice
_list.forEach(item => {
// 套餐商品不做过滤 没有这个字段也给全部默认显示
if (!item.vehicleSeriesConfigs || (item.vehicleSeriesConfigs && item.vehicleSeriesConfigs.some(ele => ele.vehicleSeriesId == cartype))) {
list2.push(item)
} else {
if (this.autoPackageCodeList.includes(item.packageCode)) {
this.changeRaido(false, item, true)
}
}
})
} else {
list2 = _list
}
console.log(list2, '_list')
this.customProductList = list2
if (formDetail) return _list if (formDetail) return _list
} }
// var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
// this.editForm.suggestedSellingPrice = ''
// if (this.editForm.vehicle.invoicePrice) {
// var invoicePrice = (this.editForm.vehicle.invoicePrice * 100).toFixed(2)
// targetItem &&
// targetItem.servicePackagePrices.forEach(item => {
// if (+invoicePrice >= +item.carButtomPrice && +invoicePrice < +item.carHighestPrice) {
// this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2)
// this.editForm.actualSalesPrice = (item.retailPrice / 100).toFixed(2)
// }
// })
// }
}, },
packageToCarType(cartype = '') { packageToCarType() {
if (cartype && this.editForm.orderStatus != 2) { let cartype = this.editForm.vehicle.vehicleSeriesId
let _price = this.editForm.vehicle.invoicePrice
if ((cartype || _price) && this.editForm.orderStatus != 2) {
let _list = [] let _list = []
this.copyCustomProductList.forEach(item => { this.copyCustomProductList.forEach(item => {
// 套餐商品不做过滤 没有这个字段也给全部默认显示 // 套餐商品不做过滤 没有这个字段也给全部默认显示
console.log(item, 'copyCustomProductList')
if (!item.vehicleSeriesConfigs || (item.vehicleSeriesConfigs && item.vehicleSeriesConfigs.some(ele => ele.vehicleSeriesId == cartype))) { if (!item.vehicleSeriesConfigs || (item.vehicleSeriesConfigs && item.vehicleSeriesConfigs.some(ele => ele.vehicleSeriesId == cartype))) {
_list.push(item) _list.push(item)
} else { } else {
...@@ -1938,7 +1946,24 @@ export default { ...@@ -1938,7 +1946,24 @@ export default {
} }
} }
}) })
this.customProductList = _list console.log(_list, '_list')
let list2 = []
if (this.editForm.vehicle.invoicePrice) {
// let _price = this.editForm.vehicle.invoicePrice
_list.forEach(item => {
// 套餐商品不做过滤
if (item.parentId || !item.carHighestPrice || (item.carHighestPrice && _price <= NP.divide(item.carHighestPrice || 0, 100) && _price >= NP.divide(item.carLowestPrice || 0, 100))) {
list2.push(item)
} else {
if (this.autoPackageCodeList.includes(item.packageCode)) {
this.changeRaido(false, item, true)
}
}
})
} else {
list2 = _list
}
this.customProductList = list2
} }
}, },
packageAttr(recovery = false, productArrData, detailInfo) { packageAttr(recovery = false, productArrData, detailInfo) {
......
...@@ -107,12 +107,12 @@ export default { ...@@ -107,12 +107,12 @@ export default {
{ required: true, message: '请输入自定义保障部件', trigger: 'blur' }, { required: true, message: '请输入自定义保障部件', trigger: 'blur' },
{ validator: validateSupportPositionOther, trigger: 'blur' } { validator: validateSupportPositionOther, trigger: 'blur' }
], ],
contractList: [{ required: true, message: '请选择关联合同', trigger: ['blur', 'change'] }], contractList: [{ required: true, message: '请选择关联合同', trigger: ['blur', 'change'] }]
specificationDetailList: [{ required: true, message: '请选择规格', trigger: ['blur', 'change'] }] // specificationDetailList: [{ required: true, message: '请选择规格', trigger: ['blur', 'change'] }]
}, },
formObj: { formObj: {
contractList: [], contractList: []
specificationDetailList: [] // specificationDetailList: []
}, },
formData: [ formData: [
{ {
...@@ -353,9 +353,16 @@ export default { ...@@ -353,9 +353,16 @@ export default {
const arr = confirmShopData.map(item => { const arr = confirmShopData.map(item => {
// item.upgradePriceEmpty = true // item.upgradePriceEmpty = true
// item.specificationDataEmpty = true // item.specificationDataEmpty = true
item.salesCostEmpty = true if (item.useStatus == 1) {
item.insuranceCostEmpty = true // 启用才需要校验
item.shelfCostEmpty = true item.salesCostEmpty = true
item.insuranceCostEmpty = true
item.shelfCostEmpty = true
} else {
item.salesCostEmpty = false
item.insuranceCostEmpty = false
item.shelfCostEmpty = false
}
return item return item
}) })
this.goodsInfoData.goodsSpecificationList = arr this.goodsInfoData.goodsSpecificationList = arr
...@@ -368,22 +375,10 @@ export default { ...@@ -368,22 +375,10 @@ export default {
try { try {
requiredList.map(it => { requiredList.map(it => {
console.log(it, item[it], 'it') console.log(it, item[it], 'it')
if (this.filterEmpty(item[it])) { if (this.filterEmpty(item[it]) && item.useStatus != 0) {
throw it throw it
} }
}) })
// throw true
// const singleMinpriceRangeNode = this.$refs['specifications-form']?.$refs.singleSpecificationFormRef?.$refs[`min-car-price-range-input${i}`]
// const singleMaxpriceRangeNode = this.$refs['specifications-form']?.$refs.singleSpecificationFormRef?.$refs[`max-car-price-range-input${i}`]
// const multipleMinPriceRangeNode = this.$refs['specifications-form']?.$refs.multipleSpecificationFormRef?.$refs[`min-car-price-range-input${i}`]
// const multipleMaxPriceRangeNode = this.$refs['specifications-form']?.$refs.multipleSpecificationFormRef?.$refs[`max-car-price-range-input${i}`]
// 去掉适用车价校验
// if (this.handlePriceConflict()?.length) throw true
// 获取适用车价元素
// if (singleMinpriceRangeNode && singleMinpriceRangeNode[0]?.$el?.className?.includes('border-red')) throw true
// if (singleMaxpriceRangeNode && singleMaxpriceRangeNode[0]?.$el?.className?.includes('border-red')) throw true
// if (multipleMinPriceRangeNode && multipleMinPriceRangeNode[0]?.$el?.className?.includes('border-red')) throw true
// if (multipleMaxPriceRangeNode && multipleMaxPriceRangeNode[0]?.$el?.className?.includes('border-red')) throw true
} catch (error) { } catch (error) {
console.log(error, 'error') console.log(error, 'error')
return document.getElementById('specificationDetailList').scrollIntoView() return document.getElementById('specificationDetailList').scrollIntoView()
......
<!-- 关联门店弹窗 --> <!-- 关联门店弹窗 -->
<template> <template>
<d2-dialog title="选择品牌" :is-visible.sync="relateStoreVisible" width="1075px" btn-ok-label="确定" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateStore"> <d2-dialog title="选择车型" :is-visible.sync="relateStoreVisible" width="1075px" btn-ok-label="确定" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateStore">
<el-form :model="storeSearchForm" ref="relate" :inline="true"> <el-form :model="storeSearchForm" ref="relate" :inline="true">
<el-form-item label="品牌名称:"> <el-form-item label="品牌名称:">
<el-input v-model.trim="storeSearchForm.brandName" placeholder="品牌名称" max-length="20" @keydown.native="handleStoreInput" clearable /> <el-input v-model.trim="storeSearchForm.brandName" placeholder="品牌名称" max-length="20" @keydown.native="handleStoreInput" clearable />
......
<!-- 关联门店弹窗 --> <!-- 关联门店弹窗 -->
<template> <template>
<d2-dialog title="组合列表" :is-visible.sync="relateStoreVisible" width="40%" btn-ok-label="确定" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateSku"> <d2-dialog title="规格组合管理" :is-visible.sync="relateStoreVisible" width="40%" btn-ok-label="确定" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateSku">
<el-form :model="searchForm" ref="relate" :inline="true"> <el-form :model="searchForm" ref="relate" :inline="true">
<el-form-item class="formItem" :label="`${item.specificationName}:`" v-for="(item, index) in specificationDetailList" :key="index"> <el-form-item class="formItem" :label="`${item.specificationName}:`" v-for="(item, index) in specificationDetailList" :key="index">
<el-select collapse-tags multiple v-model="searchForm[index]" placeholder="请选择规格" value-key="specificationValue"> <el-select collapse-tags multiple v-model="searchForm[index]" placeholder="请选择规格" value-key="specificationValue">
...@@ -17,29 +17,31 @@ ...@@ -17,29 +17,31 @@
<el-button @click="handleRelateStop">批量禁用</el-button> <el-button @click="handleRelateStop">批量禁用</el-button>
</div> </div>
</div> </div>
<div class="tableCon"> <!-- <div class="tableCon"> -->
<div class="tableBox"> <div class="tableBox" v-if="specificationDetailList.length">
<el-table ref="seletingTable" fit :data="tableData" height="464px" class="table" border @select="handleChange" @select-all="handleAll"> <!-- height="464px" -->
<el-table-column type="selection" width="55" align="center" /> <el-table ref="seletingTable" :data="tableData" class="table" border @select="handleChange" @select-all="handleAll" height="380px">
<el-table-column label="序号" type="index" width="70" align="center"></el-table-column> <el-table-column type="selection" width="55" align="center" />
<el-table-column :label="`${tableItem.specificationName}`" width="150" v-for="(tableItem, tableIndex) in specificationDetailList" :key="tableIndex" type="index" align="center"> <el-table-column label="序号" type="index" width="70" align="center"></el-table-column>
<template slot-scope="scope"> <!-- width="150" -->
{{ scope.row.specsValueList[tableIndex] }} <el-table-column :label="`${tableItem.specificationName}`" v-for="(tableItem, tableIndex) in specificationDetailList" :key="tableIndex" align="center">
</template> <template slot-scope="scope">
</el-table-column> {{ scope.row.specsValueList[tableIndex] }}
<el-table-column label="状态" align="center" width="150px"> </template>
<template slot-scope="scope"> </el-table-column>
<el-switch class="elSwitch" v-model="scope.row.useStatus" active-text="启用" inactive-text="禁用" :active-value="0" :inactive-value="1" @input="clickSwitch(scope)"></el-switch> <el-table-column label="状态" align="center" width="150px">
</template> <template slot-scope="scope">
</el-table-column> <el-switch class="elSwitch" v-model="scope.row.useStatus" active-text="启用" inactive-text="禁用" :active-value="0" :inactive-value="1" @input="clickSwitch(scope)"></el-switch>
</el-table> </template>
</div> </el-table-column>
<div style="margin-top: 10px"> </el-table>
共
<span class="tip-text">{{ tableData.length }}</span>
件规格商品。
</div>
</div> </div>
<div style="margin-top: 10px">
共
<span class="tip-text">{{ tableData.length }}</span>
件规格商品。
</div>
<!-- </div> -->
</d2-dialog> </d2-dialog>
</template> </template>
...@@ -100,6 +102,10 @@ export default { ...@@ -100,6 +102,10 @@ export default {
this.searchForm.push([]) this.searchForm.push([])
}) })
this.tableData = deepClone(this.goodsSpecificationList) this.tableData = deepClone(this.goodsSpecificationList)
// this.$nextTick(() => {
// console.log(this.$refs.seletingTable, ' this.$refs.seletingTable')
// this.$refs.seletingTable.doLayout()
// }, 4000)
console.log(this.tableData, 'tableData') console.log(this.tableData, 'tableData')
}, },
...@@ -210,12 +216,12 @@ export default { ...@@ -210,12 +216,12 @@ export default {
} }
} }
.relateSku .table { .relateSku .table {
margin: 0 auto 20px !important; // margin: 0 auto 20px !important;
}
.relateSku .tableCon {
margin-top: 20px;
width: 100%;
} }
// .relateSku .tableCon {
// margin-top: 20px;
// width: 100%;
// }
.service-store .relateSku .el-table .cell, .service-store .relateSku .el-table .cell,
.d2-form .relateSku .el-table .cell { .d2-form .relateSku .el-table .cell {
line-height: 26px !important; line-height: 26px !important;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!