Commit 50740eed authored by yaya's avatar yaya

feat:发布拍品,添加loading

parent 890a55be
......@@ -290,6 +290,13 @@ export default {
} else {
this.goods.images = ''
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.$refs.goods.validate((valid) => {
if (valid) {
if (this.numType === -1) {
......@@ -298,6 +305,9 @@ export default {
if (this.id) {
updateSale(this.goods)
.then(response => {
if (loading) {
loading.close()
}
this.$notify.success({
title: '成功',
message: '编辑成功'
......@@ -305,6 +315,9 @@ export default {
this.$router.push({ path: '/sale/saleList' })
})
.catch(response => {
if (loading) {
loading.close()
}
this.goods.images = this.goods.images.split(';') || []
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
......@@ -314,6 +327,9 @@ export default {
} else {
createSale(this.goods)
.then(response => {
if (loading) {
loading.close()
}
this.$notify.success({
title: '成功',
message: '创建成功'
......@@ -321,6 +337,9 @@ export default {
this.$router.push({ path: '/sale/saleList' })
})
.catch(response => {
if (loading) {
loading.close()
}
this.goods.images = this.goods.images.split(';') || []
MessageBox.alert('业务错误:' + response.data.errmsg || '请求失败,请重试', '警告', {
confirmButtonText: '确定',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment