fuwei 4 سال پیش
والد
کامیت
446c6229ee
2فایلهای تغییر یافته به همراه26 افزوده شده و 12 حذف شده
  1. 24 10
      ghsPad/src/admin/home/workbench.vue
  2. 2 2
      ghsPad/src/components/app-boardSet-flower.vue

+ 24 - 10
ghsPad/src/admin/home/workbench.vue

@@ -294,7 +294,7 @@ export default {
 					self.shopList = []
 				}
 				}
-			})	
+			})
 		},
 		logout(){
 		let that = this
@@ -326,21 +326,35 @@ export default {
 				}
 				}
 			})
-			
+
 		},
 		selectItemChange(item){
-		    this.selectItem = {
-		        ...item,
-		        currentUnit:item.bigUnit,
-		        currentUnitPrice:item.property==1?item.bigPrice:item.price,
-		        currentNum: 1,
-				unitType: 0
-		    }
+
+					let obj	=	this.shopList.find(i=>i.id===item.id)
+					if(this.$util.isEmpty(obj)) {
+							this.selectItem = {
+							      ...item,
+							      currentUnit:item.bigUnit,
+							      currentUnitPrice:item.property==1?item.bigPrice:item.price,
+							      currentNum: 1,
+													unitType: 0
+							  }
+					}else{
+						this.selectItem = obj
+					}
 		    this.isShowFllowNum = true
 		},
 		enterReturn(item){
 			this.isShowFllowNum = false
-			this.shopList.push(item)
+		 let index =	this.shopList.findIndex(i=>i.id===item.id)
+			console.log(1111,index)
+			console.log(item)
+			if(index >= 0) {
+						this.shopList.splice(index,1,item)
+			}else{
+				this.shopList.push(item)
+			}
+
 		},
 		collectMoneyBack(price){
 			console.log(price)

+ 2 - 2
ghsPad/src/components/app-boardSet-flower.vue

@@ -71,12 +71,12 @@
 		},
 		mounted(){
             this.activeKeyboard()
-            this.focus()
+            // this.focus()
 
 		},
 		methods: {
             focus() {
-                this.$refs.input.focus()
+                // this.$refs.input.focus()
             },
             focusSelect(event){
                 event.currentTarget.select();