From 58e1bbd0c1206ff297cc2ed9a685ecdab523596d Mon Sep 17 00:00:00 2001
From: whycq0520 <91384184@qq.com>
Date: 星期五, 25 三月 2022 12:03:40 +0800
Subject: [PATCH] #ycq

---
 pages/basics/stockIn.vue |   79 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 79 insertions(+), 0 deletions(-)

diff --git a/pages/basics/stockIn.vue b/pages/basics/stockIn.vue
new file mode 100644
index 0000000..15083f7
--- /dev/null
+++ b/pages/basics/stockIn.vue
@@ -0,0 +1,79 @@
+<template>
+	<view>
+		<view>
+			<uni-table border stripe type="selection" emptyText="娌℃湁鏇村鏁版嵁" @selection-change="selectionChange">
+				<uni-tr>
+					<uni-th>鍟嗗搧缂栧彿</uni-th>
+					<uni-th>鍟嗗搧鍚嶇О</uni-th>
+					<uni-th>瑙勬牸</uni-th>
+					<uni-th>鍗曚环</uni-th>
+					<uni-th>淇敼鏃堕棿</uni-th>
+				</uni-tr>
+				<uni-tr v-for="(item,index) in stockData" :key="index">
+					<uni-td>{{item.matnr}}</uni-td>
+					<uni-td>{{item.maktx}}</uni-td>
+					<uni-td>{{item.specs}}</uni-td>
+					<uni-td>{{item.price}}</uni-td>
+					<uni-td>{{item.updateTime$}}</uni-td>
+				</uni-tr>
+			</uni-table>
+		</view>
+		<view class="cu-bar foot input justify-center" style="height: 150rpx;">
+			<view style="width: 30%;">
+				<button class="cu-btn bg-yellow lg shadow-blur" style="width: 250rpx;color: #fff;" @click="getMat()">鎻愬彇</button>
+			</view>	
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				baseIP: '',
+				basePORT: '',
+				stockData: [],
+				selectionData: [],
+			}
+		},
+		onLoad(option) {
+			this.baseIP = option.baseIP
+			this.basePORT = option.basePORT
+			this.getMatData() 
+		},
+		methods: {
+			getMatData() {
+				let that = this
+				uni.request({
+					url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/list/auth',
+					header: {'token':uni.getStorageSync('token')},
+					success(res) {
+						var res = res.data
+						if (res.code === 200) {
+							that.stockData = res.data.records
+						}
+					}
+				})
+			},
+			// 澶氶��
+			selectionChange(e) {
+				// 鑾峰彇閫変腑鐘舵��
+				this.selectedIndexs = e.detail.index
+				this.selectedIndexs.sort(function(a,b){
+					return a-b
+				});// 閲嶆柊鎺掑簭锛堝崌搴忥級
+			},
+			getMat() {
+				let that = this
+				var index = this.selectedIndexs
+				for (var i = 0;i < index.length; i++) {
+					that.selectionData.push(that.stockData[index[i]])
+				}
+				uni.navigateBack()
+			}
+		}
+	}
+</script>
+
+<style>
+</style>

--
Gitblit v1.9.1