- *
+ *
{{$t('chapterContents')}}
-
+
- *
+ *
{{$t('contentTemplate')}}
-
+
-
-
-
+
+
+
+
@@ -101,14 +108,17 @@
import defaultTemplate from './defaultTemplate'
import solicitOpinions from './solicitOpinions'
import releaseStandard from './releaseStandard'
+ import addModel from './addModel'
import { getAction, postAction, downloadFile } from '@/api/manage'
+ import moment from 'moment'
export default {
name: 'fillAdd',
components: {
defaultTemplate,
solicitOpinions,
- releaseStandard
+ releaseStandard,
+ addModel
},
data() {
return {
@@ -140,7 +150,9 @@
confirmLoading: false,
title: '',
disabled: false,
+ isTrue: false,
chapterContentsList: [],
+ templateDisabled: false,
contentTemplateList: [
{
id: '1',
@@ -165,6 +177,12 @@
mounted() {
},
methods: {
+ bringInStandardInformationClick() {
+ this.$refs.addModelRef.addModel()
+ },
+ addModelForm(value) {
+ this.$refs.defaultTemplateRef.getStandData(value)
+ },
getTree() {
getAction('/report/lawsMonthlyReportTitleTemplateEO/list', {}).then((res) => {
if (res.success) {
@@ -174,37 +192,53 @@
}
})
},
+ dateChange(item) {
+ this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM') : ''
+ this.formInline = { ...this.formInline }
+ },
add() {
+ this.isTrue = false
+ this.templateDisabled = false
this.getTree()
this.title = this.$t('addContent')
this.visible = true
this.disabled = false
+ this.formInline = {}
this.$nextTick(() => {
- this.formInline = {}
this.formInline.contentTemplate = '1'
this.formInline = { ...this.formInline }
+ this.isTrue = true
this.$refs.ruleForm.clearValidate()
})
},
edit(row) {
this.getTree()
+ this.isTrue = false
this.title = this.$t('editContent')
this.visible = true
this.disabled = false
+ this.templateDisabled = true
this.$nextTick(() => {
this.formInline = row
if (this.formInline.memoriesChapter) {
this.formInline.memoriesChapter = this.formInline.memoriesChapter.split(',')
}
+ this.isTrue = true
this.$refs.ruleForm.clearValidate()
})
},
view(row) {
this.title = this.$t('viewContent')
this.visible = true
+ this.isTrue = false
+ this.templateDisabled = true
this.disabled = true
this.$nextTick(() => {
this.formInline = row
+ if (this.formInline.memoriesChapter) {
+ this.formInline.memoriesChapter = this.formInline.memoriesChapter.split(',')
+ }
+ this.isTrue = true
this.$refs.ruleForm.clearValidate()
})
},
@@ -237,17 +271,16 @@
}
})
let query = Object.assign(val, {
- month: JSON.stringify(formInline.month),
+ month: formInline.month,
memoriesChapter: formInline.memoriesChapter,
contentTemplate: formInline.contentTemplate
})
-
postAction(url, query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
- this.$emit('fillTableAddForm')
+ this.$emit('fillAddForm')
} else {
this.confirmLoading = false
this.$message.warning(this.$t('operationFailed'))
@@ -260,7 +293,15 @@
}
}
+