Commit 3edb5a5e by 李伟康

修复BUG

1 parent da8838c0
......@@ -208,7 +208,7 @@ export default {
type: 2,
id: row.id,
status: e
})
}, e == 0 ? '下架' : '上架')
},
handleBlur (row) {
let { salesPrice, InputPrice, sellPrice } = row
......@@ -220,12 +220,12 @@ export default {
if (InputPrice > 1000) InputPrice = 999.99
InputPrice = Number(InputPrice).toFixed(2)
} else throw '销售价需大于等于成本价'
if(!/^\d+(\.\d+)?$/.test(InputPrice)) throw '请输入数字'
if (!/^\d+(\.\d+)?$/.test(InputPrice)) throw '请输入数字'
if (InputPrice != Number(salesPrice)) this.update({
type: 1,
id: row.id,
salesPrice: NP.times(InputPrice, 100)
})
}, '更新销售价')
} catch (error) {
row.InputPrice = salesPrice ? salesPrice : ''
if (error) this.$message.error(error)
......@@ -238,17 +238,17 @@ export default {
type: 0,
id: target.id,
aliasUrl: url
})
}, '更新商品图片')
},
async update (params) {
async update (params, message) {
try {
this.loading = true
const res = await this.$apis.platformGoods.updateOilCoupon(params)
if (res) {
this.loading = false
this.$message.success('更新成功')
this.$message.success(`${message}成功`)
this.handleSearch()
} else throw '更新失败'
} else throw `${message}失败`
} catch (error) {
this.loading = false
if (error) this.$message.error(error)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!