Commit 66748ead authored by 邓春圆's avatar 邓春圆

搜索调整

parent 290255a4
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('币种1')" prop="sourceCurrencyId"> <el-form-item :label="$t('币种1')" prop="sourceCurrencyId">
<el-select v-model="queryParams.sourceCurrencyId" :placeholder="$t('请选择币种')" clearable size="small"> <el-select v-model="query.sourceCurrencyId" :placeholder="$t('请选择币种')" clearable size="small">
<el-option v-for="dict in currencyList" <el-option v-for="dict in currencyList"
:key="dict.id" :label="$l(dict,'title') + dict.fuhao" :value="dict.id" /> :key="dict.id" :label="$l(dict,'title') + dict.fuhao" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('币种2')" prop="targetCurrencyId"> <el-form-item :label="$t('币种2')" prop="targetCurrencyId">
<el-select v-model="queryParams.targetCurrencyId" :placeholder="$t('请选择币种')" clearable size="small"> <el-select v-model="query.targetCurrencyId" :placeholder="$t('请选择币种')" clearable size="small">
<el-option v-for="dict in currencyList" <el-option v-for="dict in currencyList"
:key="dict.id" :label="$l(dict,'title') + dict.fuhao" :value="dict.id" /> :key="dict.id" :label="$l(dict,'title') + dict.fuhao" :value="dict.id" />
</el-select> </el-select>
...@@ -178,6 +178,19 @@ export default { ...@@ -178,6 +178,19 @@ export default {
components: { components: {
Template Template
}, },
watch:{
'query.targetCurrencyId'(val){
if(!val){
this.queryParams.targetCurrencyId = undefined
}
},
'query.sourceCurrencyId'(val){
if(!val){
this.queryParams.sourceCurrencyId = undefined
}
}
},
data() { data() {
return { return {
status:0, status:0,
...@@ -207,6 +220,10 @@ export default { ...@@ -207,6 +220,10 @@ export default {
sourceCurrencyId: null, sourceCurrencyId: null,
targetCurrencyId: null, targetCurrencyId: null,
}, },
query:{
sourceCurrencyId:null,
targetCurrencyId:null,
},
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
...@@ -306,16 +323,25 @@ export default { ...@@ -306,16 +323,25 @@ export default {
}; };
this.resetForm("form"); this.resetForm("form");
}, },
secondarySelection(){
this.queryParams.targetCurrencyId = this.query.targetCurrencyId
this.queryParams.sourceCurrencyId = this.query.sourceCurrencyId
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.page = 1; this.queryParams.page = 1;
this.secondarySelection()
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRangeCreateTime = []; // this.dateRangeCreateTime = [];
this.resetForm("queryForm"); // this.resetForm("queryForm");
this.handleQuery(); // this.handleQuery();
this.query.targetCurrencyId = undefined
this.query.sourceCurrencyId = undefined
this.secondarySelection() //清空选中目标
this.getList();
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
......
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