lilei преди 1 година
родител
ревизия
1581bf805a
променени са 6 файла, в които са добавени 258 реда и са изтрити 13 реда
  1. 5 1
      config/api.js
  2. 1 1
      config/request.js
  3. 9 0
      pages.json
  4. 230 0
      pages/codeBar/codeBar.vue
  5. 13 11
      pages/index/index.vue
  6. 0 0
      static/iconfont/iconfont.css

+ 5 - 1
config/api.js

@@ -97,4 +97,8 @@ export const storeCallOutPick = (params, config = {}) => http.post('/storeCallOu
 //  店内调出 出库
 export const storeCallOutOut = (params, config = {}) => http.post(`/storeCallOut/outPick`, params, config)
 // 详情  合计
-export const storeCallOutDetailCount = (params, config = {}) => http.post('/storeCallOut/detail/queryCount', params, config)
+export const storeCallOutDetailCount = (params, config = {}) => http.post('/storeCallOut/detail/queryCount', params, config)
+
+// 产品维护
+export const dealerProductList = (params, config = {}) => http.post(`/dealerProduct/queryPage/${params.pageNo}/${params.pageSize}`, params, config)
+export const dealerProductSave = (params, config = {}) => http.post('/dealerProduct/save', params, config)

+ 1 - 1
config/request.js

@@ -19,7 +19,7 @@ module.exports = (vm) => {
 			// 可以在此通过vm引用vuex中的变量,具体值在vm.$store.state中
 			config.header['access-token'] = vm.$store.state.vuex_token
 		}
-		config.header['hand-device-no'] = vm.$store.state.vuex_deviceId
+		// config.header['hand-device-no'] = vm.$store.state.vuex_deviceId
 	    return config 
 	}, config => { // 可使用async await 做异步操作
 	    return Promise.reject(config)

+ 9 - 0
pages.json

@@ -211,6 +211,15 @@
                 "enablePullDownRefresh": false
             }
         }
+        ,{
+            "path" : "pages/codeBar/codeBar",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "条码维护",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 230 - 0
pages/codeBar/codeBar.vue

@@ -0,0 +1,230 @@
+<template>
+	<view class="p-content">
+		<view class="p-head">
+			<view>
+				<text>条形码:</text>
+				<view style="flex-grow: 1;display: flex;align-items: center;">
+					<input 
+					style="width: 100%;text-align: left;font-size: 32rpx;padding: 6rpx 0 6rpx 7rpx;" 
+					class="uni-input" 
+					placeholder="扫描或输入条码" 
+					border="surround" 
+					v-model="query.qrCode">
+				</view>
+			</view>
+			<view>
+				<text>产品编码:</text>
+				<view style="flex-grow: 1;display: flex;align-items: center;">
+					<input 
+					style="width: 100%;text-align: left;font-size: 32rpx;padding: 6rpx 0 6rpx 7rpx;" 
+					class="uni-input" 
+					placeholder="请输入产品编码" 
+					border="surround" 
+					v-model="query.code">
+				</view>
+			</view>
+			<view>
+				<text>产品名称:</text>
+				<view style="flex-grow: 1;display: flex;align-items: center;">
+					<input 
+					style="width: 100%;text-align: left;font-size: 32rpx;padding: 6rpx 0 6rpx 7rpx;" 
+					class="uni-input" 
+					placeholder="请输入产品名称" 
+					border="surround" 
+					v-model="query.name">
+				</view>
+			</view>
+			<view>
+				<button type="primary" size="mini" @click="queryProduct" :style="{padding:'5px 20px'}">查询</button>
+			</view>
+		</view>
+		<view class="p-body">
+			<uni-table border emptyText="暂无数据" :loading="loading" >
+				<!-- 表头行 -->
+				<uni-tr>
+					<uni-td align="center">条形码</uni-td>
+					<uni-td align="center">产品编码</uni-td>
+					<uni-td align="center">产品名称</uni-td>
+				</uni-tr>
+				<!-- 表格数据行 -->
+				<uni-tr 
+				v-for="item in detailList" :key="item.id" 
+				:checkedRow="tempProduct&&tempProduct.id == item.id" 
+				@click="toEdit(item)">
+					<uni-td width="40%" align="center">{{item.qrCode}}</uni-td>
+					<uni-td width="30%" align="center">{{item.code}}</uni-td>
+					<uni-td width="30%" align="center">{{item.name}}</uni-td>
+				</uni-tr>
+			</uni-table>
+		</view>
+		 
+		<scanCode></scanCode>
+		<uni-popup ref="popup" :mask-click="false" type="dialog">
+			<view 
+			style="
+			font-size: 30rpx;
+			background-color: #fff;
+			padding: 30rpx 50rpx;
+			border-radius: 30rpx;
+			width: 80%;
+			margin: 0 auto;">
+				<view style="line-height: 60rpx;" v-if="tempProduct">
+					<view>
+						产品编码:{{tempProduct.code}}
+					</view>
+					<view>
+						产品名称:{{tempProduct.name}}
+					</view>
+					<view style="display: flex;align-items: center;padding-top: 15rpx;">
+						条形码:
+						<input
+						:focus="true"
+						style="width: 70%;text-align: left;border: 1px solid #eee;font-size: 32rpx;padding: 6rpx 0 6rpx 7rpx;" 
+						class="uni-input" 
+						placeholder="扫描或输入条码" 
+						border="surround" 
+						v-model="code">
+					</view>
+				</view>
+				<view style="display: flex;padding: 50rpx 15rpx 10rpx;justify-content: center;">
+					<button size="mini" @click="closePop" :style="{padding:'5px 20px'}">取消</button>
+					<button size="mini" type="primary" :loading="subloading" @click="okPop" :style="{padding:'5px 20px'}">确定</button>
+				</view>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	import {
+		dealerProductList, 
+		dealerProductSave
+	} from '@/config/api.js'
+    import scanCode from '@/libs/scan-code.vue';
+	import { playAudio } from '@/libs/tools.js'
+	export default {
+		components: { scanCode },
+		data() {
+			return {
+				loading: false,
+				subloading: false,
+				query:{
+					qrCode:'',
+					name:'',
+					code:''
+				},
+				detailList:[],
+				code:'',
+				tempProduct: null
+			};
+		},
+		onLoad(opts) {
+		  var _this = this
+		  uni.$on('scancodedate', function(content) {
+			  console.log("扫描到的内容为:", content)
+			  _this.code = content||''
+		  })
+		  
+		},
+		onShow() {
+			this.hideKeyborder()
+		},
+		onUnload() {
+			uni.$off('scancodedate')
+		},
+		methods: {
+			closePop(){
+				this.$refs.popup.close()
+			},
+			okPop(){
+				if(this.code){
+					this.productSave()
+				}else{
+					uni.$u.toast("请输入或扫描条码!")
+				}
+			},
+			hideKeyborder(){
+				uni.hideKeyboard()
+			},
+			productSave(){
+				this.subloading = true
+				this.tempProduct.qrCode = this.code
+				dealerProductSave(this.tempProduct).then(res => {
+					if(res.status == 200){
+						this.queryProduct()
+						this.code == ''
+						this.closePop()
+					}
+					this.subloading = false
+				})
+			},
+			// 查询产品
+			queryProduct(){
+				if(this.query.code==''&&this.query.qrCode==''&&this.query.name==''){
+				  uni.$u.toast("请输入查询条件!")
+				  playAudio('error')
+				  return
+				}
+				const params = { 
+					pageNo:1, 
+					pageSize:10 ,
+					sysFlag: "0"
+				}
+				console.log(params)
+				dealerProductList({...params,...this.query}).then(res => {
+					console.log(res)
+					if(res.status == 200){
+						this.detailList = res.data && res.data.list || []
+					}
+				})
+			},
+			// 编辑
+			toEdit(item) {
+				this.tempProduct = item
+				this.$refs.popup.open()
+				this.hideKeyborder()
+			}
+		},
+	}
+</script>
+
+<style lang="scss">
+	.p-content{
+		button{
+			line-height: 1.7;
+		}
+		.p-head{
+			font-size: 32upx;
+			color: $uni-text-color;
+			>view{
+				display: flex;
+				align-items: center;
+				padding: 15upx 20upx;
+				border-bottom: 1px solid #eee;
+				justify-content: space-between;
+				> view{
+					display: flex;
+					padding: 0 10upx;
+					align-items: center;
+				}
+			}
+			.uni-input{
+				border: 1px solid #eee;
+				width: 150upx;
+				text-align: center;
+			}
+		}
+		.p-body{
+			overflow: auto;
+			flex-grow: 1;
+			height: 50%;
+		}
+		.p-footer{
+			padding:20upx 30upx;
+			display: flex;
+			> button{
+				width: 30%;
+			}
+		}
+	}
+</style>

+ 13 - 11
pages/index/index.vue

@@ -26,16 +26,13 @@
 					 <text class="label">操作记录</text>
 				 </view>
 			</view>
-			<!-- <view class="grid-box">
-				 <view @click="toSeting">
-					 <text class="iconfont icon-xianshi"></text>
-					 <text class="label">显示设置</text>
-				 </view>
-				 <view @click="toSeting">
-					 <text class="iconfont icon-lishijilu"></text>
-					 <text class="label">操作记录</text>
+			<view class="grid-box">
+				 <view @click="toEditCode">
+					 <text class="iconfont icon-tiaomafu"></text>
+					 <text class="label">条码维护</text>
 				 </view>
-			</view> -->
+				 <view class="nob"></view>
+			</view>
 		</view>
 		<view class="copright">
 			<view>系统版本:{{version}}</view>
@@ -145,6 +142,11 @@
 				uni.navigateTo({
 					url:"/pages/record/index"
 				})
+			},
+			toEditCode(){
+				uni.navigateTo({
+					url:"/pages/codeBar/codeBar"
+				})
 			}
 		}
 	}
@@ -212,8 +214,8 @@
 				.icon-xianshi{
 					color: #55aaff;
 				}
-				.icon-caozuozhucebiao{
-					color: #55aa7f;
+				.icon-tiaomafu{
+					color: #ffaa00;
 				}
 				.icon-lishijilu{
 					color: #55557f;

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
static/iconfont/iconfont.css


Някои файлове не бяха показани, защото твърде много файлове са промени