Commit 3edb5a5e by 李伟康

修复BUG

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