From 40866099bebc0dd34412c7e88e349b8a66f88580 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期一, 08 十二月 2025 17:05:23 +0800
Subject: [PATCH] #

---
 pages/basics/saless.vue |  597 ++++++++++++++++++++++++++++-------------------------------
 1 files changed, 281 insertions(+), 316 deletions(-)

diff --git a/pages/basics/saless.vue b/pages/basics/saless.vue
index fedb61b..a32ab84 100644
--- a/pages/basics/saless.vue
+++ b/pages/basics/saless.vue
@@ -1,341 +1,306 @@
 <template>
 	<view>
-		<scroll-view scroll-y>
-			<view>
-				<view class="search-box">
-					<view class="search-area">
-						<view class="search-icon"><uni-icons type="search" size="25" color="#a5a5a5"></uni-icons></view>
-						<input type="text" v-model="orderNo" placeholder="鎵爜 / 杈撳叆(璁㈠崟缂栧彿)" @input="search()"/>
-						<view class="close-icon" @click="reset()"><uni-icons type="closeempty" size="25" color="#a5a5a5"></uni-icons></view>
+		<scroll-view scroll-y catch:touchmove="touchmove">
+
+			<!-- 绔欑偣缂栧彿 -->
+			<view class="square-2">
+				<view class="square-title">
+					<view class="title-sign"><view class="sign"></view></view>
+					<view class="title-text"><text>绔欑偣缂栧彿</text></view>
+				</view>
+				<view class="square-content">
+					<view class="content-combox">
+						<uni-combox 
+							emptyTips="鏆傛棤鏁版嵁"
+							:candidates="floorList"
+							v-model="staNo"
+							placeholder="绔欑偣缂栧彿">
+						</uni-combox>
 					</view>
 				</view>
-				<checkbox-group @change="checkbox">
-					<label v-for="(item,index) in data" :key="index" class="demo-list bg-false" :class="'bg-'+item.checked" >
-						<view class="demo-list-left">
-							<checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
-						</view>
-						<view class="demo-list-right">
-							<!-- <view><text style="font-weight: bold;">搴忓彿锛歿{index+1}}</text></view> -->
-							<view class="order-ditel"><text class="index">No.{{index+1}}</text><text class="orderNo">{{item.orderNo}}</text></view>
-							<view><text style="width: 400rpx;">鍟嗗搧缂栫爜锛歿{item.matnr}}</text></view>
-							<view>
-								<text>搴斿叆鏁伴噺锛歿{item.anfme}}</text>
-								<text>鍟嗗搧鍚嶇О锛歿{item.maktx}}</text>
-							</view>
-							<view>
-								<text>宸插叆鏁伴噺锛歿{item.inQty}}</text>
-								<text style="width: auto;">璁㈠崟鐘舵�侊細</text><text :class="state$"> {{item.state$}}</text>
-							</view>
-						</view>
-					</label>
-				</checkbox-group>
 			</view>
+
+			<!-- 鏉$爜 -->
+			<view class="square-2">
+				<view class="square-title">
+					<view class="title-sign"><view class="sign"></view></view>
+					<view class="title-text"><text>鏉$爜鍊�</text></view>
+				</view>
+				<view class="square-content">
+					<view class="content-input">
+						<input
+							ref="barcodeInput"
+							v-model="barcode"
+							type="text"
+							:focus="barcodeFocus"
+							placeholder="鎵爜 / 杈撳叆"
+							placeholder-style="line-height: 85rpx;"
+							@confirm="submit"
+						/>
+					</view>
+				</view>
+			</view>
+
 		</scroll-view>
+
+		<!-- 搴曢儴鎸夐挳 -->
 		<view class="footer flex justify-around">
-			<label class="label-btn" style="width: 150rpx;">
-				<checkbox :checked="check" @click="allChecked()">{{checkText}}</checkbox>
+			<label class="label-btn flex justify-center align-center">
+				<button class="cu-btn" @click="reset">閲嶇疆</button>
 			</label>
-			<label class="label-btn" style="width: 100rpx;">
-				<text  @click="reChecked()">鍙嶉��</text>
-			</label>
-			
-			<label class="label-btn" style="width: 170rpx;">
-				<button class="cu-btn bg-red ">鎾ら攢涓婃灦</button>
-			</label>
-			<label class="label-btn">
-				<button class="cu-btn bg-blue " @click="shangjia()">涓婃灦</button>
+			<label class="label-btn flex justify-center align-center">
+				<button class="cu-btn bg-blue" :disabled="submitting" @click="submit">
+					{{ submitting ? '鎻愪氦涓�...' : '鍚姩' }}
+				</button>
 			</label>
 		</view>
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				data: [],
-				orderNo:'',
-				needData:{},
-				check:false,
-				checkText:'鍏ㄩ��',
-				checkedData:[],
-				state$:'',
-			}
+export default {
+	data() {
+		return {
+			barcode: '',
+			staNo: '',
+			floorList: ['2102', '2105', '2112', '2115'],
+
+			apiUrl: 'http://10.10.10.235:9090/jshdwcs/open/hd/task/cs/barcode/default/v1',
+
+			// 鉁� 闃查噸澶嶆彁浜ら攣
+			submitting: false,
+
+			// 鉁� 鎵爜妗嗚嚜鍔ㄨ仛鐒�
+			barcodeFocus: true
+		}
+	},
+
+	mounted() {
+		this.refocus()
+	},
+
+	methods: {
+		// 鉁� 寮哄埗閲嶆柊鑱氱劍鎵爜妗�
+		refocus() {
+			this.barcodeFocus = false
+			this.$nextTick(() => {
+				this.barcodeFocus = true
+			})
 		},
-		mounted() {
-			const UIP = uni.getStorageSync('UIP');
-			this.baseIP = UIP;
-			const UPORT = uni.getStorageSync('UPORT');
-			this.basePORT = UPORT;
-			this.render()
+
+		// 鉁� 閲嶇疆
+		reset() {
+			this.barcode = ''
+			this.refocus()
+			uni.vibrateShort()
 		},
-		methods: {
-			// 鎼滅储
-			search() {
-				let that = this;
-				// that.tabData.forEach(function(e){
-				// 	that.searchData = e.orderNo
-				// })
-				this.render(that.orderNo)
-			},
-			// 閲嶇疆
-			reset() {
-				let that = this;
-				if (that.orderNo == '') {
-					uni.vibrateShort();
-				} else {
-					uni.vibrateLong();
-				}
-				that.orderNo = '';
-				that.needData['order_no'] = '';
-				that.getData();
-				
-				
-			},
-			// 琛ㄦ牸鍔犺浇
-			render(param) {
-				let that = this;
-				if(param) {
-					that.needData['order_no'] = param;
-					that.getData();
-				} else {
-					that.getData();
-				}
-			},
-			getData() {
-				let that = this
-				uni.request({
-					url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/receiveDetl/list/auth",
-					header:{'token':uni.getStorageSync('token')},
-					data: that.needData,
-					success(res) {
-						var res = res.data
-						if (res.code === 200) {
-							that.data = res.data.records
-						}
-						for (var i = 0; i < that.data.length; i++) {
-							if (that.data[i].state$ == "鏈叆搴�") {
-								that.state$ = 'color-red'
-							} else {
-								console.log(2)
-							}
-							
-						}
-					}
+
+		// 鉁� 鎻愪氦锛堥槻閲嶅 + 鑷姩鍥炵劍锛�
+		submit() {
+			// 闃查噸澶嶇偣鍑�
+			if (this.submitting) return
+
+			if (!this.barcode || !this.staNo) {
+				uni.showToast({
+					title: '璇峰厛閫夋嫨绔欑偣骞舵壂鐮�',
+					icon: 'none',
+					position: 'top'
 				})
-			},
-			checkbox: function (e) {
-				var items = this.data,
-					values = e.detail.value;
-				for (var i = 0, lenI = items.length; i < lenI; ++i) {
-					const item = items[i]
-					item.id = item.id + ''
-					if(values.indexOf(item.id) >= 0){
-						this.$set(item,'checked',true)
-					}else{
-						this.$set(item,'checked',false)
-					}
-				}
-				if (values.length == items.length) {
-					this.check = true
-					this.checkText = "鍙栨秷鍏ㄩ��"
-				} else {
-					this.check = false
-					this.checkText = "鍏ㄩ��"
-				}
-				uni.vibrateShort();
-			},
-			reChecked() { // 鍙嶉��
-				var checkArr = []
-				for (var i = 0; i < this.data.length;i++) {
-					if (this.data[i].checked == true) {
-						this.$set(this.data[i],'checked',false)
-					}else{
-						this.$set(this.data[i],'checked',true)
-					}
-					if (this.data[i].checked == true) {
-						checkArr.push(this.data[i].checked) 
-					}
-				}
-				if (checkArr.length == this.data.length) {
-					this.check = true
-					this.checkText = "鍙栨秷鍏ㄩ��"
-				} else {
-					this.check = false
-					this.checkText = "鍏ㄩ��"
-				}
-				uni.vibrateShort();
-			},
-			allChecked(e){ // 鍏ㄩ��
-				if (this.check == true) {
-					for (var i = 0; i < this.data.length;i++) {
-						this.$set(this.data[i],'checked',false)
-					}
-					this.check = false
-					this.checkText = "鍏ㄩ��"
-				} else {
-					for (var i = 0; i < this.data.length;i++) {
-						this.$set(this.data[i],'checked',true)
-					}
-					this.check = true
-					this.checkText = "鍙栨秷鍏ㄩ��"
-				}
-				uni.vibrateShort();
-			},
-			shangjia() {
-				this.checkedData = []
-				for (var i = 0; i < this.data.length; i++) {
-					if (this.data[i].checked == true) {
-						this.checkedData.push(this.data[i])
-					}
-				}
-				uni.vibrateShort();
-				console.log(this.checkedData)
+				return
 			}
+
+			this.submitting = true
+			uni.showLoading({ title: '鎻愪氦涓�...' })
+
+			uni.request({
+				url: this.apiUrl,
+				method: 'POST',
+				data: {
+					barcode: this.barcode,
+					siteId: this.staNo
+				},
+				header: {
+					'token': uni.getStorageSync('token'),
+					'appkey': 'ea1f0459efc02a79f046f982767939ae'
+				},
+
+				success: res => {
+					uni.hideLoading()
+
+					if (res.data.code === 200) {
+						uni.showToast({
+							title: '鎴愬姛',
+							icon: 'success',
+							position: 'bottom'
+						})
+
+						// 鉁� 鎴愬姛 鈫� 娓呯┖鏉$爜 鈫� 鑷姩鍥炵劍
+						this.barcode = ''
+						this.refocus()
+					} else {
+						uni.showToast({
+							title: res.data.msg || '澶辫触',
+							icon: 'none',
+							position: 'top'
+						})
+					}
+				},
+
+				fail: () => {
+					uni.hideLoading()
+					uni.showToast({
+						title: '缃戠粶寮傚父',
+						icon: 'none',
+						position: 'top'
+					})
+				},
+
+				complete: () => {
+					// 鉁� 鎴愬姛 / 澶辫触 閮介噴鏀鹃攣
+					this.submitting = false
+				}
+			})
 		}
 	}
+}
 </script>
 
 <style>
-	.search-box {
-		position: fixed;
-		left: 0;
-		top: 0;
-		width: 100%;
-		height: 100rpx;
-		background-color: #FFF;
-		border-bottom: 1px solid #d8d8d8;
-		border-radius: 0 0 20rpx 20rpx;
-		z-index: 1;
-	}
-	/*#ifdef H5 */
-	.search-box {
-		position: fixed;
-		left: 0;
-		top: 60rpx;
-		width: 100%;
-		height: 100rpx;
-		background-color: #ffffff;
-		border-bottom: 1px solid #d8d8d8;
-		border-radius: 0 0 20rpx 20rpx;
-		z-index: 1;
-	}
-	/* #endif */
-	.search-area {
-		background-color: #F1F1F1;
-		width: 96%;
-		height: 70%;
-		margin: 15rpx;
-		border-radius: 15rpx;
-	}
-	.search-area input {
-		display: inline-block;
-		height: 70rpx;
-		width: 70%;
-		line-height: 70rpx;
-		font-size: 25rpx;
-		font-weight: 400;
-	}
-	.search-icon {
-		display: inline-block;
-		float: left;
-		width: 70rpx;
-		height: 70rpx;
-		text-align: center;
-		line-height: 70rpx;
-		
-	}
-	.close-icon {
-		display: inline-block;
-		float: right;
-		width: 70rpx;
-		height: 70rpx;
-		text-align: center;
-		line-height: 70rpx;
-	}
-	.bg-false {
-		background-color: #FFFFFF;
-	}
-	.bg-true {
-		background-color: #ebebeb;
-	}
-	
-	.demo-list {
-		border-bottom: 1px solid #d8d8d8;
-		height: 180rpx;
-		margin: 15rpx;
-		border-radius: 20rpx;
-	}
-	.demo-list:first-child {
-		margin-top: 120rpx;
-	}
-	.demo-list:last-child {
-		margin-bottom: 120rpx;
-	}
-	label {
-		display: block;
-	}
-	.demo-list-left {
-		display: inline-block;
-		float: left;
-		text-align: center;
-		width: 100rpx;
-		height: 180rpx;
-		line-height: 180rpx;
-	}
-	.demo-list-right {
-		display: inline-block;
-		float: left;
-		height: 180rpx;
-		color: #828282;
-	}
-	.order-ditel {
-		height: 60rpx;
-		width: 600rpx;
-		line-height: 60rpx;
-	}
+/* 鉁� 瀹屾暣淇濈暀浣犲師鏉ョ殑 style锛屼笉鍋氫换浣曠牬鍧� */
 
-	.demo-list-right .index {
-		width: 120rpx;
-		height: 25rpx;
-		line-height: 25rpx;
-		font-size: 40rpx;
-		border-right: 4rpx solid #6f6f6f;
-		padding-left: 0px;
-		padding-right: 10rpx;
-		color: #3b3b3b;
-		/* background-color: #007AFF; */
-	}
-	.demo-list-right .orderNo {
-		padding-left: 30rpx;
-		font-size: 35rpx;
-		width: 400rpx;
-		color: #3b3b3b;
-		/* background-color: #0A98D5; */
-	}
-	.demo-list-right .vertical-bar { // 绔栨潬
-		/* background-color: #6739B6; */
-		width: 50rpx;
-		font-size: 30rpx;
-		text-align: center;
-	}
-	.demo-list-right text {
-		display: inline-block;
-		width: 250rpx;
-		font-size: 25rpx;
-	}
-	.color-red {
-		width: auto;
-		font-weight: 700;
-		color: #e74f4f;
-	}
-	
-	
-	.label-btn {
-		width: 100rpx;
-	}
-	checkbox {
-		/* transform:scale(0.7) */
-	}
-	
+.item-text {
+	display: inline-block;
+	width: 500rpx;
+	line-height: 55rpx;
+	font-size: 30rpx;
+}
+
+.item-sign {
+	float: left;
+	width: 2em;
+	height: 50rpx;
+}
+
+.revise-box {
+	position: relative;
+	width: 500rpx;
+	height: 470rpx;
+	border-radius: 15px;
+	background-color: #FFFFFF;
+}
+
+.revise-box-top {
+	width: 400rpx;
+	height: 120rpx;
+	border-radius: 25px;
+}
+
+.changeBox {
+	width: 400rpx;
+	height: 100rpx;
+}
+
+.num-box {
+	margin-left: 100rpx;
+}
+
+.revise-box-buttom {
+	margin-left: 190rpx;
+}
+
+.pak-seach-box {
+	background-color: #FFFFFF;
+	margin: 15rpx 15rpx 0rpx 15rpx;
+	width: 96%;
+	height: 150rpx;
+	border-radius: 20rpx;
+}
+
+.box-top {
+	display: block;
+	height: 60rpx;
+	width: 720rpx;
+}
+
+.color-block-blue {
+	background-color: #1E9FFF;
+	display: inline-block;
+	float: left;
+	margin: 15rpx 15rpx 0 15rpx;
+	width: 12rpx;
+	height: 40rpx;
+	border: 5rpx solid #1E9FFF;
+	border-radius: 20rpx;
+}
+
+.title {
+	display: inline-block;
+	float: left;
+	font-size: 34rpx;
+	font-weight: 700;
+	height: 50rpx;
+	line-height: 50rpx;
+	margin-top: 10rpx;
+}
+
+.box-buttom {
+	display: inline-block;
+	background-color: #ededed;
+	width: 65%;
+	height: 60rpx;
+	border-radius: 20rpx;
+	margin: 15rpx 15rpx 0rpx 15rpx;
+}
+
+.box-buttom input {
+	width: 75%;
+	float: left;
+	margin: 8rpx 10rpx 0rpx 25rpx;
+}
+
+.box-buttom .search-icon {
+	width: 60rpx;
+	height: 60rpx;
+	float: right;
+	margin-top: 5rpx;
+	margin-right: 10rpx;
+}
+
+.pak-data-box {
+	background-color: #F1F1F1;
+	margin: 15rpx;
+	width: 96%;
+	height: 70rpx;
+	border-radius: 20rpx;
+}
+
+.bg-false {
+	background-color: #FFFFFF;
+}
+
+.bg-true {
+	background-color: #ebebeb;
+}
+
+.data-list {
+	border-bottom: 1px solid #d8d8d8;
+	margin: 15rpx;
+	border-radius: 20rpx;
+}
+
+.footer {
+	position: fixed;
+	bottom: 0;
+	left: 0;
+	right: 0;
+	display: flex;
+	justify-content: space-around;
+	background: #fff;
+	padding: 20rpx;
+}
+
+.bg-blue {
+	background-color: #1E9FFF;
+	color: #fff;
+}
 </style>

--
Gitblit v1.9.1