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

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

parent f55f2fd3
...@@ -25,5 +25,9 @@ export default { ...@@ -25,5 +25,9 @@ export default {
deleteDoc: { deleteDoc: {
url: '/vue/document/delete' url: '/vue/document/delete'
},
getDocType: {
url: '/vue/document/get-document-type'
} }
} }
...@@ -102,8 +102,8 @@ export default { ...@@ -102,8 +102,8 @@ export default {
}, },
created () { created () {
this.$watch('model.task_group_id', function (val) { this.$watch('model.department_id', function (val) {
this.getHeadOfArray(val) this.getDocTypeArray(val)
}) })
}, },
...@@ -134,11 +134,11 @@ export default { ...@@ -134,11 +134,11 @@ export default {
this.$refs['form'].resetFields() this.$refs['form'].resetFields()
}, },
getHeadOfArray (id) { getDocTypeArray (id) {
requestAPI(api.getMembersById, { requestAPI(api.getDocType, {
id: id id: id
}).then(res => { }).then(res => {
this.options.headOfArray = res this.options.documentTypeArray = res
}) })
} }
} }
......
<template> <template>
<section> <section>
<sidePopup ref="sidePopup" title="新建文档" :width="50"> <sidePopup ref="sidePopup" title="新建文档" :width="50" @update:close="() => btnClose()">
<DocumentForm <DocumentForm
ref="docForm" ref="docForm"
:model="model"> :model="model">
...@@ -62,6 +62,10 @@ export default { ...@@ -62,6 +62,10 @@ export default {
}) })
}, },
btnClose () {
this.$refs.docForm._resetFields()
},
save () { save () {
let _params = Object.assign({}, setModule(this.model, 'Documents')) let _params = Object.assign({}, setModule(this.model, 'Documents'))
let _apiUrl = !this.model.id ? api.saveDocNew : api.saveDocEdit let _apiUrl = !this.model.id ? api.saveDocNew : api.saveDocEdit
......
...@@ -60,7 +60,6 @@ export default { ...@@ -60,7 +60,6 @@ export default {
}, },
btnClose () { btnClose () {
debugger
Object.keys(this.model).forEach(item => { Object.keys(this.model).forEach(item => {
this.model[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