This commit is contained in:
Vergil
2020-04-20 14:59:39 +08:00
parent 126b272afd
commit fdf7585c21
4 changed files with 300 additions and 118 deletions

View File

@@ -0,0 +1,131 @@
<template>
<div class="app-container">
<el-card>
<div style="margin-top: 2px;margin-bottom: 2px">
<el-input v-model="pickingListNumber" placeholder="图号或型号" clearable size="small" style="width:200px" />
<el-button size="small" type="primary" icon="el-icon-search" style="margin: 0 0 0 10px" plain @click="searchList()">查询</el-button>
<el-button size="small" style="margin-left: 100px" type="distribution" @click="inputPassword()">领料确认</el-button>
</div>
<el-table :data="pickListTable2" :row-class-name="tableRowClassName1" highlight-current-row border style="width: 1000px" size="mini" height="600" @selection-change="handleSelectionChange">
<el-table-column label="名称" show-overflow-tooltip prop="名称" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" prop="图号或型号" align="center" width="110" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.图号或型号 || '—' }}
</template>
</el-table-column>
<el-table-column label="规格" prop="规格" align="center" width="110" show-overflow-tooltip>
<template slot-scope="scope">
{{ 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="出库" align="center" width="130">
<template slot-scope="scope">
<el-input-number :disabled="Number(scope.row.总数量) <= Number(scope.row.出库数量1) || scope.row.货位存量1 === null" :max="scope.row.货位存量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">
<template slot-scope="scope">
{{ scope.row.货位存量1 }}
</template>
</el-table-column>
<el-table-column label="已领" align="center" width="50">
<template slot-scope="scope">
{{ scope.row.出库数量1 }}
</template>
</el-table-column>
<!-- <el-table-column v-if="true" label="备料" align="center" width="60">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag v-if="Number(scope.row.是否备料确认)===1" size="mini" type="success">已备</el-tag>-->
<!-- <el-tag v-else type="warning" size="mini">未备</el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column v-if="true" label="领料" align="center" width="60">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag v-if="(Number(scope.row.总数量) <= Number(scope.row.出库数量1)) || Number(scope.row.是否领料确认) === 1" type="success" size="mini">已领</el-tag>-->
<!-- <el-tag v-else-if="Number(scope.row.总数量) > Number(scope.row.出库数量1) && Number(scope.row.出库数量1) > 0" type="primary" size="mini">未完</el-tag>-->
<!-- <el-tag v-else-if="Number(scope.row.出库数量1) === 0" type="warning" size="mini">未领</el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="机床图号" prop="机床图号" align="center" width="80" show-overflow-tooltip>
<template slot-scope="scope">
{{ 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>
</el-card>
</div>
</template>
<script>
import { searchList222 } from '@/api/Inventory/MaterialOut'
export default {
data() {
return {
pickingListNumber: '',
pickListTable2: []
}
},
methods: {
// 初始化数据
fetchData() {
console.log(111111)
},
searchList() {
searchList222(this.pickingListNum).then(res => {
console.log(res.data)
for (let i = 0; i < res.data.length; i++) {
if (res.data[i].离线采购件流水号 !== 0) {
res.data[i].货位存量1 = res.data[i].货位存量
}
if (res.data[i].请购单明细流水号 !== 0 && res.data[i].请购单明细流水号 !== '' && res.data[i].请购单明细流水号 !== null) {
res.data[i].货位存量1 = res.data[i].货位存量
}
if (res.data[i].货位存量1 > res.data[i].总数量) {
res.data[i].出库数量 = res.data[i].总数量
}
if (res.data[i].出库数量1 >= res.data[i].总数量) {
res.data[i].出库数量 = 0
}
}
this.pickListTable2 = res.data
})
},
tableRowClassName1({ row }) {
if (parseInt(row.出库数量1) === 0) {
return 'weilingliao-row'
} else if (parseInt(row.总数量) > parseInt(row.出库数量1) && parseInt(row.出库数量1)) {
return 'weilingwan-row'
} else {
return ''
}
},
// 多选
handleSelectionChange(val) {
this.multipleSelection1 = []
val.map(v => {
this.multipleSelection1.push(v.领料单明细流水号)
})
}
}
}
</script>