Commit 387638e1 by 张立顺

fix bug修复

1 parent 53d9b524
......@@ -59,7 +59,7 @@ export default {
appendToBody: {
// 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
type: Boolean,
default: false
default: true
},
fullscreen: Boolean
},
......
......@@ -19,6 +19,31 @@ import { start } from '@/setup'
Vue.use(chaining)
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.directive('preventReClick', {
bind: (el, binding) => {
let time = binding.value // 防抖时间
if (!time) {
// 用户若不设置防抖时间,则默认1s
time = 1000
}
let fun
el.addEventListener(
'click',
event => {
if (!fun) {
// 第一次执行
fun = setTimeout(() => {
fun = null
}, time)
} else {
// 直接取消当前事件
event && event.stopImmediatePropagation()
}
},
true
)
}
})
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
......
......@@ -261,7 +261,7 @@
<div class="page-btm-btn">
<el-button v-if="![3, 5].includes(routeInfo.addOrEdit)" class="custom_black" @click="handleReset">重置</el-button>
<el-button class="custom_blue" v-if="![3, 5].includes(routeInfo.addOrEdit)" @click="handleDraft">草稿</el-button>
<el-button v-if="routeInfo.addOrEdit != '5'" type="primary" @click="checkRefitInfo()">{{ routeInfo.addOrEdit != '3' ? '提单' : '确定' }}</el-button>
<el-button v-if="routeInfo.addOrEdit != '5'" type="primary" v-preventReClick @click="checkRefitInfo()">{{ routeInfo.addOrEdit != '3' ? '提单' : '确定' }}</el-button>
</div>
<!-- 二维码 -->
......@@ -1928,9 +1928,9 @@ export default {
if (cartype && this.editForm.orderStatus != 2) {
let _list = []
this.copyCustomProductList.forEach(item => {
// 套餐商品不做过滤
// 套餐商品不做过滤 没有这个字段也给全部默认显示
console.log(item, 'copyCustomProductList')
if (item.vehicleSeriesConfigs && item.vehicleSeriesConfigs.some(ele => ele.vehicleSeriesId == cartype)) {
if (!item.vehicleSeriesConfigs || (item.vehicleSeriesConfigs && item.vehicleSeriesConfigs.some(ele => ele.vehicleSeriesId == cartype))) {
_list.push(item)
} else {
if (this.autoPackageCodeList.includes(item.packageCode)) {
......
......@@ -31,7 +31,7 @@
</GLTable>
</div>
</div>
<div slot="skuContent" class="skuContent">
<div slot="specificationDetailList" class="skuContent">
<div class="add-btns">
<el-button v-if="routeInfo.type != 2" icon="el-icon-plus" @click="handleSpecsEdit(1)">新增规格</el-button>
<el-button v-if="routeInfo.type != 2" type="text" @click="handleSKuEdit">规格组合管理</el-button>
......@@ -107,10 +107,12 @@ export default {
{ required: true, message: '请输入自定义保障部件', 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'] }]
},
formObj: {
contractList: []
contractList: [],
specificationDetailList: []
},
formData: [
{
......@@ -155,8 +157,8 @@ export default {
},
{
label: '成本管理:',
name: 'skuContent',
addHtml: 'skuContent'
name: 'specificationDetailList',
addHtml: 'specificationDetailList'
}
],
contractTableParams: {
......
......@@ -126,7 +126,7 @@ const TIP_OBJ = {
minPrice: '最小值',
maxPrice: '最大值',
standardSalesCost: '上架成本',
standardShelfCost: '销售成本',
standardShelfCost: '嘀加成本',
priceCoefficient: '价格系数'
}
export default {
......@@ -419,7 +419,7 @@ export default {
salePeriodData.forEach(element => {
let { servicePeriod, standardSalesCost, standardShelfCost } = element
if (this.isEmpty(standardSalesCost) || this.isEmpty(standardShelfCost)) {
throw new Error(`请输入${serviceGrade}规格${servicePeriod}年版的${this.isEmpty(standardSalesCost) ? '销售成本' : '上架成本'}`)
throw new Error(`请输入${serviceGrade}规格${servicePeriod}年版的${this.isEmpty(standardSalesCost) ? '嘀加成本' : '上架成本'}`)
}
})
// 计算/自定义行数据
......@@ -427,13 +427,13 @@ export default {
let { servicePeriod, standardSalesCost, standardShelfCost, salesCost, shelfCost } = element
const it = salePeriodData.find(v => v.servicePeriod == servicePeriod)
if (computeFlag == 0) {
shelfCost = this.calcPrice(it?.standardShelfCost, priceCoefficient) || 0 // 计算后销售成本
shelfCost = this.calcPrice(it?.standardShelfCost, priceCoefficient) || 0 // 计算后嘀加成本
salesCost = this.calcPrice(it?.standardSalesCost, priceCoefficient) || 0 // 计算后上架成本
}
if (this.isEmpty(salesCost) || this.isEmpty(shelfCost)) {
throw new Error(`请输入${serviceGrade}规格${servicePeriod}年版的${this.isEmpty(salesCost) ? '销售成本' : '上架成本'}`)
throw new Error(`请输入${serviceGrade}规格${servicePeriod}年版的${this.isEmpty(salesCost) ? '嘀加成本' : '上架成本'}`)
}
standardSalesCost = NP.times(it?.standardSalesCost || 0, 100) // 标准销售成本
standardSalesCost = NP.times(it?.standardSalesCost || 0, 100) // 标准嘀加成本
standardShelfCost = NP.times(it?.standardShelfCost || 0, 100) // 标准上架成本
let min_price = NP.times(minPrice || 0, 1000000)
let max_price = NP.times(maxPrice || 0, 1000000)
......
......@@ -7,7 +7,7 @@
<th rowspan="2">是否计算</th>
<th rowspan="2">价格系数</th>
<th colspan="2" v-for="(item, index) in tableData.salePeriodData" :key="index">{{ item.servicePeriod }}年版</th>
<th rowspan="2" style="white-space: nowrap;">操作</th>
<th rowspan="2" style="white-space: nowrap">操作</th>
</tr>
<tr>
<template v-for="(item, index) in tableData.salePeriodData">
......@@ -18,7 +18,7 @@
</el-tooltip> -->
</th>
<th :key="index">
销售成本
滴加成本
<!-- <el-tooltip class="item" effect="dark" content="提示待运营提供" placement="top">
<img class="tip" :src="require('@/assets/tip.png')" />
</el-tooltip> -->
......@@ -154,7 +154,7 @@ export default {
.replace(new RegExp(`^(\\-)*(\\d+)\\.(\\d{${decimal}}).*`, 'g'), '$1$2.$3')
: ''
},
changeComputeFlag(e, item) {
changeComputeFlag(e, item) {
if (e == 1) {
item?.childSalePeriodData?.forEach(ele => {
ele.shelfCost = ''
......@@ -190,7 +190,7 @@ export default {
// 获取最后一个的最大价格赋值到新增的最小价格
const minPrice = this.tableData.gradeConfigList[this.tableData.gradeConfigList.length - 1].maxPrice
const arr = this.tableData.salePeriodData.map(item => {
return { servicePeriod: item.servicePeriod, standardShelfCost: '', standardSalesCost: '', shelfCost: '', salesCost: ''}
return { servicePeriod: item.servicePeriod, standardShelfCost: '', standardSalesCost: '', shelfCost: '', salesCost: '' }
})
let sectionItem = {
servicePeriod: '',
......
......@@ -3,13 +3,13 @@
<div class="input-number-range" :class="{ 'is-disabled': disabled }">
<div class="flex">
<div class="from">
<el-input ref="input_from" v-model="userInputForm" :disabled="disabled" placeholder="最小值" @keyup.enter.native="handleBlurFrom" @blur="handleBlurFrom" @focus="handleFocusFrom" @input="handleInputFrom" @change="handleInputChangeFrom"></el-input>
<el-input ref="input_from" v-model="userInputForm" :disabled="disabled" placeholder="最小值" @keyup.enter.native="handleBlurFrom" @blur="handleBlurFrom" @focus="handleFocusFrom" @input="handleInputChangeFrom" @change="handleInputChangeFromChange"></el-input>
</div>
<div class="center">
<span>-</span>
</div>
<div class="to from">
<el-input ref="input_to" v-model="userInputTo" :disabled="disabled" placeholder="最大值" @keyup.enter.native="handleBlurTo" @blur="handleBlurTo" @focus="handleFocusTo" @input="handleInputTo" @change="handleInputChangeTo"></el-input>
<el-input ref="input_to" v-model="userInputTo" :disabled="disabled" placeholder="最大值" @keyup.enter.native="handleBlurTo" @blur="handleBlurTo" @focus="handleFocusTo" @input="handleInputChangeTo" @change="handleInputChangeToChange"></el-input>
</div>
</div>
</div>
......@@ -95,16 +95,11 @@ export default {
},
handleBlurTo(event) {
this.confirm()
this.$emit('blurto', event)
},
handleFocusTo(event) {
this.$emit('focusto', event)
},
handleFocusTo(event) {},
handleInputFrom(value) {
this.$emit('inputfrom', value)
},
handleInputFrom(value) {},
handleInputTo(value) {
this.$emit('inputto', value)
......@@ -112,51 +107,28 @@ export default {
// from输入框change事件
handleInputChangeFrom(value) {
// 如果是非数字空返回null
if (isNaN(value) || value === '') {
this.$emit('input', [null, this.userInputTo])
this.$emit('changefrom', this.userInputForm)
return
}
// 初始化数字精度
this.userInputForm = this.setPrecisionValue(value)
this.userInputForm = value.replace(/^(100|[1-9]?\d)(\.\d{0,2})?.*$/, '$1$2')
},
// 如果from > to 将from值替换成to
if (typeof this.userInputTo === 'number') {
this.userInputForm = parseFloat(this.userInputForm) <= parseFloat(this.userInputTo) ? this.userInputForm : this.userInputTo
handleInputChangeFromChange() {
// 看一下this.userInputTo 是否有值,如果有应该比它小
if (this.userInputTo) {
console.log('this.userInputTo', this.userInputTo, this.userInputForm, this.userInputTo < this.userInputForm)
if (parseInt(this.userInputTo) < parseInt(this.userInputForm)) {
this.userInputForm = this.userInputTo
}
}
this.$emit('input', [this.userInputForm, this.userInputTo])
this.$emit('changefrom', this.userInputForm)
},
// to输入框change事件
handleInputChangeTo(value) {
// 如果是非数字空返回null
if (isNaN(value) || value === '') {
this.$emit('input', [this.userInputForm, null])
this.$emit('changefrom', this.userInputTo)
return
}
// 初始化数字精度
this.userInputTo = this.setPrecisionValue(value)
// 如果to < tfrom 将to值替换成from
if (typeof this.userInputForm === 'number') {
this.userInputTo = parseFloat(this.userInputTo) >= parseFloat(this.userInputForm) ? this.userInputTo : this.userInputForm
}
this.$emit('input', [this.userInputForm, this.userInputTo])
this.$emit('changeto', this.userInputTo)
this.userInputTo = value.replace(/^(100|[1-9]?\d)(\.\d{0,2})?.*$/, '$1$2')
},
// 设置成精度数字
setPrecisionValue(value) {
if (this.precision !== undefined) {
const val = this.toPrecision(value, this.precision)
return val
handleInputChangeToChange() {
// 看一下this.userInputForm 是否有值,如果有应该比它大
if (parseInt(this.userInputTo) < parseInt(this.userInputForm)) {
this.userInputTo = this.userInputForm
}
return null
}
}
}
......
......@@ -74,7 +74,8 @@
</el-input>
</td>
<td>
<el-select placeholder="车型" :disabled="routeInfo.type == 2" size="small" multiple collapse-tags :class="{ 'w-200-per': true }" style="width: 200px" v-model="subItem.seriesConfigList" @focus="carTypeSelect(false, subItem)" value-key="seriesId">
<!-- style="width: 200px" -->
<el-select ref="chooseProjectName" placeholder="车型" :disabled="routeInfo.type == 2" size="small" multiple collapse-tags :class="{ 'w-200-per': false }" v-model="subItem.seriesConfigList" @focus="carTypeSelect(false, subItem, subIndex)" value-key="seriesId">
<el-option v-for="item in subItem.seriesConfigList" :key="item.vehicleSeriesId" :label="item.vehicleSeriesName" :value="item"></el-option>
</el-select>
</td>
......@@ -88,10 +89,8 @@
<div style="margin-top: 10px">
共
<span class="tip-text">{{ goodsInfoData.goodsSpecificationList.length }}</span>
<span class="tip-text">{{ filterStatus.length }}</span>
件规格商品。
<!-- 价格区间 -->
<!-- <span class="tip-text">¥{{ minPrice }}~{{ maxPrice }}</span> -->
</div>
</div>
</div>
......@@ -264,7 +263,8 @@ export default {
watch: {
specificationVisible: {
handler() {
;(this.isChange = false), (this.spescInputVal = '')
this.isChange = false
this.spescInputVal = ''
},
deep: true
}
......@@ -304,7 +304,7 @@ export default {
methods: {
...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
// 打开门店弹窗或者品牌弹窗
carTypeSelect(type = false, item) {
carTypeSelect(type = false, item, rowindex) {
// if (this.formData.showMerchant == 1) {
// this.brandVisible = true
// } else {
......@@ -315,6 +315,12 @@ export default {
// }
console.log('type', item)
// 阻止下拉框弹出
let _this = this
console.log(_this.$refs.chooseProjectName[rowindex])
_this.$refs.chooseProjectName[rowindex].blur()
if (!type) {
this.carSelectName = item.specsValueList
this.storeSelected = deepClone(item.seriesConfigList || [])
......@@ -471,6 +477,10 @@ export default {
return data instanceof Array ? data.length <= 0 : (data ?? '') === ''
},
handleSpescClose() {
this.$nextTick(() => {
this.$refs['spescRef'].clearValidate()
})
this.specificationVisible = !this.specificationVisible
},
showInput() {
......@@ -567,10 +577,13 @@ export default {
// debugger
// console.log('changeSpecs')
this.computedTableWidth(this.goodsInfoData.goodsType)
const copySpecificationValueList = JSON.parse(JSON.stringify(this.goodsInfoData.upgradeGoodsList))
console.log(this.goodsInfoData, 'goodsInfoData')
const copySpecificationValueList = JSON.parse(JSON.stringify(this.goodsInfoData.goodsSpecificationList))
// const copySpecificationValueList = JSON.parse(JSON.stringify(this.goodsInfoData.goodsSpecificationList))
const copyDetailLength = this.goodsInfoData.goodsSpecificationNameList?.length
const copyDetailData = this.goodsInfoData.goodsSpecificationNameList
this.goodsInfoData.goodsSpecificationList = []
console.log(copySpecificationValueList, 'copySpecificationValueList')
let flag = true
var markIdx = 0
for (var i = 0; i < this.goodsInfoData.specificationDetailList?.length; i++) {
......@@ -603,6 +616,7 @@ export default {
insuranceCost: '', // 投保成本,单位元
shelfCost: '', // 上架成本,单位元
salesCost: '', // salesCost
seriesConfigList: [],
useStatus: 0
})
} else {
......@@ -645,7 +659,7 @@ export default {
this.goodsInfoData.goodsSpecificationList.forEach(item => {
for (var i = 0; i < copySpecificationValueList.length; i++) {
var temp = copySpecificationValueList[i]
console.log(flag, !restData, '!restData')
console.log(flag, !restData, temp.specificationData, item.specsValueList.join(';~;'), '!restData')
if (temp.specificationData == item.specsValueList.join(';~;') && flag && !restData) {
item.id = temp.id ? temp.id : ''
// item.upgradePrice = this.equitySceneType.includes(this.goodsInfoData.goodsType) && this.baseConfig.supplierCode.includes(`${this.goodsInfoData.supplierCode}`) ? 0 : temp.upgradePrice
......@@ -666,6 +680,7 @@ export default {
item.shelfCost = temp.shelfCost
item.salesCost = temp.salesCost
item.useStatus = temp.useStatus
item.seriesConfigList = temp.seriesConfigList
break
}
}
......@@ -810,7 +825,7 @@ export default {
// subItem.salesCost) && subItem.salesCostEmpty
newValue = newValue.replace(/[^\d.]/g, '')
let oldValue = `${this.goodsInfoData.goodsSpecificationList[index]['oldsalesCost']}`
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'salesCost', limitPrice(newValue, oldValue, 3, 1, 0))
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'salesCost', limitPrice(newValue, oldValue, 20, 2, 0))
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'oldsalesCost', this.goodsInfoData.goodsSpecificationList[index]['salesCost'])
},
handlePurchasePriceBlur(e, index) {
......@@ -836,7 +851,7 @@ export default {
// subItem.shelfCost) && subItem.salesCostEmpty
newValue = newValue.replace(/[^\d.]/g, '')
let oldValue = `${this.goodsInfoData.goodsSpecificationList[index]['oldshelfCost']}`
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'shelfCost', limitPrice(newValue, oldValue, 3, 1, 0))
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'shelfCost', limitPrice(newValue, oldValue, 20, 2, 0))
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'oldshelfCost', this.goodsInfoData.goodsSpecificationList[index]['shelfCost'])
},
handleWarrantyPeriodBlur(e, index) {
......@@ -858,7 +873,7 @@ export default {
handleKilometersInput(newValue, index) {
newValue = newValue.replace(/[^\d.]/g, '')
let oldValue = this.goodsInfoData.goodsSpecificationList[index]['oldInsuranceCost'] ? `${this.goodsInfoData.goodsSpecificationList[index]['oldInsuranceCost']}` : ''
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'insuranceCost', limitPrice(newValue, oldValue, 3, 0, 0, 100))
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'insuranceCost', limitPrice(newValue, oldValue, 20, 2, 0))
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'oldInsuranceCost', this.goodsInfoData.goodsSpecificationList[index]['insuranceCost'])
},
handleKilometersBlur(e, index) {
......@@ -993,10 +1008,10 @@ export default {
overflow-y: overlay;
}
}
.input-new-tag {
width: 90px !important;
vertical-align: bottom;
}
}
.input-new-tag {
width: 90px !important;
vertical-align: bottom;
}
.selectOpt {
margin-top: 10px;
......
......@@ -34,6 +34,11 @@
</el-table-column>
</el-table>
</div>
<div style="margin-top: 10px">
共
<span class="tip-text">{{ tableData.length }}</span>
件规格商品。
</div>
</div>
</d2-dialog>
</template>
......@@ -135,6 +140,7 @@ export default {
}
})
})
this.$message.success('启用成功')
},
handleRelateStop() {
if (!this.selectedData.length) {
......@@ -147,6 +153,7 @@ export default {
}
})
})
this.$message.success('禁用成功')
},
clickSwitch(row, val) {},
recoverySelection() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!