零件报废补投

This commit is contained in:
Vergil
2020-04-01 15:27:23 +08:00
parent b1e3de2da1
commit 7cef187221
2 changed files with 13 additions and 4 deletions

View File

@@ -64,7 +64,7 @@ export function editTime(CutCode, StartTime, FinishTime) {
}
})
}
export function editSpare(CutCode, number, reason, time) {
export function editSpare(CutCode, number, reason, time, id) {
return request({
url: '',
method: 'post',
@@ -73,7 +73,7 @@ export function editSpare(CutCode, number, reason, time) {
ModularID: router.currentRoute.path,
type: '2',
name: '车间生产管理工艺_零件工艺计划_报废零件_增加数据',
param: '工艺计划流水号=' + CutCode + '&报废数量=' + number + '&报废原因=' + reason + '&报废时间=' + time
param: '工艺计划流水号=' + CutCode + '&报废数量=' + number + '&报废原因=' + reason + '&报废时间=' + time + '&报废人=' + id
}
})
}

View File

@@ -319,6 +319,7 @@
<script>
import { MachineDrawingSelect, TeamSelect, TableDataSelect, editSpare, TableDta2Select, editA } from '@/api/ManufacturingCenter/SparePartsForScrap'
import { mapGetters } from 'vuex'
export default {
data() {
return {
@@ -387,6 +388,14 @@ export default {
inputD: 1
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchMachineDrawingData()
this.fetchTableData()
@@ -489,11 +498,11 @@ export default {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.form2.报废数量 > 0) {
editSpare(this.code, this.form2.报废数量, this.form2.报废原因, this.form2.报废时间).then(response => {
editSpare(this.code, this.form2.报废数量, this.form2.报废原因, this.form2.报废时间, this.id).then(response => {
if (response.data[0].result === '1') {
this.$message.success('报废成功')
this.dialogeditVisible = false
this.tableData[this.index].报废数量 = this.tableData[this.index].报废数量 + this.form2.报废数量
this.tableData[this.index].报废数量 = parseInt(this.tableData[this.index].报废数量) + parseInt(this.form2.报废数量)
this.tableData[this.index].批次数量 = this.tableData[this.index].批次数量 - this.form2.报废数量
if (this.tableData[this.index].批次数量 === 0) {
this.tableData[this.index].批次零件状态 = '2'