shish 4 лет назад
Родитель
Сommit
aea36c44e1

+ 85 - 0
ghsPad/src/admin/home/components/rightItem.vue

@@ -0,0 +1,85 @@
+<template>
+<view class="item-detail" @click="showAddModelFn(item)">
+    <image class="img" :src="item.cover" mode="scaleToFill" ></image>
+    <view class="shop-info_price">
+        <view>
+            <view>{{item.name}}</view>
+            <view>¥{{parseFloat(item.price)}}</view>
+        </view>
+    </view>
+</view>
+</template>
+<script>
+export default {
+    name:'rightItem',
+    components:{  },
+	props: {
+		info: {
+			required: true,
+			type: Object,
+			default() {
+				return {};
+			}
+		}
+    },
+    data(){
+        return {
+			bigCount:0,
+			smallCount:0,
+			userPrice:0
+        }
+    },
+    created(){
+
+    },
+	watch:{
+		info:{
+			handler(){
+				this.bigCount = this.info.bigCount
+				this.smallCount = this.info.smallCount
+				this.userPrice = this.info.userPrice
+			},
+			deep:true
+		}
+	},
+    methods:{
+		showAddModelFn() {
+			this.$emit("showAddModelFn", { ...this.info, bigCount: this.bigCount, smallCount: this.smallCount, userPrice: this.userPrice})
+		}
+    }
+}
+</script>
+<style lang="scss" scoped>
+.item-detail{
+    position: relative;
+    margin-right: 9upx;
+    margin-bottom: 6upx;
+    width: 82upx;
+    height: 82upx;
+    & .img {
+        width: 82upx;
+        height: 82upx;
+    }
+    .shop-info_price {
+        position: absolute;
+        background-color: rgba(0, 0, 0, 0.5);
+        bottom: 0;
+        width: 100%;
+        font-size: 12upx;
+        color: #ffffff;
+        height:25upx;
+        & > view {
+            font-size: 10upx;
+            & > view:nth-child(1) {
+                overflow: hidden;
+                text-overflow:ellipsis;
+                white-space: nowrap;
+                width:90%;
+            }
+            & > view:nth-child(2) {
+                font-size:8upx;
+            }
+        }
+    }
+}
+</style>

+ 17 - 58
ghsPad/src/admin/home/components/rightItemArea.vue

@@ -1,17 +1,11 @@
 <template>
     <view class="shop-listType_box">
         <view class="shop-type_box">
-            <view v-for="item in shopListType" :key="item.id" :class="[selectTypeId===item.id?'active':'']" @click="changeType(item)" > {{item.name}} </view>
+            <view v-for="item in shopListType" :key="item.id" :class="[categoryId===item.id?'active':'']" @click="changeType(item)" > {{item.name}} </view>
         </view>
         <view class="shop-show_box">
-            <view @click="kdSelectItem(item)" v-for="item in currenTypeShopList" :key="item.id" class="show-shop_box">
-                <image class="img" :src="item.cover" mode="scaleToFill" ></image>
-                <view class="shop-info_price">
-                    <view>
-                        <view>{{item.name}}</view>
-                        <view>¥{{parseFloat(item.price)}}</view>
-                    </view>
-                </view>
+            <view v-for="item in currenTypeShopList" :key="item.id" class="show-shop_box">
+                <rightItemComponent :info="item"></rightItemComponent>
             </view>
         </view>
         <slot name="footer"></slot>
@@ -19,14 +13,15 @@
 </template>
 <script>
 import settlePop from './settle-pop.vue'
+import rightItemComponent from './rightItem.vue'
 import { showClass,showList } from '@/api/home/index'
 export default {
     name:'rightItemArea',
-    components:{ settlePop },
+    components:{ settlePop,rightItemComponent },
     data(){
         return {
             shopListType:[],
-            selectTypeId: '',
+            categoryId: '',
             arrShop:[],
             currenTypeShopList:[],
             isShowSettle: false,
@@ -37,19 +32,17 @@ export default {
         this.init()
     },
     watch:{
-            selectItem(){
-                console.log(3333,this.selectItem)
-            }
+
     },
     methods:{
+		showAddModelFn(item) {
+			this.$emit("showAddModelFn", { ...item, bigCount: 1, smallCount: '', userPrice: item.price})
+		},
         async init(){
-            try {
-                let { data } =  await showClass()
-                this.shopListType = data
-                this.selectTypeId = this.shopListType[0].id
-                this.getShowList()
-            }catch(err){
-            }
+            let { data } =  await showClass()
+            this.shopListType = data
+            this.categoryId = this.shopListType[0].id
+            this.getShowList()
         },
         async getShowList(){
             try {
@@ -60,18 +53,15 @@ export default {
             }
         },
         updateCurrentShop(){
-            this.currenTypeShopList = this.arrShop[this.selectTypeId]
+            this.currenTypeShopList = this.arrShop[this.categoryId]
         },
         changeType(item){
-            if(item.id === this.selectTypeId){
+            if(item.id === this.categoryId){
                 return false
             }
-            this.selectTypeId = item.id
+            this.categoryId = item.id
             this.updateCurrentShop()
         },
-        kdSelectItem(item){
-            this.$emit('kdSelectItem',item)
-        },
         settle(){
             this.isShowSettle = true
         }
@@ -110,37 +100,6 @@ export default {
         flex-wrap: wrap;
         overflow-y: scroll;
         overflow-x: hidden;
-        & .show-shop_box {
-            position: relative;
-            width: 18%;
-            margin-right: 8upx;
-            margin-bottom: 6upx;
-            height: 70upx;
-            & .img {
-                height: 100%;
-            }
-            .shop-info_price {
-                position: absolute;
-                background-color: rgba(0, 0, 0, 0.5);
-                bottom: 0;
-                width: 100%;
-                font-size: 12upx;
-                color: #ffffff;
-                height:25upx;
-                & > view {
-                    font-size: 10upx;
-                    & > view:nth-child(1) {
-                        overflow: hidden;
-                        text-overflow:ellipsis;
-                        white-space: nowrap;
-                        width:90%;
-                    }
-                    & > view:nth-child(2) {
-                        font-size:8upx;
-                    }
-                }
-            }
-        }
     }
     & .shop-footer_box {
         height: 40upx;

+ 10 - 12
ghsPad/src/admin/home/components/select-user.vue

@@ -23,9 +23,7 @@ import VKeyboard from "@/components/plugin/vKeyboard/VKeyboard.vue";
 import { customList } from '@/api/home/index'
 export default {
   name: "selectUser",
-  components: {
-    VKeyboard,
-  },
+  components: { VKeyboard, },
   data() {
     return {
 		searchUser: '',
@@ -33,7 +31,7 @@ export default {
 	};
   },
   mounted() {
-	this.init()
+	  this.init()
     this.activeKeyboard();
   },
   methods: {
@@ -47,7 +45,6 @@ export default {
       let { data:{list} } = await customList({ name: this.searchUser })
       this.list = list
     },
-    //键盘方法
     activeKeyboard() {
       this.$refs.keyboard.activate()
     },
@@ -88,9 +85,9 @@ export default {
     overflow-y: scroll;
     & .userList-item_box {
       margin: 0 5upx 5upx 0;
-      width: 90upx;
-      height: 55upx;
-      border: 1px solid #333;
+      width: 80upx;
+      height: 60upx;
+      border: 1px solid #cccccc;
       padding: 3upx;
       border-radius: 3upx;
       display: flex;
@@ -100,13 +97,14 @@ export default {
         display: flex;
         font-size: 12upx;
         align-items: center;
-        margin-bottom: 10upxs;
+        margin-bottom: 15upxs;
         & .name {
-          padding-left: 5upx;
+          color:#666666;
+          padding-left: 2upx;
         }
         & > .img {
-          width: 20upx;
-          height: 20upx;
+          width: 16upx;
+          height: 16upx;
           border-radius: 50%;
         }
       }

+ 5 - 29
ghsPad/src/admin/home/workbench.vue

@@ -40,11 +40,11 @@
 				<view @click="clearItemFn"> 清空花材 </view>
 				<view>临时商品</view>
 				<view @click="breakage"> 报损 </view>
-				<view @click="settle"> 结算 </view>
+				<view @click="settle">结算 </view>
 			</view>
 			<!-- 分类和花材展示区 -->
-			<view class="item-show-list">
-				<rightItemArea @kdSelectItem="kdSelectItem"> </rightItemArea>
+			<view class="all-item-area">
+				<rightItemArea @showAddModelFn="showAddModelFn"> </rightItemArea>
 			</view>
 			<!-- 选客户 isShowUser -->
 			<uni-popup ref="selectUserRef" background-color="#fff" type="center" :animation="false">
@@ -52,7 +52,7 @@
 			</uni-popup>
 			<!-- 开单选花材输入数量和金额 -->
 			<uni-popup ref="kdSelectNumPriceRef" background-color="#fff" type="center" :animation="false">
-				<kdSelectNumPrice @enterNum="enterReturn" :selectItem.sync="selectItem"></kdSelectNumPrice>
+				<kdSelectNumPrice @enterNum="confirmAddItemModel" :selectItem.sync="selectItem" @cancelKdSelectNumPrice="addItemModelHidden"></kdSelectNumPrice>
 			</uni-popup>
 			<!-- 结算弹框 isShowSettle -->
 			<uni-popup ref="settlePopRef" background-color="#fff" type="center" :animation="false">
@@ -236,30 +236,6 @@ export default {
 		},
 		delSelectItem(){
 
-		},
-		kdSelectItem(item){
-			let obj	=	this.itemList.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.$refs.kdSelectNumPriceRef.open('center')
-		},
-		enterReturn(item){
-			this.$refs.kdSelectNumPriceRef.close()
-		 	let index =	this.itemList.findIndex(i=>i.id===item.id)
-			if(index >= 0) {
-				this.itemList.splice(index,1,item)
-			}else{
-				this.itemList.push(item)
-			}
 		},
 		selectPayWayBack(price){
 			console.log(price)
@@ -271,7 +247,7 @@ export default {
 .app-workbench_box {
 	display: flex;
 	height: 100vh;
-	& .item-show-list {
+	& .all-item-area {
 		flex: 63;
 		height: 100%;
 		& .show-footer_box {

+ 18 - 24
ghsPad/src/components/app-kd-select-num-price.vue

@@ -4,16 +4,15 @@
             <view class="flower-title">{{selectItem.name}}</view>
             <view class="flower-open_box">
                 <view>
-                    <view class="desc">数</view>
+                    <view class="desc">{{selectItem.currentUnit}}数</view>
                     <div class="flower-unit_box">
-                        <input ref="input" disabled @tap="changeType('currentNum')" :key="selectItem.currentNum" @focus="focusSelect($event)" type="text" v-model="selectItem.currentNum">
-                        <span>{{selectItem.currentUnit}}</span>
+                        <text>121</text>
                     </div>
                 </view>
                 <view>
                     <view class="desc">单价</view>
                     <div class="flower-unit_box">
-                        <input @tap="changeType('currentUnitPrice')" disabled type="text" v-model="selectItem.currentUnitPrice">
+                        <text>121</text>
                     </div>
                 </view>
             </view>
@@ -23,7 +22,7 @@
             </view>
         </view>
         <view class="keyboard-body_box">
-         <VKeyboard ref="keyboard" :pointIsShow="true" :digital="true" :disorderly="false" @typing="typing" @enter="enter"> </VKeyboard>
+         <VKeyboard ref="keyboard" :pointIsShow="true" :digital="true" :disorderly="false" @typing="typing" @enter="enter" @cancel="cancel"> </VKeyboard>
         </view>
     </view>
 </template>
@@ -31,14 +30,9 @@
 import VKeyboard from '@/components/plugin/vKeyboard/VKeyboard.vue'
 export default {
     name:'keyboardSetFlower',
-    components:{
-        VKeyboard
-    },
+    components:{ VKeyboard },
     props:{
-        selectItem:{
-            type:Object,
-            default:()=>{}
-        }
+        selectItem:{ type:Object, default:()=>{} }
     },
     data() {
         return {
@@ -50,6 +44,9 @@ export default {
         this.activeKeyboard()
     },
     methods: {
+        cancel(){
+            this.$emit('cancelKdSelectNumPrice')
+        },
         focus() {
         },
         focusSelect(event){
@@ -58,7 +55,6 @@ export default {
         changeType(type){
             this.enterType = type
         },
-        //键盘方法
         activeKeyboard() {
             this.$refs.keyboard.activate();
         },
@@ -89,20 +85,19 @@ export default {
             this.selectItem.currentUnitPrice = this.selectItem.unitType ===0?this.selectItem.bigPrice:this.selectItem.smallPrice
             this.$emit('update:selectItem', this.selectItem)
         }
-        //键盘方法end
     }
 }
 </script>
 <style lang="scss" scoped>
 .boardset-flowert {
-    width:75vh;
+    width:32vw;
+    height: 80vh;
     background-color: #ffffff;
     margin: 0 auto;
     border-radius: 5upx;
     padding: 10upx;
     overflow-y: auto;
     display: flex;
-    height: 90vh;
     flex-direction: column;
     box-sizing: border-box;
     & .flower-input_box {
@@ -113,7 +108,7 @@ export default {
             font-size: 14upx;
         }
         & .set-residue_box {
-            font-size: 14upx;
+            font-size: 12upx;
             color: #CCCCCC;
             margin-top: 10upx;
             text-align: left;
@@ -128,19 +123,18 @@ export default {
             & .desc {
                 text-align: center;
                 font-size: 12upx;
-                margin-bottom: 8upx;
+                margin-bottom: 5upx;
                 color:#CCCCCC;
             }
             & .flower-unit_box {
                 display: flex;
                 font-size:15upx;
                 align-items: center;
-                & > input {
-                    flex: 1;
-                    text-align:center;
-                    height: 40upx;
-                    font-size: 20upx;
-                    border-bottom: 1px solid #eee;
+                justify-content:center;
+                border-bottom: 1px solid #eee;
+                .selected{
+                    background:blue;
+                    color:white;
                 }
             }
         }

+ 22 - 6
ghsPad/src/components/plugin/vKeyboard/VKeyboard.vue

@@ -15,8 +15,8 @@
 			</view>
 			<view class="special-button-box">
 				<view class="enl-key-button special-button enl-gray" @tap="backspace"><i class="iconfont icon-backspace enl-large"></i></view>
-				<view class="enl-key-button special-button enl-gray" @tap="cancel"> <text style="color:#666666;font-size:15upx;">取消</text> </view>
-				<view class="enl-key-button special-button enl-gray" @tap="enter"> <text style="color:green;font-size:15upx;">确定</text> </view>
+				<view class="enl-key-button special-button enl-gray" @tap="cancel"> <text>取消</text> </view>
+				<view class="enl-key-button special-button enl-gray" @tap="enter"> <text>确认</text> </view>
 			</view>
 		</view>
 		<view class="full-keyboard" v-else>
@@ -35,8 +35,8 @@
 				</view>
 				<view class="enl-letter enl-key-button space" @tap="typing(' ')"><text class="enl-logo"> </text></view>
 				<view class="enl-letter enl-key-button swith-key enl-gray" @tap="typingDigit"><i class="iconfont icon-shuzi"></i></view>
-				<view class="enl-letter enl-key-button swith-key enl-gray" @tap="enter"><text style="color:#666666;font-size:15upx;">清</text></view>
-				<view class="enl-letter enl-key-button swith-key enl-gray" @tap="cancel"><text style="color:#666666;font-size:15upx;">取消</text></view>
+				<view class="enl-letter enl-key-button swith-key enl-gray" @tap="enter"><text style="color:#666666;font-size:13upx;">清除</text></view>
+				<view class="enl-letter enl-key-button swith-key enl-gray" @tap="cancel"><text style="color:#666666;font-size:13upx;">取消</text></view>
 			</view>
 		</view>
 	</view>
@@ -316,8 +316,6 @@ export default {
 			flex: 20;
 			padding: 0 3% 0 0;
 			.special-button {
-				line-height: 20%;
-				height: 32%;
 				width: 100%;
 				display: flex;
 				align-items: center;
@@ -326,6 +324,24 @@ export default {
 					margin-bottom: 3%;
 				}
 			}
+			& > view:nth-child(1){
+				line-height: 26%;
+				height: 26%;
+				font-size:10upx;
+				color:#666666;
+			}
+			& > view:nth-child(2){
+				line-height: 26%;
+				height: 26%;
+				font-size:12upx;
+				color:#666666;
+			}
+			& > view:nth-child(3){
+				line-height: 45%;
+				height: 45%;
+				color:green;
+				font-size:15upx;
+			}
 		}
 	}
 

+ 4 - 5
ghsPad/src/mixins/product.js

@@ -396,14 +396,14 @@ export default {
 		},
 		//显示可以修改花材的弹框
 		showAddModelFn(info) {
-			if(info.bigNum <= 0 && info.smallNum <= 0){
+			if(Number(info.stock) <= 0){
 				if(this.checkStock){
 					this.$util.noStockRemind()
-					this.$msg('库存不足哦..')
+					this.$msg('库存不足')
 					return false
 				}
 			}
-			this.isAddModel = true;
+			this.$refs.kdSelectNumPriceRef.open('center')
 			this.customData = copyObject(info)
 			this.isAddInputFocus = false;
 			this.$nextTick(()=>{
@@ -416,7 +416,6 @@ export default {
 				}else{
 					this.customData.userPrice = this.customData.userPrice==0?null:this.customData.userPrice;
 				}
-				this.isAddInputFocus = true;
 			})
 		},
 		confirmAddItemModel(val) {
@@ -459,7 +458,7 @@ export default {
 			this.addItemModelHidden()			
 		},
 		addItemModelHidden() {
-			this.isAddModel = false;
+			this.$refs.kdSelectNumPriceRef.close()
 			this.customData = {};
 		},
 		itemNumPriceRefresh(){