SmartStorage/pages/backMaterialReceiveDetail/backMaterialReceiveDetail.vue

342 lines
7.4 KiB
Vue
Raw Normal View History

2023-12-23 23:21:42 +08:00
<template>
<view>
<view
class="single-fetch"
v-for="(fetch, index) in fetchList"
:key="index"
@click="openPopup(fetch)"
>
<view>
<span>类型名称</span>
<h4>{{ fetch.typeName }}</h4>
</view>
<view>
<span>规格型号</span>
<h4>{{ fetch.typeModelName }}</h4>
</view>
<view>
<span>待出库数量</span>
<h4>{{ fetch.preNum }}</h4>
</view>
</view>
<uni-popup
ref="popup1"
type="center"
:mask-click="false"
>
<view class="popup1">
<view class="pop-top">
<h4>退料接收</h4>
<uni-icons
style="color: #AAAAAA; font-weight: bold;"
type="closeempty"
size="32"
@click="closePopup1"
>
</uni-icons>
</view>
<h5 style="width: 85%; margin: 2vh auto; font-weight: normal; text-align: center;">请选择接收方式</h5>
<view class="select-area">
<view @click="scanCode">二维码</view>
<view @click="codeOut">编码接收</view>
</view>
<!-- <view class="ipt-area">
<uni-easyinput v-model="codeVal" placeholder="请输入编码"></uni-easyinput>
</view> -->
</view>
</uni-popup>
<uni-popup
ref="popup2"
type="center"
:mask-click="false"
>
<view class="popup2">
<view class="pop-top">
<h4>退料接收</h4>
<uni-icons
style="color: #AAAAAA; font-weight: bold;"
type="closeempty"
size="32"
@click="closePopup2"
>
</uni-icons>
</view>
<view class="info-area">
<view>
<h4>类型名称</h4>
<span>{{ infoList.typeName }}</span>
</view>
<view>
<h4>规格型号</h4>
<span>{{ infoList.typeModelName }}</span>
</view>
<view>
<h4>待入库数量</h4>
<span>{{ infoList.preNum }}</span>
</view>
<!-- <view style="flex-direction: column;">
<h4 style="margin-bottom: 30rpx;">待修状态</h4>
<uni-data-checkbox v-model="fixVal" :localdata="fixRange"></uni-data-checkbox>
</view> -->
<view>
<h4>合格数量</h4>
<uni-easyinput type="number" v-model="passedNum" placeholder="请输入"></uni-easyinput>
</view>
<view>
<h4>待修数量</h4>
<uni-easyinput type="number" v-model="waitRepairNum" placeholder="请输入"></uni-easyinput>
</view>
<view>
<h4>待报废数量</h4>
<uni-easyinput type="number" v-model="waitCrashNum" placeholder="请输入"></uni-easyinput>
</view>
</view>
<view
class="sub-btn"
@click="multiOut"
>
退料接收
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
fetchList: [
],
codeVal: '',
manageType: '',
infoList: '',
multiNum: 1,
subList: {},
fixVal: '',
fixRange: [
{ text: '合格', value: '0' },
{ text: '待修', value: '1' },
{ text: '待报废', value: '2' }
],
passedNum: '',
waitRepairNum: '',
waitCrashNum: ''
}
},
methods: {
openPopup (list) {
this.infoList = list
console.log(this.infoList.manageType, this.infoList);
if (this.infoList.manageType == 0) {
this.$refs.popup1.open()
} else if (this.infoList.manageType == 1) {
this.$refs.popup2.open()
}
},
closePopup1 () {
this.$refs.popup1.close()
},
closePopup2 () {
this.$refs.popup2.close()
},
scanCode () {
this.closePopup1()
uni.scanCode({
success: (res) => {
console.log(res);
uni.navigateTo({
url: `/pages/scanReceive/scanReceive?code=${res.result}&typeId=${this.infoList.typeId}&num=${this.infoList.preNum}&parentId=${this.infoList.parenntId}`
})
}
})
},
codeOut () {
this.closePopup1()
console.log(this.infoList);
uni.navigateTo({
url: `/pages/codeReceive/codeReceive?typeId=${this.infoList.typeId}&num=${this.infoList.preNum}&parentId=${this.infoList.parenntId}`
})
},
multiOut () {
let that = this
this.closePopup2()
that.subList = {
parentId: that.infoList.parenntId,
typeId: that.infoList.typeId,
outNum: that.multiNum,
companyId: uni.getStorageSync('userInfo').sysUser.companyId
}
console.log(that.subList);
that.$api.fetchMaterialOutStore.subOutStore(that.subList, null).then(res => {
console.log(res);
if (res.data.code == 200) {
uni.showToast({
icon: 'none',
title: '退料接收成功!',
success: () => {
uni.navigateBack()
}
})
} else {
uni.showToast({
icon: 'none',
title: '退料接收失败!'
})
}
}).catch(err => {
console.log(err);
})
}
},
onLoad(params) {
let that = this
console.log(params.taskId);
// 获取详情
that.$api.fetchExam.fetchExamList({
taskId: params.taskId
}, null).then(res => {
if (res.data.code == 200) {
for (let i = 0; i < res.data.data.rows[0].leaseApplyInfoList.length; i++) {
that.fetchList.push(res.data.data.rows[0].leaseApplyInfoList[i].leaseApplyDetails[0])
}
// that.fetchList[1].manageType = 0
console.log(that.fetchList);
}
}).catch(err => {
console.log(err);
})
}
}
</script>
<style lang="scss">
.single-fetch{
width: 100%;
box-sizing: border-box;
padding: 20rpx 35rpx;
border-bottom: 1px solid #DDDDDD;
view{
display: flex;
align-items: center;
margin-bottom: 25rpx;
span{
color: #A7A7A7;
padding-right: 20rpx;
}
h4{
font-size: 14px;
font-weight: normal;
}
}
view:last-child{
margin-bottom: 0;
}
}
.btm-exam{
position: fixed;
left: 0;
bottom: 0;
width: 100%;
box-sizing: border-box;
padding: 20rpx 40rpx;
display: flex;
justify-content: flex-end;
border-top: 2px solid #F6F8FF;
.exam{
box-sizing: border-box;
padding: 10rpx 50rpx;
border-radius: 30rpx;
background-color: #3788FF;
font-size: 14px;
color: #fff;
}
}
.popup1{
width: 80vw;
height: 20vh;
background-color: #fff;
border-radius: 15rpx;
overflow: hidden;
background: linear-gradient(#D9E7FE, #fff, #fff, #fff);
.pop-top{
width: 100%;
height: 5vh;
box-sizing: border-box;
padding: 0 25rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.select-area{
width: 85%;
margin: 40rpx auto;
display: flex;
justify-content: space-around;
align-items: center;
view{
box-sizing: border-box;
font-size: 14px;
padding: 10rpx 20rpx;
border: 1px solid #D5D5D4;
border-radius: 20rpx;
}
}
.ipt-area{
width: 85%;
margin: 40rpx auto;
}
}
.popup2{
width: 80vw;
height: 60vh;
background-color: #fff;
border-radius: 15rpx;
overflow: hidden;
background: linear-gradient(#D9E7FE, #fff, #fff, #fff);
.pop-top{
width: 100%;
height: 5vh;
box-sizing: border-box;
padding: 0 25rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.info-area{
width: 85%;
margin: 30rpx auto;
display: flex;
flex-direction: column;
view{
margin-bottom: 15rpx;
display: flex;
align-items: center;
h4{
font-weight: normal;
color: #989898;
font-size: 14px;
width: 35%;
}
span{
font-size: 14px;
}
}
}
.sub-btn{
width: 85%;
margin: 30rpx auto;
background-color: #3788FF;
color: #fff;
box-sizing: border-box;
padding: 15rpx 0;
display: flex;
justify-content: center;
align-items: center;
border-radius: 40rpx;
font-size: 14px;
}
}
</style>