|
|
@@ -60,7 +60,7 @@
|
|
|
|
|
|
<!-- 弹出框 -->
|
|
|
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type" destroy-on-close
|
|
|
- width="1000px">
|
|
|
+ width="1200px">
|
|
|
|
|
|
<el-form ref="elFormRef" :model="detailData" inline label-position="right" :rules="rule"
|
|
|
id="detail-form">
|
|
|
@@ -96,35 +96,35 @@
|
|
|
<el-input v-model="detailData.yj_yjmc" style="width: 500px;" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="废品总数">
|
|
|
- <el-input v-model="detailData.qczl_fp" id="废品总数" style="width: 100px;" />
|
|
|
+ <el-input v-model="detailData.qczl_fp" id="废品总数" @keydown="ent1($event)" style="width: 100px;" />
|
|
|
</el-form-item>
|
|
|
<br>
|
|
|
|
|
|
<el-form-item label="工序">
|
|
|
<el-input v-model="detailData.qczl_gxmc" style="width: 200px;"
|
|
|
- @keyup.enter.native="getgxsubmit" />
|
|
|
+ @blur="getgxsubmit" @keydown="ent1($event)" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="工序号">
|
|
|
- <el-input v-model="detailData.qczl_gxh" style="width: 100px;" />
|
|
|
+ <el-input v-model="detailData.qczl_gxh" @keydown="ent1($event)" style="width: 100px;" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="总流程号">
|
|
|
- <el-input v-model="detailData.total_liucheng" style="width: 100px;" />
|
|
|
+ <el-input v-model="detailData.total_liucheng" @keydown="ent1($event)" style="width: 100px;" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="流程单号">
|
|
|
- <el-input v-model="detailData.qczl_num" style="width: 60px; margin-left: 5px;" />
|
|
|
- <el-input v-model="detailData.qczl_NumDesc1" style="width: 60px; margin-left: 5px;" />
|
|
|
- <el-input v-model="detailData.qczl_NumDesc2" style="width: 60px; margin-left: 5px;" />
|
|
|
- <el-input v-model="detailData.qczl_NumDesc3" style="width: 60px; margin-left: 5px;" />
|
|
|
- <el-input v-model="detailData.qczl_NumDesc4" style="width: 60px; margin-left: 5px;" />
|
|
|
- <el-input v-model="detailData.qczl_NumDesc5" style="width: 60px; margin-left: 5px;" />
|
|
|
- <el-input v-model="detailData.qczl_NumDesc6" style="width: 60px; margin-left: 5px;" />
|
|
|
- <el-input v-model="detailData.qczl_NumDesc7" style="width: 60px; margin-left: 5px;" />
|
|
|
- <el-input v-model="detailData.qczl_NumDesc8" style="width: 60px; margin-left: 5px;" />
|
|
|
+ <el-input v-model="detailData.qczl_num" @keydown="ent1($event)" style="width: 60px; margin-left: 5px;" />
|
|
|
+ <el-input v-model="detailData.qczl_NumDesc1" @keydown="ent1($event)" style="width: 60px; margin-left: 5px;" />
|
|
|
+ <el-input v-model="detailData.qczl_NumDesc2" @keydown="ent1($event)" style="width: 60px; margin-left: 5px;" />
|
|
|
+ <el-input v-model="detailData.qczl_NumDesc3" @keydown="ent1($event)" style="width: 60px; margin-left: 5px;" />
|
|
|
+ <el-input v-model="detailData.qczl_NumDesc4" @keydown="ent1($event)" style="width: 60px; margin-left: 5px;" />
|
|
|
+ <el-input v-model="detailData.qczl_NumDesc5" @keydown="ent1($event)" style="width: 60px; margin-left: 5px;" />
|
|
|
+ <el-input v-model="detailData.qczl_NumDesc6" @keydown="ent1($event)" style="width: 60px; margin-left: 5px;" />
|
|
|
+ <el-input v-model="detailData.qczl_NumDesc7" @keydown="ent1($event)" style="width: 60px; margin-left: 5px;" />
|
|
|
+ <el-input v-model="detailData.qczl_NumDesc8" @keydown="ent1($event)" style="width: 60px; margin-left: 5px;" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="备注">
|
|
|
- <el-input v-model="detailData.qczl_NumDesc" style="width: 200px;" />
|
|
|
+ <el-input v-model="detailData.qczl_NumDesc" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-scrollbar height="400px">
|
|
|
@@ -133,7 +133,7 @@
|
|
|
:header-row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }">
|
|
|
<el-table-column label="废品类别" width="200">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-input v-model="row.fp_lb" @keyup.enter="handleFplbEnter($index, row)" />
|
|
|
+ <el-input v-model="row.fp_lb" @keydown="ent1($event)" @keyup.enter="handleFplbEnter($index, row)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
@@ -203,12 +203,12 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 弹出选项框 工序 -->
|
|
|
- <el-dialog v-model="GetjtbhVisible" title="选择" destroy-on-close width="600px">
|
|
|
- <el-table tooltip-effect="dark" :data="JTBHselectData" row-key="ID" highlight-current-row="true"
|
|
|
- border style="width:100%" @row-dblclick="JTBHSelectClick">
|
|
|
- <el-table-column prop="gxh" label="工序号" width="70" />
|
|
|
- <el-table-column prop="gxmc" label="工序名称" width="150" />
|
|
|
- <el-table-column prop="addGxmc" label="工序名称" width="150" />
|
|
|
+ <el-dialog v-model="dialogSelectVisible_gx" title="选择" destroy-on-close width="600px"
|
|
|
+ @keydown="select_gx($event)">
|
|
|
+ <el-table tooltip-effect="dark" :data="selectData_gx" row-key="ID" highlight-current-row="true"
|
|
|
+ border style="width:100%" @row-dblclick="handleSelectClick_gx" ref="table_gx">
|
|
|
+ <el-table-column prop="gxh" label="工序号" width="100" />
|
|
|
+ <el-table-column prop="gxmc" label="工序名称" width="460" />
|
|
|
</el-table>
|
|
|
</el-dialog>
|
|
|
|
|
|
@@ -250,7 +250,8 @@
|
|
|
} from '@element-plus/icons-vue'
|
|
|
import {
|
|
|
ref,
|
|
|
- reactive
|
|
|
+ reactive,
|
|
|
+ nextTick
|
|
|
} from 'vue'
|
|
|
import {
|
|
|
getSide,
|
|
|
@@ -436,11 +437,9 @@
|
|
|
}
|
|
|
]
|
|
|
const tableData = reactive([])
|
|
|
- const GetjtbhVisible = ref(false)
|
|
|
const total = ref(0)
|
|
|
const page = ref(1)
|
|
|
const limit = ref(10)
|
|
|
- const JTBHselectData = reactive([])
|
|
|
const searchInfo = ref('')
|
|
|
const params = {
|
|
|
date: '',
|
|
|
@@ -451,49 +450,71 @@
|
|
|
}
|
|
|
// 获取工序
|
|
|
const getgxsubmit = () => {
|
|
|
+
|
|
|
+ if(!detailData.qczl_gdbh || !detailData.qczl_yjno){
|
|
|
+ return
|
|
|
+ }
|
|
|
GetJtbh()
|
|
|
}
|
|
|
const GetJtbh = async () => {
|
|
|
- try {
|
|
|
- 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) {
|
|
|
- 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
|
|
|
- }))
|
|
|
- console.log(tableData)
|
|
|
- JTBHselectData.splice(0, JTBHselectData.length, ...tableData)
|
|
|
- GetjtbhVisible.value = true
|
|
|
- // Now you can use the tableData to populate your table
|
|
|
- } else {
|
|
|
- console.log('No data found')
|
|
|
- }
|
|
|
- } else {
|
|
|
- console.log('Error: ', response.msg)
|
|
|
+ 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) {
|
|
|
+ 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
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- console.error('Error fetching data: ', error)
|
|
|
}
|
|
|
}
|
|
|
- const JTBHSelectClick = (row, column, event) => {
|
|
|
- const {
|
|
|
- gxh,
|
|
|
- gxmc
|
|
|
- } = row
|
|
|
+
|
|
|
+ const dialogSelectVisible_gx = ref(false)
|
|
|
+ const selectData_gx = reactive([])
|
|
|
+ const handleSelectClick_gx = (row, column, event) => {
|
|
|
+ const { gxh, gxmc } = row
|
|
|
detailData.qczl_gxmc = gxh + '-' + gxmc
|
|
|
detailData.qczl_gxh = gxh
|
|
|
- GetjtbhVisible.value = false
|
|
|
+ dialogSelectVisible_gx.value = false
|
|
|
+ }
|
|
|
+ const currentIndex_gx = ref(0);
|
|
|
+ const current_gx = ref(0);
|
|
|
+ const select_gx = (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex_gx.value < selectData_gx.length - 1) {
|
|
|
+ currentIndex_gx.value++;
|
|
|
+ setCurrent_gx(selectData_gx[currentIndex_gx.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_gx.value = 0;
|
|
|
+ setCurrent_gx(selectData_gx[currentIndex_gx.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex_gx.value > 0) {
|
|
|
+ currentIndex_gx.value--;
|
|
|
+ setCurrent_gx(selectData_gx[currentIndex_gx.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_gx.value = selectData_gx.length - 1;
|
|
|
+ setCurrent_gx(selectData_gx[currentIndex_gx.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ dialogSelectVisible_gx.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const table_gx = ref()
|
|
|
+ const setCurrent_gx = (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ table_gx.value?.setCurrentRow(row)
|
|
|
+ const { gxh, gxmc } = row
|
|
|
+ detailData.qczl_gxmc = gxh + '-' + gxmc
|
|
|
+ detailData.qczl_gxh = gxh
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
// 批量删除控制标记
|
|
|
const deleteVisible = ref(false)
|
|
|
const multipleSelection = ref([])
|
|
|
@@ -617,6 +638,7 @@
|
|
|
}
|
|
|
detailData.table = table
|
|
|
try {
|
|
|
+ console.log(detailData)
|
|
|
const res = await getOrderInfo({
|
|
|
order: detailData.qczl_gdbh
|
|
|
})
|
|
|
@@ -1100,6 +1122,78 @@
|
|
|
}, 0)
|
|
|
}
|
|
|
|
|
|
+ const ent1 = (event) => {
|
|
|
+ const inputs = document.getElementsByTagName('input');
|
|
|
+ const currentIndex = Array.from(inputs).indexOf(event.target);
|
|
|
+
|
|
|
+ if (event.keyCode === 13 || event.keyCode === 40) { // Enter 或向下箭头
|
|
|
+ let nextIndex = currentIndex + 1;
|
|
|
+ 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();
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ nextIndex++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 8) { // 删除箭头
|
|
|
+ if (event.target.selectionStart === 0) {
|
|
|
+ for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].setSelectionRange(0, 0);
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 37) { // 向左箭头
|
|
|
+ if (event.target.selectionStart === 0) {
|
|
|
+ for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ 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(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// let formElements
|
|
|
// const moveFocus = (event) => {
|
|
|
// const index = Array.from(formElements).indexOf(event.target)
|