a
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
</el-select>
|
||||
<el-button type="primary" size="small" icon="el-icon-search" style="margin-left: 15px;margin-top: 5px" plain @click="pageSize=10; pageCurrent= 1;selecttable()">查询</el-button>
|
||||
<el-tooltip :open-delay="1000" effect="dark" content="导出查询数据" placement="top">
|
||||
<el-button type="warning" size="small" icon="el-icon-download" plain style="margin-left:10px" @click="exportExcel()">导出</el-button>
|
||||
<el-button v-positive="'loading'" type="warning" size="small" icon="el-icon-download" plain style="margin-left:10px" @click="exportExcel()">导出</el-button>
|
||||
</el-tooltip>
|
||||
<el-button type="distribution" size="small" icon="el-icon-circle-plus-outline" plain style="margin-left:10px" @click="AddTableData()">新增</el-button>
|
||||
</el-row>
|
||||
|
||||
@@ -15,15 +15,11 @@
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<!--<el-select v-model="ModelValue" placeholder="规格" style="width: 150px;margin-top: 10px;margin-bottom: 5px" filterable size="small" clearable="">-->
|
||||
<!--<el-option-->
|
||||
<!--v-for="item in Model"-->
|
||||
<!--:key="item.value"-->
|
||||
<!--:label="item.label"-->
|
||||
<!--:value="item.value"/>-->
|
||||
<!--</el-select>-->
|
||||
<el-input v-model="ModelValue" placeholder="名称规格型号" style="width: 180px" size="small" clearable/>
|
||||
<el-button icon="el-icon-search" type="primary" plain size="small" @click="pageCurrentWB = 1;pageSizeWB = 1000;pageCurrent = 1;pageSize = 1000;getTableData()">查询</el-button>
|
||||
<el-tooltip :open-delay="1000" effect="dark" content="导出查询数据" placement="top">
|
||||
<el-button v-positive="'loading'" type="warning" size="small" icon="el-icon-download" plain style="margin-left:10px" @click="exportExcel()">导出</el-button>
|
||||
</el-tooltip>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div v-for="(file, key) in hadFile" :key="key">
|
||||
@@ -42,7 +38,7 @@
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<h3>自制件</h3>
|
||||
<div style="font-size: 22px;font-weight: bold;margin-top: 5px">自制件</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
@@ -175,21 +171,14 @@
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<h3>外购件</h3>
|
||||
<el-table
|
||||
v-loading="loadingWB"
|
||||
:data="tableDataWB"
|
||||
style="width: 100%;min-height: 600px;"
|
||||
size="mini"
|
||||
stripe
|
||||
height="500"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
align="center"
|
||||
type="index"
|
||||
width="50"/>
|
||||
<div style="font-size: 22px;font-weight: bold;margin-top: 5px">
|
||||
外购件
|
||||
<el-tooltip :open-delay="1000" effect="dark" content="导出查询数据" placement="top">
|
||||
<el-button v-positive="'loading'" type="warning" size="small" icon="el-icon-download" plain style="float: right;margin: 3px 150px 5px 0" @click="exportExcel2()">导出</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<el-table v-loading="loadingWB" :data="tableDataWB" style="width: 100%;min-height: 600px;" size="mini" stripe height="500" highlight-current-row border>
|
||||
<el-table-column label="序号" align="center" type="index" width="50"/>
|
||||
<el-table-column align="center" prop="物料名称" label="物料名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料名称 }}
|
||||
@@ -328,11 +317,6 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// machine(val) {
|
||||
// if (val.length > 0) {
|
||||
// this.machineValue = val[0].value
|
||||
// }
|
||||
// },
|
||||
machineValue(val) {
|
||||
this.groupValue = ''
|
||||
this.group = []
|
||||
@@ -359,6 +343,42 @@ export default {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
exportExcel() {
|
||||
if (this.tableData.length === 0) {
|
||||
this.$message.warning('请先查询要导出的数据')
|
||||
} else {
|
||||
const machine_check = this.machineValue ? 1 : 0
|
||||
const group_check = this.groupValue ? 1 : 0
|
||||
const Model_check = this.ModelValue ? 1 : 0
|
||||
var param = []
|
||||
param[0] = ['机床流水号_check', machine_check]
|
||||
param[1] = ['机床流水号', this.machineValue]
|
||||
param[2] = ['组件流水号_check', group_check]
|
||||
param[3] = ['组件流水号', this.groupValue]
|
||||
param[4] = ['规格_check', Model_check]
|
||||
param[5] = ['规格', this.ModelValue]
|
||||
var Data = this.CreateData('2001', '报表_PDM_零件明细表_基本件_查询数据_综合gj', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
}
|
||||
},
|
||||
exportExcel2() {
|
||||
if (this.tableDataWB.length === 0) {
|
||||
this.$message.warning('请先查询要导出的数据')
|
||||
} else {
|
||||
const machine_check = this.machineValue ? 1 : 0
|
||||
const group_check = this.groupValue ? 1 : 0
|
||||
const Model_check = this.ModelValue ? 1 : 0
|
||||
var param = []
|
||||
param[0] = ['机床流水号_check', machine_check]
|
||||
param[1] = ['机床流水号', this.machineValue]
|
||||
param[2] = ['组件流水号_check', group_check]
|
||||
param[3] = ['组件流水号', this.groupValue]
|
||||
param[4] = ['规格_check', Model_check]
|
||||
param[5] = ['规格', this.ModelValue]
|
||||
var Data = this.CreateData('2001', '报表_PDM_零件明细表_标准件和外购件_查询数据', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
}
|
||||
},
|
||||
// 在什么情况下需要查询上传的附件,调用this.getFileData()即可根据
|
||||
getFileData(machineValue) {
|
||||
this.hadFile = []
|
||||
@@ -394,11 +414,9 @@ export default {
|
||||
param[2] = group_check
|
||||
param[3] = this.groupValue
|
||||
this.getSelect(searchModel, ['规格', '规格'], 'Model', param)
|
||||
console.log(this.Model, 989898)
|
||||
},
|
||||
getTableData() {
|
||||
this.getFileData(this.machineValue)
|
||||
console.log(this.hadFile, 88899)
|
||||
if (this.machineValue) {
|
||||
const machine_check = this.machineValue ? 1 : 0
|
||||
const group_check = this.groupValue ? 1 : 0
|
||||
@@ -408,7 +426,6 @@ export default {
|
||||
this.loading = false
|
||||
const res = response.data
|
||||
this.total = res.total
|
||||
console.log(this.tableData)
|
||||
this.tableData = res.rows.map(item => {
|
||||
if (item.整改类型 === '1') {
|
||||
item.整改类型 = '新增'
|
||||
@@ -432,7 +449,6 @@ export default {
|
||||
const data = response.data
|
||||
this.totalWB = data.total
|
||||
this.tableDataWB = data.rows.map(item => {
|
||||
console.log(item)
|
||||
if (item.整改类型 === '1') {
|
||||
item.整改类型 = '新增'
|
||||
} else if (item.整改类型 === '2') {
|
||||
|
||||
Reference in New Issue
Block a user