Browse Source

【PC端】群通知违规校验逻辑修改-王公峰-2020-08-05

master
wanggongfeng 5 years ago
parent
commit
290140ec8e
  1. 35
      src/views/modules/master/masternotice-add-or-update.vue

35
src/views/modules/master/masternotice-add-or-update.vue

@ -50,12 +50,14 @@ export default {
createdTime: '', createdTime: '',
updatedBy: '', updatedBy: '',
updatedTime: '', updatedTime: '',
fileList: '' fileList: '',
isConReview: false
}, },
url: '', url: '',
num: 0, num: 0,
fileList: [], fileList: [],
btnAble: false btnAble: false,
isFirst: true
} }
}, },
computed: { computed: {
@ -72,8 +74,10 @@ export default {
}, },
methods: { methods: {
init () { init () {
this.btnAble = false this.dataForm.isConReview = false
this.isFirst = true
this.visible = true this.visible = true
this.btnAble = false
this.url = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` this.url = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.num = 0 this.num = 0
this.fileList = [] this.fileList = []
@ -98,14 +102,32 @@ export default {
}, },
// //
dataFormSubmitHandle: debounce(function () { dataFormSubmitHandle: debounce(function () {
this.btnAble = true
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
this.btnAble = false
return false return false
} }
this.btnAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/cloudAnalysis/masternotice/', this.dataForm).then(({ data: res }) => { this.$http[!this.dataForm.id ? 'post' : 'put']('/cloudAnalysis/masternotice/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) { if (!this.isFirst && res.code === 533) {
//
this.$confirm('您提交的内容再次被判定为违规, 是否继续提交?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
}).then(() => {
this.dataForm.isConReview = true
//
this.dataFormSubmitHandle()
}).catch(() => {
this.btnAble = false
})
return false
} else if (res.code === 533) {
this.isFirst = false
this.btnAble = false
return this.$message.error(res.msg)
} else if (res.code !== 0) {
this.btnAble = false
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.$message({ this.$message({
@ -114,7 +136,6 @@ export default {
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.btnAble = false
this.$emit('refreshDataList') this.$emit('refreshDataList')
} }
}) })

Loading…
Cancel
Save