Kaynağa Gözat

上架确认页面

wanghaojie 10 ay önce
ebeveyn
işleme
7f3a0f737e

+ 6 - 6
pages.json

@@ -2,6 +2,12 @@
 	"pages": [
 		//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
+			"path": "pages/grounding/grounding",
+			"style": {
+				"navigationBarTitleText": "上架"
+			}
+		},
+		{
 			"path": "pages/query/query",
 			"style": {
 				"navigationBarTitleText": "商品检索"
@@ -32,12 +38,6 @@
 			}
 		},
 		{
-			"path": "pages/grounding/grounding",
-			"style": {
-				"navigationBarTitleText": "上架确认"
-			}
-		},
-		{
 			"path": "pages/outbound/outbound",
 			"style": {
 				"navigationBarTitleText": "出库拣货"

+ 46 - 45
pages/grounding/grounding.vue

@@ -1,11 +1,10 @@
 <template>
 	<view class="query-wrap">
-		<qs-scanlistener @scan="scan"></qs-scanlistener>
 		<uni-easyinput prefixIcon="search" :value="value" placeholder="请输入或扫描入库单号" @iconClick="iconClick" :focus="true"
 			@input="input" @blur="blur" @confirm="confirm">
 		</uni-easyinput>
 		<v-tabs v-model="index" :tabs="tabList" @change="changeTab" :scroll="false"></v-tabs>
-		<z-paging ref="paging" @query="" v-model="dataList" :use-page-scroll="true">
+		<z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
 			<view class="inner-item" v-for="(item,index) in listData" :key="index" @click="itemDetails(item)">
 				<view class="inventory-item">
 					<view class="shuo-item-name">
@@ -114,9 +113,10 @@
 			</view>
 		</z-paging>
 		<uni-popup ref="inputDialog" type="dialog">
-			<uni-popup-dialog ref="inputClose" mode="input" title="上架" @confirm="dialogInputConfirm">
+			<uni-popup-dialog ref="inputClose" mode="input" title="上架" @confirm="dialogInputConfirm"
+				:beforeClose="beforeClose" @close="oncloseList">
 				<uni-data-picker :localdata="items" popup-title="库位" @change="onchange" v-model="classes"
-					@nodeclick="onnodeclick"></uni-data-picker>
+					@popupclosed="onpopupclosed" @nodeclick="onnodeclick"></uni-data-picker>
 			</uni-popup-dialog>
 		</uni-popup>
 	</view>
@@ -135,16 +135,12 @@
 		debounced
 	} from '@/utils/debounced.js';
 	import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
-	import renTime from '@/components/ren-time/ren-time.vue';
 	export default {
 		mixins: [ZPMixin],
-		components: {
-			renTime,
-		},
+
 		data() {
 			return {
-				index: "0",
-				title: 'Hello',
+				index: 0,
 				value1: "",
 				value: "",
 				dataList: [],
@@ -152,11 +148,11 @@
 				codeVal: "",
 				confirmVal: "",
 				changeVal: "",
-				classes: "",
+				classes: [],
 				listData: listData,
 				tabList: ['待上架', '已上架'],
 				valueList: 0,
-				defaultIndex: [0],
+				beforeClose: true,
 				items: [{
 						text: "一级",
 						value: "1-0",
@@ -199,11 +195,8 @@
 				],
 			}
 		},
-		onLoad() {
-
-		},
 		computed: {
-			...mapState(['groundData'])
+			// ...mapState(['groundData'])
 		},
 		onShow() {
 			uni.$once('update', function(data) {
@@ -212,29 +205,28 @@
 				// });
 			})
 		},
-		mounted() {
-
-		},
+		mounted() {},
 		methods: {
 			...mapActions(['getGroundData']),
 			...mapMutations(['setMentItemData']),
-			// queryList(pageNo, pageSize) {
-			// 	this.getGroundData();
-			// },
+			queryList(pageNo, pageSize) {
+				// this.getGroundData();
+				this.$refs.paging.complete(this.listData);
+			},
 			//跳转上架详情	 
 			itemDetails(item) {
 				this.setMentItemData([item]);
 				uni.navigateTo({
 					url: '/pages/groundetials/groundetials',
 					success: function(res) {
-						console.log(res,"res")
+						console.log(res, "res")
 					}
 				});
 			},
 			input(e) {
 				this.$nextTick(() => {
-					this.value = e;
-					this.inputVal = e;
+					// this.value = e;
+					// this.inputVal = e;
 				})
 				this.getGroundData({
 					id_instock: e,
@@ -246,48 +238,57 @@
 			},
 			blur(e) {
 				this.$nextTick(() => {
-					this.value = e.target.value;
+					// this.value = e.target.value;
 				})
 			},
 
 			confirm(e) {
 				this.$nextTick(() => {
-					this.value = e;
-					this.confirmVal = e;
-				})
-			},
-			scan(code) {
-				this.codeVal = code;
-				this.$nextTick(() => {
-					this.value = code;
-					this.$debounced(this.getGroundData({
-						id_instock: code,
-						type: ""
-					}), 2000)
-
+					// this.value = e;
+					// this.confirmVal = e;
 				})
 			},
 			changeTab(index) {
 				console.log('当前选中的项:' + index)
 			},
+			oncloseList() {
+				this.$refs.inputDialog.close()
+			},
 			handleShelf(item) {
 				this.$refs.inputDialog.open();
 				console.log(111, item)
 			},
+			dialogInputConfirm() {
+				if (this.classes.length === 0) {
+					uni.showToast({
+						title: '请选择库位',
+						icon: 'none',
+					});
+					this.beforeClose = true;
+					return;
+				} else {
+					this.classes = "";
+					this.beforeClose = false;
+					this.$refs.inputDialog.close();
+				}
+			},
 			changeList(e) {
-				console.log(e)
+				// console.log(e)
 			},
 			onchange(e) {
-				const value = e.detail.value
+				// console.log(e, 44)
 			},
 			onnodeclick(node) {
-				console.log(node)
+				console.log(node, "node");
+			},
+			onpopupclosed(e) {
+				// console.log(e, 33)
 			}
 		},
 		watch: {
 			groundData(newData, flodData) {
 				this.$refs.paging.complete(newData);
-			}
+			},
 		}
 
 	}
@@ -378,7 +379,7 @@
 						font-size: 25rpx;
 						text-align: left;
 						font-family: PingFangSC-regular;
-						margin-left: 20rpx;
+						margin-left: 10rpx;
 					}
 				}
 
@@ -431,7 +432,7 @@
 						font-size: 25rpx;
 						text-align: left;
 						font-family: PingFangSC-regular;
-						margin-left: 20rpx;
+						margin-left: 10rpx;
 					}
 
 					.shuo-await {

+ 1 - 1
pages/query/list.js

@@ -25,7 +25,7 @@ export const queryData = [{
 	guige: "这里是规格",
 	xinghao: "这里是型号",
 	liebie:"这里是类别",
-	qiye:"乌蒙山里的22222222222222222222222",
+	qiye:"乌蒙山里的222222222222",
 	laiyuan:"惊雷",
 	suozcku: "所在仓库",
 	suozaikw: "12-1-1",

+ 114 - 75
pages/query/query.vue

@@ -2,92 +2,94 @@
 	<view class="query-wrap">
 		<uni-easyinput prefixIcon="search" v-model="value" placeholder="请输入商品名称" @iconClick="iconClick" :focus="true">
 		</uni-easyinput>
-		<view class="inner-item" v-for="(item,index) in queryData" :key="index">
-			<view class="inventory-item">
-				<view class="shuo-item">
-					<view class="shuo-label">
-						{{item.name}}
-					</view>
-					<view class="shuo-unit">
-						{{item.unit}}
-					</view>
-				</view>
-			</view>
-			<view class="inventory-item">
-				<view class="shuo-item">
-					<view class="shuo-label">
-						规格:
-					</view>
-					<view class="shuo-cont">
-						{{item.guige}}
-					</view>
-				</view>
-				<view class="shuo-item">
-					<view class="shuo-label">
-						型号:
-					</view>
-					<view class="shuo-cont">
-						{{item.xinghao}}
-					</view>
-				</view>
-			</view>
-			<view class="inventory-item">
-				<view class="shuo-item">
-					<view class="shuo-label">
-						耗材类别:
-					</view>
-					<view class="shuo-cont-blue">
-						{{item.liebie}}
+		<z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
+			<view class="inner-item" v-for="(item,index) in queryData" :key="index">
+				<view class="inventory-item">
+					<view class="shuo-item-name">
+						<view class="shuo-label">
+							{{item.name}}
+						</view>
+						<view class="shuo-unit">
+							{{item.unit}}
+						</view>
 					</view>
 				</view>
-				<view class="shuo-item">
-					<view class="shuo-label">
-						生产来源:
+				<view class="inventory-item">
+					<view class="shuo-item">
+						<view class="shuo-label">
+							规格:
+						</view>
+						<view class="shuo-cont">
+							{{item.guige}}
+						</view>
 					</view>
-					<view class="shuo-cont-blue">
-						{{item.laiyuan}}
+					<view class="shuo-item">
+						<view class="shuo-label">
+							型号:
+						</view>
+						<view class="shuo-cont">
+							{{item.xinghao}}
+						</view>
 					</view>
 				</view>
-			</view>
-			<view class="inventory-item">
-				<view class="shuo-item-qy">
-					<view class="shuo-label">
-						生产企业:
+				<view class="inventory-item">
+					<view class="shuo-item">
+						<view class="shuo-label">
+							耗材类别:
+						</view>
+						<view class="shuo-cont-blue">
+							{{item.liebie}}
+						</view>
 					</view>
-					<view class="shuo-cont">
-						{{item.qiye}}
+					<view class="shuo-item">
+						<view class="shuo-label">
+							生产来源:
+						</view>
+						<view class="shuo-cont-blue">
+							{{item.laiyuan}}
+						</view>
 					</view>
 				</view>
-			</view>
-			<view class="inventory-item">
-				<view class="shuo-item">
-					<view class="shuo-label">
-						所在仓库:
-					</view>
-					<view class="shuo-cont">
-						{{item.suozcku}}
+				<view class="inventory-item">
+					<view class="shuo-item-qy">
+						<view class="shuo-label">
+							生产企业:
+						</view>
+						<view class="shuo-cont">
+							{{item.qiye}}
+						</view>
 					</view>
 				</view>
-				<view class="shuo-item">
-					<view class="shuo-label">
-						所在库位:
+				<view class="inventory-item">
+					<view class="shuo-item">
+						<view class="shuo-label">
+							所在仓库:
+						</view>
+						<view class="shuo-cont">
+							{{item.suozcku}}
+						</view>
 					</view>
-					<view class="shuo-cont">
-						{{item.suozaikw}}
+					<view class="shuo-item">
+						<view class="shuo-label">
+							所在库位:
+						</view>
+						<view class="shuo-cont">
+							{{item.suozaikw}}
+						</view>
 					</view>
 				</view>
-			</view>
-			<view class="inventory-item">
-				<view class="shuo-item">
-					<view class="shuo-label">
-						现有库存:
-					</view>
-					<view class="shuo-cont-blue">
-						{{item.xianykc}}
+				<view class="inventory-item">
+					<view class="shuo-item">
+						<view class="shuo-label">
+							现有库存:
+						</view>
+						<view class="shuo-cont-blue">
+							{{item.xianykc}}
+						</view>
 					</view>
 				</view>
 			</view>
-		</view>
+		</z-paging>
 	</view>
 </template>
 
@@ -99,8 +101,15 @@
 		data() {
 			return {
 				value: '',
-				queryData: queryData
+				queryData: queryData,
+				dataList: [],
 			}
+		},
+		methods: {
+			queryList(pageNo, pageSize) {
+				// this.getGroundData();
+				this.$refs.paging.complete(this.listData);
+			},
 		}
 	}
 </script>
@@ -139,7 +148,7 @@
 			}
 
 			.inventory-item {
-				width: 115%;
+				width: 100%;
 				height: 40rpx;
 				color: rgba(16, 16, 16, 1);
 				font-size: 28rpx;
@@ -149,12 +158,41 @@
 				display: flex;
 				align-items: center;
 
+				.shuo-item-name {
+					width: 100%;
+					height: 100%;
+					line-height: 20rpx;
+					display: flex;
+					align-items: center;
+
+					.shuo-label {
+						width: 200rpx;
+						color: rgba(16, 16, 16, 1);
+						font-size: 28rpx;
+						text-align: left;
+						font-family: PingFangSC-regular;
+						text-align: justify;
+						text-align-last: justify;
+						margin-right: 10rpx;
+					}
+
+					.shuo-cont {
+						color: rgba(16, 16, 16, 1);
+						font-size: 25rpx;
+						text-align: left;
+						font-family: PingFangSC-regular;
+						margin-left: 20rpx;
+					}
+				}
 				.shuo-label {
 					color: rgba(16, 16, 16, 1);
 					font-size: 28rpx;
 					text-align: left;
 					font-family: PingFangSC-regular;
 					font-weight: bold;
+					width: 130rpx;
+					text-align: justify;
+					text-align-last: justify;
 				}
 
 				.shuo-unit {
@@ -168,6 +206,7 @@
 					text-align: left;
 					font-family: PingFangSC-regular;
 					font-weight: bold;
+					margin-left: 20rpx;
 				}
 
 				.shuo-cont {
@@ -175,7 +214,7 @@
 					font-size: 28rpx;
 					text-align: left;
 					font-family: PingFangSC-regular;
-					margin-left: 30rpx;
+					margin-left: 20rpx;
 				}
 
 				.shuo-item-qy {
@@ -197,7 +236,7 @@
 						font-size: 28rpx;
 						text-align: left;
 						font-family: PingFangSC-regular;
-						margin-left: 30rpx;
+						margin-left: 20rpx;
 					}
 				}
 
@@ -220,7 +259,7 @@
 						font-size: 28rpx;
 						text-align: left;
 						font-family: PingFangSC-regular;
-						margin-left: 30rpx;
+						margin-left: 20rpx;
 					}
 
 					.shuo-await {

+ 1 - 1
uni_modules/v-tabs/components/v-tabs/props.js

@@ -91,6 +91,6 @@ export default {
   },
   zIndex: {
     type: Number,
-    // default: 1993
+    default: 11
   }
 }