瀏覽代碼

价格设置

lilei 2 年之前
父節點
當前提交
68f150989d

+ 2 - 2
App.vue

@@ -1,8 +1,8 @@
 <script>
 	export default {
 		globalData: {
-			// baseUrl: 'http://192.168.0.103:9110/saas/clz/', // 本地
-			baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
+			baseUrl: 'http://192.168.0.215:9110/saas/clz/', // 本地
+			// baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},
 		onLaunch: function() {

+ 27 - 0
api/shelf.js

@@ -226,4 +226,31 @@ export const getShelfTempBillDetail = (params) => {
     url: `shelfTempBill/findBySn/${params.sn}`,
     method: 'get'
   })
+}
+
+// 扫描取货
+export const getProductfindByScanCode = (params) => {
+  return request({
+    url: `shelfProduct/findByScanCode`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 确认取货
+export const shelfOrderOnceCreate = (params) => {
+  return request({
+    url: `shelfOrder/atOnceCreate`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 是否设置了价格显示
+export const findPriceShow = (params) => {
+  return request({
+    url: `shelf/storeParam/findByParamKey`,
+    data: params,
+    method: 'post'
+  })
 }

+ 27 - 0
pages.json

@@ -276,6 +276,33 @@
             }
             
         }
+        ,{
+            "path" : "pages/queryByCode/queryByCode",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "按产品编码查询",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/queryByCode/confirmQh",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "确认取货",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/storeManage/priceSetting/priceSetting",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "价格显示设置",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 1 - 1
pages/digitalShelf/orderDetail.vue

@@ -24,7 +24,7 @@
 		</view>
 		<view class="order-body">
 			<!-- 头部车辆信息 -->
-			<div class="flex align-center cpb_header" v-if="info">
+			<div class="flex align-center cpb_header" v-if="info&&!info.billSource">
 				<div>
 					<u-image :src="info.vehicleLogo" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
 				</div>

+ 90 - 4
pages/index/index.vue

@@ -58,9 +58,14 @@
 			<view class="scanButton flex align_center" @click="openCamera">
 				<u-icon name="scan" size="60"></u-icon><text class="ml10">扫描VIN</text>
 			</view>
+			<!-- 直接取货 -->
+			<view class="quickButton flex align_center" v-if="userInfo.sysUserFlag == '1'" @click="showAction = true">
+				<text>没有VIN,直接取货</text>
+			</view>
 			<view class="flex align_center justify_center">
 				<u-image src="/static/banner1.png" width="645" height="504"></u-image>
 			</view>
+			<u-action-sheet :list="actionList" @click="clickAction" v-model="showAction"></u-action-sheet>
 		</view>
 		<!-- 扫描记录 -->
 		<view class="list-box">
@@ -98,7 +103,7 @@
 	} from 'vuex'
 	import scrollBox from '@/components/scrollBox.vue'
 	import UniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue'
-	import { shelfBondRecordWaitPayRecord, findStoreShelf, shelfGetTotalWaitQty } from '@/api/shelf.js'
+	import { shelfBondRecordWaitPayRecord, findStoreShelf, shelfGetTotalWaitQty, getProductfindByScanCode } from '@/api/shelf.js'
 	import { xprhStoreApplyRead } from '@/api/xprh.js'
 	import { listLookUp, getLookUpDatas } from '@/api/data.js';
 	import { scanVinLogQueryRoll, getScanVinLogList, getScanGetMaxQty }from '@/api/car.js'
@@ -117,7 +122,18 @@
 				orderTodo: null,
 				avatarUrl:'',
 				navHeight: '44',
-				scanMaxNums: 10
+				scanMaxNums: 10,
+				showAction: false,
+				actionList: [
+					{
+						text: '扫描条形码/二维码',
+						fontSize: 32
+					},
+					{
+						text: '按产品编码查询',
+						fontSize: 32
+					}
+				]
 			}
 		},
 		computed: {
@@ -154,6 +170,8 @@
 				this.getListLookUp();
 				// 获取支付,收款方式
 				this.getLookUpList('PAY_PROCUCT_TYPE', 'vuex_paymentTypeList');
+				// 价格类型
+				this.getLookUpList('PRICE_SHOW_TYPE', 'vuex_priceTypeList');
 				// 初始化页面
 				this.pageInit()
 			})
@@ -308,8 +326,62 @@
 				})
 			},
 			// 保证金支付
-			toPayBondAmount(){
-				 
+			toPayBondAmount(){},
+			// 选择取货方式
+			clickAction(index){
+				const shelfSn = this.hasShelf.shelfSn
+				// 扫描
+				if(index == 0){
+					uni.scanCode({
+						success: function (res) {
+							console.log(res);
+							const params = {
+								codeType: res.scanType == 'QR_CODE' ? 0 : 1,
+							}
+							// 二维码
+							if(res.scanType == 'QR_CODE'){
+								const ret = res.result.split("&")
+								params.productSn = ret[1] // 产品编码sn
+							}else{
+								params.qrCode = res.result
+							}
+							uni.showLoading({
+								title: "正在查询产品..."
+							})
+							// 确认取货
+							getProductfindByScanCode(params).then(res => {
+								if(res.status == 200 && res.data){
+									if(res.data.currentInven){
+										const params = Object.assign({shelfSn: shelfSn, billSource: res.scanType == 'QR_CODE' ? 'qr_code': 'bar_code'},res.data)
+										uni.navigateTo({
+											url: '/pages/queryByCode/confirmQh?data='+ encodeURIComponent(JSON.stringify(res.data))
+										})
+									}else{
+										uni.showModal({
+											title: '提示',
+											content: '产品库存为0,无法取货!',
+											confirmText: '好的',
+											showCancel: false
+										})
+									}
+								}else{
+									uni.showModal({
+										title: '提示',
+										content: '产品不属于此货架,请重新扫描!',
+										confirmText: '好的',
+										showCancel: false
+									})
+								}
+								uni.hideLoading()
+							})
+						}
+					});
+				}else{
+					// 按编码搜索
+					uni.navigateTo({
+						url: '/pages/queryByCode/queryByCode'
+					})
+				}
 			},
 			// 去扫描
 			openCamera(){
@@ -416,6 +488,20 @@
 					opacity: 0.8;
 				}
 			}
+			.quickButton{
+				margin: 0 0 0.5em 0;
+				padding: 0.5em;
+				background: #fff;
+				color: #333;
+				font-size: 1.5em;
+				border-radius: 5em;
+				justify-content: center;
+				border:0.1rpx solid #eee;
+				box-shadow: 1rpx 2rpx 5rpx #f8f8f8;
+				&:active{
+					opacity: 0.8;
+				}
+			}
 			.ml10{
 				margin-left: 0.4em;
 			}

+ 5 - 0
pages/morePage/morePage.vue

@@ -53,6 +53,11 @@
 					<text slot="icon"></text>
 				</u-cell-item>
 			</u-cell-group>
+			<u-cell-group :border="false">
+				<u-cell-item title="价格显示设置" v-if="$hasPermissions('M_roleSetting_mini')" @click="toPage('/pages/storeManage/priceSetting/priceSetting')" :title-style="{fontSize:'1em'}">
+					<text slot="icon"></text>
+				</u-cell-item>
+			</u-cell-group>
 		</view>
 		<view class="list-box" v-if="hasLogin&&dealerPhone">
 			<view class="list-title flex justify_center phone" @click="call">

+ 130 - 0
pages/queryByCode/confirmQh.vue

@@ -0,0 +1,130 @@
+<template>
+	<view class="content" v-if="nowData">
+		 <view class="productInfo">
+			 <view><u-image :src="nowData.images" border-radius="16" width="160" height="160" bg-color="#EBEBEB"></u-image></view>
+			 <view><text class="item-no">{{ nowData.shelfPlaceCode }}</text><text>{{ nowData.code }}</text></view>
+			 <view class="item-name">
+			 	<text>{{ nowData.name }}</text>
+			 </view>
+		 </view>
+		 <view class="number-input flex flex_column align_center justify_center">
+		 	<view class="u-ninput">
+		 		<u-number-box :min="1" :max="nowData.currentInven" v-model="qty" color="#000" bg-color="#fff" size="36" :input-height="80" :input-width="180"></u-number-box>
+		 	</view>
+		 	<view class="kucun">可用库存:<text>{{nowData.currentInven}}</text>{{nowData.unit}}</view>
+		 </view>
+		 <view class="buttons">
+			 <u-button :throttle-time="100" :loading="loading" @click="outShelfOrder" :custom-style="{ background: '#066cff', color: '#fff',width:'400rpx' }" shape="circle" type="info">
+			 	确认取货
+			 </u-button>
+		 </view>
+	</view>
+</template>
+
+<script>
+	import { shelfOrderOnceCreate } from '@/api/shelf'
+	export default {
+		data() {
+			return {
+				 loading:false,
+				 nowData: null,
+				 qty: 1
+			}
+		},
+		onLoad(options) {
+			 this.nowData = JSON.parse(decodeURIComponent(options.data));
+		},
+		methods: {
+			// 确认取货
+			 outShelfOrder(){
+				 this.loading = true
+				 shelfOrderOnceCreate({
+					 billSource: this.nowData.billSource,
+					 shelfOrderDetailList: [{
+							"productSn": this.nowData.productSn,
+							"totalQty": this.qty
+						}]
+				 }).then(res => {
+					 if(res.status == 200){
+						 uni.showToast({
+						 	icon:'none',
+							title: res.message
+						 })
+						 uni.redirectTo({
+						 	url: "/pages/digitalShelf/orderDetail?shelfOrderSn="+res.data.shelfOrderSn
+						 })
+					 }
+					this.loading = false
+				 })
+			 }
+		}
+	}
+</script>
+
+<style lang="less">
+.content{
+	background-color: #fff;
+	width: 100%;
+	padding: 50rpx 30rpx;
+	height: 100vh;
+	.productInfo{
+		> view{
+			text-align: center;
+			display: flex;
+			justify-content: center;
+			font-size: 32rpx;
+			.item-no{
+				font-weight: normal;
+				margin-right: 6rpx;
+				padding: 0 10rpx;
+				background: rgba(3, 54, 146, 0.15);
+				border-radius: 100rpx;
+				color: #033692;
+				font-size: 24rpx;
+			}
+			padding: 10rpx;
+		}
+		.item-name{
+			margin-top: 20rpx;
+			font-size: 28rpx;
+		}
+	}
+	.number-input{
+		padding: 30rpx 30rpx 10rpx;
+		> view{
+			padding: 20rpx 0;
+		}
+		.kucun{
+			color: #999;
+			text{
+				color: #333;
+			}
+		}
+		.u-ninput{
+			border: 2rpx solid #eee;
+			border-radius: 50rpx;
+			padding: 0 12rpx;
+		}
+		/deep/ .u-icon-disabled{
+			background: #fff!important;
+		}
+		/deep/ .u-number-input{
+			margin: 0 2rpx;
+			border: 2rpx solid #eee;
+			border-top: 0;
+			border-bottom: 0;
+		}
+		/deep/ .u-icon-plus, /deep/ .u-icon-minus{
+			border-radius: 50rpx;
+		}
+	}
+	  
+	.buttons{
+		padding: 50rpx 0;
+		> view{
+			width: 80%;
+			margin: 0 2%;
+		}
+	}
+}
+</style>

+ 209 - 0
pages/queryByCode/queryByCode.vue

@@ -0,0 +1,209 @@
+<template>
+	<view class="content flex flex_column">
+		<view class="searchBar">
+			<view class="search flex align_center">
+				<view class="input">
+					<u-search 
+					focus
+					v-model="queryWord" 
+					@input="change"
+					@custom="getpartList" 
+					@search="getpartList" 
+					@clear="clearSearch" 
+					:height="80"
+					bg-color="#fff" 
+					:action-style="{border:'0.1rpx solid #00aaff',borderRadius:'50rpx',color:'#00aaff'}" 
+					placeholder="请输入产品编码或名称搜索"></u-search>
+				</view>
+			</view>
+		</view>
+		<view class="check-list">
+			<scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
+				<view class="partList-list-box" v-for="item in partList" :key="item.id">
+					<view class="product flex align_center" @click="toEdit(item)">
+						<view class="flex align_center flex_1">
+							<view class="pimgs">
+								<u-image :src="item.images?item.images:`/static/def_imgs.png`" width="128" height="128" border-radius="10"></u-image>
+							</view>
+							<view class="pinfo">
+								<view class="pname">
+									<text>{{item.shelfPlaceCode}}</text>{{item.code}}
+								</view>
+								<view class="ptxt flex align_center justify_between">
+									<view>
+										<text class="pcode">{{item.name}}</text>
+									</view>
+								</view>
+							</view>
+						</view>
+					</view>
+				</view>
+				<view style="padding: 20upx;">
+					 <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="partList.length==0 && status!='loading'" mode="list"></u-empty>
+					 <u-loadmore v-if="(total>=partList.length&&partList.length)||status=='loading'" :status="status" />
+				</view>
+			</scroll-view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { getShelfProductList } from '@/api/shelf'
+	export default {
+		data() {
+			return {
+				queryWord: '',
+				shelfName:'',
+				shelfSn: '',
+				pageNo:1,
+				pageSize: 20,
+				total: 0, // 列表总数
+				noDataText: '暂无产品',
+				status: 'nomore',
+				partList: [],
+			}
+		},
+		onLoad(opts) {
+			this.shelfSn = this.$store.state.vuex_storeShelf.shelfSn
+		},
+		methods: {
+			//取货
+			toEdit(item){
+				const params = Object.assign({shelfSn: this.shelfSn, billSource: 'product_code'},item)
+				uni.navigateTo({
+					url: '/pages/queryByCode/confirmQh?data='+ encodeURIComponent(JSON.stringify(params))
+				})
+			},
+			clearSearch(){
+				this.queryWord = ''
+				this.pageNo = 1
+				this.partList = []
+			},
+			change(v){
+				if(v==''){
+					this.clearSearch()
+				}
+			},
+			// 获取数字货架列表
+			getpartList(){
+				const _this = this
+				let params = {
+				    pageNo: this.pageNo,
+				    pageSize: this.pageSize,
+					code: this.queryWord,
+				}
+				_this.status = 'loading'
+				getShelfProductList(params).then(res => {
+					uni.hideLoading()
+					if(res.status == 200){
+						let list = res.data.list
+						console.log(list)
+						if (list && list.length){
+							// 分页 拼接数据
+							if (_this.pageNo != 1) {
+								_this.partList = _this.partList ? _this.partList.concat(list) : list
+							} else {
+								_this.partList = list
+							}
+							this.total = res.data.count
+							if (_this.partList.length == res.data.count) {
+								_this.status = 'nomore'
+							} else {
+								_this.status = 'loadmore'
+							}
+						} else {
+							_this.partList = list || []
+							this.total = 0
+							_this.status = 'nomore'
+						}
+						_this.noDataText = '暂无匹配产品'
+					}else{
+						_this.status = 'loadmore'
+						_this.partList = []
+						_this.total = 0
+						_this.noDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
+					}
+					this.showTab = false
+				})
+			},
+			// 加载更多
+			onreachBottom () {
+				if(this.partList.length < this.total ){
+					this.pageNo++
+					this.getpartList()
+				}else{
+					this.status = "nomore"
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+.content{
+	height: 100vh;
+	width: 100%;
+	padding: 0 0.5rem;
+	background: #fff;
+	.searchBar{
+		padding: 0 0.3rem;
+		.search{
+			padding: 0.5rem 0.5rem 0.3rem 0.5rem;
+			.input{
+				flex-grow: 1;
+				border:0.1rpx solid #eee;
+				padding: 0.1rpx;
+				border-radius: 50rpx;
+				padding-right: 10rpx;
+			}
+		}
+	}
+	.check-list{
+		flex-grow: 1;
+		.scroll-view{
+			height: calc(100vh - 180rpx);
+			box-sizing: border-box;
+		}
+		.partList-list-box{
+			padding: 20rpx 30rpx;
+			border-bottom: 2rpx solid #f5f5f5;
+			&:last-child{
+				border:0;
+			}
+			.product{
+				flex-grow: 1;
+				&:active{
+					opacity: 0.6;
+					background-color: #f8f8f8;
+				}
+				.pinfo{
+					flex-grow: 1;
+					padding-left: 20rpx;
+					.pname{
+						font-size: 28rpx;
+						color: #191919;
+						margin-bottom: 10rpx;
+						text{
+							font-weight: normal;
+							margin-right: 6rpx;
+							padding: 0 10rpx;
+							background: rgba(3, 54, 146, 0.15);
+							border-radius: 100rpx;
+							color: #033692;
+							font-size: 24rpx;
+						}
+					}
+					.ptxt{
+						font-size: 28rpx;
+						color: #333;
+						font-weight: bold;
+						.pnums{
+							color: #222;
+						}
+					}
+				}
+			}
+		} 
+	}
+}
+</style>

+ 53 - 0
pages/storeManage/priceSetting/priceSetting.vue

@@ -0,0 +1,53 @@
+<template>
+	<view class="content">
+		<u-cell-group>
+			<u-cell-item title="显示价格">
+				<u-switch slot="right-icon" v-model="showPrice"></u-switch>
+			</u-cell-item>
+			<u-cell-item title="显示价格类型" value="请选择" @click="showPriceType=true"></u-cell-item>
+			<u-cell-item title="员工是否可见进货价">
+				<u-switch slot="right-icon" v-model="showJhPrice"></u-switch>
+			</u-cell-item>
+		</u-cell-group>
+		<u-action-sheet :list="priceTypeList" v-model="showPriceType"></u-action-sheet>
+	</view>
+</template>
+
+<script>
+	import { findPriceShow } from '@/api/shelf'
+	export default {
+		data() {
+			return {
+				showPrice: false,
+				showJhPrice: false,
+				showPriceType: false,
+				priceTypeList:[]
+			}
+		},
+		onLoad() {
+			this.getPrice('PRICE_SHOW')
+		},
+		onReady() {
+			this.priceTypeList = this.$store.state.vuex_priceTypeList
+			this.priceTypeList.map(item => {
+				item.text = item.dispName
+				item.fontSize = 30
+			})
+			console.log(this.$store.state)
+		},
+		methods: {
+			getPrice(data){
+				findPriceShow({paramCode:data}).then(res => {
+					console.log(res)
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.content{
+		width: 100%;
+		height: 100vh;
+	}
+</style>

+ 1 - 0
store/index.js

@@ -49,6 +49,7 @@ const store = new Vuex.Store({
 		vuex_shelfChoosePart: [], // 数字货架临配选择配件
 		vuex_allLookUp: [],  //  数据字典
 		vuex_paymentTypeList: [], // 支付方式
+		vuex_priceTypeList:[], // 价格类型
 		vuex_userInfo:  null, // 用户信息
 		vuex_userPhoto: null, // 用户头像
 		vuex_permCodes: [], // 权限码