From 1e993780749c9525be74e77e4c81b7db2c88da6f Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期四, 07 九月 2023 09:08:36 +0800
Subject: [PATCH] 小程序

---
 minipro_standard/pages/OutOperation/OutOperation.vue |  324 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 172 insertions(+), 152 deletions(-)

diff --git a/minipro_standard/pages/OutOperation/OutOperation.vue b/minipro_standard/pages/OutOperation/OutOperation.vue
index 83f7e78..80bb6f3 100644
--- a/minipro_standard/pages/OutOperation/OutOperation.vue
+++ b/minipro_standard/pages/OutOperation/OutOperation.vue
@@ -2,7 +2,7 @@
 	<view>
 		<InOutInfo :info="info" />
 		<uni-collapse @change="change" @close="close" @open="open">
-			<uni-collapse-item v-if="type==7" v-for="(item1, index) in warehouseList" :key="index">
+			<uni-collapse-item :open="item1.wtransferDetailList.length" v-if="type==7" v-for="(item1, index) in warehouseList" :key="index">
 				<view class="p30 cY" style="border-bottom: 4rpx solid #f7f7f7;" slot="title">
 					<image src="../../static/chuku_ic_cangku@2x.png" class="img36 mr10" mode=""></image>
 					<view>{{ item1.warehouseName }}</view>
@@ -19,7 +19,7 @@
 						<div class="page_content_title">
 							<div class="page_content_title_top">
 								<span>{{ item.materialName + ' | ' + item.materialCode }}</span>
-								<span>寰呭嚭{{ item.materialName + ' | ' + item.materialCode }}</span>
+								<span>寰呭嚭<span>{{ item.outPlannum }}</span> {{ item.unitName }}</span>
 							</div>
 							<div class="page_content_title_bottom">
 								<span class="green" v-if="item.qualityType === 0">鍚堟牸&nbsp;<span
@@ -33,18 +33,18 @@
 								<span>{{item.batch ? item.batch : '-'}}</span>
 							</div>
 						</div>
-						<div class="page_content_list">
+						<div class="page_content_list" v-for="(childer, idxs) in item.wstockExtListVOList" :key="idxs">
 							<div class="page_content_list_item">
 								<div class="page_content_list_item_label">鍑哄簱璐т綅锛�</div>
-								<div class="page_content_list_item_nr">
-									{{item.outLocationName ? item.outLocationName : '-'}}
-								</div>
+								<div class="page_content_list_item_nr">{{ childer.locationName }}</div>
 							</div>
 							<div class="page_content_list_items">
 								<div class="page_content_list_item_label">鏁伴噺锛�</div>
-								<div class="page_content_list_item_nr">
-									{{item.outPlannum ? item.outPlannum : '-'}}{{item.unitName}}
-								</div>
+								<div class="page_content_list_item_nr">{{ childer.num }}{{ childer.unitName }}</div>
+							</div>
+							<div class="page_content_list_item">
+								<div class="page_content_list_item_label">鎵规鍙凤細</div>
+								<div class="page_content_list_item_nr">{{ childer.batch ? childer.batch : '-' }}</div>
 							</div>
 						</div>
 					</div>
@@ -142,7 +142,7 @@
 							</div>
 						</div>
 						<div class="dele" @click="dele(index)">
-							<!-- <img src="@/assets/icon/chuku_ic_delete@2x.png" alt="" /> -->
+							<!-- <img src="@/assets/icon/chuku_ic_delete@2x.png" alt="" /> -->
 							<image src="../../static/chuku_ic_delete@2x.png" class="img24" mode=""></image>
 						</div>
 					</div>
@@ -157,7 +157,7 @@
 				<span>纭鍑哄簱</span>
 			</div>
 		</div>
-		<SelectTraMultipleMaterial ref="selectTraMultipleMaterial" />
+		<SelectTraMultipleMaterial ref="selectTraMultipleMaterial" @selectes="selectMaterail" />
 	</view>
 </template>
 
@@ -262,20 +262,114 @@
 			close() {},
 			open() {},
 			openxz() {
-				// let arr = []
-				// if (this.info.wtransferRedisCodeBeanList.length !== 0) {
-				// 	this.info.wtransferRedisCodeBeanList.forEach(element => {
-				// 		arr.push(element.appliancesId)
-				// 	})
-				// 	this.ids = arr.join(',')
-				// } else {
-				// 	this.ids = ''
-				// }
-				this.$refs.selectTraMultipleMaterial.open({
-					transferId: this.id,
-					warehouseId: this.warehouseId
+				this.$refs.selectTraMultipleMaterial.open({
+					transferId: this.id,
+					warehouseId: this.warehouseId
 				})
 			},
+			selectMaterail(v) {
+				let tempList = this.warehouseList[0].wtransferDetailList
+				let materials = v.materials
+
+				materials.forEach(materail => {
+					tempList.forEach(item => {
+						if (materail.materialId == item.materialId && materail.procedureId == item
+							.procedureId && materail.qualityType == item.qualityType && materail.batch ==
+							item.batch) {
+							let isExist = false
+							this.outboundList.forEach(selected => {
+								if (selected.newId == materail.id) {
+									isExist = true
+									return
+								}
+							})
+							if (isExist) {
+								uni.$u.toast('璇ョ墿鏂欐壒娆″凡瀛樺湪')
+								return
+							}
+							let obj = JSON.parse(JSON.stringify(materail))
+							obj.newId = item.id
+							this.outboundList.push(obj)
+						}
+					})
+				})
+			},
+			submit() {
+				if (this.type == QRCodeType.ZKD) {
+					if (this.outboundList.length > 0) {
+						let result = this.outboundList.reduce((a, b) => {
+							if (a[b.newId]) {
+								a[b.newId].push(b);
+							} else {
+								a[b.newId] = [b];
+							}
+							return a;
+						}, {});
+						let tempList = this.warehouseList[0].wtransferDetailList
+
+						for (let i = 0; i < tempList.length; i++) {
+							let item = tempList[i]
+							for (let a in result) {
+								if (item.id == a) {
+									let total = 0
+									for (let b = 0; b < result[a].length; b++) {
+										total = Number(total) + Number(result[a][b].num)
+									}
+									if (!total || total <= 0) {
+										uni.$u.toast('鍑哄簱鐗╂枡鏁伴噺蹇呴』澶т簬0')
+										return
+									}
+									console.log(total, item.outPlannum);
+									if (total > item.outPlannum) {
+										uni.$u.toast('鍑哄簱鏁伴噺涓嶈兘澶т簬寰呭嚭搴撴暟閲�')
+										return
+									}
+								}
+							}
+						}
+						let submitTransferOutDetailDTOList = []
+						this.outboundList.forEach(item => {
+							tempList.forEach(child => {
+								if (item.newId == child.id) {
+									submitTransferOutDetailDTOList.push({
+										outNum: item.num,
+										wstockId: item.id,
+										wtransferDetailId: child.id
+									})
+								}
+							})
+						})
+						transferToOutNew({
+							submitTransferOutDetailDTOList,
+							wtransferId: this.id
+						}).then(res => {
+							if (res.code === 200) {
+								this.$store.dispatch.dispatch('getUpcomingNum')
+								uni.$u.toast('鎿嶄綔鎴愬姛')
+								// setTimeout(() => {
+								//   router.replace({ name: 'wTransferDetail', query: { id: info.value.wtransfer.id, dbid: route.query.dbid } })
+								// }, 2000)
+							}
+						})
+					} else {
+						uni.$u.toast('璇烽�夋嫨鍑哄簱鐗╂枡')
+					}
+				} else if (this.type === QRCodeType.CKD) {
+					wOutBoundForUpload({
+						id: info.value.woutbound.id,
+						wOutboundType: 0
+					}).then(res => {
+						if (res.code === 200) {
+							this.$store.dispatch.dispatch('getUpcomingNum')
+							uni.$u.toast('鎿嶄綔鎴愬姛')
+							// setTimeout(() => {
+							//   // router.go(-1)
+							//   router.replace({ name: 'wOutboundDetail', query: { id: info.value.wtransfer.id } })
+							// }, 2000)
+						}
+					})
+				}
+			}
 		}
 	}
 </script>
@@ -558,135 +652,61 @@
 					margin-top: 15rpx;
 				}
 
-				.page_yxwl_list_item_num {
-					display: flex;
-					flex-direction: column;
-
-					// margin-top: 30rpx;
-					&:first-child {
-						margin-top: 0;
-					}
-
-					.dis {
-						display: flex;
-					}
-
-					.itemy {
-						margin-top: 20rpx;
-						width: 100%;
-						display: flex;
-						align-items: center;
-						position: relative;
-
-						.itemy_item {
-							flex: 1;
-							display: flex;
-							align-items: center;
-
-							.label {
-								font-size: 26rpx;
-								font-weight: 400;
-								color: #666666;
-								flex-shrink: 0;
-							}
-
-							.nr {
-								font-size: 26rpx;
-								font-weight: 400;
-								color: #222222;
-
-								input {
-									width: 100rpx;
-									height: 35rpx;
-									border-radius: 8rpx;
-									border: 1rpx solid #E5E5E5;
-									margin-right: 10rpx;
-									margin-left: 5rpx;
-								}
-
-								span {
-									font-size: 26rpx;
-									font-weight: 400;
-									color: #222222;
-								}
-							}
-						}
-
-						.dele {
-							position: absolute;
-							right: -30rpx;
-							width: 48rpx;
-							height: 48rpx;
-
-							img {
-								width: 100%;
-								height: 100%;
-							}
-						}
-					}
-
-					.items {
-						width: 50%;
-						display: flex;
-						align-items: center;
-
-						.label {
-							font-size: 26rpx;
-							font-weight: 400;
-							color: #666666;
-							flex-shrink: 0;
-						}
-
-						.nr {
-							font-size: 26rpx;
-							font-weight: 400;
-							color: #222222;
-
-							input {
-								width: 100rpx;
-								height: 40rpx;
-								margin-right: 10rpx;
-							}
-
-							span {
-								font-size: 26rpx;
-								font-weight: 400;
-								color: #222222;
-							}
-						}
-					}
-
-					.item {
-						width: 70%;
-						display: flex;
-						align-items: center;
-
-						.label {
-							font-size: 26rpx;
-							font-weight: 400;
-							color: #666666;
-							flex-shrink: 0;
-						}
-
-						.nr {
-							font-size: 26rpx;
-							font-weight: 400;
-							color: #222222;
-
-							input {
-								width: 100rpx;
-								height: 40rpx;
-								margin-right: 10rpx;
-							}
-
-							span {
-								font-size: 26rpx;
-								font-weight: 400;
-								color: #222222;
-							}
-						}
-					}
-				}
+				.page_yxwl_list_item_num {
+				          display: flex;
+				          position: relative;
+				          margin-top: 36rpx;
+				
+				          &:first-child {
+				            margin-top: 0;
+				          }
+				
+				          .dele {
+				            position: absolute;
+				            right: -30rpx;
+				            width: 48rpx;
+				            height: 48rpx;
+				
+				            img {
+				              width: 100%;
+				              height: 100%;
+				            }
+				          }
+				
+				          .item {
+				            width: 50%;
+				            display: flex;
+				            align-items: center;
+				
+				            .label {
+				              flex-shrink: 0;
+				              font-size: 26rpx;
+				              font-weight: 400;
+				              color: #666666;
+				              flex-shrink: 0;
+				            }
+				
+				            .nr {
+				              flex: 1;
+				              display: flex;
+				              align-items: center;
+				
+				              input {
+				                width: 130rpx;
+				                height: 40rpx;
+				                border-radius: 8rpx;
+				                border: 1rpx solid #E5E5E5;
+				                margin-right: 10rpx;
+				              }
+				
+				              span {
+				                font-size: 26rpx;
+				                font-weight: 400;
+				                color: #222222;
+				              }
+				            }
+				          }
+				        }
 			}
 		}
 

--
Gitblit v1.9.3