|
@@ -47,6 +47,7 @@ import { createOrder} from '@/api/order'
|
|
|
import {goodsWastage} from '@/api/wastage'
|
|
import {goodsWastage} from '@/api/wastage'
|
|
|
import productMins from "@/mixins/product"
|
|
import productMins from "@/mixins/product"
|
|
|
import { allProduct } from '@/api/product'
|
|
import { allProduct } from '@/api/product'
|
|
|
|
|
+import { getBySn } from '@/api/goods'
|
|
|
import selectPrice from './selectPrice.vue'
|
|
import selectPrice from './selectPrice.vue'
|
|
|
export default {
|
|
export default {
|
|
|
name:'console',
|
|
name:'console',
|
|
@@ -135,16 +136,39 @@ export default {
|
|
|
calcFn(){
|
|
calcFn(){
|
|
|
this.calc = this.calc == 'add' ? 'sub' : 'add'
|
|
this.calc = this.calc == 'add' ? 'sub' : 'add'
|
|
|
},
|
|
},
|
|
|
- takeItem(code){
|
|
|
|
|
- let current = this.allProduct.find(function(val){
|
|
|
|
|
- return val.itemId == code
|
|
|
|
|
- })
|
|
|
|
|
- if(current == undefined){
|
|
|
|
|
|
|
+ async takeItem(code){
|
|
|
|
|
+ if(this.$util.isEmpty(code)){
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ let current = null
|
|
|
|
|
+ let unitPrice = 0
|
|
|
|
|
+ let unitName = ''
|
|
|
|
|
+ if(code.indexOf('1-') == 0){
|
|
|
|
|
+ //成品
|
|
|
|
|
+ const res = await getBySn({sn:code})
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ current = res.data
|
|
|
|
|
+ unitName = '份'
|
|
|
|
|
+ unitPrice = Number(res.data.price)
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //花材
|
|
|
|
|
+ current = this.allProduct.find(function(val){
|
|
|
|
|
+ return val.itemId == code
|
|
|
|
|
+ })
|
|
|
|
|
+ if(current == undefined){
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ unitName = current.bigUnit
|
|
|
|
|
+ unitPrice = current.bigPrice
|
|
|
|
|
+ }
|
|
|
|
|
+ if(this.$util.isEmpty(current)){
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
this.$util.hitRemind()
|
|
this.$util.hitRemind()
|
|
|
let num = this.calc == 'add' ? 1 : -1
|
|
let num = this.calc == 'add' ? 1 : -1
|
|
|
- let params = {...current,unitName:current.bigUnit,unitPrice:current.bigPrice,currentNum:num}
|
|
|
|
|
|
|
+ let params = {...current,unitName:unitName,unitPrice:unitPrice,currentNum:num}
|
|
|
|
|
+ console.log(params)
|
|
|
this.replaceItemFn(params,1)
|
|
this.replaceItemFn(params,1)
|
|
|
},
|
|
},
|
|
|
changeProperty(){
|
|
changeProperty(){
|
|
@@ -189,7 +213,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
selectPayWayBack(price){
|
|
selectPayWayBack(price){
|
|
|
this.$util.hitRemind()
|
|
this.$util.hitRemind()
|
|
|
- console.log(price)
|
|
|
|
|
},
|
|
},
|
|
|
toWastage(){
|
|
toWastage(){
|
|
|
this.$util.hitRemind()
|
|
this.$util.hitRemind()
|