|
@@ -38,18 +38,15 @@
|
|
|
</template>
|
|
|
|
|
|
<template slot="unitNoForm">
|
|
|
- <search-query :datalist="unitNoData"
|
|
|
+ <search-query ref="SearchQuery"
|
|
|
+ :datalist="unitNoData"
|
|
|
title="计量单位"
|
|
|
:filterable="true"
|
|
|
:clearable="true"
|
|
|
:remote="true"
|
|
|
- :forParameter="{
|
|
|
- key:'id',
|
|
|
- label:'cnName',
|
|
|
- value:'id'
|
|
|
- }"
|
|
|
- @remoteMethod="getBunitsListfun" >
|
|
|
- <bunits></bunits>
|
|
|
+ :forParameter="{key:'id',label:'cnName',value:'cnName'}"
|
|
|
+ @remoteMethod="getBunitsListfun" @corpChange="corpChange" >
|
|
|
+ <bunits @selectionChange="selectionBunits"></bunits>
|
|
|
</search-query>
|
|
|
</template>
|
|
|
|
|
@@ -256,11 +253,23 @@
|
|
|
methods: {
|
|
|
// 获取计算单位数据
|
|
|
getBunitsListfun(cnName){
|
|
|
- console.log(cnName)
|
|
|
getBunitsList(1, 10,{cnName}).then(res=>{
|
|
|
this.unitNoData = res.data.data.records
|
|
|
})
|
|
|
},
|
|
|
+ // 计量单位选中的回调
|
|
|
+ corpChange(value){
|
|
|
+ this.form.unitNo = value
|
|
|
+ // for(let item of this.unitNoData) {
|
|
|
+ // if (item.id == value) {
|
|
|
+ // this.form.unitNo = item.cnName
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ // 表格组件抛出的选择数据
|
|
|
+ selectionBunits(list){
|
|
|
+ console.log(list,271)
|
|
|
+ },
|
|
|
rowSave(row, done, loading) {
|
|
|
bcommoditySubmit(row).then(() => {
|
|
|
this.onLoad(this.page);
|
|
@@ -330,6 +339,11 @@
|
|
|
if (["edit", "view"].includes(type)) {
|
|
|
bcommodityDetail(this.form.id).then(res => {
|
|
|
this.form = res.data.data;
|
|
|
+ // 获取插槽数据
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ console.log(this.$refs.SearchQuery.selectValue)
|
|
|
+ this.$refs.SearchQuery.selectValue = this.form.unitNo
|
|
|
+ })
|
|
|
});
|
|
|
}
|
|
|
done();
|