Commit 1c7d0142 authored by yaya's avatar yaya

bugfix

parent 73d499c5
......@@ -260,7 +260,6 @@ export default {
* 保存
*/
handleSave() {
debugger
if (this.goods.images.length === 0) {
this.$message({
type: 'error',
......@@ -282,9 +281,10 @@ export default {
})
return
}
const imageList = [...this.goods.images]
if (this.itemImages) {
this.goods.images = this.goods.images.join(';')
if (this.goods.images) {
if (typeof this.goods.images !== 'string') {
this.goods.images = this.goods.images.join(';')
}
} else {
this.goods.images = ''
}
......@@ -303,7 +303,7 @@ export default {
this.$router.push({ path: '/sale/saleList' })
})
.catch(response => {
this.goods.images = imageList
this.goods.images = this.goods.images.split(';') || []
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
......@@ -319,8 +319,8 @@ export default {
this.$router.push({ path: '/sale/saleList' })
})
.catch(response => {
this.goods.images = imageList
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
this.goods.images = this.goods.images.split(';') || []
MessageBox.alert('业务错误:' + response.data.errmsg || '请求失败,请重试', '警告', {
confirmButtonText: '确定',
type: 'error'
})
......@@ -343,7 +343,7 @@ export default {
uploadOverrun: function() {
this.$message({
type: 'error',
message: '上传文件个数超出限制!最多上传5张图片!'
message: '上传文件个数超出限制!最多上传9张图片!'
})
},
handleGalleryUrl(response, file, fileList) {
......
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