From e065047450407e9b0448e2b3e7786f8959f35cf9 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期三, 06 九月 2023 09:35:15 +0800
Subject: [PATCH] 小程序

---
 minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue |   98 ++++++++++++++++++++++++++++++++++---------------
 1 files changed, 68 insertions(+), 30 deletions(-)

diff --git a/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue b/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue
index 413f853..b7d0818 100644
--- a/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue
+++ b/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue
@@ -29,26 +29,25 @@
 		</view>
 		<view class="zk_wl">
 			<template v-if="view.MaterialList.length > 0">
-				<van-swipe-cell v-for="(item, i) in view.MaterialList" :key="i">
-					<view class="zk_wl_item">
-						<text>{{item.materialName}}锝渰{item.materialCode}}</text>
-						<text>
-							<text class="green" v-if="item.qualityType === '0'">鍚堟牸</text>
-							<text class="yellow" v-if="item.qualityType === '1'">涓嶈壇</text>
-							<text class="red" v-if="item.qualityType === '2'">鎶ュ簾</text>
-							| <text>{{item.procedureName ? item.procedureName : '-'}} | </text>
-							<text>{{item.batch ? item.batch : '-'}}</text>
-						</text>
+				<view class="zk_wl_item" v-for="(item, i) in view.MaterialList" :key="i">
+					<image class="shanchu" src="@/static/chuku_ic_delete@2x.png" mode="widthFix" @click="dele(i)"></image>
+					<text>{{item.materialName}}锝渰{item.materialCode}}</text>
+					<text>
+						<text class="green" v-if="item.qualityType === '0'">鍚堟牸&nbsp;|</text>
+						<text class="yellow" v-if="item.qualityType === '1'">涓嶈壇&nbsp;|</text>
+						<text class="red" v-if="item.qualityType === '2'">鎶ュ簾&nbsp;|</text>
+						<text>{{item.procedureName ? item.procedureName : '-'}}&nbsp;|&nbsp;</text>
+						<text>{{item.batch ? item.batch : '-'}}</text>
+					</text>
+					<view class="zk_wl_item_num">
 						<text>璐т綅锛歿{item.locationName}}</text>
-						<view class="zk_wl_item_num">
-							<text>杞嚭鏁伴噺({{item.unitName}})锛�</text>
+						<view class="zk_wl_item_input">
+							<text>鏁伴噺锛�</text>
 							<input type="number" v-model="item.total" placeholder="0" />
+							<text>{{item.unitName}}</text>
 						</view>
 					</view>
-					<template #right>
-						<van-button square type="danger" style="height: 100%;" text="鍒犻櫎" @click="dele(i)" />
-					</template>
-				</van-swipe-cell>
+				</view>
 			</template>
 			<view class="zk_wl_w" v-else>
 				<text>鏆傛棤鏁版嵁</text>
@@ -63,7 +62,12 @@
 		<!-- 閫夋嫨浠撳簱 -->
 		<Warehouse :show="view.Warehouse" @close="view.Warehouse = false" @value="getValue" />
 		<!-- 閫夋嫨鐗╂枡 -->
-		<SelectMultipleMaterial ref="SelectMultipleMaterial" />
+		<multipleMaterial
+		:warehouseId="data.exWarehouseId.toString()"
+		:warehouseQualityType="view.warehouseQualityType"
+		:selected="view.MaterialList.map(item => item.id)"
+		@value="getValueWL"
+		ref="multipleMaterial" />
 		<!--  鍗曟嵁绫诲瀷  -->
 		<u-picker :show="view.type" :columns="view.documentTypeDate" keyName="name" @cancel="onCancel" @confirm="onConfirm"></u-picker>
 	</view>
@@ -72,13 +76,13 @@
 <script>
 	import { setTime } from '@/util/utils.js'
 	import { documentType } from '@/util/constData.js'
-	import SelectMultipleMaterial from '@/components/SelectMultipleMaterial.vue'
+	import multipleMaterial from '../../components/multipleMaterial.vue'
 	import Warehouse from '../../components/Warehouse.vue'
 	import { createZK } from '@/util/api/agencyAPI'
 	
 	export default {
 		components: {
-			SelectMultipleMaterial,
+			multipleMaterial,
 			Warehouse
 		},
 		data() {
@@ -117,17 +121,21 @@
 						    { name: '搴熷搧鍏ュ簱', id: 30 }
 						]
 					],
-					warehouseQualityType: '',
-					customFieldName: {
-						text: 'name'
-					}
+					warehouseQualityType: ''
 				}
 			};
 		},
 		methods: {
+			// 鍒犻櫎鐗╂枡
+			dele(i) {
+				this.view.MaterialList.splice(i, 1)
+			},
 			// 浠撳簱鍥炶皟
 			getValue(val) {
 				if (this.view.status === 'c') {
+					if (this.data.exWarehouseId !== val.id) {
+						this.view.MaterialList = []
+					}
 					this.data.exWarehouse = val.name
 					this.data.exWarehouseId = val.id
 					this.data.outUserId = val.managerId
@@ -138,6 +146,14 @@
 					this.view.warehouseQualityType = val.tmodel.label
 				}
 				this.view.Warehouse = false
+			},
+			// 鐗╂枡鍥炶皟
+			getValueWL(val) {
+				val.forEach(element => {
+					element.total = element.num
+				})
+				this.view.MaterialList.push(...val)
+				this.view.Material = false
 			},
 			// 纭鍗曟嵁绫诲瀷
 			onConfirm(val) {
@@ -178,8 +194,8 @@
 						proceduresId: element.procedureId,
 						inLocationId: null,
 						outLocationId: element.locationId,
-						inWarehouseId: data.exWarehouseId,
-						outWarehouseId: data.warehousingWarehouse
+						inWarehouseId: this.data.exWarehouseId,
+						outWarehouseId: this.data.warehousingWarehouse
 					})
 				})
 				createZK({
@@ -194,7 +210,7 @@
 					wtransferDetailBeanList
 				}).then(res => {
 					if (res.code === 200) {
-						uni.showToast({ title: '鍒涘缓鎴愬姛锛�', icon: 'none', duration: 2000 });
+						uni.showToast({ title: '鍒涘缓鎴愬姛锛�', icon: 'success', duration: 2000 });
 						setTimeout(() => {
 							uni.navigateBack({ delta: 1 });
 						}, 2000)
@@ -221,7 +237,7 @@
 							// const { selected } = Material.value
 							// Material.value.selected = arr
 							// view.Material = true
-							this.$refs.SelectMultipleMaterial.open({})
+							this.$refs.multipleMaterial.open()
 						} else {
 							uni.showToast({ title: '璇峰厛閫夋嫨鍏ュ簱浠撳簱', icon: 'none', duration: 2000 });
 						}
@@ -314,22 +330,43 @@
 				flex-direction: column;
 				padding: 30rpx;
 				border-bottom: 1rpx solid #e2e2e2;
+				position: relative;
+				
+				.shanchu {
+					width: 48rpx;
+					height: 48rpx;
+					position: absolute;
+					top: 0;
+					right: 0;
+				}
 
 				.zk_wl_item_num {
 					display: flex;
 					align-items: center;
 					justify-content: space-between;
 					margin-top: 30rpx;
+					
+					.zk_wl_item_input {
+						display: flex;
+						align-items: center;
+						text {
+							font-size: 26rpx;
+							font-family: PingFangSC-Regular, PingFang SC;
+							font-weight: 400;
+							color: #666666;
+						}
+					}
 
 					text {
-						font-size: 28rpx;
+						font-size: 26rpx;
+						font-family: PingFangSC-Regular, PingFang SC;
 						font-weight: 400;
-						color: #222222;
+						color: #333333;
 						margin: 0 !important;
 					}
 
 					input {
-						width: 180rpx;
+						width: 140rpx;
 						height: 60rpx;
 						background: #FFFFFF;
 						border-radius: 8rpx;
@@ -384,6 +421,7 @@
 			position: fixed;
 			bottom: 0;
 			left: 0;
+			z-index: 999;
 			padding-bottom: 68rpx;
 			display: flex;
 			align-items: center;

--
Gitblit v1.9.3