This commit is contained in:
liushuai
2019-06-21 14:54:24 +08:00
5 changed files with 340 additions and 10 deletions

View File

@@ -0,0 +1,39 @@
import request from '@/utils/request'
// 查询外协到货单列表
export function searchTable1(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理_外协到货单_查询数据',
param: ``,
Pagination: params[0] + '&' + params[1]
}
})
}
// 查询外协到货单明细
export function searchTable2(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理_外协到货单明细_查询数据',
param: `外协到货单流水号=${params[0]}`
}
})
}
// 查询外协到货单明细
export function searchTableDetail(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '质检管理_外协质检数据_查询数据',
param: `检测类型=${params[0]}&外协到货单明细流水号=${params[1]}`
}
})
}

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1545978796022" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1103" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M835.584 1016.32H50.176c-14.336 0-25.6-11.264-25.6-25.6V76.8c0-14.336 11.264-25.6 25.6-25.6h545.28c6.656 0 13.312 2.56 17.92 7.68l240.128 240.64c4.608 4.608 7.68 11.264 7.68 17.92v673.28c0 14.336-11.264 25.6-25.6 25.6z m-759.808-51.2h734.208V328.192l-225.28-225.792H75.776v862.72z" p-id="1104"></path><path d="M835.584 343.04h-240.128c-14.336 0-25.6-11.264-25.6-25.6V76.8c0-14.336 11.264-25.6 25.6-25.6s25.6 11.264 25.6 25.6v215.04h214.528c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM688.128 865.792c-6.656 0-13.312-2.56-17.92-7.68l-99.84-99.84c-4.608-4.608-7.68-11.264-7.68-17.92 0-6.656 2.56-13.312 7.68-17.92l99.84-99.328c10.24-9.728 26.112-9.728 36.352 0 9.728 10.24 9.728 26.112 0 36.352l-81.92 80.896 81.92 81.92c10.24 10.24 10.24 26.112 0 36.352-5.12 4.608-11.776 7.168-18.432 7.168zM574.464 428.544H247.808c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h326.656c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM574.464 604.672H247.808c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h326.656c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6z" p-id="1105"></path><path d="M984.064 769.024h-345.6c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h345.6c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM376.32 770.56H247.808c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h128.512c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6z" p-id="1106"></path></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -128,7 +128,7 @@ export function groupBy(datas, keys) {
group.data1 = group.data1 || 0
group.key.数量 = group.data1 += v.数量
group.data2 = group.data2 || ''
group.key.机床图号_组号 = group.data2 += (v.机床图号 || '') + '-' + (v.组号 ? v.组号.split('组')[0] : '') + ';'
group.key.机床图号_组号 = group.data2 += (v.机床图号 || '') + '-' + (v.组号 ? v.组号.split('组')[0] : '') + ' '
group.data3 = group.data3 || 0
group.key.合计 = group.data3 += v.合计
})

View File

@@ -1,10 +1,259 @@
<template>
<div>123</div>
<div class="app-container">
<el-card>
<div slot="header">
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</div>
<el-table v-loading="" :data="tableData1" border style="width: 100%;max-height: 600px;" height="440px" size="mini" @row-click="searchTable2">
<el-table-column label="序号" align="center" width="80" type="index"/>
<el-table-column label="外协到货单号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.外协到货单编号 }}
</template>
</el-table-column>
<el-table-column label="外协厂家" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.外协厂家名称 }}
</template>
</el-table-column>
<el-table-column label="操作日期" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.操作日期 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<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" min-width="120">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column label="检验数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.检验数量 || 0 }}
</template>
</el-table-column>
<el-table-column label="不合格数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.不合格数量 || 0 }}
</template>
</el-table-column>
<el-table-column label="检验时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.检验时间 || '—' }}
</template>
</el-table-column>
<el-table-column label="形位" align="center" width="100">
<template slot-scope="scope">
<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>
</el-table-column>
<el-table-column label="尺寸" align="center" width="100">
<template slot-scope="scope">
<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>
</el-table-column>
<el-table-column label="外观" align="center" width="100">
<template slot-scope="scope">
<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>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchTable1, searchTable2, searchTableDetail } from '@/api/Outsourcing/OutsourcingQCSearch'
export default {
name: 'OutsourcingQCSearch'
name: 'OutsourcingQCSearch',
data() {
return {
tableData1: [],
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
tableData2: [],
pageCurrent2: 1,
pageSize2: 10,
total2: 0,
gridData: []
}
},
mounted() {
this.searchTable1()
},
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(this.pageCurrent1, this.pageSize1).then(response => {
console.log(response.data, 1)
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2(row) {
console.log(row, 2)
searchTable2(row.外协到货单流水号).then(response => {
this.tableData2 = response.data
})
},
searchTableDetail(type, num) {
searchTableDetail(type, num).then(response => {
this.gridData = response.data
})
console.log(type)
}
}
}
</script>

View File

@@ -9,16 +9,26 @@
<el-badge :value="sudoku.value">
<svg-icon :icon-class="sudoku.icon" style="border: 1px solid black;background-color: #555c66" />
<router-link :to="sudoku.router">{{ sudoku.name }}</router-link>
<!--<a size="small" type="text" href="/Assembly/DeliveryConfirmation">{{sudoku.name}}</a>-->
</el-badge>
</div>
<div/>
</el-card>
<el-divider content-position="right"/>
<!--<div class="sudoku_item " :class="curSelect==sudoku.id?'opacity':''" v-for="(sudoku,index) in sudokus" :key="index" @touchstart="touchstart(index)" @touchend="touchend">-->
<!--&lt;!&ndash;<img :src="sudoku.img_src" width="40" height="40" >&ndash;&gt;-->
<!---->
<!--</div>-->
<div v-if="Number(token)===2" style="width:100%">
<el-divider content-position="right">待分配零件数</el-divider>
<el-row>
<el-col v-for="(machine,index) in machines" :key="index" style="width: 200px">
<el-card shadow="hover" class="sudoku_item" style="height:80px;width: 90%" @click.native="clickCard()">
<el-badge :value="machine.未分配零件数">
<div style="width: 100px;height:50px;margin:0" class="sudoku_item">
{{ machine.机床图号 }}
</div>
</el-badge>
</el-card>
</el-col>
</el-row>
<el-divider content-position="right"/>
</div>
</div>
</div>
</el-card>
@@ -35,7 +45,9 @@ export default {
sudokus: [],
curSelect: null,
number: '',
timer: ''
timer: '',
timer2: '',
machines: []
}
},
computed: {
@@ -47,11 +59,18 @@ export default {
mounted() {
this.getFileList()
this.timer = setInterval(this.getFileList, 60 * 60 * 1000) // 60 分钟一刷新
this.searchUnallocatePartNumber()
this.timer2 = setInterval(this.searchUnallocatePartNumber, 20 * 60 * 1000) // 20 分钟一刷新
},
beforeDestroy() {
clearInterval(this.timer)
clearInterval(this.timer2)
},
methods: {
// 选择机床
clickCard() {
this.$router.push({ path: '/PurchaseTaskAllocate/index' })
},
async getFileList() {
await request({
url: '',
@@ -85,6 +104,28 @@ export default {
value: res.data[0].Column1
})
})
},
async searchUnallocatePartNumber() {
this.machines = []
await request({
url: '',
method: 'post',
data: {
type: '3',
name: ` select 项目流水号,机床流水号,机床图号,sum(未分配零件数) as 未分配零件数 from (
select 项目流水号,机床流水号,机床图号,COUNT(*) as 未分配零件数 from MRP_计划订单_组件零件清单_标准件和外购件_视图
where 人员编号 is null
group by 项目流水号,机床流水号,机床图号
union all
select 项目流水号,机床流水号,机床图号,COUNT(*) as 未分配零件数 from MRP_计划订单_组件零件清单_基本件_视图
where 人员编号 is null
group by 项目流水号,机床流水号,机床图号
) as tb1
group by 项目流水号,机床流水号,机床图号`
}
}).then(res => {
this.machines = res.data
})
}
}
}