This commit is contained in:
liushuai
2020-05-06 08:44:51 +08:00
parent 1df919eab0
commit b7bb7d031e
15 changed files with 357 additions and 220 deletions

View File

@@ -7,9 +7,14 @@
</div>
<el-table v-loading="loading1" :data="pickListTable2" :row-class-name="tableRowClassName1" highlight-current-row border style="width: 1015px" size="mini" height="600" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="50"/>
<el-table-column label="领料单编号" show-overflow-tooltip prop="名称" align="center" width="150">
<el-table-column label="机床图号" prop="机床图号" align="center" width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.领料单编 }}
{{ scope.row.机床图 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" width="50">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="名称" show-overflow-tooltip prop="名称" align="center" width="110">
@@ -29,37 +34,27 @@
</el-table-column>
<el-table-column label="领用" align="center" width="50">
<template slot-scope="scope">
{{ scope.row.数量 }}
{{ scope.row.领用数量 }}
</template>
</el-table-column>
<el-table-column label="出库" align="center" width="130">
<template slot-scope="scope">
<el-input-number :disabled="parseInt(scope.row.数量) <= parseInt(scope.row.出库数量1) || parseInt(scope.row.货位存量1) === null" :max="parseInt(scope.row.货位存量1)" v-model="scope.row.出库数量" size="mini" style="width: 100%"/>
<el-input-number :disabled="Number(scope.row.领用数量) <= Number(scope.row.出库数量1) || Number(scope.row.货位存量1) === 0" :max="Number(scope.row.货位存量1)" :min="1" v-model="scope.row.出库数量" size="mini" style="width: 100%"/>
</template>
</el-table-column>
<el-table-column label="备件" align="center" width="50">
<template slot-scope="scope">
{{ scope.row.备件数量 }}
</template>
</el-table-column>
<el-table-column label="库存" align="center" width="50">
<el-table-column label="库存" align="center" width="70">
<template slot-scope="scope">
{{ scope.row.货位存量1 }}
</template>
</el-table-column>
<el-table-column label="已领" align="center" width="50">
<el-table-column label="已领" align="center" width="70">
<template slot-scope="scope">
{{ scope.row.出库数量1 }}
</template>
</el-table-column>
<el-table-column label="机床图号" prop="机床图号" align="center" width="80" show-overflow-tooltip>
<el-table-column label="领料单编号" show-overflow-tooltip prop="名称" align="center" width="130">
<template slot-scope="scope">
{{ scope.row.机床图 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" width="50">
<template slot-scope="scope">
{{ scope.row.组号 }}
{{ scope.row.领料单编 }}
</template>
</el-table-column>
</el-table>
@@ -118,7 +113,7 @@
<script>
import { initPickPerson, initMachineProject, initOutType, searchList222, selectdepartment, submitOutStore, selectleaders } from '@/api/Inventory/MaterialOut'
import { mapGetters } from 'vuex'
export default {
data() {
return {
@@ -128,6 +123,7 @@ export default {
DirectNotes: [],
outType: [],
total1: 0,
pickList: [],
pageCurrent1: 1,
pageSize1: 50,
loading1: false,
@@ -143,9 +139,15 @@ export default {
// password: [{ required: true, message: '请输入' }],
outTypeValue: [{ required: true, message: '请选择' }]
},
multipleSelection1: []
multipleSelection1: [],
StockNumberTable: []
}
},
computed: {
...mapGetters([
'id'
])
},
methods: {
fetchData() {
this.person = []
@@ -192,20 +194,6 @@ export default {
var check
this.pickingListNumber ? check = 1 : check = 0
searchList222(check, this.pickingListNumber, this.pageCurrent1, this.pageSize1).then(response => {
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].离线采购件流水号 !== 0) {
response.data.rows[i].货位存量1 = response.data.rows[i].货位存量
}
if (response.data.rows[i].请购单明细流水号 !== 0 && response.data.rows[i].请购单明细流水号 !== '' && response.data.rows[i].请购单明细流水号 !== null) {
response.data.rows[i].货位存量1 = response.data.rows[i].货位存量
}
if (response.data.rows[i].货位存量1 > response.data.rows[i].总数量) {
response.data.rows[i].出库数量 = response.data.rows[i].总数量
}
if (response.data.rows[i].出库数量1 >= response.data.rows[i].总数量) {
response.data.rows[i].出库数量 = 0
}
}
this.loading1 = false
this.total1 = response.data.total
this.pickListTable2 = response.data.rows
@@ -214,7 +202,7 @@ export default {
tableRowClassName1({ row }) {
if (parseInt(row.出库数量1) === 0) {
return 'weilingliao-row'
} else if (parseInt(row.数量) > parseInt(row.出库数量1) && parseInt(row.出库数量1)) {
} else if (parseInt(row.领用数量) > parseInt(row.出库数量1) && parseInt(row.出库数量1)) {
return 'weilingwan-row'
} else {
return ''
@@ -222,7 +210,29 @@ export default {
},
// 多选
handleSelectionChange(val) {
this.multipleSelection1 = val
this.StockNumberTable = val
this.multipleSelection = []
this.basePartNum = []
this.materialNum = []
this.parchasePartNum = []
this.purchaseBillNum = []
this.groupNumValue = []
this.machineValue = []
this.offlineNum = []
this.outNumber = []
this.pickList = []
for (let i = 0; i < val.length; i++) {
this.multipleSelection.push(val[i].领料单明细流水号)
this.basePartNum.push(val[i].基本件流水号)
this.materialNum.push(val[i].物料流水号)
this.parchasePartNum.push(val[i].标准件和外购件流水号)
this.purchaseBillNum.push(val[i].请购单明细流水号)
this.groupNumValue.push(val[i].组件流水号)
this.machineValue.push(val[i].机床流水号)
this.offlineNum.push(val[i].离线采购件流水号)
this.outNumber.push(val[i].出库数量)
this.pickList.push(val[i].领料单流水号)
}
},
// 领料确认
inputPassword() {
@@ -234,6 +244,7 @@ export default {
this.dialogFormVisible3 = true
},
selectDepartment() {
this.departments = []
selectdepartment().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.departments.push({
@@ -255,17 +266,20 @@ export default {
this.machineValue = []
this.offlineNum = []
this.outNumber = []
for (let i = 0; i < this.multipleSelection1.length; i++) {
if (this.multipleSelection1[i].出库数量 !== 0) {
this.multipleSelection.push(this.multipleSelection1[i].领料单明细流水号)
this.basePartNum.push(this.multipleSelection1[i].基本件流水号)
this.materialNum.push(this.multipleSelection1[i].物料流水号)
this.parchasePartNum.push(this.multipleSelection1[i].标准件和外购件流水号)
this.purchaseBillNum.push(this.multipleSelection1[i].请购单明细流水号)
this.groupNumValue.push(this.multipleSelection1[i].件流水号)
this.machineValue.push(this.multipleSelection1[i].机床流水号)
this.offlineNum.push(this.multipleSelection1[i].离线采购件流水号)
this.outNumber.push(this.multipleSelection1[i].出库数量)
this.pickList = []
for (let i = 0; i < this.StockNumberTable.length; i++) {
console.log(this.pickListTable2[i].出库数量, 1233)
if (this.StockNumberTable[i].出库数量 !== 0) {
this.multipleSelection.push(this.StockNumberTable[i].领料单明细流水号)
this.basePartNum.push(this.StockNumberTable[i].基本件流水号)
this.materialNum.push(this.StockNumberTable[i].物料流水号)
this.parchasePartNum.push(this.StockNumberTable[i].标准件和外购件流水号)
this.purchaseBillNum.push(this.StockNumberTable[i].请购单明细流水号)
this.groupNumValue.push(this.StockNumberTable[i].件流水号)
this.machineValue.push(this.StockNumberTable[i].机床流水号)
this.offlineNum.push(this.StockNumberTable[i].离线采购件流水号)
this.outNumber.push(this.StockNumberTable[i].出库数量)
this.pickList.push(this.StockNumberTable[i].领料单流水号)
}
}
if (this.form3.DirectNote) {
@@ -274,7 +288,7 @@ export default {
this.department111 = this.departments[i].label
}
}
submitOutStore(this.multipleSelection, this.basePartNum, this.materialNum, this.parchasePartNum, this.purchaseBillNum, this.groupNumValue, this.machineValue, this.outNumber, this.id, this.form3.DirectNote, this.form3.outTypeValue, this.pickingListNum, this.offlineNum, this.department111).then(response => {
submitOutStore(this.multipleSelection, this.basePartNum, this.materialNum, this.parchasePartNum, this.purchaseBillNum, this.groupNumValue, this.machineValue, this.outNumber, this.id, this.form3.DirectNote, this.form3.outTypeValue, this.pickList, this.offlineNum, this.department111).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.dialogFormVisible3 = false