Commit fbb5d121 by zhangquan

过滤产品

1 parent 8b01bca4
......@@ -16,6 +16,7 @@
"glsx-common": "^2.0.4",
"glsx-components": "^1.5.4",
"lodash": "^4.17.21",
"number-precision": "^1.6.0",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2",
......
......@@ -316,6 +316,7 @@ import { fetchConfig } from '@/config'
import utils from '../../util/util'
import uploadInfo from './uploadInfo.vue'
import FormatInput from '@/components/FormatInput'
import NP from 'number-precision'
export default {
name: 'editEquity',
data() {
......@@ -435,8 +436,8 @@ export default {
type: 'input',
placeholder: '请输入车辆价格',
maxlength: 11,
inputBlur: () => {
this.packageToPrice()
inputBlur: e => {
this.packageToPrice(e)
}
},
{
......@@ -1615,6 +1616,7 @@ export default {
this.customProductList.push(item)
}
})
this.copyCustomProductList = this.$common.utils.deepClone(this.customProductList) //复制一份出来当做过滤源数据
this.autoGenerate(this.customProductList, this.productList)
},
setDisabled(partDisabledList = []) {
......@@ -1767,18 +1769,32 @@ export default {
},
// 改建议价,实际销售价
packageToPrice() {
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)
let _price = e?.target?.value || ''
if (_price) {
let _list = []
this.copyCustomProductList.forEach(item => {
if (!item.carHighestPrice || (item.carHighestPrice && _price < NP.divide(item.carHighestPrice || 0, 100) && _price > NP.divide(item.carLowestPrice || 0, 100))) {
_list.push(item)
} else {
if (this.autoPackageCodeList.includes(item.packageCode)) {
this.changeRaido(false, item)
}
})
}
}
})
this.customProductList = _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)
// }
// })
// }
},
packageAttr(recovery = false, productArrData, detailInfo) {
// 2023 7月底版本 改版
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!