Browse Source

价格设置

lilei 1 năm trước cách đây
mục cha
commit
772ceca209

+ 4 - 6
api/shelf.js

@@ -151,21 +151,19 @@ export const shelfProductSave = (params) => {
 // 获取价格显示
 export const getShelfPriceShow = (params) => {
   return axios.request({
-    url: `bizparam/getShelfPriceShow`,
-    data: params,
-    method: 'post'
+    url: `shelf/queryShelfPriceShowParam/${params.shelfSn}`,
+    method: 'get'
   })
 }
 // 更新价格显示
 export const updateShelfPriceShow = (params) => {
   return axios.request({
-    url: `bizparam/updateShelfPriceShow`,
-    data: params,
+    url: `shelf/updateShelfPriceShowParam/${params.shelfSn}`,
+    data: params.paramValue,
     method: 'post'
   })
 }
 
-
 // 货架订单-分页列表
 export const orderBillQueryPage = (params) => {
   const url = `orderBill/queryPage/${params.pageNo}/${params.pageSize}`

+ 43 - 4
pages/approveStore/authPass.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="apply-wrap flex flex_column">
 		<view class="login-form">
-			<u-form :model="form" label-width="180rpx" :error-type="['toast']" ref="uForm">
+			<u-form :model="form" label-width="200rpx" :error-type="['toast']" ref="uForm">
 				<u-form-item label="门头照片" required prop="storeImage">
 					<u-upload 
 					@on-success="uploadStorePhoto" 
@@ -52,6 +52,12 @@
 				<u-form-item label="授信金额" v-if="form.settleType == 'CREDIT'" required prop="creditLimit">
 					<u-input :clearable="false" type="digit" :min="100" :maxlength="8" @blur="numberToFixed('creditLimit',2,999999)" v-model.trim="form.creditLimit" placeholder="请输入大于100的数字,最多两位小数"/>
 				</u-form-item>
+				<u-form-item label="价格权限设置" >
+					<u-checkbox-group @change="priceSetChange">
+						<u-checkbox v-for="item in showPrice" :key="item.paramCode" v-model="item.checked"
+							:name="item.paramCode">{{item.text}}</u-checkbox>
+					</u-checkbox-group>
+				</u-form-item>
 			</u-form>
 		</view>
 		<view class="form-btn-con flex justify_center">
@@ -119,12 +125,24 @@
 				storePhotoList: [],
 				yyzzPhotoList: [],
 				settleStyleModal: false,
-				settleStyleList: []
+				settleStyleList: [],
+				showPrice: []
 			}
 		},
 		// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
 		onReady() {
 			this.$refs.uForm.setRules(this.rules);
+			this.showPrice = [{
+								paramCode: 'shelf_price_show',
+								paramValue: 0,
+								text: '车主价',
+								checked: false
+							},{
+								paramCode: 'shelf_cost_show',
+								paramValue: 0,
+								text: '结算价',
+								checked: false
+							}]
 		},
 		onLoad(options) {
 			const _this = this
@@ -240,8 +258,29 @@
 				xprhStoreApplyAudit(obj).then(res => {
 					console.log(res)
 					if(res.status == 200){
-						 uni.navigateBack()
-						 uni.$emit("updateAuthState")
+						 savePriceSet(res.data)
+					}else{
+						uni.showToast({icon: 'none',title: res.message})
+						this.loading = false
+					}
+				})
+			},
+			// 选择价格显示
+			priceSetChange(e) {
+				this.showPrice.map(item => {
+					item.paramValue = e.includes(item.paramCode) ? 1 : 0
+				})
+			},
+			// 价格显示保存
+			savePriceSet(data) {
+				// 更新价格显示
+				updateShelfPriceShow({
+					shelfSn: data.shelfSn,
+					paramValue: this.showPrice
+				}).then(res => {
+					if (res.status == 200) {
+						uni.navigateBack()
+						uni.$emit("updateAuthState")
 					}
 					uni.showToast({icon: 'none',title: res.message})
 					this.loading = false

+ 3 - 0
pages/approveStore/detail.vue

@@ -46,6 +46,9 @@
 				<u-form-item label="授信金额" v-if="form.auditStatus == 'PASS'&&form.settleType == 'CREDIT'">
 					{{form.creditLimit||'--'}}
 				</u-form-item>
+				<u-form-item label="价格权限设置" >
+					{{form.priceStr||'--'}}
+				</u-form-item>
 			</u-form>
 		</view>
 	</view>

+ 1 - 1
pages/shelfSetting/addShelfHw.vue

@@ -29,7 +29,7 @@
 						</view>
 					</view>
 				</u-form-item>
-				<u-form-item label="销售价(元)" v-if="productEntity" required prop="price">
+				<u-form-item label="车主价(元)" v-if="productEntity" required prop="price">
 					<u-input clearable type="number" :min="0" @input="numberToFixed('price',2,999999)" v-model="form.price" placeholder="请输入销售价,最多两位小数"/>
 				</u-form-item>
 				<u-form-item label="结算价(元)" v-if="productEntity" required prop="cost">

+ 1 - 1
pages/shelfSetting/editShelfHw.vue

@@ -42,7 +42,7 @@
 							</view>
 						</view>
 					</u-form-item>
-					<u-form-item label="销售价(元)" required prop="price">
+					<u-form-item label="车主价(元)" required prop="price">
 						<u-input clearable type="number" :min="0" @input="numberToFixed('price',2,999999)" v-model="form.price" placeholder="请输入销售价,最多两位小数"/>
 					</u-form-item>
 					<u-form-item label="结算价(元)" required prop="cost">

+ 420 - 321
pages/shelfSetting/shelfSet.vue

@@ -1,134 +1,160 @@
 <template>
 	<view class="content">
-		<u-navbar back-text="货架设置" :border-bottom="false" :background="{backgroundColor: $config('primaryColor')}" back-icon-color="#fff" :back-text-style="{ color: '#fff' }">
+		<u-navbar back-text="货架设置" :border-bottom="false" :background="{backgroundColor: $config('primaryColor')}"
+			back-icon-color="#fff" :back-text-style="{ color: '#fff' }">
 			<view slot='right' style="padding: 0 30upx;color: #ffffff;" @click="toPlRacking" v-if="shelfPlaceList">
 				<u-icon name="piliangshangjia" custom-prefix="iscm-icon"></u-icon>
 				<text style="margin-left: 6rpx;">批量上架</text>
 				<u-badge v-if="showDot" :is-dot="true" size="mini" type="error"></u-badge>
 			</view>
 		</u-navbar>
-	<view class="body-content flex flex_column">
-		<view class="card-box" v-if="detailData">
-			<view class="card-row flex align_center justify_between">
-				<view class="label">货架名称</view>
-				<view class="text flex align_center" @click="editShelf">
-					<text style="width: 80%;flex: 1;">{{detailData.shelfName}}</text>
-					<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
+		<view class="body-content flex flex_column">
+			<view class="card-box" v-if="detailData">
+				<view class="card-row flex align_center justify_between">
+					<view class="label">货架名称</view>
+					<view class="text flex align_center" @click="editShelf">
+						<text style="width: 80%;flex: 1;">{{detailData.shelfName}}</text>
+						<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
+					</view>
 				</view>
-			</view>
-			<view class="card-row flex align_center justify_between">
-				<view class="label">关联客户</view>
-				<view class="text flex align_center" @click="customeSet">
-					<text style="width: 80%;flex: 1;">{{ (detailData&&detailData.customerEntity&&detailData.customerEntity.customerName) || '--' }}</text>
-					<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
+				<view class="card-row flex align_center justify_between">
+					<view class="label">关联客户</view>
+					<view class="text flex align_center" @click="customeSet">
+						<text
+							style="width: 80%;flex: 1;">{{ (detailData&&detailData.customerEntity&&detailData.customerEntity.customerName) || '--' }}</text>
+						<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
+					</view>
 				</view>
-			</view>
-			<view class="card-row align_center flex justify_between" v-if="showMore">
-				<view class="label" style="width: 50%;" @click="showTip(1)">是否设置完成 <u-icon color="#ffaa00" name="question-circle"></u-icon></view>
-				<view class="text" style="width: 50%;text-align: right;"><u-switch v-model="switchVal" @change="switchChange"></u-switch></view>
-			</view>
-			<!-- <view class="card-row align_center flex justify_between" v-if="showMore">
-				<view class="label" style="width: 40%;" @click="showTip(0)">价格显示 <u-icon color="#ffaa00" name="question-circle"></u-icon></view>
-				<view class="text flex align_center" style="width: 60%;text-align: right;" @click="updateShowPrice = true">
-					<text style="width: 80%;flex: 1;">非铺货产品——{{ showPrice == '1' ? '显示': '不显示' }}价格</text>
-					<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
+				<view class="card-row align_center flex justify_between">
+					<view class="label" style="width: 40%;" @click="showTip(0)">价格权限设置 <u-icon color="#ffaa00"
+							name="question-circle"></u-icon></view>
+					<view class="text flex align_center" style="width: 60%;text-align: right;"
+						@click="updateShowPrice = true">
+						<text style="width: 80%;flex: 1;">{{showPriceStr.length ? showPriceStr.join("/") : '--'}}</text>
+						<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
+					</view>
 				</view>
-			</view> -->
-			<view class="moreSeting" @click="showMore=!showMore">
-				<text>{{!showMore?'更多设置':'收起'}}</text> <u-icon :name="showMore?'arrow-up':'arrow-down'"></u-icon>
-			</view>
-			<u-action-sheet :list="actionList" @click="clickAction" v-model="updateShowPrice"></u-action-sheet>
-		</view>
-		<!-- 货位信息 -->
-		<view class="shelfPlace" :style="{height: scrollH+'px'}" v-if="shelfPlaceList">
-			<view class="flex align_center shelfPlaceHead">
-				<view class="lt"><text>□</text>表示没有绑定产品</view>
-				<view class="search-btn flex align_center" @click="toSearchHw">
-					<view><u-icon name="search"></u-icon><text>按产品搜索</text></view>
-					<u-icon name="scan"></u-icon>
+				<view class="card-row align_center flex justify_between" v-if="showMore">
+					<view class="label" style="width: 50%;" @click="showTip(1)">是否设置完成 <u-icon color="#ffaa00"
+							name="question-circle"></u-icon></view>
+					<view class="text" style="width: 50%;text-align: right;"><u-switch v-model="switchVal"
+							@change="switchChange"></u-switch></view>
+				</view>
+				<view class="moreSeting" @click="showMore=!showMore">
+					<text>{{!showMore?'更多设置':'收起'}}</text> <u-icon :name="showMore?'arrow-up':'arrow-down'"></u-icon>
 				</view>
 			</view>
-			<view class="flex shelfTabs">
-				<view class="leftTabs">
-					<view v-for="item in placeTab" :key="item" :class="curTab==item?'active':''" @click="tabChange(item)">{{item}}层</view>
+			<!-- 货位信息 -->
+			<view class="shelfPlace" :style="{height: scrollH+'px'}" v-if="shelfPlaceList">
+				<view class="flex align_center shelfPlaceHead">
+					<view class="lt"><text>□</text>表示没有绑定产品</view>
+					<view class="search-btn flex align_center" @click="toSearchHw">
+						<view><u-icon name="search"></u-icon><text>按产品搜索</text></view>
+						<u-icon name="scan"></u-icon>
+					</view>
 				</view>
-				<view class="rightCons flex flex_column">
-					<view class="hwList flex_1">
-						<text @click="editHw(item)" v-for="item in shelfPlaceList[curTab]" :key="item.shelfPlaceCode" :class="item.shelfProductApiEntity && item.shelfProductApiEntity.productSn?'':'red'">
-							{{item.shelfPlaceCode}}
-						</text>
-						<text class="add" @click="addHw('add',1)"><u-icon name="plus"></u-icon></text>
+				<view class="flex shelfTabs">
+					<view class="leftTabs">
+						<view v-for="item in placeTab" :key="item" :class="curTab==item?'active':''"
+							@click="tabChange(item)">{{item}}层</view>
 					</view>
-					<view class="hwAction flex justify_between">
-						<u-button shape="circle" @click="tapPopup(1)" size="medium">打印贴签</u-button>
-						<u-button class="newbtn" @click="tapPopup(2)" type='primary' shape="circle" size="medium">快速补货</u-button>
+					<view class="rightCons flex flex_column">
+						<view class="hwList flex_1">
+							<text @click="editHw(item)" v-for="item in shelfPlaceList[curTab]"
+								:key="item.shelfPlaceCode"
+								:class="item.shelfProductApiEntity && item.shelfProductApiEntity.productSn?'':'red'">
+								{{item.shelfPlaceCode}}
+							</text>
+							<text class="add" @click="addHw('add',1)"><u-icon name="plus"></u-icon></text>
+						</view>
+						<view class="hwAction flex justify_between">
+							<u-button shape="circle" @click="tapPopup(1)" size="medium">打印贴签</u-button>
+							<u-button class="newbtn" @click="tapPopup(2)" type='primary' shape="circle"
+								size="medium">快速补货</u-button>
+						</view>
 					</view>
 				</view>
 			</view>
-		</view>
-		<view style="width: 100%;" v-else>
-			<view class="nodata" v-if="!loading">
-				<view>
-					<u-image :src="`../../static/${$config('themePath')}/def_no_data@3x.png`" width="180" height="180" border-radius="10"></u-image>
-				</view>
-				<view class="flex">
-					暂无货位信息,请点击
+			<view style="width: 100%;" v-else>
+				<view class="nodata" v-if="!loading">
 					<view>
-						<text @click="toPlRacking">批量上架</text>
-						<u-badge :offset="[-6,-10]" v-if="showDot" :is-dot="true" size="mini" type="error"></u-badge>
+						<u-image :src="`../../static/${$config('themePath')}/def_no_data@3x.png`" width="180"
+							height="180" border-radius="10"></u-image>
+					</view>
+					<view class="flex">
+						暂无货位信息,请点击
+						<view>
+							<text @click="toPlRacking">批量上架</text>
+							<u-badge :offset="[-6,-10]" v-if="showDot" :is-dot="true" size="mini"
+								type="error"></u-badge>
+						</view>
 					</view>
 				</view>
-			</view>
-			<view class="nodata" v-else>
-				<u-loadmore :load-text="$config('loadText')" status="loading" />
+				<view class="nodata" v-else>
+					<u-loadmore :load-text="$config('loadText')" status="loading" />
+				</view>
 			</view>
 		</view>
-	</view>
-		
+		<!-- 设置价格显示弹框 -->
+		<u-modal v-model="updateShowPrice" title="价格权限设置" @confirm="savePriceSet">
+			<view class="slot-content" style="padding: 1.5rem 1rem;text-align: center;">
+				<u-checkbox-group @change="priceSetChange">
+					<u-checkbox v-for="item in showPrice" :key="item.paramCode" v-model="item.checked"
+						:name="item.paramCode">{{item.text}}</u-checkbox>
+				</u-checkbox-group>
+			</view>
+		</u-modal>
 	</view>
 </template>
 
 <script>
-    import { shelfDetail, shelfSave, modifFinishFlag, getProductPlace, getShelfPriceShow, updateShelfPriceShow } from '@/api/shelf'
-	import { shelfCartNotEmpty } from '@/api/shelfCart'
-	import { createShelfReplenishBill } from '@/api/shelfReplenish'
+	import {
+		shelfDetail,
+		shelfSave,
+		modifFinishFlag,
+		getProductPlace,
+		getShelfPriceShow,
+		updateShelfPriceShow
+	} from '@/api/shelf'
+	import {
+		shelfCartNotEmpty
+	} from '@/api/shelfCart'
+	import {
+		createShelfReplenishBill
+	} from '@/api/shelfReplenish'
 	export default {
-		components:{
-		},
+		components: {},
 		data() {
 			return {
 				loading: false,
 				shelfSn: null,
 				detailData: null,
 				switchVal: false,
-				showMenus:false,
+				showMenus: false,
 				scrollH: 400,
-				popData:[{title:'快速补货',val:'0'},{title:'打印贴签',val:'1'}],
-				pleft:0,
-				ptop:0,
+				popData: [{
+					title: '快速补货',
+					val: '0'
+				}, {
+					title: '打印贴签',
+					val: '1'
+				}],
+				pleft: 0,
+				ptop: 0,
 				shelfPlaceList: null,
 				placeTab: [],
 				curTab: '',
 				isLoad: false,
 				webView: null,
 				showDot: false,
-				showPrice: '',
+				showPrice: [],
+				showPriceStr: [],
 				updateShowPrice: false,
-				showMore: false,
-				actionList:[
-					{
-						text: '非铺货产品——显示价格',
-						fontSize: 32
-					},
-					{
-						text: '非铺货产品——不显示价格',
-						fontSize: 32
-					}
-				]
+				showMore: false
 			}
 		},
-		watch:{
-			showMore(a,b){
+		watch: {
+			showMore(a, b) {
 				this.getScrollHeight(a)
 			},
 		},
@@ -136,20 +162,19 @@
 			this.shelfSn = option.shelfSn
 			// 获取货架详情
 			this.getShelfDetal()
-			// this.getShelfPriceShow()
 			// 获取货物
 			this.getShelfPlace()
 			this.isLoad = true
 			// this.webView = this.$mp.page.$getAppWebview(); 
-			uni.$on("editCustome",(data)=>{
+			uni.$on("editCustome", (data) => {
 				this.isLoad = true
-				this.saveShelf(data,0)
+				this.saveShelf(data, 0)
 			})
-			uni.$on("editShelfName",(data)=>{
+			uni.$on("editShelfName", (data) => {
 				this.isLoad = true
-				this.saveShelf(data,1)
+				this.saveShelf(data, 1)
 			})
-			
+
 			// const win = uni.getWindowInfo()
 			// this.pleft = Math.floor(win.windowWidth * 0.3)
 			// this.ptop = Math.floor(win.windowHeight - 70)
@@ -161,68 +186,75 @@
 			uni.$off("editShelfName")
 		},
 		onShow() {
-			if(!this.isLoad){
+			if (!this.isLoad) {
 				this.updateHw()
 			}
 		},
 		methods: {
-			getScrollHeight(a){
+			getScrollHeight(a) {
 				const sys = uni.getSystemInfoSync()
-				const h = a? 290 : 250
-				if(sys.platform == 'android'){
+				const h = a ? 290 : 250
+				if (sys.platform == 'android') {
 					this.scrollH = sys.windowHeight - h
-				}else{
-					if(sys.safeArea.top){
+				} else {
+					if (sys.safeArea.top) {
 						this.scrollH = sys.windowHeight - h + sys.statusBarHeight - 34
-					}else{
+					} else {
 						this.scrollH = sys.windowHeight - h - 14
 					}
 				}
 			},
 			// 刷新货位
-			updateHw(){
+			updateHw() {
 				this.placeTab = []
 				this.shelfPlaceList = null
 				this.getShelfPlace(true)
 			},
 			// 批量上架
-			toPlRacking(){
+			toPlRacking() {
 				const url = this.showDot ? '/pages/batchShelves/cartList' : '/pages/batchShelves/index'
 				uni.navigateTo({
-					url: url+"?shelfSn="+this.shelfSn+'&shelfName='+this.detailData.shelfName+'&customerSn='+this.detailData.customerSn
+					url: url + "?shelfSn=" + this.shelfSn + '&shelfName=' + this.detailData.shelfName +
+						'&customerSn=' + this.detailData.customerSn
 				})
 			},
 			// 更多操作
-			tapPopup(e){
+			tapPopup(e) {
 				// 打印贴签
-				if(e == 1){
-					if(this.hasNoBindPro()){
+				if (e == 1) {
+					if (this.hasNoBindPro()) {
 						uni.navigateTo({
-							url: "/pages/latePlay/chooseProduct?shelfSn="+this.shelfSn+'&shelfName='+this.detailData.shelfName
+							url: "/pages/latePlay/chooseProduct?shelfSn=" + this.shelfSn + '&shelfName=' + this
+								.detailData.shelfName
 						})
-					}else{
+					} else {
 						uni.showModal({
-							showCancel:false,
-							confirmText:"好的",
+							showCancel: false,
+							confirmText: "好的",
 							title: "提示",
 							content: "所有货位都没有绑定产品,无法打印贴签!"
 						})
 					}
 				}
 				// 快速补货
-				if(e == 2){
-					createShelfReplenishBill({shelfSn: this.shelfSn, enableFlag: 1}).then(res => {
+				if (e == 2) {
+					createShelfReplenishBill({
+						shelfSn: this.shelfSn,
+						enableFlag: 1
+					}).then(res => {
 						console.log(res.data)
-						if(res.data&&res.data.length){
-							const params = Object.assign(this.detailData,{list:res.data})
+						if (res.data && res.data.length) {
+							const params = Object.assign(this.detailData, {
+								list: res.data
+							})
 							this.$store.state.vuex_tempData = params
 							uni.navigateTo({
 								url: "/pages/shelfSetting/quickReplenish"
 							})
-						}else{
+						} else {
 							uni.showModal({
-								showCancel:false,
-								confirmText:"好的",
+								showCancel: false,
+								confirmText: "好的",
 								title: "提示",
 								content: "没有需要补货的产品"
 							})
@@ -230,183 +262,224 @@
 					})
 				}
 			},
-			showTip(type){
+			showTip(type) {
 				uni.showModal({
-					showCancel:false,
-					confirmText:"好的",
+					showCancel: false,
+					confirmText: "好的",
 					title: "提示",
-					content: type ? "只有当数字货架的“是否设置完成”为“是”,系统才会自动对该货架生成补货单,修理厂才能正常下单。":"1、非铺货产品,是指不是货架上的产品\n2、终端会员价,对于汽修厂来说,即进货价\n3、如果该产品在销售单里有销售记录,则使用最近一次销售价,如果没有销售记录,则使用箭冠总公司的终端会员价"
+					content: type ? "只有当数字货架的“是否设置完成”为“是”,系统才会自动对该货架生成补货单,修理厂才能正常下单。" :
+						"1、不勾选则不显示价格,非货架产品只显示车主价,不选择车主价时,非货架产品不显示价格\n2、结算价:既易码通进货价"
 				})
 			},
 			// 设置完成是否
-			switchChange(v){
+			switchChange(v) {
 				const params = {
-				  shelfSn: this.shelfSn,
-				  finishFlag: v ? '1' : '0'
+					shelfSn: this.shelfSn,
+					finishFlag: v ? '1' : '0'
 				}
 				modifFinishFlag(params).then(res => {
-				  if (res.status == 200) {
-					  uni.showToast({
-					  	icon: 'none',
-					  	title: res.message
-					  })
-				  }
+					if (res.status == 200) {
+						uni.showToast({
+							icon: 'none',
+							title: res.message
+						})
+					}
 				})
 			},
 			// 关联客户
-			customeSet(){
+			customeSet() {
 				uni.navigateTo({
-					url: "/pages/sales/chooseCustomer?backPage=shelfEdit&shelfName="+this.detailData.shelfName
+					url: "/pages/sales/chooseCustomer?backPage=shelfEdit&shelfName=" + this.detailData.shelfName
 				})
 			},
 			// 修改货架名称
-			editShelf(){
+			editShelf() {
 				uni.navigateTo({
-					url: "/pages/shelfSetting/editShelf?shelfName="+this.detailData.shelfName
+					url: "/pages/shelfSetting/editShelf?shelfName=" + this.detailData.shelfName
 				})
 			},
 			// 是否没有绑定任何产品
-			hasNoBindPro(){
+			hasNoBindPro() {
 				let noBindPro = null;
-				for(let i=0;i<this.placeTab.length;i++){
-					noBindPro = this.shelfPlaceList[this.placeTab[i]].find(item => item.shelfProductApiEntity && item.shelfProductApiEntity.productSn);
-					if(!!noBindPro){
+				for (let i = 0; i < this.placeTab.length; i++) {
+					noBindPro = this.shelfPlaceList[this.placeTab[i]].find(item => item.shelfProductApiEntity && item
+						.shelfProductApiEntity.productSn);
+					if (!!noBindPro) {
 						break
 					}
 				}
 				return !!noBindPro
 			},
 			// 按照产品搜索货位
-			toSearchHw(){
-				if(this.hasNoBindPro()){
+			toSearchHw() {
+				if (this.hasNoBindPro()) {
 					uni.navigateTo({
-						url: "/pages/shelfSetting/searchShelfHw?shelfName="+this.detailData.shelfName+"&shelfSn="+this.shelfSn
+						url: "/pages/shelfSetting/searchShelfHw?shelfName=" + this.detailData.shelfName +
+							"&shelfSn=" + this.shelfSn
 					})
-				}else{
+				} else {
 					uni.showModal({
-						showCancel:false,
-						confirmText:"好的",
+						showCancel: false,
+						confirmText: "好的",
 						title: "提示",
 						content: "所有货位都没有绑定产品,无法搜索!"
 					})
 				}
 			},
 			// 编辑货位
-			editHw(item){
+			editHw(item) {
 				const hasProduct = item.shelfProductApiEntity && item.shelfProductApiEntity.productSn
-				const type = hasProduct ? 'edit':'bind'
-				const params = Object.assign(this.detailData,item)
+				const type = hasProduct ? 'edit' : 'bind'
+				const params = Object.assign(this.detailData, item)
 				this.$store.state.vuex_tempData = params
 				uni.navigateTo({
 					url: "/pages/shelfSetting/editShelfHw?type=" + type
 				})
 			},
 			// 新增货位
-			addHw(type,flag){
+			addHw(type, flag) {
 				let shelfPlaceCode = ''
-				if(type=='edit'){
+				if (type == 'edit') {
 					shelfPlaceCode = flag
 				}
-				if(type=='add'&&flag==1){
+				if (type == 'add' && flag == 1) {
 					const row = this.shelfPlaceList[this.curTab]
-					const num = row[row.length-1].shelfPlaceCode.replace(this.curTab,'')
+					const num = row[row.length - 1].shelfPlaceCode.replace(this.curTab, '')
 					const nextNum = Number(num) + 1
-					shelfPlaceCode = this.curTab + (nextNum<10?'0':'') + nextNum
+					shelfPlaceCode = this.curTab + (nextNum < 10 ? '0' : '') + nextNum
 				}
-				const params={
+				const params = {
 					customerSn: this.detailData.customerSn,
 					shelfSn: this.detailData.shelfSn,
 					id: this.detailData.id
 				}
 				uni.navigateTo({
-					url: "/pages/shelfSetting/addShelfHw?detailData="+encodeURIComponent(JSON.stringify(params))+"&type="+type+"&shelfPlaceCode="+shelfPlaceCode
+					url: "/pages/shelfSetting/addShelfHw?detailData=" + encodeURIComponent(JSON.stringify(
+						params)) + "&type=" + type + "&shelfPlaceCode=" + shelfPlaceCode
 				})
 			},
 			// 保存数字货架基本信息
-			saveShelf(data,type){
+			saveShelf(data, type) {
 				const params = {
 					shelfSn: this.shelfSn
 				}
-				if(type == 1){
+				if (type == 1) {
 					params.customerSn = this.detailData.customerSn
 					params.shelfName = data.shelfName
-				}else{
+				} else {
 					params.customerSn = data.customerSn
 				}
 				shelfSave(params).then(res => {
-					 if (res.status == 200) {
-					  this.toashMsg(res.message)
-					  this.getShelfDetal()
-					 }
+					if (res.status == 200) {
+						this.toashMsg(res.message)
+						this.getShelfDetal()
+					}
 				})
 			},
 			// 获取价格显示设置
-			getShelfPriceShow () {
-			  getShelfPriceShow({ shelfSn: this.shelfSn }).then(res => {
-			    if (res.status == 200) {
-			      this.showPrice = res.data.paramValue
-			    }
-			  })
+			getShelfPriceShow() {
+				this.showPrice = []
+				this.showPriceStr = []
+				getShelfPriceShow({
+					shelfSn: this.shelfSn
+				}).then(res => {
+					if (res.status == 200) {
+						const ret = res.data && res.data
+						ret.map(item => {
+							if (item.paramCode == 'shelf_price_show' && item.paramValue == 1) {
+								this.showPriceStr.push("车主价")
+							}
+							if (item.paramCode == 'shelf_cost_show' && item.paramValue == 1) {
+								this.showPriceStr.push("结算价")
+							}
+							this.showPrice.push({
+								paramCode: item.paramCode,
+								paramValue: item.paramValue,
+								text: item.paramCode == 'shelf_price_show' ? '车主价' : '结算价',
+								checked: item.paramValue == 1
+							})
+						})
+					}
+				})
 			},
-			clickAction(index){
+			// 选择价格显示
+			priceSetChange(e) {
+				console.log(e)
+				this.showPrice.map(item => {
+					item.paramValue = e.includes(item.paramCode) ? 1 : 0
+				})
+			},
+			// 价格显示保存
+			savePriceSet() {
 				uni.showLoading({
 					mask: true,
-					title: '正在保存价格显示...'
+					title: '正在保存价格设置...'
 				})
+				// 更新价格显示
 				updateShelfPriceShow({
 					shelfSn: this.shelfSn,
-					paramValue: index == 0 ? 1 : 0
+					paramValue: this.showPrice
 				}).then(res => {
-					if(res.status == 200){
+					if (res.status == 200) {
 						this.getShelfPriceShow()
 						this.toashMsg(res.message)
 					}
 					uni.hideLoading()
 				})
 			},
-			getShelfDetal(){
-				shelfDetail({ sn: this.shelfSn }).then(res => {
-				  if (res.status == 200) {
-				    this.detailData = res.data
-					this.switchVal = res.data.finishFlag == 1
-				  } else {
-				    this.detailData = null
-				  }
+			getShelfDetal() {
+				shelfDetail({
+					sn: this.shelfSn
+				}).then(res => {
+					if (res.status == 200) {
+						this.detailData = res.data
+						this.switchVal = res.data.finishFlag == 1
+						// 价格设置
+						this.getShelfPriceShow()
+					} else {
+						this.detailData = null
+					}
 				})
 			},
-			getShelfPlace(flag){
+			getShelfPlace(flag) {
 				this.loading = true
-				getProductPlace({ shelfSn: this.shelfSn }).then(res => {
-				  if (res.status == 200 && res.data) {
-				    this.shelfPlaceList = res.data
-					// 获取层
-					for(let a in res.data){
-						this.placeTab.push(a)
-					}
-					// 排序
-					this.placeTab.sort(function(a,b){ return (a+'').localeCompare(b+'');});
-					console.log(this.placeTab)
-					if(!flag || !this.curTab){
-						this.curTab = this.placeTab[0]
-					}
-					if(this.placeTab.length == 0){
+				getProductPlace({
+					shelfSn: this.shelfSn
+				}).then(res => {
+					if (res.status == 200 && res.data) {
+						this.shelfPlaceList = res.data
+						// 获取层
+						for (let a in res.data) {
+							this.placeTab.push(a)
+						}
+						// 排序
+						this.placeTab.sort(function(a, b) {
+							return (a + '').localeCompare(b + '');
+						});
+						console.log(this.placeTab)
+						if (!flag || !this.curTab) {
+							this.curTab = this.placeTab[0]
+						}
+						if (this.placeTab.length == 0) {
+							this.shelfPlaceList = null
+						}
+					} else {
 						this.shelfPlaceList = null
+						this.placeTab = []
 					}
-				  } else {
-				    this.shelfPlaceList = null
-					this.placeTab = []
-				  }
-				  // 是否有已录入的产品
-				  this.getHasCartNotEmpty()
-				  this.isLoad = false
-				  this.loading = false
+					// 是否有已录入的产品
+					this.getHasCartNotEmpty()
+					this.isLoad = false
+					this.loading = false
 				})
 			},
-			tabChange(item){
+			tabChange(item) {
 				this.curTab = item
 			},
-			getHasCartNotEmpty(){
-				shelfCartNotEmpty({ shelfSn: this.shelfSn }).then(res => {
+			getHasCartNotEmpty() {
+				shelfCartNotEmpty({
+					shelfSn: this.shelfSn
+				}).then(res => {
 					this.showDot = res.data == 1
 				})
 			}
@@ -415,146 +488,172 @@
 </script>
 
 <style lang="less">
-.content{
-	width:100%;
-	.nodata{
-		padding: 100rpx 50rpx;
-		text-align: center;
-		display: flex;
-		flex-direction: column;
-		justify-content: center;
-		align-items: center;
-		> view{
-			position: relative;
-			padding: 10upx 0;
-			text{
-				color: #00aaff;
-				margin-left: 10rpx;
-			}
-		}
-	}
-	.body-content{
+	.content {
 		width: 100%;
-     }
-	.card-box{
-		background-color: #fff;
-		border-radius: 0.5rem;
-		box-shadow: 0.1rem 0.2rem 0.3rem #eee;
-		padding: 0 1rem;
-		margin: 0.5rem;
-		.card-row{
-			border-bottom: 1rpx solid #eee;
-			padding: 20rpx 0;
-			min-height: 90rpx;
-			&:last-child{
-				border-bottom: 0;
-			}
-			.label{
-				flex: 1;
-				width: 20%;
-			}
-			.text{
-				width: 80%;
-				color: #666;
-			}
-		}
-		.moreSeting{
+
+		.nodata {
+			padding: 100rpx 50rpx;
 			text-align: center;
-			color: #999;
-			padding: 20upx;
-			> text{
-				margin-right: 10rpx;
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			align-items: center;
+
+			>view {
+				position: relative;
+				padding: 10upx 0;
+
+				text {
+					color: #00aaff;
+					margin-left: 10rpx;
+				}
 			}
 		}
-	}
-	
-	.shelfPlace{
-		height: calc(100% - 300rpx);
-		.shelfPlaceHead{
-			padding: 0.2rem 0.5rem 0.5rem;
-			justify-content: space-between;
-			.lt{
-				font-size: 0.9rem;
-				color: #999;
-				text{
-					color: #ff5500;
-					font-size: 1rem;
+
+		.body-content {
+			width: 100%;
+		}
+
+		.card-box {
+			background-color: #fff;
+			border-radius: 0.5rem;
+			box-shadow: 0.1rem 0.2rem 0.3rem #eee;
+			padding: 0 1rem;
+			margin: 0.5rem;
+
+			.card-row {
+				border-bottom: 1rpx solid #eee;
+				padding: 20rpx 0;
+				min-height: 90rpx;
+
+				&:last-child {
+					border-bottom: 0;
+				}
+
+				.label {
+					flex: 1;
+					width: 20%;
+				}
+
+				.text {
+					width: 80%;
+					color: #666;
 				}
 			}
-			.search-btn{
-				border:1rpx solid #eee;
-				border-radius: 50rpx;
-				width: 50%;
-				justify-content: space-between;
-				padding:0.3rem 0.5rem;
+
+			.moreSeting {
+				text-align: center;
 				color: #999;
-				background-color: #fff;
-				font-size: 0.9rem;
-				&:active{
-					opacity: 0.6;
+				padding: 20upx;
+
+				>text {
+					margin-right: 10rpx;
 				}
 			}
 		}
-		.shelfTabs{
-			height: calc(100% - 85rpx);
-			.leftTabs{
-				width: 20%;
-				overflow: auto;
-				> view{
-					padding: 0.8rem 0.5rem;
-					border-left: 0.2rem solid #f8f8f8;
-					text-align: center;
+
+		.shelfPlace {
+			height: calc(100% - 300rpx);
+
+			.shelfPlaceHead {
+				padding: 0.2rem 0.5rem 0.5rem;
+				justify-content: space-between;
+
+				.lt {
+					font-size: 0.9rem;
+					color: #999;
+
+					text {
+						color: #ff5500;
+						font-size: 1rem;
+					}
 				}
-				.active{
-					border-color: rgb(47, 126, 209);
+
+				.search-btn {
+					border: 1rpx solid #eee;
+					border-radius: 50rpx;
+					width: 50%;
+					justify-content: space-between;
+					padding: 0.3rem 0.5rem;
+					color: #999;
 					background-color: #fff;
+					font-size: 0.9rem;
+
+					&:active {
+						opacity: 0.6;
+					}
 				}
 			}
-			.rightCons{
-				width: 80%;
-				background-color: #fff;
-				position: relative;
-				.hwList{
+
+			.shelfTabs {
+				height: calc(100% - 85rpx);
+
+				.leftTabs {
+					width: 20%;
 					overflow: auto;
-					padding: 0.5rem;
-					padding-bottom: 105rpx;
-					> text{
-						border: 1rpx solid #eee;
-						padding: 0.2rem 0.8rem;
-						border-radius: 0.3rem;
-						margin: 0.5rem 2%;
-						float: left;
-						width: 20%;
+
+					>view {
+						padding: 0.8rem 0.5rem;
+						border-left: 0.2rem solid #f8f8f8;
 						text-align: center;
 					}
-					.red{
-						border-color: #ff5500;
-					}
-					.add{
-						border-style: dashed;
-						border-color: #999;
-						color: #999;
+
+					.active {
+						border-color: rgb(47, 126, 209);
+						background-color: #fff;
 					}
 				}
-				.hwAction{
-					padding: 0.5rem;
-					position: fixed;
-					bottom: 0;
-					right: 0;
+
+				.rightCons {
 					width: 80%;
 					background-color: #fff;
-					button{
-						width: 240rpx;
+					position: relative;
+
+					.hwList {
+						overflow: auto;
+						padding: 0.5rem;
+						padding-bottom: 105rpx;
+
+						>text {
+							border: 1rpx solid #eee;
+							padding: 0.2rem 0.8rem;
+							border-radius: 0.3rem;
+							margin: 0.5rem 2%;
+							float: left;
+							width: 20%;
+							text-align: center;
+						}
+
+						.red {
+							border-color: #ff5500;
+						}
+
+						.add {
+							border-style: dashed;
+							border-color: #999;
+							color: #999;
+						}
 					}
-					.newbtn{
-						background-color: rgb(51, 95, 182);
-						color: #fff;
+
+					.hwAction {
+						padding: 0.5rem;
+						position: fixed;
+						bottom: 0;
+						right: 0;
+						width: 80%;
+						background-color: #fff;
+
+						button {
+							width: 240rpx;
+						}
+
+						.newbtn {
+							background-color: rgb(51, 95, 182);
+							color: #fff;
+						}
 					}
 				}
 			}
 		}
 	}
-}
-
-
-</style>
+</style>