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.
116 lines
3.0 KiB
116 lines
3.0 KiB
<template>
|
|
<uni-popup ref="popupItems">
|
|
<com-popup @onClose="closePopup">
|
|
<view class="uni-center" style="position: relative;height:900rpx ;">
|
|
<view class="" style="position: absolute;font-size: 38rpx;height: 50rpx; margin-top: 10rpx;margin-bottom: 10rpx;left: 0;top: 0;right: 0;">
|
|
选择物料
|
|
</view>
|
|
<u-line/>
|
|
<view class="" style="position: absolute;height: 720rpx; font-size: 40rpx;top: 70rpx;bottom: 80rpx;left: 0;right: 0;">
|
|
<view style="margin: 15rpx;text-align: left;" v-for="(item, index) in showList" :key="index" >
|
|
<view class="" style="padding: 10rpx;font-size: 30rpx; " @click="selectItem(item)">
|
|
({{index+1}}) 物料: {{item.itemCode}}
|
|
</view>
|
|
<u-line/>
|
|
</view>
|
|
</view>
|
|
<view class="" style="position: absolute; height:80rpx ;left: 0;bottom: 0;right: 0;">
|
|
<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>
|
|
</view>
|
|
</view>
|
|
|
|
</com-popup>
|
|
</uni-popup>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import {
|
|
getCustomerItemList
|
|
} 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
|
|
})
|
|
|
|
var params = {
|
|
filters: filters,
|
|
pageNo: this.pageCurrent,
|
|
pageSize: this.pageSize,
|
|
}
|
|
getCustomerItemList(params).then(res => {
|
|
if (res.data != null && res.data.list.length > 0) {
|
|
this.showList = res.data.list;
|
|
this.total = res.data.total;
|
|
this.$forceUpdate()
|
|
this.$refs['popupItems'].open("center");
|
|
} else {
|
|
//没有查询到生产线对应的物料信息
|
|
// this.showErrorMessage('未查找到生产线【' + lineCode + '】对应的物料');
|
|
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>
|
|
|