Commit cf28ba38 authored by 高宇's avatar 高宇

修复重置按钮;

parent 27cee777
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
:edit-client="editClient" :edit-client="editClient"
:button-title="buttonTitle" :button-title="buttonTitle"
:key-code="keyCode" :key-code="keyCode"
:reset-form="resetForm"
:buttons="buttons" :buttons="buttons"
:icon="icon" :icon="icon"
:model="model" v-if="type !== ''"></component> :model="model" v-if="type !== ''"></component>
...@@ -43,7 +44,8 @@ ...@@ -43,7 +44,8 @@
'model', 'model',
'keyCode', 'keyCode',
'buttons', 'buttons',
'icon'], 'icon',
'resetForm'],
created () { created () {
} }
} }
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<i class="fa fa-plus faa-pulse animated"></i> {{buttonTitle}} <i class="fa fa-plus faa-pulse animated"></i> {{buttonTitle}}
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="searchKey"> <el-form-item>
<a class="btn"> <a class="btn" @click="resetForm">
<i class="fa fa-fw fa-refresh faa-spin animated-hover"></i> <i class="fa fa-fw fa-refresh faa-spin animated-hover"></i>
</a> </a>
</el-form-item> </el-form-item>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
// this.$emit('update:addNew') // this.$emit('update:addNew')
// } // }
}, },
props: ['model', 'searchKey', 'keyCode', 'buttonTitle', 'searchKeyword', 'addNewUser'], props: ['model', 'searchKey', 'keyCode', 'buttonTitle', 'searchKeyword', 'addNewUser', 'resetForm'],
created () { created () {
} }
} }
......
...@@ -163,6 +163,14 @@ ...@@ -163,6 +163,14 @@
[this.formSearchKey + '[from]']: from, [this.formSearchKey + '[from]']: from,
[this.formSearchKey + '[to]']: to [this.formSearchKey + '[to]']: to
}, this.clientTimeForm, this.clientForm)) }, this.clientTimeForm, this.clientForm))
},
resetForm () {
Object.keys(this.clientForm).forEach(item => {
this.clientForm[item] = ''
})
Object.keys(this.clientTimeRange).forEach(item => {
this.clientTimeRange[item] = ''
})
} }
}, },
mounted () { mounted () {
......
...@@ -184,7 +184,11 @@ ...@@ -184,7 +184,11 @@
this.$refs.sidePopup && this.$refs.sidePopup &&
this.$refs.sidePopup.close() this.$refs.sidePopup.close()
}, },
getList () { updatePage (pager) {
Object.assign(this.pagenation, pager)
this.getList(true)
},
getList (toTop) {
if (this.loading) { if (this.loading) {
return return
} }
...@@ -199,7 +203,9 @@ ...@@ -199,7 +203,9 @@
// this.pagenation.page = res.pagenation.thispage // this.pagenation.page = res.pagenation.thispage
this.totalcount = res.pagenation.totalcount this.totalcount = res.pagenation.totalcount
// this.totalcount = 8 // this.totalcount = 8
if (toTop) {
this.$el.querySelector('.page-body-content').scrollTo(0, 0) this.$el.querySelector('.page-body-content').scrollTo(0, 0)
}
}).finally(_ => { }).finally(_ => {
this.loading = false this.loading = false
}) })
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
key-code="keyword" key-code="keyword"
type="keyword" type="keyword"
button-title="新建销售合同 " button-title="新建销售合同 "
:reset-form="resetForm"
:add-new-user="addNewContract" :add-new-user="addNewContract"
:search-keyword="searchKeyword"></client-header> :search-keyword="searchKeyword"></client-header>
<client-form ref="clientForm" <client-form ref="clientForm"
...@@ -245,7 +246,18 @@ ...@@ -245,7 +246,18 @@
}) })
return list return list
}, },
getList () { resetForm () {
this.$refs.clientForm.resetForm()
Object.keys(this.form).forEach(item => {
this.form[item] = ''
})
this.getList()
},
updatePage (pager) {
Object.assign(this.pagenation, pager)
this.getList(true)
},
getList (toTop) {
if (this.loading) { if (this.loading) {
return return
} }
...@@ -260,7 +272,9 @@ ...@@ -260,7 +272,9 @@
// this.pagenation.page = res.pagenation.thispage // this.pagenation.page = res.pagenation.thispage
this.totalcount = res.pagenation.totalcount this.totalcount = res.pagenation.totalcount
// this.totalcount = 8 // this.totalcount = 8
if (toTop) {
this.$el.querySelector('.page-body-content').scrollTo(0, 0) this.$el.querySelector('.page-body-content').scrollTo(0, 0)
}
}).finally(_ => { }).finally(_ => {
this.loading = false this.loading = false
}) })
......
...@@ -405,7 +405,7 @@ ...@@ -405,7 +405,7 @@
Object.keys(this.files).forEach(item => { Object.keys(this.files).forEach(item => {
this.files[item].name = res.model[item].orig_name this.files[item].name = res.model[item].orig_name
}) })
console.log(this.files) this.singleSearchDisabled = true
}) })
} }
}, },
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
key-code="keyword" key-code="keyword"
type="keyword" type="keyword"
button-title="新建商机 " button-title="新建商机 "
:reset-form="resetForm"
:add-new-user="addNewProject" :add-new-user="addNewProject"
:search-keyword="searchKeyword"></client-header> :search-keyword="searchKeyword"></client-header>
<client-form ref="clientForm" <client-form ref="clientForm"
...@@ -46,7 +47,7 @@ ...@@ -46,7 +47,7 @@
<el-button class="pull-right" <el-button class="pull-right"
type="primary" type="primary"
size="mini" size="mini"
@click="editAnnotation(item)" @click.prevent.stop="editAnnotation(item)"
:disabled="!item.can_update"> :disabled="!item.can_update">
<i class="fa fa-tag"></i> 批注</el-button> <i class="fa fa-tag"></i> 批注</el-button>
<el-button class="pull-right" <el-button class="pull-right"
...@@ -254,11 +255,18 @@ ...@@ -254,11 +255,18 @@
Object.assign(this.form, form) Object.assign(this.form, form)
this.getList() this.getList()
}, },
resetForm () {
this.$refs.clientForm.resetForm()
Object.keys(this.form).forEach(item => {
this.form[item] = ''
})
this.getList()
},
updatePage (pager) { updatePage (pager) {
Object.assign(this.pagenation, pager) Object.assign(this.pagenation, pager)
this.getList() this.getList(true)
}, },
getList () { getList (toTop) {
if (this.loading) { if (this.loading) {
return return
} }
...@@ -273,7 +281,9 @@ ...@@ -273,7 +281,9 @@
// this.pagenation.page = res.pagenation.thispage // this.pagenation.page = res.pagenation.thispage
this.totalcount = res.pagenation.totalcount this.totalcount = res.pagenation.totalcount
// this.totalcount = 8 // this.totalcount = 8
if (toTop) {
this.$el.querySelector('.page-body-content').scrollTo(0, 0) this.$el.querySelector('.page-body-content').scrollTo(0, 0)
}
}).finally(_ => { }).finally(_ => {
this.loading = false this.loading = false
}) })
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
<el-form-item :show-message="false" :error="errorData['client_id'] ? errorData['client_id'] : ''"> <el-form-item :show-message="false" :error="errorData['client_id'] ? errorData['client_id'] : ''">
<single-search-input <single-search-input
:required="true" :required="true"
api="searchSupplierByName"
:form-serch-item="Projects.client_id" :form-serch-item="Projects.client_id"
:form-show-text="searchText" :form-show-text="searchText"
label="客户名称" label="客户名称"
:single-search-disabled="singleSearchDisabled"
@update:searchItem="val => {Projects.client_id = val}"> @update:searchItem="val => {Projects.client_id = val}">
<span slot="formError" class="el-form-item__error"> <span slot="formError" class="el-form-item__error">
{{errorData['client_id']}} {{errorData['client_id']}}
...@@ -282,6 +284,7 @@ ...@@ -282,6 +284,7 @@
contract_type: 0, contract_type: 0,
projectArchitects: [] projectArchitects: []
}, },
singleSearchDisabled: false,
options: { options: {
'Projects[contract_type]': { 'Projects[contract_type]': {
value: [ value: [
...@@ -395,6 +398,7 @@ ...@@ -395,6 +398,7 @@
this.searchText = res.model.client.name this.searchText = res.model.client.name
this.Projects.client_id = res.model.client.key this.Projects.client_id = res.model.client.key
} }
this.singleSearchDisabled = true
}) })
}, },
getFormData () { getFormData () {
......
...@@ -176,6 +176,17 @@ ...@@ -176,6 +176,17 @@
[this.formSearchKey + '[from]']: from, [this.formSearchKey + '[from]']: from,
[this.formSearchKey + '[to]']: to [this.formSearchKey + '[to]']: to
}, this.clientTimeForm, this.clientForm)) }, this.clientTimeForm, this.clientForm))
},
resetForm () {
Object.keys(this.clientForm).forEach(item => {
this.clientForm[item] = ''
})
Object.keys(this.clientTimeRange).forEach(item => {
this.clientTimeRange[item] = ''
})
Object.keys(this.clientTimeForm).forEach(item => {
this.clientTimeForm[item] = ''
})
} }
}, },
mounted () { mounted () {
......
...@@ -241,7 +241,11 @@ ...@@ -241,7 +241,11 @@
this.getList() this.getList()
} }
}, },
getList () { updatePage (pager) {
Object.assign(this.pagenation, pager)
this.getList(true)
},
getList (toTop) {
if (this.loading) { if (this.loading) {
return return
} }
...@@ -255,6 +259,9 @@ ...@@ -255,6 +259,9 @@
this.result.list = res.list this.result.list = res.list
// this.pagenation.page = res.pagenation.thispage // this.pagenation.page = res.pagenation.thispage
this.totalcount = res.pagenation.totalcount this.totalcount = res.pagenation.totalcount
if (toTop) {
this.$el.querySelector('.page-body-content').scrollTo(0, 0)
}
}).finally(_ => { }).finally(_ => {
this.loading = false this.loading = false
}) })
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
key-code="keyword" key-code="keyword"
type="keyword" type="keyword"
button-title="新建销售记录 " button-title="新建销售记录 "
:reset-form="resetForm"
:add-new-user="addNewSales" :add-new-user="addNewSales"
:search-keyword="searchKeyword"></client-header> :search-keyword="searchKeyword"></client-header>
<client-form ref="clientForm" <client-form ref="clientForm"
...@@ -175,7 +176,7 @@ ...@@ -175,7 +176,7 @@
}, },
updateForm (form) { updateForm (form) {
Object.assign(this.form, form) Object.assign(this.form, form)
this.getList() this.getList(true)
}, },
delSales (id) { delSales (id) {
this.$confirm('确认删除吗?', '提示').then(() => { this.$confirm('确认删除吗?', '提示').then(() => {
...@@ -214,11 +215,18 @@ ...@@ -214,11 +215,18 @@
this.$refs.sidePopup.show(this.$refs[this.operationPage].init(row.id)) this.$refs.sidePopup.show(this.$refs[this.operationPage].init(row.id))
}) })
}, },
resetForm () {
this.$refs.clientForm.resetForm()
Object.keys(this.form).forEach(item => {
this.form[item] = ''
})
this.getList()
},
updatePage (pager) { updatePage (pager) {
Object.assign(this.pagenation, pager) Object.assign(this.pagenation, pager)
this.getList() this.getList(true)
}, },
getList () { getList (toTop) {
if (this.loading) { if (this.loading) {
return return
} }
...@@ -233,7 +241,9 @@ ...@@ -233,7 +241,9 @@
// this.pagenation.page = res.pagenation.thispage // this.pagenation.page = res.pagenation.thispage
this.totalcount = res.pagenation.totalcount this.totalcount = res.pagenation.totalcount
// this.totalcount = 8 // this.totalcount = 8
if (toTop) {
this.$el.querySelector('.page-body-content').scrollTo(0, 0) this.$el.querySelector('.page-body-content').scrollTo(0, 0)
}
}).finally(_ => { }).finally(_ => {
this.loading = false this.loading = false
}) })
......
...@@ -139,6 +139,17 @@ ...@@ -139,6 +139,17 @@
[this.formSearchKey + '[from]']: from, [this.formSearchKey + '[from]']: from,
[this.formSearchKey + '[to]']: to [this.formSearchKey + '[to]']: to
}, this.clientTimeForm, this.clientForm)) }, this.clientTimeForm, this.clientForm))
},
resetForm () {
Object.keys(this.clientForm).forEach(item => {
this.clientForm[item] = ''
})
Object.keys(this.clientTimeRange).forEach(item => {
this.clientTimeRange[item] = ''
})
Object.keys(this.clientTimeForm).forEach(item => {
this.clientTimeForm[item] = ''
})
} }
}, },
mounted () { mounted () {
......
...@@ -193,7 +193,11 @@ ...@@ -193,7 +193,11 @@
this.$refs.sidePopup.show(this.$refs[this.operationPage].init(row.id)) this.$refs.sidePopup.show(this.$refs[this.operationPage].init(row.id))
}) })
}, },
getList () { updatePage (pager) {
Object.assign(this.pagenation, pager)
this.getList(true)
},
getList (toTop) {
if (this.loading) { if (this.loading) {
return return
} }
...@@ -206,6 +210,9 @@ ...@@ -206,6 +210,9 @@
this.result.list = res.list this.result.list = res.list
// this.pagenation.page = res.pagenation.thispage // this.pagenation.page = res.pagenation.thispage
this.totalcount = res.pagenation.totalcount this.totalcount = res.pagenation.totalcount
if (toTop) {
this.$el.querySelector('.page-body-content').scrollTo(0, 0)
}
}).finally(_ => { }).finally(_ => {
this.loading = false this.loading = false
}) })
......
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