修改自制件出库

This commit is contained in:
bryan sun
2019-12-25 17:25:05 +08:00
18 changed files with 743 additions and 875 deletions

View File

@@ -29,12 +29,12 @@
</el-row>
</el-card>
<el-card>
<el-table :data="tableData" style="width: 760px" height="580" stripe size="mini" border @selection-change="handleSelectionChange">
<el-table :data="tableData" style="width: 1020px" height="580" stripe size="mini" border @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="45"/>
<el-table-column align="center" label="序号" type="index" width="55px"/>
<el-table-column align="center" label="机床图号" width="110px">
<el-table-column align="center" label="机床图号" width="130px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
@@ -54,11 +54,26 @@
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" width="50px">
<el-table-column align="center" label="库存数量" width="90px">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
{{ scope.row.出库数量1 }}
</template>
</el-table-column>
<el-table-column align="center" label="已出库数量" width="90px">
<template slot-scope="scope">
{{ scope.row.已出库数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="出库数量" width="140px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.出库数量" :max="scope.row.出库数量1" :min="0" size="mini" style="width: 100%"/>
</template>
</el-table-column>
<!-- <el-table-column align="center" label="入库数量" width="80px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.入库数量 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="状态" width="80px">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag v-if="scope.row.考核状态 === '8'">入库</el-tag>-->
@@ -138,6 +153,9 @@ export default {
rules: {
leader: [{ required: true, message: '请输入' }]
},
shuzu: [],
keyichuku: 1,
outgoingQuantity: [],
departments: [], // 部门
leaders: [] // 领料人
}
@@ -148,12 +166,27 @@ export default {
},
methods: {
searchData() {
this.tableData = []
const entryNameValue_check = this.entryNameValue === '' || this.entryNameValue === null ? 0 : 1
const machineToolValue_check = this.machineToolValue === '' || this.machineToolValue === null ? 0 : 1
const groupNumberValue_check = this.groupNumberValue === '' ? 0 : 1
const partNumber_check = this.partNumber === '' || this.partNumber === null ? 0 : 1
searchdata(entryNameValue_check, this.entryNameValue, machineToolValue_check, this.machineToolValue, groupNumberValue_check, this.groupNumberValue, partNumber_check, this.partNumber, this.pageCurrent, this.pageSize).then(response => {
this.tableData = response.data.rows
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({
机床图号: response.data.rows[i].机床图号,
组号: response.data.rows[i].组号,
零件图号: response.data.rows[i].零件图号,
零件名称: response.data.rows[i].零件名称,
已出库数量: Number(response.data.rows[i].出库数量),
入库数量: Number(response.data.rows[i].入库数量),
工艺计划流水号: response.data.rows[i].工艺计划流水号,
出库数量: Number(response.data.rows[i].入库数量) - Number(response.data.rows[i].出库数量),
出库数量1: Number(response.data.rows[i].入库数量) - Number(response.data.rows[i].出库数量)
})
}
}
this.total = response.data.total
})
},
@@ -220,8 +253,8 @@ export default {
}
}, // 入库
wareHousing() {
console.log(this.multipleSelection, 121212)
if (this.multipleSelection.length === 0) {
console.log(this.shuzu, 121212)
if (this.shuzu.length === 0) {
this.$message.warning('请勾选出库物料')
} else {
this.selectDepartment()
@@ -230,28 +263,43 @@ export default {
}
}, // 多选
handleSelectionChange(val) {
this.multipleSelection = []
val.map(v => {
this.multipleSelection.push(v.工艺计划流水号)
})
this.shuzu = []
this.shuzu = val
// val.map(v => {
// this.multipleSelection.push(v.工艺计划流水号)
// this.outgoingQuantity.push(v.出库数量)
// })
},
CHUKU() {
console.log(this.form.name, 909090, this.form.leader)
// if (Number(this.form.leader) === Number(this.form.name)) {
warehousing(this.multipleSelection, this.form.name, this.remarks).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.dialogFormVisible = false
this.searchData()
this.keyichuku = 1
this.multipleSelection = []
this.outgoingQuantity = []
this.shuzu.map(v => {
if (v.出库数量 !== 0) {
this.multipleSelection.push(v.工艺计划流水号)
this.outgoingQuantity.push(v.出库数量)
} else {
this.$message.error('出库失败')
this.dialogFormVisible = false
this.keyichuku = 0
}
})
// }
// else {
// this.$message.error('人员编号错误')
// }
if (this.keyichuku === 1) {
if (this.form.name === '') {
this.$message.error('请选择领料人')
} else {
warehousing(this.multipleSelection, this.outgoingQuantity, this.form.name, this.remarks).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.dialogFormVisible = false
this.searchData()
} else {
this.$message.error('出库失败')
this.dialogFormVisible = false
}
})
}
} else {
this.$message.error('请选择正确的出库数量')
}
},
handleSizeChange(val) {
this.pageSize = val