|
|
@@ -1,7 +1,8 @@
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
import { copyObject } from "@/utils/util";
|
|
|
import { getBySn } from '@/api/goods'
|
|
|
-import { allProduct } from '@/api/product'
|
|
|
+import { showClass } from '@/api/item-class/index'
|
|
|
+import { showList } from '@/api/item/index'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -22,7 +23,12 @@ export default {
|
|
|
customData: { currentNum: 0, unitPrice: 0,unitType:0, unitName:'扎',property:1},
|
|
|
globalItemList:[],
|
|
|
globalAllProduct:[],
|
|
|
- calc:'add'
|
|
|
+ calc:'add',
|
|
|
+ globalRightItemCustomId:0,
|
|
|
+ globalRightItemClass:[],
|
|
|
+ globalRightItemCategoryId: '',
|
|
|
+ globalRightAllItemInfo:[],
|
|
|
+ globalRightItemInfloList:[],
|
|
|
};
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
@@ -316,6 +322,8 @@ export default {
|
|
|
this.$refs.selectNumPriceRef.open('center')
|
|
|
}
|
|
|
}else{
|
|
|
+ console.log('---000---')
|
|
|
+ console.log(this.globalAllProduct)
|
|
|
//花材
|
|
|
current = this.globalAllProduct.find(function(val){
|
|
|
return Number(val.itemId) == Number(code)
|
|
|
@@ -349,17 +357,34 @@ export default {
|
|
|
uni.$on('listenGetScanCode',function(data){
|
|
|
that.takeItem(data.code)
|
|
|
})
|
|
|
- if(this.getMyShopInfo && this.getMyShopInfo.scan == 1){
|
|
|
- this.getAllProduct()
|
|
|
- }
|
|
|
},
|
|
|
- getAllProduct(){
|
|
|
- allProduct().then(res=>{
|
|
|
- if(res.code == 1){
|
|
|
- this.globalAllProduct = res.data.list
|
|
|
- //console.log('载入最新花材...')
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ async getRightItemData(id){
|
|
|
+ let { data } = await showClass()
|
|
|
+ this.globalRightItemClass = data
|
|
|
+ this.globalRightItemCategoryId = this.globalRightItemClass[0].id
|
|
|
+ this.globalRightItemCustomId = id
|
|
|
+ let { data:{list,productList} } = await showList({isCashier:1,customId:this.globalRightItemCustomId})
|
|
|
+ this.globalRightAllItemInfo = list
|
|
|
+ this.globalAllProduct = productList
|
|
|
+ this.globalShowCatItem()
|
|
|
+ },
|
|
|
+ itemRefresh(){
|
|
|
+ showList({isCashier:1,customId:this.globalRightItemCustomId}).then(res=>{
|
|
|
+ this.globalRightAllItemInfo = res.data.list
|
|
|
+ this.globalAllProduct = res.data.productList
|
|
|
+ this.globalShowCatItem()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ globalShowCatItem(){
|
|
|
+ this.globalRightItemInfloList = this.globalRightAllItemInfo[this.globalRightItemCategoryId]
|
|
|
+ },
|
|
|
+ globalChangeCategory(item){
|
|
|
+ if(item.id === this.globalRightItemCategoryId){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.globalRightItemCategoryId = item.id
|
|
|
+ this.$util.hitVoice()
|
|
|
+ this.globalShowCatItem()
|
|
|
+ }
|
|
|
}
|
|
|
}
|