shish 1 سال پیش
والد
کامیت
bf3f3c3227

+ 2 - 2
ghsPad/src/mixins/product.js

@@ -370,8 +370,8 @@ export default {
         },
         itemRefresh(){
             showList({isCashier:1,customId:this.globalRightItemCustomId}).then(res=>{
-                this.globalRightAllItemInfo = res.data.list
-				this.globalAllProduct = res.data.productList
+                this.globalRightAllItemInfo = res.data.list?res.data.list:[]
+				this.globalAllProduct = res.data.productList?res.data.productList:[]
                 this.globalShowCatItem()
             })
         },

+ 10 - 6
ghsPad/src/pages/home/cash.vue

@@ -96,11 +96,11 @@ export default {
 		}else{
 			this.isLogin = 1
 
-			this.customId = this.getLoginInfo.skCustomId && this.getLoginInfo.skCustomId > 0 ? Number(this.getLoginInfo.skCustomId):0
-			this.customName = '快捷开单'
-
+			if(this.getLoginInfo.skCustomId && this.getLoginInfo.skCustomId>0){
+				this.customId = this.getLoginInfo.skCustomId
+				this.customName = '快捷开单'
+			}
 		}
-
 	},
 	watch:{
 		getLoginInfo: {
@@ -108,8 +108,12 @@ export default {
 				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 = '快捷开单'
+					if(newValue.skCustomId && newValue.skCustomId>0){
+						console.log('this.customId'+newValue.skCustomId)
+						this.customId = newValue.skCustomId
+						this.customName = '快捷开单'
+					}
+
 
 				}else{
 					this.isLogin = 0

+ 81 - 50
ghsPad/src/pages/home/components/cashConsole.vue

@@ -1,6 +1,8 @@
 <template>
 <view class="button-area">
 	<view class="active" @click="openBox">开箱</view>
+	<view class="active" @click="toWastage">报损</view>
+	<view class="active" @click="part">拆散</view>
 	<view class="active2" :class="[fastAction==1 ? 'clear-fast' : 'clear']" style="" @click="beginSettle">结算</view>
 	<view class="active2" :class="[fastAction==1 ? 'hand-fast' : 'hand']" @click="handOrder()" v-if="globalHasHand == 0">挂单</view>
 	<view class="active2" :class="[fastAction==1 ? 'out-fast' : 'out']" @click="getHandOrder()" v-else>取单</view>
@@ -40,18 +42,38 @@
 		@cancelKdSelectNumPrice="addItemModelHidden"></selectNumPrice>
 	</uni-popup>
 
+	<uni-popup ref="wastageRef" type="dialog">
+		<view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
+			<view style="margin-bottom:40upx;text-align: center;font-size:24upx;">确认报损?</view>
+			<view style="text-align:center;">
+				<button class="admin-button-com mini-btn default" @click="cancelWastage">取消</button>
+				<button class="admin-button-com mini-btn default" @click="confirmWastage" style="margin-left:30upx;">确认</button>
+			</view>
+		</view>
+	</uni-popup>
+
+	<uni-popup ref="myPartRef" type="dialog">
+		<view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
+			<view style="margin-bottom:40upx;text-align: center;font-size:24upx;">确认拆散?</view>
+			<view style="text-align:center;">
+				<button class="admin-button-com mini-btn default" @click="cancelPart">取消</button>
+				<button class="admin-button-com mini-btn default" @click="confirmPart" style="margin-left:30upx;">确认</button>
+			</view>
+		</view>
+	</uni-popup>
+
 </view>
 </template>
 <script>
 import settlePop from './settlePop'
 import toPayWay from './toPay'
-import { wastageCreateOrder } from '@/api/home/index'
+import { wastageCreateOrder } from '@/api/home'
 import { createOrder} from '@/api/order'
-import {goodsWastage} from '@/api/wastage'
 import productMins from "@/mixins/product"
 import selectPrice from './selectPrice'
 import selectNumPrice from './selectNumPrice'
 import { mapGetters } from "vuex";
+import { partItem } from '@/api/part'
 // #ifdef APP-PLUS
 let sunmiCashboxPlugin = uni.requireNativePlugin('Tellsea-SunmiCashboxPlugin')
 // #endif
@@ -128,6 +150,63 @@ export default {
 	destroyed(){
 	},
     methods:{
+		part(){
+			this.$util.hitVoice()
+			if(this.$util.isEmpty(this.selectList)) {
+				this.$msg('请选择花材')
+				return false
+			}
+			this.$refs.myPartRef.open('center')
+		},
+		cancelPart(){
+			this.$util.hitVoice()
+			this.$refs.myPartRef.close()
+		},
+		confirmPart(){
+			this.$util.hitVoice()
+			if(this.$util.isEmpty(this.selectList)) {
+				this.$msg('请选择花材')
+				return false
+			}
+			let product = this.selectList.map(i=>({ 
+				productId:i.id, unitType: i.unitType||0, num: i.currentNum, property: i.property, unitPrice: i.unitPrice,
+			}))
+			partItem({ product: JSON.stringify(product) }).then(res=>{
+				if(res.code == 1){
+					this.removeFromSaveDirect()
+					this.$refs.myPartRef.close()
+					this.$msg("拆散成功")
+				}
+			})
+		},
+		toWastage(){
+			this.$util.hitVoice()
+			if(this.$util.isEmpty(this.selectList)) {
+				this.$msg('请选择花材')
+				return false
+			}
+			this.$refs.wastageRef.open('center')
+		},
+		cancelWastage(){
+			this.$refs.wastageRef.close()
+		},
+		confirmWastage(){
+			this.$util.hitVoice()
+			if(this.$util.isEmpty(this.selectList)) {
+				this.$msg('请选择花材')
+				return false
+			}
+			let product = this.selectList.map(i=>({ 
+				productId:i.id, unitType: i.unitType||0, num: i.currentNum, property: i.property, unitPrice: i.unitPrice,
+			}))
+			wastageCreateOrder({ product: JSON.stringify(product) }).then(res=>{
+				if(res.code == 1){
+					this.removeFromSaveDirect()
+					this.$refs.wastageRef.close()
+					this.$msg("报损成功")
+				}
+			})
+		},
 		showCustomPop(){
 			this.$util.hitVoice()
 			this.$emit('showCustomPop')
@@ -237,54 +316,6 @@ export default {
 		selectPayWayBack(price){
 			this.$util.hitVoice()
 		},
-		toWastage(){
-			this.$util.hitVoice()
-			if(this.$util.isEmpty(this.selectList)) {
-				this.$msg('请选择报损花材')
-				return false
-			}
-			this.$refs.wastageRef.open('center')
-		},
-		confirmWastage(){
-			this.$util.hitVoice()
-			if(this.$util.isEmpty(this.selectList)) {
-				this.$msg('请选择报损花材')
-				return false
-			}
-			let hasGoods = this.selectList.some((item) => {
-			  return item.property  == 0
-			})
-			let hasItem = this.selectList.some((item) => {
-			  return item.property  == 1
-			})
-			if(hasGoods == true && hasItem == true){
-				this.$msg('商品和花材要分别进行报损')
-				return false
-			}
-			if(hasItem == true){
-				let product = this.selectList.map(i=>({ 
-					productId:i.id, unitType: i.unitType||0, num: i.currentNum, property: i.property, unitPrice: i.unitPrice,
-				}))
-				wastageCreateOrder({ product: JSON.stringify(product) }).then(res=>{
-					if(res.code == 1){
-						this.removeFromSaveDirect()
-						this.$refs.wastageRef.close()
-						this.$msg("报损成功!")
-					}
-				})
-			}else{
-				let goodsList = this.selectList.map(i=>({ 
-					goodsId:i.id, num: i.currentNum, property: i.property, unitPrice: i.unitPrice,name:i.name,cover:i.shortCover
-				}))
-				goodsWastage({ goodsList: JSON.stringify(goodsList) }).then(res=>{
-					if(res.code == 1){
-						this.removeFromSaveDirect()
-						this.$refs.wastageRef.close()
-						this.$msg("报损成功!")
-					}
-				})
-			}
-		},
 		beginSettle(){
 			this.$util.hitVoice()
 			if(this.$util.isEmpty(this.selectList)) {

+ 36 - 13
hdPad/src/mixins/product.js

@@ -1,7 +1,8 @@
 import { mapGetters, mapActions } from "vuex";
 import { copyObject } from "@/utils/util";
 import { getBySn } from '@/api/goods'
-import { allProduct } from '@/api/product'
+import { showClass } from '@/api/item-class/index'
+import { showList } from '@/api/item/index'
 export default {
 	data() {
 		return {
@@ -22,7 +23,12 @@ export default {
 			customData: { currentNum: 0, unitPrice: 0,unitType:0, unitName:'扎',property:1},
 			globalItemList:[],
 			globalAllProduct:[],
-			calc:'add'
+			calc:'add',
+            globalRightItemClass:[],
+            globalRightItemCatId: '',
+            globalAllItemInfo:[],
+            globalItemInfoList:[],
+			globalRightItemCustomId:0
 		};
 	},
 	onLoad(options) {
@@ -349,17 +355,34 @@ export default {
 			uni.$on('listenGetScanCode',function(data){
 				that.takeItem(data.code)
 			})
-			if(this.getMyShopInfo && this.getMyShopInfo.scan == 1){
-				that.getAllProduct()
-			}
 		},
-		getAllProduct(){
-			allProduct().then(res=>{
-				if(res.code == 1){
-					this.globalAllProduct = res.data.list
-					//console.log('载入最新花材...')
-				}
-			})
-		}
+        async globalGetRightItem(id){
+            let { data } =  await showClass()
+            this.globalRightItemClass = data
+            this.globalRightItemCatId = this.globalRightItemClass[0].id
+			this.globalRightItemCustomId = id
+            let { data:{list,productList} } =  await showList({isCashier:1,customId:this.globalRightItemCustomId})
+            this.globalAllItemInfo = list
+			this.globalAllProduct = productList
+            this.globalShowCatItem()
+        },
+        globalItemRefresh(){
+            showList({isCashier:1,customId:this.globalRightItemCustomId}).then(res=>{
+                this.globalAllItemInfo = res.data.list
+				this.globalAllProduct = res.data.productList ? res.data.productList : []
+                this.globalShowCatItem()
+            })
+        },
+        globalShowCatItem(){
+            this.globalItemInfoList = this.globalAllItemInfo[this.globalRightItemCatId]
+        },
+        changeCategory(item){
+            if(item.id === this.globalRightItemCatId){
+                return false
+            }
+            this.globalRightItemCatId = item.id
+            this.$util.hitVoice()
+            this.globalShowCatItem()
+        }
 	}
 }

+ 67 - 20
hdPad/src/pages/home/cash.vue

@@ -23,8 +23,8 @@
 			</view>
 			<!-- 按钮操作 -->
 			<view class="open-box">
-				<consoleButton :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId" @clearAll="clearAll"
-				:customId.sync="customId" :customName.sync="customName" @changeProperty="changeProperty" @rightItemRefresh="rightItemRefresh"></consoleButton>
+				<consoleButton :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId" @showCustomPop="showCustomPop" @fastCreate="fastCreate" @part="part"
+				:customId.sync="customId" :customName.sync="customName" @changeProperty="changeProperty" @updateRightItem="updateRightItem"></consoleButton>
 			</view>
 		</view>
 
@@ -34,6 +34,11 @@
         <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 @fastCreate="fastCreate" :myCustomList.sync="myCustomList" @confirmCustom="confirmCustom" @cancelChoose="cancelChoose">
+		</customerList>
+    </uni-popup>
+
 </view>
 </template>
 <script>
@@ -48,9 +53,11 @@ import navComponent from './components/nav.vue'
 import loginComponent from './login.vue'
 import { checkRefresh } from '@/api/item'
 import productMins from "@/mixins/product";
+import { customList } from '@/api/home/index'
+import customerList from './components/customerList.vue'
 export default {
 	name: "cash",
-	components: { rightItem,consoleButton,  loginComponent, leftArea,leftGroup, rightGoods,navComponent},
+	components: { rightItem,consoleButton,  loginComponent, leftArea,leftGroup, rightGoods,navComponent,customerList},
 	mixins: [autoUpdateApp,productMins],
 	data() {
 		return {
@@ -67,33 +74,35 @@ export default {
             currentJobId:0,
 			hasChooseCustomer:true,
 			T:null,
-			customerInfo:{hasSelect:0,customId:0,customName:''}
+			customerInfo:{hasSelect:0,customId:0,customName:''},
+			myCustomList:[]
 		}
 	},
 	computed: {
-		...mapGetters(["getLoginInfo"])
+		...mapGetters(["getLoginInfo","getMyShopInfo"])
 	},
 	onLoad() {
 		this.initDataFromStorage()
 
 		this.beginRemind()
-	},
-	onShow(){
-		if(this.customerInfo.hasSelect == 1){
-			this.customId = this.customerInfo.customId
-			this.customName = this.customerInfo.customName
-		}
+
+		//这个页面有二个这方法,不能去掉,不然会造成:全部缓存清了,点选客没有客户可选
+		this.getCustomData()
+
 	},
 	onUnload(){
 		clearInterval(this.T)
 	},
-	onPullDownRefresh() {
-	},
 	mounted() {
 		if(this.$util.isEmpty(this.getLoginInfo.admin) || this.getLoginInfo.admin.currentShopId == 0){
 			this.isLogin = 0
 		}else{
 			this.isLogin = 1
+
+			if(this.getMyShopInfo.defaultCustomId && this.getMyShopInfo.defaultCustomId > 0){
+				this.customId =  Number(this.getMyShopInfo.defaultCustomId)
+				this.customName = '快捷开单'
+			}
 		}
 	},
 	watch:{
@@ -105,12 +114,47 @@ export default {
 					this.isLogin = 0
 				}			
 			}
+		},
+		getMyShopInfo:{
+			handler(newValue) {
+				this.customId = newValue.defaultCustomId && newValue.defaultCustomId > 0 ? Number(newValue.defaultCustomId):0
+				this.customName = '快捷开单'
+			}
 		}
 	},
 	methods: {
-		clearAll(){
-			this.customId = 0
-			this.customName = ''
+		fastCreate(){
+			this.$refs.myCustomRef.close()
+			this.customId = this.getMyShopInfo.defaultCustomId && this.getMyShopInfo.defaultCustomId > 0 ? Number(this.getMyShopInfo.defaultCustomId):0
+			this.customName = '快捷开单'
+			this.$refs.rightItemRef.renewMyRightItem(this.customId)
+		},
+		init(){
+			//这个页面有二个这方法,不能去掉,不然会造成:全部缓存清了,点选客没有客户可选
+			this.getCustomData()
+		},
+		getCustomData(){
+			customList({ name: '',isCashier:1 }).then(res=>{
+				if(res.code == 1){
+					if(res.data.list.length > 12){
+						this.myCustomList = res.data.list.slice(0,12)
+					}else{
+						this.myCustomList = res.data.list
+					}
+				}
+      		})
+		},
+		showCustomPop(){
+			this.$refs.myCustomRef.open('top')
+		},
+		cancelChoose(){
+			this.$refs.myCustomRef.close()
+		},
+		confirmCustom(info){
+			this.$refs.myCustomRef.close()
+			this.customId = Number(info.id)
+			this.customName = info.name
+			this.$refs.rightItemRef.renewMyRightItem(this.customId)
 		},
 		cancelRefresh(){
 			this.beginRemind()
@@ -131,11 +175,14 @@ export default {
 						}
 					}
 				})
-			}, 15000)
+			}, 20000)
 		},
-		//开单完成之后更新花材的库存
-		rightItemRefresh(){
-			this.$refs.rightItemRef.itemRefresh()
+		updateRightItem(){
+			this.customId = this.getMyShopInfo.defaultCustomId && this.getMyShopInfo.defaultCustomId > 0 ? Number(this.getMyShopInfo.defaultCustomId):0
+			this.customName = '快捷开单'
+			//要调用rightItemRef里的方法更新,不能这边直接请求product.js里方法更新,因为会造成扫码那块出问题,识别不到,关键词hzg_scan_right_item
+			this.$refs.rightItemRef.renewMyRightItem(this.customId)
+			this.getCustomData()
 		},
 		changeProperty(property){
 			this.currentProperty = property

+ 145 - 37
hdPad/src/pages/home/components/console.vue

@@ -3,29 +3,42 @@
 	<view class="active" @click="changeProperty(1)">花材</view>
 	<view class="active" @click="changeProperty(0)">花束</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="goSettleCommit">结算</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: #09C567;" @click="getHandOrder()" v-else>取单</view>
+	<view class="active" :class="[fastAction==1 ? 'clear-fast' : 'clear']" @click="goSettleCommit">结算</view>
+	<view class="active2" :class="[fastAction==1 ? 'hand-fast' : 'hand']" @click="handOrder()" v-if="globalHasHand == 0">挂单</view>
+	<view class="active2" :class="[fastAction==1 ? 'out-fast' : 'out']" @click="getHandOrder()" v-else>取单</view>
     <view class="active" @click="toWastage" style="color:#f1a313;border:1upx solid #f1a313;">报损</view>
-	<view class="active" @click="selectCustom()">选客</view>
-	<view class="active" @click="getAllProduct()">扫码</view>
+	<view class="active" @click="showCustomPop()" style="background-color: #09C567;border:1upx sold #09C567;color:white;">选客</view>
+	<view class="active" @click="part()">拆散</view>
+	<view class="active" @click="fastCreate()" style="font-size:9upx;">快捷开单</view>
 	<view class="active" @click="gatheringFn()" style="color:#3385FF;border:1upx solid #3385FF;">收款</view>
     <view class="active" @click="clearItemFn" style="color:#636161;border:1upx solid #636161;">清空</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:#09C567;font-weight:bold;border:none;">{{customName}}</view>
+	<view v-if="Number(customId)>0" :class="[fastAction==1 ? 'custom-fast' : 'custom']">{{customName}}</view>
+
+	<uni-popup ref="clearItemRef" type="dialog">
+		<view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
+			<view style="margin-bottom:40upx;text-align: center;font-size:24upx;">确认清空?</view>
+			<view style="text-align:center;">
+				<button class="admin-button-com mini-btn default" @click="cancelClear">取消</button>
+				<button class="admin-button-com mini-btn default" @click="confirmClearItem" style="margin-left:30upx;">确认</button>
+			</view>
+		</view>
+	</uni-popup>
 
-    <!-- 清空 -->
-    <uni-popup ref="clearItemRef" type="dialog">
-        <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认清空?" @confirm="confirmClearItem"></uni-popup-dialog>
-    </uni-popup>
 
     <uni-popup ref="logoutRef" type="dialog">
         <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认退出?" @confirm="confirmLogout"></uni-popup-dialog>
     </uni-popup>
 
-    <uni-popup ref="wastageRef" type="dialog">
-        <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认报损?" @confirm="confirmWastage"></uni-popup-dialog>
-    </uni-popup>
+	<uni-popup ref="wastageRef" type="dialog">
+		<view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
+			<view style="margin-bottom:40upx;text-align: center;font-size:24upx;">确认报损?</view>
+			<view style="text-align:center;">
+				<button class="admin-button-com mini-btn default" @click="cancelWastage">取消</button>
+				<button class="admin-button-com mini-btn default" @click="confirmWastage" style="margin-left:30upx;">确认</button>
+			</view>
+		</view>
+	</uni-popup>
 
     <!-- 结算弹框 -->
     <uni-popup ref="settlePopRef" background-color="#fff" type="center" :animation="false">
@@ -48,9 +61,20 @@
 		@addToClear="addToClear" @cancelKdSelectNumPrice="addItemModelHidden"></selectNumPrice>
 	</uni-popup>
 
+	<uni-popup ref="myPartRef" type="dialog">
+		<view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
+			<view style="margin-bottom:40upx;text-align: center;font-size:24upx;">确认拆散?</view>
+			<view style="text-align:center;">
+				<button class="admin-button-com mini-btn default" @click="cancelPart">取消</button>
+				<button class="admin-button-com mini-btn default" @click="confirmPart" style="margin-left:30upx;">确认</button>
+			</view>
+		</view>
+	</uni-popup>
+
 </view>
 </template>
 <script>
+import { mapGetters } from "vuex";
 import settlePop from './settlePop'
 import toPayWay from './toPay'
 import { wastageCreateOrder } from '@/api/home/index'
@@ -59,6 +83,7 @@ import {goodsWastage} from '@/api/wastage'
 import productMins from "@/mixins/product"
 import selectPrice from './selectPrice'
 import selectNumPrice from './selectNumPrice'
+import { partItem } from '@/api/part'
 // #ifdef APP-PLUS
 let sunmiCashboxPlugin = uni.requireNativePlugin('Tellsea-SunmiCashboxPlugin')
 // #endif
@@ -92,9 +117,13 @@ export default {
             currentJobId:0,
 			calc:'add',
 			settleOpenStatus:0,
-			price:0
+			price:0,
+			fastAction:1
         }
     },
+	computed: {
+		...mapGetters(["getLoginInfo","getMyShopInfo"])
+	},
     watch:{
         changeCurrentJobType:{
             handler(str){
@@ -107,10 +136,20 @@ export default {
                 this.currentJobId = Number(id)
             },
             immediate:true
-        }
+        },
+		customId:{
+            handler(id){
+                if(Number(this.getMyShopInfo.defaultCustomId)==Number(id)){
+					this.fastAction=1
+				}else{
+					this.fastAction=0
+				}
+            },
+            immediate:true
+		}
     },
 	created(){
-		
+
 		//判断是否有单可取
 		let has = uni.getStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentBackJobId)
 		if(!this.$util.isEmpty(has)){
@@ -122,15 +161,51 @@ export default {
 		this.listenScanItem()
 	},
 	destroyed(){
-		// #ifdef APP-PLUS
-		//避免重复,每次进来先移除全局自定义事件监听器
-		uni.$off('listenGetScanCode')
-		// #endif
 	},
     methods:{
-		selectCustom(){
+		part(){
 			this.$util.hitVoice()
-			this.$util.pageTo({url:'/pages/home/selectCustom'})
+			if(this.$util.isEmpty(this.selectList)) {
+				this.$msg('请选择花材')
+				return false
+			}
+			this.$refs.myPartRef.open('center')
+		},
+		cancelPart(){
+			this.$util.hitVoice()
+			this.$refs.myPartRef.close()
+		},
+		confirmPart(){
+			this.$util.hitVoice()
+			if(this.$util.isEmpty(this.selectList)) {
+				this.$msg('请选择花材')
+				return false
+			}
+			let hasGoods = this.selectList.some((item) => {
+			  return item.property  == 0
+			})
+			if(hasGoods){
+				this.$msg('商品不能拆散')
+				return false
+			}
+			let product = this.selectList.map(i=>({ 
+				productId:i.id, unitType: i.unitType||0, num: i.currentNum, property: i.property, unitPrice: i.unitPrice,
+			}))
+			partItem({ product: JSON.stringify(product) }).then(res=>{
+				if(res.code == 1){
+					this.removeFromSaveDirect()
+					this.$refs.myPartRef.close()
+					this.$msg("拆散成功")
+				}
+			})
+		},
+		showCustomPop(){
+			this.$util.hitVoice()
+			this.$emit('showCustomPop')
+		},
+		fastCreate(){
+			this.$util.hitVoice()
+			this.$emit('fastCreate')
 		},
         addToClear(){
 			let params = {
@@ -195,7 +270,7 @@ export default {
 			//继续监听花材扫码
 			this.listenScanItem()
 			//开单完成之后更新花材库存
-			this.$emit('rightItemRefresh')
+			this.$emit('updateRightItem')
 		},
 		calcFn(){
 			this.calc = this.calc == 'add' ? 'sub' : 'add'
@@ -220,9 +295,8 @@ export default {
 						this.$refs.toPayRef.open('center')
 					}else{
 						this.removeFromSaveDirect()
-						this.$emit('clearAll')
 						//开单完成之后更新花材库存
-						this.$emit('rightItemRefresh')
+						this.$emit('updateRightItem')
 						uni.showToast({ title: '操作成功', duration: 1000 })
 					}
 					this.settleOpenStatus = 0
@@ -253,15 +327,18 @@ export default {
 		toWastage(){
 			this.$util.hitVoice()
 			if(this.$util.isEmpty(this.selectList)) {
-				this.$msg('请选择报损花材')
+				this.$msg('请选择花材')
 				return false
 			}
 			this.$refs.wastageRef.open('center')
 		},
+		cancelWastage(){
+			this.$refs.wastageRef.close()
+		},
 		confirmWastage(){
 			this.$util.hitVoice()
 			if(this.$util.isEmpty(this.selectList)) {
-				this.$msg('请选择报损花材')
+				this.$msg('请选择花材')
 				return false
 			}
 			let hasGoods = this.selectList.some((item) => {
@@ -282,7 +359,7 @@ export default {
 					if(res.code == 1){
 						this.removeFromSaveDirect()
 						this.$refs.wastageRef.close()
-						this.$msg("报损成功!")
+						this.$msg("报损成功")
 					}
 				})
 			}else{
@@ -293,7 +370,7 @@ export default {
 					if(res.code == 1){
 						this.removeFromSaveDirect()
 						this.$refs.wastageRef.close()
-						this.$msg("报损成功!")
+						this.$msg("报损成功")
 					}
 				})
 			}
@@ -311,11 +388,6 @@ export default {
 			this.settleOpenStatus = 1
 			this.$refs.settlePopRef.open('center')
 		},
-		//清空花材弹框
-		clearItemFn(){
-			this.$util.hitVoice()
-			this.$refs.clearItemRef.open()
-		},
 		openBox(){
 			// #ifdef APP-PLUS
 			sunmiCashboxPlugin.connect((e) => {
@@ -331,11 +403,19 @@ export default {
 			})
 			// #endif
 		},
-		//确认清空花材
+		//清空花材弹框
+		clearItemFn(){
+			this.$util.hitVoice()
+			this.$refs.clearItemRef.open()
+		},
+		cancelClear(){
+			this.$util.hitVoice()
+			this.$refs.clearItemRef.close()
+		},
 		confirmClearItem(){
 			this.$util.hitVoice()
+			this.$refs.clearItemRef.close()
 			this.removeFromSaveDirect()
-			this.$emit('clearAll')
 		},
 		confirmLogout(){
 			this.$util.hitVoice()
@@ -372,8 +452,36 @@ export default {
 	& .active {
 		color: #09C567;
 		border-color: #09C567;
-		font-size: 12upx;
+		font-size: 10upx;
+		font-weight:bold;
+	}
+	& .active2 {
+		font-size: 10upx;
 		font-weight:bold;
 	}
+	& .custom-fast{
+		position:fixed;left:32upx;bottom:66upx;width:189upx;height:20upx;line-height:5upx;font-size:13upx;background-color:white;color:#09C567;font-weight:bold;border:none;
+	}
+	& .clear-fast{
+		background-color:#09C567;color:white;border-color:#09C567;position:fixed;left:135upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;
+	}
+	& .hand-fast{
+		position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color: #09C567;border-color: #09C567;
+	}
+	& .out-fast{
+		position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color:white;background-color: #09C567;
+	}
+	& .custom{
+		position:fixed;left:32upx;bottom:66upx;width:189upx;height:20upx;line-height:5upx;font-size:13upx;background-color:white;color:orange;font-weight:bold;border:none;
+	}
+	& .clear{
+		background-color:orange;color:white;border-color:orange;position:fixed;left:135upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;
+	}
+	& .hand{
+		position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color: orange;border-color: orange;
+	}
+	& .out{
+		position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color:white;background-color: orange;
+	}
 }
 </style>

+ 102 - 62
hdPad/src/pages/home/components/customerList.vue

@@ -2,72 +2,99 @@
   <view class="app-select_user">
     <view class="title">请选客户</view>
     <view class="app-userList_box">
-      <view :key="item.id" @click="selectCustomer(item)" class="userList-item_box" v-for="item in list">
-        <view class="head-box">
-          <image class="img" :src="item.avatar" mode="" ></image>
-          <view class="name">{{item.name}}</view>
-        </view>
-        <view class="footer-box">
-          <view> {{item.updateTime.substr(5,11)}} </view>
-        </view>
-      </view>
+
+            <view class="user-list-item_box" @click.stop="cancelChoose()" 
+            style="background-color:#CDB79E;border:1upx solid #CDB79E;text-align:center;">
+              <view class="head-box">
+                <view class="name" style="color:white;font-size:15upx;font-weight:bold;">取消</view>
+              </view>
+            </view>
+
+            <view class="user-list-item_box" @click.stop="fastCreate()"
+            style="background-color:#3385FF;border:1upx solid #3385FF;text-align:center;">
+              <view class="head-box">
+                <view class="name" style="color:white;font-size:15upx;font-weight:bold;">快捷开单</view>
+              </view>
+            </view>
+        
+            <view @click="confirmCustom(item)" class="user-list-item_box" v-for="(item,index) in currentCustomList" :key="item.id">
+              <view class="head-box">
+                <view class="name">{{item.name}}</view>
+              </view>
+            </view>
+
     </view>
-    <input disabled class="input-serach_box" style="margin-bottom:5upx;" v-model="searchUser" type="text" @change="changSearch" placeholder-class="input-placeholder" placeholder="请输入"/>
-    <view class="keyboard-body_box">
-      <VKeyboard ref="keyboard" :pointIsShow="false" :digital="false" :disorderly="false" @typing="typing" @enter="enter" @cancel="cancelWrite" > </VKeyboard>
+    <view style="position: relative;">
+        <input class="input-serach_box" v-model="searchUser" type="text" @focus="clearInput" @input="changSearch" placeholder-class="input-placeholder" placeholder="请输入客户名称"/>
     </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: {
+		myCustomList: {
+			type: Array,
+			default:[]
+		}
   },
   data() {
     return {
 		searchUser: '',
-		list:[]
+		currentCustomList:[]
 	};
   },
   mounted() {
-	  this.searchCustomer()
-    this.activeKeyboard();
+    if (!this.$util.isEmpty(this.myCustomList)) {
+      this.currentCustomList = this.myCustomList
+    }
   },
+  watch:{
+      myCustomList:{
+          handler(newList){
+            if (!this.$util.isEmpty(newList)) {
+              this.currentCustomList = newList
+            }
+          },
+          immediate:true,
+          deep:true
+        }
+    },
   methods: {
-    selectCustomer(info){
+    fastCreate(){
       this.$util.hitVoice()
-      this.$emit('selectCustomer',info)
+      this.searchUser = ''
+      this.$emit('fastCreate')
     },
-    changSearch(val){
-      this.init()
+    cancelChoose(){
+      this.$util.hitVoice()
+      this.searchUser = ''
+      this.$emit('cancelChoose')
     },
-    cancelWrite(){
-      this.$emit('cancelChooseCustomer')
+    confirmCustom(info){
+      this.$util.hitVoice()
+      this.searchUser = ''
+      this.$emit('confirmCustom',info)
+    },
+    clearInput(){
+      this.searchUser=''
+      this.searchCustomer()
+    },
+    changSearch(){
+      this.searchCustomer()
     },
     searchCustomer() {
-      customList({ name: this.searchUser }).then(res=>{
+      customList({ name: this.searchUser,isCashier:1 }).then(res=>{
         if(res.code == 1){
-          this.list = res.data.list
+          if(res.data.list.length > 12){
+            this.currentCustomList = res.data.list.slice(0,12)
+          }else{
+            this.currentCustomList = res.data.list
+          }
         }
       })
-    },
-    activeKeyboard() {
-      this.$refs.keyboard.activate()
-    },
-    typing(e) {
-      if (e.backspace) {
-          this.searchUser = this.searchUser.substring(0, this.searchUser.length - 1);
-      } else {
-        this.searchUser += e.char;
-      }
-      this.searchCustomer()
-    },
-    enter() {
-    },
-    cancel(){
     }
   },
 };
@@ -76,27 +103,41 @@ export default {
 .app-select_user {
   background-color: #ffffff;
   padding: 5upx;
-  height: 99vh;
-  width:100vw;
+  height: 39vh;
+  width:98vw;
   display: flex;
   flex-direction: column;
   box-sizing: border-box;
+  margin:0 auto;
   & .title {
-    font-size: 12upx;
+    font-size:9upx;
     color: #CCCCCC;
     margin-left:5upx;
   }
   & .app-userList_box {
-    padding: 5upx;
+    position:relative;
+    padding: 4upx;
     display: flex;
     flex-wrap: wrap;
-    min-height: 130upx;
+    min-height:100upx;
     overflow-y: scroll;
-    & .userList-item_box {
-      margin: 0 5upx 5upx 0;
-      width: 100upx;
-      height: 60upx;
-      border: 1px solid #cccccc;
+    .fast-kd{
+      font-size:20upx;
+      width:100upx;
+      padding:30upx 0 30upx 0;
+      position:absolute;
+      top:20upx;
+      right:10upx;
+      background-color:green;
+      color:white;
+      border-radius:20upx;
+      text-align:center;
+    }
+    & .user-list-item_box {
+      margin: 0 5upx 3upx 0;
+      width: 95upx;
+      height:43upx;
+      border: 1px solid #3385FF;
       padding: 3upx;
       border-radius: 3upx;
       display: flex;
@@ -108,12 +149,11 @@ export default {
         align-items: center;
         margin-bottom: 15upxs;
         & .name {
-          color:#666666;
+          color:#3385FF;
           padding-left: 2upx;
           overflow:hidden;
-          text-overflow:ellipsis;
           white-space:nowrap;
-          width:75upx;
+          width:82upx;
         }
         & > .img {
           width: 16upx;
@@ -131,19 +171,19 @@ export default {
       }
     }
   }
-  & .keyboard-body_box {
-		flex: 1;
-  }
   & .input-serach_box {
-	  font-size: 16upx;
-	  line-height: 25upx;
+	  font-size: 15upx;
+	  line-height:30upx;
 	  text-align: center;
-	  height: 25upx;
-    color:#CCCCCC;
+	  height: 30upx;
+    color:#868585;
+    border:1upx solid #868585;
+    width:40vw;
+    margin:0 auto;
   }
   & .input-placeholder {
-		font-size: 18upx!important;
-		color: #CCCCCC!important;
+		font-size: 15upx!important;
+		color: #929292!important;
 	}
 }
 </style>

+ 0 - 1
hdPad/src/pages/home/components/nav.vue

@@ -31,7 +31,6 @@ export default {
         { name: "收银", page: "/pages/home/cash",flag:'casher' },
         { name: "订单", page: "/pages/home/order",flag:'order' },
         { name: "任务", page: "/pages/home/work",flag:'work' },
-        { name: "拆散", page: "/pages/home/make",flag:'selItem' },
         { name: "美团", page: "/pages/home/mt",flag:'mt' },
         { name: "散花", page: "/pages/home/sh",flag:'sh' },
         { name: "现金", page: "/pages/home/xj",flag:'xh' },

+ 1 - 4
hdPad/src/pages/home/components/rightGoods.vue

@@ -36,14 +36,13 @@
     </view>
 </template>
 <script>
-import { getClass } from '@/api/category/index'
 import { getGoodsList } from '@/api/goods/index'
 import productMins from "@/mixins/product";
 import list from "@/mixins/list";
 import selectNumPrice from './selectNumPrice.vue'
 import selectNum from './selectNum.vue'
 export default {
-    name:'rightItem',
+    name:'rightGoods',
     components:{ selectNumPrice,selectNum },
 	mixins: [productMins,list],
     data(){
@@ -104,8 +103,6 @@ export default {
         }
     },
     methods:{
-        itemRefresh(){
-        },
         addToClear(){
             this.$msg('请扫码打开')
         },

+ 18 - 33
hdPad/src/pages/home/components/rightItem.vue

@@ -1,10 +1,10 @@
 <template>
     <view class="shop-listType_box">
         <view class="cat-list-area">
-            <view v-for="item in classData" :key="item.id" :class="[categoryId===item.id?'active':'']" @click="changeCategory(item)" > {{item.name}} </view>
+            <view v-for="item in globalRightItemClass" :key="item.id" :class="[globalRightItemCatId===item.id?'active':'']" @click="changeCategory(item)" > {{item.name}} </view>
         </view>
         <view class="shop-show_box">
-            <view v-for="item in itemInfoList" :key="item.id" class="show-shop_box">
+            <view v-for="item in globalItemInfoList" :key="item.id" class="show-shop_box">
                 <view class="item-detail" @click="popAddModelFn(item)">
                     <image class="img" :src="item.cover" lazy-load="true" :lazy-load-margin="0" mode="scaleToFill" ></image>
                     <view class="shop-info_price">
@@ -29,8 +29,6 @@
     </view>
 </template>
 <script>
-import { showClass } from '@/api/item-class/index'
-import { showList } from '@/api/item/index'
 import productMins from "@/mixins/product";
 import selectNumPrice from './selectNumPrice.vue'
 import selectNum from './selectNum.vue'
@@ -40,10 +38,6 @@ export default {
 	mixins: [productMins],
     data(){
         return {
-            classData:[],
-            categoryId: '',
-            allItemInfo:[],
-            itemInfoList:[],
             currentJobType:'bill',
             currentJobId:0
         }
@@ -63,9 +57,20 @@ export default {
         }
     },
     mounted(){
-        this.init()
+        let id = this.customId>0 ? this.customId : 0
+        if(id>0){
+            this.globalGetRightItem(id)
+        }
     },
     watch:{
+        customId:{
+            handler(id){
+                if(id>0){
+                    this.globalGetRightItem(id)
+                }
+            },
+            immediate:true
+        },
         changeCurrentJobType:{
             handler(str){
                 this.currentJobType = str
@@ -87,30 +92,10 @@ export default {
             this.$util.hitVoice()
 			this.showAddModelFn({ ...info, currentNum: 1, unitPrice: info.price,unitType:0})
 		},
-        async init(){
-            let { data } =  await showClass()
-            this.classData = data
-            this.categoryId = this.classData[0].id
-            let { data:{list} } =  await showList({isCashier:1})
-            this.allItemInfo = list
-            this.showCatItem()
-        },
-        itemRefresh(){
-            showList({isCashier:1}).then(res=>{
-                this.allItemInfo = res.data.list
-                this.showCatItem()
-            })
-        },
-        showCatItem(){
-            this.itemInfoList = this.allItemInfo[this.categoryId]
-        },
-        changeCategory(item){
-            if(item.id === this.categoryId){
-                return false
-            }
-            this.categoryId = item.id
-            this.$util.hitVoice()
-            this.showCatItem()
+        renewMyRightItem(customId){
+            this.globalRightItemCustomId = customId
+            this.globalItemRefresh(customId)
+            this.listenScanItem()
         }
     }
 }