update 树形通过接口获取数据
This commit is contained in:
+17
-18
@@ -29,7 +29,12 @@
|
||||
<script>
|
||||
import AddForm from '../../../../components/customField/AddForm.vue'
|
||||
import { postAction } from '@api/manage'
|
||||
import { getDomesticStandardDocumentInfo, getDomesticStandardFormModal } from '../../../../api/standardRegulationLibraryApi'
|
||||
import {
|
||||
getDomesticStandardDocumentInfo,
|
||||
getDomesticStandardFormModal,
|
||||
addDomesticStandard,
|
||||
editDomesticStandard
|
||||
} from '../../../../api/standardRegulationLibraryApi'
|
||||
|
||||
export default {
|
||||
name: 'DomesticStandardModal',
|
||||
@@ -43,13 +48,7 @@ export default {
|
||||
form: {},
|
||||
confirmLoading: false,
|
||||
getFormFunc: getDomesticStandardFormModal,
|
||||
getDocumentInfoFunc: getDomesticStandardDocumentInfo,
|
||||
url: {
|
||||
getAddForm: '/laws/standard/domestic/getFormModel',
|
||||
getDocumentInfo: '/laws/standard/domestic/getByIdAndModule',
|
||||
add: '/laws/standard/domestic/commonAdd',
|
||||
edit: '/laws/standard/domestic/commonEdit'
|
||||
}
|
||||
getDocumentInfoFunc: getDomesticStandardDocumentInfo
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -61,6 +60,9 @@ export default {
|
||||
},
|
||||
edit (record) {
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addForm.edit(record)
|
||||
})
|
||||
},
|
||||
handleOk () {
|
||||
this.confirmLoading = true
|
||||
@@ -68,20 +70,17 @@ export default {
|
||||
},
|
||||
// 表单提交的回调,获取表单数据
|
||||
submitFormData (formInline) {
|
||||
let url = ''
|
||||
let submitFunc
|
||||
if (formInline.id) {
|
||||
url = this.url.edit
|
||||
submitFunc = editDomesticStandard
|
||||
} else {
|
||||
url = this.url.add
|
||||
submitFunc = addDomesticStandard
|
||||
}
|
||||
postAction(url, formInline).then((res) => {
|
||||
submitFunc(formInline).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
if (this.formInline.id) {
|
||||
this.$emit('ok')
|
||||
} else {
|
||||
this.$emit('ok')
|
||||
}
|
||||
this.$message.success(res.message)
|
||||
this.$emit('ok')
|
||||
this.close()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user