Commit 5ae00dc2 by zhangxw

bug修复

1 parent b1d21472
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<th><span class="required">*</span>套餐类型</th> <th><span class="required">*</span>套餐类型</th>
<th><span class="required">*</span>套餐名称</th> <th><span class="required">*</span>套餐名称</th>
<th><span class="required">*</span>套餐内容</th> <th><span class="required">*</span>套餐内容</th>
<th><span class="required">*</span>价格</th> <th><span class="required">*</span>价格/元</th>
<th><span class="required">*</span>套餐简介</th> <th><span class="required">*</span>套餐简介</th>
<th><span class="required">*</span>话术介绍</th> <th><span class="required">*</span>话术介绍</th>
<th>操作</th> <th>操作</th>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
class="price-input" class="price-input"
@input="priceInput($event, pindex, 'marketPrice')" @input="priceInput($event, pindex, 'marketPrice')"
v-model="pItem.marketPrice" v-model="pItem.marketPrice"
placeholder="请输入价格" placeholder="请输入"
></el-input> ></el-input>
</div> </div>
<div> <div>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
class="price-input" class="price-input"
@input="priceInput($event, pindex, 'packagePrice')" @input="priceInput($event, pindex, 'packagePrice')"
v-model="pItem.packagePrice" v-model="pItem.packagePrice"
placeholder="请输入价格" placeholder="请输入"
></el-input> ></el-input>
</div> </div>
<div> <div>
...@@ -124,6 +124,7 @@ ...@@ -124,6 +124,7 @@
import { limitPrice } from '@/common/format' import { limitPrice } from '@/common/format'
import BigNumber from 'bignumber.js' import BigNumber from 'bignumber.js'
import { packageRecommendDetail, updatePackageRecommend } from '@api/contentManager' import { packageRecommendDetail, updatePackageRecommend } from '@api/contentManager'
import { deepClone } from "@/common/util"
export default{ export default{
name: 'PackageRecommend', name: 'PackageRecommend',
props: { props: {
...@@ -168,7 +169,7 @@ export default{ ...@@ -168,7 +169,7 @@ export default{
}) })
}, },
initFormData() { initFormData() {
this.infoList = [this.initObj] this.infoList = [deepClone(this.initObj)]
}, },
priceInput(newValue, index, key) { priceInput(newValue, index, key) {
newValue = newValue.replace(/[^\d.]/g, '') newValue = newValue.replace(/[^\d.]/g, '')
...@@ -184,7 +185,7 @@ export default{ ...@@ -184,7 +185,7 @@ export default{
}, },
// 新增一行 // 新增一行
handleAdd(i) { handleAdd(i) {
if (i < 0) return this.infoList.push(this.initObj) if (i < 0) return this.infoList.push(deepClone(this.initObj))
if (this.infoList?.length >= 10) return this.$message.error('最多支持新增10个套餐') if (this.infoList?.length >= 10) return this.$message.error('最多支持新增10个套餐')
const result = this.validateForm(i) const result = this.validateForm(i)
if (result) this.infoList.push(result) if (result) this.infoList.push(result)
...@@ -228,7 +229,7 @@ export default{ ...@@ -228,7 +229,7 @@ export default{
this.$message.error(`${this.infoList[i]?.name}优惠金额≤0,请核实后重新录入`) this.$message.error(`${this.infoList[i]?.name}优惠金额≤0,请核实后重新录入`)
return false return false
} }
return this.initObj return deepClone(this.initObj)
}, },
handleDel(i) { handleDel(i) {
this.infoList.splice(i, 1) this.infoList.splice(i, 1)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!