零件导入,零件分配,车间采购系统
This commit is contained in:
@@ -101,7 +101,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
{{ scope.row.零件备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -275,6 +275,11 @@
|
||||
{{ 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>
|
||||
@@ -329,6 +334,11 @@
|
||||
{{ 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>
|
||||
@@ -380,7 +390,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, searchmachine, searchgroup, searchTable, searchPart, searchPart1, searchTable1, addData, editData, deleteData, searchDetailed, searchDetailed1, 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, purchaseRequisition2, MoveOut, MoveOut1, PurchasingDepartment, Production } from '@/api/ManufacturingCenter/PartAssignment'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
inject: ['reload'],
|
||||
@@ -669,7 +679,7 @@ export default {
|
||||
this.PartToolNumber[i] = val[i].零件图号
|
||||
this.Material[i] = val[i].材料
|
||||
this.NumberOfParts[i] = val[i].零件数量
|
||||
this.ReMarks[i] = val[i].备注
|
||||
this.ReMarks[i] = val[i].零件备注
|
||||
}
|
||||
} else if (this.PartType === '外购件') {
|
||||
this.MaterialNum = []
|
||||
@@ -708,117 +718,141 @@ export default {
|
||||
purchaseRequisition() {
|
||||
if (this.RequisitionList !== '') {
|
||||
if (this.time !== '') {
|
||||
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.PartToolNumber[i], this.Material[i], this.NumberOfParts[i], 3, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
console.log(this.result)
|
||||
if (this.result === this.BasicPartsNumber.length) {
|
||||
console.log(1111)
|
||||
this.$message.success('请购成功')
|
||||
searchPart(this.groupFloatValue).then(response => {
|
||||
this.tableData1 = 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]
|
||||
if (this.BasicPartsNumber.length !== 0 || this.StandardPartsAndOutsourcing.length !== 0) {
|
||||
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.PartToolNumber[i], this.Material[i], this.NumberOfParts[i], 3, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
console.log(this.result)
|
||||
if (this.result === this.BasicPartsNumber.length) {
|
||||
console.log(1111)
|
||||
this.$message.success('请购成功')
|
||||
searchPart(this.groupFloatValue).then(response => {
|
||||
this.tableData1 = 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
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.PartType === '外购件') {
|
||||
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
|
||||
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], 2, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.StandardPartsAndOutsourcing.length) {
|
||||
this.$message.success('请购成功')
|
||||
searchPart1(this.groupFloatValue, 2).then(response => {
|
||||
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.tableData6 = response.data
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.PartType === '外购件') {
|
||||
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
|
||||
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], 2, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.StandardPartsAndOutsourcing.length) {
|
||||
this.$message.success('请购成功')
|
||||
searchPart1(this.groupFloatValue, 2).then(response => {
|
||||
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
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.PartType === '标准件') {
|
||||
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
|
||||
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], 1, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.StandardPartsAndOutsourcing.length) {
|
||||
this.$message.success('请购成功')
|
||||
searchPart1(this.groupFloatValue, 1).then(response => {
|
||||
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
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.PartType === '标准件') {
|
||||
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
|
||||
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], 1, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.StandardPartsAndOutsourcing.length) {
|
||||
this.$message.success('请购成功')
|
||||
searchPart1(this.groupFloatValue, 1).then(response => {
|
||||
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
|
||||
})
|
||||
}
|
||||
})
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请选择零件或物料')
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请选择计划到货时间')
|
||||
this.$message.warning('请选择交货期')
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请先选择请购单')
|
||||
}
|
||||
},
|
||||
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 => {
|
||||
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 => {
|
||||
this.tableData2 = response.data
|
||||
if (this.BasicPartsNumber.length !== 0 || this.StandardPartsAndOutsourcing.length !== 0) {
|
||||
if (this.PartType === '基本件') {
|
||||
purchaseRequisition2(this.projectFloatValue, this.machineFloatValue, this.groupFloatValue, this.BasicPartsNumber, this.NumberOfParts, this.time).then(response => {
|
||||
if (response.data[0].result !== '0') {
|
||||
console.log(response.data[0].result)
|
||||
this.$message.success('请购成功')
|
||||
searchPart(this.groupFloatValue).then(response => {
|
||||
this.tableData1 = 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
|
||||
})
|
||||
} else {
|
||||
searchPart1(this.groupFloatValue, 1).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
this.$message.success('请购失败')
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
PurchasingDepartment(this.groupFloatValue, this.StandardPartsAndOutsourcing, this.time, this.MaterialNum, this.NumberOfParts, this.NumberOfParts, this.projectFloatValue, this.machineFloatValue).then(response => {
|
||||
if (response.data[0].result !== '0') {
|
||||
this.$message.success('请购成功')
|
||||
if (this.PartType === '外购件') {
|
||||
searchPart1(this.groupFloatValue, 2).then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
} else {
|
||||
searchPart1(this.groupFloatValue, 1).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$message.success('请购失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请选择零件或物料')
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请选择计划到货时间')
|
||||
this.$message.warning('请选择交货期')
|
||||
}
|
||||
},
|
||||
Production() {
|
||||
this.result = 0
|
||||
if (this.PartType === '基本件' && this.BasicPartsNumber.length !== 0) {
|
||||
for (let i = 0; i < this.BasicPartsNumber.length; i++) {
|
||||
Production(this.groupFloatValue, this.BasicPartsNumber[i], this.projectFloatValue, this.machineFloatValue).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.BasicPartsNumber.length) {
|
||||
this.$message.success('投产成功')
|
||||
searchPart(this.groupFloatValue).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
} else {
|
||||
this.$message.error('投产失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
Production(this.groupFloatValue, this.BasicPartsNumber, this.projectFloatValue, this.machineFloatValue).then(response => {
|
||||
if (response.data[0].result !== '0') {
|
||||
this.$message.success('投产成功')
|
||||
searchPart(this.groupFloatValue).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
} else {
|
||||
this.$message.error('投产失败')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请选择基本件')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user