|
|
@@ -171,7 +171,8 @@ import { getFilePath } from '@/utils/appfun'
|
|
|
|
|
|
|
|
|
const loading = ref(false)
|
|
|
-const nextLoading = ref(false)
|
|
|
+const runLoading = ref(false)
|
|
|
+const takePictureLoading = ref(false)
|
|
|
|
|
|
|
|
|
const clientStore = client();
|
|
|
@@ -221,7 +222,7 @@ async function runGoods(data) {
|
|
|
type: 'run_mcu',
|
|
|
data,
|
|
|
})
|
|
|
- nextLoading.value = true;
|
|
|
+ runLoading.value = true;
|
|
|
runAction.value = data
|
|
|
goods_art_no.value = ''
|
|
|
goods_art_no_tpl.value = ''
|
|
|
@@ -258,7 +259,7 @@ const del = async function(params){
|
|
|
}
|
|
|
|
|
|
const next = async function(){
|
|
|
- if(nextLoading.value){
|
|
|
+ if(runLoading.value){
|
|
|
ElMessage.error('正在拍摄中,请稍候')
|
|
|
return;
|
|
|
}
|
|
|
@@ -311,7 +312,10 @@ onMounted(async () => {
|
|
|
clientStore.ipc.on(icpList.socket.message + '_photo_take', (event, result) => {
|
|
|
console.log('_photo_take')
|
|
|
console.log(result)
|
|
|
- if(result.status === 2 && result.msg.includes('执行完成')) getPhotoRecords()
|
|
|
+ if(result.status === 2 && result.msg.includes('执行完成')){
|
|
|
+ getPhotoRecords()
|
|
|
+ takePictureLoading.value = false;
|
|
|
+ }
|
|
|
|
|
|
})
|
|
|
|
|
|
@@ -319,7 +323,24 @@ onMounted(async () => {
|
|
|
clientStore.ipc.on(icpList.socket.message + '_photo_take_finish', (event, result) => {
|
|
|
console.log('_photo_take_finish')
|
|
|
console.log(result)
|
|
|
- if(result.code === 0) nextLoading.value = false;
|
|
|
+ if(result.code === 0) runLoading.value = false;
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ clientStore.ipc.on(icpList.socket.message + '_handler_take_picture', async (event, result) => {
|
|
|
+ console.log('_photo_take_finish')
|
|
|
+ console.log(result)
|
|
|
+ if(result.code === 0){
|
|
|
+ if(runLoading.value || takePictureLoading.value){
|
|
|
+ ElMessage.error('拍摄程序正在运行,请稍候')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ await socketStore.connectSocket();
|
|
|
+ socketStore.sendMessage(result.data)
|
|
|
+ takePictureLoading.value = true;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
})
|
|
|
|