shish 1 éve
szülő
commit
7e6cadc3e6

+ 50 - 51
ghsPad/src/pages/home/cash.vue

@@ -5,40 +5,25 @@
 	</template>
 	<template v-else>
 
-		<block v-if="customId == 0">
-			<view class="custom-app-casher-area">
-				<view class="nav-left">
-					<navComponent navType="casher"></navComponent>
-				</view>
-				<view class="select-custom">
-					<customerList @fastKd="fastKd" @selectCustomer="selectCustomer" @cancelChooseCustomer="cancelSelect"> </customerList>
-				</view>
+		<view class="item-app-casher-area">
+			<view class="nav-left">
+				<navComponent navType="casher"></navComponent>
 			</view>
-		</block>
-		<block v-else>
 
-			<view class="item-app-casher-area">
-				<view class="nav-left">
-					<navComponent navType="casher"></navComponent>
-				</view>
-				<!-- 已选花材列表 -->
-				<view class="itemList-box">
-					<leftArea v-if="!$util.isEmpty(selectList)" :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId"></leftArea>
-					<leftGroup v-else :customId.sync="customId"></leftGroup>
-				</view>
-				<!-- 分类和花材图片 -->
-				<view class="all-item-area">
-					<rightGoods v-if="currentProperty == 0" ref="rightItemRef" :customId.sync="customId" :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId"> </rightGoods>
-					<rightItem v-else ref="rightItemRef" :customId.sync="customId" :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId"> </rightItem>
-				</view>
-				<!-- 按钮操作 -->
-				<view class="open-box">
-					<consoleButton :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId" @clearAll="clearAll"
-					:customId.sync="customId" :customName.sync="customName" @changeProperty="changeProperty" @cancelKdFn="cancelKdFn" @rightItemRefresh="rightItemRefresh"></consoleButton>
-				</view>
+			<view class="itemList-box">
+				<leftArea v-if="!$util.isEmpty(selectList)" :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId"></leftArea>
+				<leftGroup v-else :customId.sync="customId"></leftGroup>
 			</view>
 
-		</block>
+			<view class="all-item-area">
+				<rightItem ref="rightItemRef" :customId.sync="customId" :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId"> </rightItem>
+			</view>
+
+			<view class="open-box">
+				<consoleButton :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId" @clearAll="clearAll" @showCustomPop="showCustomPop"
+				:customId.sync="customId" :customName.sync="customName" @changeProperty="changeProperty" @rightItemRefresh="rightItemRefresh"></consoleButton>
+			</view>
+		</view>
 
 	</template>
 
@@ -46,6 +31,10 @@
         <uni-popup-dialog type="info" cancelText="取消" @close="cancelRefresh" confirmText="确认" title="提示" content="花材价格已修改,请刷新" @confirm="confirmRefresh"></uni-popup-dialog>
     </uni-popup>
 
+    <uni-popup ref="myCustomRef" background-color="#fff" type="center" :animation="false">
+        <customerList @fastKd="fastKd" ref="inCustomRef" @confirmCustom="confirmCustom" @cancelChoose="cancelChoose"> </customerList>
+    </uni-popup>
+
 </view>
 </template>
 <script>
@@ -90,12 +79,6 @@ export default {
 
 		this.beginRemind()
 	},
-	onShow(){
-		if(this.option.customId){
-			this.customId = this.option.customId
-			this.customName = this.option.customName
-		}
-	},
 	onUnload(){
 		clearInterval(this.T)
 	},
@@ -106,13 +89,22 @@ export default {
 			this.isLogin = 0
 		}else{
 			this.isLogin = 1
+
+			this.customId = this.getLoginInfo.skCustomId && this.getLoginInfo.skCustomId > 0 ? Number(this.getLoginInfo.skCustomId):0
+			this.customName = '快捷开单'
+
 		}
+
 	},
 	watch:{
 		getLoginInfo: {
 			handler(newValue) {
 				if(this.$util.isEmpty(newValue.admin) == false && newValue.admin.currentShopId > 0){
 					this.isLogin = 1
+
+					this.customId = newValue.skCustomId && newValue.skCustomId>0 ? Number(newValue.skCustomId) : 0
+					this.customName = '快捷开单'
+
 				}else{
 					this.isLogin = 0
 				}			
@@ -121,25 +113,30 @@ export default {
 	},
 	methods: {
 		fastKd(){
-			if(this.getLoginInfo.skCustomId && this.getLoginInfo.skCustomId > 0){
-				let currentId = this.getLoginInfo.skCustomId
-				this.customId = Number(currentId)
-				this.customName = '快捷开单'
-			}else{
-				this.$msg('请先设置开单门店')
-			}
+			this.$refs.inCustomRef.focusInput = false
+			this.$refs.myCustomRef.close()
+			this.customId = this.getLoginInfo.skCustomId && this.getLoginInfo.skCustomId > 0 ? Number(this.getLoginInfo.skCustomId) : 0
+			this.customName = '快捷开单'
+			this.$refs.rightItemRef.currentCustomId = this.customId
+			this.$refs.rightItemRef.itemRefresh()
 		},
-		cancelKdFn(){
-			this.customId = 0
-			this.customName = ''
+		showCustomPop(){
+			this.$refs.inCustomRef.searchUser = ''
+			this.$refs.inCustomRef.searchCustomer()
+			this.$refs.myCustomRef.open('top')
+			this.$refs.inCustomRef.focusInput = true
 		},
-		cancelSelect(){
-			this.customId = 0
-			this.customName = ''
+		cancelChoose(){
+			this.$refs.inCustomRef.focusInput = false
+			this.$refs.myCustomRef.close()
 		},
-		selectCustomer(info){
+		confirmCustom(info){
+			this.$refs.inCustomRef.focusInput = false
+			this.$refs.myCustomRef.close()
 			this.customId = Number(info.id)
 			this.customName = info.name
+			this.$refs.rightItemRef.currentCustomId = this.customId
+			this.$refs.rightItemRef.itemRefresh()
 		},
 		clearAll(){
 			this.customId = 0
@@ -166,8 +163,10 @@ export default {
 				})
 			}, 15000)
 		},
-		//开单完成之后更新花材的库存
 		rightItemRefresh(){
+			this.customId = this.getLoginInfo.skCustomId && this.getLoginInfo.skCustomId > 0 ? Number(this.getLoginInfo.skCustomId) : 0
+			this.customName = '快捷开单'
+			this.$refs.rightItemRef.currentCustomId = this.customId
 			this.$refs.rightItemRef.itemRefresh()
 		},
 		changeProperty(property){

+ 4 - 4
ghsPad/src/pages/home/components/cashConsole.vue

@@ -2,11 +2,11 @@
 <view class="button-area">
 	<view class="active" @click="getAllProduct">扫码</view>
 	<view class="active" @click="openBox">开箱</view>
-	<view class="active" style="background-color:orange;color:white;border-color:orange;position:fixed;left:135upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;" @click="beginSettle">批发结算</view>
+	<view class="active" style="background-color:orange;color:white;border-color:orange;position:fixed;left:135upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;" @click="beginSettle">结算</view>
 	<view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;" @click="handOrder()" v-if="globalHasHand == 0">挂单</view>
 	<view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color:white;background-color: #3385FF;" @click="getHandOrder()" v-else>取单</view>
     <view class="active" @click="clearItemFn">清空</view>
-	<view class="active" @click="cancelKdFn">返回</view>
+	<view class="active" @click="showCustomPop" style="background-color:#3385FF;color:white;">选客</view>
 
 	<view v-if="Number(customId)>0" style="position:fixed;left:32upx;bottom:66upx;width:189upx;height:20upx;line-height:5upx;font-size:13upx;background-color:white;color:#3385FF;font-weight:bold;border:none;">{{customName}}</view>
 
@@ -118,9 +118,9 @@ export default {
 		// #endif
 	},
     methods:{
-		cancelKdFn(){
+		showCustomPop(){
 			this.$util.hitVoice()
-			this.$emit('cancelKdFn')
+			this.$emit('showCustomPop')
 		},
 		cancelSelectPrice(){
 			this.$refs.gatheringRef.close()

+ 18 - 15
ghsPad/src/pages/home/components/customerList.vue

@@ -3,7 +3,7 @@
     <view class="title">请选客户</view>
     <view class="app-userList_box">
       <block v-for="(item,index) in list" :key="item.id">
-        <block v-if="index == 6">
+        <block v-if="index == 12">
             <view class="user-list-item_box" @click.stop="fastKd()" 
             style="background-color:#3385FF;border:1upx solid #3385FF;text-align:center;">
               <view class="head-box">
@@ -11,7 +11,7 @@
               </view>
             </view>
         </block>
-        <view @click="selectCustomer(item)" class="user-list-item_box" >
+        <view @click="confirmCustom(item)" class="user-list-item_box" >
           <view class="head-box">
             <view class="name">{{item.name}}</view>
           </view>
@@ -25,23 +25,25 @@
           </view>
         </view>
       </block>
-
     </view>
-    <input class="input-serach_box" v-model="searchUser" type="text" focus="true" @focus="clearInput" @input="changSearch" placeholder-class="input-placeholder" placeholder="请输入客户名称"/>
+    <view style="position: relative;">
+        <input class="input-serach_box" v-model="searchUser" type="text" :focus="focusInput" @focus="clearInput" @input="changSearch" placeholder-class="input-placeholder" placeholder="请输入客户名称"/>
+        <button class="admin-button-com mini-btn default" style="position: absolute;right:10upx;top:-5upx;font-size:20upx;" @click="cancelChoose">取消</button>
+    </view>
   </view>
 </template>
 <script>
-import VKeyboard from "@/components/vKeyboard/VKeyboard.vue";
 import { customList } from '@/api/home/index'
 export default {
   name: "selectCustom",
-  components: { VKeyboard },
+  components: {  },
 	props: {
   },
   data() {
     return {
 		searchUser: '',
-		list:[]
+		list:[],
+    focusInput:true
 	};
   },
   mounted() {
@@ -52,9 +54,13 @@ export default {
       this.$util.hitVoice()
       this.$emit('fastKd')
     },
-    selectCustomer(info){
+    cancelChoose(){
+      this.$util.hitVoice()
+      this.$emit('cancelChoose')
+    },
+    confirmCustom(info){
       this.$util.hitVoice()
-      this.$emit('selectCustomer',info)
+      this.$emit('confirmCustom',info)
     },
     clearInput(){
       this.searchUser=''
@@ -81,11 +87,12 @@ export default {
 .app-select_user {
   background-color: #ffffff;
   padding: 5upx;
-  height: 99vh;
-  width:96vw;
+  height: 36vh;
+  width:95vw;
   display: flex;
   flex-direction: column;
   box-sizing: border-box;
+  margin:0 auto;
   & .title {
     font-size:9upx;
     color: #CCCCCC;
@@ -148,10 +155,6 @@ export default {
       }
     }
   }
-  & .keyboard-body_box {
-		flex: 1;
-    z-index:99;
-  }
   & .input-serach_box {
 	  font-size: 15upx;
 	  line-height:30upx;

+ 5 - 3
ghsPad/src/pages/home/components/rightItem.vue

@@ -45,7 +45,8 @@ export default {
             allItemInfo:[],
             itemInfoList:[],
             currentJobType:'bill',
-            currentJobId:0
+            currentJobId:0,
+            currentCustomId:0
         }
     },
 	props: {
@@ -91,12 +92,13 @@ export default {
             let { data } =  await showClass()
             this.classData = data
             this.categoryId = this.classData[0].id
-            let { data:{list} } =  await showList({isCashier:1,customId:this.customId})
+            this.currentCustomId = this.customId>0 ? this.customId : 0
+            let { data:{list} } =  await showList({isCashier:1,customId:this.currentCustomId})
             this.allItemInfo = list
             this.showCatItem()
         },
         itemRefresh(){
-            showList({isCashier:1}).then(res=>{
+            showList({isCashier:1,customId:this.currentCustomId}).then(res=>{
                 this.allItemInfo = res.data.list
                 this.showCatItem()
             })

+ 2 - 2
ghsPad/src/pages/home/selectCustom.vue

@@ -13,7 +13,7 @@
                 <casherNav navType="selectCustom"></casherNav>
             </view>
 			<view class="select-custom">
-				<customerList @selectCustomer="selectCustomer" @cancelChooseCustomer="cancelSelect"> </customerList>
+				<customerList @confirmCustom="confirmCustom" @cancelChooseCustomer="cancelSelect"> </customerList>
 			</view>
         </view>
 
@@ -61,7 +61,7 @@ export default {
 		}
 	},
 	methods: {
-		selectCustomer(info){
+		confirmCustom(info){
 			this.$util.hitVoice()
 			this.$util.pageTo({url:'/pages/home/cash?customId='+info.id+'&customName='+info.name})
 		},