Commit cf28ba38 authored by 高宇's avatar 高宇

修复重置按钮;

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