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
multiple
filterable
collapse-tags
clearable
ref="selectRef"
remote
@ -11,9 +12,10 @@
:placeholder="placeholder"
style="width:100%"
@focus="onFocus"
@change="onChange"
class="mutiSelect"
>
<!-- @change="onChange" -->
<!-- collapse-tags -->
<div style="padding: 0px 8px 0 20px;width:100%;line-height:34px;display:inline-flex; border-bottom: 1px solid #e7e7e7;">
<div style="width:50%">
@ -23,7 +25,7 @@
<el-button type="primary" size="mini" style="padding:2px 10px" @click="confirmOk">确定</el-button>
</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-select>
</template>
@ -62,46 +64,51 @@ data() {
},
watch: {
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() {
if(this.value) {
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: {
confirmOk(){
let selCodeStr="";
let selNameStr="";
if(this.svalue&&this.svalue.length>0){
selCodeStr=this.svalue.join(',');
}
selCodeStr = selCodeStr.substring(0,selCodeStr.length-1);
console.log("===>==1:",selCodeStr);
console.log("===>==1=>》:",this.svalue,selCodeStr);
this.$emit('input', 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();
},
onFocus(){
this.queryData();
if(this.svalue&&this.svalue.length>0){
let selCodeStr=this.svalue.join(',');
this.queryData(null,null,sortCodeStr);
}
},
onChange(val) {
this.confirmOk()
// this.confirmOk()
},
queryData(queryVal) {
queryData(val,key,sortCodeStr) {
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)
listSimpleEmisSupplier(this.queryParams).then(response => {

View File

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