Переглянути джерело

Merge branch 'develop_hb01' of jianguan-web/repairYimatong-mini-html into master

李磊 2 роки тому
батько
коміт
21de05c8ae

+ 33 - 0
api/shelf.js

@@ -306,4 +306,37 @@ export const rewardOrderFindBySn = (params) => {
     data: params,
     method: 'post'
   })
+}
+
+// 用户价格权限配置
+export const queryQplsConfig = (params) => {
+  return request({
+    url: `shelf/storeParam/queryQplsConfig`,
+    data: params,
+    method: 'post'
+  })
+}
+// 用户价格配置列表
+export const queryShelfUserParam = (params) => {
+  return request({
+    url: `shelf/storeParam/queryShelfUserParam`,
+    data: params,
+    method: 'post'
+  })
+}
+// 修改货架用户配置  根据id 修改
+export const updateShelfUserParam = (params) => {
+  return request({
+    url: `shelf/storeParam/updateShelfUserParam`,
+    data: params,
+    method: 'post'
+  })
+}
+// 选中配件价格显示
+export const findShelfUserParam = (params) => {
+  return request({
+    url: `shelf/storeParam/findShelfUserParam`,
+    data: params,
+    method: 'post'
+  })
 }

+ 2 - 26
pages/index/index.vue

@@ -119,7 +119,7 @@
 	} from 'vuex'
 	import scrollBox from '@/components/scrollBox.vue'
 	import UniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue'
-	import { shelfBondRecordWaitPayRecord, findStoreShelf, shelfGetTotalWaitQty, getProductfindByScanCode, findPriceShow,findPriceShowType,findPriceShowEmployee } from '@/api/shelf.js'
+	import { shelfBondRecordWaitPayRecord, findStoreShelf, shelfGetTotalWaitQty, getProductfindByScanCode } from '@/api/shelf.js'
 	import { xprhStoreApplyRead } from '@/api/xprh.js'
 	import { findCurrentRewardRule } from '@/api/rewardRule.js'
 	import { listLookUp, getLookUpDatas, getCurrUserInfo } from '@/api/data.js';
@@ -173,8 +173,6 @@
 			imgList(){
 				if(this.hasRedPacket&&this.hasShelf){
 					return [{
-						image: '/static/banner1.png'
-					},{
 						image: '/static/banner2.png'
 					}]
 				}else{
@@ -256,24 +254,6 @@
 					return true
 				}
 			},
-			// 价格显示
-			async getPriceShow(){
-				await findPriceShow().then(res => {
-					this.showPrice = res.data ? res.data.paramValue=='1' : false
-					this.$store.state.vuex_showPrice[0] = this.showPrice
-				})
-				await findPriceShowType().then(res => {
-					if(res.data&&res.data.paramValue){
-						this.priceType = res.data.paramValue
-						this.priceTypeName = this.$store.state.vuex_priceTypeList.find(item => item.code == res.data.paramValue).dispName
-						this.$store.state.vuex_showPrice[1] = this.priceType
-					}
-				})
-				await findPriceShowEmployee().then(res => {
-					this.showJhPrice = res.data ? res.data.paramValue=='1' : false
-					this.$store.state.vuex_showPrice[2] = this.showJhPrice
-				})
-			},
 			pageInit(){
 				if(this.hasLogin){
 					// 获取扫描记录
@@ -309,10 +289,6 @@
 				getLookUpDatas({ type: code }).then(res => {
 					if (res.status == 200) {
 						this.$store.state[vuexKey] = res.data || [];
-						if(code=='PRICE_SHOW_TYPE'){
-							// 获取显示价格类型
-							this.getPriceShow()
-						}
 					}
 				});
 			},
@@ -445,7 +421,7 @@
 			},
 			// 单击banner
 			clickBanner(index){
-				if(index == 1 && this.hasRedPacket){
+				if(index == 0 && this.hasRedPacket){
 					uni.navigateTo({url:"/pages/morePage/redPacket"})
 				}
 			},

+ 19 - 4
pages/morePage/morePage.vue

@@ -48,7 +48,7 @@
 				</u-cell-item>
 			</u-cell-group>
 		</view>
-		<view class="list-box" v-if="$hasPermissions('M_employee_mini')||$hasPermissions('M_roleSetting_mini')||$hasPermissions('M_priceShow_mini')">
+		<view class="list-box" v-if="$hasPermissions('M_employee_mini')||$hasPermissions('M_roleSetting_mini')||($hasPermissions('M_priceShow_mini')&&showPriceSet)">
 			<view class="list-title">
 				<u-icon size="32" name="home"></u-icon> <text>基础设置</text>
 			</view>
@@ -63,7 +63,7 @@
 				</u-cell-item>
 			</u-cell-group>
 			<u-cell-group :border="false">
-				<u-cell-item title="价格显示设置" v-if="$hasPermissions('M_priceShow_mini')" @click="toPage('/pages/storeManage/priceSetting/priceSetting')" :title-style="{fontSize:'1em'}">
+				<u-cell-item title="价格权限/显示设置" v-if="$hasPermissions('M_priceShow_mini')&&showPriceSet" @click="toPage('/pages/storeManage/priceSetting/priceSetting')" :title-style="{fontSize:'1em'}">
 					<text slot="icon"></text>
 				</u-cell-item>
 			</u-cell-group>
@@ -97,11 +97,14 @@
 	    mapState,
 	    mapMutations
 	} from 'vuex'
+	import { queryQplsConfig } from '@/api/shelf.js'
 	export default {
 		data() {
 			return {
 				dealerPhone: null,
-				showPopup: false
+				showPopup: false,
+				showPriceSet: false,
+				shelfSn: null
 			}
 		},
 		computed: {
@@ -118,11 +121,13 @@
 			hasRedPacket(){
 				const rule = this.$store.state.vuex_rewardRule
 				return rule&&rule.ruleStatus == 'release'
-			}
+			},
 		},
 		onShow() {
 			const shelfInfo = this.$store.state.vuex_storeShelf
+			this.shelfSn = shelfInfo.shelfSn
 			this.dealerPhone = shelfInfo&&shelfInfo.contactMobile ? shelfInfo.contactMobile : ''
+			this.getPriceCofig()
 		},
 		methods: {
 			beforeSwitch(index){
@@ -132,6 +137,16 @@
 					return true
 				}
 			},
+			// 获取价格配置
+			getPriceCofig(){
+				queryQplsConfig({shelfSn: this.shelfSn}).then(res => {
+					this.$store.state.vuex_configPrice = res.data || null
+					const ret = [false,false]
+					ret[0]= res.data.shelf_cost_show == '1'
+					ret[1]= res.data.shelf_price_show == '1'
+					this.showPriceSet = ret.filter(item => !!item).length > 0
+				})
+			},
 			// 去扫描
 			openCamera(){
 				if(this.hasLogin){

+ 191 - 76
pages/storeManage/priceSetting/priceSetting.vue

@@ -1,100 +1,215 @@
 <template>
-	<view class="content">
-		<u-cell-group>
-			<u-cell-item title="显示价格">
-				<u-switch slot="right-icon" @change="changeShowPrice" v-model="showPrice"></u-switch>
-			</u-cell-item>
-			<u-cell-item title="显示价格类型" v-if="showPrice" :value="priceTypeName||'请选择'" @click="showPriceType=true"></u-cell-item>
-			<u-cell-item title="员工是否可见进货价" v-if="showPrice&&priceType == 'PURCHASES_PRICE'">
-				<u-switch slot="right-icon" @change="changeShowJhPrice" v-model="showJhPrice"></u-switch>
-			</u-cell-item>
-		</u-cell-group>
-		<!-- 价格类型列表 -->
-		<u-action-sheet :list="priceTypeList" v-model="showPriceType" @click="clickAction"></u-action-sheet>
+	<view class="page-body">
+		<view class="scroll-list">
+			 <view
+			 class="check-order-list" 
+			 v-for="(item,index) in list" 
+			 :key="item.id" 
+			 >
+			 	<view class="flex align_center justify_between">
+			 		<view class="u-name">
+			 			<text style="margin-right: 0.5rem;">{{item.userName}}</text>
+			 		</view>
+			 		<view class="u-mobile">
+			 			<text v-if="item.isManager == 1">门店负责人 / </text>
+						<text v-else>{{item.roleName?item.roleName + '/':''}}</text>
+			 			{{item.phone}}
+			 		</view>
+			 	</view>
+			 	<view class="price-item">
+			 		<u-checkbox-group>
+						<u-checkbox 
+							@change="(e)=>priceChange(e,item)"
+							v-for="(priceItem, priceIndex) in item.priceTypeList" :key="priceItem.id" 
+							v-model="priceItem.checked" 
+							:name="priceItem.val"
+						>{{priceItem.name}}</u-checkbox>
+					</u-checkbox-group>
+			 	</view>
+			 	<view class="price-show-list flex align_center" v-if="item.priceTypeList.length == 2&&item.showListPrice">
+			 		<text>列表显示</text>
+					<view>
+						<u-radio-group v-model="item.showListPriceVal" @change="(e)=>priceShowChange(e,item)">
+							<u-radio 
+								v-for="(priceItem, priceIndex) in priceShowType" :key="priceItem.id" 
+								:name="priceItem.code"
+							>
+								{{priceItem.dispName}}
+							</u-radio>
+						</u-radio-group>
+					</view>
+			 	</view>
+			  </view>
+			  <view style="padding:0 30upx 30upx;">
+			 	 <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
+			 	 <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
+			  </view>
+		</view>
 	</view>
 </template>
 
 <script>
-	import { findPriceShow,findPriceShowType,findPriceShowEmployee,savePriceShow,savePriceShowType,savePriceShowEmployee } from '@/api/shelf'
-	export default {
-		data() {
-			return {
-				showPrice: false,
-				showJhPrice: false,
-				showPriceType: false,
-				priceTypeList:[],
-				priceType:'',
-				priceTypeName:''
+	import {searchEmployee, delEmployee } from '@/api/employee'
+	import { queryQplsConfig, queryShelfUserParam, updateShelfUserParam } from '@/api/shelf.js'
+	import moment from 'moment'
+	export default{
+		name:'personnel',
+		data(){
+			return{
+				status: 'loading',
+				noDataText: '暂无数据',
+				// 查询条件
+				list: [],
+				total: 0,
+				shelfSn: null,
+				priceType:[{
+					val: 'PURCHASES_PRICE',
+					name: '进货价',
+					show: false,
+					checked: false
+				},
+				{
+					val: 'CAR_OWNER_PRICE',
+					name: '车主价',
+					show: false,
+					checked: false
+				}],
+				priceShowType:[]
+			}
+		},
+		computed:{
+			hasShelf(){
+				return this.$store.state.vuex_storeShelf
+			},
+			configPrice(){
+				return this.$store.state.vuex_configPrice
 			}
 		},
 		onLoad() {
-			this.priceTypeList = this.$store.state.vuex_priceTypeList
-			this.priceTypeList.map(item => {
-				item.text = item.dispName
-				item.fontSize = 30
-			})
+			this.shelfSn = this.hasShelf.shelfSn
+			this.priceShowType = this.$store.state.vuex_priceTypeList
+			this.getPriceCofig()
 		},
-		onReady() {
-			// this.pageInit()
-			this.showPrice = this.$store.state.vuex_showPrice[0]
-			this.priceType = this.$store.state.vuex_showPrice[1]
-			this.priceTypeName = this.priceTypeList.find(item => item.code == this.priceType).dispName
-			this.showJhPrice = this.$store.state.vuex_showPrice[2]
+		onShow() {
+			this.getRow()
 		},
-		methods: {
-			async pageInit(){
-				await findPriceShow().then(res => {
-					this.showPrice = res.data ? res.data.paramValue=='1' : false
-					this.$store.state.vuex_showPrice[0] = this.showPrice
+		methods:{
+			// 获取价格配置
+			getPriceCofig(){
+				this.priceType[0].show = this.configPrice.shelf_cost_show == '1'
+				this.priceType[1].show = this.configPrice.shelf_price_show == '1'
+			},
+			priceChange(e,item){
+				console.log(e,item)
+				const row = item.storeParamList.find(k => k.paramCode == e.name)
+				this.updateData({id:row.id,paramValue:e.value?'1':'0'})
+			},
+			priceShowChange(e,item){
+				console.log(e,item)
+				const row = item.storeParamList.find(k => k.paramCode == 'PRICE_SHOW_TYPE')
+				this.updateData({id:row.id,paramValue:e})
+			},
+			// 修改数据
+			updateData(params){
+				uni.showLoading({
+					title:'正在修改...'
 				})
-				await findPriceShowType().then(res => {
-					if(res.data&&res.data.paramValue){
-						this.priceType = res.data.paramValue
-						this.priceTypeName = this.priceTypeList.find(item => item.code == res.data.paramValue).dispName
-						this.$store.state.vuex_showPrice[1] = this.priceType
+				updateShelfUserParam(params).then(res => {
+					if(res.status == 200){
+						this.getRow()
 					}
-				})
-				await findPriceShowEmployee().then(res => {
-					this.showJhPrice = res.data ? res.data.paramValue=='1' : false
-					this.$store.state.vuex_showPrice[2] = this.showJhPrice
+					uni.hideLoading()
 				})
 			},
-			savePrice(data,value){
-				let fun = savePriceShow
-				if(data == 'PRICE_SHOW_TYPE'){
-					fun = savePriceShowType
-				}
-				if(data == 'PRICE_SHOW_EMPLOYEE'){
-					fun = savePriceShowEmployee
-				}
-				fun({
-					paramValue: value
-				}).then(res => {
-					 if(res.status == 200){
-						 uni.showToast({
-						 	icon:'none',
-							title: res.message
-						 })
-					 }
-					 this.pageInit()
+			// 格式化数据
+			formatData(){
+				this.list.map(item => {
+					const a = item.storeParamList
+					const pst = a.find(b=>b.paramCode=='PRICE_SHOW_TYPE') // 列表显示价格值
+					item.showListPriceVal = pst?pst.paramValue:''
+					const cop = a.find(b=>b.paramCode=='CAR_OWNER_PRICE') // 车主价值
+					item.carPriceVal = cop?cop.paramValue:''
+					const pp = a.find(b=>b.paramCode=='PURCHASES_PRICE') // 进货价值
+					item.ppPriceVal = pp?pp.paramValue:''
+					item.priceTypeList = JSON.parse(JSON.stringify(this.priceType.filter(item => item.show)))
+					// 赋值
+					item.priceTypeList.map(key => {
+						key.id = item.userId + '-' + key.val
+						// 车主价
+						if(key.val == 'CAR_OWNER_PRICE'){
+							key.checked = item.carPriceVal == '1'
+						}
+						// 进货价
+						if(key.val == 'PURCHASES_PRICE'){
+							key.checked = item.ppPriceVal == '1'
+						}
+					})
+					// 列表显示价格一行是否显示
+					const showListPrice = item.priceTypeList.filter(item => item.checked)
+					item.showListPrice = showListPrice.length == 2
 				})
+				this.list.splice()
+				console.log(this.list)
 			},
-			changeShowPrice(v){
-				this.savePrice('PRICE_SHOW',v?'1':'0')
-			},
-			clickAction(index){
-				this.savePrice('PRICE_SHOW_TYPE',this.priceTypeList[index].code)
+			// 查询列表
+			getRow () {
+			  let _this = this
+			  this.status = "loading"
+			  queryShelfUserParam({shelfSn: this.shelfSn}).then(res => {
+				if (res.code == 200 || res.status == 204 || res.status == 200) {
+				  _this.list = res.data || []
+				  _this.total = res.data.length
+				} else {
+				  _this.list = []
+				  _this.total = 0
+				  _this.noDataText = res.message
+				}
+				_this.formatData()
+				_this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
+			  })
 			},
-			changeShowJhPrice(v){
-				this.savePrice('PRICE_SHOW_EMPLOYEE',v?'1':'0')
-			}
 		}
 	}
 </script>
 
 <style lang="less">
-	.content{
-		width: 100%;
+	.page-body{
 		height: 100vh;
+		padding:0;
+		.scroll-list{
+			height: 100vh;
+			overflow: auto;
+			.check-order-list{
+				background: #ffffff;
+				padding: 10upx 20upx;
+				margin: 25rpx;
+				border-radius: 20upx;
+				box-shadow: 1px 1px 3px #EEEEEE;
+				> view{
+					padding: 0.8rem 0.5rem;
+					.u-name{
+						font-size: 32rpx;
+					}
+					.u-mobile{
+						color: #999;
+					}
+				}
+			}
+			.price-item{
+				border-top: 1rpx solid #eee;
+				padding-left: 5%;
+			}
+			.price-show-list{
+				margin-left: 5%;
+				border-top: 1rpx solid #eee;
+				>view{
+					padding:0 20rpx;
+				}
+			}
+		}
+		.footer{
+			padding: 0.6rem;
+			background: #ffffff;
+		}
 	}
-</style>
+</style>

+ 1 - 4
pages/vinInput/confirmVin.vue

@@ -160,10 +160,7 @@
 						vin:vinNo
 					}).then(res => {
 						if (res.status == 200&&res.data) {
-							// 非游客,生成vin记录
-							if(_this.userInfo.sysUserFlag == '1'){
-								_this.creatRecord(res.data)
-							}
+							_this.creatRecord(_this.userInfo.sysUserFlag == '1' ? res.data : null)
 							// 打开选择配件页面
 							uni.redirectTo({
 								url: "/pagesA/digitalShelf/choosePart?vinNumber="+vinNo+"&carList="+encodeURIComponent(JSON.stringify(res.data))+'&type=news'

+ 85 - 41
pagesA/digitalShelf/choosePart.vue

@@ -53,20 +53,11 @@
 											<text class="item-detail-text" v-if="item.affiliation=='SHELF'">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
 										</view>
 										<view class="flex justify_between">
-											<view class="item-detail-text flex_1" v-if="item.affiliation=='SHELF'">
-												 <view v-if="showPrice[0]">
-												 	<view v-if="showPrice[1]=='PURCHASES_PRICE'&&item.cost">
-												 		<text class="item-price" v-if="isAdmin || showPrice[2]">¥{{item.cost||0}}</text>
-												 	</view>
-												 	<text v-else class="item-price">¥{{item.price||0}}</text>
-												 </view>
-											</view>
-											<view class="item-detail-text flex_1" v-if="item.affiliation=='SUPER_CATALOGUE'">
-												<view v-if="showPrice[0]">
-													<text class="item-price" v-if="showPrice[1]!='PURCHASES_PRICE'">¥{{item.price||0}}</text>
-													<text class="item-price" v-else>
-														{{showPrice[2]?(item.cost||''):(isAdmin?(item.cost||''):'')}}
-													</text>
+											<view class="item-detail-text flex_1">
+												<view @click="openPriceModal(item)">
+													<text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice">{{item.price?'¥'+item.price:'暂无价格'}}</text>
+													<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
+													<u-icon name="arrow-right" v-if="priceShowVal"></u-icon>
 												</view>
 											</view>
 											<view class="item-detail-text" v-if="item.currentInven">
@@ -115,13 +106,11 @@
 										<text class="item-detail-text">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
 									</view>
 									<view class="flex justify_between">
-										<view class="item-detail-text flex_1" v-if="showPrice[0]">
-											<view v-if="showPrice[1]=='PURCHASES_PRICE'&&item.cost">
-												<text class="item-price" v-if="isAdmin || showPrice[2]">¥{{item.cost||0}}</text>
-											</view>
-											<text v-else class="item-price">¥{{item.price||0}}</text>
+										<view class="item-detail-text flex_1" @click="openPriceModal(item)">
+											<text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice">{{item.price?'¥'+item.price:'暂无价格'}}</text>
+											<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
+											<u-icon name="arrow-right" v-if="priceShowVal"></u-icon>
 										</view>
-										<view class="item-detail-text flex_1" v-else></view>
 										<view class="item-detail-text" v-if="item.currentInven">
 											<u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx',background:'#066cff'}" type="primary" size="mini">
 												<u-icon name="plus" color="#fff" size="28"></u-icon>
@@ -158,8 +147,8 @@
 					<u-image width="44" height="44" :src="`/static/icon_shopping@3x.png`"></u-image>
 				</div>
 			</div>
-			<view v-if="showPrice[0]&&showPrice[1]=='CAR_OWNER_PRICE'&&totalAmount">
-				合计:<text>¥{{totalAmount}}</text>
+			<view v-if="(showCarPrice||showCostPrice)&&totalAmount">
+				<!-- 合计:<text>¥{{totalAmount}}</text> -->
 			</view>
 			<div>
 				<u-button type="primary" :loading="saveLoading" @click="submitForm" :custom-style="{background:'#066cff',fontSize:'32rpx'}" shape="circle">确认拿货</u-button>
@@ -189,21 +178,9 @@
 										<text class="item-detail-text" v-if="item.affiliation!='SUPER_CATALOGUE'">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
 									</view>
 									<view class="flex justify_between">
-										<view class="item-detail-text flex_1" v-if="item.affiliation=='SUPER_CATALOGUE'">
-											<view v-if="showPrice[0]">
-												<text class="item-price" v-if="showPrice[1]=='CAR_OWNER_PRICE'">¥{{item.price||0}}</text>
-												<text class="item-price" v-else>
-													{{showPrice[2]?(item.cost||''):(isAdmin?(item.cost||''):'')}}
-												</text>
-											</view>
-										</view>
-										<view class="item-detail-text flex_1" v-else>
-											 <view v-if="showPrice[0]">
-												  <view v-if="showPrice[1]=='PURCHASES_PRICE'&&item.cost">
-												  	<text class="item-price" v-if="isAdmin || showPrice[2]">¥{{item.cost||0}}</text>
-												  </view>
-												  <text v-else class="item-price">¥{{item.price||0}}</text>
-											 </view>
+										<view class="item-detail-text flex_1">
+											<text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice">{{item.price?'¥'+item.price:'暂无价格'}}</text>
+											<text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
 										</view>
 										<view class="item-detail-text">
 											<u-number-box @change="updateCartNums" @blur="updateCartNums" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven||999999"></u-number-box>
@@ -225,16 +202,38 @@
 				</view>
 			</view>
 		</u-popup>
+		<!-- 价格查看 -->
+		<u-popup v-model="showPriceModal" mode="center" length="80%" closeable>
+			<view class="show-price-modal" v-if="tempData">
+				<view>
+					<text>产品编码</text>
+					<text>{{tempData.code||'--'}}</text>
+				</view>
+				<view>
+					<text>产品名称</text>
+					<text>{{tempData.name||'--'}}</text>
+				</view>
+				<view>
+					<text>进货价</text>
+					<text>{{tempData.cost?'¥'+tempData.cost:'暂无价格'}}</text>
+				</view>
+				<view>
+					<text>车主价</text>
+					<text>{{tempData.price?'¥'+tempData.price:'暂无价格'}}</text>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
 <script>
-	import { getShelfProductList, getShelfProductType, queryPartCodeByVin, getShelfQueryList, shelfOrderFlowCreate } from '@/api/shelf'
+	import { getShelfProductList, getShelfProductType, queryPartCodeByVin, getShelfQueryList, shelfOrderFlowCreate, findShelfUserParam } from '@/api/shelf'
 	import { scanVinLogCopy } from '@/api/car'
 	export default {
 		data() {
 			return {
 				showOther: false,
+				showPriceModal: false,
 				theme: '',
 				vinNumber: '',
 				leve2Data: [],  //  二级菜单数据
@@ -255,6 +254,10 @@
 				isIphoneXup: false,
 				saveLoading: false,
 				showPopup: false,
+				priceShowVal: null, // 是否可以查看所有价格
+				showCarPrice: false, // 显示车主价
+				showCostPrice: false, // 显示成本价
+				tempData: null // 临时数据
 			}
 		},
 		computed:{
@@ -286,9 +289,6 @@
 			storeApply(){
 				return this.$store.state.vuex_storeAuthInfo || null
 			},
-			showPrice(){
-				return this.$store.state.vuex_showPrice
-			},
 			isAdmin(){
 				return this.userInfo.superAdmin == 1
 			},
@@ -317,8 +317,35 @@
 		},
 		onShow() {
 			this.$store.state.vuex_shelfChoosePart = []
+			this.getShowPriceType()
 		},
 		methods: {
+			getShowPriceType(){
+				const storeShelf = this.$store.state.vuex_storeShelf
+				findShelfUserParam({shelfSn: storeShelf?storeShelf.shelfSn:''}).then(res => {
+					this.priceShowVal = res.data ? res.data.carOwnerPrice == '1' && res.data.purchasesPrice == '1' : false
+					// 选中了2中价格,则从列表显示价格中取值
+					if(this.priceShowVal){
+						// 进货价
+						this.showCostPrice = res.data.priceShowType == 'PURCHASES_PRICE'
+						// 车主价
+						this.showCarPrice = res.data.priceShowType == 'CAR_OWNER_PRICE'
+					}else{
+						// 进货价
+						this.showCostPrice = res.data ? res.data.purchasesPrice == '1' : false
+						// 车主价
+						this.showCarPrice = res.data ? res.data.carOwnerPrice == '1' : false
+					}
+				})
+			},
+			// 打开价格信息弹框
+			openPriceModal(row){
+				console.log(row)
+				if(this.priceShowVal){
+					this.tempData = row
+					this.showPriceModal = true
+				}
+			},
 			scanVinLogCopy(){
 				scanVinLogCopy({id:this.carInfo.id}).then(res => {
 					console.log(res)
@@ -684,6 +711,23 @@
 			margin-left: 10rpx;
 		}
 	}
+	.show-price-modal{
+		padding: 30px 20px;
+		>view{
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			> text{
+				&:last-child{
+					color: #999;
+					width: 70%;
+					display: block;
+				}
+			}
+			border-bottom: 1px solid #eee;
+			padding: 10px;
+		}
+	}
 	.cpb_middle{
 		flex-grow: 1;
 		padding-top: 10rpx;

+ 30 - 10
pagesA/queryByCode/confirmQh.vue

@@ -12,12 +12,11 @@
 		 		<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 flex justify_center">
-				<view class="pcode" v-if="showPrice[0]">
-					<view v-if="showPrice[1]=='PURCHASES_PRICE'">
-						价格:<text class="item-price" v-if="isAdmin || showPrice[2]">{{nowData.cost||0}}</text>
-					</view>
-					<view v-else>
-						价格:<text class="item-price">{{nowData.price||0}}</text>
+				<view class="pcode" v-if="showCarPrice||showCostPrice">
+					<view>
+						价格:
+						<text class="item-price" v-if="showCarPrice">{{nowData.price?'¥'+nowData.price:'暂无'}}</text>
+						<text class="item-price" v-if="showCostPrice">{{nowData.cost?'¥'+nowData.cost:'暂无'}}</text>
 					</view>
 				</view>
 				<view>
@@ -34,30 +33,51 @@
 </template>
 
 <script>
-	import { shelfOrderOnceCreate } from '@/api/shelf'
+	import { shelfOrderOnceCreate, findShelfUserParam  } from '@/api/shelf'
 	export default {
 		data() {
 			return {
 				 loading:false,
 				 nowData: null,
 				 qty: 1,
+				 shelfSn: null,
+				 priceShowVal: null, // 是否可以查看所有价格
+				 showCarPrice: false, // 显示车主价
+				 showCostPrice: false, // 显示成本价
 			}
 		},
 		onLoad(options) {
 			 this.nowData = this.$store.state.vuex_tempData
+			 this.shelfSn = this.$store.state.vuex_storeShelf.shelfSn
+			 // 价格显示权限
+			 this.getShowPriceType()
 		},
 		computed: {
 			userInfo(){
 				return this.$store.state.vuex_userInfo
 			},
-			showPrice(){
-				return this.$store.state.vuex_showPrice
-			},
 			isAdmin(){
 				return this.userInfo.superAdmin == 1
 			}
 		},
 		methods: {
+			getShowPriceType(){
+				findShelfUserParam({shelfSn: this.shelfSn}).then(res => {
+					this.priceShowVal = res.data ? res.data.carOwnerPrice == '1' && res.data.purchasesPrice == '1' : false
+					// 选中了2中价格,则从列表显示价格中取值
+					if(this.priceShowVal){
+						// 进货价
+						this.showCostPrice = res.data.priceShowType == 'PURCHASES_PRICE'
+						// 车主价
+						this.showCarPrice = res.data.priceShowType == 'CAR_OWNER_PRICE'
+					}else{
+						// 进货价
+						this.showCostPrice = res.data ? res.data.purchasesPrice == '1' : false
+						// 车主价
+						this.showCarPrice = res.data ? res.data.carOwnerPrice == '1' : false
+					}
+				})
+			},
 			onSubmit(){
 				const _this = this
 				uni.showModal({

+ 28 - 10
pagesA/queryByCode/queryByCode.vue

@@ -35,11 +35,9 @@
 									</view>
 								</view>
 								<view class="pname flex align_center justify_between">
-									<view class="pcode" v-if="showPrice[0]">
-										<view v-if="showPrice[1]=='PURCHASES_PRICE'">
-											<text class="item-price" v-if="isAdmin || showPrice[2]">价格:{{item.cost||0}}</text>
-										</view>
-										<text v-else class="item-price">价格:{{item.price||0}}</text>
+									<view class="pcode">
+										<text class="item-price" v-if="showCarPrice">价格:{{item.price?'¥'+item.price:'暂无'}}</text>
+										<text class="item-price" v-if="showCostPrice">价格:{{item.cost?'¥'+item.cost:'暂无'}}</text>
 									</view>
 									<view class="kc">库存:<text>{{item.currentInven}}</text>{{item.unit}}</view>
 								</view>
@@ -57,7 +55,7 @@
 </template>
 
 <script>
-	import { getShelfProductList } from '@/api/shelf'
+	import { getShelfProductList,findShelfUserParam } from '@/api/shelf'
 	export default {
 		data() {
 			return {
@@ -70,6 +68,9 @@
 				noDataText: '暂无产品',
 				status: 'nomore',
 				partList: [],
+				priceShowVal: null, // 是否可以查看所有价格
+				showCarPrice: false, // 显示车主价
+				showCostPrice: false, // 显示成本价
 			}
 		},
 		onLoad(opts) {
@@ -77,14 +78,13 @@
 			uni.$on("updateQueryByCodeList",()=>{
 				this.getpartList()
 			})
+			// 价格显示权限
+			this.getShowPriceType()
 		},
 		computed: {
 			userInfo(){
 				return this.$store.state.vuex_userInfo
 			},
-			showPrice(){
-				return this.$store.state.vuex_showPrice
-			},
 			isAdmin(){
 				return this.userInfo.superAdmin == 1
 			}
@@ -93,12 +93,30 @@
 			uni.$off("updateQueryByCodeList")
 		},
 		methods: {
+			getShowPriceType(){
+				findShelfUserParam({shelfSn: this.shelfSn}).then(res => {
+					this.priceShowVal = res.data ? res.data.carOwnerPrice == '1' && res.data.purchasesPrice == '1' : false
+					// 选中了2中价格,则从列表显示价格中取值
+					if(this.priceShowVal){
+						// 进货价
+						this.showCostPrice = res.data.priceShowType == 'PURCHASES_PRICE'
+						// 车主价
+						this.showCarPrice = res.data.priceShowType == 'CAR_OWNER_PRICE'
+					}else{
+						// 进货价
+						this.showCostPrice = res.data ? res.data.purchasesPrice == '1' : false
+						// 车主价
+						this.showCarPrice = res.data ? res.data.carOwnerPrice == '1' : false
+					}
+				})
+			},
 			//拿货
 			toEdit(item){
 				if(item.currentInven){
 					const params = {
 						shelfSn: this.shelfSn, 
-						billSource: 'product_code'
+						billSource: 'product_code',
+						showPrice: this.showCarPrice ? item.price : (this.showCostPrice?item.cost:'')
 					}
 					this.$store.state.vuex_tempData = Object.assign(params, item)
 					uni.navigateTo({

+ 1 - 0
store/index.js

@@ -62,6 +62,7 @@ const store = new Vuex.Store({
 		vuex_scanMaxNums: 10, // 最大扫描次数
 		vuex_storeAuthInfo: null ,// 门店认证状态信息
 		vuex_tempData: null, // 临时数据
+		vuex_configPrice: null, // 价格显示配置
 		vuex_tabBarList: [
 			{
 				"pagePath": "/pages/index/index",