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

+ 0 - 17
ghsApp/src/admin/billing/affirm.vue

@@ -193,7 +193,6 @@ import { createOrder, updateOrder } from "@/api/order/index";
 import { getAllStaff } from "@/api/shop-admin"
 import { mapActions, mapGetters } from "vuex";
 import { getUserDet} from "@/api/member"
-import { allProduct } from '@/api/product'
 import ModalModule from "@/components/plugin/modal"
 export default {
   name: "BillingAffirm",
@@ -331,22 +330,6 @@ export default {
     ...mapActions(["initMerchantInfo"]),
     changeGet(){
       this.calc = this.calc == 'add' ? 'sub' : 'add'
-    },
-    listenScanItem(){
-			// #ifdef APP-PLUS
-			//避免重复,每次进来先移除全局自定义事件监听器
-			uni.$off('listenGetScanCode')
-			let that = this
-			uni.$on('listenGetScanCode',function(data){
-				that.takeItem(data.code)
-			})
-			allProduct().then(res=>{
-				if(res.code == 1){
-					that.globalAllProduct = res.data.list
-					console.log('载入最新花材...')
-				}
-			})
-			// #endif
     },
 		reduceItemFn(item) {
       this.kdType = 'HIT';

+ 25 - 19
ghsApp/src/admin/breakage/confirm.vue

@@ -6,26 +6,28 @@
         <view class="module-com">
           <view class="commodity-view">
             <view class="commodity-list">
-              <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
-                <image class="item-icon" :src="item.cover" alt="商品图" />
-                <view class="item-info">
-                  <view class="info-line">
-                    <text class="item-name">{{ item.itemName }}</text>
-                    <text class="item-price">
-                      <text class="unit"></text>
-                      <text class="price">
-                        <text v-if="item.bigCount > 0">{{`${item.bigCount}`}}扎</text>
-                        <text v-if="item.smallCount > 0">{{`${item.smallCount}`}}支</text>
+              <template v-if="!$util.isEmpty(selectList)">
+                <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
+                  <image class="item-icon" :src="item.cover" />
+                  <view class="item-info">
+                    <view class="info-line">
+                      <text class="item-name">{{ item.itemName }}</text>
+                      <text class="item-price">
+                        <text class="unit"></text>
+                        <text class="price">
+                          <text v-if="item.bigCount > 0">{{`${item.bigCount}`}}扎</text>
+                          <text v-if="item.smallCount > 0">{{`${item.smallCount}`}}支</text>
+                        </text>
                       </text>
-                    </text>
-                  </view>
-                  <view class="info-line">
-                    <text class="item-type"></text>
-                    <text class="item-count">
-                    </text>
+                    </view>
+                    <view class="info-line">
+                      <text class="item-type"></text>
+                      <text class="item-count">
+                      </text>
+                    </view>
                   </view>
                 </view>
-              </view>
+              </template>
             </view>
             <view class="summary-bar">
               <view class="operate-view" @click="gobackEvent">
@@ -33,7 +35,7 @@
                 重选花材
               </view>
               <view class="describe-view">
-                共{{ selectList.length }}种</text>
+                共{{ selectList.length }}种
               </view>
             </view>
           </view>
@@ -135,6 +137,9 @@ export default {
     if(option.customName){
       this.form.customName = option.customName
     }
+
+    this.listenScanItem()
+
   },
 	onShow(){
 		if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
@@ -142,7 +147,8 @@ export default {
 		}
 	},
 	onUnload(){
-			uni.removeStorageSync('newClient');
+			uni.removeStorageSync('newClient')
+      uni.$off('listenGetScanCode')
 	},
   computed: {
     ...mapGetters(["getMerchantInfo", "getLoginInfo"]),

+ 5 - 1
ghsApp/src/admin/breakage/list.vue

@@ -59,7 +59,11 @@ export default {
   },
   methods: {
     selectProduct(){
-      this.$util.pageTo({url: '/admin/breakage/index',type:2})
+      if(this.$util.isScanEnv()){
+        this.$util.pageTo({url: '/admin/breakage/confirm',type:2})
+      }else{
+        this.$util.pageTo({url: '/admin/breakage/index',type:2})
+      }
     },
     _list(type, timeArr) {
       return wastageList({

+ 18 - 1
ghsApp/src/mixins/product.js

@@ -1,6 +1,7 @@
 import { getProductDataApi } from "@/api/product/index";
 import { mapGetters, mapActions } from "vuex";
-import { copyObject } from "@/utils/util";
+import { copyObject } from "@/utils/util"
+import { allProduct } from '@/api/product'
 export default {
 	data() {
 		return {
@@ -438,6 +439,22 @@ export default {
 
 
 		},
+		listenScanItem(){
+			// #ifdef APP-PLUS
+			//避免重复,每次进来先移除全局自定义事件监听器
+			uni.$off('listenGetScanCode')
+			let that = this
+			uni.$on('listenGetScanCode',function(data){
+				that.takeItem(data.code)
+			})
+			allProduct().then(res=>{
+				if(res.code == 1){
+					that.globalAllProduct = res.data.list
+					console.log('载入最新花材...')
+				}
+			})
+			// #endif
+    	},
 		takeItem(code){
 			if(this.$util.isEmpty(code)){
 				return false