父页面
<template>
<view class="order-list">
<cu-custom bgColor="bg-gradual-blue" :isBack="true">
<block slot="content">荒料管理</block>
</cu-custom>
<view class="" >
<!-- 订单展示 -->
<mescroll-uni ref="mescrollRef" @init="mescrollInit" top="60rpx" @down="downCallback" @up="upCallback">
<!-- 数据列表 -->
<view class="data-list" style=" margin-top: 2rem;">
<!-- 空内容展示-->
<u-empty :text="textNoMore" v-if="dataList.length==0" mode="list"></u-empty>
<!-- 空内容展示End-->
<view class="order margin-top-sm" v-for="(item, aindex) in dataList" :key="item.id"
@click="jumpToOrder(item)">
<view class='bg-white padding-sm flex padding-right-zero flex-between'>
<view class='flex-sub radius text-left text-xs margin-top-xs'>
<image src="../../static/common/huang.png"
style="width: 100rpx;height: 80rpx;margin-top: -10px;"></image>
</view>
<view class='flex-sub radius text-left text-xs margin-top-xs'
style="margin-left: -200px;font-size: 12px;">
编号:{{ item.sbwWarehousingNumber}}</view>
</view>
<view class="bg-white padding-sm solid-top" >
<view class='padding-top-sm text-sm flex'>
<view class="left-title" style="font-size: 12px;">日期:</view><view class="right-content" style="font-size: 12px;">{{ item.sbwWarehousingDate}}</view>
</view>
<view class='padding-top-sm text-sm flex'></view>
</view>
</view>
<!-- 返回顶部 -->
<u-back-top :scroll-top="scrollTop" top="600">
</u-back-top>
<!-- 返回顶部End -->
</view>
</mescroll-uni>
</view>
<!-- 订单展示完毕End -->
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import configService from '@/common/service/config.service.js';
export default {
mixins: [MescrollMixin],
data() {
return {
pageable: {
pageIndex: 0,
pageSize: 10
},
list: [{
complainantStatus: '0',
name: '待解决'
}, {
complainantStatus: '10',
name: '已解决'
}],
textNoMore :'-- 没有更多数据了 --',
tabCurrent: 0,
scrollTop: 0,
dataList: [],
}
},
methods: {
//下拉刷新
downCallback() {
this.mescroll.scrollTo(0, 0)
this.mescroll.resetUpScroll();
},
//上拉加载
async upCallback(pages) {
let pageIndex = pages.num // 页码, 默认从1开始
let pageSize = pages.size // 页长, 默认每页10条
this.pageable.pageIndex = pageIndex
this.pageable.pageSize = pageSize
let data = await this.getOrder(this.pageable)
console.log("data" + data)
const curPageData = data.records || []
if (data && curPageData.length > 0) {
const curPageLen = curPageData.length // 当前数据长度
const totalPage = data.total // 获取接口总共有多少页
this.mescroll.endByPage(curPageLen, totalPage);
} else {
this.mescroll.endErr()
}
},
//订单列表
async getOrder(pageable) {
let that = this
let params = {
openid: uni.getStorageSync("openId"),
complainantStatus: this.list[this.tabCurrent].complainantStatus,
pageNo: pageable.pageIndex,
pageSize: pageable.pageSize
}
// console.log(params)
let preData = {
records: []
}
// 获取列表数据
await that.$http.get('/block/smsBlockWarehousing/list', {
params: params
}).then(res => {
console.log(res)
if (res.data.success !== true) {
that.$tip.alert(res.data.message)
} else {
if (pageable.pageIndex < 2)
that.dataList = [] // 如果是第一页需手动置空列表
that.dataList.push(...res.data.result.records) //数据添加到dataList
console.log(res.data.result)
preData = res.data.result;
}
}).catch(err => {
// that.$tip.alert("网络波动,请重试!")
console.log("err")
})
console.log(preData)
return preData
},
// 点击跳转到huangliao页面 携带当前点击的id 过去
jumpToOrder(item) {
// console.log(item, 'adad')
uni.navigateTo({
url: '/pages/common/huangliao?id=' + item.id
})
},
}
}
</script>
子页面
<template>
<view style="background-color: #ffffff;">
<cu-custom bgColor="bg-gradual-blue" :isBack="true">
<block slot="content">荒料详情</block>
</cu-custom>
<u-form :model="form" ref="uForm">
<view class="container">
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ; display: flex;">入库编号 :<span
style="color:#666;">{{form.sbwWarehousingNumber}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">入库日期 :<span
style="color:#666;">{{form.sbwWarehousingDate}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">荒料种类 :<span
style="color:#666;">{{form.sbwName_dictText}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">长 :<span
style="color:#666;">{{form.sbwLong}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">宽 :<span
style="color:#666;">{{form.sbwWidth}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">高 :<span
style="color:#666;">{{form.sbwTall}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">体积 :<span
style="color:#666;">{{form.sbwSbwVolume}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">颜色 :<span
style="color:#666;">{{form.sbwColor_dictText}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">价格 :<span
style="color:#666;">{{form.sbwPrice}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">数量 :<span
style="color:#666;">{{form.sbwNum}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">运单单价 :<span
style="color:#666;">{{form.sbwFreightPrice}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">运费 :<span
style="color:#666;">{{form.sbwFreight}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">运输人 :<span
style="color:#666;">{{form.sbwTransporter_dictText}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">总价 :<span
style="color:#666;">{{form.sbwNum}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">料场 :<span
style="color:#666;">{{form.sbwFreight}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">操作员 :<span
style="color:#666;">{{form.sbwTransporter_dictText}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">图片 :<!-- <span
style="color:#666;">{{form.sbwPic}}</span> -->
<image src="form.sbwPic" mode=""></image>
</view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">文件 :<span
style="color:#666;">{{form.sbwFile}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">备注 :<span
style="color:#666;">{{form.sbwRemake}}</span></view>
<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
</view>
</u-form>
</view>
</template>
<script>
export default {
data() {
return {
form: {
sbwWarehousingDate: '',
sbwWarehousingNumber: '',
sbwName_dictText: '',
sbwLong: '',
sbwWidth: '',
sbwTall: '',
sbwSbwVolume: '',
sbwColor_dictText: '',
sbwPrice: '',
sbwNum: '',
sbwFreightPrice: '',
sbwFreight: '',
sbwTransporter_dictText: '',
sbwTotalPrice: '',
sbwStockyard_dictText: '',
sbwPic: '',
sbwFile: '',
sbwRemake: ''
},
}
},
onLoad: function(options) {
this.getOrderDetail()
},
methods: {
// 接受数据
async getOrderDetail() {
let that = this
let params = {
id: this.id
}
console.log(params)
//return
await this.$http.get('/block/smsBlockWarehousing/list', {
params: params
}).then(res => {
console.log("get RES")
console.log(res.data.result.records[0], '马甲的喇嘛是的')
if (res.data.success !== true) {
that.form = res.data.result.records[0]
that.$tip.alert(res.data.message)
} else {
that.form = res.data.result.records[0]
if (that.form.complaintFileString) {
that.fileList = that.form.complaintFileString.split(",")
}
console.log(that.fileList)
}
}).catch(err => {
// that.$tip.alert("网络波动,请重试!")
console.log(err)
})
},
}
}
</script>