更新大连模块的 搜索查询 Excel导出大改

This commit is contained in:
XingCheng3
2026-05-23 16:47:08 +08:00
parent 381f02595f
commit d543f94149
25 changed files with 420 additions and 171 deletions

View File

@@ -93,7 +93,7 @@
<el-dialog :visible.sync="dialogFormVisible" :title="title" center style="min-height: 200px;" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
<el-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">
<el-select v-model="form.stationNumberValue" size="small" placeholder="请选择工位号">
<el-select v-model="form.stationNumberValue" size="small" placeholder="请选择工位号" style="width: 240px">
<el-option
v-for="item in stationNumber"
:key="item.value"
@@ -955,4 +955,3 @@ export default {
background-color: white!important;
}
</style>

View File

@@ -44,7 +44,7 @@
<el-button type="primary" size="small" icon="el-icon-circle-plus" @click="creatOrder('form')">创建物料</el-button>
<!-- <el-button type="success" size="small" plain icon="el-icon-document-copy" @click="copyOrder('form4')">复制物料</el-button>-->
<!-- <el-button type="info" plain size="small" icon="el-icon-upload2" @click="importOrder('form')">物料导入</el-button>-->
<el-button type="warning" plain size="small" icon="el-icon-download" @click="exportExcel()">物料导出</el-button>
<el-button :loading="exportLoading" :disabled="exportLoading" type="warning" plain size="small" icon="el-icon-download" @click="exportExcel()">物料导出</el-button>
</div>
<el-table
v-loading="loading"
@@ -155,7 +155,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">
<el-select v-model="form.stationNumberValue" size="small" placeholder="请选择工位号">
<el-select v-model="form.stationNumberValue" size="small" placeholder="请选择工位号" style="width: 250px">
<el-option
v-for="item in stationNumber"
:key="item.value"
@@ -530,6 +530,7 @@ export default {
engineTypeValue: '',
version: '',
versionList: [],
exportLoading: false,
engineType: [],
engineType1: [],
isVerification: '',
@@ -1163,10 +1164,17 @@ export default {
exportExcel() {
if (this.tableData.length !== 0) {
var param = []
const isVerification = this.isVerification === '' ? 9999 : this.isVerification
param[0] = ['产品型号代码', this.engineTypeValue]
param[1] = ['工位号', this.stationNumberValue]
var Data = this.CreateData('2001', '电子看板_装配零件_总物料表_导出新', param)
this.exportExcel_NPOI(Data)
param[2] = ['是否验证', isVerification]
param[3] = ['物料号', this.materialCode]
param[4] = ['版本号', this.version]
var exportData = JSON.parse(this.CreateData('2005', '电子看板_装配零件_查询', param))
exportData.exportFileName = '物料扫码维护'
exportData.exportColumns = '工位号,版本号,物料号,零件名称,零件数量=物料数量,是否验证,是否批次,零件图号=匹配规则,条码长度=匹配长度'
var Data = JSON.stringify(exportData)
this.runExcelExport(Data, 'exportLoading')
} else {
this.$message.warning('暂无数据')
}

View File

@@ -3,7 +3,7 @@
<el-card class="topCard">
<div class="topDiv">
<span style="margin-left: 10px">工位号</span>
<el-select v-model="stationNumberValue" placeholder="请选择工位号" size="small" style="width: 250px" @change="searchTable">
<el-select v-model="stationNumberValue" placeholder="请选择工位号" filterable clearable size="small" style="width: 250px" @change="searchTable">
<el-option
v-for="item in stationNumber"
:key="item.value"
@@ -12,7 +12,7 @@
size="mini"/>
</el-select>
<span style="margin-left: 10px">产品型号</span>
<el-select v-model="engineTypeValue" placeholder="请选择产品型号" size="small" style="width: 150px" @change="searchTable">
<el-select v-model="engineTypeValue" placeholder="请选择产品型号" filterable size="small" style="width: 150px" @change="searchTable">
<el-option
v-for="item in engineType"
:key="item.value"
@@ -30,6 +30,7 @@
size="mini"/>
</el-select>
<el-button type="primary" plain size="small" icon="el-icon-search" @click="searchTable()">查询</el-button>
<el-button :loading="exportLoading" :disabled="exportLoading" type="info" size="small" icon="el-icon-download" @click="exportExcel">Excel</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addTo">新增</el-button>
<!-- <el-button type="success" size="small" plain icon="el-icon-document-copy" @click="copyOrder('form4')">复制工步</el-button>-->
</div>
@@ -44,6 +45,11 @@
style="width: 100%"
border
size="mini">
<el-table-column align="center" fixed label="工位号" width="100px">
<template slot-scope="scope">
{{ scope.row.工位号 }}
</template>
</el-table-column>
<el-table-column align="center" fixed label="版本号" width="80px">
<template slot-scope="scope">
{{ scope.row.版本号 }}
@@ -159,7 +165,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="工位号" prop="stationNumber" style="display: inline-block">
<el-select v-model="form.stationNumber" placeholder="请选择工位号" size="small" style="width: 150px">
<el-select v-model="form.stationNumber" placeholder="请选择工位号" size="small" style="width: 240px">
<el-option
v-for="item in stationNumber"
:key="item.value"
@@ -345,7 +351,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="工位号" prop="stationNumber" style="display: inline-block">
<el-select v-model="form1.stationNumber" placeholder="请选择工位号" size="small" style="width: 150px">
<el-select v-model="form1.stationNumber" placeholder="请选择工位号" size="small" style="width: 240px">
<el-option
v-for="item in stationNumber"
:key="item.value"
@@ -529,7 +535,7 @@
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible4" title="数据复制" center style="min-height: 200px" width="400px">
<el-form ref="form4" :model="form4" :rules="rules4" label-position="right" label-width="110px">
<el-form-item label="工位号" prop="engineTypeValue" style="display: inline-block">
<el-select v-model="form4.stationNumberValue" placeholder="请选择工位号" size="small">
<el-select v-model="form4.stationNumberValue" placeholder="请选择工位号" size="small" style="width: 240px">
<el-option
v-for="item in stationNumber"
:key="item.value"
@@ -698,6 +704,7 @@ export default {
labelText: '',
labelNumber: '',
loading1: false,
exportLoading: false,
dialogFormVisible: false,
dialogFormVisible1: false,
dialogFormVisible4: false,
@@ -821,7 +828,7 @@ export default {
},
mounted() {
setTimeout(() => {
this.searchTable()
this.searchTable(false)
}, 300)
},
methods: {
@@ -830,10 +837,6 @@ export default {
var param = []
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length) {
this.stationNumberValue = response.data[0].工位号
this.stationName = response.data[0].工位名称
}
for (let i = 0; i < response.data.length; i++) {
this.stationNumber.push({
label: `${response.data[i].工位号}${response.data[i].工位名称}`,
@@ -932,12 +935,26 @@ export default {
}
},
// 查询MES消息
searchTable() {
this.tableData = []
getQueryParam() {
var param = []
param[0] = ['产品型号代码', this.engineTypeValue]
param[1] = ['工位号', this.stationNumberValue]
param[1] = ['工位号', this.stationNumberValue || null]
param[2] = ['版本号', this.version]
return param
},
validateSearch(showWarning = true) {
if (!this.engineTypeValue) {
if (showWarning) this.$message.warning('请选择产品型号')
return false
}
return true
},
searchTable(showWarning = true) {
if (!this.validateSearch(showWarning)) {
return
}
this.tableData = []
var param = this.getQueryParam()
var Data = this.CreateData('11', '电子看板_工序内容_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length !== 0) {
@@ -953,6 +970,20 @@ export default {
}
})
},
exportExcel() {
if (!this.validateSearch()) {
return
}
if (this.tableData.length === 0) {
this.$message.warning('暂无数据')
return
}
var exportData = JSON.parse(this.CreateData('2005', '电子看板_工序内容_查询', this.getQueryParam()))
exportData.exportFileName = '工步内容维护'
exportData.exportColumns = '工位号,版本号,标记名称=标记,工步号=序号,操作内容=主要步骤,技术要求=关键要素,工步属性名称=工步类型,关联物料,扭矩=扭矩(Nm),等级,选装代码,数量,辅料号,辅料名称,工夹具名称,工夹具型号_序列号=工夹具型号/序列号'
var Data = JSON.stringify(exportData)
this.runExcelExport(Data, 'exportLoading')
},
selectDate3() {
this.tableData1 = []
var param = []
@@ -1478,4 +1509,3 @@ export default {
height: 100px;
}
</style>