<template>
|
<div style="padding:0px 14px;height: 100%;overflow: auto;">
|
<div class="need-feed-header">
|
<div style="height:28px;line-height:28px;">
|
<el-divider class="pane-divider" direction="vertical"></el-divider
|
><span style="font-size:14px;font-weight:bold">模具登记</span>
|
</div>
|
<div>
|
<el-button
|
class="out-btn"
|
type="primary"
|
icon="tracking-btn-out"
|
@click="addMould()"
|
>装模</el-button
|
>
|
</div>
|
</div>
|
<el-table
|
ref="materialTable"
|
:data="materialList"
|
highlight-current-row
|
height="300px"
|
:header-cell-style="needFeedsTableHeaderCellStyle"
|
:row-class-name="needFeedsTableRowClassName"
|
class="feed-table need-feed-content"
|
>
|
<el-table-column
|
label="设备"
|
prop="equipmentName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">设备</div>
|
<div class="th" @click.stop>
|
<template>
|
<el-input
|
type="text"
|
v-model="queryParamOne.equipmentName"
|
@keyup.enter.native="handleMaterialList"
|
clearable
|
@clear="handleMaterialList"
|
size="mini"
|
></el-input>
|
</template>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.equipmentName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="模具编号"
|
prop="mouldCode"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">模具编号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.mouldCode"
|
@keyup.enter.native="handleMaterialList"
|
clearable
|
@clear="handleMaterialList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.mouldCode }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="模具名称"
|
prop="mouldName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">模具名称</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.mouldName"
|
@keyup.enter.native="handleMaterialList"
|
clearable
|
@clear="handleMaterialList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.mouldName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="工序"
|
prop="operationName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">工序</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.operationName"
|
@keyup.enter.native="handleMaterialList"
|
clearable
|
@clear="handleMaterialList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.operationName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="工步"
|
prop="stepName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">工步</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.stepName"
|
@keyup.enter.native="handleMaterialList"
|
clearable
|
@clear="handleMaterialList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.stepName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="寿命转换系数"
|
prop="lifeConversionFactor"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">寿命转换系数</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamOne.lifeConversionFactor"
|
@keyup.enter.native="handleMaterialList"
|
clearable
|
@clear="handleMaterialList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column align="center" label="操作" width="150px" fixed="right">
|
<template slot-scope="scope">
|
<span>{{ scope.row.lifeConversionFactor }}</span>
|
</template>
|
<template slot-scope="scope">
|
<el-tooltip effect="dark" content="删除" placement="top-start">
|
<el-button
|
type="text"
|
size="small"
|
class="red-but"
|
@click="delMould(scope.row.id)"
|
>卸模</el-button
|
>
|
</el-tooltip>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div class="line-side-warehouse-header">
|
<div>
|
<el-divider class="pane-divider" direction="vertical"></el-divider
|
><span style="font-size:14px;font-weight:bold">模具使用记录</span>
|
</div>
|
</div>
|
<el-table
|
ref="stockTable"
|
:data="stockList"
|
height="420px"
|
:header-cell-style="lineSideWarehouseTableHeaderCellStyle"
|
:row-class-name="lineSideWarehouseTableRowClassName"
|
class="feed-table line-side-warehouse-content"
|
>
|
<el-table-column type="selection" width="55"></el-table-column>
|
<el-table-column
|
label="设备"
|
prop="equipmentName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">设备</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.equipmentName"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.equipmentName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="模具编号"
|
prop="mouldCode"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">模具编号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.mouldCode"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.mouldCode }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="模具名称"
|
prop="mouldName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">模具名称</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.mouldName"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.mouldName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="工序"
|
prop="name"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">工序</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.name"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.name }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="工步"
|
prop="stepName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">工步</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.stepName"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.stepName }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="批号"
|
prop="batchNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">批号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.batchNo"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.batchNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="产量" prop="output" align="center">
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">产量</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.output"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.output }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="寿命转换系数"
|
prop="lifeConversionFactor"
|
align="center"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">寿命转换系数</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.lifeConversionFactor"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.lifeConversionFactor }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="使用量" prop="usageAmount" align="center">
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">使用量</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.usageAmount"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.usageAmount }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="报工单号" prop="productNo" align="center">
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">报工单号</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.productNo"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.productNo }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="状态" prop="status" align="center">
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">状态</div>
|
<div class="th" @click.stop>
|
<el-input
|
type="text"
|
v-model="queryParamTwo.status"
|
@keyup.enter.native="handleStockList"
|
clearable
|
@clear="handleStockList"
|
size="mini"
|
></el-input>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.status }}</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
<!-- 弹窗, 新增 / 修改 -->
|
<table-form
|
v-if="addOrUpdateVisible"
|
ref="addOrUpdate"
|
:workstationId="workstationId"
|
:currOperateTask="currOperateTask"
|
@refreshDataList="loadMouldByWorkstation"
|
:shiftId="shiftId"
|
:crewId="crewId"
|
></table-form>
|
</div>
|
</template>
|
<style lang="scss" scoped>
|
.need-feed-header {
|
margin-top: 20px;
|
margin-bottom: 14px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
.pane-divider {
|
width: 4px;
|
background-color: #4283ee;
|
}
|
.need-feed-content {
|
}
|
.feed-table >>> .stripe-row {
|
background: #f6f9fe;
|
}
|
.feed-table >>> .el-table__header th {
|
padding-bottom: 0px;
|
}
|
.feed-table >>> th .cell div {
|
/*display: block;*/
|
}
|
.feed-table >>> th .cell {
|
height: 60px;
|
}
|
.feed-table >>> td {
|
padding: 3px 0px;
|
}
|
.feed-table .el-input {
|
padding: 0px 0px;
|
}
|
.feed-table >>> .feed-input-search {
|
background: url('/img/workbench/icon_search.png') center center no-repeat;
|
background-size: cover;
|
}
|
|
.feed-table >>> .feed-input-search:before {
|
content: '搜';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
.line-side-warehouse-header {
|
margin-top: 10px;
|
margin-bottom: 14px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
.line-side-warehouse-header >>> .feed-btn-feeding {
|
background: url('/img/workbench/icon_wl1.png') center center no-repeat;
|
background-size: cover;
|
}
|
|
.line-side-warehouse-header >>> .feed-btn-feeding:before {
|
content: '投';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
.need-feed-header >>> .tracking-btn-out {
|
background: url('/img/workbench/icon_bgcc.png') center center no-repeat;
|
background-size: cover;
|
font-size: 14px;
|
}
|
.need-feed-header >>> .tracking-btn-out:before {
|
content: '装';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
.out-btn {
|
background-image: -webkit-linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
background-image: -moz-linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
background-image: linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
}
|
.out-btn >>> span {
|
margin-left: 3px;
|
}
|
.feeding-btn {
|
background-image: -webkit-linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
background-image: -moz-linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
background-image: linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
color: #fff;
|
border-color: #e8effb;
|
border-radius: 15px;
|
padding: 6px 15px;
|
}
|
.feeding-btn >>> span {
|
margin-left: 3px;
|
}
|
.line-side-warehouse-content >>> th .cell:first-child {
|
/*line-height: 55px;
|
text-align: center;*/
|
}
|
.workstation-house-header {
|
margin-top: 10px;
|
margin-bottom: 14px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
.workstation-house-header >>> .feed-btn-return {
|
background: url('/img/workbench/icon_return1.png') center center no-repeat;
|
background-size: cover;
|
}
|
|
.workstation-house-header >>> .feed-btn-return:before {
|
content: '退';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
.return-btn {
|
background-image: -webkit-linear-gradient(139deg, #ff3f20 0%, #f77339 100%);
|
background-image: -moz-linear-gradient(139deg, #ff3f20 0%, #f77339 100%);
|
background-image: linear-gradient(139deg, #ff3f20 0%, #f77339 100%);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
}
|
.return-btn >>> span {
|
margin-left: 3px;
|
}
|
.workstation-house-content >>> th .cell:first-child {
|
/*line-height: 55px;
|
text-align: center;*/
|
}
|
</style>
|
<script>
|
import { fetchList, delObj } from '@/api/product/mouldregister'
|
import { fetchList as fetchMoulduserecord } from '@/api/product/moulduserecord'
|
import TableForm from './mould_form'
|
export default {
|
components: { TableForm },
|
props: {
|
workstationId: {
|
type: Number
|
},
|
currOperateTask: {
|
type: Object,
|
default: function() {
|
return {}
|
}
|
},
|
shiftId: {
|
type: Number
|
},
|
crewId: {
|
type: Number
|
}
|
},
|
data() {
|
return {
|
addOrUpdateVisible: false,
|
materialList: [],
|
stockList: [],
|
feedList: [],
|
selectStocks: [],
|
selectFeeds: [],
|
showFeedForm: false,
|
showReturnMaterialForm: false,
|
currentMaterialPartId: 0,
|
paramObject: null,
|
queryParamOne: {
|
partNo: null,
|
partName: null,
|
qpa: null,
|
quantityRequired: null
|
},
|
queryParamTwo: {},
|
queryParamThree: {},
|
dateTimeFiltersThree: {}
|
}
|
},
|
created() {
|
this.loadMouldByWorkstation()
|
this.loadMouldUseRecordByWorkstation()
|
},
|
methods: {
|
// 根据工作站获取所有工装模具
|
loadMouldByWorkstation() {
|
if (this.workstationId && this.workstationId != null) {
|
const query = Object.assign(
|
{ workstationId: this.workstationId },
|
this.queryParamOne
|
)
|
fetchList(query)
|
.then((response) => {
|
var data = response.data
|
console.info(data)
|
if (data.code === 0) {
|
this.materialList = data.data.records
|
} else {
|
this.$message.error('获取工装模具失败')
|
}
|
})
|
.catch((error) => {
|
console.log(error)
|
})
|
}
|
},
|
handleMaterialList() {
|
this.loadMouldByWorkstation()
|
},
|
handleStockList() {
|
this.loadMouldUseRecordByWorkstation()
|
},
|
// 根据工作站获取所有工装模具使用记录
|
loadMouldUseRecordByWorkstation() {
|
const query = Object.assign(
|
{
|
workstationId: this.workstationId,
|
operationTaskId: this.currOperateTask.id
|
},
|
this.queryParamTwo
|
)
|
fetchMoulduserecord(query)
|
.then((response) => {
|
var data = response.data
|
if (data.code === 0) {
|
this.stockList = data.data.records
|
} else {
|
this.$message.error('获取工装模具使用记录失败')
|
}
|
})
|
.catch((error) => {
|
console.log(error)
|
})
|
},
|
// 新增模具
|
addMould() {
|
if (this.currOperateTask.id) {
|
this.addOrUpdateVisible = true
|
this.$nextTick(() => {
|
this.$refs.addOrUpdate.init(null)
|
})
|
} else {
|
this.$message.error('请先选择工单')
|
}
|
},
|
needFeedsTableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
|
let headerStyle = 'background:#599ef4;color:#fff;'
|
if (columnIndex === 0) {
|
headerStyle += 'border-radius: 6px 0px 0px 0px;'
|
} else if (columnIndex === 6) {
|
headerStyle += 'border-radius: 0px 6px 0px 0px;'
|
}
|
return headerStyle
|
},
|
needFeedsTableRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 === 1) {
|
return 'stripe-row'
|
} else {
|
return ''
|
}
|
},
|
lineSideWarehouseTableHeaderCellStyle({
|
row,
|
column,
|
rowIndex,
|
columnIndex
|
}) {
|
let headerStyle = 'background:#599ef4;color:#fff;'
|
if (columnIndex === 0) {
|
headerStyle += 'border-radius: 6px 0px 0px 0px;'
|
} else if (columnIndex === 11) {
|
headerStyle += 'border-radius: 0px 6px 0px 0px;'
|
}
|
return headerStyle
|
},
|
lineSideWarehouseTableRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 === 1) {
|
return 'stripe-row'
|
} else {
|
return ''
|
}
|
},
|
workstationHouseTableHeaderCellStyle({
|
row,
|
column,
|
rowIndex,
|
columnIndex
|
}) {
|
let headerStyle = 'background:#599ef4;color:#fff;'
|
if (columnIndex === 0) {
|
headerStyle += 'border-radius: 6px 0px 0px 0px;'
|
} else if (columnIndex === 9) {
|
headerStyle += 'border-radius: 0px 6px 0px 0px;'
|
}
|
return headerStyle
|
},
|
workstationHouseTableRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 === 1) {
|
return 'stripe-row'
|
} else {
|
return ''
|
}
|
},
|
// 初始化页面变量
|
initFeed() {
|
this.selectStocks = []
|
this.selectFeeds = []
|
this.showFeedForm = false
|
this.showReturnMaterialForm = false
|
},
|
delMould(id) {
|
this.$confirm('是否确认删除ID为' + id, '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
})
|
.then(function() {
|
return delObj(id)
|
})
|
.then((data) => {
|
this.$message.success('删除成功')
|
this.loadMouldByWorkstation()
|
})
|
},
|
refreshAllData() {
|
if (this.workstationId && this.currOperateTask.id) {
|
this.handleStockList()
|
} else {
|
this.$message.warning('请先选择工单')
|
}
|
}
|
},
|
watch: {
|
workstationId() {
|
if (this.workstationId) {
|
this.loadMouldByWorkstation()
|
this.loadMouldUseRecordByWorkstation()
|
}
|
this.initFeed()
|
},
|
currOperateTask: {
|
handler(newValue, oldValue) {
|
if (newValue.id) {
|
this.loadMouldUseRecordByWorkstation()
|
} else {
|
this.materialList = []
|
}
|
},
|
deep: true
|
}
|
}
|
}
|
</script>
|