|
@@ -107,11 +107,10 @@
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="内容" prop="content"
|
|
|
:rules="[
|
|
|
- {required: true, message:'内容不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
<WangEditor ref="contentEditor" v-model="inputForm.content" @getUrl="(url, lsUrl) => {
|
|
|
inputForm.editorFilesDTOList.push({temporaryUrl: lsUrl, url: url})
|
|
|
- }"/>
|
|
|
+ }" @change="changeEditor"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -221,7 +220,7 @@
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
|
|
|
- <el-button size="small" v-if="method === 'edit'" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
|
|
|
+ <el-button size="small" v-if="method === 'edit'" type="primary" icon="el-icon-circle-check" @click="doSubmitBefore()">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -434,67 +433,69 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ doSubmitBefore () {
|
|
|
+ if (this.inputForm.status === '5') {
|
|
|
+ this.$confirm(`修改后会重新发起通告,确定修改数据吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.doSubmit()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.doSubmit()
|
|
|
+ }
|
|
|
+ },
|
|
|
// 表单提交
|
|
|
doSubmit () {
|
|
|
- this.$confirm(`修改后会重新发起通告,确定修改数据吗?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.$refs['inputForm'].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.loading = true
|
|
|
- if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
- this.loading = false
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.pluginNotifyOfficesDTOList) && this.commonJS.isEmpty(this.inputForm.pluginNotifyUserDTOList)) {
|
|
|
- this.$message.error('通告范围(部门或成员),至少填写一项')
|
|
|
- this.loading = false
|
|
|
- throw new Error('通告范围(部门或成员),至少填写一项')
|
|
|
- }
|
|
|
- this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
|
|
|
- if (this.commonJS.isNotEmpty(this.inputForm.dates)) {
|
|
|
- this.inputForm.beginDate = this.inputForm.dates[0]
|
|
|
- this.inputForm.endDate = this.inputForm.dates[1]
|
|
|
- if (this.commonJS.isNotEmpty(this.inputForm.beginDate) && this.commonJS.isNotEmpty(this.inputForm.endDate)) {
|
|
|
- if (this.inputForm.beginDate === this.inputForm.endDate) {
|
|
|
- if (this.inputForm.notifyType === '0') {
|
|
|
- this.$message.error('通告起止时间不可以相同')
|
|
|
- this.loading = false
|
|
|
- throw new Error('通告起止时间不可以相同')
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
+ this.$refs['inputForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.pluginNotifyOfficesDTOList) && this.commonJS.isEmpty(this.inputForm.pluginNotifyUserDTOList)) {
|
|
|
+ this.$message.error('通告范围(部门或成员),至少填写一项')
|
|
|
+ this.loading = false
|
|
|
+ throw new Error('通告范围(部门或成员),至少填写一项')
|
|
|
+ }
|
|
|
+ this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.dates)) {
|
|
|
+ this.inputForm.beginDate = this.inputForm.dates[0]
|
|
|
+ this.inputForm.endDate = this.inputForm.dates[1]
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.beginDate) && this.commonJS.isNotEmpty(this.inputForm.endDate)) {
|
|
|
+ if (this.inputForm.beginDate === this.inputForm.endDate) {
|
|
|
if (this.inputForm.notifyType === '0') {
|
|
|
- this.$message.error('请填写通告时间')
|
|
|
+ this.$message.error('通告起止时间不可以相同')
|
|
|
this.loading = false
|
|
|
- throw new Error('请填写通告时间')
|
|
|
+ throw new Error('通告起止时间不可以相同')
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- this.inputForm.beginDate = ''
|
|
|
- this.inputForm.endDate = ''
|
|
|
if (this.inputForm.notifyType === '0') {
|
|
|
this.$message.error('请填写通告时间')
|
|
|
this.loading = false
|
|
|
throw new Error('请填写通告时间')
|
|
|
}
|
|
|
}
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.content)) {
|
|
|
- this.$message.error('请填写内容')
|
|
|
+ } else {
|
|
|
+ this.inputForm.beginDate = ''
|
|
|
+ this.inputForm.endDate = ''
|
|
|
+ if (this.inputForm.notifyType === '0') {
|
|
|
+ this.$message.error('请填写通告时间')
|
|
|
this.loading = false
|
|
|
- throw new Error('请填写内容')
|
|
|
+ throw new Error('请填写通告时间')
|
|
|
}
|
|
|
- this.getEditorFilesDTOList()
|
|
|
- this.notifyService.saveForm(this.inputForm).then(({data}) => {
|
|
|
- this.loading = false
|
|
|
- this.close()
|
|
|
- }).catch(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
}
|
|
|
- })
|
|
|
+ this.getEditorFilesDTOList()
|
|
|
+ this.notifyService.saveForm(this.inputForm).then(({data}) => {
|
|
|
+ this.loading = false
|
|
|
+ this.close()
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
close () {
|
|
@@ -542,24 +543,17 @@
|
|
|
getEditorFilesDTOList () {
|
|
|
let a = []
|
|
|
if (this.commonJS.isNotEmpty(this.inputForm.editorFilesDTOList)) {
|
|
|
- this.inputForm.content = this.inputForm.content.replace(/&/, '&')
|
|
|
- console.log('content', this.inputForm.content)
|
|
|
- console.log('editorFilesDTOList', this.inputForm.editorFilesDTOList)
|
|
|
+ this.inputForm.content = this.inputForm.content.replace(/&/g, '&')
|
|
|
this.inputForm.editorFilesDTOList.forEach((item) => {
|
|
|
- console.log('尽')
|
|
|
if (this.inputForm.content.includes(item.temporaryUrl)) {
|
|
|
a.push(item)
|
|
|
- console.log('a', a)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
- this.inputForm.editorFilesDTOList = []
|
|
|
- a.forEach((item) => {
|
|
|
- console.log('editorFilesDTOList', this.inputForm.editorFilesDTOList)
|
|
|
- this.inputForm.editorFilesDTOList.push(item)
|
|
|
- })
|
|
|
- }, 200)
|
|
|
+ this.inputForm.editorFilesDTOList = []
|
|
|
+ a.forEach((item) => {
|
|
|
+ this.inputForm.editorFilesDTOList.push(item)
|
|
|
+ })
|
|
|
},
|
|
|
openOfficeChoose () {
|
|
|
this.$refs.officeTreeSelect.init()
|
|
@@ -661,6 +655,9 @@
|
|
|
this.notifyService.delComment(id).then(() => {
|
|
|
this.init(this.method, this.inputForm.id)
|
|
|
})
|
|
|
+ },
|
|
|
+ changeEditor (cont) {
|
|
|
+ this.inputForm.content = cont
|
|
|
}
|
|
|
}
|
|
|
}
|