bonus-material-app/src/pages/picking/outbound/details.vue

247 lines
8.2 KiB
Vue
Raw Normal View History

2024-11-19 14:52:39 +08:00
<template>
<!-- 领料出库详情 -->
<view class="page-container">
<uni-row :gutter="24" class="search-form">
<uni-col :span="12">
<view>
<uni-easyinput placeholder="请输入内容" />
</view>
</uni-col>
<uni-col :span="4">
2024-11-19 18:07:40 +08:00
<view class="search">查询</view>
2024-11-19 14:52:39 +08:00
</uni-col>
</uni-row>
<scroll-view scroll-y class="scroll-container">
2024-12-17 17:21:13 +08:00
<view
v-for="(item, index) in detailsList"
2024-11-19 15:09:17 +08:00
:key="index"
class="table-list-item"
2024-12-17 17:21:13 +08:00
@tap="onCodingItem(item)"
>
<div class="title">
<span style="font-size: 15px; font-weight: 800">领料出库</span>
<span v-if="item.status == 2" style="color: #3784fb">已完成</span>
<span v-if="item.status != 2" style="color: #ff4d4f">未完成</span>
</div>
2024-11-20 10:20:39 +08:00
<view class="line"></view>
2024-12-17 17:21:13 +08:00
<uni-row :gutter="24">
2024-11-19 14:52:39 +08:00
<uni-col :span="6">物资名称</uni-col>
2024-11-20 10:20:39 +08:00
<uni-col :span="16">
<view class="cont">{{ item.maTypeName }}</view>
</uni-col>
2024-11-19 14:52:39 +08:00
</uni-row>
2024-12-17 17:21:13 +08:00
<uni-row :gutter="24">
2024-11-19 14:52:39 +08:00
<uni-col :span="6">规格型号</uni-col>
2024-11-20 10:20:39 +08:00
<uni-col :span="16">
<view class="cont">{{ item.typeName }}</view>
</uni-col>
2024-11-19 14:52:39 +08:00
</uni-row>
2024-12-17 17:21:13 +08:00
<uni-row :gutter="24">
2024-11-19 14:52:39 +08:00
<uni-col :span="6">预领数量</uni-col>
2024-11-20 10:20:39 +08:00
<uni-col :span="16">
<view class="cont">{{ item.preNum }}</view>
</uni-col>
2024-11-19 14:52:39 +08:00
</uni-row>
2024-12-17 17:21:13 +08:00
<uni-row :gutter="24">
2024-11-19 14:52:39 +08:00
<uni-col :span="6">已领数量</uni-col>
2024-11-20 10:20:39 +08:00
<uni-col :span="16">
<view class="cont">{{ item.alNum }}</view>
</uni-col>
2024-11-19 14:52:39 +08:00
</uni-row>
2024-12-17 17:21:13 +08:00
<uni-row :gutter="24">
2024-11-19 14:52:39 +08:00
<uni-col :span="6">待领数量</uni-col>
<uni-col :span="16">
2024-11-20 10:20:39 +08:00
<view class="cont">{{ item.preNum - item.alNum }}</view>
2024-11-19 14:52:39 +08:00
</uni-col>
</uni-row>
2024-12-17 17:21:13 +08:00
<uni-row :gutter="24">
2024-11-19 14:52:39 +08:00
<uni-col :span="6">单位</uni-col>
<uni-col :span="16">
2024-11-20 10:20:39 +08:00
<view class="cont">{{ item.unitName }}</view>
2024-11-19 14:52:39 +08:00
</uni-col>
</uni-row>
2024-12-17 17:21:13 +08:00
<uni-row :gutter="24">
2024-11-19 14:52:39 +08:00
<uni-col :span="6">管理模式</uni-col>
<uni-col :span="16">
<uni-tag
text="编码"
type="warning"
v-if="item.manageType === 0"
size="small"
/>
<uni-tag
text="数量"
type="success"
v-if="item.manageType === 1"
size="small"
/>
</uni-col>
</uni-row>
2024-12-17 17:21:13 +08:00
<uni-row :gutter="24">
2024-11-19 14:52:39 +08:00
<uni-col :span="6">状态</uni-col>
<uni-col :span="16">
<uni-tag
text="未完成"
type="warning"
size="small"
v-if="item.status == 0 || item.status == 1"
/>
<uni-tag
text="已完成"
type="success"
size="small"
v-if="item.status == 2"
/>
</uni-col>
</uni-row>
</view>
</scroll-view>
</view>
</template>
<script setup>
2024-11-19 16:27:00 +08:00
import { ref, onUnmounted } from 'vue'
2024-11-19 14:52:39 +08:00
import { getOutboundDetailsAPI } from '@/services/picking/outbound.js'
2024-12-17 17:21:13 +08:00
import { onLoad, onShow } from '@dcloudio/uni-app'
2024-12-04 17:14:05 +08:00
2024-11-19 14:52:39 +08:00
const detailsList = ref([])
2024-12-17 17:21:13 +08:00
// const query = defineProps() // 获取上级页面传递的路由参数
2024-11-19 14:52:39 +08:00
2024-11-19 16:27:00 +08:00
// 领料单位,参数等信息
const leaseApplyInfo = ref({
2024-12-04 17:14:05 +08:00
leaseUnitId: '', // 领料单位
2024-11-19 16:27:00 +08:00
leaseUnit: '', // 领料单位
2024-12-04 17:14:05 +08:00
leaseProjectId: '', // 领料工程
2024-11-19 16:27:00 +08:00
leaseProject: '', // 领料工程
maTypeName: '', // 物资类型
typeName: '', // 规格型号
unitName: '', // 单位
storageNum: '', // 库存数量
preNum: '', // 预领数量
2024-12-17 17:21:13 +08:00
parentId: '', // 出库时所需参数 取列表 id
2024-11-19 16:27:00 +08:00
id: '', // 出库时所需参数 取详情接口 id
typeId: '', // 出库时所需参数 取详情接口 typeId
manageType: '', // 出库时所需参数 取详情接口 manageType
})
2024-12-17 17:21:13 +08:00
onLoad((options) => {
leaseApplyInfo.value.parentId = options.id
getOutboundDetailsData()
})
2024-11-19 14:52:39 +08:00
// 获取列表详情
const getOutboundDetailsData = async () => {
2024-12-17 17:21:13 +08:00
const { data: res } = await getOutboundDetailsAPI(leaseApplyInfo.value.parentId)
2024-11-19 14:52:39 +08:00
detailsList.value = res.leaseApplyDetailsList
2024-12-17 17:21:13 +08:00
console.log(res.leaseApplyInfo)
2024-12-04 17:14:05 +08:00
leaseApplyInfo.value.leaseUnitId = res.leaseApplyInfo.leaseUnitId
2024-11-19 16:27:00 +08:00
leaseApplyInfo.value.leaseUnit = res.leaseApplyInfo.leaseUnit
2024-12-04 17:14:05 +08:00
leaseApplyInfo.value.leaseProjectId = res.leaseApplyInfo.leaseProjectId
2024-11-19 16:27:00 +08:00
leaseApplyInfo.value.leaseProject = res.leaseApplyInfo.leaseProject
// console.log('详情数据', res)
2024-11-19 14:52:39 +08:00
}
2024-11-19 15:09:17 +08:00
// 点击跳转出库页面
const onCodingItem = (item) => {
2024-12-17 17:21:13 +08:00
console.log(item)
2024-11-19 16:27:00 +08:00
// 解构所需要的数据
const {
status,
manageType,
maTypeName,
typeName,
storageNum,
preNum,
alNum,
unitName,
id,
typeId,
2024-12-17 17:21:13 +08:00
unitValue,
} = item
2024-11-19 16:27:00 +08:00
leaseApplyInfo.value.maTypeName = maTypeName
leaseApplyInfo.value.typeName = typeName
2024-12-17 17:21:13 +08:00
leaseApplyInfo.value.unitName = unitName
2024-11-19 16:27:00 +08:00
leaseApplyInfo.value.storageNum = storageNum
leaseApplyInfo.value.preNum = preNum
leaseApplyInfo.value.alNum = alNum
leaseApplyInfo.value.id = id
leaseApplyInfo.value.typeId = typeId
leaseApplyInfo.value.manageType = manageType
2024-12-10 14:41:47 +08:00
leaseApplyInfo.value.unitValue = unitValue
2024-11-19 15:09:17 +08:00
if (status == 2) {
uni.showToast({ title: '该物资已完成出库!', icon: 'none' })
return
}
let codingUrl = ''
if (manageType === 0) {
codingUrl = '/pages/picking/outbound/code-outbound' // 编码出库
}
2024-11-19 18:07:40 +08:00
if (manageType == 1) {
2024-11-19 15:09:17 +08:00
codingUrl = '/pages/picking/outbound/num-outbound' // 数量出库
}
2024-11-19 16:27:00 +08:00
// 把 leaseApplyInfo 领料信息转成 json 传递到下个页面
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(leaseApplyInfo.value)}` })
2024-11-19 15:09:17 +08:00
}
2024-12-04 17:14:05 +08:00
onShow(() => {
2024-12-17 17:21:13 +08:00
getOutboundDetailsData()
2024-11-19 14:52:39 +08:00
})
</script>
<style lang="scss" scoped>
.page-container {
display: flex;
height: 100%;
padding: 0 15rpx;
flex-direction: column;
background-color: #e8f5fb;
.search-form {
margin: 10rpx 0;
display: flex;
align-items: center;
box-sizing: content-box;
}
.search {
height: 60rpx;
background-color: #3784fb;
text-align: center;
line-height: 60rpx;
color: #fff;
border-radius: 10rpx;
}
.scroll-container {
.table-list-item {
margin-bottom: 20rpx;
padding: 20rpx;
background-color: #fff;
min-height: 300rpx;
border-radius: 10rpx;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
.title {
display: flex;
justify-content: space-between;
align-items: center;
}
.line {
margin: 20rpx 0;
height: 1px;
background-color: #e8e8e8;
}
}
}
}
// 加载提示文字
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
</style>