|
|
@@ -258,8 +258,8 @@ function saveGoodsArtNo(){
|
|
|
* @param params - 可选参数,用于分页或其他筛选条件。
|
|
|
*/
|
|
|
async function getPhotoRecords(params?:{}) {
|
|
|
- clientStore.ipc.removeAllListeners(icpList.takePhoto.getPhotoRecords);
|
|
|
- loading.true = true;
|
|
|
+ if(loading.value) return;
|
|
|
+ loading.value = true;
|
|
|
clientStore.ipc.send(icpList.takePhoto.getPhotoRecords,{
|
|
|
...params,
|
|
|
page:1,
|
|
|
@@ -267,12 +267,13 @@ async function getPhotoRecords(params?:{}) {
|
|
|
});
|
|
|
clientStore.ipc.on(icpList.takePhoto.getPhotoRecords, (event, result) => {
|
|
|
|
|
|
- loading.true = false;
|
|
|
- clientStore.ipc.removeAllListeners(icpList.takePhoto.getPhotoRecords);
|
|
|
+ loading.value = false;
|
|
|
if(result.code === 0){
|
|
|
|
|
|
- console.log('======================');
|
|
|
- console.log(runAction.value);
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.takePhoto.getPhotoRecords);
|
|
|
+
|
|
|
+ console.log('getPhotoRecords print_time:'+new Date().toLocaleString()) // 打印当前时间
|
|
|
+ console.log('getPhotoRecords print_time:'+JSON.stringify(result.data.list)) // 打印当前时间
|
|
|
goodsList.value = result.data.list
|
|
|
if(isDelGoodsGetList.value){
|
|
|
isDelGoodsGetList.value = false;
|
|
|
@@ -662,23 +663,31 @@ const getLastPhotoRecord = async ()=>{
|
|
|
|
|
|
// 监听拍照完成后的最终状态事件
|
|
|
clientStore.ipc.on(icpList.socket.message + '_run_mcu_update', (event, result) => {
|
|
|
- console.log('_run_mcu_update')
|
|
|
- console.log(result)
|
|
|
- console.log('run_mcu_update:'+new Date().toLocaleString()) // 打印当前时间
|
|
|
+ console.log('run_mcu_updat print_time:'+new Date().toLocaleString()) // 打印当前时间
|
|
|
+ console.log('run_mcu_update print_time:'+JSON.stringify(result))
|
|
|
|
|
|
if(result.code === 0){
|
|
|
- if(lastPhoto.value?.file_path){
|
|
|
+ if(result.data?.file_path){
|
|
|
if( lastPhoto.value?.file_path == result.data?.file_path) return;
|
|
|
|
|
|
if(runAction.value.goods_art_no === result.data?.goods_art_no){
|
|
|
showlastPhoto.value = true
|
|
|
- getPhotoRecords()
|
|
|
+ goodsList.value.map(item=>{
|
|
|
+ if(item.goods_art_no === result.data?.goods_art_no){
|
|
|
+ console.log('========item');
|
|
|
+ console.log(item);
|
|
|
+ item.items[result.data.image_index].image_path = result.data?.file_path
|
|
|
+ console.log(item);
|
|
|
+ console.log( goodsList.value);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // getPhotoRecords()
|
|
|
setTimeout(()=>{
|
|
|
getPhotoRecords()
|
|
|
},2000)
|
|
|
}
|
|
|
+ lastPhoto.value = result.data
|
|
|
}
|
|
|
- lastPhoto.value = result.data
|
|
|
}else if(result.msg) {
|
|
|
ElMessage.error(result.msg)
|
|
|
}
|