|
|
@@ -2,7 +2,7 @@
|
|
|
<div>
|
|
|
<!-- 左侧树形结构 -->
|
|
|
<el-container>
|
|
|
- <el-aside width="250px">
|
|
|
+ <el-aside width="250px" class="aside-container">
|
|
|
<div class="JKWTree-tree">
|
|
|
<h3>成品入仓管理</h3>
|
|
|
<el-tree :data="treeData" :props="defaultProps" highlight-current="true"
|
|
|
@@ -27,7 +27,7 @@
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<!-- 数据展示 -->
|
|
|
- <el-table ref="multipleTable" style="width: 100%" tooltip-effect="dark" :data="tableData" row-key="ID" @row-click="Click"
|
|
|
+ <el-table ref="multipleTable" height=70vh style="width: 100%" tooltip-effect="dark" :data="tableData" row-key="ID" @row-click="Click"
|
|
|
highlight-current-row="true" border @selection-change="handleSelectionChange" :show-overflow-tooltip="true" @row-dblclick="doubleClick">
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column align="left" sortable label="入仓类型" prop="入仓类型" width="120"/>
|
|
|
@@ -59,12 +59,12 @@
|
|
|
<el-table-column align="left" sortable label="UNIQID" prop="UniqId" width="120"/>
|
|
|
</el-table>
|
|
|
<!-- 分页 -->
|
|
|
- <div class="gva-pagination">
|
|
|
+ <!-- <div class="gva-pagination">
|
|
|
<el-pagination layout="total, sizes, prev, pager, next, jumper" v-model:current-page="page"
|
|
|
v-model:page-size="limit"
|
|
|
:page-sizes="[10, 30, 50, 100]" :total="total" @current-change="handleCurrentChange"
|
|
|
@size-change="handleSizeChange" />
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<!-- 弹出框 -->
|
|
|
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type === 'create' ? '添加' : '详情'"
|
|
|
@@ -322,16 +322,17 @@
|
|
|
|
|
|
<el-dialog v-model="SMVisible" title="选择" destroy-on-close style='height: 100%;margin: 0px;' width="100%">
|
|
|
<div class="block">
|
|
|
- <span class="demonstration">月份选择:</span>
|
|
|
- <el-date-picker v-model="ExcelformData['rq']" type="month" placeholder="选择月份"style='width: 10%;'></el-date-picker>
|
|
|
- <el-button type="primary" @click="ExcelonSubmit" style='margin-left: 10px;'>查询</el-button>
|
|
|
+ <!-- <span class="demonstration">月份选择:</span> -->
|
|
|
+ <!-- <el-date-picker v-model="ExcelformData['rq']" type="month" placeholder="选择月份"style='width: 10%;'></el-date-picker> -->
|
|
|
+ <el-input v-model="searchInfo" placeholder="搜索产品编号或产品名称" style="width: 180px;"></el-input>
|
|
|
+ <el-button type="primary" @click="dwonSubmit" style='margin-left: 10px;'>定位</el-button>
|
|
|
<el-button type="primary" class="bt" icon="download" @click="exportToExcel" >导出Excel</el-button>
|
|
|
<el-button type="primary" icon="edit" @click="pd_gxclhconClick" class="bt">工序产量核查</el-button>
|
|
|
<el-button type="primary" icon="edit" @click="pd_lcdlistonClick" class="bt">流程单查询</el-button>
|
|
|
</div>
|
|
|
- <el-table tooltip-effect="dark" :data="SMselectData"
|
|
|
- style="width: 100%;height: 80vh"
|
|
|
- row-key="ID" highlight-current-row="true"
|
|
|
+ <el-table tooltip-effect="dark" ref="tableRef" :data="SMselectData"
|
|
|
+ style="width: 100%;height: 80vh"
|
|
|
+ row-key="Yj_Gdbh" highlight-current-row="true"
|
|
|
borderstyle="width:180%"height="100%"
|
|
|
@row-dblclick="SMSelectClick"
|
|
|
@row-click="MBRowClick"
|
|
|
@@ -494,7 +495,7 @@ import * as XLSX from 'xlsx'
|
|
|
import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import { Search, Refresh, Download } from '@element-plus/icons-vue'
|
|
|
-import { ref, reactive, onMounted, onBeforeMount } from 'vue'
|
|
|
+import { ref, reactive, onMounted, onBeforeMount,nextTick } from 'vue'
|
|
|
import { getPackingSideTable, getPackingTable } from '@/api/mes_api_gty/myapi'
|
|
|
import { TRUE } from 'sass'
|
|
|
import { exportExcelFile } from '@/utils/excel'
|
|
|
@@ -603,6 +604,7 @@ const total = ref(0)
|
|
|
const page = ref(1)
|
|
|
const limit = ref(10)
|
|
|
const searchInfo = ref('')
|
|
|
+const tableRef = ref(null); // 表格的引用
|
|
|
const params = {
|
|
|
type: '',
|
|
|
date: '',
|
|
|
@@ -610,33 +612,33 @@ const params = {
|
|
|
gdbh: '',
|
|
|
}
|
|
|
|
|
|
-// 分页设置
|
|
|
-const handleSizeChange = (val) => {
|
|
|
- switch (params.type) {
|
|
|
- case 'getTableData':
|
|
|
- getTableData()
|
|
|
- break
|
|
|
- case 'getLocateTable':
|
|
|
- GetmachineLocate()
|
|
|
- break
|
|
|
- default:
|
|
|
- break
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 页面跳转
|
|
|
-const handleCurrentChange = (val) => {
|
|
|
- switch (params.type) {
|
|
|
- case 'getTableData':
|
|
|
- getTableData()
|
|
|
- break
|
|
|
- case 'getLocateTable':
|
|
|
- GetmachineLocate()
|
|
|
- break
|
|
|
- default:
|
|
|
- break
|
|
|
- }
|
|
|
-}
|
|
|
+// // 分页设置
|
|
|
+// const handleSizeChange = (val) => {
|
|
|
+// switch (params.type) {
|
|
|
+// case 'getTableData':
|
|
|
+// getTableData()
|
|
|
+// break
|
|
|
+// case 'getLocateTable':
|
|
|
+// GetmachineLocate()
|
|
|
+// break
|
|
|
+// default:
|
|
|
+// break
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// // 页面跳转
|
|
|
+// const handleCurrentChange = (val) => {
|
|
|
+// switch (params.type) {
|
|
|
+// case 'getTableData':
|
|
|
+// getTableData()
|
|
|
+// break
|
|
|
+// case 'getLocateTable':
|
|
|
+// GetmachineLocate()
|
|
|
+// break
|
|
|
+// default:
|
|
|
+// break
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
const ExcelformData = ref({})
|
|
|
@@ -769,6 +771,67 @@ const gdwhformData = reactive({
|
|
|
const inputCpmc = ref('')
|
|
|
|
|
|
|
|
|
+const dwonSubmit = () => {
|
|
|
+ const searchValue = searchInfo.value.trim();
|
|
|
+ if (searchValue) {
|
|
|
+ const matchedRow = SMselectData.value.find(row => row.Yj_Gdbh === searchValue);
|
|
|
+ if (matchedRow) {
|
|
|
+ nextTick(() => {
|
|
|
+ // 设置当前行以高亮显示
|
|
|
+ tableRef.value.setCurrentRow(matchedRow);
|
|
|
+
|
|
|
+ // 查找表格体的滚动容器
|
|
|
+ const tableBodyWrapper = tableRef.value.$el.querySelector('.el-table__body-wrapper tbody');
|
|
|
+ if (tableBodyWrapper) {
|
|
|
+ // 由于 Element UI 不提供直接获取行 DOM 元素的方法,我们需要遍历所有行来找到匹配的那一行
|
|
|
+ const rows = tableBodyWrapper.querySelectorAll('.el-table__row');
|
|
|
+ const targetRow = Array.from(rows).find(row => {
|
|
|
+ // 注意:这里我们假设每行都有一个唯一的 key 属性与数据匹配,但实际情况可能不同
|
|
|
+ // 如果您的表格行有 `row-key` 属性,并且这个 key 映射到了 DOM 的某个属性上(比如 data-row-key),
|
|
|
+ // 那么您应该使用那个属性来找到目标行。但是,Element UI 并不默认这样做。
|
|
|
+ // 一种解决方案是在渲染行时手动添加一个 ref 或 data 属性来存储行的 key。
|
|
|
+ // 由于这个示例中没有这样的设置,我们假设您无法通过 DOM 属性直接找到目标行。
|
|
|
+ // 因此,这里我们使用了一个不太优雅的方法:通过比较行的数据与匹配的数据来找到目标行。
|
|
|
+ // 这通常不是最佳实践,因为它依赖于行的渲染顺序和数据结构的一致性。
|
|
|
+ const rowData = JSON.parse(row.dataset.rowData || '{}'); // 假设您在某处将行数据作为 JSON 字符串存储在了 data-row-data 属性中(这不是 Element UI 的默认行为)
|
|
|
+ return rowData.Yj_Gdbh === matchedRow.Yj_Gdbh;
|
|
|
+ });
|
|
|
+
|
|
|
+ // 如果找到了目标行,滚动到它
|
|
|
+ if (targetRow) {
|
|
|
+ targetRow.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
|
|
+ } else {
|
|
|
+ ElMessage.warning('未找到对应的行数据(在 DOM 中)');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ElMessage.warning('未找到表格体');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage.warning('未找到匹配的工单编号');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ElMessage.warning('请输入搜索内容');
|
|
|
+ }
|
|
|
+};
|
|
|
+// const dwonSubmit = () => {
|
|
|
+// const searchValue = searchInfo.value.trim();
|
|
|
+// if (searchValue) {
|
|
|
+// const matchedRow = SMselectData.value.find(row => row.Yj_Gdbh === searchValue);
|
|
|
+// if (matchedRow) {
|
|
|
+// nextTick(() => {
|
|
|
+// tableRef.value.setCurrentRow(matchedRow);
|
|
|
+// });
|
|
|
+// } else {
|
|
|
+// // 你可以使用 Element Plus 的消息组件或其他方式来显示警告
|
|
|
+// // 例如:ElMessage.warning('未找到匹配的工单编号');
|
|
|
+// console.warn('未找到匹配的工单编号');
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// console.warn('请输入搜索内容');
|
|
|
+// }
|
|
|
+// };
|
|
|
+
|
|
|
//导出excel表
|
|
|
const exportToExcel = () => {
|
|
|
const tableCols1 = [
|
|
|
@@ -831,6 +894,15 @@ const ongdwhfanclick = async() => {
|
|
|
|
|
|
//工序产量核查回车
|
|
|
const gxclhcProductValue = async () => {
|
|
|
+ const response = await PrintDetailList ({workOrder:gxclhcformData['gdbh']});
|
|
|
+ gdwhformData.yjno = response.data[0].no
|
|
|
+ inputCpmc.value = response.data[0].name
|
|
|
+ if (response.code === 0) {
|
|
|
+ const noFields = response.data.map(item => item.no);
|
|
|
+ gdwhformData.yinjian = noFields
|
|
|
+ } else {
|
|
|
+ console.error('查询失败:', response.msg);
|
|
|
+ }
|
|
|
_getOrderProcessCount();
|
|
|
_PrintDetailList();
|
|
|
}
|
|
|
@@ -1530,7 +1602,9 @@ onMounted(async () => {
|
|
|
margin: 0px !important;
|
|
|
}
|
|
|
.gva-table-box{
|
|
|
+ position: relative;
|
|
|
padding: 0px !important;
|
|
|
+ z-index: 2;
|
|
|
}
|
|
|
.mab{
|
|
|
margin-bottom: 5px;
|
|
|
@@ -1540,4 +1614,37 @@ onMounted(async () => {
|
|
|
color: blue !important;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
+.aside-container {
|
|
|
+ height: 80vh; /* 设置你希望的高度 */
|
|
|
+ overflow-y: auto; /* 允许垂直滚动 */
|
|
|
+}
|
|
|
+
|
|
|
+.JKWTree-tree {
|
|
|
+ /* 确保内部内容不会撑破 aside 容器 */
|
|
|
+ height: calc(100% - 40px);
|
|
|
+ max-height: 100%; /* 或设置为 calc(100% - 某个值),如果需要考虑标题的高度等 */
|
|
|
+}
|
|
|
+
|
|
|
+/* .aside-header {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ padding: 0 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ z-index: 1;
|
|
|
+} */
|
|
|
+
|
|
|
+/* 如果需要,可以为 h3 也设置样式,以确保它在滚动区域外或包含在内 */
|
|
|
+.JKWTree-tree h3 {
|
|
|
+ /* position: absolute;
|
|
|
+ top: 0; */
|
|
|
+ margin: 0; /* 移除默认的 margin */
|
|
|
+ padding: 10px; /* 添加一些 padding,如果需要 */
|
|
|
+ background-color: #f5f5f5; /* 可选:添加背景色 */
|
|
|
+ z-index: 1;
|
|
|
+}
|
|
|
</style>
|