<template>
|
<view>
|
<view class="content">
|
<view class="itemstyle">
|
<u-sticky>
|
<view style="background-color: #ffffff;">
|
<uni-search-bar @confirm="search" v-model="searchValue"></uni-search-bar>
|
</view>
|
</u-sticky>
|
<uni-forms label-width="50">
|
<uni-forms-item label="出库区域"><uni-data-select v-model="value"
|
:localdata="range"></uni-data-select></uni-forms-item>
|
</uni-forms>
|
<uni-list :border="true" class="order-list">
|
<uni-list-item v-for="item in orderInfo" :key="item.id" class="list-item">
|
<template v-slot:body>
|
<view class="item-content">
|
<view class="info-section">
|
<text class="info-label">单据编号:</text>
|
<text class="info-value">{{ orderNo }}</text>
|
|
<text class="info-label">物料编码:</text>
|
<text class="info-value">{{ item.materielCode }}</text>
|
|
<text class="info-label">物料名称:</text>
|
<text class="info-value">{{ item.materielName }}</text>
|
|
<text class="info-label">单据数量:</text>
|
<text class="info-value">{{ item.orderQuantity }}</text>
|
|
<text class="info-label">出库数量:</text>
|
<text class="info-value">{{ item.overOutQuantity }}</text>
|
</view>
|
|
<button class="action-btn" type="primary" size="mini" @click="handleOutbound(item.id)">
|
出库
|
</button>
|
</view>
|
</template>
|
</uni-list-item>
|
</uni-list>
|
|
|
</view>
|
<u-toast ref="uToast" />
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
config
|
} from '../../common/config';
|
const innerAudioContext = uni.createInnerAudioContext();
|
export default {
|
data() {
|
return {
|
current: 0,
|
orderNo: "",
|
Id: 0,
|
orderIds: [],
|
orderInfo: [],
|
searchValue: "",
|
value: "2",
|
range: [],
|
}
|
},
|
// onShow() {},
|
onLoad(res) {
|
this.Id = res.Id;
|
this.orderNo = res.orderNo;
|
this.range = config.OutArea;
|
this.getData();
|
},
|
methods: {
|
search() {
|
this.getData();
|
},
|
getData() {
|
this.orderInfo = [];
|
var postData = {
|
id: this.Id,
|
searchValue: this.searchValue,
|
};
|
this.$u.post('/api/ProductionOutboundOrder/GettProductOutboundOrderDetail', postData).then((res) => {
|
if (res.status) {
|
this.orderInfo = res.data;
|
}
|
})
|
},
|
OutBound(id) {
|
this.orderIds = [];
|
this.orderIds.push(id);
|
var postData = {
|
AreaId: this.value,
|
orderIds: this.orderIds
|
};
|
this.$u.post('/api/ProductionOutboundOrder/GeneratetProductOutboundTask', postData).then(res => {
|
if (res.status) {
|
this.items = [];
|
uni.$showMsg(res.message);
|
setTimeout(() => {}, 200);
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
})
|
}
|
}).catch(err => {
|
this.$refs.uToast.show({
|
title: err.message,
|
type: "error"
|
})
|
})
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
@import '@/common/uni-ui.scss';
|
|
.flex-row {
|
display: flex;
|
justify-content: space-between;
|
/* 左右对齐 */
|
align-items: center;
|
/* 垂直居中 */
|
padding: 10rpx 0;
|
}
|
|
.label {
|
color: #666;
|
width: 200rpx;
|
/* 固定标签宽度 */
|
text-align: left;
|
}
|
|
.value {
|
flex: 1;
|
text-align: right;
|
color: #333;
|
font-weight: bold;
|
}
|
|
.container {
|
padding: 20rpx;
|
}
|
|
.search-bar {
|
background: #fff;
|
padding: 15rpx 0;
|
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.1);
|
z-index: 10;
|
}
|
|
.filter-section {
|
margin: 20rpx 0;
|
}
|
|
.order-list {
|
.list-item {
|
margin-bottom: 15rpx;
|
border-radius: 10rpx;
|
overflow: hidden;
|
box-shadow: 0 1rpx 3rpx rgba(0, 0, 0, 0.05);
|
|
.item-content {
|
display: flex;
|
justify-content: space-between;
|
align-items: flex-start;
|
padding: 20rpx;
|
|
.info-section {
|
flex: 1;
|
display: grid;
|
grid-template-columns: auto 1fr;
|
gap: 10rpx 15rpx;
|
|
.info-label {
|
color: #666;
|
font-size: 28rpx;
|
grid-column: 1;
|
}
|
|
.info-value {
|
color: #333;
|
font-size: 28rpx;
|
font-weight: 500;
|
grid-column: 2;
|
}
|
}
|
|
.action-btn {
|
margin-left: 150rpx;
|
align-self: center;
|
}
|
}
|
}
|
}
|
</style>
|