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.

129 lines
2.8 KiB

12 months ago
<template>
<view class="page-wraper">
11 months ago
<view class="page-header">
<view class="header_job_top">
<request-top :dataContent="requestContent"></request-top>
</view>
<view class="header_item">
到仓库代码 : {{requestContent.toWarehouseCode}}
</view>
<u-line color="#D8D8D8" />
</view>
12 months ago
<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="">
11 months ago
<comRequestDetailCard :dataContent="item" @openDetail="openDetail">
12 months ago
</comRequestDetailCard>
</view>
</view>
</scroll-view>
</view>
<requestRecDetailInfoPopup ref="requestDetailPopup"></requestRecDetailInfoPopup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getUnPlannedReceiptRequestDetail,
} from '@/api/request2.js';
import {
goHome,
} from '@/common/basic.js';
import {
getDataSource,
} from '@/common/detail.js';
import comRequestDetailCard from "@/mycomponents/detail/comRequestDetailCard.vue"
import requestRecDetailInfoPopup from '@/pages/unPlanned/coms/requestRecDetailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
11 months ago
import requestTop from "@/mycomponents/request/requestTop.vue"
12 months ago
export default {
components: {
comRequestDetailCard,
requestRecDetailInfoPopup,
comMessage,
11 months ago
requestTop
12 months ago
},
data() {
return {
id: '',
requestContent: {}, //任务内容
12 months ago
subList: [], //接口返回的任务subList
12 months ago
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
});
getUnPlannedReceiptRequestDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
11 months ago
if (res.data.subList.length > 0) {
that.requestContent = res.data;
that.subList = res.data.subList;
that.subList.forEach(res => {
res.fromLocationCode = res.toLocationCode
})
that.detailSource = getDataSource(that.subList);
} else {
that.showMessage('列表数据为0');
}
12 months ago
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
11 months ago
12 months ago
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
11 months ago
if (res) {}
12 months ago
});
},
openDetail(item) {
this.$refs.requestDetailPopup.openPopup(item)
},
}
}
</script>
<style scoped lang="scss">
</style>