Browse Source

修改扫码

shish 4 years ago
parent
commit
d134501a2b

+ 3 - 1
hdPad/src/mixins/product.js

@@ -19,7 +19,8 @@ export default {
 			checkStock:true,// 考虑库存,盘点不需要考虑库存
 			customData: { currentNum: 0, unitPrice: 0,unitType:0, unitName:'扎',property:1},
 			globalItemList:[],
-			globalAllProduct:[]
+			globalAllProduct:[],
+			calc:'add'
 		};
 	},
 	onLoad(options) {
@@ -242,6 +243,7 @@ export default {
 			if(this.$util.isEmpty(code)){
 				return false
 			}
+			code = String(code)
 			let current = null
 			let unitPrice = 0
 			let unitName = ''

+ 11 - 7
hdPad/src/pages/home/components/workInfo.vue

@@ -27,7 +27,8 @@
     </view>
     <view class="work-item-detail">
 
-      <view class="flex-space right-detail-title">每份用材</view>
+      <view class="flex-space right-detail-title" v-if="getMyShopInfo.stockModel && getMyShopInfo.stockModel == 1">每份用材</view>
+      <view class="flex-space right-detail-title" v-else>使用花材</view>
       
       <view class="unit-use-item">
         <view class="commodity-list">
@@ -48,11 +49,11 @@
         </view>
       </view>
 
-      <view style="height:2vh;background-color:#EEEEEE;"></view>
+      <view style="height:2vh;background-color:#EEEEEE;" v-if="getMyShopInfo.stockModel && getMyShopInfo.stockModel == 1"></view>
 
-      <view class="flex-space right-detail-title"> 总共用材 </view>
+      <view class="flex-space right-detail-title" v-if="getMyShopInfo.stockModel && getMyShopInfo.stockModel == 1"> 总共用材 </view>
       
-      <view class="total-use-item">
+      <view class="total-use-item" v-if="getMyShopInfo.stockModel && getMyShopInfo.stockModel == 1">
         <view class="commodity-list">
           <view v-for="(s, idx) in orderItem" :key="idx" class="commodity-item" >
             <image class="item-icon" :src="s.cover" @click="pageTo({url:'/admin/item/detail',query:{id: s.id}})" />
@@ -72,6 +73,8 @@
           </view>
         </view>
       </view>
+
+
     </view>
 
     <view class="button-area">
@@ -107,9 +110,7 @@
 import { getFullInfo,finish,lockWork,cancelWork,print } from '@/api/work'
 import {modifyWastage} from '@/api/work-item'
 import wastageSelectNum from './wastageSelectNum.vue'
-// #ifdef APP-PLUS
-const plug = uni.requireNativePlugin('Html5app-Gprinter')
-// #endif
+import { mapGetters } from "vuex";
 export default {
 	name: "orderInfo",
 	components: {wastageSelectNum},
@@ -124,6 +125,9 @@ export default {
       today:''
     }
   },
+	computed:{
+		...mapGetters(["getMyShopInfo"]),
+	},
   methods:{
     printFn(item){
       if(item.status ==1){

+ 18 - 2
hdPad/src/pages/home/modify.vue

@@ -1,7 +1,9 @@
 <template>
     <view>
         <view class="app-casher-area">
-            <view class="nav-left"> </view>
+            <view class="nav-left">
+				<navComponent navType="work"></navComponent>
+			</view>
             <!-- 已选花材列表 -->
             <view class="itemList-box">
                 <leftArea :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId"></leftArea>
@@ -32,9 +34,10 @@ import leftArea from './components/leftArea.vue'
 import productMins from "@/mixins/product"
 import { getFullInfo } from '@/api/work'
 import {modifyItem} from '@/api/work-item'
+import navComponent from './components/nav.vue'
 export default {
 	name: "modify",
-	components: { rightItem,leftArea},
+	components: { rightItem,leftArea,navComponent},
 	mixins: [productMins],
 	data() {
 		return {
@@ -48,6 +51,19 @@ export default {
 	computed: {
 		...mapGetters(["getLoginInfo"])
 	},
+	onUnload() {
+		// #ifdef APP-PLUS
+		//避免重复,每次进来先移除全局自定义事件监听器
+		uni.$off('listenGetScanCode')
+		// #endif
+	},
+	onLoad() {
+		// #ifdef APP-PLUS
+		let id = this.option.id || 0
+		this.currentJobId = Number(id)
+		this.listenScanItem()
+		// #endif
+	},
 	methods: {
 		//清空花材弹框
 		clearItemFn(){

+ 12 - 0
hdPad/src/pages/home/work.vue

@@ -39,6 +39,18 @@ export default {
 			this.$refs.workInfoRef.getOrderDetail(this.selectOrderId)
 		}
 	},
+	onUnload() {
+		// #ifdef APP-PLUS
+		//避免重复,每次进来先移除全局自定义事件监听器
+		uni.$off('listenGetScanCode')
+		// #endif
+	},
+	onHide(){
+		// #ifdef APP-PLUS
+		//避免重复,每次进来先移除全局自定义事件监听器
+		uni.$off('listenGetScanCode')
+		// #endif
+	},
 	methods: {
 		getOrder(item){
 			this.selectOrderId = Number(item.id)