Commit 5b6a0192 authored by huai.li's avatar huai.li

修复关闭弹窗不清空表单的问题

parent f55f2fd3
......@@ -25,5 +25,9 @@ export default {
deleteDoc: {
url: '/vue/document/delete'
},
getDocType: {
url: '/vue/document/get-document-type'
}
}
......@@ -102,8 +102,8 @@ export default {
},
created () {
this.$watch('model.task_group_id', function (val) {
this.getHeadOfArray(val)
this.$watch('model.department_id', function (val) {
this.getDocTypeArray(val)
})
},
......@@ -134,11 +134,11 @@ export default {
this.$refs['form'].resetFields()
},
getHeadOfArray (id) {
requestAPI(api.getMembersById, {
getDocTypeArray (id) {
requestAPI(api.getDocType, {
id: id
}).then(res => {
this.options.headOfArray = res
this.options.documentTypeArray = res
})
}
}
......
<template>
<section>
<sidePopup ref="sidePopup" title="新建文档" :width="50">
<sidePopup ref="sidePopup" title="新建文档" :width="50" @update:close="() => btnClose()">
<DocumentForm
ref="docForm"
:model="model">
......@@ -62,6 +62,10 @@ export default {
})
},
btnClose () {
this.$refs.docForm._resetFields()
},
save () {
let _params = Object.assign({}, setModule(this.model, 'Documents'))
let _apiUrl = !this.model.id ? api.saveDocNew : api.saveDocEdit
......
......@@ -60,7 +60,6 @@ export default {
},
btnClose () {
debugger
Object.keys(this.model).forEach(item => {
this.model[item] = ''
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment