<template>
|
<div style="padding:0px 14px;height: 100%;overflow: auto;">
|
<div class="product-record-div">
|
<div class="product-record-div-left">
|
<div class="product-record-list-header">
|
<div>
|
<el-divider class="pane-divider" direction="vertical"></el-divider>
|
<span style="font-size:14px;font-weight:bold;margin-right:10px;"
|
>生产记录</span
|
>
|
<el-checkbox
|
style="margin-right:15px;"
|
v-model="isDutyFilter"
|
@change="getProductRecords"
|
>按班次</el-checkbox
|
>
|
<el-checkbox v-model="isTaskFilter" @change="getProductRecords"
|
>按工单</el-checkbox
|
>
|
<el-checkbox
|
v-model="isWorkstationFilter"
|
@change="getProductRecords"
|
>按工作站</el-checkbox
|
>
|
</div>
|
<!-- <div>
|
<el-button
|
class="record-add-btn"
|
type="primary"
|
icon="product-record-btn-add"
|
@click="addProductRecord()"
|
>
|
新增
|
</el-button>
|
</div> -->
|
</div>
|
<div>
|
<el-date-picker
|
v-model="createDateRange"
|
type="daterange"
|
range-separator="至"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
value-format="yyyy-MM-dd"
|
style="width:80%"
|
@change="getProductRecords"
|
>
|
</el-date-picker>
|
</div>
|
<div class="product-record-list-content">
|
<el-tabs v-model="currTemplateType" @tab-click="handleClick">
|
<el-tab-pane
|
v-for="(item, index) in templateTypeList"
|
:key="item.id"
|
:label="item.templateTypeName"
|
:name="item.templateTypeName"
|
>
|
<div class="button">
|
<div>
|
<el-button
|
class="record-add-btn"
|
type="primary"
|
icon="product-record-btn-add"
|
@click="addProductRecord()"
|
>
|
新增
|
</el-button>
|
</div>
|
<div>
|
<el-button
|
class="record-del-btn"
|
type="danger"
|
icon="product-record-btn-add"
|
@click="delAlls"
|
>
|
删除
|
</el-button>
|
</div>
|
</div>
|
<el-table
|
ref="productRecordTable"
|
height="717px"
|
:data="productRecords"
|
:highlight-current-row="true"
|
:header-cell-style="productRecordTableHeaderCellStyle"
|
:row-class-name="productRecordTableRowClassName"
|
class="product-record-table"
|
@row-click="handleProductRecordChange"
|
@select="select"
|
@select-all="selectAll"
|
>
|
<el-table-column type="selection"></el-table-column>
|
|
<el-table-column
|
label="模板名称"
|
prop="templateName"
|
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
|
clearable
|
v-model="searchContent.templateName"
|
placeholder="模板名称"
|
style="width: 100%"
|
@input="getSearch"
|
>
|
</el-input>
|
</template>
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="SN号"
|
prop="outBatchNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">SN号</div>
|
<div class="th" @click.stop>
|
<template>
|
<el-input
|
type="text"
|
placeholder="SN号"
|
v-model="searchContent.outBatchNo"
|
clearable
|
size="mini"
|
@input="getSearch"
|
></el-input>
|
</template>
|
</div>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
label="记录时间"
|
prop="createTime"
|
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"
|
placeholder="记录时间"
|
v-model="searchContent.createTime"
|
clearable
|
size="mini"
|
@input="getSearch"
|
></el-input>
|
</template>
|
</div>
|
</template> -->
|
</el-table-column>
|
<el-table-column
|
label="记录人"
|
prop="createUser"
|
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"
|
placeholder="记录人"
|
v-model="searchContent.createUser"
|
clearable
|
size="mini"
|
@input="getSearch"
|
></el-input>
|
</template>
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column align="center" width="85px" fixed="right">
|
<template slot-scope="scope">
|
<el-tooltip
|
effect="dark"
|
content="删除"
|
placement="top-start"
|
>
|
<el-button
|
type="text"
|
size="small"
|
class="red-but"
|
@click.stop="delProductrecord(scope.$index, scope.row)"
|
>
|
删除
|
</el-button>
|
</el-tooltip>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</div>
|
<div class="product-record-div-right">
|
<div class="product-record-info-header">
|
<div>
|
<el-divider class="pane-divider" direction="vertical"></el-divider>
|
<span style="font-size:14px;font-weight:bold">记录详情</span>
|
</div>
|
<div>
|
<el-button
|
class="record-edit-btn"
|
type="primary"
|
icon="product-record-btn-edit"
|
@click="updateProductRecord()"
|
>
|
保存
|
</el-button>
|
</div>
|
</div>
|
<div style="height:800px;">
|
<el-tabs type="card" ref="tabs">
|
<el-tab-pane label="参数">
|
<el-table
|
ref="productRecordInfoTable"
|
:data="paramValues"
|
height="744px"
|
:row-class-name="productRecordInfoTableRowClassName"
|
class="product-record-table"
|
>
|
<el-table-column
|
prop="code"
|
label="编号"
|
align="center"
|
></el-table-column>
|
<el-table-column
|
prop="parameterItem"
|
label="名称"
|
align="center"
|
>
|
<template slot-scope="scope"
|
><span>
|
{{ scope.row.parameterItem }}({{ scope.row.unit }})</span
|
>
|
</template>
|
</el-table-column>
|
<!--<el-table-column
|
prop="type"
|
label="参数类型"
|
align="center"
|
:formatter="getParam"
|
></el-table-column>-->
|
<el-table-column prop="paramValue" label="值" align="center">
|
<template slot-scope="scope">
|
<!-- <el-input v-model="scope.row.paramValue" placeholder="值">
|
</el-input> -->
|
<el-input
|
v-model="scope.row.paramValue"
|
placeholder="值"
|
v-if="scope.row.type != 2"
|
:ref="'reference_' + scope.$index"
|
@keyup.enter.native="nextFocus(scope.$index)"
|
></el-input>
|
<el-select
|
v-if="scope.row.type == 2"
|
:ref="'reference_' + scope.$index"
|
v-model="scope.row.paramValue"
|
style="width:100%"
|
>
|
<el-option
|
v-for="item in scope.row.sysDictItemList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
/>
|
</el-select>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-tab-pane>
|
<el-tab-pane label="附件">
|
<el-upload
|
ref="upload"
|
action="/mes/operationTask/upload"
|
:headers="headers"
|
:on-preview="handlePreview"
|
:on-remove="handleRemove"
|
:on-change="change"
|
:file-list="fileList"
|
:auto-upload="false"
|
list-type="picture"
|
></el-upload>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</div>
|
</div>
|
<productRecordFormDialog
|
:currshowlist.sync="showProductRecordForm"
|
:currOperateTask="currOperateTask"
|
:currentDutyRecord="currentDutyRecord"
|
:workstationId="workstationId"
|
:currTemplateType="currTemplateType"
|
:createDateRange="createDateRange"
|
@saveProductRecordSucess="productRecordSucessCallback"
|
/>
|
</div>
|
</template>
|
<style lang="scss" scoped>
|
.button {
|
display: flex;
|
margin-bottom: 10px;
|
div {
|
margin-right: 10px;
|
}
|
}
|
.product-record-div {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.product-record-div-left {
|
width: 40%;
|
}
|
|
.product-record-div-right {
|
width: 58%;
|
}
|
|
.product-record-list-header {
|
margin-top: 20px;
|
margin-bottom: 10px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.product-record-list-header >>> .product-record-btn-add {
|
background: url('/img/workbench/icon_xz1.png') center center no-repeat;
|
background-size: cover;
|
}
|
|
.product-record-list-header >>> .product-record-btn-add:before {
|
content: '增';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
|
.pane-divider {
|
width: 4px;
|
background-color: #4283ee;
|
}
|
|
.record-add-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;
|
}
|
.record-del-btn {
|
color: #fff;
|
border-color: rgb(240, 108, 109);
|
border-radius: 15px;
|
padding: 6px 15px;
|
}
|
.record-add-btn >>> span {
|
margin-left: 3px;
|
}
|
|
.product-record-list-content {
|
height: 772px;
|
}
|
|
.product-record-table >>> .stripe-row {
|
background: #f6f9fe;
|
}
|
|
.product-record-table >>> td {
|
padding: 3px 0px;
|
}
|
|
.product-record-table >>> .el-button {
|
padding: 5px 0px;
|
}
|
|
.product-record-table >>> .el-input .el-input__inner {
|
height: 24px;
|
line-height: 24px;
|
}
|
|
.product-record-info-header {
|
margin-top: 20px;
|
margin-bottom: 14px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.product-record-info-header >>> .product-record-btn-edit {
|
background: url('/img/workbench/icon_xg.png') center center no-repeat;
|
background-size: cover;
|
}
|
|
.product-record-info-header >>> .product-record-btn-edit:before {
|
content: '修';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
|
.record-edit-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;
|
}
|
|
.record-edit-btn >>> span {
|
margin-left: 3px;
|
}
|
|
.red-but.is-disabled {
|
color: #fab6b6;
|
}
|
|
.red-but {
|
color: red;
|
}
|
|
.blue-but.is-disabled {
|
color: #aacfff;
|
}
|
|
.blue-but {
|
color: #006eff;
|
}
|
</style>
|
<script>
|
import {
|
getTemplateRecord,
|
getTemplateParam,
|
deleteTemplateRecord,
|
delAll,
|
UpdateTemplateRecord as updateProductRecord
|
} from '@/api/plan/operationtask'
|
import { remote } from '@/api/admin/dict'
|
import { getStore } from '../../../util/store'
|
import productRecordFormDialog from './product-record-form.vue'
|
import { removeFile } from '../../../api/plan/operationtask'
|
|
export default {
|
components: {
|
productRecordFormDialog
|
},
|
props: {
|
currOperateTask: {
|
type: Object,
|
default: () => {
|
return {}
|
}
|
},
|
currentDutyRecord: {
|
type: Object,
|
default: () => {
|
return {}
|
}
|
},
|
workstationId: {
|
type: Number
|
},
|
templateTypeList: {
|
type: Array,
|
default: () => {
|
return []
|
}
|
}
|
},
|
data() {
|
return {
|
fileList: [],
|
headers: {
|
Authorization: 'Bearer ' + getStore({ name: 'access_token' })
|
},
|
paramValues: [],
|
currProductRecordId: null,
|
typeOptions: [],
|
productRecords: [],
|
showProductRecordForm: false,
|
isDutyFilter: true,
|
isTaskFilter: true,
|
isWorkstationFilter: true,
|
currTemplateType: null,
|
createDateRange: [],
|
searchContent: {
|
templateName: '',
|
outBatchNo: '',
|
createTime: '',
|
createUser: ''
|
},
|
idList: []
|
}
|
},
|
mounted() {
|
this.getParamType()
|
},
|
methods: {
|
async getSearch(val) {
|
let templateJson
|
if (this.createDateRange != null && this.createDateRange !== '') {
|
templateJson = {
|
createUser: this.searchContent.createUser,
|
createTime: this.searchContent.createTime,
|
outBatchNo: this.searchContent.outBatchNo,
|
templateName: this.searchContent.templateName,
|
operationTaskId: this.isTaskFilter ? this.currOperateTask.id : null,
|
dutyRecordId: this.isDutyFilter ? this.currentDutyRecord.id : null,
|
workstationId: this.isWorkstationFilter ? this.workstationId : null,
|
templateType: this.currTemplateType,
|
startTime: this.createDateRange[0],
|
endTime: this.createDateRange[1]
|
}
|
} else {
|
templateJson = {
|
createUser: this.searchContent.createUser,
|
createTime: this.searchContent.createTime,
|
outBatchNo: this.searchContent.outBatchNo,
|
templateName: this.searchContent.templateName,
|
operationTaskId: this.isTaskFilter ? this.currOperateTask.id : null,
|
dutyRecordId: this.isDutyFilter ? this.currentDutyRecord.id : null,
|
workstationId: this.isWorkstationFilter ? this.workstationId : null,
|
templateType: this.currTemplateType
|
}
|
}
|
|
getTemplateRecord(templateJson).then((response) => {
|
this.fileList = []
|
this.paramValues = []
|
this.currProductRecordId = null
|
if (response.data.code === 0) {
|
this.productRecords = response.data.data
|
} else {
|
this.productRecords = []
|
}
|
})
|
// const res = await getTemplateRecord({
|
// createUser: this.searchContent.createUser,
|
// createTime: this.searchContent.createTime,
|
// outBatchNo: this.searchContent.outBatchNo,
|
// templateName: this.searchContent.templateName,
|
// templateType: this.currTemplateType,
|
// operationTaskId: this.isTaskFilter ? this.currOperateTask.id : null,
|
// dutyRecordId: this.isDutyFilter ? this.currentDutyRecord.id : null,
|
// workstationId: this.isWorkstationFilter ? this.workstationId : null
|
// })
|
// console.log(val, res)
|
// this.productRecords = res.data.data
|
},
|
// 多选删除
|
select(selection, row) {
|
console.log(selection, row)
|
const arr = []
|
// this.idList = []
|
selection.forEach((item) => {
|
arr.push(item.id)
|
})
|
this.idList = [...new Set(arr)]
|
console.log(this.idList)
|
},
|
// 全选删除
|
selectAll(selection) {
|
console.log(selection)
|
const arr = []
|
// this.idList = []
|
selection.forEach((item) => {
|
arr.push(item.id)
|
})
|
this.idList = [...new Set(arr)]
|
console.log(this.idList)
|
},
|
async delAlls() {
|
let isContinue = true
|
if (this.idList.length >= 1) {
|
await this.$confirm(
|
`已选${this.idList.length}条记录,是否继续`,
|
'提示',
|
{
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}
|
)
|
.then(async () => {
|
isContinue = true
|
// this.idList = []
|
const res = await delAll(this.idList)
|
console.log(res)
|
this.getProductRecords()
|
this.$message.success('删除成功!')
|
this.idList = []
|
this.$refs.productRecordInfoTable.clearSelection()
|
})
|
.catch(() => {
|
isContinue = false
|
})
|
} else {
|
await this.$confirm('请选中数据', {
|
confirmButtonText: '确定',
|
type: 'warning'
|
})
|
}
|
},
|
productRecordTableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
|
let headerStyle = 'background:#599ef4;color:#fff;'
|
if (columnIndex === 0) {
|
headerStyle += 'border-radius: 6px 0px 0px 0px;'
|
} else if (columnIndex === 3) {
|
headerStyle += 'border-radius: 0px 6px 0px 0px;'
|
}
|
return headerStyle
|
},
|
productRecordTableRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 === 1) {
|
return 'stripe-row'
|
} else {
|
return ''
|
}
|
},
|
productRecordInfoTableRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 === 1) {
|
return 'stripe-row'
|
} else {
|
return ''
|
}
|
},
|
// 新增生产记录成功后的回调,刷新生产记录列表
|
productRecordSucessCallback(val) {
|
this.getProductRecords()
|
},
|
handleRemove(file, fileList) {
|
removeFile(file).then((response) => {
|
if (response.data.code === 0) {
|
this.$message.success('图片删除成功')
|
}
|
})
|
},
|
change(file, fileList) {},
|
handlePreview(file) {
|
window.open(file.url)
|
},
|
// 获取生产记录列表
|
getProductRecords() {
|
console.log(this.createDateRange)
|
let templateJson
|
if (this.createDateRange != null && this.createDateRange !== '') {
|
templateJson = {
|
operationTaskId: this.isTaskFilter ? this.currOperateTask.id : null,
|
dutyRecordId: this.isDutyFilter ? this.currentDutyRecord.id : null,
|
workstationId: this.isWorkstationFilter ? this.workstationId : null,
|
templateType: this.currTemplateType,
|
startTime: this.createDateRange[0],
|
endTime: this.createDateRange[1]
|
}
|
} else {
|
templateJson = {
|
operationTaskId: this.isTaskFilter ? this.currOperateTask.id : null,
|
dutyRecordId: this.isDutyFilter ? this.currentDutyRecord.id : null,
|
workstationId: this.isWorkstationFilter ? this.workstationId : null,
|
templateType: this.currTemplateType
|
}
|
}
|
|
getTemplateRecord(templateJson).then((response) => {
|
this.fileList = []
|
this.paramValues = []
|
this.currProductRecordId = null
|
if (response.data.code === 0) {
|
this.productRecords = response.data.data
|
} else {
|
this.productRecords = []
|
}
|
})
|
},
|
// 在页面添加一个新的点检记录或原始记录
|
addProductRecord() {
|
if (this.currentDutyRecord.shiftId == null) {
|
this.$message.error('请完善班次信息')
|
} else {
|
this.showProductRecordForm = true
|
}
|
},
|
// 点击某个生产记录触发
|
handleProductRecordChange(row) {
|
this.$refs.productRecordTable.forEach((item) => {
|
item.toggleRowSelection(row)
|
})
|
const index = this.idList.indexOf(row.id)
|
console.log(index)
|
if (index >= 0) {
|
this.idList.splice(index, 1)
|
} else {
|
this.idList.push(row.id)
|
}
|
console.log(this.idList)
|
this.currProductRecordId = row.id
|
this.paramValues = []
|
var productRecordJson = {
|
operationTaskRecordId: row.id
|
}
|
getTemplateParam(productRecordJson).then((response) => {
|
if (response.data.code === 0) {
|
this.paramValues = response.data.data
|
if (response.data.data.length > 0) {
|
const attachments =
|
response.data.data[0].operationTaskAttachmentList
|
// 渲染附件
|
this.fileList = []
|
if (attachments != null && attachments.length > 0) {
|
let attachment
|
let fileEl
|
for (let i = 0; i < attachments.length; i++) {
|
attachment = attachments[i]
|
fileEl = {}
|
fileEl.name = attachment.original
|
fileEl.url = attachment.url
|
fileEl.id = attachment.id
|
fileEl.fileName = attachment.fileName
|
this.fileList.push(fileEl)
|
}
|
}
|
}
|
} else {
|
this.paramValues = []
|
}
|
})
|
},
|
// 回车换行
|
nextFocus(index) {
|
index++
|
this.$refs['reference_' + index].focus()
|
// console.log(this.i)
|
},
|
// 删除某条生产记录
|
delProductrecord(index, row) {
|
var productRecordJson = {
|
id: row.id
|
}
|
deleteTemplateRecord(productRecordJson)
|
.then((response) => {
|
if (response.data.code === 0) {
|
this.productRecords.splice(index, 1)
|
this.currProductRecordId = null
|
this.paramValues = []
|
this.fileList = []
|
this.$message.success('删除成功!')
|
} else {
|
this.$message.error('删除失败!')
|
}
|
})
|
.catch((error) => {
|
console.log('生产记录删除异常')
|
})
|
},
|
// 修改参数值
|
async updateProductRecord() {
|
// var productRecord = {}
|
if (this.currProductRecordId) {
|
let isContinue = true
|
if (this.idList.length > 1) {
|
await this.$confirm(
|
`已选${this.idList.length}条记录,是否继续`,
|
'提示',
|
{
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}
|
)
|
.then(() => {
|
isContinue = true
|
// this.idList = []
|
})
|
.catch(() => {
|
isContinue = false
|
})
|
}
|
if (!isContinue) {
|
return
|
}
|
const currProductRecord = this.productRecords.find(
|
(item) => item.id === this.currProductRecordId
|
)
|
// var formdata = new FormData()
|
var paramValueArray = []
|
if (this.paramValues != null && this.paramValues.length > 0) {
|
// formdata.append('id', currProductRecord.id)
|
// formdata.append('operationTaskId', currProductRecord.operationTaskId)
|
// formdata.append(
|
// 'operationTemplateId',
|
// currProductRecord.operationTemplateId
|
// )
|
// formdata.append('dutyRecordId', currProductRecord.dutyRecordId)
|
// formdata.append('file', this.fileList)
|
var paramValue
|
for (var i = 0; i < this.paramValues.length; i++) {
|
paramValue = {
|
id: this.paramValues[i].id,
|
code: this.paramValues[i].code,
|
parameterItem: this.paramValues[i].parameterItem,
|
type: this.paramValues[i].type,
|
unit: this.paramValues[i].unit,
|
paramValue: this.paramValues[i].paramValue,
|
operationTemplateId: currProductRecord.operationTemplateId,
|
operationTaskRecordId: currProductRecord.id,
|
operationTaskId: currProductRecord.operationTaskId,
|
technologyOperationParamId: this.paramValues[i]
|
.technologyOperationParamId
|
}
|
paramValueArray.push(paramValue)
|
}
|
const obj = {
|
idList: this.idList,
|
operationTaskParamList: JSON.stringify(paramValueArray)
|
}
|
// 先转成jsonarray,在把jsonarray转string,最终答应[{},{}]
|
// formdata.append(
|
// 'operationTaskParamList',
|
// JSON.stringify(paramValueArray)
|
// )
|
updateProductRecord(obj).then((response) => {
|
console.log(this.idList)
|
if (response.data.code === 0) {
|
this.$message.success('修改成功')
|
console.log(this.$refs.productRecordTable)
|
this.$refs.productRecordTable.forEach((item) => {
|
item.clearSelection()
|
})
|
this.idList = []
|
} else {
|
this.$message.error('修改失败')
|
}
|
})
|
}
|
} else {
|
this.$message.error('请先选中生产记录')
|
}
|
},
|
// 获取工序参数类型
|
getParamType() {
|
remote('technology_param').then((response) => {
|
if (response.data.code === 0) {
|
this.typeOptions = response.data.data
|
} else {
|
this.typeOptions = []
|
}
|
})
|
},
|
// 表格字段格式化
|
getParam(row, column, cellValue) {
|
for (let i = 0, len = this.typeOptions.length; i < len; i++) {
|
if (cellValue == this.typeOptions[i].value) {
|
return this.typeOptions[i].label
|
}
|
}
|
},
|
// 生产模板切换
|
handleClick(tab, event) {
|
// 清空数据
|
this.currProductRecordId = null
|
this.paramValues = []
|
this.fileList = []
|
this.idList = []
|
this.$refs.productRecordTable.forEach((item) => {
|
item.clearSelection()
|
})
|
// 查询生产记录
|
this.getProductRecords()
|
}
|
},
|
watch: {
|
currOperateTask: {
|
handler(newValue, oldValue) {
|
// 清空数据
|
this.currProductRecordId = null
|
this.paramValues = []
|
this.fileList = []
|
this.$nextTick(() => {
|
if (newValue.id) {
|
this.currTemplateType = this.templateTypeList[0].templateTypeName
|
// 查询生产记录
|
this.getProductRecords()
|
} else {
|
this.productRecords = []
|
}
|
})
|
},
|
deep: true
|
},
|
'currentDutyRecord.id'(val) {
|
this.$nextTick(() => {
|
this.currTemplateType = this.templateTypeList[0].templateTypeName
|
this.getProductRecords()
|
})
|
},
|
workstationId() {
|
this.$nextTick(() => {
|
this.currTemplateType = this.templateTypeList[0].templateTypeName
|
this.getProductRecords()
|
})
|
}
|
}
|
}
|
</script>
|