|
|
@@ -1,11 +1,11 @@
|
|
|
<template>
|
|
|
<view class="button-area">
|
|
|
- <view class="active" @click="changeProperty(1)">花材</view>
|
|
|
- <view @click="changeProperty(0)">成品</view>
|
|
|
+ <view class="active" @click="changeProperty">{{property==1 ? '花材' : '成品'}}</view>
|
|
|
<view @click="gosettleCommit">结算 </view>
|
|
|
<view>收款</view>
|
|
|
<view @click="breakage">报损</view>
|
|
|
<view @click="resetCustomer">选客</view>
|
|
|
+ <view @click="calcFn">{{calc == 'add' ? '+' : '-'}}</view>
|
|
|
<view @click="clearItemFn">清空</view>
|
|
|
<view @click="logout">退出</view>
|
|
|
|
|
|
@@ -28,12 +28,6 @@
|
|
|
<toPayWay @cancelPay="cancelPay()" @selectPayWayBack="selectPayWayBack" :orderId.sync="orderId"></toPayWay>
|
|
|
</uni-popup>
|
|
|
|
|
|
- <!-- 开单选花材输入数量和金额 -->
|
|
|
- <uni-popup ref="selectNumPriceRef" background-color="#fff" type="center" :animation="false">
|
|
|
- <selectNum v-if="currentJobType=='make'" @confirmAddItemModel="confirmAddItemModel" :customData.sync="customData" @cancelKdSelectNumPrice="addItemModelHidden"></selectNum>
|
|
|
- <selectNumPrice v-else @confirmAddItemModel="confirmAddItemModel" :customData.sync="customData" @cancelKdSelectNumPrice="addItemModelHidden"></selectNumPrice>
|
|
|
- </uni-popup>
|
|
|
-
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -45,26 +39,53 @@ import { allProduct } from '@/api/product'
|
|
|
export default {
|
|
|
name:'console',
|
|
|
mixins: [productMins],
|
|
|
- components:{ settlePop,toPayWay },
|
|
|
+ components:{ settlePop,toPayWay},
|
|
|
props: {
|
|
|
customId: {
|
|
|
type: Number,
|
|
|
default: 0
|
|
|
- }
|
|
|
+ },
|
|
|
+ changeCurrentJobType:{
|
|
|
+ type:String,
|
|
|
+ default:'bill'
|
|
|
+ },
|
|
|
+ changeCurrentJobId:{
|
|
|
+ type:Number,
|
|
|
+ default:0
|
|
|
+ }
|
|
|
},
|
|
|
data(){
|
|
|
return {
|
|
|
totalShop:{ bigUnit: 0, smallUnit:0, totalPrice: 0 },
|
|
|
orderId:0,
|
|
|
- allProduct:[]
|
|
|
+ allProduct:[],
|
|
|
+ currentJobType:'bill',
|
|
|
+ currentJobId:0,
|
|
|
+ calc:'add',
|
|
|
+ property:1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ changeCurrentJobType:{
|
|
|
+ handler(str){
|
|
|
+ this.currentJobType = str
|
|
|
+ },
|
|
|
+ immediate:true
|
|
|
+ },
|
|
|
+ changeCurrentJobId:{
|
|
|
+ handler(id){
|
|
|
+ this.currentJobId = Number(id)
|
|
|
+ },
|
|
|
+ immediate:true
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
// #ifdef APP-PLUS
|
|
|
//避免重复,每次进来先移除全局自定义事件监听器
|
|
|
- uni.$off('listenGetScanCode')
|
|
|
+ uni.$off('listenGetScanCode')
|
|
|
+ let that = this
|
|
|
uni.$on('listenGetScanCode',function(data){
|
|
|
- console.log(data.code)
|
|
|
+ that.takeItem(data.code)
|
|
|
})
|
|
|
allProduct().then(res=>{
|
|
|
this.allProduct = res.data.list
|
|
|
@@ -73,15 +94,25 @@ export default {
|
|
|
// #endif
|
|
|
},
|
|
|
methods:{
|
|
|
- takeItem(code){
|
|
|
-
|
|
|
+ calcFn(){
|
|
|
+ this.calc = this.calc == 'add' ? 'sub' : 'add'
|
|
|
},
|
|
|
- popAddModelFn(info) {
|
|
|
- this.$util.hitRemind()
|
|
|
- this.showAddModelFn({ ...info, buyNum: 1, unitPrice: info.price,unitType:0})
|
|
|
+ takeItem(code){
|
|
|
+ code = 1001
|
|
|
+ let current = this.allProduct.find(function(val){
|
|
|
+ return val.itemId == code
|
|
|
+ })
|
|
|
+ if(current == undefined){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.$util.hitRemind()
|
|
|
+ let num = this.calc == 'add' ? 1 : -1
|
|
|
+ let params = {...current,unitName:current.bigUnit,unitPrice:current.bigPrice,buyNum:num}
|
|
|
+ this.replaceItemFn(params,1,'',1)
|
|
|
},
|
|
|
- changeProperty(property){
|
|
|
- this.$emit('changeProperty',property)
|
|
|
+ changeProperty(){
|
|
|
+ this.property = this.property == 1 ? 0 : 1
|
|
|
+ this.$emit('changeProperty',this.property)
|
|
|
},
|
|
|
resetCustomer(){
|
|
|
this.$util.hitRemind()
|