Commit 5bfce159 authored by 何远江's avatar 何远江

bug修改

parent e704ecea
<template>
<view class="factoryBox">
<zxz-uni-data-select filterable v-model="warehouseCode" dataKey="label" placeholder="请选择仓库别" dataValue="value"
:localdata="warehouseData" @change='onWarehouseChange' />
</view>
<view class="factoryBox">
<zxz-uni-data-select
filterable
v-model="warehouseCode"
dataKey="label"
placeholder="请选择仓库别"
dataValue="value"
:localdata="warehouseData"
@change="onWarehouseChange"
/>
</view>
</template>
<script>
export default {
model: {
prop: 'value',
event: 'update'
},
props: {
value: {
type: String,
defualt: ''
}
},
data() {
return {
warehouseData: []
}
},
computed: {
warehouseCode: {
get() {
return this.value
},
set(v) {
this.$emit('update', v)
}
}
},
created() {
this.getDepotLists()
},
methods: {
onWarehouseChange(e) {
this.$emit('change', e);
},
getDepotLists() {
this.$u.api.sapApi
.sapDict({
FIELDNAME: 'T001L'
})
.then((res) => {
if (res) {
res.forEach((ele) => {
ele.label = ele.LGORT + "-" + ele.LGOBE;
ele.value = ele.LGORT
});
this.warehouseData = res;
} else {
this.warehouseData = [];
}
});
},
}
}
export default {
model: {
prop: "value",
event: "update",
},
props: {
value: {
type: String,
defualt: "",
},
},
data() {
return {
warehouseData: [],
};
},
computed: {
warehouseCode: {
get() {
return this.value;
},
set(v) {
this.$emit("update", v);
},
},
},
created() {
this.getDepotLists();
},
methods: {
onWarehouseChange(e) {
this.$emit("change", e);
},
getDepotLists() {
this.$u.api.sapApi
.sapDict({
FIELDNAME: "T001L",
})
.then((res) => {
if (res) {
// 过滤当前工厂下的库存地点
this.warehouseData = res
.filter((ele) => ele.WERKS == this.vuex_user_factory)
.map((item) => {
item.label = item.LGORT + "-" + item.LGOBE;
item.value = item.LGORT;
return item;
});
} else {
this.warehouseData = [];
}
});
},
},
};
</script>
<style lang="scss">
.factoryBox {
padding: 10rpx 20rpx 0;
.factoryBox {
padding: 10rpx 20rpx 0;
.item-select {
margin-bottom: 20rpx;
}
}
.item-select {
margin-bottom: 20rpx;
}
}
</style>
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