Quellcode durchsuchen

开单完成之后更新花材库存

shish vor 4 Jahren
Ursprung
Commit
7c92bc7219

+ 6 - 2
hdPad/src/pages/home/cash.vue

@@ -23,12 +23,12 @@
 				<!-- 分类和花材图片 -->
 				<view class="all-item-area">
 					<rightGoods v-if="currentProperty == 0" :customId.sync="customId" :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId" :changeFlower="changeFlower"> </rightGoods>
-					<rightItem v-else :customId.sync="customId" :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId"> </rightItem>
+					<rightItem v-else ref="rightItemRef" :customId.sync="customId" :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId"> </rightItem>
 				</view>
 				<!-- 按钮操作 -->
 				<view class="open-box">
 					<consoleButton :changeCurrentJobType.sync="currentJobType" :changeCurrentJobId.sync="currentJobId" @resetCustomer="resetCustomer" 
-					:customId.sync="customId" @changeProperty="changeProperty"></consoleButton>
+					:customId.sync="customId" @changeProperty="changeProperty" @rightItemRefresh="rightItemRefresh"></consoleButton>
 				</view>
 			</view>
 		</template>
@@ -94,6 +94,10 @@ export default {
 		}
 	},
 	methods: {
+		//开单完成之后更新花材的库存
+		rightItemRefresh(){
+			this.$refs.rightItemRef.itemRefresh()
+		},
 		changeProperty(property){
 			this.currentProperty = property
 		},

+ 6 - 0
hdPad/src/pages/home/components/console.vue

@@ -127,7 +127,10 @@ export default {
 		payFinish(){
 			this.$util.hitVoice()
 			this.$refs.toPayRef.close()
+			//继续监听花材扫码
 			this.listenScanItem()
+			//开单完成之后更新花材库存
+			this.$emit('rightItemRefresh')
 		},
 		calcFn(){
 			this.calc = this.calc == 'add' ? 'sub' : 'add'
@@ -153,6 +156,9 @@ export default {
 					if(res.data.status == 1){
 						this.orderId = res.data.id
 						this.$refs.toPayRef.open('center')
+					}else{
+						//开单完成之后更新花材库存
+						this.$emit('rightItemRefresh')
 					}
 					this.settleOpenStatus = 0
 					this.$refs.settlePopRef.close()

+ 6 - 0
hdPad/src/pages/home/components/rightItem.vue

@@ -98,6 +98,12 @@ export default {
             this.allItemInfo = list
             this.showCatItem()
         },
+        itemRefresh(){
+            showList().then(res=>{
+                this.allItemInfo = res.data.list
+                this.showCatItem()
+            })
+        },
         showCatItem(){
             this.itemInfoList = this.allItemInfo[this.categoryId]
         },