This commit is contained in:
liushuai
2020-01-17 18:18:15 +08:00
parent 4fb54f4d3e
commit ab32ccfb84
11 changed files with 242 additions and 149 deletions

View File

@@ -95,6 +95,16 @@
{{ scope.row.机床数量 }}
</template>
</el-table-column>
<el-table-column label="零件总数量" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="投产总数量" align="center" width="115px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.投产总数量" :min="0" size="mini" style="width: 90px"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.零件备注 }}
@@ -140,6 +150,16 @@
{{ scope.row.机床数量 }}
</template>
</el-table-column>
<el-table-column label="零件总数量" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="采购总数量" align="center" width="115px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.采购总数量" :min="0" size="mini" style="width: 90px"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.备注 }}
@@ -180,6 +200,16 @@
{{ scope.row.机床数量 }}
</template>
</el-table-column>
<el-table-column label="零件总数量" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="采购总数量" align="center" width="115px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.采购总数量" :min="0" size="mini" style="width: 90px"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.备注 }}
@@ -601,6 +631,7 @@ export default {
MaterialSpecification: [],
MaterialModel: [],
NumberOfParts: [],
multipleSelection: [],
ReMarks: [],
projectName: '',
MachineToolNumber: '',
@@ -1113,67 +1144,29 @@ export default {
})
},
handleSelectionChange(val) {
if (this.PartType === '基本件') {
this.MaterialNum = []
this.BasicPartsNumber = []
this.MaterialName = []
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].零件数量
this.ReMarks[i] = val[i].零件备注
}
console.log(this.NumberOfParts, 1111)
} else if (this.PartType === '外购件') {
this.MaterialNum = []
this.MaterialCode = []
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].物料流水号
this.MaterialCode[i] = val[i].物料代码
this.MaterialName[i] = val[i].物料名称
this.MaterialSpecification[i] = val[i].物料规格
this.MaterialModel[i] = val[i].物料型号
this.NumberOfParts[i] = val[i].零件数量
this.ReMarks[i] = val[i].备注
}
} else if (this.PartType === '标准件') {
this.MaterialNum = []
this.MaterialCode = []
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].物料流水号
this.MaterialCode[i] = val[i].物料代码
this.MaterialName[i] = val[i].物料名称
this.MaterialSpecification[i] = val[i].物料规格
this.MaterialModel[i] = val[i].物料型号
this.NumberOfParts[i] = val[i].零件数量
this.ReMarks[i] = val[i].备注
}
}
this.multipleSelection = val
},
purchaseRequisition() {
if (this.RequisitionList !== '') {
if (this.time !== '' && this.time !== null) {
if (this.BasicPartsNumber.length !== 0 || this.StandardPartsAndOutsourcing.length !== 0) {
if (this.multipleSelection.length !== 0) {
this.result = 0
if (this.PartType === '基本件') {
this.MaterialNum = []
this.BasicPartsNumber = []
this.MaterialName = []
this.PartToolNumber = []
this.Material = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.BasicPartsNumber[i] = this.multipleSelection[i].基本件流水号
this.MaterialName[i] = this.multipleSelection[i].零件名称
this.PartToolNumber[i] = this.multipleSelection[i].零件图号
this.Material[i] = this.multipleSelection[i].材料
this.NumberOfParts[i] = this.multipleSelection[i].投产总数量
this.ReMarks[i] = this.multipleSelection[i].零件备注
}
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)
@@ -1204,6 +1197,23 @@ export default {
})
}
} else if (this.PartType === '外购件') {
this.MaterialNum = []
this.MaterialCode = []
this.StandardPartsAndOutsourcing = []
this.MaterialName = []
this.MaterialSpecification = []
this.MaterialModel = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.StandardPartsAndOutsourcing[i] = this.multipleSelection[i].标准件和外购件流水号
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.MaterialCode[i] = this.multipleSelection[i].物料代码
this.MaterialName[i] = this.multipleSelection[i].物料名称
this.MaterialSpecification[i] = this.multipleSelection[i].物料规格
this.MaterialModel[i] = this.multipleSelection[i].物料型号
this.NumberOfParts[i] = this.multipleSelection[i].采购总数量
this.ReMarks[i] = this.multipleSelection[i].备注
}
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.MaterialCode[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)
@@ -1234,6 +1244,23 @@ export default {
})
}
} else if (this.PartType === '标准件') {
this.MaterialNum = []
this.MaterialCode = []
this.StandardPartsAndOutsourcing = []
this.MaterialName = []
this.MaterialSpecification = []
this.MaterialModel = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.StandardPartsAndOutsourcing[i] = this.multipleSelection[i].标准件和外购件流水号
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.MaterialCode[i] = this.multipleSelection[i].物料代码
this.MaterialName[i] = this.multipleSelection[i].物料名称
this.MaterialSpecification[i] = this.multipleSelection[i].物料规格
this.MaterialModel[i] = this.multipleSelection[i].物料型号
this.NumberOfParts[i] = this.multipleSelection[i].采购总数量
this.ReMarks[i] = this.multipleSelection[i].备注
}
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.MaterialCode[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)
@@ -1276,8 +1303,23 @@ export default {
},
PurchasingDepartment() {
if (this.time !== '' && this.time !== null) {
if (this.BasicPartsNumber.length !== 0 || this.StandardPartsAndOutsourcing.length !== 0) {
if (this.multipleSelection.length !== 0) {
if (this.PartType === '基本件') {
this.MaterialNum = []
this.BasicPartsNumber = []
this.MaterialName = []
this.PartToolNumber = []
this.Material = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.BasicPartsNumber[i] = this.multipleSelection[i].基本件流水号
this.MaterialName[i] = this.multipleSelection[i].零件名称
this.PartToolNumber[i] = this.multipleSelection[i].零件图号
this.Material[i] = this.multipleSelection[i].材料
this.NumberOfParts[i] = this.multipleSelection[i].投产总数量
this.ReMarks[i] = this.multipleSelection[i].零件备注
}
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)
@@ -1290,6 +1332,23 @@ export default {
}
})
} else {
this.MaterialNum = []
this.MaterialCode = []
this.StandardPartsAndOutsourcing = []
this.MaterialName = []
this.MaterialSpecification = []
this.MaterialModel = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.StandardPartsAndOutsourcing[i] = this.multipleSelection[i].标准件和外购件流水号
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.MaterialCode[i] = this.multipleSelection[i].物料代码
this.MaterialName[i] = this.multipleSelection[i].物料名称
this.MaterialSpecification[i] = this.multipleSelection[i].物料规格
this.MaterialModel[i] = this.multipleSelection[i].物料型号
this.NumberOfParts[i] = this.multipleSelection[i].采购总数量
this.ReMarks[i] = this.multipleSelection[i].备注
}
PurchasingDepartment(this.groupFloatValue, this.StandardPartsAndOutsourcing, this.time, this.MaterialNum, this.NumberOfParts, this.projectFloatValue, this.machineFloatValue).then(response => {
if (response.data[0].result !== '0') {
this.$message.success('请购成功')
@@ -1315,7 +1374,22 @@ export default {
}
},
Production() {
if (this.PartType === '基本件' && this.BasicPartsNumber.length !== 0) {
if (this.PartType === '基本件' && this.multipleSelection.length !== 0) {
this.MaterialNum = []
this.BasicPartsNumber = []
this.MaterialName = []
this.PartToolNumber = []
this.Material = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.BasicPartsNumber[i] = this.multipleSelection[i].基本件流水号
this.MaterialName[i] = this.multipleSelection[i].零件名称
this.PartToolNumber[i] = this.multipleSelection[i].零件图号
this.Material[i] = this.multipleSelection[i].材料
this.NumberOfParts[i] = this.multipleSelection[i].投产总数量
this.ReMarks[i] = this.multipleSelection[i].零件备注
}
Production(this.groupFloatValue, this.BasicPartsNumber, this.NumberOfParts, this.projectFloatValue, this.machineFloatValue).then(response => {
if (response.data[0].result !== '0') {
this.$message.success('投产成功')