190 lines
4.4 KiB
Vue
Raw Normal View History

<template>
<view class="projectList">
<view class="fixedheader">
<headers :themeType="true" :showBack="true">
<view class="headerName">
材料出场管理
</view>
</headers>
</view>
<view v-if="dataList.length > 0">
<view class="ukashList" v-for="item in dataList" :key="item.id">
<!-- @click="jobLookDetails(item.id)" 暂时不跳详情页 -->
<view class="ukashList-what">
<span style="font-size: 28rpx;font-weight: 700;">材料名称: {{item.name}}</span>
<!-- <span class="ukashList-look">查看明细</span> -->
</view>
<view class="ukashList-time">型号: {{item.model}}</view>
<view class="ukashList-time">规格: {{item.specifications}}</view>
<view class="ukashList-time">单位: {{item.unit}}</view>
<view class="ukashList-time">数量: {{item.num}}</view>
<view class="ukashList-time">备注: {{item.remark}}</view>
<view class="ukashList-time"><text style="width: 64rpx;">图片:</text>
<view class="" v-if="item.imageUrl" style="display: flex;flex-wrap: wrap;">
<view class="" v-for="(imgItem,imgIndex) in JSON.parse(item.imageUrl)" :key="imgIndex">
<!-- <image :src="imgItem?url_config+'image/'+imgItem.url:''" -->
<image :src="imgItem?url_config+'image/'+imgItem.url:''"
class="profile_photo"
@click="previewImg(url_config+'image/'+imgItem.url)"></image>
</view>
</view>
</view>
</view>
</view>
<view class="no-data" v-else>
<image class="img" src="/static/noData.png"></image>
<text class="txt">暂无数据</text>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {
data() {
return {
search: '',
pageNo: 1,
pageSize: 10,
isLoadMore: false,
dataList: [],
id: ''
}
},
onLoad(vai) {
console.log(vai.itemS);
this.id = vai.itemS
this.queryList()
},
onReachBottom() {
console.log(99999);
// if (!this.isLoadMore) {
// this.isLoadMore = true
// this.pageNo + 1
// this.queryList()
// }
},
onPullDownRefresh() {
console.log(222);
this.pageNo = 1
this.dataList = []
this.queryList()
},
methods: {
queryList() {
let data = {
materialId: this.id
}
let _this = this
this.sendRequest({
url: 'xmgl/xzMaterialDetail/list',
method: 'post',
data: data,
success: res => {
console.log(res);
this.dataList = res.result
if (res.result.length < this.pageSize) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true
this.loadStatus = 'nomore'
} else {
this.isLoadMore = false
// that.loadStatus='more'
}
uni.stopPullDownRefresh()
// console.log(res.result)
}
})
},
jobLookDetails(id){
uni.navigateTo({
url: './lookDetails?itemS=' + id
})
},
previewImg(url) {
uni.previewImage({
urls: [url]
})
},
}
}
</script>
<style lang="scss" scoped>
.projectList {
min-height: 100%;
background: #f4f5fd;
.uni-input {
border-radius: 20rpx;
margin: 20rpx 20rpx;
background-color: #e6e7ef;
height: 70rpx;
line-height: 60rpx;
padding: 0 40rpx;
font-size: 28rpx;
}
.ukashList {
// height: 193px;
height: auto;
background-color: #fff;
margin: 20rpx 20rpx;
border-radius: 30rpx;
padding-bottom: 20rpx;
.ukashList-what {
display: flex;
justify-content: space-between;
margin: 0 30rpx;
padding-top: 20rpx;
.ukashList-look {
background-color: #5081f7;
border-radius: 20rpx;
padding: 0 4px;
font-size: 24rpx;
text-align: center;
color: #fff;
}
}
.ukashList-time {
// margin-top: 30rpx;
// margin-left: 30rpx;
margin: 30rpx 30rpx 20rpx 30rpx;
font-size: 24rpx;
color: #b9bbc9;
display: flex;
.profile_photo {
width: 60rpx;
height: 60rpx;
margin-right:10rpx;
border-radius: 10rpx;
}
}
}
.no-data {
text-align: center;
margin-top: 50%;
.img {
display: block;
height: 200rpx;
width: 200rpx;
margin: 0 auto;
margin-top: 60rpx;
margin-bottom: 60rpx;
}
.txt {
color: #C0C4CC;
}
}
}
</style>