feat: 增加一次合格率表格导出
This commit is contained in:
@@ -60,7 +60,10 @@
|
||||
<div class="panel table-panel">
|
||||
<div class="panel-title-row">
|
||||
<div class="panel-title">今日产品列表</div>
|
||||
<el-checkbox v-model="lineDataMap[line.key].onlyNG" size="mini" @change="$forceUpdate()">只看不合格</el-checkbox>
|
||||
<div class="panel-actions">
|
||||
<el-button :loading="exportLoading" :disabled="exportLoading" type="warning" plain size="mini" icon="el-icon-download" @click="exportLineProductList(line)">导出</el-button>
|
||||
<el-checkbox v-model="lineDataMap[line.key].onlyNG" size="mini" @change="$forceUpdate()">只看不合格</el-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-subtitle">
|
||||
合格 <span class="count-ok">{{ getPassCount(line.key) }}</span> 件
|
||||
@@ -151,7 +154,10 @@
|
||||
<div class="panel table-panel">
|
||||
<div class="panel-title-row">
|
||||
<div class="panel-title">产品明细</div>
|
||||
<el-checkbox v-model="stationOnlyNG" size="mini">只看不合格</el-checkbox>
|
||||
<div class="panel-actions">
|
||||
<el-button :loading="exportLoading" :disabled="exportLoading" type="warning" plain size="mini" icon="el-icon-download" @click="exportStationProductList">导出</el-button>
|
||||
<el-checkbox v-model="stationOnlyNG" size="mini">只看不合格</el-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="filteredStationProductList"
|
||||
@@ -200,6 +206,7 @@ export default {
|
||||
activeTab: 'line',
|
||||
queryDate: '',
|
||||
loading: false,
|
||||
exportLoading: false,
|
||||
pendingCount: 0,
|
||||
// 整线Tab
|
||||
lineConfigs: [
|
||||
@@ -361,6 +368,18 @@ export default {
|
||||
}
|
||||
return list
|
||||
},
|
||||
exportLineProductList(line) {
|
||||
if (this.getFilteredProductList(line.key).length === 0) {
|
||||
this.$message.warning('暂无数据')
|
||||
return
|
||||
}
|
||||
const param = [['查询日期', this.queryDate], ['SearchType', line.searchType]]
|
||||
const exportData = JSON.parse(this.CreateData('2005', '一次合格率_产品列表', param))
|
||||
exportData.exportFileName = `${line.title}一次合格率产品列表_`
|
||||
exportData.exportColumns = '发动机号=产品编号,产品型号=型号,上线时间,下线时间'
|
||||
const Data = JSON.stringify(exportData)
|
||||
this.runExcelExport(Data, 'exportLoading')
|
||||
},
|
||||
formatTime(val) {
|
||||
if (!val) return ''
|
||||
const d = new Date(val)
|
||||
@@ -405,6 +424,23 @@ export default {
|
||||
this.stationData = { total: 0, pass: 0, fail: 0, rate: 0, productList: [] }
|
||||
}).finally(() => { this.loading = false })
|
||||
},
|
||||
exportStationProductList() {
|
||||
const stationList = this.buildStationList()
|
||||
if (!this.startStation || !this.endStation || !stationList) {
|
||||
this.$message.warning('请选择有效的工位范围')
|
||||
return
|
||||
}
|
||||
if (this.filteredStationProductList.length === 0) {
|
||||
this.$message.warning('暂无数据')
|
||||
return
|
||||
}
|
||||
const param = [['查询日期', this.queryDate], ['工位号列表', stationList]]
|
||||
const exportData = JSON.parse(this.CreateData('2005', '一次合格率_工位合格率', param))
|
||||
exportData.exportFileName = '工位一次合格率产品明细_'
|
||||
exportData.exportColumns = '发动机号=产品编号,产品型号=型号,上线时间,下线时间'
|
||||
const Data = JSON.stringify(exportData)
|
||||
this.runExcelExport(Data, 'exportLoading')
|
||||
},
|
||||
|
||||
// ========== 不合格详情 ==========
|
||||
handleExpandChange(row, expandedRows) {
|
||||
@@ -707,6 +743,7 @@ export default {
|
||||
}
|
||||
.panel-title { font-size: 15px; font-weight: 700; color: #233445; }
|
||||
.panel-title-row { display: flex; justify-content: space-between; align-items: center; }
|
||||
.panel-actions { display: flex; align-items: center; gap: 10px; }
|
||||
.panel-subtitle { margin-top: 4px; margin-bottom: 10px; font-size: 12px; color: #6f7f8f; }
|
||||
.bar-canvas { width: 100%; min-height: 250px; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user