This commit is contained in:
zhangdingyu
2019-03-25 10:25:58 +08:00
5 changed files with 228 additions and 55 deletions

View File

@@ -61,26 +61,27 @@ export function searchPeople(data1) {
})
}
// 离线件出库
export function outlinePartOut(data1, data2, data3, data4, data5, data6, data7, data8, data9, data10) {
export function outlinePartOut(data2, data3, data4, data5, data6, data7, data8, data9, data10) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '库存管理_离线采购件_零件出库',
param: '离线合同明细流水号=' + data1 + '&领用者=' + data2 + '&出库数量=' + data3 + '&货位流水号=' + data4 + '&备注=' + data5 + '&项目流水号=' + data6 + '&机床流水号=' + data7 + '&组件流水号=' + data8 + '&物料流水号=' + data9 + '&出库人员流水号=' + data10
param: '领用者=' + data2 + '&出库数量=' + data3 + '&货位流水号=' + data4 + '&备注=' + data5 + '&项目流水号=' + data6 + '&机床流水号=' + data7 + '&组件流水号=' + data8 + '&物料流水号=' + data9 + '&出库人员流水号=' + data10
}
})
}
// 查询出库记录
export function outRecord(data1) {
export function outRecord(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_离线外购件出库_出库记录',
param: '离线合同明细流水号=' + data1
param: '物料流水号=' + params[0],
Pagination: params[1] + '&' + params[2]
}
})
}

View File

@@ -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({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_领用核算_查询数据',
param: `项目流水号_check=${check}&项目流水号=${num}`
param: `项目流水号_check=${check1}&项目流水号=${num1}&机床流水号_check=${check2}&机床流水号=${num2}&组件流水号_check=${check3}&组件流水号=${num3}`
}
})
}

View File

@@ -45,7 +45,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope" align="center">
<el-button size="mini" type="success" icon="el-icon-search" @click="searchoutRecord(scope.row)">查看领用情况</el-button>
<el-button size="mini" type="success" icon="el-icon-search" @click="pageCurrent2=1;pageSize2=10;total2=0;searchoutRecord(scope.row)">查看领用情况</el-button>
<el-button :disabled="Number(scope.row.货位存量)===0" size="mini" type="primary" icon="el-icon-sort-up" @click="parOut(scope.row)">出库</el-button>
</template>
</el-table-column>
@@ -81,7 +81,7 @@
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="出库数量" align="center" min-width="80">
<el-table-column label="出库数量" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
</template>
@@ -106,12 +106,28 @@
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="80">
<el-table-column label="出库人" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.出库人姓名 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="140">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<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-dialog :visible.sync="dialogFormVisible" title="零件出库" center width="380px">
@@ -192,7 +208,6 @@ export default {
MachineValue: [{ required: true, message: '请选择机床', trigger: 'blur' }],
DirectNumber: [{ required: true, message: '请输入直达件数量', trigger: 'blur' }]
},
contractNumber: '',
locateNumber: '',
materialNumber: '',
PeopleNumber: '',
@@ -203,6 +218,9 @@ export default {
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
pageCurrent2: 1,
pageSize2: 10,
total2: 0,
materialName: '', // 物料名称
materialSpec: '', // 物料规格
materialModel: '' // 物料型号
@@ -279,10 +297,31 @@ export default {
},
// 离线记录查询
searchoutRecord(row) {
this.contractNumber = row.离线合同明细流水号
// 物料流水号查
this.materialNumber = row.物料流水号
this.listLoading1 = true
outRecord(this.contractNumber).then(response => {
this.tableDataOut = response.data
outRecord(this.materialNumber, this.pageCurrent2, this.pageSize2).then(response => {
this.tableDataOut = response.data.rows
this.total2 = response.data.total
this.listLoading1 = false
})
},
handleSizeChange2(val) {
this.pageSize2 = val
this.pageCurrent2 = 1
this.listLoading1 = true
outRecord(this.materialNumber, this.pageCurrent2, this.pageSize2).then(response => {
this.tableDataOut = response.data.rows
this.total2 = response.data.total
this.listLoading1 = false
})
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.listLoading1 = true
outRecord(this.materialNumber, this.pageCurrent2, this.pageSize2).then(response => {
this.tableDataOut = response.data.rows
this.total2 = response.data.total
this.listLoading1 = false
})
},
@@ -295,7 +334,6 @@ export default {
this.form.MachineValue = ''
this.form.GroupNumValue = ''
this.dialogFormVisible = true
this.contractNumber = row.离线合同明细流水号
this.locateNumber = row.货位流水号
this.materialNumber = row.物料流水号
this.partnumber = row.货位存量
@@ -319,18 +357,21 @@ export default {
},
// 离线外购件出库
addDirectPartm() {
if (this.partnumber < this.form.DirectNumber) {
console.log(this.partnumber, this.form.DirectNumber)
if (Number(this.partnumber) < Number(this.form.DirectNumber)) {
this.$message.error('请正确输入数量')
} else {
this.$refs['form'].validate((valid) => {
if (valid) {
outlinePartOut(this.contractNumber, this.form.PeopleValue, this.form.DirectNumber, this.locateNumber, this.form.DirectNote, this.form.ProjectValue, this.form.MachineValue, this.form.GroupNumValue, this.materialNumber, this.PeopleNumber).then(response => {
outlinePartOut(this.form.PeopleValue, this.form.DirectNumber, this.locateNumber, this.form.DirectNote, this.form.ProjectValue, this.form.MachineValue, this.form.GroupNumValue, this.materialNumber, this.PeopleNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('零件出库成功')
this.dialogFormVisible = false
this.searchTable1()
outRecord(this.contractNumber).then(response => {
this.tableDataOut = response.data
// 物料流水号查
outRecord(this.materialNumber, this.pageCurrent2, this.pageSize2).then(response => {
this.tableDataOut = response.data.rows
this.total2 = response.data.total
this.listLoading1 = false
})
} else {

View File

@@ -261,7 +261,7 @@
</el-table-column>
<el-table-column label="可出库数量" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.货位存量 - scope.row.待出库数量 }}
{{ scope.row.可出库数量 = scope.row.货位存量 - scope.row.待出库数量 }}
</template>
</el-table-column>
<el-table-column label="零件类型" align="center" width="80">
@@ -271,7 +271,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope" align="center">
<el-button size="mini" type="primary" icon="el-icon-edit" @click="addListDetailinfor(scope.row)">领料</el-button>
<el-button :disabled="scope.row.可出库数量===0" size="mini" type="primary" icon="el-icon-edit" @click="addListDetailinfor(scope.row)">领料</el-button>
</template>
</el-table-column>
</el-table>
@@ -304,11 +304,6 @@
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
@@ -319,12 +314,22 @@
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="合同数量" align="center" width="80">
<el-table-column label="采购数量" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column label="零件数量" align="center" width="80">
<el-table-column label="仓库名称" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="货位名称" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column label="货位存量" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.货位存量 }}
</template>
@@ -334,6 +339,11 @@
{{ scope.row.待出库数量 }}
</template>
</el-table-column>
<el-table-column label="可出库数量" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.可出库数量 = scope.row.货位存量 - scope.row.待出库数量 }}
</template>
</el-table-column>
<el-table-column label="零件类型" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.类型名称 }}
@@ -341,7 +351,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 10px" @click="addWorkshopDetailinfor(scope.row)">领料</el-button>
<el-button :disabled="scope.row.可出库数量===0" size="mini" type="primary" icon="el-icon-edit" @click="addWorkshopDetailinfor(scope.row)">领料</el-button>
</template>
</el-table-column>
</el-table>
@@ -392,6 +402,9 @@
<!--车间采购件领料对话框-->
<el-dialog :visible.sync="dialogFormVisibleWork" title="车间采购件领料" center width="380px">
<el-form ref="form3" :model="form3" :rules="rules3" label-position="left" class="demo-ruleForm">
<el-form-item label="领料单号" label-width="100px" size="small">
<el-input v-model="pickingListNumber" size="small" placeholder="空" readonly style="width: 200px"/>
</el-form-item>
<el-form-item label="出库数量" prop="OutNumber" label-width="100px" size="small">
<el-input v-model="form3.OutNumber" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
@@ -655,6 +668,7 @@ export default {
this.total = response.data.total
})
searchHoursePart(this.PageCurrentx, this.PageSizex, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
console.log(response.data.rows)
this.tableDataHouse = response.data.rows
this.listLoadingx = false
this.totalx = response.data.total
@@ -750,14 +764,18 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dropList(this.pickingListNumberx).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchListinfor()
} else {
this.$message.error('数据占用')
}
})
if (this.tableDataPicking.length === 0) {
dropList(this.pickingListNumberx).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchListinfor()
} else {
this.$message.error('数据占用')
}
})
} else {
this.$message.error('数据占用')
}
}).catch(() => {
this.$message({
type: 'info',
@@ -889,7 +907,8 @@ export default {
},
// 增加车间采购领料单明细
addWorkshopDetailinfor(row) {
this.form3 = []
console.log(row)
this.form3 = {}
this.outType = 3
this.partProjectNumber = row.项目流水号
this.partMachineNumber = row.机床流水号
@@ -914,10 +933,19 @@ export default {
} else if (this.form3.OutNumber === '' || this.form3.OutNumber > this.enableOut) {
this.$message.error('请正确输入领用数量')
} else {
console.log(this.materialLocate)
addListDetail(this.pickingListNumberx, this.partProjectNumber, this.partMachineNumber, this.partGroupNumber, this.form3.OutNumber, this.partType, this.form3.outNote, this.craftplannumber, this.receive, this.purchaseDetailNum, this.askPurchaseNumber, this.locatenumber, this.outType, this.materialLocate, this.materialName, this.materialType, this.materialNumber, this.partPiant, this.material).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.searchPartinfo()
searchListDetail(this.pickingListNumberx).then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].是否出库 === '1' ? data[i].是否禁用 = true : data[i].是否禁用 = false
}
this.tableDataPicking = data
})
this.dialogFormVisibleWork = false
} else {
this.$message.error('增加失败')
}
@@ -925,7 +953,6 @@ export default {
}
}
})
this.dialogFormVisibleWork = false
this.searchListinfor()
this.searchListDetailt()
},

View File

@@ -2,21 +2,38 @@
<div class="app-container">
<el-card>
<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
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: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-card>
<el-card style="margin-top: 15px">
<el-table
:data="tableData1"
:summary-method="getSummaries"
style="width: 100%"
height="440"
height="650"
size="mini"
show-summary
stripe
@@ -27,6 +44,16 @@
{{ scope.row.项目名称 }}
</template>
</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="物料名称">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
@@ -44,7 +71,7 @@
</el-table-column>
<el-table-column align="center" label="小计(元)" prop="小计">
<template slot-scope="scope">
{{ scope.row.小计 }}
{{ scope.row.小计.toFixed(2) }}
</template>
</el-table-column>
<el-table-column align="center" label="单价">
@@ -68,27 +95,21 @@
</template>
<script>
import { initProject, searchReceiveCheck } from '@/api/PurchasingCenter/ReceiveCheck'
import { initProject, searchMachine, searchGroup, searchReceiveCheck } from '@/api/PurchasingCenter/ReceiveCheck'
export default {
data() {
return {
projectValue: '', // 项目名称
project: [],
machineValue: '',
machine: [],
groupValue: '',
group: [],
tableData1: [],
check1: '',
pageCurrent: 1,
pageSize: 10,
total: 0,
form: {
项目名称: '',
物料名称: '',
物料规格: '',
物料型号: '',
数量: '',
单价: '',
小计: ''
}
total: 0
}
},
created() {
@@ -98,11 +119,62 @@ export default {
fetchData() {
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() { // 查询
if (!this.projectValue) {
this.$message.error('请选择项目')
} 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
})
}
@@ -112,5 +184,13 @@ export default {
</script>
<style scoped>
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
</style>