diff --git a/litemall-admin/src/views/config/express.vue b/litemall-admin/src/views/config/express.vue index 6fc85237..5e3d59fa 100644 --- a/litemall-admin/src/views/config/express.vue +++ b/litemall-admin/src/views/config/express.vue @@ -50,18 +50,21 @@ export default { update() { this.$refs['dataForm'].validate((valid) => { if (!valid) { - return + return false } - updateExpress(this.dataForm).then(response => { - this.$notify.success({ - title: '成功', - message: '运费配置修改成功' - }) - }).catch(response => { - this.$notify.error({ - title: '失败', - message: response.data.errmsg - }) + this.doUpdate() + }) + }, + doUpdate() { + updateExpress(this.dataForm).then(response => { + this.$notify.success({ + title: '成功', + message: '运费配置修改成功' + }) + }).catch(response => { + this.$notify.error({ + title: '失败', + message: response.data.errmsg }) }) } diff --git a/litemall-admin/src/views/config/mall.vue b/litemall-admin/src/views/config/mall.vue index f6c4fc52..d14abd6a 100644 --- a/litemall-admin/src/views/config/mall.vue +++ b/litemall-admin/src/views/config/mall.vue @@ -33,6 +33,20 @@ export default { litemall_mall_address: '', litemall_mall_phone: '', litemall_mall_qq: '' + }, + rules: { + litemall_mall_name: [ + { required: true, message: '不能为空', trigger: 'blur' } + ], + litemall_mall_address: [ + { required: true, message: '不能为空', trigger: 'blur' } + ], + litemall_mall_phone: [ + { required: true, message: '不能为空', trigger: 'blur' } + ], + litemall_mall_qq: [ + { required: true, message: '不能为空', trigger: 'blur' } + ] } } }, @@ -49,6 +63,14 @@ export default { this.init() }, update() { + this.$refs['dataForm'].validate((valid) => { + if (!valid) { + return false + } + this.doUpdate() + }) + }, + doUpdate() { updateMall(this.dataForm) .then(response => { this.$notify.success({ diff --git a/litemall-admin/src/views/config/order.vue b/litemall-admin/src/views/config/order.vue index 329e11ec..2297a298 100644 --- a/litemall-admin/src/views/config/order.vue +++ b/litemall-admin/src/views/config/order.vue @@ -34,7 +34,22 @@ export default { name: 'ConfigOrder', data() { return { - dataForm: {} + dataForm: { + litemall_order_unpaid: 0, + litemall_order_unconfirm: 0, + litemall_order_comment: 0 + }, + rules: { + litemall_order_unpaid: [ + { required: true, message: '不能为空', trigger: 'blur' } + ], + litemall_order_unconfirm: [ + { required: true, message: '不能为空', trigger: 'blur' } + ], + litemall_order_comment: [ + { required: true, message: '不能为空', trigger: 'blur' } + ] + } } }, created() { @@ -50,6 +65,14 @@ export default { this.init() }, update() { + this.$refs['dataForm'].validate((valid) => { + if (!valid) { + return false + } + this.doUpdate() + }) + }, + doUpdate() { updateOrder(this.dataForm) .then(response => { this.$notify.success({ diff --git a/litemall-admin/src/views/config/wx.vue b/litemall-admin/src/views/config/wx.vue index 70099e3a..ee755b5c 100644 --- a/litemall-admin/src/views/config/wx.vue +++ b/litemall-admin/src/views/config/wx.vue @@ -5,9 +5,7 @@ :rules="rules" :model="dataForm" status-icon - label-width="300px" - - > + label-width="300px"> @@ -51,7 +49,35 @@ export default { name: 'ConfigWx', data() { return { - dataForm: { } + dataForm: { + litemall_wx_index_new: 0, + litemall_wx_index_hot: 0, + litemall_wx_index_brand: 0, + litemall_wx_index_topic: 0, + litemall_wx_catlog_list: 0, + litemall_wx_catlog_goods: 0, + litemall_wx_share: false + }, + rules: { + litemall_wx_index_new: [ + { required: true, message: '不能为空', trigger: 'blur' } + ], + litemall_wx_index_hot: [ + { required: true, message: '不能为空', trigger: 'blur' } + ], + litemall_wx_index_brand: [ + { required: true, message: '不能为空', trigger: 'blur' } + ], + litemall_wx_index_topic: [ + { required: true, message: '不能为空', trigger: 'blur' } + ], + litemall_wx_catlog_list: [ + { required: true, message: '不能为空', trigger: 'blur' } + ], + litemall_wx_catlog_goods: [ + { required: true, message: '不能为空', trigger: 'blur' } + ] + } } }, created() { @@ -67,6 +93,14 @@ export default { this.init() }, update() { + this.$refs['dataForm'].validate((valid) => { + if (!valid) { + return false + } + this.doUpdate() + }) + }, + doUpdate() { updateWx(this.dataForm) .then(response => { this.$notify.success({