Commit 32c8c682 by 张立顺

fix bug

1 parent 387638e1
......@@ -75,8 +75,13 @@ export default {
}
</script>
<style scoped>
::v-deep .el-dialog__header {
font-size: 16px;
font-weight: 600;
}
.dialog-sub-title {
font-size: 12px;
font-size: 20px;
font-weight: 600;
color: #666666;
}
</style>
......@@ -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()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
......
......@@ -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
}
// 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 = '') {
if (cartype && this.editForm.orderStatus != 2) {
packageToCarType() {
let cartype = this.editForm.vehicle.vehicleSeriesId
let _price = this.editForm.vehicle.invoicePrice
if ((cartype || _price) && this.editForm.orderStatus != 2) {
let _list = []
this.copyCustomProductList.forEach(item => {
// 套餐商品不做过滤 没有这个字段也给全部默认显示
console.log(item, 'copyCustomProductList')
if (!item.vehicleSeriesConfigs || (item.vehicleSeriesConfigs && item.vehicleSeriesConfigs.some(ele => ele.vehicleSeriesId == cartype))) {
_list.push(item)
} else {
......@@ -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) {
......
......@@ -107,12 +107,12 @@ export default {
{ required: true, message: '请输入自定义保障部件', trigger: 'blur' },
{ validator: validateSupportPositionOther, trigger: 'blur' }
],
contractList: [{ required: true, message: '请选择关联合同', trigger: ['blur', 'change'] }],
specificationDetailList: [{ required: true, message: '请选择规格', trigger: ['blur', 'change'] }]
contractList: [{ required: true, message: '请选择关联合同', trigger: ['blur', 'change'] }]
// specificationDetailList: [{ required: true, message: '请选择规格', trigger: ['blur', 'change'] }]
},
formObj: {
contractList: [],
specificationDetailList: []
contractList: []
// specificationDetailList: []
},
formData: [
{
......@@ -353,9 +353,16 @@ export default {
const arr = confirmShopData.map(item => {
// item.upgradePriceEmpty = true
// item.specificationDataEmpty = true
item.salesCostEmpty = true
item.insuranceCostEmpty = true
item.shelfCostEmpty = true
if (item.useStatus == 1) {
// 启用才需要校验
item.salesCostEmpty = true
item.insuranceCostEmpty = true
item.shelfCostEmpty = true
} else {
item.salesCostEmpty = false
item.insuranceCostEmpty = false
item.shelfCostEmpty = false
}
return item
})
this.goodsInfoData.goodsSpecificationList = arr
......@@ -368,22 +375,10 @@ export default {
try {
requiredList.map(it => {
console.log(it, item[it], 'it')
if (this.filterEmpty(item[it])) {
if (this.filterEmpty(item[it]) && item.useStatus != 0) {
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) {
console.log(error, 'error')
return document.getElementById('specificationDetailList').scrollIntoView()
......
<!-- 关联门店弹窗 -->
<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-item label="品牌名称:">
<el-input v-model.trim="storeSearchForm.brandName" placeholder="品牌名称" max-length="20" @keydown.native="handleStoreInput" clearable />
......
<!-- 关联门店弹窗 -->
<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-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">
......@@ -17,29 +17,31 @@
<el-button @click="handleRelateStop">批量禁用</el-button>
</div>
</div>
<div class="tableCon">
<div class="tableBox">
<el-table ref="seletingTable" fit :data="tableData" height="464px" class="table" border @select="handleChange" @select-all="handleAll">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="70" align="center"></el-table-column>
<el-table-column :label="`${tableItem.specificationName}`" width="150" v-for="(tableItem, tableIndex) in specificationDetailList" :key="tableIndex" type="index" align="center">
<template slot-scope="scope">
{{ scope.row.specsValueList[tableIndex] }}
</template>
</el-table-column>
<el-table-column label="状态" align="center" width="150px">
<template slot-scope="scope">
<el-switch class="elSwitch" v-model="scope.row.useStatus" active-text="启用" inactive-text="禁用" :active-value="0" :inactive-value="1" @input="clickSwitch(scope)"></el-switch>
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-top: 10px">
共
<span class="tip-text">{{ tableData.length }}</span>
件规格商品。
</div>
<!-- <div class="tableCon"> -->
<div class="tableBox" v-if="specificationDetailList.length">
<!-- height="464px" -->
<el-table ref="seletingTable" :data="tableData" class="table" border @select="handleChange" @select-all="handleAll" height="380px">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="70" align="center"></el-table-column>
<!-- width="150" -->
<el-table-column :label="`${tableItem.specificationName}`" v-for="(tableItem, tableIndex) in specificationDetailList" :key="tableIndex" align="center">
<template slot-scope="scope">
{{ scope.row.specsValueList[tableIndex] }}
</template>
</el-table-column>
<el-table-column label="状态" align="center" width="150px">
<template slot-scope="scope">
<el-switch class="elSwitch" v-model="scope.row.useStatus" active-text="启用" inactive-text="禁用" :active-value="0" :inactive-value="1" @input="clickSwitch(scope)"></el-switch>
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-top: 10px">
共
<span class="tip-text">{{ tableData.length }}</span>
件规格商品。
</div>
<!-- </div> -->
</d2-dialog>
</template>
......@@ -100,6 +102,10 @@ export default {
this.searchForm.push([])
})
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')
},
......@@ -210,12 +216,12 @@ export default {
}
}
.relateSku .table {
margin: 0 auto 20px !important;
}
.relateSku .tableCon {
margin-top: 20px;
width: 100%;
// margin: 0 auto 20px !important;
}
// .relateSku .tableCon {
// margin-top: 20px;
// width: 100%;
// }
.service-store .relateSku .el-table .cell,
.d2-form .relateSku .el-table .cell {
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!