Explorar el Código

价格显示和设置

lilei hace 2 años
padre
commit
ce4865147f

+ 42 - 5
api/shelf.js

@@ -54,6 +54,14 @@ export const saveShelfOrder = (params) => {
     method: 'post'
   })
 }
+//保存并一键取货
+export const shelfOrderFlowCreate = (params) => {
+  return request({
+    url: `shelfOrder/flowCreate`,
+    data: params,
+    method: 'post'
+  })
+}
 // 关闭订单
 export const cancelShelfOrder = (params) => {
   return request({
@@ -246,18 +254,47 @@ export const shelfOrderOnceCreate = (params) => {
   })
 }
 
-// 是否设置了价格显示
+ // 查找价格显示 GET
 export const findPriceShow = (params) => {
   return request({
-    url: `shelf/storeParam/findByParamKey`,
+    url: `shelf/storeParam/findPriceShow`,
+    method: 'get'
+  })
+}
+// 保存价格显示 POST
+export const savePriceShow = (params) => {
+  return request({
+    url: `shelf/storeParam/savePriceShow`,
     data: params,
     method: 'post'
   })
 }
-// 保存价格设置
-export const savePriceShow = (params) => {
+// 查找价格显示类型 GET
+export const findPriceShowType = (params) => {
+  return request({
+    url: `shelf/storeParam/findPriceShowType`,
+    method: 'get'
+  })
+}
+ // 保存价格显示类型 post
+export const savePriceShowType = (params) => {
+  return request({
+    url: `shelf/storeParam/savePriceShowType`,
+    data: params,
+    method: 'post'
+  })
+}
+// 查找价格显示员工可见 GET
+export const findPriceShowEmployee = (params) => {
+  return request({
+    url: `shelf/storeParam/findPriceShowEmployee`,
+    method: 'get'
+  })
+}
+ // POST 保存价格显示员工可见
+export const savePriceShowEmployee = (params) => {
   return request({
-    url: `shelf/storeParam/saveByParamKey`,
+    url: `shelf/storeParam/savePriceShowEmployee`,
     data: params,
     method: 'post'
   })

+ 7 - 7
pages/digitalShelf/choosePart.vue

@@ -55,7 +55,7 @@
 										<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'">
+												 	<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>
@@ -114,7 +114,7 @@
 									</view>
 									<view class="flex justify_between">
 										<view class="item-detail-text flex_1" v-if="showPrice[0]">
-											<view v-if="showPrice[1]=='PURCHASES_PRICE'">
+											<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>
@@ -195,7 +195,7 @@
 										</view>
 										<view class="item-detail-text flex_1" v-else>
 											 <view v-if="showPrice[0]">
-												  <view v-if="showPrice[1]=='PURCHASES_PRICE'">
+												  <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>
@@ -225,7 +225,7 @@
 </template>
 
 <script>
-	import { getShelfProductList, getShelfProductType, queryPartCodeByVin, getShelfQueryList, saveShelfOrder } from '@/api/shelf'
+	import { getShelfProductList, getShelfProductType, queryPartCodeByVin, getShelfQueryList, shelfOrderFlowCreate } from '@/api/shelf'
 	export default {
 		data() {
 			return {
@@ -546,7 +546,7 @@
 						tempList.push({
 							"productSn": item.productSn,
 							"qty": item.qty,
-							"price": item.cost
+							// "price": item.cost
 						})
 					}
 				})
@@ -589,8 +589,8 @@
 					}
 					console.log(params,'立即提交')
 					this.saveLoading = true
-					saveShelfOrder(params).then(res => {
-						console.log(res,'saveShelfOrder')
+					shelfOrderFlowCreate(params).then(res => {
+						console.log(res,'shelfOrderFlowCreate')
 						if(res.status == 200){
 							res.data.shelfOrder.remindMessage = '请在货架上按照指定位置拿取配件'
 							// 提交成功

+ 4 - 4
pages/digitalShelf/settlementManage/settlementSxDetail.vue

@@ -8,7 +8,7 @@
 					<text>¥{{info?info.usedAmount.toFixed(2):0.00}}</text>
 				</view>
 			</view>
-			<view class="sxjs-head-grid flex align-center justify_between">
+			<!-- <view class="sxjs-head-grid flex align-center justify_between">
 				<view :class="tabIndex==0?'active':''" @click="tabChange(0)">
 					<view>待结算</view>
 					<view class="edu"><text>¥{{info?info.waitSettleAmount:0.00}}</text></view>
@@ -19,13 +19,13 @@
 					<view class="edu"><text>¥{{info?info.freezeAmount.toFixed(2):0.00}}</text></view>
 					<view class="line"></view>
 				</view>
-			</view>
+			</view> -->
 		</view>
 		<view class="ds-box">
 			<scroll-view style="height: calc(100vh - 370upx);position: relative;" scroll-y @scrolltolower="loadMore">
-				 <view class="notes-msg" v-if="tabIndex==1">
+				 <!-- <view class="notes-msg" v-if="tabIndex==1">
 				 	已冻结金额是指状态为“待取货”的订单结算金额合计,暂时无需支付,但是会占用授信额度,请尽快处理
-				 </view>
+				 </view> -->
 				 <!-- 列表 -->
 				 <view class="ds-list" v-for="item in list" :key="item.id">
 				 	<view class="flex align_center">

+ 4 - 4
pages/index/index.vue

@@ -106,7 +106,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 } from '@/api/shelf.js'
+	import { shelfBondRecordWaitPayRecord, findStoreShelf, shelfGetTotalWaitQty, getProductfindByScanCode, findPriceShow,findPriceShowType,findPriceShowEmployee } 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'
@@ -213,18 +213,18 @@
 				}
 			},
 			async getPriceShow(){
-				await findPriceShow({paramCode:'PRICE_SHOW'}).then(res => {
+				await findPriceShow().then(res => {
 					this.showPrice = res.data ? res.data.paramValue=='1' : false
 					this.$store.state.vuex_showPrice[0] = this.showPrice
 				})
-				await findPriceShow({paramCode:'PRICE_SHOW_TYPE'}).then(res => {
+				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 findPriceShow({paramCode:'PRICE_SHOW_EMPLOYEE'}).then(res => {
+				await findPriceShowEmployee().then(res => {
 					this.showJhPrice = res.data ? res.data.paramValue=='1' : false
 					this.$store.state.vuex_showPrice[2] = this.showJhPrice
 				})

+ 1 - 1
pages/morePage/morePage.vue

@@ -55,7 +55,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')" @click="toPage('/pages/storeManage/priceSetting/priceSetting')" :title-style="{fontSize:'1em'}">
 					<text slot="icon"></text>
 				</u-cell-item>
 			</u-cell-group>

+ 17 - 7
pages/storeManage/priceSetting/priceSetting.vue

@@ -15,7 +15,7 @@
 </template>
 
 <script>
-	import { findPriceShow, savePriceShow } from '@/api/shelf'
+	import { findPriceShow,findPriceShowType,findPriceShowEmployee,savePriceShow,savePriceShowType,savePriceShowEmployee } from '@/api/shelf'
 	export default {
 		data() {
 			return {
@@ -35,29 +35,39 @@
 			})
 		},
 		onReady() {
-			this.pageInit()
+			// 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]
 		},
 		methods: {
 			async pageInit(){
-				await findPriceShow({paramCode:'PRICE_SHOW'}).then(res => {
+				await findPriceShow().then(res => {
 					this.showPrice = res.data ? res.data.paramValue=='1' : false
 					this.$store.state.vuex_showPrice[0] = this.showPrice
 				})
-				await findPriceShow({paramCode:'PRICE_SHOW_TYPE'}).then(res => {
+				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
 					}
 				})
-				await findPriceShow({paramCode:'PRICE_SHOW_EMPLOYEE'}).then(res => {
+				await findPriceShowEmployee().then(res => {
 					this.showJhPrice = res.data ? res.data.paramValue=='1' : false
 					this.$store.state.vuex_showPrice[2] = this.showJhPrice
 				})
 			},
 			savePrice(data,value){
-				savePriceShow({
-					paramCode:data,
+				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){