zhang_li
3 months ago
9 changed files with 132 additions and 122 deletions
@ -1,117 +1,99 @@ |
|||
<template> |
|||
<view class="page-wraper"> |
|||
<view class="page-header"> |
|||
<view class='page-header-box'> |
|||
<view class="header_job_top"> |
|||
<request-top :dataContent="requestContent"></request-top> |
|||
</view> |
|||
<view class="header_item"> |
|||
供应商 : {{requestContent.supplierCode}} |
|||
</view> |
|||
</view> |
|||
</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=""> |
|||
<com-request-detail-card :dataContent="item" @openDetail="openDetail"> |
|||
</com-request-detail-card> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
</view> |
|||
<request-detail-info-popup ref="jobDetailPopup"></request-detail-info-popup> |
|||
<com-message ref="comMessageRef" /> |
|||
</view> |
|||
<view class="page-wraper"> |
|||
<view class="page-header"> |
|||
<view class="page-header-box"> |
|||
<view class="header_job_top"> |
|||
<request-top :dataContent="requestContent"></request-top> |
|||
</view> |
|||
<view class="header_item"> 供应商 : {{ requestContent.supplierCode }} </view> |
|||
</view> |
|||
</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=""> |
|||
<com-request-detail-card :dataContent="item" @openDetail="openDetail"> </com-request-detail-card> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
</view> |
|||
<request-detail-info-popup ref="jobDetailPopup"></request-detail-info-popup> |
|||
<com-message ref="comMessageRef" /> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { |
|||
ref, |
|||
getCurrentInstance, |
|||
onMounted |
|||
} from 'vue' |
|||
import { |
|||
onLoad, |
|||
onNavigationBarButtonTap, |
|||
onPullDownRefresh |
|||
} from '@dcloudio/uni-app' |
|||
import { |
|||
getPurchaseReturnRequestDetail, |
|||
import { ref, getCurrentInstance, onMounted } from 'vue' |
|||
import { onLoad, onNavigationBarButtonTap, onPullDownRefresh } from '@dcloudio/uni-app' |
|||
import { getPurchaseReturnRequestDetail } from '@/api/request2.js' |
|||
|
|||
} from '@/api/request2.js'; |
|||
import { goHome } from '@/common/basic.js' |
|||
|
|||
import { |
|||
goHome, |
|||
} from '@/common/basic.js'; |
|||
import { getDataSource } from '@/common/detail.js' |
|||
|
|||
import { |
|||
getDataSource, |
|||
} from '@/common/detail.js'; |
|||
import comRequestDetailCard from '@/mycomponents/detail/comRequestDetailCard.vue' |
|||
import requestDetailInfoPopup from '@/pages/purchaseReturn/coms/requestDetailInfoPopup.vue' |
|||
import requestTop from '@/mycomponents/request/requestTop.vue' |
|||
|
|||
const { proxy } = getCurrentInstance() |
|||
|
|||
import comRequestDetailCard from "@/mycomponents/detail/comRequestDetailCard.vue" |
|||
import requestDetailInfoPopup from '@/pages/purchaseReturn/coms/requestDetailInfoPopup.vue' |
|||
import requestTop from "@/mycomponents/request/requestTop.vue" |
|||
const { proxy } = getCurrentInstance() |
|||
const id = ref('') |
|||
const requestContent = ref({}) |
|||
const subList = ref([]) |
|||
const detailSource = ref([]) |
|||
const comMessageRef = ref() |
|||
const jobDetailPopup = ref() |
|||
onLoad((option) => { |
|||
id.value = option.id |
|||
uni.setNavigationBarTitle({ |
|||
title: `${option.title}详情` |
|||
}) |
|||
getDetail() |
|||
}) |
|||
// 返回首页 |
|||
onNavigationBarButtonTap((e) => { |
|||
if (e.index === 0) { |
|||
goHome() |
|||
} |
|||
}) |
|||
onPullDownRefresh(() => { |
|||
getDetail() |
|||
uni.stopPullDownRefresh() |
|||
}) |
|||
const getDetail = () => { |
|||
proxy.$modal.loading('加载中....') |
|||
getPurchaseReturnRequestDetail(id.value) |
|||
.then((res) => { |
|||
proxy.$modal.closeLoading() |
|||
if (res.data == null) { |
|||
showMessage('未获取到详情') |
|||
} else if (res.data.subList.length > 0) { |
|||
requestContent.value = res.data |
|||
subList.value = res.data.subList |
|||
subList.value.forEach((res) => { |
|||
// res.fromLocationCode = res.toLocationCode |
|||
res.locationCode = res.fromLocationCode |
|||
}) |
|||
detailSource.value = getDataSource(subList.value) |
|||
} else { |
|||
showMessage('列表数据为0') |
|||
} |
|||
}) |
|||
.catch((error) => { |
|||
proxy.$modal.closeLoading() |
|||
showMessage(error) |
|||
}) |
|||
} |
|||
const showMessage = (message) => { |
|||
comMessageRef.value.showMessage(message, (res) => { |
|||
if (res) { |
|||
} |
|||
}) |
|||
} |
|||
|
|||
const id = ref('') |
|||
const requestContent = ref({}) |
|||
const subList = ref([]) |
|||
const detailSource = ref([]) |
|||
const comMessageRef = ref() |
|||
const jobDetailPopup = ref() |
|||
onLoad((option)=>{ |
|||
id.value = option.id; |
|||
getDetail(); |
|||
}) |
|||
//返回首页 |
|||
onNavigationBarButtonTap((e)=> { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} |
|||
}) |
|||
onPullDownRefresh(()=> { |
|||
getDetail(); |
|||
uni.stopPullDownRefresh(); |
|||
}) |
|||
const getDetail = ()=> { |
|||
proxy.$modal.loading('加载中....') |
|||
getPurchaseReturnRequestDetail(id.value).then(res => { |
|||
proxy.$modal.closeLoading(); |
|||
if (res.data == null) { |
|||
showMessage('未获取到详情'); |
|||
} else { |
|||
if (res.data.subList.length > 0) { |
|||
requestContent.value = res.data; |
|||
subList.value = res.data.subList; |
|||
subList.value.forEach(res => { |
|||
// res.fromLocationCode = res.toLocationCode |
|||
res.locationCode = res.fromLocationCode |
|||
}) |
|||
detailSource.value = getDataSource(subList.value); |
|||
} else { |
|||
showMessage('列表数据为0'); |
|||
} |
|||
} |
|||
}).catch(error => { |
|||
proxy.$modal.closeLoading(); |
|||
showMessage(error) |
|||
}) |
|||
} |
|||
const showMessage=(message) =>{ |
|||
comMessageRef.value.showMessage(message, res => { |
|||
if (res) { |
|||
} |
|||
}); |
|||
} |
|||
|
|||
const openDetail=(item)=> { |
|||
jobDetailPopup.value.openPopup(item) |
|||
} |
|||
|
|||
const openDetail = (item) => { |
|||
jobDetailPopup.value.openPopup(item) |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
</style> |
|||
<style scoped lang="scss"></style> |
|||
|
Loading…
Reference in new issue