|
|
@@ -58,6 +58,18 @@
|
|
|
<view class="title_nape">删除</view>
|
|
|
</view> -->
|
|
|
</view>
|
|
|
+ <view class="box_serial_number" v-if="iceRaftData.length > 0">
|
|
|
+ <view class="card_frequency_title">选择冰排</view>
|
|
|
+ <view class="card_ice_code">
|
|
|
+ <view class="item_coding" v-for="(item,index) in iceRaftData" :key="index" @click="selectIce(item)">
|
|
|
+ <view style="display: flex;align-items: center;">
|
|
|
+ <span class="iconfont icon-bingpaiguanli iceIcon"></span>
|
|
|
+ <view class="title_coding">{{item.value}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="checked" v-if="item.flag"></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="card_frequency">
|
|
|
<view class="card_high space_between">
|
|
|
<view class="card_frequency_title">已录入冰排编号</view>
|
|
|
@@ -65,7 +77,10 @@
|
|
|
</view>
|
|
|
<view style="width: 100%;" v-if="list.length > 0">
|
|
|
<view class="item_coding" v-for="(item,index) in list" :key="index">
|
|
|
- <view class="title_coding">{{item}}</view>
|
|
|
+ <view style="display: flex;align-items: center;">
|
|
|
+ <span class="iconfont icon-bingpaiguanli iceIcon"></span>
|
|
|
+ <view class="title_coding">{{item}}</view>
|
|
|
+ </view>
|
|
|
<u-icon name="close-circle-fill" color="#c0c4cc" size="20"
|
|
|
@click="removeWaybill(item)"></u-icon>
|
|
|
</view>
|
|
|
@@ -109,6 +124,8 @@
|
|
|
title: '是否继续出库?',
|
|
|
content: '',
|
|
|
userInfo: {},
|
|
|
+
|
|
|
+ iceRaftData: []
|
|
|
}
|
|
|
},
|
|
|
onUnload() {
|
|
|
@@ -120,6 +137,7 @@
|
|
|
this.selectiveType = receive.id
|
|
|
if (receive.id == 'enter') {
|
|
|
this.typeFlag = true
|
|
|
+ this.getNotStoredIce()
|
|
|
} else {
|
|
|
this.typeFlag = false
|
|
|
}
|
|
|
@@ -130,6 +148,8 @@
|
|
|
if (incubator.id != this.incubator.id) {
|
|
|
this.incubator.id = incubator.id
|
|
|
this.incubator.name = incubator.name
|
|
|
+ this.list = []
|
|
|
+ this.getAvailable(incubator.id)
|
|
|
}
|
|
|
}
|
|
|
let freezer = uni.getStorageSync('freezerValue')
|
|
|
@@ -143,6 +163,42 @@
|
|
|
this.userInfo = userInfo
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取未入库冰排
|
|
|
+ getNotStoredIce() {
|
|
|
+ this.$api.get('/api/ice-raft/GetCoolerIceRaft').then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ let iceArr = res.data
|
|
|
+ let iceData = []
|
|
|
+ iceArr.forEach(item => {
|
|
|
+ let arrValue = {
|
|
|
+ flag: false,
|
|
|
+ value: item.code
|
|
|
+ }
|
|
|
+ iceData.push(arrValue)
|
|
|
+ })
|
|
|
+ this.iceRaftData = iceData
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取保温箱可使用冰排
|
|
|
+ getAvailable(id) {
|
|
|
+ this.$api.post('/api/ice-raft/GetCoolerBoxBindCieRaft', {
|
|
|
+ id: String(id),
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ let iceArr = res.data
|
|
|
+ let iceData = []
|
|
|
+ iceArr.forEach(item => {
|
|
|
+ let arrValue = {
|
|
|
+ flag: false,
|
|
|
+ value: item
|
|
|
+ }
|
|
|
+ iceData.push(arrValue)
|
|
|
+ })
|
|
|
+ this.iceRaftData = iceData
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
focus(flag) {
|
|
|
this.typeFlag = flag
|
|
|
if (flag) {
|
|
|
@@ -167,34 +223,44 @@
|
|
|
});
|
|
|
if (this.typeFlag) {
|
|
|
// 入库
|
|
|
- this.$api.post('/api/ice-raft/in-storage', {
|
|
|
- code: this.list,
|
|
|
- iceLockerId: this.coldCupboard.id,
|
|
|
- freezeClaim: Number(this.freezingDuration),
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.list = []
|
|
|
- this.freezingDuration = ''
|
|
|
- this.frequencyCoding = ''
|
|
|
- this.coldCupboard.id = null
|
|
|
- this.coldCupboard.name = ''
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: res.msg,
|
|
|
- duration: 3000
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: res.msg,
|
|
|
- duration: 3000
|
|
|
- });
|
|
|
- }
|
|
|
+ if (this.coldCupboard.id) {
|
|
|
+ this.$api.post('/api/ice-raft/in-storage', {
|
|
|
+ code: this.list,
|
|
|
+ iceLockerId: this.coldCupboard.id,
|
|
|
+ freezeClaim: Number(this.freezingDuration),
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.list = []
|
|
|
+ this.freezingDuration = ''
|
|
|
+ this.frequencyCoding = ''
|
|
|
+ this.coldCupboard.id = null
|
|
|
+ this.coldCupboard.name = ''
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ this.getNotStoredIce()
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ this.getIncubator()
|
|
|
+ }).catch(() => {
|
|
|
+ uni.hideLoading();
|
|
|
+ })
|
|
|
+ } else {
|
|
|
this.loading = false
|
|
|
- this.getIncubator()
|
|
|
- }).catch(() => {
|
|
|
- uni.hideLoading();
|
|
|
- })
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '请选择入库冷冻柜',
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
this.loading = false
|
|
|
this.$api.post('/api/ice-raft/isoutstorage', {
|
|
|
@@ -246,8 +312,10 @@
|
|
|
this.list = []
|
|
|
// this.suitableForCold = null
|
|
|
this.frequencyCoding = ''
|
|
|
- this.incubator.id = null
|
|
|
- this.incubator.name = ''
|
|
|
+ // this.incubator.id = null
|
|
|
+ // this.incubator.name = ''
|
|
|
+ this.list = []
|
|
|
+ this.getAvailable(this.incubator.id)
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: res.msg,
|
|
|
@@ -296,7 +364,7 @@
|
|
|
// scanType: ['qrCode'],
|
|
|
autoZoom: false,
|
|
|
success: (res) => {
|
|
|
- console.log(res);
|
|
|
+ // console.log(res);
|
|
|
if (res.result) {
|
|
|
let url = res.result;
|
|
|
this.frequencyCoding = url
|
|
|
@@ -334,6 +402,9 @@
|
|
|
this.list.push(this.frequencyCoding)
|
|
|
this.list = this.uniqueArray(this.list)
|
|
|
this.frequencyCoding = ''
|
|
|
+ this.iceRaftData.forEach(item => {
|
|
|
+ item.flag = this.list.includes(item.value)
|
|
|
+ })
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
@@ -344,6 +415,22 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ // 选择冰排
|
|
|
+ selectIce(value) {
|
|
|
+ this.iceRaftData.forEach(item => {
|
|
|
+ if (item.value == value.value) {
|
|
|
+ if (item.flag) {
|
|
|
+ item.flag = false
|
|
|
+ let arr = this.list.filter(item1 => item1 !== value.value);
|
|
|
+ this.list = arr
|
|
|
+ } else {
|
|
|
+ item.flag = true
|
|
|
+ this.list.push(item.value)
|
|
|
+ this.list = this.uniqueArray(this.list)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 去重
|
|
|
uniqueArray(arr) {
|
|
|
return [...new Set(arr)];
|
|
|
@@ -359,6 +446,10 @@
|
|
|
function deleteElementById(arr, key) {
|
|
|
return arr.filter((item) => item !== key);
|
|
|
}
|
|
|
+
|
|
|
+ this.iceRaftData.forEach(item => {
|
|
|
+ item.flag = this.list.includes(item.value)
|
|
|
+ })
|
|
|
},
|
|
|
}
|
|
|
}
|
|
|
@@ -433,6 +524,21 @@
|
|
|
margin-top: 20rpx;
|
|
|
}
|
|
|
|
|
|
+ .box_serial_number {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card_ice_code {
|
|
|
+ padding: 10rpx 0rpx;
|
|
|
+ max-height: 25vh;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+
|
|
|
+ .item_code_box {
|
|
|
+ padding: 10rpx 0rpx;
|
|
|
+ }
|
|
|
+
|
|
|
.card_frequency {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
@@ -447,6 +553,8 @@
|
|
|
|
|
|
span {
|
|
|
color: red;
|
|
|
+ margin-left: 5rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -455,15 +563,51 @@
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
width: 100%;
|
|
|
- margin-top: 10px;
|
|
|
+ // margin-top: 10px;
|
|
|
padding: 25rpx 0rpx;
|
|
|
- border-bottom: 2rpx solid #dfdfdf;
|
|
|
+ border-bottom: 2rpx solid #E4E7ED;
|
|
|
+ }
|
|
|
+
|
|
|
+ .iceIcon {
|
|
|
+ color: #19be6b;
|
|
|
+ margin-right: 10rpx;
|
|
|
+ font-size: 36rpx;
|
|
|
}
|
|
|
|
|
|
.title_coding {
|
|
|
font-size: 30rpx;
|
|
|
}
|
|
|
|
|
|
+ .checked {
|
|
|
+ position: relative;
|
|
|
+ width: 40rpx;
|
|
|
+ height: 40rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .checked::after {
|
|
|
+ content: "";
|
|
|
+ background-color: #19be6b;
|
|
|
+ width: 20rpx;
|
|
|
+ height: 4rpx;
|
|
|
+ position: absolute;
|
|
|
+ top: 30rpx;
|
|
|
+ left: 0rpx;
|
|
|
+ transform: rotate(30deg);
|
|
|
+ border-radius: 8rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .checked::before {
|
|
|
+ content: "";
|
|
|
+ background-color: #19be6b;
|
|
|
+ width: 30rpx;
|
|
|
+ height: 4rpx;
|
|
|
+ position: absolute;
|
|
|
+ top: 22rpx;
|
|
|
+ left: 12rpx;
|
|
|
+ transform: rotate(-50deg);
|
|
|
+ border-radius: 8rpx;
|
|
|
+ }
|
|
|
+
|
|
|
.card_empty {
|
|
|
width: 100%;
|
|
|
margin-top: 50rpx;
|