自制件入库
This commit is contained in:
@@ -81,3 +81,17 @@ export function insertOne(num0, num1, people, num4, num5, num6, num7) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 更新零件状态
|
||||||
|
export function FinishPart(num0) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
UserID: state.state.user.id,
|
||||||
|
ModularID: router.currentRoute.path,
|
||||||
|
type: '2',
|
||||||
|
name: 'MES_机加工MES_库存管理_入库模块_更新零件状态',
|
||||||
|
param: '工艺计划流水号组=' + num0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -70,11 +70,36 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
<el-dialog :visible.sync="dialogFormVisible" title="更新零件状态" center>
|
||||||
|
<el-table :data="finishParts" stripe border size="mini" style="width: 100%;margin: 3px 0px" height="300px">
|
||||||
|
<el-table-column label="序号" align="center" type="index" width="55"/>
|
||||||
|
<el-table-column label="项目名称" align="center" min-width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.项目名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="机床图号" align="center" min-width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="零件图号" align="center" min-width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.零件图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button size="small" @click="dialogFormVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" size="small" @click="FinishPart()">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { searchTable, insertOne, getlocate, searchPartNumber, CraftNumber } from '@/api/Inventory/Inboundscanning'
|
import { searchTable, insertOne, getlocate, searchPartNumber, CraftNumber, FinishPart } from '@/api/Inventory/Inboundscanning'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { wsuri, name } from '@/utils/request'
|
import { wsuri, name } from '@/utils/request'
|
||||||
export default {
|
export default {
|
||||||
@@ -94,7 +119,9 @@ export default {
|
|||||||
locateName: [], // 货位名称下拉框
|
locateName: [], // 货位名称下拉框
|
||||||
locateNumber: '',
|
locateNumber: '',
|
||||||
Partpaint: '',
|
Partpaint: '',
|
||||||
tableDataNum: []
|
tableDataNum: [],
|
||||||
|
dialogFormVisible: false,
|
||||||
|
finishParts: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -178,32 +205,38 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
this.finishParts = []
|
||||||
this.listLoading = true
|
this.listLoading = true
|
||||||
searchTable(this.partNumber).then(response => {
|
searchTable(this.partNumber).then(response => {
|
||||||
|
console.log(response.data)
|
||||||
if (response.data.length === 0) {
|
if (response.data.length === 0) {
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: '警告',
|
title: '警告',
|
||||||
message: '该零件未加工完成',
|
message: '该零件未加工',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
if (response.data[i].考核状态 === 8) {
|
if (response.data[i].状态 === '未完成') {
|
||||||
this.listLoading = false
|
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: '警告',
|
title: '警告',
|
||||||
message: 'P' + response.data[i].工艺计划流水号 + '已入库',
|
message: 'P' + response.data[i].工艺计划流水号 + '未加工完成',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
} else if (response.data[i].考核状态 === 9) {
|
} else if (response.data[i].状态 === '可完成') {
|
||||||
this.listLoading = false
|
this.finishParts.push({
|
||||||
this.$notify({
|
plannumber: response.data[i].剩余数量,
|
||||||
title: '警告',
|
innumber: response.data[i].入库数量,
|
||||||
message: 'P' + response.data[i].工艺计划流水号 + '已出库',
|
capture: '',
|
||||||
type: 'warning'
|
note: '',
|
||||||
|
工艺计划流水号: response.data[i].工艺计划流水号,
|
||||||
|
项目名称: response.data[i].项目名称,
|
||||||
|
机床图号: response.data[i].机床图号,
|
||||||
|
零件图号: response.data[i].零件图号
|
||||||
})
|
})
|
||||||
} else if (response.data[i].考核状态 === 7) {
|
} else if (response.data[i].状态 === '已完成') {
|
||||||
|
if (response.data[i].考核状态 === '7') {
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
this.tableData.push({
|
this.tableData.push({
|
||||||
plannumber: response.data[i].剩余数量,
|
plannumber: response.data[i].剩余数量,
|
||||||
@@ -229,14 +262,65 @@ export default {
|
|||||||
})
|
})
|
||||||
return preVal
|
return preVal
|
||||||
}, [])
|
}, [])
|
||||||
|
} else if (response.data[i].考核状态 === '8') {
|
||||||
|
this.$notify({
|
||||||
|
title: '警告',
|
||||||
|
message: 'P' + response.data[i].工艺计划流水号 + '已入库',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
} else if (response.data[i].考核状态 === '9') {
|
||||||
|
this.$notify({
|
||||||
|
title: '警告',
|
||||||
|
message: 'P' + response.data[i].工艺计划流水号 + '已出库',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
if (this.finishParts.length > 0) {
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
}
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
FinishPart() {
|
||||||
|
var nums = []
|
||||||
|
this.finishParts.map(v => {
|
||||||
|
nums.push(v.工艺计划流水号)
|
||||||
|
})
|
||||||
|
FinishPart(nums).then(response => {
|
||||||
|
this.dialogFormVisible = false
|
||||||
|
for (let i = 0; i < this.finishParts.length; i++) {
|
||||||
|
this.tableData.push({
|
||||||
|
plannumber: this.finishParts[i].plannumber,
|
||||||
|
innumber: this.finishParts[i].innumber,
|
||||||
|
capture: '',
|
||||||
|
note: '',
|
||||||
|
工艺计划流水号: this.finishParts[i].工艺计划流水号,
|
||||||
|
项目名称: this.finishParts[i].项目名称,
|
||||||
|
机床图号: this.finishParts[i].机床图号,
|
||||||
|
零件图号: this.finishParts[i].零件图号
|
||||||
|
})
|
||||||
|
const hash = {} // 一个新数组,data为你需要去重的数组,newData用于接收去重后的数组, curVal.去重条件
|
||||||
|
this.tableDataNum = this.tableData.reduce((preVal, curVal) => {
|
||||||
|
hash[curVal.工艺计划流水号] ? '' : hash[curVal.工艺计划流水号] = true && preVal.push({
|
||||||
|
工艺计划流水号: curVal.工艺计划流水号,
|
||||||
|
项目名称: curVal.项目名称,
|
||||||
|
机床图号: curVal.机床图号,
|
||||||
|
零件图号: curVal.零件图号,
|
||||||
|
plannumber: curVal.plannumber,
|
||||||
|
innumber: curVal.innumber,
|
||||||
|
capture: '',
|
||||||
|
note: ''
|
||||||
|
})
|
||||||
|
return preVal
|
||||||
|
}, [])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 修改入库
|
// 修改入库
|
||||||
Innumber() {
|
Innumber() {
|
||||||
this.$confirm('此操作将不可逆转,且如果入库数量大于计划数量,则全部入库,是否继续?', '提示', {
|
this.$confirm('此操作将不可逆转,且如果入库数量大于计划数量,则全部入库,是否继续?', '提示', {
|
||||||
|
|||||||
Reference in New Issue
Block a user