浏览代码

投料功能优化221227

liuhairui 3 年之前
父节点
当前提交
3b5d0d01e7
共有 1 个文件被更改,包括 11 次插入11 次删除
  1. 11 11
      public/assets/js/backend/feeding.js

+ 11 - 11
public/assets/js/backend/feeding.js

@@ -296,14 +296,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','jQuery.print','jquery
                                                                                 var the_bach = document.getElementsByClassName('bach')[i];
                                                                                 if(the_bach.readOnly == false){
                                                                                     the_bach.value = bach;
+                                                                                    $(".number")[i].focus();
+                                                                                    //语音播报
+                                                                                    var msg = new SpeechSynthesisUtterance("应投入物料"+result.data[i].material+"应投入重量"+result.data[i].nweight+"千克");
+                                                                                    window.speechSynthesis.speak(msg);
+                                                                                    error++;
                                                                                 }
-                                                                                // var the_bach = document.getElementsByClassName('bach')[i];
-                                                                                // the_bach.value = bach;
-                                                                                $(".number")[i].focus();
-                                                                                //语音播报
-                                                                                var msg = new SpeechSynthesisUtterance("应投入物料"+result.data[i].material+"应投入重量"+result.data[i].nweight+"千克");
-                                                                                window.speechSynthesis.speak(msg);
-                                                                                error++;
+
                                                                             }else if (result.data[i].gy_num > result.process){
                                                                                 Layer.confirm("此物料不在当前工序,请确认!",{
                                                                                     area: ['60%', '60%'],
@@ -410,11 +409,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','jQuery.print','jquery
                                                                             var the_bach = document.getElementsByClassName('bach')[i];
                                                                             if(the_bach.readOnly == false){
                                                                                 the_bach.value = bach;
+                                                                                $(".number")[i].focus();
+                                                                                var msg = new SpeechSynthesisUtterance("应投入物料"+result.data[i].material+"应投入重量"+result.data[i].nweight+"千克");
+                                                                                window.speechSynthesis.speak(msg);
+                                                                                error++;
                                                                             }
-                                                                            $(".number")[i].focus();
-                                                                            var msg = new SpeechSynthesisUtterance("应投入物料"+result.data[i].material+"应投入重量"+result.data[i].nweight+"千克");
-                                                                            window.speechSynthesis.speak(msg);
-                                                                            error++;
+
                                                                         } else if (arr.indexOf($("#wuliao").val()) !== -1) {
                                                                             Layer.confirm("此物料不在当前工序,请确认!", {
                                                                                 area: ['60%', '60%'],