|
|
@@ -63,7 +63,7 @@
|
|
|
label-position="right" :rules="rule" label-width="80px" aria-="true">
|
|
|
<el-form-item label="工单编号:" prop="address" style="margin-right: 120px;">
|
|
|
<el-input v-model="detailData.sczl_gdbh" @keydown="ent1($event,index,row,'工单编号')"
|
|
|
- style="width: 120px;" placeholder="Enter回车" />
|
|
|
+ style="width: 120px;" id='工单编号' placeholder="Enter回车" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="产品名称:" prop="image">
|
|
|
<el-input v-model="detailData.Gd_cpmc" disabled @keydown="ent1($event)" placeholder="请输入产品名称" style="width: 450px;" />
|
|
|
@@ -91,8 +91,9 @@
|
|
|
</el-form>
|
|
|
<el-form ref="elFormRef" :model="detailData" :inline="true" label-position="right"
|
|
|
:rules="rule" label-width="80px">
|
|
|
- <el-form-item label="日期:" prop="address" style="margin-right: 120px;">
|
|
|
- <el-input v-model="detailData.sczl_rq" @keydown="ent1($event)" style="width: 120px;" />
|
|
|
+ <el-form-item label="日期">
|
|
|
+ <el-input type="date" max="9999-12-31" v-model="detailData.sczl_rq" id = '日期' @keydown="ent1($event)" @focus="rqHandleFocus()"
|
|
|
+ style="width: 150px;" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="废品数量:" prop="image">
|
|
|
<el-input v-model="detailData.sczl_cl" @keydown="ent1($event)" style="width: 120px;" />
|
|
|
@@ -134,8 +135,8 @@
|
|
|
<div class="sub-title">奖励班组:</div>
|
|
|
<el-input v-model="detailData.Jl_bzdh" @keydown="ent1($event)"
|
|
|
style="width: 40px;" />
|
|
|
- <!-- <el-input v-model="detailData.jl_jtbh" @blur="getJtbhsubmit('1')"
|
|
|
- @keydown="ent1($event)" id="jt" style="width: 65px;" /> -->
|
|
|
+ <!-- <el-input v-model="detailData.jl_jtbh" @keydown="ent1($event,index,row,'班组')"
|
|
|
+ style="width: 40px;" /> -->
|
|
|
<el-select
|
|
|
v-model="detailData.jl_jtbh"
|
|
|
placeholder="请选择班次"
|
|
|
@@ -393,6 +394,16 @@
|
|
|
</el-table>
|
|
|
</el-dialog>
|
|
|
|
|
|
+
|
|
|
+ <!-- 班组弹窗 -->
|
|
|
+ <el-dialog v-model="dialogFormVisiblebzlist" title="选择" destroy-on-close width="200px"
|
|
|
+ @keydown="selectGX_BZlsit($event)">
|
|
|
+ <el-table tooltip-effect="dark" :data="selectData_BZlsit" row-key="ID" highlight-current-row="true"
|
|
|
+ border style="width:100%" @row-dblclick="handleSelectClick_BZlsit" ref="table_BZlsit">
|
|
|
+ <el-table-column align="center" prop="name" label="班组" width="170" />
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 员工编号编号弹窗 -->
|
|
|
<el-dialog v-model="dialogSelectVisible_Yg" title="选择" destroy-on-close width="300px"
|
|
|
@keydown="selectGX_Yg($event)">
|
|
|
@@ -444,7 +455,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
<el-dialog v-model="detailShow" style="width: 800px" lock-scroll :before-close="closeDetailShow"
|
|
|
title="查看详情" destroy-on-close>
|
|
|
<el-scrollbar height="550px">
|
|
|
@@ -667,6 +677,12 @@ import LuckyExcel from 'luckyexcel';
|
|
|
console.log(res)
|
|
|
Object.assign(detailData, res.data[0])
|
|
|
dialogFormVisible.value = true
|
|
|
+ setTimeout(() => {
|
|
|
+ const inputElement = document.getElementById('工单编号');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
}
|
|
|
}
|
|
|
let lastCellValue = ref()
|
|
|
@@ -686,6 +702,12 @@ import LuckyExcel from 'luckyexcel';
|
|
|
const ADD = ref('0')
|
|
|
//新增
|
|
|
function onAdd() {
|
|
|
+ setTimeout(() => {
|
|
|
+ const inputElement = document.getElementById('工单编号');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
ADD.value = '新增'
|
|
|
type.value = 'create'
|
|
|
GetInfo(lastCellValue)
|
|
|
@@ -700,6 +722,27 @@ import LuckyExcel from 'luckyexcel';
|
|
|
console.log(res)
|
|
|
Object.assign(detailData, res.data[0])
|
|
|
dialogFormVisible.value = true
|
|
|
+
|
|
|
+ detailData.JL_Je1 = '0.00'
|
|
|
+ detailData.JL_Je2 = '0.00'
|
|
|
+ detailData.JL_Je3 = '0.00'
|
|
|
+ detailData.JL_Je4 = '0.00'
|
|
|
+ detailData.JL_Je5 = '0.00'
|
|
|
+ detailData.JL_Je6 = '0.00'
|
|
|
+ detailData.JL_Je7 = '0.00'
|
|
|
+ detailData.JL_Je8 = '0.00'
|
|
|
+ detailData.JL_Je9 = '0.00'
|
|
|
+ detailData.JL_Je10 = '0.00'
|
|
|
+ detailData.sczl_je1 = '0.00'
|
|
|
+ detailData.sczl_je2 = '0.00'
|
|
|
+ detailData.sczl_je3 = '0.00'
|
|
|
+ detailData.sczl_je4 = '0.00'
|
|
|
+ detailData.sczl_je5 = '0.00'
|
|
|
+ detailData.sczl_je6 = '0.00'
|
|
|
+ detailData.sczl_je7 = '0.00'
|
|
|
+ detailData.sczl_je8 = '0.00'
|
|
|
+ detailData.sczl_je9 = '0.00'
|
|
|
+ detailData.sczl_je10 = '0.00'
|
|
|
}
|
|
|
}
|
|
|
//工单编号回车事件
|
|
|
@@ -946,7 +989,57 @@ import LuckyExcel from 'luckyexcel';
|
|
|
JtbhVisible.value = false;
|
|
|
};
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ /*
|
|
|
+ 班组
|
|
|
+ */
|
|
|
+ // const dialogFormVisiblebzlist = ref(false)
|
|
|
+ // const selectData_BZlsit = reactive([]);
|
|
|
+ // const currentIndexBZlsit = ref(0); // 当前选中行索引
|
|
|
+ // const getbzlist = () => {
|
|
|
+ // // 模拟后端返回的数据
|
|
|
+ // const response = {
|
|
|
+ // data: [
|
|
|
+ // { id: 1, name: "A班" },
|
|
|
+ // { id: 2, name: "B班" }
|
|
|
+ // ]
|
|
|
+ // };
|
|
|
+ // // 清空原数组并插入新数据
|
|
|
+ // selectData_BZlsit.splice(0, selectData_BZlsit.length, ...response.data);
|
|
|
+ // dialogFormVisiblebzlist.value = true
|
|
|
+ // }
|
|
|
+ // // 键盘事件处理
|
|
|
+ // const selectGX_BZlsit = (event) => {
|
|
|
+ // if (!dialogFormVisiblebzlist.value || !selectData_BZlsit.length) return;
|
|
|
+
|
|
|
+ // if (event.keyCode === 40) {
|
|
|
+ // // 向下箭头
|
|
|
+ // currentIndexBZlsit.value =
|
|
|
+ // currentIndexBZlsit.value < selectData_BZlsit.length - 1
|
|
|
+ // ? currentIndexZRBM.value + 1
|
|
|
+ // : 0;
|
|
|
+ // setCurrentRow(selectData_BZlsit[currentIndexBZlsit.value]);
|
|
|
+ // } else if (event.keyCode === 38) {
|
|
|
+ // // 向上箭头
|
|
|
+ // currentIndexBZlsit.value =
|
|
|
+ // currentIndexBZlsit.value > 0
|
|
|
+ // ? currentIndexBZlsit.value - 1
|
|
|
+ // : selectData_BZlsit.length - 1;
|
|
|
+ // setCurrentRow(selectData_BZlsit[currentIndexBZlsit.value]);
|
|
|
+ // } else if (event.keyCode === 13) {
|
|
|
+ // // 回车键调用选中当前行
|
|
|
+ // handleSelectClick_BZlsit(selectData_BZlsit[currentIndexBZlsit.value]);
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // // 双击或回车选中行
|
|
|
+ // const handleSelectClick_BZlsit = (row) => {
|
|
|
+ // console.log(row)
|
|
|
+ // if (row) {
|
|
|
+ // detailData.jl_jtbh = row.name;
|
|
|
+ // dialogFormVisiblebzlist.value = false;
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+
|
|
|
|
|
|
/*
|
|
|
责任部门
|
|
|
@@ -1342,6 +1435,14 @@ import LuckyExcel from 'luckyexcel';
|
|
|
name: '',
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //日期获得焦点事件
|
|
|
+ const rqHandleFocus = () => {
|
|
|
+ if (detailData.sczl_rq == undefined || detailData.sczl_rq == '') {
|
|
|
+ detailData.sczl_rq = new Date().toISOString().split('T')[0]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 弹窗确定
|
|
|
const enterDialog = async () => {
|
|
|
if (type.value === 'update') {
|
|
|
@@ -1544,6 +1645,7 @@ import LuckyExcel from 'luckyexcel';
|
|
|
sys_id: sys_id,
|
|
|
}
|
|
|
console.log(restoredData)
|
|
|
+ // return;
|
|
|
// console.log(formData3.value.formattedArray)
|
|
|
const response = await JunkDetailAdd(restoredData);
|
|
|
console.log(response)
|
|
|
@@ -1557,6 +1659,9 @@ import LuckyExcel from 'luckyexcel';
|
|
|
|
|
|
getTableData()
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//键盘 input框跳转
|
|
|
const ent = (event, id1, id2, id3) => {
|
|
|
if (event.keyCode === 13 || event.keyCode === 40) { // Enter 或向下箭头
|
|
|
@@ -1582,8 +1687,12 @@ import LuckyExcel from 'luckyexcel';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
const ent1 = (event,index,row,title) => {
|
|
|
+ console.log(title)
|
|
|
const inputs = document.getElementsByTagName('input');
|
|
|
const currentIndex = Array.from(inputs).indexOf(event.target);
|
|
|
|
|
|
@@ -1675,18 +1784,71 @@ import LuckyExcel from 'luckyexcel';
|
|
|
}
|
|
|
nextIndex++;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- if (event.keyCode === 13 || event.keyCode === 40) { // Enter 或向下箭头
|
|
|
- for (let i = currentIndex + 1; i < inputs.length; i++) {
|
|
|
- if (!inputs[i].readOnly) {
|
|
|
- nextTick(() => {
|
|
|
- inputs[i].focus();
|
|
|
- inputs[i].select();
|
|
|
- })
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ }else if(event.keyCode === 13 && title === '班组'){
|
|
|
+ console.log("班组")
|
|
|
+ getbzlist()
|
|
|
+ // 跳转到下一个输入框
|
|
|
+ let nextIndex = currentIndex + 1;
|
|
|
+ let foundNext = false; // 标记是否找到下一个可用输入框
|
|
|
+ while (nextIndex < inputs.length) {
|
|
|
+ if (inputs[nextIndex].disabled) {
|
|
|
+ console.log("当前输入框为 disabled,跳过");
|
|
|
+ nextIndex++; // 跳过 disabled 的输入框
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!inputs[nextIndex].readOnly) {
|
|
|
+ nextTick(() => {
|
|
|
+ inputs[nextIndex].focus();
|
|
|
+ inputs[nextIndex].select();
|
|
|
+ });
|
|
|
+ foundNext = true; // 找到下一个可用输入框
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ nextIndex++;
|
|
|
+ }
|
|
|
+ }else if (event.keyCode === 13 || title === "undefined") {
|
|
|
+ // 跳转到下一个输入框或下拉框
|
|
|
+ let nextIndex = currentIndex + 1;
|
|
|
+ let foundNext = false; // 标记是否找到下一个可用的输入框或下拉框
|
|
|
+
|
|
|
+ while (nextIndex < inputs.length) {
|
|
|
+ const nextElement = inputs[nextIndex];
|
|
|
+
|
|
|
+ // 跳过 disabled 或 readOnly 的元素
|
|
|
+ if (nextElement.disabled) {
|
|
|
+ console.log("当前输入框为 disabled,跳过");
|
|
|
+ nextIndex++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (nextElement.readOnly) {
|
|
|
+ console.log("当前输入框为 readOnly,跳过");
|
|
|
+ nextIndex++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果是输入框或者下拉框,则聚焦并选中
|
|
|
+ if (
|
|
|
+ nextElement.tagName === "INPUT" || // 输入框
|
|
|
+ nextElement.tagName === "SELECT" // 下拉框
|
|
|
+ ) {
|
|
|
+ nextTick(() => {
|
|
|
+ nextElement.focus(); // 聚焦
|
|
|
+ if (nextElement.tagName === "INPUT") {
|
|
|
+ nextElement.select(); // 如果是输入框,选中内容
|
|
|
+ }
|
|
|
+ });
|
|
|
+ foundNext = true; // 找到下一个可用元素
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 否则继续找下一个元素
|
|
|
+ nextIndex++;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果没有找到下一个可用的输入框或下拉框
|
|
|
+ if (!foundNext) {
|
|
|
+ console.log("未找到下一个可用的输入框或下拉框");
|
|
|
+ }
|
|
|
} else if (event.keyCode === 38) { // 向上箭头
|
|
|
for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
if (!inputs[i].readOnly) {
|
|
|
@@ -1712,27 +1874,27 @@ import LuckyExcel from 'luckyexcel';
|
|
|
// }
|
|
|
} else if (event.keyCode === 37) { // 向左箭头
|
|
|
if (event.target.selectionStart === 0) {
|
|
|
- for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
- if (!inputs[i].readOnly) {
|
|
|
- nextTick(() => {
|
|
|
+ for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
inputs[i].focus();
|
|
|
inputs[i].select();
|
|
|
- })
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} else if (event.keyCode === 39) { // 向右箭头
|
|
|
if (event.target.selectionStart === event.target.value.length) {
|
|
|
- for (let i = currentIndex + 1; i < inputs.length; i++) {
|
|
|
- if (!inputs[i].readOnly) {
|
|
|
- nextTick(() => {
|
|
|
+ for (let i = currentIndex + 1; i < inputs.length; i++) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
inputs[i].focus();
|
|
|
inputs[i].select();
|
|
|
- })
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|