对接法规月报

This commit is contained in:
qq787203167
2022-06-30 09:37:02 +08:00
parent 42067060b4
commit 83f9c20264
3 changed files with 51 additions and 10 deletions
@@ -293,5 +293,7 @@
height: 38px; height: 38px;
/*margin-top: 2px;*/ /*margin-top: 2px;*/
} }
.text-operation {
margin-right: 8px;
}
</style> </style>
@@ -24,7 +24,7 @@
size="middle" size="middle"
:loading="loading" :loading="loading"
:pagination="false" :pagination="false"
:scroll="{x: '100%'}" :scroll="{x: '100%',y:500}"
:data-source="dataSource" :data-source="dataSource"
:columns="columns" :columns="columns"
> >
@@ -104,8 +104,8 @@
mounted() { mounted() {
}, },
methods: { methods: {
edit() { edit(row) {
this.$refs.fillTableAddRef.edit(JSON.parse(JSON.stringify(row)))
}, },
getData() { getData() {
this.visible = true this.visible = true
@@ -130,7 +130,7 @@
pageSize: this.pageSize pageSize: this.pageSize
} }
this.loading = true this.loading = true
getAction('/report/lawsMonthlyReportTitleTemplateEO/list', query).then((res) => { getAction('/report/lawsMonthlyReportTitleTemplateEO/page', query).then((res) => {
if (res.success) { if (res.success) {
if (res.result.current > 1 && res.result.records.length == 0) { if (res.result.current > 1 && res.result.records.length == 0) {
this.pageNo = res.result.current - 1 this.pageNo = res.result.current - 1
@@ -151,8 +151,21 @@
moveDownClick() { moveDownClick() {
}, },
deleteLib() { deleteLib(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
getAction('/report/lawsMonthlyReportTitleTemplateEO/deleteBatch', { ids: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
}
})
}, },
newlyAddedClick() { newlyAddedClick() {
this.$refs.fillTableAddRef.add() this.$refs.fillTableAddRef.add()
@@ -171,4 +184,7 @@
text-align: right; text-align: right;
margin-bottom: 16px; margin-bottom: 16px;
} }
.text-operation {
margin-right: 8px;
}
</style> </style>
@@ -58,6 +58,8 @@
</template> </template>
<script> <script>
import { getAction, postAction } from '@/api/manage'
export default { export default {
name: 'fillTableAdd', name: 'fillTableAdd',
data() { data() {
@@ -66,7 +68,11 @@
confirmLoading: false, confirmLoading: false,
formInline: {}, formInline: {},
rules: {}, rules: {},
title: '' title: '',
url: {
add: '/report/lawsMonthlyReportTitleTemplateEO/add',
edit: '/report/lawsMonthlyReportTitleTemplateEO/edit'
}
} }
}, },
mounted() { mounted() {
@@ -92,7 +98,24 @@
handleOk() { handleOk() {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
this.confirmLoading = true
let url = ''
if (this.formInline.id) {
url = this.url.edit
} else {
url = this.url.add
}
postAction(url, this.formInline).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('fillTableAddForm')
} else {
this.confirmLoading = false
this.$message.warning(this.$t('operationFailed'))
}
})
} }
}) })
}, },
@@ -163,7 +186,7 @@
} }
.title-text { .title-text {
width:100px; width: 100px;
text-align: right; text-align: right;
display: inline-block; display: inline-block;
font-weight: 500; font-weight: 500;