lilei 2 år sedan
förälder
incheckning
fc3de90f54
2 ändrade filer med 31 tillägg och 5 borttagningar
  1. 4 0
      .hbuilderx/launch.json
  2. 27 5
      pages/digitalShelf/choosePart.vue

+ 4 - 0
.hbuilderx/launch.json

@@ -2,6 +2,10 @@
   // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
     "version": "0.0",
     "configurations": [{
+     	"app-plus" : 
+     	{
+     		"launchtype" : "local"
+     	},
      	"default" : 
      	{
      		"launchtype" : "local"

+ 27 - 5
pages/digitalShelf/choosePart.vue

@@ -53,8 +53,12 @@
 											<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">
-												<text class="item-price" v-if="item.affiliation=='SHELF'">¥{{item.price||0}}</text>
+											<view class="item-detail-text flex_1" v-if="item.affiliation=='SHELF'">
+												<text class="item-price" v-if="showJhPrice">¥{{item.cost||0}}</text>
+												<text class="item-price" v-else>¥{{item.price||0}}</text>
+											</view>
+											<view class="item-detail-text flex_1" v-if="item.affiliation=='SUPER_CATALOGUE'">
+												<text class="item-price" v-if="!showJhPrice">¥{{item.price||0}}</text>
 											</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'}" type="primary" size="mini">
@@ -103,7 +107,8 @@
 									</view>
 									<view class="flex justify_between">
 										<view class="item-detail-text flex_1">
-											<text class="item-price">¥{{item.price||0}}</text>
+											<text class="item-price" v-if="showJhPrice">¥{{item.cost||0}}</text>
+											<text class="item-price" v-else>¥{{item.price||0}}</text>
 										</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">
@@ -169,8 +174,12 @@
 										<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">
-											<text class="item-price" v-if="item.affiliation!='SUPER_CATALOGUE'">¥{{item.price||0}}</text>
+										<view class="item-detail-text flex_1" v-if="item.affiliation&&item.affiliation=='SHELF'">
+											<text class="item-price" v-if="showJhPrice">¥{{item.cost||0}}</text>
+											<text class="item-price" v-else>¥{{item.price||0}}</text>
+										</view>
+										<view class="item-detail-text flex_1" v-else>
+											<text class="item-price" v-if="!showJhPrice">¥{{item.price||0}}</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>
@@ -243,6 +252,19 @@
 			},
 			storeApply(){
 				return this.$store.state.vuex_storeAuthInfo || null
+			},
+			showJhPrice(){
+				const showPrice = this.$store.state.vuex_showPrice
+				const isAdmin = this.userInfo.superAdmin == 1
+				const isJhPrice = showPrice[0] && showPrice[1] == 'PURCHASES_PRICE'
+				// 是管理员
+				if(isAdmin){
+					// 是否进货价
+					return isJhPrice
+				}else{
+					// 员工且是否可见进货价
+					return isJhPrice && showPrice[2]
+				}
 			}
 		},
 		onLoad(opts) {