|
@@ -12,9 +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="nowData.showPrice">
|
|
|
+ <view class="pcode" v-if="showCarPrice||showCostPrice">
|
|
|
<view>
|
|
|
- 价格:<text class="item-price">{{nowData.showPrice||0}}</text>
|
|
|
+ 价格:
|
|
|
+ <text class="item-price" v-if="showCarPrice">¥{{nowData.price||0}}</text>
|
|
|
+ <text class="item-price" v-if="showCostPrice">¥{{nowData.cost||0}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view>
|
|
@@ -31,17 +33,24 @@
|
|
|
</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(){
|
|
@@ -52,6 +61,23 @@
|
|
|
}
|
|
|
},
|
|
|
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({
|