zck 1 year ago
parent
commit
c0cf73dafb
1 changed files with 17 additions and 2 deletions
  1. 17 2
      src/view/performance/Dayreports.vue

+ 17 - 2
src/view/performance/Dayreports.vue

@@ -396,7 +396,7 @@
 				  
                 <el-col :span="6">
                   <el-form-item label="工单编号:" prop="flatFeed" class="mab">
-                    <el-input v-model="formData.sczl_gdbh" id="工单编号" placeholder="Enter回车" @blur="getCPMCsubmit()" @keydown="ent1($event)" :clearable="true" />
+                    <el-input v-model="formData.sczl_gdbh" id="工单编号" placeholder="Enter回车"  @keydown="ent1($event,'工单编号')" :clearable="true" />
                   </el-form-item>
                 </el-col>
 				
@@ -1581,6 +1581,10 @@ const ent1 = (event,id,id2) => {
   const inputs = document.getElementsByTagName("input");
   const currentIndex = Array.from(inputs).indexOf(event.target);
   // console.log(inputs)
+  if(event.keyCode === 13 && id ==='工单编号'){
+	  //调用印件号选择方法
+    getCPMCsubmit()
+  }
   if(event.keyCode === 13 && id ==='印件号'){
 	  console.log("回车印件号")
 	  //调用印件号选择方法
@@ -2607,12 +2611,23 @@ function onAdd() {
     }
     initFormData();
     dialogFormVisible.value = true;
-
+    setTimeout(() => {
+		const inputElement = document.getElementById('工单编号');
+			if (inputElement) {
+				inputElement.focus();		
+			}
+		}, 100);
   } else {
     // GetInfo(table.value)
     // console.log(['table_type'])
     // console.log('此数据无法新增')
     dialogFormVisible.value = true;
+    setTimeout(() => {
+		const inputElement = document.getElementById('工单编号');
+			if (inputElement) {
+				inputElement.focus();		
+			}
+		}, 100);
   }
   // Productionadd()
 }