质检
This commit is contained in:
@@ -21,8 +21,19 @@ export function searchTable2(...params) {
|
|||||||
data: {
|
data: {
|
||||||
type: '1',
|
type: '1',
|
||||||
name: '车间生产管理_外协到货单明细_查询数据',
|
name: '车间生产管理_外协到货单明细_查询数据',
|
||||||
param: `外协到货单流水号=${params[2]}`,
|
param: `外协到货单流水号=${params[0]}`
|
||||||
Pagination: params[0] + '&' + params[1]
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询外协到货单明细
|
||||||
|
export function searchTableDetail(...params) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '质检管理_外协质检数据_查询数据',
|
||||||
|
param: `检测类型=${params[0]}&外协到货单明细流水号=${params[1]}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
@size-change="handleSizeChange1"
|
@size-change="handleSizeChange1"
|
||||||
@current-change="handleCurrentChange1"/>
|
@current-change="handleCurrentChange1"/>
|
||||||
</div>
|
</div>
|
||||||
<el-table v-loading="" :data="tableData2" show-summary stripe border style="width: 100%;max-height: 600px;" height="600px" size="mini">
|
<el-table v-loading="" :data="tableData2" :summary-method="getSummaries" show-summary border style="width: 100%" size="mini">
|
||||||
<el-table-column label="序号" align="center" width="80" type="index"/>
|
<el-table-column label="序号" align="center" width="80" type="index"/>
|
||||||
<el-table-column label="零件名称" align="center" min-width="100">
|
<el-table-column label="零件名称" align="center" min-width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.零件名称 }}
|
{{ scope.row.零件名称 }}
|
||||||
</template>
|
</template>
|
||||||
@@ -45,17 +45,17 @@
|
|||||||
{{ scope.row.零件图号 }}
|
{{ scope.row.零件图号 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="零件数量" align="center" min-width="120">
|
<el-table-column label="零件数量" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.批次数量 }}
|
{{ scope.row.批次数量 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="检验数量" align="center" min-width="100">
|
<el-table-column label="检验数量" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.检验数量 || 0 }}
|
{{ scope.row.检验数量 || 0 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="不合格数量" align="center" min-width="100">
|
<el-table-column label="不合格数量" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.不合格数量 || 0 }}
|
{{ scope.row.不合格数量 || 0 }}
|
||||||
</template>
|
</template>
|
||||||
@@ -65,39 +65,88 @@
|
|||||||
{{ scope.row.检验时间 || '—' }}
|
{{ scope.row.检验时间 || '—' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="形位" align="center" min-width="100">
|
<el-table-column label="形位" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.形位 }}
|
<el-popover placement="right" width="500" trigger="click">
|
||||||
|
<el-table :data="gridData" highlight-current-row size="mini">
|
||||||
|
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||||
|
<el-table-column min-width="150" align="center" label="类别">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.类别 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column min-width="100" align="center" label="数值">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.数值 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column min-width="100" align="center" label="零件数量">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.零件数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-button slot="reference" type="success" plain size="mini" icon="el-icon-search" @click="searchTableDetail(1, scope.row.外协到货单明细流水号)">形位</el-button>
|
||||||
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="尺寸" align="center" min-width="100">
|
<el-table-column label="尺寸" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.尺寸 }}
|
<el-popover placement="right" width="500" trigger="click">
|
||||||
|
<el-table :data="gridData" highlight-current-row size="mini">
|
||||||
|
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||||
|
<el-table-column min-width="150" align="center" label="类别">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.类别 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column min-width="100" align="center" label="数值">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.数值 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column min-width="100" align="center" label="零件数量">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.零件数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-button slot="reference" type="success" plain size="mini" icon="el-icon-search" @click="searchTableDetail(2, scope.row.外协到货单明细流水号)">尺寸</el-button>
|
||||||
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="外观" align="center" min-width="100">
|
<el-table-column label="外观" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.外观 }}
|
<el-popover placement="right" width="500" trigger="click">
|
||||||
|
<el-table :data="gridData" highlight-current-row size="mini">
|
||||||
|
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||||
|
<el-table-column min-width="150" align="center" label="类别">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.类别 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column min-width="100" align="center" label="数值">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.数值 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column min-width="100" align="center" label="零件数量">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.零件数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-button slot="reference" type="success" plain size="mini" icon="el-icon-search" @click="searchTableDetail(3, scope.row.外协到货单明细流水号)">外观</el-button>
|
||||||
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="block" style="margin: 10px 0;">
|
|
||||||
<el-pagination
|
|
||||||
:current-page="pageCurrent2"
|
|
||||||
:page-sizes="[10, 20, 30, 40]"
|
|
||||||
:page-size="pageSize2"
|
|
||||||
:total="total2"
|
|
||||||
style="display:inline-block;width:50%"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
@size-change="handleSizeChange2"
|
|
||||||
@current-change="handleCurrentChange2"/>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { searchTable1, searchTable2 } from '@/api/Outsourcing/OutsourcingQCSearch'
|
import { searchTable1, searchTable2, searchTableDetail } from '@/api/Outsourcing/OutsourcingQCSearch'
|
||||||
export default {
|
export default {
|
||||||
name: 'OutsourcingQCSearch',
|
name: 'OutsourcingQCSearch',
|
||||||
data() {
|
data() {
|
||||||
@@ -109,13 +158,72 @@ export default {
|
|||||||
tableData2: [],
|
tableData2: [],
|
||||||
pageCurrent2: 1,
|
pageCurrent2: 1,
|
||||||
pageSize2: 10,
|
pageSize2: 10,
|
||||||
total2: 0
|
total2: 0,
|
||||||
|
gridData: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.searchTable1()
|
this.searchTable1()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 合计
|
||||||
|
getSummaries(param) {
|
||||||
|
const { columns, data } = param
|
||||||
|
const sums = []
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
sums[index] = '总价'
|
||||||
|
} else if (index === 3) {
|
||||||
|
const values = data.map(item => Number(item['批次数量']))
|
||||||
|
if (!values.every(value => isNaN(value))) {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return Number((prev + curr).toFixed(2))
|
||||||
|
} else {
|
||||||
|
return Number((prev).toFixed(2))
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else {
|
||||||
|
sums[index] = 'N/A'
|
||||||
|
}
|
||||||
|
} else if (index === 4) {
|
||||||
|
const values = data.map(item => Number(item['检验数量']))
|
||||||
|
if (!values.every(value => isNaN(value))) {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return Number((prev + curr).toFixed(2))
|
||||||
|
} else {
|
||||||
|
return Number((prev).toFixed(2))
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else {
|
||||||
|
sums[index] = 'N/A'
|
||||||
|
}
|
||||||
|
} else if (index === 5) {
|
||||||
|
const values = data.map(item => Number(item['不合格数量']))
|
||||||
|
if (!values.every(value => isNaN(value))) {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return Number((prev + curr).toFixed(2))
|
||||||
|
} else {
|
||||||
|
return Number((prev).toFixed(2))
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else {
|
||||||
|
sums[index] = 'N/A'
|
||||||
|
}
|
||||||
|
} else if (index === 6) {
|
||||||
|
sums[index] = '检验比例:' + ((sums[4] / sums[3]) * 100).toFixed(2) + '%'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
},
|
||||||
// 查询到货单列表
|
// 查询到货单列表
|
||||||
searchTable1() {
|
searchTable1() {
|
||||||
searchTable1(this.pageCurrent1, this.pageSize1).then(response => {
|
searchTable1(this.pageCurrent1, this.pageSize1).then(response => {
|
||||||
@@ -135,19 +243,15 @@ export default {
|
|||||||
},
|
},
|
||||||
searchTable2(row) {
|
searchTable2(row) {
|
||||||
console.log(row, 2)
|
console.log(row, 2)
|
||||||
searchTable2(this.pageCurrent2, this.pageSize2, row.外协到货单流水号).then(response => {
|
searchTable2(row.外协到货单流水号).then(response => {
|
||||||
this.tableData2 = response.data.rows
|
this.tableData2 = response.data
|
||||||
this.total2 = response.data.total
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleSizeChange2(val) {
|
searchTableDetail(type, num) {
|
||||||
this.pageSize2 = val
|
searchTableDetail(type, num).then(response => {
|
||||||
this.pageCurrent2 = 1
|
this.gridData = response.data
|
||||||
this.searchTable2()
|
})
|
||||||
},
|
console.log(type)
|
||||||
handleCurrentChange2(val) {
|
|
||||||
this.pageCurrent2 = val
|
|
||||||
this.searchTable2()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user