将车间采购分为基本件和外购件两张表

This commit is contained in:
liushuai
2018-11-30 13:40:47 +08:00
parent 09cd1828de
commit 6dbe7817de
19 changed files with 635 additions and 158 deletions

View File

@@ -74,19 +74,19 @@
<el-tab-pane label="基本件">
<el-table :data="tableData1" border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
<el-table-column align="center" width="50" type="selection"/>
<el-table-column label="物料名称" align="center">
<el-table-column label="零件名称" align="center">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center">
<el-table-column label="零件图号" align="center">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center">
<el-table-column label="材料" align="center">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column label="零件数量" align="center">
@@ -228,6 +228,60 @@
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-table :data="tableData6" border size="mini" style="width: 100%" height="300px">
<el-table-column label="零件名称" align="center">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="材料" align="center">
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column label="零件数量" align="center">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column label="零件类型" align="center">
<template slot-scope="scope">
{{ scope.row.零件类型 }}
</template>
</el-table-column>
<el-table-column label="物料计划到货时间" align="center">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间 }}
</template>
</el-table-column>
<el-table-column label="项目名称" align="center">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床编号" align="center">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250px" fixed="right">
<template slot-scope="scope">
<el-button type="danger" size="mini" icon="el-icon-delete" @click="MoveOut(scope.row)">移出</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-table :data="tableData5" border size="mini" style="width: 100%" height="300px">
<el-table-column label="物料名称" align="center">
@@ -282,7 +336,6 @@
</el-table-column>
</el-table>
</el-card>
<el-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="请购单编号" prop="请购单编号">
@@ -323,12 +376,11 @@
<el-button v-show="title==='编辑'" type="primary" @click="submitEdit('form')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initProject, searchmachine, searchgroup, searchTable, searchPart, searchPart1, searchTable1, addData, editData, deleteData, searchDetailed, purchaseRequisition, purchaseRequisition1, MoveOut, MoveOut1, PurchasingDepartment, Production } from '@/api/ManufacturingCenter/PartAssignment'
import { initProject, searchmachine, searchgroup, searchTable, searchPart, searchPart1, searchTable1, addData, editData, deleteData, searchDetailed, searchDetailed1, purchaseRequisition, purchaseRequisition1, MoveOut, MoveOut1, PurchasingDepartment, Production } from '@/api/ManufacturingCenter/PartAssignment'
import { mapGetters } from 'vuex'
export default {
inject: ['reload'],
@@ -352,6 +404,7 @@ export default {
tableData3: [],
tableData4: [],
tableData5: [],
tableData6: [],
loading: false,
title: '',
dialogFormVisible: false,
@@ -370,6 +423,7 @@ export default {
StandardPartsAndOutsourcing: [],
MaterialNum: [],
MaterialName: [],
PartToolNumber: [],
MaterialSpecification: [],
MaterialModel: [],
NumberOfParts: [],
@@ -589,22 +643,34 @@ export default {
}
this.tableData5 = response.data
})
searchDetailed1(row.请购单流水号).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].物料计划到货时间 !== '') {
response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0]
}
}
this.tableData6 = response.data
})
},
handleSelectionChange(val) {
console.log(val)
if (this.PartType === '基本件') {
this.MaterialNum = []
this.BasicPartsNumber = []
this.MaterialName = []
this.MaterialSpecification = []
this.MaterialModel = []
this.PartToolNumber = []
this.Material = []
this.NumberOfParts = []
for (let i = 0; i < val.length; i++) {
this.MaterialNum[i] = val[i].物料流水号
this.BasicPartsNumber[i] = val[i].基本件流水号
this.MaterialName[i] = val[i].零件名称
this.PartToolNumber[i] = val[i].零件图号
this.Material[i] = val[i].材料
this.NumberOfParts[i] = val[i].零件数量
}
} else if (this.PartType === '外购件') {
this.MaterialNum = []
this.StandardPartsAndOutsourcing = []
this.MaterialName = []
this.MaterialSpecification = []
@@ -619,7 +685,12 @@ export default {
this.NumberOfParts[i] = val[i].零件数量
}
} else if (this.PartType === '标准件') {
this.MaterialNum = []
this.StandardPartsAndOutsourcing = []
this.MaterialName = []
this.MaterialSpecification = []
this.MaterialModel = []
this.NumberOfParts = []
for (let i = 0; i < val.length; i++) {
this.StandardPartsAndOutsourcing[i] = val[i].标准件和外购件流水号
this.MaterialNum[i] = val[i].物料流水号
@@ -636,7 +707,7 @@ export default {
this.result = 0
if (this.PartType === '基本件') {
for (let i = 0; i < this.BasicPartsNumber.length; i++) {
purchaseRequisition(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.BasicPartsNumber[i], this.MaterialName[i], this.NumberOfParts[i], 3, this.time, this.MaterialNum[i]).then(response => {
purchaseRequisition(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.BasicPartsNumber[i], this.MaterialName[i], this.PartToolNumber[i], this.Material[i], this.NumberOfParts[i], 3, this.time, this.MaterialNum[i]).then(response => {
this.result += parseInt(response.data[0].result)
console.log(this.result)
if (this.result === this.BasicPartsNumber.length) {
@@ -645,8 +716,13 @@ export default {
searchPart(this.groupFloatValue).then(response => {
this.tableData1 = response.data
})
searchDetailed(this.RequisitionList).then(response => {
this.tableData5 = response.data
searchDetailed1(this.RequisitionList).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].物料计划到货时间 !== '') {
response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0]
}
}
this.tableData6 = response.data
})
}
})
@@ -661,6 +737,11 @@ export default {
this.tableData2 = response.data
})
searchDetailed(this.RequisitionList).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].物料计划到货时间 !== '') {
response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0]
}
}
this.tableData5 = response.data
})
}
@@ -676,6 +757,11 @@ export default {
this.tableData3 = response.data
})
searchDetailed(this.RequisitionList).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].物料计划到货时间 !== '') {
response.data[i].物料计划到货时间 = (response.data[i].物料计划到货时间).split(' ')[0]
}
}
this.tableData5 = response.data
})
}
@@ -690,10 +776,12 @@ export default {
}
},
PurchasingDepartment() {
this.result = 0
if (this.time !== '') {
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
PurchasingDepartment(this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.time, this.MaterialNum[i], this.NumberOfParts[i], this.projectFloatValue, this.machineFloatValue).then(response => {
if (response.data[0].result === '1') {
this.result += parseInt(response.data[0].result)
if (this.result === this.StandardPartsAndOutsourcing.length) {
this.$message.success('请购成功')
if (this.PartType === '外购件') {
searchPart1(this.groupFloatValue, 2).then(response => {
@@ -704,7 +792,7 @@ export default {
this.tableData3 = response.data
})
}
} else { this.$message.error('请购失败') }
}
})
}
} else {