Przeglądaj źródła

fix(photography): 优化重拍功能逻辑

- 在重拍操作前增加对 img.image_path 的判断,避免不必要的操作
-保持原有的确认对话框和日志记录功能
- 调整代码结构,提高可读性和维护性
panqiuyao 3 miesięcy temu
rodzic
commit
78c8ff6e54
1 zmienionych plików z 12 dodań i 9 usunięć
  1. 12 9
      frontend/src/views/Photography/shot.vue

+ 12 - 9
frontend/src/views/Photography/shot.vue

@@ -542,15 +542,18 @@ const del = async function(params){
 
 const reTakePicture = async (img)=>{
   if(!img.id) return;
-  try {
-    await ElMessageBox.confirm('此操作会先删除此数据,需要继续吗?', '提示', {
-      confirmButtonText: '确定',
-      cancelButtonText: '取消',
-    })
-    await clickLog({ describe: { action: '点击确认单张重拍', goods_art_no: img.goods_art_no, action_name: img.action_name } }, route)
-  } catch (e) {
-    await clickLog({ describe: { action: '点击取消单张重拍', goods_art_no: img.goods_art_no, action_name: img.action_name } }, route)
-    return
+  if(img.image_path){
+    try {
+        await ElMessageBox.confirm('此操作会先删除此数据,需要继续吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+        })
+      await clickLog({ describe: { action: '点击确认单张重拍', goods_art_no: img.goods_art_no, action_name: img.action_name } }, route)
+    } catch (e) {
+      await clickLog({ describe: { action: '点击取消单张重拍', goods_art_no: img.goods_art_no, action_name: img.action_name } }, route)
+      return
+    }
+
   }
 
   runLoading.value = true;