Parcourir la source

mod:商品拍摄

panqiuyao il y a 8 mois
Parent
commit
454e9acb5e
1 fichiers modifiés avec 26 ajouts et 2 suppressions
  1. 26 2
      frontend/src/views/Photography/shot.vue

+ 26 - 2
frontend/src/views/Photography/shot.vue

@@ -153,7 +153,7 @@
             />
             <span class="empty-text">暂无数据</span>
           </div>-->
-          <div class="next-step button--primary1 flex-col"><span
+          <div class="next-step button--primary1 flex-col" @click="next"><span
               class="next-step-text">拍摄完毕,进入下一步处理</span></div>
         </div>
 
@@ -171,8 +171,12 @@ import { getFilePath } from '@/utils/appfun'
 
 
 const loading = ref(false)
+const nextLoading = ref(false)
+
+
 const clientStore = client();
 
+const goodsList = ref([])
 const  goods_art_no_tpl = ref('')
 const  goods_art_no = ref('')
 const runAction = ref({
@@ -217,13 +221,13 @@ async function runGoods(data) {
     type: 'run_mcu',
     data,
   })
+  nextLoading.value = true;
   runAction.value = data
   goods_art_no.value = ''
   goods_art_no_tpl.value = ''
 }
 
 
-const goodsList = ref([])
 
 const getTime = function(time){
   if(!time) return null
@@ -253,6 +257,17 @@ const del = async function(params){
 
 }
 
+const  next = async function(){
+  if(nextLoading.value){
+    ElMessage.error('正在拍摄中,请稍候')
+    return;
+  }
+  if(goodsList.length){
+    ElMessage.error('请先拍摄商品。')
+    return;
+  }
+}
+
 
 onMounted(async () => {
   //扫货号
@@ -291,6 +306,12 @@ onMounted(async () => {
   })
 
 
+  clientStore.ipc.on(icpList.socket.message + '_photo_take_finish', (event, result) => {
+    if(result.code === 0) nextLoading.value = false;
+
+  })
+
+
 
 
 
@@ -301,6 +322,9 @@ onBeforeUnmount(() => {
   clientStore.ipc.removeAllListeners(icpList.socket.message + '_blue_tooth_scan');
   clientStore.ipc.removeAllListeners(icpList.socket.message + '_image_process');
   clientStore.ipc.removeAllListeners(icpList.socket.message + '_photo_take');
+  clientStore.ipc.removeAllListeners(icpList.socket.message + '_photo_take_finish');
+
+
 })
 
 </script>