From 1aa94fb921d57707aa83009a75708aed4beaee95 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期五, 01 九月 2023 11:51:57 +0800
Subject: [PATCH] 小程序

---
 minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue |  419 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 419 insertions(+), 0 deletions(-)

diff --git a/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue b/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue
new file mode 100644
index 0000000..8899d5c
--- /dev/null
+++ b/minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue
@@ -0,0 +1,419 @@
+<template>
+	<view class="zk">
+		<view class="zk_list">
+			<view class="zk_list_item" @click="open('d')">
+				<text>鍗曟嵁绫诲瀷</text>
+				<view class="zk_list_item_n">
+					<text :style="data.typeName ? 'color: black;' : ''">{{data.typeName ? data.typeName : '璇烽�夋嫨'}}</text>
+					<u-icon name="arrow-right" color="#999999" size="20"></u-icon>
+				</view>
+			</view>
+			<view class="zk_list_item" @click="open('c')">
+				<text>鍑哄簱浠撳簱</text>
+				<view class="zk_list_item_n">
+					<text :style="data.exWarehouse ? 'color: black;' : ''">{{data.exWarehouse ? data.exWarehouse : '璇烽�夋嫨'}}</text>
+					<u-icon name="arrow-right" color="#999999" size="20"></u-icon>
+				</view>
+			</view>
+			<view class="zk_list_item" @click="open('r')">
+				<text>鍏ュ簱浠撳簱</text>
+				<view class="zk_list_item_n">
+					<text :style="data.warehousingWarehouseName ? 'color: black;' : ''">{{data.warehousingWarehouseName ? data.warehousingWarehouseName : '璇烽�夋嫨'}}</text>
+					<u-icon name="arrow-right" color="#999999" size="20"></u-icon>
+				</view>
+			</view>
+		</view>
+		<view class="zk_title">
+			<view class="zk_title_i"></view>
+			<text>杞嚭鐗╂枡鍒楄〃</text>
+		</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>
+						<text>璐т綅锛歿{item.locationName}}</text>
+						<view class="zk_wl_item_num">
+							<text>杞嚭鏁伴噺({{item.unitName}})锛�</text>
+							<input type="number" v-model="item.total" placeholder="0" />
+						</view>
+					</view>
+					<template #right>
+						<van-button square type="danger" style="height: 100%;" text="鍒犻櫎" @click="dele(i)" />
+					</template>
+				</van-swipe-cell>
+			</template>
+			<view class="zk_wl_w" v-else>
+				<text>鏆傛棤鏁版嵁</text>
+			</view>
+		</view>
+		<view class="zk_z"></view>
+		<view class="zk_footer">
+			<view class="zk_footer_wl" @click="open('w')">閫夋嫨鐗╂枡</view>
+			<view style="width: 20rpx"></view>
+			<view class="zk_footer_submit" @click="submit">鎻愪氦</view>
+		</view>
+		<!-- 閫夋嫨浠撳簱 -->
+		<Warehouse :show="view.Warehouse" @close="view.Warehouse = false" @value="getValue" />
+		<!-- 閫夋嫨鐗╂枡 -->
+		<SelectMultipleMaterial ref="SelectMultipleMaterial" />
+		<!--  鍗曟嵁绫诲瀷  -->
+		<u-picker :show="view.type" :columns="view.documentTypeDate" keyName="name" @cancel="onCancel" @confirm="onConfirm"></u-picker>
+	</view>
+</template>
+
+<script>
+	import { setTime } from '@/util/utils.js'
+	import { documentType } from '@/util/constData.js'
+	import SelectMultipleMaterial from '@/components/SelectMultipleMaterial.vue'
+	import Warehouse from '../../components/Warehouse.vue'
+	export default {
+		components: {
+			SelectMultipleMaterial,
+			Warehouse
+		},
+		data() {
+			return {
+				data: {
+					type: '',
+					outUserId: '',
+					inUserId: '',
+					typeName: '',
+					exWarehouse: '',
+					exWarehouseId: '',
+					warehousingWarehouse: '',
+					warehousingWarehouseName: ''
+				},
+				view: {
+					type: false,
+					Warehouse: false,
+					Material: false,
+					status: '',
+					MaterialList: [],
+					documentTypeDate: [
+						[
+						    { name: '杞﹂棿棰嗘枡', id: 1 },
+						    { name: '杞﹂棿杞簱', id: 5 },
+						    { name: '澶栧崗棰嗘枡杞簱', id: 6 },
+						    { name: '澶栧崗瀹屽伐杞簱', id: 7 },
+						    { name: '浜у搧鍏ュ簱', id: 8 },
+						    { name: '浜у搧杞簱', id: 9 },
+						    { name: '璁╂鏀捐鍏ュ簱', id: 10 },
+						    { name: '璁╂鏀捐杞簱', id: 11 },
+						    { name: '瀹㈣繑杩斾慨棰嗘枡', id: 12 },
+						    { name: '瀹㈣繑杩斾慨鍏ュ簱', id: 13 },
+						    { name: '璺ㄧ粍缁囪浆搴�', id: 14 },
+						    { name: '瀹㈤��杩斾慨棰嗘枡', id: 16 },
+						    { name: '瀹㈤��杩斾慨鍏ュ簱', id: 17 },
+						    { name: '搴熷搧鍏ュ簱', id: 30 }
+						]
+					],
+					warehouseQualityType: '',
+					customFieldName: {
+						text: 'name'
+					}
+				}
+			};
+		},
+		methods: {
+			// 浠撳簱鍥炶皟
+			getValue(val) {
+				if (this.view.status === 'c') {
+					this.data.exWarehouse = val.name
+					this.data.exWarehouseId = val.id || 1
+					this.data.outUserId = val.managerId || 3
+				} else if (this.view.status === 'r') {
+					this.data.warehousingWarehouseName = val.name
+					this.data.warehousingWarehouse = val.id || 2
+					this.data.inUserId = val.managerId || 4
+					this.view.warehouseQualityType = val.tmodel.label
+				}
+				view.Warehouse = false
+			},
+			// 纭鍗曟嵁绫诲瀷
+			onConfirm(val) {
+				this.data.type = val.value[0].id
+				this.data.typeName = val.value[0].name
+				this.view.type = false
+			},
+			onCancel() {
+				this.view.type = false
+			},
+			// 鍒涘缓杞簱鍗�
+			submit() {
+				if (!this.data.type) return uni.showToast({ title: '鍗曟嵁绫诲瀷涓嶈兘涓虹┖', icon: 'none', duration: 2000 });
+				if (!this.data.exWarehouse) return uni.showToast({ title: '鍑哄簱浠撳簱涓嶈兘涓虹┖', icon: 'none', duration: 2000 });
+				if (!this.data.warehousingWarehouse) return uni.showToast({ title: '鍏ュ簱浠撳簱涓嶈兘涓虹┖', icon: 'none', duration: 2000 });
+				if (this.view.MaterialList.length === 0) return uni.showToast({ title: '杞嚭鐗╂枡涓嶈兘涓虹┖', icon: 'none', duration: 2000 });
+				for (let i = 0; i < this.view.MaterialList.length; i++) {
+					if (!this.view.MaterialList[i].total || this.view.MaterialList[i].total <= 0) {
+						uni.showToast({ title: '杞嚭鏁伴噺蹇呴』澶т簬0', icon: 'none', duration: 2000 });
+						return
+					}
+					if (Number(this.view.MaterialList[i].total) > Number(this.view.MaterialList[i].num)) {
+						uni.showToast({ title: '杞簱鐨勭墿鏂欐暟閲忎笉鑳藉ぇ浜庡簱瀛橀噺锛�', icon: 'none', duration: 2000 });
+						return
+					}
+				}
+				let time = setTime(new Date(), '-')
+				let wtransferDetailBeanList = []
+				this.view.MaterialList.forEach((element) => {
+					wtransferDetailBeanList.push({
+						batch: element.batch,
+						materialId: element.materialId,
+						procedureId: element.procedureId,
+						procedureName: element.procedureName,
+						qualityType: element.qualityType,
+						unitId: element.unitId,
+						outPlanNum: element.total,
+						proceduresId: element.procedureId,
+						inLocationId: null,
+						outLocationId: element.locationId,
+						inWarehouseId: data.exWarehouseId,
+						outWarehouseId: data.warehousingWarehouse
+					})
+				})
+				createZK({
+					type: this.data.type,
+					outPlandate: time,
+					inPlandate: time,
+					origin: 0,
+					outUserId: this.data.outUserId,
+					inUserId: this.data.inUserId,
+					inWarehouseId: this.data.warehousingWarehouse,
+					outWarehouseId: this.data.exWarehouseId,
+					wtransferDetailBeanList
+				}).then(res => {
+					if (res.code === 200) {
+						uni.showToast({ title: '鍒涘缓鎴愬姛锛�', icon: 'none', duration: 2000 });
+						setTimeout(() => {
+							uni.navigateBack({ delta: 1 });
+						}, 2000)
+					}
+				})
+			},
+			// 鎵撳紑閫夋嫨寮规
+			open(type) {
+				if (type === 'd') {
+					this.view.type = true
+				} else if (type === 'c') {
+					this.view.status = 'c'
+					this.view.Warehouse = true
+				} else if (type === 'r') {
+					this.view.status = 'r'
+					this.view.Warehouse = true
+				} else if (type === 'w') {
+					if (this.data.exWarehouseId) {
+						if (this.data.warehousingWarehouseName) {
+							// let arr = []
+							// this.view.MaterialList.forEach(element => {
+							// 	arr.push(element.id)
+							// })
+							// const { selected } = Material.value
+							// Material.value.selected = arr
+							// view.Material = true
+							this.$refs.SelectMultipleMaterial.open({})
+						} else {
+							uni.showToast({ title: '璇峰厛閫夋嫨鍏ュ簱浠撳簱', icon: 'none', duration: 2000 });
+						}
+					} else {
+						uni.showToast({ title: '璇峰厛閫夋嫨鍑哄簱浠撳簱', icon: 'none', duration: 2000 });
+					}
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.zk {
+		position: absolute;
+		width: 100%;
+
+		.zk_list {
+			padding: 0 30rpx;
+			background: white;
+			margin-top: 20rpx;
+
+			.zk_list_item {
+				height: 98rpx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				border-bottom: 1rpx solid #E5E5E5;
+
+				&:last-child {
+					border: none !important;
+				}
+
+				text {
+					font-size: 30rpx;
+					font-weight: 400;
+					color: #222222;
+				}
+
+				.zk_list_item_n {
+					display: flex;
+					align-items: center;
+
+					text {
+						font-size: 28rpx;
+						font-weight: 400;
+						color: #999999;
+						margin-right: 10rpx;
+					}
+				}
+			}
+		}
+
+		.zk_title {
+			padding: 40rpx 30rpx 30rpx 30rpx;
+			display: flex;
+			align-items: center;
+
+			.zk_title_i {
+				width: 8rpx;
+				height: 30rpx;
+				background: #4275FC;
+				border-radius: 2rpx;
+				margin-right: 12rpx;
+			}
+
+			text {
+				font-size: 32rpx;
+				font-weight: 500;
+				color: #222222;
+			}
+		}
+
+		.zk_wl {
+			background: white;
+
+			.zk_wl_w {
+				width: 100%;
+				height: 200rpx;
+				background: white;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				font-size: 26rpx;
+				color: black;
+			}
+
+			.zk_wl_item {
+				display: flex;
+				flex-direction: column;
+				padding: 30rpx;
+				border-bottom: 1rpx solid #e2e2e2;
+
+				.zk_wl_item_num {
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					margin-top: 30rpx;
+
+					text {
+						font-size: 28rpx;
+						font-weight: 400;
+						color: #222222;
+						margin: 0 !important;
+					}
+
+					input {
+						width: 180rpx;
+						height: 60rpx;
+						background: #FFFFFF;
+						border-radius: 8rpx;
+						border: 1rpx solid #CCCCCC;
+						padding: 0 30rpx;
+						font-size: 28rpx;
+					}
+
+					input::-webkit-input-placeholder {
+						font-size: 28rpx;
+						font-weight: 400;
+						color: #999999;
+					}
+				}
+
+				text {
+					&:nth-child(1) {
+						font-size: 30rpx;
+						font-weight: 500;
+						color: #222222;
+						margin-bottom: 24rpx;
+					}
+
+					&:nth-child(2) {
+						font-size: 24rpx;
+						font-weight: 400;
+						color: #666666;
+						margin-bottom: 30rpx;
+
+						text {
+							font-size: 24rpx;
+						}
+					}
+
+					&:nth-child(3) {
+						font-size: 28rpx;
+						font-weight: 400;
+						color: #333333;
+					}
+				}
+			}
+		}
+
+		.zk_z {
+			height: 168rpx;
+		}
+
+		.zk_footer {
+			width: 100%;
+			box-sizing: border-box;
+			padding: 0 30rpx;
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			padding-bottom: 68rpx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.zk_footer_wl {
+				flex: 1;
+				height: 88rpx;
+				background: #FFFFFF;
+				box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
+				border-radius: 8rpx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				font-size: 30rpx;
+				font-weight: 500;
+				color: $nav-color;
+			}
+
+			.zk_footer_submit {
+				flex: 1;
+				height: 88rpx;
+				background: $nav-color;
+				box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
+				border-radius: 8rpx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				font-size: 30rpx;
+				font-weight: 500;
+				color: #FFFFFF;
+			}
+		}
+	}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3