<!--
|
* @Descripttion:
|
* @version:
|
* @Author: zt_lc
|
* @Date: 2022-07-01 15:15:54
|
* @LastEditors: zt_lc
|
* @LastEditTime: 2022-07-04 18:25:28
|
-->
|
<template>
|
<div>
|
<div style="display:flex;justify-content:space-around;">
|
<div style="width:32%">
|
<el-card class="document-params-template">
|
<div slot="header">
|
<span>检测标准</span>
|
<div style="float: right;">
|
<el-button
|
style="padding: 3px 0"
|
type="text"
|
size="medium"
|
v-if="
|
editable && dataFormId && routingOperationId && bomRoutingId
|
"
|
@click="openTestStandardDialog"
|
>添加
|
</el-button>
|
</div>
|
</div>
|
<el-table
|
ref="operationTestStandardTable"
|
:data="operationTestStandardList"
|
class="l-mes"
|
highlight-current-row
|
@row-click="testStandardRowClick"
|
height="400px"
|
>
|
<el-table-column
|
label="标准编号"
|
prop="standardNo"
|
align="center"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="标准名称"
|
prop="standardName"
|
align="center"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="检测类型"
|
prop="inspectionType"
|
align="center"
|
:formatter="inspectionTypeFomat"
|
/>
|
<el-table-column label="操作" align="center">
|
<template slot-scope="scope">
|
<el-button
|
@click="deleteMain(scope.row)"
|
type="text"
|
size="small"
|
class="red-but"
|
>删除</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-card>
|
</div>
|
<div style="width:64%">
|
<el-card class="document-template-rule">
|
<div slot="header">
|
<span>标准参数</span>
|
<div style="float: right;">
|
<el-button
|
style="padding: 3px 0"
|
type="text"
|
size="medium"
|
@click="dataFormTestStandardParam()"
|
v-if="editable"
|
>保存
|
</el-button>
|
<!-- <el-button
|
style="padding: 3px 0"
|
type="text"
|
size="medium"
|
v-if="editable "
|
@click="relateOperationParam()"
|
>添加
|
</el-button> -->
|
</div>
|
</div>
|
<el-table
|
:data="operationTestStandardParamList"
|
id="testStandardParamTable"
|
ref="testStandardParam"
|
:default-sort="{ prop: 'index' }"
|
highlight-current-row
|
height="400px"
|
style="width: 100%"
|
>
|
<el-table-column
|
prop="index"
|
label="序号"
|
align="center"
|
width="50"
|
/>
|
<el-table-column label="线芯" prop="wireCore" align="center" />
|
<el-table-column
|
prop="isCheck"
|
label="抽检"
|
align="center"
|
:formatter="isCheckFormatter"
|
/>
|
<el-table-column label="参数编号" prop="code" align="center" />
|
<el-table-column
|
label="参数项"
|
prop="parameterItem"
|
align="center"
|
/>
|
<el-table-column
|
label="检测范围"
|
prop="referenceValue"
|
align="center"
|
show-overflow-tooltip
|
>
|
<template slot-scope="scope">
|
<el-input
|
:ref="'reference_' + scope.$index"
|
v-model="scope.row.referenceValue"
|
@keyup.enter.native="nextFocus(scope.$index)"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="默认值"
|
prop="defaultValue"
|
align="center"
|
show-overflow-tooltip
|
>
|
<template slot-scope="scope">
|
<el-input
|
:ref="'defaultValue_' + scope.$index"
|
v-model="scope.row.defaultValue"
|
@keyup.enter.native="nextFocus2(scope.$index)"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="检测类型" prop="paramType" align="center">
|
<template slot-scope="scope">
|
<span>{{
|
scope.row.paramType
|
? paramTypeOptions.find((item) => {
|
return item.value === scope.row.paramType
|
}).label
|
: ''
|
}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="参数格式"
|
prop="parameterFormat"
|
align="center"
|
>
|
</el-table-column>
|
<el-table-column label="通道" prop="aisle" align="center">
|
</el-table-column>
|
<el-table-column label="部位" prop="position" align="center">
|
</el-table-column>
|
<el-table-column label="单位" prop="unit" align="center" />
|
<el-table-column
|
width="150"
|
label="继承检测零件"
|
prop="extendsPartNo"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<el-input
|
placeholder="请选择"
|
v-model="scope.row.extendsRoutingNo"
|
readonly
|
>
|
<span
|
slot="suffix"
|
v-if="scope.row.extendsRoutingNo"
|
@click="clearExtendPart(scope.row)"
|
>
|
<i
|
class="el-icon-close"
|
style="margin-left: 5px;cursor: pointer;"
|
></i>
|
</span>
|
<el-button
|
slot="append"
|
icon="el-icon-search"
|
@click="openExtendPart(scope.row)"
|
></el-button>
|
</el-input>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
width="150"
|
label="继承检测工序"
|
prop="extendsPartNo"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.extendsOperationNo"
|
placeholder="请选择"
|
readonly
|
>
|
<el-button
|
slot="append"
|
icon="el-icon-search"
|
@click="openExtendsOperation(scope.row)"
|
></el-button>
|
</el-input>
|
</template>
|
</el-table-column>
|
<el-table-column
|
width="150"
|
label="继承检测标准"
|
prop="extendsPartNo"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.extendsTestStandardNo"
|
placeholder="请选择"
|
readonly
|
>
|
<el-button
|
slot="append"
|
icon="el-icon-search"
|
@click="openExtendsTestStandard(scope.row)"
|
></el-button>
|
</el-input>
|
</template>
|
</el-table-column>
|
<el-table-column
|
width="150"
|
label="继承检测标准参数"
|
prop="extendsPartNo"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.extendsTestStandardParamNo"
|
placeholder="请选择"
|
readonly
|
>
|
<el-button
|
slot="append"
|
icon="el-icon-search"
|
@click="openExtendsTestStandardParam(scope.row)"
|
></el-button>
|
</el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" align="center">
|
<template slot-scope="scope">
|
<el-button
|
@click="deleteSon(scope.row)"
|
type="text"
|
size="small"
|
class="red-but"
|
>删除</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-card>
|
</div>
|
</div>
|
<testStandardDialog
|
:currshowlist.sync="showTestStandard"
|
@handleSelectionTestStandardChange="selectTestStandard"
|
:multiSelect="multiSelect"
|
:paramObj="paramObj"
|
:isExecuteCreate="isExecuteCreate"
|
/>
|
<!-- 弹窗, 基础参数选择 -->
|
<!--<ParamDialog
|
:currshowlist.sync="showParam"
|
@handleSelectionChange="getJoinData"
|
:paramSelArr="paramSelArr"
|
:paramSelCol="paramSelCol"
|
></ParamDialog>-->
|
<edit-order-param-form
|
v-if="editOrderParamVisible"
|
ref="editOrderParam"
|
@refreshOrderParamList="refreshOrderParamList"
|
></edit-order-param-form>
|
|
<extend-part
|
:currshowlist.sync="showExtendPart"
|
:data-form-id="dataFormId"
|
@listenToPartEvent="selectExtendPart"
|
></extend-part>
|
|
<extends-operation
|
:currshowlist.sync="showExtendsOperation"
|
:data-form-id="selectRow.extendsRoutingId"
|
@listenToPartEvent="selectExtendsOperation"
|
></extends-operation>
|
|
<extends-test-standard
|
:currshowlist.sync="showExtendsTestStandard"
|
:query-object="selectRow"
|
@listenToPartEvent="selectExtendsTestStandard"
|
></extends-test-standard>
|
|
<extends-test-standard-param
|
:currshowlist.sync="showExtendsTestStandardParam"
|
:data-form-id="selectRow.extendsTestStandardId"
|
@listenToPartEvent="selectExtendsTestStandardParam"
|
></extends-test-standard-param>
|
</div>
|
</template>
|
<style lang="scss" scoped>
|
.document-params-template >>> .el-card__body {
|
padding: 0px 0px 5px;
|
}
|
.document-template-rule >>> .el-card__body {
|
padding: 0px 0px 5px;
|
}
|
.red-but.is-disabled {
|
color: #fab6b6;
|
}
|
|
.red-but {
|
color: red;
|
}
|
.el-icon-close:before {
|
content: '\E78D';
|
}
|
</style>
|
<script>
|
import {
|
addRoutingTestStandard,
|
getRoutingTestStandardList,
|
deleteRoutingTestStandard,
|
getOperationTestStandardParam,
|
addOperationTestStandardParam
|
} from '@/api/plan/moteststandard'
|
import { getTestStandardParams } from '@/api/quality/teststandard'
|
import testStandardDialog from '@/views/common/teststandard'
|
import EditOrderParamForm from './editparamform'
|
import ParamDialog from '@/views/common/param.vue'
|
import { remote } from '../../../api/admin/dict'
|
import {
|
qryDocTestStandard,
|
qryDocTestStandardDetailsByStandardId,
|
addDocTestStandardOveride,
|
delDocTestStandardByIdOveride,
|
delDocTestStandardDetailByIdOveride,
|
updDocTestStandardDetails,
|
batchAddDocTestStandard,
|
getObj
|
} from '@/api/technology/document'
|
import { getObj as getTechnologyDetail } from '@/api/technology/routing'
|
import ExtendPart from '@/views/technology/document/extendPart'
|
import ExtendsOperation from '@/views/technology/document/extendsOperation'
|
import ExtendsTestStandard from '@/views/technology/document/extendsTestStandard'
|
import ExtendsTestStandardParam from '@/views/technology/document/extendsTestStandardParam'
|
import { delObj } from '@/api/warehouse/reservemain'
|
|
export default {
|
props: {
|
editable: {
|
type: Boolean,
|
default: false
|
},
|
dataFormId: {
|
type: Number,
|
default: 0
|
},
|
routingOperationId: {
|
type: Number,
|
default: 0
|
},
|
paramTypeOptions: {
|
type: Array,
|
default: () => {
|
return []
|
}
|
},
|
// operationTestStandardList: {
|
// type: Array,
|
// default: () => {
|
// return []
|
// }
|
// },
|
bomRoutingId: {
|
type: Number,
|
default: 0
|
},
|
everyBomRoutingId: {
|
type: Number,
|
default: 0
|
},
|
operationId: {
|
type: Number,
|
default: 0
|
},
|
operationName: {
|
type: String,
|
default: ''
|
}
|
},
|
data() {
|
return {
|
addCustomizeTestStandardVisible: false,
|
showTestStandard: false,
|
operationTestStandardParamList: [],
|
currentOperationTestStandardId: 0,
|
paramSelArr: [],
|
paramSelCol: 'code',
|
showParam: false,
|
insertIndex: null,
|
last: true,
|
editOrderParamVisible: false,
|
multiSelect: true,
|
paramObj: {
|
state: '02accepted'
|
},
|
operationTestStandardList: [],
|
isExecuteCreate: false,
|
showExtendPart: false,
|
showExtendsOperation: false,
|
showExtendsTestStandard: false,
|
showExtendsTestStandardParam: false,
|
selectRow: {}
|
}
|
},
|
components: {
|
ExtendsTestStandardParam,
|
ExtendsTestStandard,
|
ExtendsOperation,
|
ExtendPart,
|
testStandardDialog,
|
EditOrderParamForm
|
},
|
mounted() {
|
// this.rowDrop()
|
},
|
created() {
|
// this.initDirParamType()
|
if (
|
this.everyBomRoutingId != null &&
|
this.everyBomRoutingId != 0 &&
|
this.bomRoutingId != null &&
|
this.bomRoutingId != 0 &&
|
this.everyBomRoutingId === this.bomRoutingId
|
) {
|
this.isExecuteCreate = true
|
} else {
|
this.isExecuteCreate = false
|
}
|
},
|
methods: {
|
initDirParamType() {
|
remote('quality_param_type').then((response) => {
|
if (response.data.code === 0) {
|
this.paramTypeOptions = response.data.data
|
}
|
})
|
},
|
selectLastTestStandard() {
|
if (
|
this.operationTestStandardList &&
|
this.operationTestStandardList.length > 0
|
) {
|
const lastTestStandard = this.operationTestStandardList[
|
this.operationTestStandardList.length - 1
|
]
|
this.$refs.operationTestStandardTable.setCurrentRow(lastTestStandard)
|
this.getOperationTestStandardParam(lastTestStandard.id)
|
}
|
},
|
// 根据制造订单id和工艺工序id查询检测标准
|
getRoutingTestStandard(param) {
|
getRoutingTestStandardList(param).then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
this.currentOperationTestStandardId = 0
|
this.operationTestStandardList = resData.data
|
if (this.operationTestStandardList) {
|
this.$refs.operationTestStandardTable.setCurrentRow(
|
this.operationTestStandardList[0]
|
)
|
this.testStandardRowClick(this.operationTestStandardList[0])
|
}
|
this.operationTestStandardParamList = []
|
} else {
|
this.currentOperationTestStandardId = 0
|
this.operationTestStandardList = []
|
this.operationTestStandardParamList = []
|
this.$message.error('检测标准请求异常')
|
}
|
})
|
},
|
// 弹出基础检测标准选择列表
|
openTestStandardDialog() {
|
this.showTestStandard = true
|
},
|
// 检测标准的选中结果返回
|
selectTestStandard(param) {
|
if (param && param.length > 0) {
|
const queryParamList = []
|
param.forEach((item) => {
|
queryParamList.push({
|
docBomId: this.bomRoutingId,
|
routingOperationId: this.routingOperationId, // 工艺工序关系ID
|
testStandardId: item.id
|
})
|
})
|
batchAddDocTestStandard(queryParamList).then((res) => {
|
const resData = res.data.data
|
this.$emit('refreshTestStandardInfo', resData)
|
this.getMainList()
|
this.$message.success('添加成功')
|
})
|
}
|
},
|
// 检测标准点击事件,显示检测标准参数
|
testStandardRowClick(row) {
|
this.getSonList(row.id)
|
},
|
// 根据工艺工序id、模板id去获取模板下的参数
|
getOperationTestStandardParam(standardId) {
|
this.currentOperationTestStandardId = standardId
|
getTestStandardParams(
|
Object.assign({
|
testStandardId: standardId
|
})
|
).then((response) => {
|
this.operationTestStandardParamList = response.data.data
|
})
|
},
|
|
rowDrop() {
|
const that = this
|
const tbody = document.querySelector(
|
'#testStandardParamTable .el-table__body-wrapper tbody'
|
)
|
Sortable.create(tbody, {
|
// 结束拖拽
|
onEnd({ newIndex, oldIndex }) {
|
if (newIndex > oldIndex) {
|
// 下移
|
that.operationTestStandardParamList
|
.filter((e) => e.index === oldIndex + 1)
|
.forEach((e) => (e.index = 'x'))
|
that.operationTestStandardParamList
|
.filter((e) => e.index > oldIndex + 1 && e.index <= newIndex + 1)
|
.forEach((e) => (e.index = e.index - 1))
|
that.operationTestStandardParamList
|
.filter((e) => e.index === 'x')
|
.forEach((e) => (e.index = newIndex + 1))
|
} else if (oldIndex > newIndex) {
|
// 上移
|
that.operationTestStandardParamList
|
.filter((e) => e.index === oldIndex + 1)
|
.forEach((e) => (e.index = 'x'))
|
that.operationTestStandardParamList
|
.filter((e) => e.index < oldIndex + 1 && e.index >= newIndex + 1)
|
.forEach((e) => (e.index = e.index + 1))
|
that.operationTestStandardParamList
|
.filter((e) => e.index === 'x')
|
.forEach((e) => (e.index = newIndex + 1))
|
}
|
}
|
})
|
},
|
// 提交检测标准参数
|
dataFormTestStandardParam() {
|
if (this.operationTestStandardParamList.length > 0) {
|
for (let i = 0; i < this.operationTestStandardParamList.length; i++) {
|
// 如果继承的没选完 提示
|
const item = this.operationTestStandardParamList[i]
|
if (
|
item.extendsRoutingId &&
|
(!item.extendsRoutingId ||
|
!item.extendsTestStandardId ||
|
!item.extendsTestStandardParamId)
|
) {
|
this.$message.error('请选择正确的继承检测标准参数')
|
return
|
}
|
}
|
console.log(this.operationTestStandardParamList)
|
updDocTestStandardDetails(this.operationTestStandardParamList).then(
|
(response) => {
|
this.$message.success('检测标准参数保存成功')
|
this.getSonList(this.currentOperationTestStandardId)
|
}
|
)
|
} else {
|
this.$message.warning('请先添加参数')
|
}
|
},
|
editTestStandardParam(row) {
|
this.editOrderParamVisible = true
|
this.$nextTick(() => {
|
this.$refs.editOrderParam.init(row)
|
})
|
},
|
deleteTestStandardParam(row) {
|
this.$confirm('是否确认删除参数编号为:' + row.code, {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then((data) => {
|
this.operationTestStandardParamList.splice(
|
this.operationTestStandardParamList.findIndex(
|
(item) => item.index === row.index
|
),
|
1
|
)
|
this.operationTestStandardParamList
|
.filter((e) => e.index >= row.index)
|
.forEach((e) => (e.index = e.index - 1))
|
this.$message.success('删除参数成功')
|
})
|
},
|
// 选择基础参数(添加)
|
relateOperationParam() {
|
if (this.currentOperationTestStandardId !== 0) {
|
this.selectedParamCode()
|
this.showParam = true
|
} else {
|
this.$message.error('请选择检测标准')
|
}
|
},
|
// 选择基础参数(插入)
|
insertOperationParam(row) {
|
this.selectedParamCode()
|
this.showParam = true
|
this.last = false
|
this.insertIndex = row.index
|
},
|
selectedParamCode() {
|
// 筛选出当前页面已有的参数
|
this.paramSelArr = []
|
if (this.operationTestStandardParamList.length > 0) {
|
this.operationTestStandardParamList.forEach((ele) => {
|
if (ele.code != null && ele.code !== '') {
|
this.paramSelArr.push(ele.code)
|
}
|
})
|
}
|
},
|
refreshOrderParamList() {
|
getOperationTestStandardParam(
|
Object.assign({
|
moTestStandardId: this.currentOperationTestStandardId
|
})
|
).then((response) => {
|
this.operationTestStandardParamList = response.data.data
|
})
|
},
|
// 选中的基础参数信息
|
getJoinData(param) {
|
const newDataList = this.operationTestStandardParamList
|
this.operationTestStandardParamList = []
|
this.$nextTick(() => {
|
this.operationTestStandardParamList = newDataList
|
for (let i = 0, len = param.length; i < len; i++) {
|
if (this.last) {
|
this.operationTestStandardParamList.push(
|
Object.assign({
|
moTestStandardId: this.currentOperationTestStandardId,
|
code: param[i].code,
|
parameterItem: param[i].parameterItem,
|
type: param[i].type,
|
unit: param[i].unit,
|
parameterFormat: param[i].parameterFormat,
|
referenceValue: null,
|
index: this.operationTestStandardParamList.length + 1
|
})
|
)
|
} else {
|
this.operationTestStandardParamList
|
.filter((e) => e.index >= this.insertIndex)
|
.forEach((e) => (e.index = e.index + 1))
|
this.operationTestStandardParamList.push(
|
Object.assign({
|
moTestStandardId: this.currentOperationTestStandardId,
|
code: param[i].code,
|
parameterItem: param[i].parameterItem,
|
type: param[i].type,
|
unit: param[i].unit,
|
parameterFormat: param[i].parameterFormat,
|
referenceValue: null,
|
index: this.insertIndex
|
})
|
)
|
}
|
}
|
})
|
},
|
// 主删除
|
deleteMain(row) {
|
this.$confirm('是否确认删除检测标准' + row.standardName, '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
closeOnClickModal: false,
|
type: 'warning'
|
})
|
.then(function() {
|
return delDocTestStandardByIdOveride(row.id)
|
})
|
.then((data) => {
|
this.$message.success('删除成功')
|
this.operationTestStandardList = []
|
this.operationTestStandardParamList = []
|
this.getMainList()
|
})
|
},
|
// 子删除
|
deleteSon(row) {
|
this.$confirm('是否确认删除参数项' + row.parameterItem, '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
closeOnClickModal: false,
|
type: 'warning'
|
})
|
.then(function() {
|
return delDocTestStandardDetailByIdOveride(row.id)
|
})
|
.then((data) => {
|
this.$message.success('删除成功')
|
this.operationTestStandardList = []
|
this.operationTestStandardParamList = []
|
this.getMainList()
|
})
|
},
|
// 输入enter键,下一行自动聚焦并选中‘要求范围’字段的input
|
nextFocus(index) {
|
let nextRef
|
if (index + 1 >= this.operationTestStandardParamList.length) {
|
nextRef = 'reference_0'
|
} else {
|
nextRef = 'reference_' + (index + 1)
|
}
|
this.$refs[nextRef].focus()
|
this.$refs[nextRef].select()
|
},
|
nextFocus2(index) {
|
let nextRef
|
if (index + 1 >= this.operationTestStandardParamList.length) {
|
nextRef = 'defaultValue_0'
|
} else {
|
nextRef = 'defaultValue_' + (index + 1)
|
}
|
this.$refs[nextRef].focus()
|
this.$refs[nextRef].select()
|
},
|
getMainList() {
|
var obj = {
|
docBomId: this.bomRoutingId,
|
routingOperationId: this.routingOperationId
|
}
|
qryDocTestStandard(obj).then((res) => {
|
this.operationTestStandardList = res.data.data
|
})
|
},
|
getSonList(standardId) {
|
this.currentOperationTestStandardId = standardId
|
qryDocTestStandardDetailsByStandardId(
|
Object.assign({
|
standardId: standardId
|
})
|
).then((response) => {
|
this.operationTestStandardParamList = response.data.data
|
// this.operationTestStandardParamList.forEach((item) => {
|
// item.extendsTdspId = standardId
|
// })
|
})
|
},
|
inspectionTypeFomat(row, column) {
|
if (row.inspectionType != null) {
|
if (row.inspectionType === '08process') {
|
return '工序检'
|
} else if (row.inspectionType === '00outputfirst') {
|
return '产出首检'
|
} else if (row.inspectionType === '01output') {
|
return '产出尾检'
|
} else if (row.inspectionType === '06finishedproduct') {
|
return '成品检'
|
} else if (row.inspectionType === '02stock') {
|
return '库存报检'
|
} else if (row.inspectionType === '03erp') {
|
return 'erp库存报检'
|
} else if (row.inspectionType === '04onsite') {
|
return '巡检'
|
} else if (row.inspectionType === '05back') {
|
return '退货报检'
|
} else if (row.inspectionType === '07batchfirst') {
|
return '批次首检'
|
} else if (row.inspectionType === '04firstInsp') {
|
return '上机检'
|
} else if (row.inspectionType === '05lastInsp') {
|
return '下机检'
|
}
|
} else {
|
return ''
|
}
|
},
|
clearExtendPart(row) {
|
this.$confirm('确认删除此继承零件?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
closeOnClickModal: false,
|
type: 'warning'
|
})
|
.then(function() {
|
row.extendsRoutingId = null
|
row.extendsPartNo = null
|
row.extendsRoutingNo = null
|
row.extendsOperationId = null
|
row.extendsOperationNo = null
|
row.extendsTestStandardId = null
|
row.extendsTestStandardNo = null
|
row.extendsTestStandardParamId = null
|
row.extendsTestStandardParamNo = null
|
})
|
.then((data) => {})
|
},
|
openExtendPart(row) {
|
if (row) {
|
this.showExtendPart = true
|
this.selectRow = row
|
}
|
},
|
openExtendsOperation(row) {
|
if (row.extendsRoutingId) {
|
this.showExtendsOperation = true
|
this.selectRow = row
|
} else {
|
this.$message.error('请先选择继承检测零件')
|
}
|
},
|
openExtendsTestStandard(row) {
|
console.log(row)
|
if (row.extendsOperationId) {
|
this.showExtendsTestStandard = true
|
this.selectRow = row
|
} else {
|
this.$message.error('请先选择继承检测工序')
|
}
|
},
|
openExtendsTestStandardParam(row) {
|
if (row.extendsTestStandardId) {
|
this.showExtendsTestStandardParam = true
|
this.selectRow = row
|
} else {
|
this.$message.error('请先选择继承检测标准')
|
}
|
},
|
selectExtendPart(param) {
|
for (let i = 0; i < this.operationTestStandardParamList.length; i++) {
|
if (this.selectRow.id === this.operationTestStandardParamList[i].id) {
|
if (param) {
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'extendsRoutingId',
|
param.routingId
|
)
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'extendsPartNo',
|
param.partNo
|
)
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'extendsRoutingNo',
|
param.routingNo
|
)
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'bomRoutingId',
|
param.id
|
)
|
} else {
|
this.operationTestStandardParamList[i].extendsRoutingId = null
|
this.operationTestStandardParamList[i].extendsPartNo = null
|
this.operationTestStandardParamList[i].extendsRoutingNo = null
|
}
|
this.operationTestStandardParamList[i].extendsOperationId = null
|
this.operationTestStandardParamList[i].extendsOperationNo = null
|
this.operationTestStandardParamList[i].extendsTestStandardId = null
|
this.operationTestStandardParamList[i].extendsTestStandardNo = null
|
this.operationTestStandardParamList[
|
i
|
].extendsTestStandardParamId = null
|
this.operationTestStandardParamList[
|
i
|
].extendsTestStandardParamNo = null
|
break
|
}
|
}
|
},
|
selectExtendsOperation(param) {
|
if (param) {
|
for (let i = 0; i < this.operationTestStandardParamList.length; i++) {
|
if (this.selectRow.id === this.operationTestStandardParamList[i].id) {
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'extendsOperationId',
|
param.operationId
|
)
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'routingOperationId',
|
param.id
|
)
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'extendsOperationNo',
|
param.operationNo
|
)
|
this.operationTestStandardParamList[i].extendsTestStandardId = null
|
this.operationTestStandardParamList[i].extendsTestStandardNo = null
|
this.operationTestStandardParamList[
|
i
|
].extendsTestStandardParamId = null
|
this.operationTestStandardParamList[
|
i
|
].extendsTestStandardParamNo = null
|
break
|
}
|
}
|
}
|
},
|
selectExtendsTestStandard(param) {
|
if (param) {
|
for (let i = 0; i < this.operationTestStandardParamList.length; i++) {
|
if (this.selectRow.id === this.operationTestStandardParamList[i].id) {
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'extendsTestStandardId',
|
param.id
|
)
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'extendsTestStandardNo',
|
param.standardNo
|
)
|
this.operationTestStandardParamList[
|
i
|
].extendsTestStandardParamId = null
|
this.operationTestStandardParamList[
|
i
|
].extendsTestStandardParamNo = null
|
break
|
}
|
}
|
}
|
},
|
selectExtendsTestStandardParam(param) {
|
if (param) {
|
for (let i = 0; i < this.operationTestStandardParamList.length; i++) {
|
if (this.selectRow.id === this.operationTestStandardParamList[i].id) {
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'extendsTestStandardParamId',
|
param.id
|
)
|
this.$set(
|
this.operationTestStandardParamList[i],
|
'extendsTestStandardParamNo',
|
param.code
|
)
|
break
|
}
|
}
|
}
|
},
|
isCheckFormatter(row) {
|
let isCheckStr = ''
|
if (row.isCheck != null) {
|
if (row.isCheck) {
|
isCheckStr = '是'
|
} else {
|
isCheckStr = '否'
|
}
|
}
|
return isCheckStr
|
}
|
},
|
watch: {
|
// operationTestStandardList: {
|
// handler(newValue, oldValue) {
|
// // this.operationTestStandardParamList = []
|
// },
|
// deep: true
|
// }
|
routingOperationId: {
|
handler(newValue, oldValue) {
|
if (newValue) {
|
if (
|
this.everyBomRoutingId != null &&
|
this.everyBomRoutingId != 0 &&
|
this.bomRoutingId != null &&
|
this.bomRoutingId != 0 &&
|
this.everyBomRoutingId === this.bomRoutingId
|
) {
|
this.getMainList()
|
}
|
}
|
},
|
immediate: true
|
}
|
}
|
}
|
</script>
|