shish 4 lat temu
rodzic
commit
a744cd09e7

+ 26 - 2
hdPad/src/pages/home/components/console.vue

@@ -2,7 +2,7 @@
 <view class="button-area">
 	<view class="active" @click="changeProperty">{{property==1 ? '花材' : '成品'}}</view>
 	<view @click="gosettleCommit">结算 </view>
-	<view>收款</view>
+	<view @click="gatheringFn()">收款</view>
     <view @click="breakage">报损</view>
 	<view @click="resetCustomer">选客</view>
 	<view @click="calcFn">{{calc == 'add' ? '+' : '-'}}</view>
@@ -28,6 +28,11 @@
         <toPayWay @cancelPay="cancelPay()" @payFinish="payFinish()" @selectPayWayBack="selectPayWayBack" :orderId.sync="orderId"></toPayWay>
     </uni-popup>
 
+	<!-- 收款 -->
+	<uni-popup ref="gatheringRef" background-color="#fff" type="center" :animation="false">
+		<selectPrice @confirmSelectPrice="confirmSelectPrice" @cancelSelectPrice="cancelSelectPrice"></selectPrice>
+	</uni-popup>
+
 </view>
 </template>
 <script>
@@ -36,10 +41,11 @@ import toPayWay from './toPay.vue'
 import { createCreateOrder, wastageCreateOrder } from '@/api/home/index'
 import productMins from "@/mixins/product"
 import { allProduct } from '@/api/product'
+import selectPrice from './selectPrice.vue'
 export default {
     name:'console',
 	mixins: [productMins],
-    components:{ settlePop,toPayWay},
+    components:{ settlePop,toPayWay,selectPrice},
 	props: {
 		customId: {
 			type: Number,
@@ -83,6 +89,24 @@ export default {
 		this.initData()
 	},
     methods:{
+		cancelSelectPrice(){
+			this.$refs.gatheringRef.close()
+		},
+		confirmSelectPrice(params){
+			uni.showLoading({mask:true})
+			createCreateOrder({orderName:params.name,lsGoodsPrice:params.price,modifyPrice:params.price}).then(res=>{
+				uni.hideLoading()
+				if(res.code == 1){
+					this.$refs.gatheringRef.close()
+					this.orderId = res.data.id
+					this.$refs.toPayRef.open('center')
+				}
+			})
+		},
+		gatheringFn(){
+			this.$util.hitRemind()
+			this.$refs.gatheringRef.open('center')
+		},
 		payFinish(){
 			this.$util.hitRemind()
 			this.$refs.toPayRef.close()

+ 1 - 1
hdPad/src/pages/home/components/selectNum.vue

@@ -34,7 +34,7 @@
 <script>
 import VKeyboard from '@/components/vKeyboard/VKeyboard.vue'
 export default {
-    name:'keyboardSetFlower',
+    name:'selectNum',
     components:{ VKeyboard },
     props:{
         customData:{ type:Object, default:()=>{} }

+ 1 - 1
hdPad/src/pages/home/components/selectNumPrice.vue

@@ -40,7 +40,7 @@
 <script>
 import VKeyboard from '@/components/vKeyboard/VKeyboard.vue'
 export default {
-    name:'keyboardSetFlower',
+    name:'selectNumPrice',
     components:{ VKeyboard },
     props:{
         customData:{ type:Object, default:()=>{} }

+ 165 - 0
hdPad/src/pages/home/components/selectPrice.vue

@@ -0,0 +1,165 @@
+<template>
+    <view class="boardset-flowert">
+        <view class="flower-input_box">
+
+            <view class="flower-open_box">
+                <view @tap="checkCurrent(1)">
+                    <view class="desc">收款金额</view>
+                    <div class="flower-unit_box">
+                        <text :class="{selected:checkType == 1}">{{price}}</text>
+                    </div>
+                </view>
+            </view>
+            <input class="goods-name" v-model="name" placeholder="商品名称(选填)" placeholder-class="grey-color" />
+
+        </view>
+        <view class="keyboard-body_box">
+         <VKeyboard ref="keyboard" :pointIsShow="true" :digital="true" :disorderly="false" @typing="typing" @enter="enter" @cancel="cancel"> </VKeyboard>
+        </view>
+    </view>
+</template>
+<script>
+import VKeyboard from '@/components/vKeyboard/VKeyboard.vue'
+export default {
+    name:'selectPrice',
+    components:{ VKeyboard },
+    data() {
+        return {
+            price:0,
+            //0未全选 1全选
+            checkType:1,
+            name:''
+        };
+    },
+    mounted(){
+        this.activeKeyboard()
+    },
+    methods: {
+        checkCurrent(n){
+            this.checkType = 1
+        },
+        cancel(){
+            this.$util.hitRemind()
+            this.$emit('cancelSelectPrice')
+        },
+        activeKeyboard() {
+            this.$refs.keyboard.activate();
+        },
+        typing(e) {
+            if (e.backspace) {
+                if(this.checkType == 1){
+                    this.price = ''
+                }else{
+                    if (this.price.length > 0) {
+                        this.price = this.price.substring(0, this.price.length - 1)
+                    }
+                }
+            }else {
+                if(this.$util.isEmpty(this.price) || this.checkType == 1) {
+                    this.price = e.char
+                }else {
+                    this.price += e.char;
+                }
+            }
+            this.checkType = 0
+        },
+        enter() {
+            if(Number(this.price)  <= 0) {
+                this.$msg('请填写金额')
+                return
+            }
+            this.$emit('confirmSelectPrice', {price:this.price,name:this.name})
+        }
+    }
+}
+</script>
+<style lang="scss" scoped>
+.grey-color{
+    color:#d1cfcf;
+}
+.boardset-flowert {
+    width:34vw;
+    height: 80vh;
+    background-color: #ffffff;
+    margin: 0 auto;
+    border-radius: 5upx;
+    padding: 10upx;
+    overflow-y: auto;
+    display: flex;
+    flex-direction: column;
+    box-sizing: border-box;
+    & .flower-input_box {
+        flex: 1;
+        & .flower-title {
+            text-align: center;
+            color: #333333;
+            font-size: 14upx;
+        }
+        & .flower-ratio{
+            text-align: center;
+            color: #CCCCCC;
+            font-size: 9upx;
+            margin-bottom:10upx;
+            margin-top:6upx;
+        }
+        & .set-residue_box {
+            font-size: 12upx;
+            color: #CCCCCC;
+            margin-top: 10upx;
+            text-align: left;
+        }
+        .goods-name{
+            border:1upx solid #EEEEEE;
+            width:150upx;
+            margin:20upx auto 0 auto;
+            height:30upx;
+        }
+    }
+    & .flower-open_box {
+        display: flex;
+        align-items: center;
+        margin-top:10upx;
+        justify-content: center;
+        & > view {
+            width:90upx;
+            & .desc {
+                text-align: center;
+                font-size: 13upx;
+                margin-bottom: 5upx;
+                color:#CCCCCC;
+            }
+            & .flower-unit_box {
+                display: flex;
+                font-size:15upx;
+                align-items: center;
+                justify-content:center;
+                border-bottom: 1px solid #eee;
+                & > text{
+                    height:25upx;
+                }
+                .selected{
+                    background:blue;
+                    color:white;
+                }
+            }
+        }
+    }
+    .switch-button{
+        display: flex;
+        justify-content: center;
+        width: 35upx;
+        height: 35upx;
+        position: absolute;
+        top:70upx;
+        left:14vw;
+        .change-unit {
+            width: 35upx;
+            height: 35upx;
+        }
+    }
+    & .keyboard-body_box {
+        flex: 1;
+        overflow: hidden;
+    }
+}
+</style>