|
|
@@ -49,7 +49,7 @@
|
|
|
<!-- 弹出框 -->
|
|
|
<!-- <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type" destroy-on-close
|
|
|
width="1200px" style="margin-top: 0%;height: 100%;;"> -->
|
|
|
- <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type" destroy-on-close
|
|
|
+ <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type" destroy-on-close
|
|
|
width="1200px" style="margin-top: 2%;height: 80%;">
|
|
|
<el-form ref="elFormRef" :model="detailData" inline label-position="right" :rules="rule"
|
|
|
id="detail-form" label-width="70px">
|
|
|
@@ -194,7 +194,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 弹出选项框 数量 -->
|
|
|
- <el-dialog v-model="dialogSelectVisible2" title="数量选择" destroy-on-close width="830px" style="margin-top: 3%;" @keydown="selectSL($event)">
|
|
|
+ <el-dialog v-model="dialogSelectVisible2" title="数量选择" destroy-on-close width="900px" style="margin-top: 3%;" @keydown="selectSL($event)">
|
|
|
<el-table tooltip-effect="dark" :data="selectData" row-key="ID" highlight-current-row border style="width:100%" @row-dblclick="handleSelectClick" ref="table2">
|
|
|
<el-table-column v-for="column in selectColumns" :key="column.prop" :prop="column.prop" :label="column.label" :width="column.width" />
|
|
|
</el-table>
|
|
|
@@ -411,30 +411,30 @@
|
|
|
}
|
|
|
}, 100);
|
|
|
|
|
|
- // 获取工序
|
|
|
- const getgxsubmit = () => {
|
|
|
- if(!detailData.qczl_gdbh || !detailData.qczl_yjno){
|
|
|
- return
|
|
|
- }
|
|
|
- GetJtbh()
|
|
|
- }
|
|
|
- const GetJtbh = async () => {
|
|
|
- const { qczl_gdbh, qczl_yjno } = detailData
|
|
|
- const response = await getYjInfo({ order: qczl_gdbh, yj_no: qczl_yjno })
|
|
|
- if (response.code === 0) {
|
|
|
- const data = response.data
|
|
|
- if (data) {
|
|
|
- detailData.total_liucheng = data.max_num
|
|
|
- const tableData = data.gx_data.map(item => ({
|
|
|
- gxh: item.Gy0_gxh,
|
|
|
- gxmc: item.Gy0_gxmc + (item.Add_gxmc === '' ? '' : '-' + item.Add_gxmc),
|
|
|
- // addGxmc: item.Add_gxmc
|
|
|
- }))
|
|
|
- selectData_gx.splice(0, selectData_gx.length, ...tableData)
|
|
|
- setCurrent_gx(selectData_gx[0])
|
|
|
- dialogSelectVisible_gx.value = true
|
|
|
- }
|
|
|
- }
|
|
|
+ // 获取工序
|
|
|
+ const getgxsubmit = () => {
|
|
|
+ if(!detailData.qczl_gdbh || !detailData.qczl_yjno){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ GetJtbh()
|
|
|
+ }
|
|
|
+ const GetJtbh = async () => {
|
|
|
+ const { qczl_gdbh, qczl_yjno } = detailData
|
|
|
+ const response = await getYjInfo({ order: qczl_gdbh, yj_no: qczl_yjno })
|
|
|
+ if (response.code === 0) {
|
|
|
+ const data = response.data
|
|
|
+ if (data) {
|
|
|
+ detailData.total_liucheng = data.max_num
|
|
|
+ const tableData = data.gx_data.map(item => ({
|
|
|
+ gxh: item.Gy0_gxh,
|
|
|
+ gxmc: item.Gy0_gxmc + (item.Add_gxmc === '' ? '' : '-' + item.Add_gxmc),
|
|
|
+ // addGxmc: item.Add_gxmc
|
|
|
+ }))
|
|
|
+ selectData_gx.splice(0, selectData_gx.length, ...tableData)
|
|
|
+ setCurrent_gx(selectData_gx[0])
|
|
|
+ dialogSelectVisible_gx.value = true
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1445,86 +1445,86 @@ const gd_lcdCancel = async () => {
|
|
|
const currentIndex = Array.from(inputs).indexOf(event.target);
|
|
|
if (event.keyCode === 13 && title === '工序') {
|
|
|
getgxsubmit()
|
|
|
- }else if (event.keyCode === 13 && title === '流程单号') {
|
|
|
- // 获取所有相关的输入框值
|
|
|
- const allValues = [
|
|
|
- detailData.qczl_num,
|
|
|
- detailData.qczl_NumDesc1,
|
|
|
- detailData.qczl_NumDesc2,
|
|
|
- detailData.qczl_NumDesc3,
|
|
|
- detailData.qczl_NumDesc4,
|
|
|
- detailData.qczl_NumDesc5,
|
|
|
- detailData.qczl_NumDesc6,
|
|
|
- detailData.qczl_NumDesc7,
|
|
|
- detailData.qczl_NumDesc8,
|
|
|
- ];
|
|
|
- // 获取当前输入框的值
|
|
|
- const currentValue = event.target.value;
|
|
|
-
|
|
|
- // 如果当前值为 0,不进行校验,直接跳转到下一个输入框
|
|
|
- if (currentValue === "0") {
|
|
|
- console.log("输入值为 0,无需校验");
|
|
|
-
|
|
|
- // 跳转到下一个输入框
|
|
|
- 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++;
|
|
|
- }
|
|
|
- if (!foundNext) {
|
|
|
+ }else if (event.keyCode === 13 && title === '流程单号') {
|
|
|
+ // 获取所有相关的输入框值
|
|
|
+ const allValues = [
|
|
|
+ detailData.qczl_num,
|
|
|
+ detailData.qczl_NumDesc1,
|
|
|
+ detailData.qczl_NumDesc2,
|
|
|
+ detailData.qczl_NumDesc3,
|
|
|
+ detailData.qczl_NumDesc4,
|
|
|
+ detailData.qczl_NumDesc5,
|
|
|
+ detailData.qczl_NumDesc6,
|
|
|
+ detailData.qczl_NumDesc7,
|
|
|
+ detailData.qczl_NumDesc8,
|
|
|
+ ];
|
|
|
+ // 获取当前输入框的值
|
|
|
+ const currentValue = event.target.value;
|
|
|
+
|
|
|
+ // 如果当前值为 0,不进行校验,直接跳转到下一个输入框
|
|
|
+ if (currentValue === "0") {
|
|
|
+ console.log("输入值为 0,无需校验");
|
|
|
+
|
|
|
+ // 跳转到下一个输入框
|
|
|
+ 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++;
|
|
|
+ }
|
|
|
+ if (!foundNext) {
|
|
|
+ console.log("没有更多可用的输入框");
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查是否有重复的值
|
|
|
+ const isDuplicate = allValues.filter((val) => val === currentValue).length > 1;
|
|
|
+
|
|
|
+ if (isDuplicate) {
|
|
|
+ // 如果有重复值,提示用户并清空当前输入框
|
|
|
+ event.target.value = 0;
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '输入的值已存在,请重新输入'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ console.log('输入值无重复');
|
|
|
+ // 跳转到下一个输入框
|
|
|
+ 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++;
|
|
|
+ }
|
|
|
+ if (!foundNext) {
|
|
|
console.log("没有更多可用的输入框");
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // 检查是否有重复的值
|
|
|
- const isDuplicate = allValues.filter((val) => val === currentValue).length > 1;
|
|
|
-
|
|
|
- if (isDuplicate) {
|
|
|
- // 如果有重复值,提示用户并清空当前输入框
|
|
|
- event.target.value = 0;
|
|
|
- ElMessage({
|
|
|
- type: 'error',
|
|
|
- message: '输入的值已存在,请重新输入'
|
|
|
- });
|
|
|
- } else {
|
|
|
- console.log('输入值无重复');
|
|
|
- // 跳转到下一个输入框
|
|
|
- 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++;
|
|
|
- }
|
|
|
- if (!foundNext) {
|
|
|
- console.log("没有更多可用的输入框");
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
}else if (event.keyCode === 13 && title === '废品类别') {
|
|
|
handleFplbEnter(event,index,row,title)
|
|
|
let nextIndex = currentIndex + 1;
|
|
|
@@ -1545,48 +1545,48 @@ const gd_lcdCancel = async () => {
|
|
|
}
|
|
|
nextIndex++;
|
|
|
}
|
|
|
- }else if (event.keyCode === 13 && title === '数量') {
|
|
|
- // 去掉数量前导的0
|
|
|
- if (typeof row.fp_sl === 'string') {
|
|
|
- row.fp_sl = row.fp_sl.replace(/^0+(?=\d)/, '');
|
|
|
- }
|
|
|
-
|
|
|
- // 判断数量是否为 0 或为空
|
|
|
- if (row.fp_sl === '0' || row.fp_sl === '' || row.fp_sl === 0) {
|
|
|
- console.log("数量为 0,清空对应字段");
|
|
|
- ['fp_gxmc', 'fp_bz', 'fp_bh', 'fp_name'].forEach(field => {
|
|
|
- detailData.table[index][field] = '';
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // 焦点跳转逻辑
|
|
|
- let nextIndex = currentIndex + 1;
|
|
|
- let foundNext = false;
|
|
|
-
|
|
|
- while (nextIndex < inputs.length) {
|
|
|
- const nextInput = inputs[nextIndex];
|
|
|
- if (!nextInput.disabled && !nextInput.readOnly) {
|
|
|
- nextInput.focus();
|
|
|
- nextInput.select();
|
|
|
- foundNext = true;
|
|
|
- console.log(`焦点已跳转到输入框索引: ${nextIndex}`);
|
|
|
- break;
|
|
|
- }
|
|
|
- nextIndex++;
|
|
|
- }
|
|
|
-
|
|
|
- if (!foundNext) {
|
|
|
- console.log("未找到下一个可用的输入框");
|
|
|
-
|
|
|
- enterCount++; // 增加回车键按下的次数
|
|
|
-
|
|
|
- if (enterCount === 2) {
|
|
|
- dialogbutton.value = true; // 第二次按下回车键时弹出弹窗
|
|
|
- enterCount = 0; // 重置计数器
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- isProcessing = false; // 标志位重置,允许下一次回车处理
|
|
|
+ }else if (event.keyCode === 13 && title === '数量') {
|
|
|
+ // 去掉数量前导的0
|
|
|
+ if (typeof row.fp_sl === 'string') {
|
|
|
+ row.fp_sl = row.fp_sl.replace(/^0+(?=\d)/, '');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断数量是否为 0 或为空
|
|
|
+ if (row.fp_sl === '0' || row.fp_sl === '' || row.fp_sl === 0) {
|
|
|
+ console.log("数量为 0,清空对应字段");
|
|
|
+ ['fp_gxmc', 'fp_bz', 'fp_bh', 'fp_name'].forEach(field => {
|
|
|
+ detailData.table[index][field] = '';
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 焦点跳转逻辑
|
|
|
+ let nextIndex = currentIndex + 1;
|
|
|
+ let foundNext = false;
|
|
|
+
|
|
|
+ while (nextIndex < inputs.length) {
|
|
|
+ const nextInput = inputs[nextIndex];
|
|
|
+ if (!nextInput.disabled && !nextInput.readOnly) {
|
|
|
+ nextInput.focus();
|
|
|
+ nextInput.select();
|
|
|
+ foundNext = true;
|
|
|
+ console.log(`焦点已跳转到输入框索引: ${nextIndex}`);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ nextIndex++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!foundNext) {
|
|
|
+ console.log("未找到下一个可用的输入框");
|
|
|
+
|
|
|
+ enterCount++; // 增加回车键按下的次数
|
|
|
+
|
|
|
+ if (enterCount === 2) {
|
|
|
+ dialogbutton.value = true; // 第二次按下回车键时弹出弹窗
|
|
|
+ enterCount = 0; // 重置计数器
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ isProcessing = false; // 标志位重置,允许下一次回车处理
|
|
|
}else
|
|
|
if (event.keyCode === 13 && title === '工序及责任机长') {
|
|
|
console.log('工序及责任机长');
|
|
|
@@ -1713,7 +1713,7 @@ const gd_lcdCancel = async () => {
|
|
|
dialogSelectVisible2.value = true; // 显示弹窗
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
else if (event.keyCode === 13 || event.keyCode === 40 && title === '') {
|
|
|
console.log('其他')
|
|
|
let nextIndex = currentIndex + 1;
|