<template>
|
<view><uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
|
</uni-segmented-control>
|
<view class="content">
|
<view v-if="current === 0" class="headerstyle">
|
<div style="padding: 30px;">
|
<view class="flex-row">
|
<view class="label">单号:</view>
|
<view class="value">{{orderDetail.orderNo}}</view>
|
</view>
|
<view class="flex-row">
|
<view class="label">上游单号:</view>
|
<view class="value">{{orderDetail.upperOrderNo}}</view>
|
</view>
|
<view class="flex-row">
|
<view class="label">物料编码:</view>
|
<view class="value">{{orderDetail.materielCode}}</view>
|
</view>
|
<view class="flex-row">
|
<view class="label">单据数量:</view>
|
<view class="value">{{orderDetail.orderQuantity}}</view>
|
</view>
|
<view class="flex-row">
|
<view class="label">已出库数量:</view>
|
<view class="value">{{orderDetail.overOutQuantity}}</view>
|
</view>
|
|
</div>
|
<view style="padding: 5%;">
|
<uni-forms label-width="120">
|
<uni-forms-item label="终 点 区 域">
|
<uni-data-select :focus="!istrue" v-model="AreaId" :localdata="range"
|
placeholder="请输选择入库终点区域"></uni-data-select>
|
</uni-forms-item>
|
</uni-forms>
|
<button @click="OutBound" type="primary" size="default" style="margin-top: 2%;">出库</button>
|
|
</view>
|
<u-toast ref="uToast" />
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
config
|
} from '../../common/config';
|
const innerAudioContext = uni.createInnerAudioContext();
|
export default {
|
data() {
|
return {
|
items: ['直接出库'],
|
current: 0,
|
orderNo: "",
|
Id: 0,
|
AreaId:"",
|
orderIds:[],
|
label: "",
|
range: [],
|
orderDetail: {
|
// id: "",
|
// orderNo: "",
|
// upperOrderNo: "",
|
// materielCode: "",
|
// materielName: "",
|
// orderQuantity: "",
|
// overOutQuantity: "",
|
},
|
focus: false,
|
key: [],
|
materielCode: "",
|
}
|
},
|
onShow() {},
|
onLoad(res) {
|
console.log(res);
|
this.focus = false;
|
this.addressFocus = false;
|
this.Id = res.Id;
|
this.range = config.AreaId;
|
this.getData();
|
},
|
methods: {
|
groupClick(materielCode, id) {
|
// window.location="/pages/materielGroup/OutOrderDetail?materielCode="+materielCode+"&id="+id;
|
// console.log(materielCode,id)
|
},
|
getData() {
|
var postData = this.Id;
|
this.$u.post('/api/OutboundOrder/GetOutboundOrderDetail?id=' + postData, "").then((res) => {
|
if (res.status) {
|
this.orderDetail = res.data;
|
// if (this.orderDetail.length > 3) {
|
// this.loadVisible = true;
|
// }
|
}
|
})
|
},
|
onClickItem(e) {
|
this.focus = false;
|
this.addressFocus = false;
|
if (this.current !== e.currentIndex) {
|
this.current = e.currentIndex;
|
if (this.current == 2) {
|
this.getData();
|
}
|
}
|
},
|
OutBound() {
|
this.orderIds.push(this.Id);
|
var postData = {
|
AreaId:this.AreaId,
|
orderIds:this.orderIds
|
};
|
this.$u.post('/api/StockInfo/GenerateOutboundTask', postData).then(res => {
|
if (res.status) {
|
this.items = [];
|
uni.$showMsg(res.message);
|
setTimeout(() => {
|
this.addressFocus = false;
|
}, 200);
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
})
|
}
|
}).catch(err => {
|
this.$refs.uToast.show({
|
title: err.message,
|
type: "error"
|
})
|
})
|
},
|
click(e) {
|
if (this.key.find(x => x.id == e.id)) {
|
this.key.map((item, index) => {
|
if (item.id == e.id) {
|
this.key.splice(index, 1);
|
}
|
})
|
} else {
|
this.key.push(e.id);
|
}
|
}
|
}
|
}
|
</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;
|
}
|
</style>
|