lilei 1 年之前
父節點
當前提交
ac9f3459e8

+ 1 - 1
config/request.js

@@ -29,7 +29,7 @@ module.exports = (vm) => {
 	// 响应拦截
 	uni.$u.http.interceptors.response.use((response) => { /* 对响应成功做点什么 可使用async await 做异步操作*/
 		const data = response.data
-		console.log(data)
+		// console.log(data)
 		// 自定义参数
 		const custom = response.config?.custom
 		if (data.status != 200) { 

+ 2 - 1
libs/scan-code.vue

@@ -40,11 +40,12 @@
 				if(!this.sPtime){
 					this.sPtime = e.timeStamp
 				}
+				this.$emit('onKeyDown',this.keys[e.key]||e.key,e)
 			},
 			keyUp(e){
 				const len = e.timeStamp - this.sPtime
 				this.sPtime = 0
-				this.$emit('onKey',this.keys[e.key],e)
+				this.$emit('onKeyUp',this.keys[e.key]||e.key,e)
 			},
 			initScan() {
 				let _this = this;

+ 12 - 11
pages/codeBar/codeBar.vue

@@ -42,9 +42,9 @@
 			<view class="uni-table">
 				 <!-- 表头行 -->
 				 <uni-tr>
-				 	<uni-td align="center">产品编码</uni-td>
-				 	<uni-td align="center">产品名称</uni-td>
-				 	<uni-td align="center">条形码</uni-td>
+				 	<uni-td width="30%" align="center">产品编码</uni-td>
+				 	<uni-td width="40%" align="center">产品名称</uni-td>
+				 	<uni-td width="30%" align="center">条形码</uni-td>
 				 </uni-tr>
 			</view>
 			<scroll-view enable-flex scroll-y="true" class="table-scroll-body" @scrolltolower="scrolltolower">
@@ -121,7 +121,6 @@
 				detailList:[],
 				code:'',
 				tempProduct: null,
-				noMore: '',
 				pageNo: 1,
 				pageSize: 10,
 				total: 0,
@@ -198,12 +197,13 @@
 				dealerProductList({...params,...this.query}).then(res => {
 					console.log(res)
 					if(res.status == 200){
-						this.detailList = res.data && res.data.list || []
-					}
-					if(res.data.count > 10){
-						this.noMore = '最多显示前10条匹配产品!'
-					}else{
-						this.noMore = ''
+						const list = res.data.list||[]
+						this.total = res.data.count
+						if(this.pageNo == 1){
+							this.detailList = list
+						}else{
+							this.detailList = this.detailList.concat(list)
+						}
 					}
 					this.loading = false
 				})
@@ -220,7 +220,7 @@
 			// 编辑
 			toEdit(item) {
 				this.tempProduct = item
-				this.code = this.tempProduct.qrCode
+				this.code = item.qrCode || ''
 				this.$refs.popup.open()
 				this.hideKeyborder()
 			}
@@ -229,6 +229,7 @@
 </script>
 
 <style lang="scss">
+	$border-color:#EBEEF5;
 	.p-content{
 		button{
 			line-height: 1.7;

+ 13 - 1
pages/stock/index.vue

@@ -37,6 +37,7 @@
 				<u-button size="medium" hover-class="none" shape="circle" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
 			</view>
 		</view>
+		<scanCode></scanCode>
 		<!-- 产品品牌 -->
 		<productBrand ref="productBrand" :openModal="brandModal" :itemSn="form.productBrandSn" @choose="brandChoose" @clean="brandClean" @close="brandModal=false" />
 		<!-- 产品分类 -->
@@ -45,11 +46,12 @@
 </template>
 
 <script>
+	import scanCode from '@/libs/scan-code.vue';
 	import productBrand from '@/pages/common/productBrand.vue'
 	import productType from '@/pages/common/productType.vue'
 	import { dealerProductTypeList , stockCount } from '@/config/api'
 	export default{
-		components: { productBrand, productType },
+		components: { productBrand, productType, scanCode },
 		data(){
 			return {
 				form: {
@@ -95,6 +97,16 @@
 		    uni.setStorageSync('productEnabledFlag-' + this.$store.state.vuex_userData.orgId, newValue)
 		  },
 		},
+		onLoad() {
+			var _this = this
+			uni.$on('scancodedate', function(content) {
+			  console.log("扫描到的内容为:", content)
+			  _this.form.qrCode = content||''
+			})
+		},
+		onUnload() {
+			uni.$off('scancodedate')
+		},
 		onShow() {
 			// 是否默认包括禁用产品
 			const a = uni.getStorageSync('productEnabledFlag-' + this.$store.state.vuex_userData.orgId)

+ 1 - 1
pages/stock/stockDetail.vue

@@ -81,7 +81,7 @@
 				margin-left: 20upx;
 				.padding_7{
 					padding: 14upx 0 0;
-					font-size: 28upx;
+					font-size: 14px;
 				}
 			}
 		}

+ 1 - 1
pages/stock/stockSearch.vue

@@ -191,7 +191,7 @@
 			margin: 25upx;
 			padding: 20upx 0;
 			.item-box{
-				padding: 10upx 30upx;
+				padding: 5upx 30upx;
 				display: flex;
 				align-items: center;
 				justify-content: space-between;

+ 2 - 2
pages/stockPan/index.vue

@@ -80,7 +80,7 @@
 			<button size="mini" type="warn" @click="addQty(false)"> <text class="iconfont icon-reduce-btn"> 减 </text></button>
 			<button size="mini" type="primary" @click="addQty(true)"> <text class="iconfont icon-add-btn"> 加 </text></button>
 		</view>
-		<scanCode @onKey="onKey"></scanCode>
+		<scanCode @onKeyDown="keyDown"></scanCode>
 	</view>
 </template>
 
@@ -147,7 +147,7 @@
 				uni.hideKeyboard()
 			},
 			// 物理按键
-			onKey(key,e){
+			keyDown(key,e){
 				console.log(key,e)
 			},
 			// 修改数量和成本

文件差異過大導致無法顯示
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


文件差異過大導致無法顯示
+ 7 - 2
unpackage/dist/dev/app-plus/app-view.js


部分文件因文件數量過多而無法顯示