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

bug修改

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