liuhairui 1 anno fa
parent
commit
ab408c2a03
2 ha cambiato i file con 118 aggiunte e 12 eliminazioni
  1. 117 12
      src/view/performance/Dayreports.vue
  2. 1 0
      src/view/performance/chejianbaogong.vue

+ 117 - 12
src/view/performance/Dayreports.vue

@@ -1158,6 +1158,21 @@
               <el-table-column prop="sczl_bzdh" label="班组" width="150" />
             </el-table>
           </el-dialog>
+		  
+		  
+		  <el-dialog v-model="YjhVisible"  title="选择" destroy-on-close width="200px" @keydown="selectYjh($event)" >
+		    <el-table
+		      tooltip-effect="dark"
+		      :data="selectDataYjh"
+		      row-key="ID"
+		      highlight-current-row="true"
+		      border
+		      style="width: 100%;"
+		      @row-dblclick="SelectClickYjh"
+		      ref="tablesczl_yjno" >
+		      <el-table-column prop="yjno" label="印件号" width="170"/>
+		    </el-table>
+		  </el-dialog>
         </el-main>
       </el-container>
     </el-container>
@@ -1571,7 +1586,9 @@ const handleNodeClick = (node, check) => {
 const ent1 = (event) => {
   const inputs = document.getElementsByTagName("input");
   const currentIndex = Array.from(inputs).indexOf(event.target);
-
+  // if(event.keyCode === 13 || inputs =='印件号'){
+	 //  console.log(123213)
+  // }
   if (event.keyCode === 13 || event.keyCode === 40) {
     // Enter 或向下箭头
     for (let i = currentIndex + 1; i < inputs.length; i++) {
@@ -1683,16 +1700,103 @@ const getCPMCsubmit = () => {
 //印件号数组
 const yjnoArr = ref([0]);
 //印件号获得焦点事件
-const yjnoHandleFocus = () => {
-  if (yjnoArr.value[0] == 0) {
-    formData.value.sczl_yjno = 1;
-  } else {
-    formData.value.sczl_yjno = yjnoArr.value[0];
-  }
+// const yjnoHandleFocus = () => {
+//   if (yjnoArr.value[0] == 0) {
+//     formData.value.sczl_yjno = 1;
+//   } else {
+//     formData.value.sczl_yjno = yjnoArr.value[0];
+//   }
+// };
+
+//印件号弹窗
+const selectDataYjh = reactive([]);
+const YjhVisible = ref(false);
+// const selectYjh = (event) => {
+//   if (event.keyCode === 40) {
+//     // Enter 或向下箭头
+//     setCurrents(selectDataYjh[1]);
+//   } else if (event.keyCode === 38) {
+//     setCurrents(selectDataYjh[0]);
+//   } else if (event.keyCode === 13) {
+//     YjhVisible.value = false;
+//   }
+// };
+
+const currentIndex = ref(0);
+const selectYjh = (event) => {
+  if (event.keyCode === 40) {
+    // 向下箭头
+    currentIndex.value = (currentIndex.value + 1) % selectDataYjh.length;
+    setCurrents(selectDataYjh[currentIndex.value]);
+  } else if (event.keyCode === 38) {
+    // 向上箭头
+    currentIndex.value = (currentIndex.value - 1 + selectDataYjh.length) % selectDataYjh.length;
+    setCurrents(selectDataYjh[currentIndex.value]);
+  } else if (event.keyCode === 13) {
+    // Enter 键
+	if (formData.value.sczl_gdbh != "" && formData.value.sczl_yjno != "") {
+	  //获取印件名称
+	  productionYjmc({
+	    gdbh: formData.value.sczl_gdbh,
+	    yjno: formData.value.sczl_yjno,
+	  }).then((response) => {
+	    if (response.code === 0) {
+	      formData.value.yj_yjmc = response.data.yj_yjmc;
+	      gxmc.value = response.data.gxmc;
+	      formData.value.sczl_gxmc = gxmc.value.sczl_gxmc;
+	      setColorReadonly("印件名称");
+	    } else {
+	      ElMessage({
+	        type: "error",
+	        message: "印件编号不存在, 将恢复默认值, 请仔细确认数据准确性!",
+	      });
+	      // formData.value.sczl_yjno = yjnoArr.value[0];
+	      formData.value.yj_yjmc = "";
+	      gxmc.value = "";
+	    }
+	  });
+	} else {
+	  ElMessage({
+	    type: "error",
+	    message: "印件编号不存在, 将恢复默认值, 请仔细确认数据准确性!",
+	  });
+	  // formData.value.sczl_yjno = yjnoArr.value[0];
+	  // formData.value.yj_yjmc = "";
+	  // gxmc.value = "";
+	}
+    YjhVisible.value = false;
+  }
+};
+const tablesczl_yjno = ref();
+const setCurrents = (row) => {
+  setTimeout(() => {
+    tablesczl_yjno.value?.setCurrentRow(row);
+    // SelectClick(row)
+    // console.log(row)
+    // console.log(table)
+    const { yjno } = row;
+    formData.value.sczl_yjno = row.yjno;
+    console.log(row);
+  });
+};
+//印件号选择
+const SelectClickYjh = (row, column, event) => {
+  const { sczl_yjno } = row;
+  console.log(row)
+  formData.value.sczl_yjno = row.yjno;
+  YjhVisible.value = false;
 };
 
+			
 //印件号失去焦点事件
-const getYJMCsubmit = () => {
+const getYJMCsubmit = async () => {
+	const response = await productionGdmc({gdbh:formData.value.sczl_gdbh})
+	console.log(response)
+	YjhVisible.value = true;
+	// 将数组转换为对象数组
+	const formattedData = response.data.yjno.map(item => ({ yjno: item }));
+	selectDataYjh.splice(0, selectDataYjh.length, ...formattedData);
+	
   if (formData.value.sczl_gdbh != "" && formData.value.sczl_yjno != "") {
     //获取印件名称
     productionYjmc({
@@ -1709,7 +1813,7 @@ const getYJMCsubmit = () => {
           type: "error",
           message: "印件编号不存在, 将恢复默认值, 请仔细确认数据准确性!",
         });
-        formData.value.sczl_yjno = yjnoArr.value[0];
+        // formData.value.sczl_yjno = yjnoArr.value[0];
         formData.value.yj_yjmc = "";
         gxmc.value = "";
       }
@@ -1719,9 +1823,9 @@ const getYJMCsubmit = () => {
       type: "error",
       message: "印件编号不存在, 将恢复默认值, 请仔细确认数据准确性!",
     });
-    formData.value.sczl_yjno = yjnoArr.value[0];
-    formData.value.yj_yjmc = "";
-    gxmc.value = "";
+    // formData.value.sczl_yjno = yjnoArr.value[0];
+    // formData.value.yj_yjmc = "";
+    // gxmc.value = "";
   }
 };
 
@@ -1956,6 +2060,7 @@ const selectBZ = (event) => {
     BzVisible.value = false;
   }
 };
+
 //mult失去焦点事件
 const mult = () => {
   formData.value.sczl_cl = parseFloat(mult1.value * mult2.value);

+ 1 - 0
src/view/performance/chejianbaogong.vue

@@ -3968,6 +3968,7 @@ const tableCols1 = [
   { label: '计时时数', prop: '计时时数', width: '105' },
   { label: '计时工资', prop: '计时工资', width: '135' },
   { label: '日工资合计', prop: '日工资合计', width: '135' },
+  { label: '分摊比例', prop: 'Rate', width: '135' },
 ]
 const tableCols2 = [
   { label: '日期', prop: 'sczl_rq', width: '100' },