采购件出库记录

This commit is contained in:
chenjianan
2019-05-18 16:41:03 +08:00
parent 48b415e74d
commit 8503eff9c3
3 changed files with 213 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
import request from '@/utils/request'
// 初始化项目
export function initProject() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_项目名称_查询数据_按时间排序'
}
})
}
// 机床查询
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 searchRecord(project, machine, group, name, spec, model) {
let execName = `select PDM_机床名称.项目流水号,PDM_组件名称.机床流水号,出库记录.* from(select 组件流水号,名称,物料规格 as 规格,物料型号 as 图号或型号,出库数量,备注 as 领料人,滞货出库时间 as 出库时间 from 车间装配管理_领料单_领料单明细 where 滞货出库时间 is not null
union
select 组件流水号,物料名称 as 名称,物料规格 as 规格,物料型号 as 图号或型号,出库数量,备注 as 领料人,出库时间 from 库存管理_基础表_离线采购件出库
inner join 库存管理_物料主文件_基本 on 库存管理_物料主文件_基本.物料流水号 = 库存管理_基础表_离线采购件出库.物料流水号
union
select 组件流水号,物料名称 as 名称,物料规格 as 规格,物料型号 as 图号或型号,出库数量,库存管理_基础表_外购件出库.备注 as 领料人,出库时间 from 库存管理_基础表_外购件出库
inner join 采购管理_采购合同明细_采购部 on 采购管理_采购合同明细_采购部.采购合同明细流水号 = 库存管理_基础表_外购件出库.采购合同明细流水号
left join MRP_计划订单_组件零件清单 on MRP_计划订单_组件零件清单.组件零件流水号 = 采购管理_采购合同明细_采购部.组件零件流水号
inner join MRP_计划订单_机床组件清单 on MRP_计划订单_机床组件清单.机床组件流水号 = MRP_计划订单_组件零件清单.机床组件流水号
inner join 库存管理_物料主文件_基本 on 库存管理_物料主文件_基本.物料流水号 = MRP_计划订单_组件零件清单.物料流水号
union
select 组件流水号,'' as 规格,零件图号 as 图号或型号,零件名称 as 名称,出库数量,库存管理_基础表_外购件出库.备注 as 领料人,出库时间 from 库存管理_基础表_外购件出库
inner join 采购管理_采购合同明细_采购部 on 采购管理_采购合同明细_采购部.采购合同明细流水号 = 库存管理_基础表_外购件出库.采购合同明细流水号
left join MRP_计划订单_组件零件清单_基本件_采购 on MRP_计划订单_组件零件清单_基本件_采购.组件零件基本件流水号 = 采购管理_采购合同明细_采购部.组件零件基本件流水号
inner join PDM_零件明细表_基本件 on PDM_零件明细表_基本件.基本件流水号 = MRP_计划订单_组件零件清单_基本件_采购.基本件流水号
) as 出库记录 inner join PDM_组件名称 on PDM_组件名称.组件流水号 = 出库记录.组件流水号 inner join PDM_机床名称 on PDM_机床名称.机床流水号 = PDM_组件名称.机床流水号
where PDM_组件名称.组件流水号 is not null`
if (project) { execName += ` and PDM_机床名称.项目流水号 = ${project} ` }
if (machine) { execName += ` and PDM_组件名称.机床流水号 = ${machine} ` }
if (group) { execName += ` and PDM_组件名称.组件流水号 = ${group} ` }
if (name) { execName += ` and 出库记录.名称 like '%${name}%' ` }
if (spec) { execName += ` and 出库记录.规格 like '%${spec}%' ` }
if (model) { execName += ` and 出库记录.图号或型号 like '%${model}%' ` }
return request({
url: '',
method: 'post',
data: {
type: '3',
name: execName
}
})
}

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="1545972017991" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1585" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M905.216 401.408 905.216 401.408c-26.624-28.672-65.536-45.056-104.448-45.056-4.096 0-8.192 0-10.24 0L790.528 180.224c0-18.432-16.384-34.816-34.816-34.816L108.544 145.408c-18.432 0-34.816 16.384-34.816 34.816l0 647.168c0 18.432 16.384 34.816 34.816 34.816l647.168 0c18.432 0 34.816-16.384 34.816-34.816l0-176.128c4.096 0 6.144 0 10.24 0 40.96 0 77.824-16.384 104.448-43.008 26.624-26.624 43.008-63.488 43.008-104.448C948.224 462.848 931.84 428.032 905.216 401.408zM448.512 188.416l286.72 0 0 182.272c-14.336 8.192-26.624 16.384-38.912 28.672-20.48 20.48-34.816 45.056-40.96 75.776L448.512 475.136 448.512 188.416zM415.744 794.624l-286.72 0 0-286.72 286.72 0L415.744 794.624zM415.744 475.136l-286.72 0 0-286.72 286.72 0L415.744 475.136zM735.232 794.624l-286.72 0 0-286.72 204.8 0c2.048 38.912 18.432 73.728 43.008 100.352 10.24 10.24 24.576 20.48 38.912 26.624L735.232 794.624zM800.768 608.256c-57.344 0-104.448-47.104-104.448-104.448 0-57.344 47.104-104.448 104.448-104.448s104.448 47.104 104.448 104.448C905.216 561.152 858.112 608.256 800.768 608.256z" p-id="1586"></path><path d="M849.92 460.8 849.92 460.8c4.096-4.096 12.288-4.096 18.432 0 4.096 4.096 4.096 12.288 0 18.432l-79.872 79.872c-4.096 6.144-12.288 6.144-18.432 0l0 0-36.864-36.864c-4.096-4.096-4.096-12.288 0-18.432 6.144-4.096 12.288-4.096 18.432 0L778.24 532.48 849.92 460.8 849.92 460.8z" p-id="1587"></path><path d="M301.056 593.92 301.056 593.92c6.144-6.144 16.384-6.144 22.528 0 6.144 6.144 6.144 16.384 0 22.528L286.72 655.36l38.912 38.912c6.144 6.144 6.144 16.384 0 22.528-6.144 6.144-16.384 6.144-22.528 0l-38.912-38.912-38.912 38.912c-6.144 6.144-16.384 6.144-22.528 0-6.144-6.144-6.144-16.384 0-22.528l38.912-38.912-38.912-38.912c-6.144-6.144-6.144-16.384 0-22.528 6.144-6.144 16.384-6.144 22.528 0l38.912 38.912L301.056 593.92 301.056 593.92z" p-id="1588"></path><path d="M245.76 253.952 245.76 253.952c0-8.192 8.192-16.384 16.384-16.384 8.192 0 16.384 8.192 16.384 16.384l0 55.296 55.296 0c8.192 0 16.384 6.144 16.384 16.384 0 8.192-8.192 16.384-16.384 16.384l-55.296 0 0 55.296c0 10.24-8.192 16.384-16.384 16.384-10.24 0-16.384-8.192-16.384-16.384l0-55.296L190.464 342.016c-10.24 0-16.384-8.192-16.384-16.384 0-10.24 8.192-16.384 16.384-16.384L245.76 309.248 245.76 253.952 245.76 253.952z" p-id="1589"></path><path d="M665.6 671.744 665.6 671.744c8.192 0 16.384 8.192 16.384 16.384 0 8.192-8.192 16.384-16.384 16.384-120.832 0-22.528 0-143.36 0-8.192 0-16.384-8.192-16.384-16.384 0-8.192 6.144-16.384 16.384-16.384C641.024 671.744 544.768 671.744 665.6 671.744L665.6 671.744z" p-id="1590"></path><path d="M665.6 606.208 665.6 606.208c8.192 0 16.384 8.192 16.384 16.384 0 8.192-8.192 16.384-16.384 16.384-120.832 0-22.528 0-143.36 0-8.192 0-16.384-8.192-16.384-16.384 0-10.24 6.144-16.384 16.384-16.384C641.024 606.208 544.768 606.208 665.6 606.208L665.6 606.208z" p-id="1591"></path><path d="M665.6 309.248 665.6 309.248c8.192 0 16.384 6.144 16.384 16.384 0 8.192-8.192 16.384-16.384 16.384-120.832 0-22.528 0-143.36 0-8.192 0-16.384-8.192-16.384-16.384 0-10.24 6.144-16.384 16.384-16.384C641.024 309.248 544.768 309.248 665.6 309.248L665.6 309.248z" p-id="1592"></path></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,141 @@
<template>
<div class="app-container">
<el-card>
<div slot="header" class="clearfix">
<span>项目名称:</span>
<el-select v-model="projectValue" style="width:150px" placeholder="请选择" size="small" clearable filterable @change="projectChange">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="machineValue" style="width:150px" 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:140px" placeholder="请选择" size="small" clearable filterable>
<el-option
v-for="item in group"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>名称:</span>
<el-input v-model="name" clearable size="small" style="width:150px" />
<span>规格:</span>
<el-input v-model="spec" clearable size="small" style="width:150px" />
<span>图号或型号:</span>
<el-input v-model="model" clearable size="small" style="width:150px" />
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="searchRecord()">查询</el-button>
</div>
<el-table :data="tableData" border size="mini" style="width: 100%;" height="600">
<el-table-column label="名称" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.规格 }}
</template>
</el-table-column>
<el-table-column label="出库数量" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
</template>
</el-table-column>
<el-table-column label="领料人" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.领料人 }}
</template>
</el-table-column>
<el-table-column label="出库时间" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.出库时间 }}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { initProject, searchMachine, searchGroup, searchRecord } from '@/api/Inventory/PurchaseOutRecord'
export default {
name: 'PurchaseOutRecord',
data() {
return {
projectValue: '', // 项目名称
project: [],
machineValue: '',
machine: [],
groupValue: '',
group: [],
name: '',
spec: '',
model: '',
tableData: []
}
},
mounted() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
},
methods: {
projectChange() {
this.machine = []
this.machineValue = ''
this.group = []
this.groupValue = ''
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 = []
this.groupValue = ''
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].组号
})
}
})
},
searchRecord() {
if (!this.projectValue) {
this.$message.warning('请选择项目')
return
}
searchRecord(this.projectValue, this.machineValue, this.groupValue, this.name, this.spec, this.model).then(res => {
this.tableData = res.data
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
span{
margin: 10px 0 10px 10px;
}
</style>