This commit is contained in:
linfso 2025-06-12 08:44:30 +08:00
parent 195b812105
commit f55e3ff034
2 changed files with 25 additions and 16 deletions

View File

@ -2,6 +2,7 @@
<el-select <el-select
multiple multiple
filterable filterable
collapse-tags
clearable clearable
ref="selectRef" ref="selectRef"
remote remote
@ -11,9 +12,10 @@
:placeholder="placeholder" :placeholder="placeholder"
style="width:100%" style="width:100%"
@focus="onFocus" @focus="onFocus"
@change="onChange"
class="mutiSelect" class="mutiSelect"
> >
<!-- @change="onChange" -->
<!-- collapse-tags --> <!-- collapse-tags -->
<div style="padding: 0px 8px 0 20px;width:100%;line-height:34px;display:inline-flex; border-bottom: 1px solid #e7e7e7;"> <div style="padding: 0px 8px 0 20px;width:100%;line-height:34px;display:inline-flex; border-bottom: 1px solid #e7e7e7;">
<div style="width:50%"> <div style="width:50%">
@ -23,7 +25,7 @@
<el-button type="primary" size="mini" style="padding:2px 10px" @click="confirmOk">确定</el-button> <el-button type="primary" size="mini" style="padding:2px 10px" @click="confirmOk">确定</el-button>
</div> </div>
</div> </div>
<el-option v-for="item in optionItems" :key="item.code" :label="item.name" :value="item.code"> <el-option v-for="item in optionItems" :key="item.id" :label="item.name" :value="item.code">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -62,46 +64,51 @@ data() {
}, },
watch: { watch: {
value(newVal) { value(newVal) {
if(this.value) {
this.svalue = this.value.split(',');
this.queryData(null,this.value,this.value);
}
// this.queryParams.sortCodeStr=this.value;
// console.log("xxxx===>xxx2:",this.queryParams)
// this.queryData(null);
}, },
}, },
created() { created() {
if(this.value) { if(this.value) {
this.svalue = this.value.split(','); this.svalue = this.value.split(',');
this.queryData(null,this.value,this.value);
} }
this.queryParams.code=this.value;
console.log("xxxx===>xxx1:",this.queryParams)
this.queryData(null);
}, },
methods: { methods: {
confirmOk(){ confirmOk(){
let selCodeStr=""; let selCodeStr="";
let selNameStr=""; let selNameStr="";
if(this.svalue&&this.svalue.length>0){ if(this.svalue&&this.svalue.length>0){
selCodeStr=this.svalue.join(','); selCodeStr=this.svalue.join(',');
} }
console.log("===>==1=>》:",this.svalue,selCodeStr);
selCodeStr = selCodeStr.substring(0,selCodeStr.length-1);
console.log("===>==1:",selCodeStr);
this.$emit('input', selCodeStr) this.$emit('input', selCodeStr)
this.$emit('onChange',selCodeStr) this.$emit('onChange',selCodeStr)
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); // this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
this.$refs.selectRef.blur(); this.$refs.selectRef.blur();
}, },
onFocus(){ onFocus(){
this.queryData(); if(this.svalue&&this.svalue.length>0){
let selCodeStr=this.svalue.join(',');
this.queryData(null,null,sortCodeStr);
}
}, },
onChange(val) { onChange(val) {
this.confirmOk() // this.confirmOk()
}, },
queryData(queryVal) { queryData(val,key,sortCodeStr) {
this.queryParams.pageNum=1; this.queryParams.pageNum=1;
this.queryParams.custName=queryVal; this.queryParams.name=val;
this.queryParams.code=key;
this.queryParams.sortCodeStr=sortCodeStr;
console.log("xxxx===>xxx2:",this.queryParams) console.log("xxxx===>xxx2:",this.queryParams)
listSimpleEmisSupplier(this.queryParams).then(response => { listSimpleEmisSupplier(this.queryParams).then(response => {

View File

@ -291,10 +291,12 @@ export default {
// this.router.push({ path: '/emis/emisTransPlanRule/viewDetail', query: { id: row.id }}) // this.router.push({ path: '/emis/emisTransPlanRule/viewDetail', query: { id: row.id }})
}, },
handleFormChanged(){ handleFormChanged(){
this.currentId=null;
this.openForm = false; this.openForm = false;
this.getList(); this.getList();
}, },
cancelForm(){ cancelForm(){
this.currentId=null;
this.openForm = false; this.openForm = false;
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */