<template>
|
<el-dialog
|
width="60%"
|
title="机料"
|
top="5vh"
|
:visible.sync="innerVisible"
|
append-to-body
|
@close="$emit('update:currshowlist', false)"
|
:show="currshowlist"
|
>
|
<el-table
|
:data="workstationFeedList"
|
max-height="330"
|
:header-cell-style="{ background: '#f5f7fa' }"
|
@selection-change="selectionWorkstationFeedChange"
|
>
|
<el-table-column type="selection" width="55"> </el-table-column>
|
<el-table-column label="零件编号" prop="partNo" align="center">
|
</el-table-column>
|
<el-table-column
|
label="零件"
|
prop="partName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
label="IFS批次号"
|
prop="ifsBatchNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column label="零件批号" prop="partBatchNo" align="center">
|
</el-table-column>
|
<el-table-column label="规格型号" prop="specs" align="center">
|
</el-table-column>
|
<el-table-column
|
label="可用数量"
|
prop="availableStockQuantity"
|
align="center"
|
>
|
</el-table-column>
|
<el-table-column label="库存数量" prop="stockQuantity" align="center">
|
</el-table-column>
|
<el-table-column label="单位" prop="unit" align="center">
|
</el-table-column>
|
</el-table>
|
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="innerVisible = false">取 消</el-button>
|
<el-button type="primary" @click="saveSelectRow" :disabled="saveDisabled"
|
>确 定</el-button
|
>
|
</div>
|
</el-dialog>
|
</template>
|
<script>
|
import { getFeed as getWorkstationFeed } from '@/api/product/personboard'
|
export default {
|
props: {
|
currshowlist: {
|
type: Boolean,
|
default: false
|
},
|
workstationId: {
|
type: Number
|
}
|
},
|
data() {
|
return {
|
innerVisible: false,
|
workstationFeedList: [],
|
dataListLoading: false,
|
multipleSelection: [],
|
saveDisabled: false,
|
clickSaveArr: []
|
}
|
},
|
methods: {
|
saveSelectRow() {
|
let canClickFlag = true
|
this.clickSaveArr.push(new Date().getTime())
|
if (this.clickSaveArr.length > 1) {
|
if (
|
this.clickSaveArr[this.clickSaveArr.length - 1] -
|
this.clickSaveArr[this.clickSaveArr.length - 2] <
|
2000
|
) {
|
// 小于2秒则认为重复提交
|
canClickFlag = false
|
}
|
}
|
if (canClickFlag) {
|
this.saveDisabled = true
|
this.$emit('handleSelectionChange', this.multipleSelection)
|
this.innerVisible = false
|
this.saveDisabled = false
|
}
|
},
|
selectionWorkstationFeedChange(val) {
|
// 多行选中
|
this.multipleSelection = val
|
},
|
getDataList() {
|
this.dataListLoading = true
|
var query = {}
|
this.workstationFeedList = []
|
if (this.workstationId && this.workstationId != null) {
|
getWorkstationFeed(query, this.workstationId)
|
.then((response) => {
|
var data = response.data
|
if (data.code == 0) {
|
this.workstationFeedList = data.data
|
} else {
|
this.$message.error('获取投料信息失败')
|
}
|
})
|
.catch((error) => {})
|
}
|
this.dataListLoading = false
|
}
|
},
|
watch: {
|
currshowlist() {
|
this.innerVisible = this.currshowlist
|
if (this.currshowlist) {
|
this.getDataList()
|
}
|
}
|
},
|
mounted() {
|
this.getDataList()
|
}
|
}
|
</script>
|