领用加机床分组
This commit is contained in:
@@ -11,15 +11,39 @@ export function initProject() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 机床查询
|
||||||
|
export function searchMachine(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: 'PDM_机床名称_查询数据',
|
||||||
|
param: '项目流水号_check=1&项目流水号=' + num
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 分组查询
|
||||||
|
export function searchGroup(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: 'PDM_组件名称_查询数据',
|
||||||
|
param: '机床流水号=' + num
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
// 初始化项目金额统计表
|
// 初始化项目金额统计表
|
||||||
export function searchReceiveCheck(check, num) {
|
export function searchReceiveCheck(check1, num1, check2, num2, check3, num3) {
|
||||||
return request({
|
return request({
|
||||||
url: '',
|
url: '',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
type: '1',
|
type: '1',
|
||||||
name: '采购管理_领用核算_查询数据',
|
name: '采购管理_领用核算_查询数据',
|
||||||
param: `项目流水号_check=${check}&项目流水号=${num}`
|
param: `项目流水号_check=${check1}&项目流水号=${num1}&机床流水号_check=${check2}&机床流水号=${num2}&组件流水号_check=${check3}&组件流水号=${num3}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,21 +2,38 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card>
|
<el-card>
|
||||||
<span>项目名称:</span>
|
<span>项目名称:</span>
|
||||||
<el-select v-model="projectValue" style="width:200px" placeholder="请选择" size="small" clearable filterable>
|
<el-select v-model="projectValue" style="width:200px" placeholder="请选择" size="small" clearable filterable @change="projectChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in project"
|
v-for="item in project"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"/>
|
:value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<span>机床图号:</span>
|
||||||
|
<el-select v-model="machineValue" style="width:200px" placeholder="请选择" size="small" clearable filterable @change="machineChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in machine"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"/>
|
||||||
|
</el-select>
|
||||||
|
<span>组号:</span>
|
||||||
|
<el-select v-model="groupValue" style="width:200px" placeholder="请选择" size="small" clearable filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in group"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"/>
|
||||||
|
</el-select>
|
||||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="searchProject()">查询</el-button>
|
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="searchProject()">查询</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card style="margin-top: 15px">
|
<el-card style="margin-top: 15px">
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData1"
|
:data="tableData1"
|
||||||
|
:summary-method="getSummaries"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
height="440"
|
height="650"
|
||||||
size="mini"
|
size="mini"
|
||||||
show-summary
|
show-summary
|
||||||
stripe
|
stripe
|
||||||
@@ -27,6 +44,16 @@
|
|||||||
{{ scope.row.项目名称 }}
|
{{ scope.row.项目名称 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="机床图号" width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="组号" width="80px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.组号 || '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column align="center" label="物料名称">
|
<el-table-column align="center" label="物料名称">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.物料名称 }}
|
{{ scope.row.物料名称 }}
|
||||||
@@ -44,7 +71,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="小计(元)" prop="小计">
|
<el-table-column align="center" label="小计(元)" prop="小计">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.小计 }}
|
{{ scope.row.小计.toFixed(2) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="单价">
|
<el-table-column align="center" label="单价">
|
||||||
@@ -68,27 +95,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { initProject, searchReceiveCheck } from '@/api/PurchasingCenter/ReceiveCheck'
|
import { initProject, searchMachine, searchGroup, searchReceiveCheck } from '@/api/PurchasingCenter/ReceiveCheck'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
projectValue: '', // 项目名称
|
projectValue: '', // 项目名称
|
||||||
project: [],
|
project: [],
|
||||||
|
machineValue: '',
|
||||||
|
machine: [],
|
||||||
|
groupValue: '',
|
||||||
|
group: [],
|
||||||
tableData1: [],
|
tableData1: [],
|
||||||
check1: '',
|
check1: '',
|
||||||
pageCurrent: 1,
|
pageCurrent: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0
|
||||||
form: {
|
|
||||||
项目名称: '',
|
|
||||||
物料名称: '',
|
|
||||||
物料规格: '',
|
|
||||||
物料型号: '',
|
|
||||||
数量: '',
|
|
||||||
单价: '',
|
|
||||||
小计: ''
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -98,11 +119,62 @@ export default {
|
|||||||
fetchData() {
|
fetchData() {
|
||||||
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
|
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
|
||||||
},
|
},
|
||||||
|
projectChange() {
|
||||||
|
this.machine = []
|
||||||
|
searchMachine(this.projectValue).then(response => {
|
||||||
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
|
this.machine.push({
|
||||||
|
value: response.data[i].机床流水号,
|
||||||
|
label: response.data[i].机床图号
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
machineChange() {
|
||||||
|
this.group = []
|
||||||
|
searchGroup(this.machineValue).then(response => {
|
||||||
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
|
this.group.push({
|
||||||
|
value: response.data[i].组件流水号,
|
||||||
|
label: response.data[i].组号
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getSummaries(param) {
|
||||||
|
const { columns, data } = param
|
||||||
|
const sums = []
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
sums[index] = '总价'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const values = data.map(item => Number(item[column.property]))
|
||||||
|
if (!values.every(value => isNaN(value))) {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] = sums[index].toFixed(2)
|
||||||
|
sums[index] += ' 元'
|
||||||
|
} else {
|
||||||
|
sums[index] = ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
},
|
||||||
searchProject() { // 查询
|
searchProject() { // 查询
|
||||||
if (!this.projectValue) {
|
if (!this.projectValue) {
|
||||||
this.$message.error('请选择项目')
|
this.$message.error('请选择项目')
|
||||||
} else {
|
} else {
|
||||||
searchReceiveCheck(1, this.projectValue).then(response => {
|
let check2, check3
|
||||||
|
this.machineValue ? check2 = 1 : check2 = 0
|
||||||
|
this.groupValue ? check3 = 1 : check3 = 0
|
||||||
|
searchReceiveCheck(1, this.projectValue, check2, this.machineValue, check3, this.groupValue).then(response => {
|
||||||
this.tableData1 = response.data
|
this.tableData1 = response.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -112,5 +184,13 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.el-select{
|
||||||
|
width:200px
|
||||||
|
}
|
||||||
|
.el-input{
|
||||||
|
width:200px
|
||||||
|
}
|
||||||
|
span{
|
||||||
|
margin: 10px 0 10px 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user