You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
2.6 KiB

1 year ago
<template>
<uni-popup ref="popupItems">
<com-popup @onClose="closePopup">
<view class="">
<view class="uni-center" style="font-size: 40rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
选择物料
1 year ago
</view>
<u-line/>
<view style="margin: 20rpx;" v-for="(item, index) in showList" :key="index" >
<view class="" style="padding: 10rpx;" @click="selectItem(item)">
物料: {{item.itemCode}}
1 year ago
</view>
<u-line/>
</view>
</view>
<view class="flex uni-center" style="width: 100%;justify-content: center;margin-top: 10rpx;margin-bottom: 10rpx;" >
<view class="">
当前页{{ pageCurrent }}数据总量{{ total }}每页数据{{ pageSize }}
</view>
</view>
<view class="">
<uni-pagination :page-size="pageSize" :current="pageCurrent" :total="total" @change="change" />
</view>
</com-popup>
</uni-popup>
</template>
<script>
import {
getProductionlineItem,
getCustomerItemList
1 year ago
} from '@/api/request2.js';
import comPopup from '@/mycomponents/common/comPopup.vue'
export default {
emits: ["selectedItem"],
components: {
comPopup,
},
props: {
},
data() {
return {
showList: [],
pageCurrent:1,
pageSize:10,
total:0
}
},
methods: {
queryList(lineCode){
var filters =[]
filters.push({
column: "customerCode",
action: "==",
value: lineCode
})
1 year ago
var params = {
filters: filters,
1 year ago
pageNo: this.pageCurrent,
pageSize: this.pageSize,
1 year ago
}
getCustomerItemList(params).then(res => {
1 year ago
if (res.data != null && res.data.list.length > 0) {
this.showList = res.data.list;
this.total = res.data.total;
this.$forceUpdate()
1 year ago
this.$refs['popupItems'].open("center");
} else {
//没有查询到生产线对应的物料信息
// this.showErrorMessage('未查找到生产线【' + lineCode + '】对应的物料');
1 year ago
this.$refs['popupItems'].open("center");
}
}).catch(error => {
// this.showErrorMessage(error);
})
},
openPopup(items) {
this.showList = items;
this.$refs['popupItems'].open("center");
},
closePopup() {
this.$refs.popupItems.close()
},
selectItem(item) {
this.$emit("selectedItem", item);
this.$refs['popupItems'].close();
},
change(e){
this.pageCurrent = e.current
console.log("分页",e.current)
}
}
}
</script>
<style>
.fixed-bottom {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
background-color: #fff;
padding: 10px 0;
box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}
</style>