From 917b01ee96a3e1c60a1d8b02167fa2e5b194f049 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期五, 05 四月 2024 08:52:56 +0800
Subject: [PATCH] #

---
 pages/phyz/order/orderList2.vue |  232 ++++++++++++++++++++++++++++++++++++++++++++++
 pages/home/orderManage.vue      |    2 
 pages.json                      |    9 +
 3 files changed, 242 insertions(+), 1 deletions(-)

diff --git a/pages.json b/pages.json
index 3a5f4e0..1bb89b5 100644
--- a/pages.json
+++ b/pages.json
@@ -553,6 +553,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/phyz/order/orderList2",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "璁㈠崟鍒楄〃",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
diff --git a/pages/home/orderManage.vue b/pages/home/orderManage.vue
index 8555208..517f502 100644
--- a/pages/home/orderManage.vue
+++ b/pages/home/orderManage.vue
@@ -30,7 +30,7 @@
 						name: 'pakin',
 						color: 'blue',
 						// cuIcon: 'pullup',
-						url: `/phyz/order/purchaseOrder`
+						url: `/phyz/order/orderList2`
 					},
 					{
 						title: '鍑哄簱鍗�',
diff --git a/pages/phyz/order/orderList2.vue b/pages/phyz/order/orderList2.vue
new file mode 100644
index 0000000..1af0b77
--- /dev/null
+++ b/pages/phyz/order/orderList2.vue
@@ -0,0 +1,232 @@
+<template>
+	<view>
+		<view class="code">
+			<uni-search-bar :focus="matFocus" v-model="matnr"  @input="matInput()" ma
+				maxlength="500" ancel="cancel" @clear="clear" placeholder="杈撳叆 / 鎵弿鍟嗗搧">
+			</uni-search-bar>
+			<view class="code-title">
+				<view></view>
+				<view>鍟嗗搧鍒楄〃</view>
+				<view @click="allChecked">{{allCheckBtnTitle}}</view>
+			</view>
+		</view>
+		<view class="list" v-for="(item,i) in dataList">
+			<view class="list-left">
+				<view>缂栧彿锛歿{item.matnr}}</view>
+				<view>鍚嶇О锛歿{item.maktx}}</view>
+				<view>瑙勬牸锛歿{item.specs}}</view>
+				<view>鎵瑰彿锛歿{item.batch}}</view>
+				<view class="list-anfme">鏁伴噺锛歿{item.anfme}}</view>
+				<view class="list-qty-1" v-if="item.anfme > item.qty">浣滀笟鏁伴噺锛歿{item.qty}}</view>
+				<view class="list-qty-2" v-if="item.anfme <= item.qty">浣滀笟鏁伴噺锛歿{item.qty}}</view>
+				<view class="card-id">{{i + 1}}</view>
+			</view>
+			<view class="list-right" @click="checkboxChange(item)">
+				<label >
+					<checkbox :value="item.orderNo" :checked="item.checked" color="" :disabled="item.anfme <= item.qty" style="transform:scale(0.7)" /><text></text>
+				</label>
+			</view>
+		</view>
+		<view style="height: 100rpx;"></view>
+		
+		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+		<view class="buttom" v-if="orderType == 'in'">
+			<button size="mini" @click="reset('warn')">閲嶇疆</button>
+			<button size="mini" type="primary" @click="combConfirm('warn')">鍘荤粍鎵�</button>
+		</view>
+		
+		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+		<view class="buttom" v-if="orderType == 'out'">
+			<button size="mini" @click="reset('warn')">閲嶇疆</button>
+			<button size="mini" type="primary" @click="combConfirm2('warn')">鍘诲嚭搴�</button>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				baseUrl: '',
+				token: '',
+				orderId: '',
+				matFocus: true,
+				matnr: '',
+				checck: true,
+				dataList: [],
+				oldDataList: [],
+				newDataList: [],
+				allCheck: false,
+				allCheckBtnTitle: '鍏ㄩ��',
+				orderType: 'in'
+			}
+		},
+		onLoad() {
+			this.baseUrl = uni.getStorageSync('baseUrl');
+			this.token = uni.getStorageSync('token');
+			this.getOrderDetl()
+		},
+		onShow() {
+			if (this.dataList.length > 0) {
+				this.oldDataList = [...this.dataList]
+			}
+		},
+		methods: {
+			// 璁㈠崟鏄庣粏
+			getOrderDetl(id) {
+				let _this = this
+				uni.request({
+					url: `${_this.baseUrl}/orderDetl/list/auth`,
+					header: {'token': uni.getStorageSync('token')},
+					data: {
+						curr: 1,
+						limit: 1000,
+						order_id: id
+					},
+					method: 'GET',
+					success(res) {
+						res = res.data
+						console.log(res);
+						if (res.code === 200) {
+							res.data.records
+							_this.dataList = res.data.records
+							
+							_this.oldDataList = [..._this.dataList]
+						} 
+					}
+				})
+			},
+			matInput() {
+				let count = 0
+				let sign = 0
+				if (this.oldDataList.length > 0) {
+					this.dataList = [...this.oldDataList]
+				}
+				this.newDataList = []
+				for (let k in this.dataList) {
+					if (!this.dataList[k].matnr.includes(this.matnr)) {
+						count++;
+					} else {
+						this.newDataList.push(this.dataList[k])
+					}
+				}
+				if (this.matnr != '') {
+					for (let j in this.dataList) {
+						if (!this.dataList[j].maktx.includes(this.matnr)) {
+						} else {
+							for (let i in this.newDataList) {
+								if (this.newDataList[i].matnr ==  this.dataList[j].matnr) {
+									sign++
+								}
+							}
+							if (sign == 0) {
+								this.newDataList.push(this.dataList[j])
+							}
+						}
+					}
+				}
+				this.dataList = this.newDataList
+			},
+			checkboxChange(e) {
+				let items = this.dataList,
+				values = e.orderNo;
+				if (e.checked) {
+					this.$set(e,'checked',false)
+				} else {
+					if (e.anfme == e.qty) {
+						this.$set(e,'checked',false)
+					} else {
+						this.$set(e,'checked',true)
+					}
+					
+				}
+			},
+			allChecked() {
+				if (this.allCheck) {
+					this.allCheck = false
+					this.allCheckBtnTitle = '鍏ㄩ��'
+				} else {
+					this.allCheck = true
+					this.allCheckBtnTitle = '鍙栨秷'
+				}
+				for (let item of this.dataList) {
+					if (this.allCheck) {
+						if (item.anfme == item.qty) {
+							this.$set(item,'checked',false)
+						} else {
+							this.$set(item,'checked',true)
+						}
+					} else {
+						this.$set(item,'checked',false)
+					}
+				}
+			},
+			clear() {
+				this.matnr = ''
+				this.dataList = [...this.oldDataList]
+			},
+			combConfirm(type) {
+				let _this = this
+				let combList = []
+				for (let k of _this.dataList) {
+					k['csocode'] = k.threeCode
+					if (k.checked) {
+						combList.push(k)
+					}
+				}
+				if (combList.length == 0) {
+					uni.showToast({ title: '璇烽�夋嫨缁勬墭鍟嗗搧', icon: "error", position: 'top'})
+					return
+				}
+				uni.navigateTo({
+					url: "../AGV/AGVPakin3",
+					success: function(res) {
+						// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+						res.eventChannel.emit('mats', {
+							mats: combList
+						})
+					},
+				});
+			},
+			combConfirm2(type) {
+				let _this = this
+				let combList = []
+				for (let k of _this.dataList) {
+					if (k.checked) {
+						combList.push(k)
+					}
+				}
+				if (combList.length == 0) {
+					uni.showToast({ title: '璇烽�夋嫨鍑哄簱鍟嗗搧', icon: "error", position: 'top'})
+					return
+				}
+				uni.navigateTo({
+					url: "./preview",
+					success: function(res) {
+						// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+						res.eventChannel.emit('mats', {
+							mats: combList
+						})
+					},
+				});
+			},
+		}
+	}
+</script>
+
+<style>
+	@import url('../../../static/css/common/order.css');
+	.list-anfme {
+		color: #0082ff;
+		font-weight: bold;
+	}
+	.list-qty-1 {
+		color: #33ba43;
+		font-weight: bold;
+	}
+	.list-qty-2 {
+		color: #e2231a;
+		font-weight: bold;
+	}
+</style>

--
Gitblit v1.9.1