|
|
|
<template>
|
|
|
|
<view class="page-wraper">
|
|
|
|
<view class="page-header">
|
|
|
|
<view class="header_job_top">
|
|
|
|
<request-top :dataContent="requestContent"></request-top>
|
|
|
|
</view>
|
|
|
|
<view class="header_item">
|
|
|
|
从仓库代码 : {{requestContent.fromWarehouseCode}}
|
|
|
|
</view>
|
|
|
|
<u-line color="#D8D8D8" />
|
|
|
|
</view>
|
|
|
|
<view class="page-main">
|
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll">
|
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
|
|
|
|
<view class="">
|
|
|
|
<comRequestDetailCard :dataContent="item"
|
|
|
|
@openDetail="openDetail">
|
|
|
|
</comRequestDetailCard>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<requestDetailInfoPopup ref="jobDetailPopup"></requestDetailInfoPopup>
|
|
|
|
<com-message ref="comMessage"></com-message>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {
|
|
|
|
getScrapRequestDetail,
|
|
|
|
} from '@/api/request2.js';
|
|
|
|
|
|
|
|
import {
|
|
|
|
goHome,
|
|
|
|
} from '@/common/basic.js';
|
|
|
|
|
|
|
|
import {
|
|
|
|
getDataSource,
|
|
|
|
} from '@/common/detail.js';
|
|
|
|
|
|
|
|
import comRequestDetailCard from "@/mycomponents/detail/comRequestDetailCard.vue"
|
|
|
|
import requestDetailInfoPopup from '@/pages/scrap/coms/requestDetailInfoPopup.vue'
|
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue'
|
|
|
|
import requestTop from "@/mycomponents/request/requestTop.vue"
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
comRequestDetailCard,
|
|
|
|
requestDetailInfoPopup,
|
|
|
|
comMessage,
|
|
|
|
requestTop
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
id: '',
|
|
|
|
requestContent: {}, //任务内容
|
|
|
|
subList: [], //接口返回的任务subList
|
|
|
|
detailSource: [], //绑定在页面上的数据源
|
|
|
|
};
|
|
|
|
},
|
|
|
|
onLoad(option) {
|
|
|
|
this.id = option.id;
|
|
|
|
this.getDetail();
|
|
|
|
},
|
|
|
|
//返回首页
|
|
|
|
onNavigationBarButtonTap(e) {
|
|
|
|
if (e.index === 0) {
|
|
|
|
goHome();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onPullDownRefresh() {
|
|
|
|
this.getDetail();
|
|
|
|
uni.stopPullDownRefresh();
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getDetail() {
|
|
|
|
var that = this;
|
|
|
|
uni.showLoading({
|
|
|
|
title: "加载中....",
|
|
|
|
mask: true
|
|
|
|
});
|
|
|
|
|
|
|
|
getScrapRequestDetail(that.id).then(res => {
|
|
|
|
uni.hideLoading();
|
|
|
|
if (res.data == null) {
|
|
|
|
that.showMessage('未获取到详情');
|
|
|
|
} else {
|
|
|
|
if (res.data.subList.length > 0) {
|
|
|
|
that.requestContent = res.data;
|
|
|
|
that.subList = res.data.subList;
|
|
|
|
that.detailSource = getDataSource(that.subList);
|
|
|
|
} else {
|
|
|
|
that.showMessage('列表数据为0');
|
|
|
|
}}
|
|
|
|
}).catch(error => {
|
|
|
|
uni.hideLoading()
|
|
|
|
this.showMessage(error)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
showMessage(message) {
|
|
|
|
this.$refs.comMessage.showMessage(message, res => {
|
|
|
|
if (res) {
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
openDetail(item) {
|
|
|
|
this.$refs.jobDetailPopup.openPopup(item)
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
|
|
</style>
|