零件报废补投
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user