| | |
| | | <template #toolbar></template> |
| | | </ttable> |
| | | </el-col> |
| | | <el-col :span="12" style="padding-left: 10px"> |
| | | <el-col :span="12"> |
| | | <el-card> |
| | | <div slot="header"> |
| | | <div slot="header" style="height:20px"> |
| | | <el-row> |
| | | <el-col :span="8"> |
| | | <span>参数</span> |
| | |
| | | </el-row> |
| | | </div> |
| | | <paramMergeTemplate |
| | | style="padding: 0px 5px;" |
| | | :key="isShowTree" |
| | | :isModel="true" |
| | | :option="paramTemplateOption" |
| | |
| | | :handleParamSave="saveSample" |
| | | :tableTreeData="operationParams"> |
| | | </paramMergeTemplate> |
| | | <!-- <component :is="paramMergeTemplate" |
| | | :key="isShowTree" |
| | | :tableTreeData="operationParams"></component> --> |
| | | <!-- <el-table |
| | | :data="operationParams" |
| | | id="templateParamTable" |
| | |
| | | }, |
| | | addOrUpdateVisible: false, |
| | | paramTemplateOption: { |
| | | height: 300, |
| | | maxHeight: 450, |
| | | height: 450, |
| | | loadingText: "Loading...", |
| | | columnBtn: false, |
| | | index: true, |
| | | indexLabel: '序号', |
| | |
| | | }, |
| | | mounted() { |
| | | this.getParamType() |
| | | this.rowDrop() |
| | | // this.rowDrop() |
| | | }, |
| | | methods: { |
| | | // 获取数据列表 |
| | |
| | | this.newOperationParams.push( |
| | | Object.assign({ |
| | | technologyOperationTemplateId: this.templateId, |
| | | technologyOperationParamId: this.operationParams[j].id, |
| | | technologyOperationParamId: this.operationParams[j].id ? this.operationParams[j].id : this.operationParams[j].oneId, |
| | | sort: this.operationParams[j].index |
| | | }) |
| | | ) |
| | |
| | | (response) => { |
| | | const resData = response.data |
| | | if (resData.code === 0) { |
| | | const resSteps = resData.data |
| | | if (resSteps.length > 0) { |
| | | this.operationParams = [] |
| | | let operationParam |
| | | for (let i = 0; i < resSteps.length; i++) { |
| | | operationParam = { |
| | | id: resSteps[i].id, |
| | | code: resSteps[i].code, |
| | | parameterItem: resSteps[i].parameterItem, |
| | | unit: resSteps[i].unit, |
| | | index: resSteps[i].index, |
| | | type: resSteps[i].type, |
| | | defaultValue: resSteps[i].defaultValue, |
| | | dict: resSteps[i].dict, |
| | | sysDictItemList: resSteps[i].sysDictItemList, |
| | | technologyOperationTemplateId: |
| | | resSteps[i].technologyOperationTemplateId |
| | | } |
| | | /* operationParam.id = resSteps[i].id |
| | | operationParam.code = resSteps[i].code |
| | | operationParam.parameterItem = resSteps[i].parameterItem |
| | | operationParam.unit = resSteps[i].unit |
| | | operationParam.index = resSteps[i].index |
| | | operationParam.type = resSteps[i].type |
| | | operationParam.defaultValue = resSteps[i].defaultValue */ |
| | | this.operationParams.push(operationParam) |
| | | } |
| | | } |
| | | this.operationParams = resData.data |
| | | if (state) { |
| | | this.$message.success('参数关联成功') |
| | | } |
| | |
| | | }) |
| | | }, |
| | | deleteOperationParam(row) { |
| | | let id = null |
| | | if(row.threeId && row.threeId!='null'){ |
| | | id = row.threeId |
| | | }else{ |
| | | if(row.twoId && row.twoId!='null'){ |
| | | id = row.twoId |
| | | }else{ |
| | | id = row.oneId |
| | | } |
| | | } |
| | | this.$confirm('是否确认删除参数编号为:' + row.code, { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then((data) => { |
| | | this.operationParams.splice( |
| | | this.operationParams.findIndex((item) => item.index === row.index), |
| | | 1 |
| | | ) |
| | | this.operationParams |
| | | .filter((e) => e.index >= row.index) |
| | | .forEach((e) => (e.index = e.index - 1)) |
| | | this.operationParams.findIndex((item) => { |
| | | let itemId = null |
| | | if(item.threeId && item.threeId!='null'){ |
| | | itemId = item.threeId |
| | | }else{ |
| | | if(item.twoId && item.twoId!='null'){ |
| | | itemId = item.twoId |
| | | }else{ |
| | | itemId = item.oneId |
| | | } |
| | | } |
| | | return itemId === id |
| | | }),1) |
| | | // this.operationParams |
| | | // .filter((e) => e.oneId >= row.oneId) |
| | | // .forEach((e) => (e.index = e.index - 1)) |
| | | deleteOperationParamTemplate( |
| | | Object.assign({ |
| | | technologyOperationTemplateId: this.templateId, |
| | | technologyOperationParamId: row.id |
| | | technologyOperationParamId: id |
| | | }) |
| | | ).then((response) => { |
| | | this.$message.success('删除关联成功') |
| | | // if (response.data.code == 0 && this.operationParams.length > 0) { |
| | | // this.dataFormRelateOperationParam(false) |
| | | // } |
| | | }) |
| | | if (this.operationParams.length > 0) { |
| | | this.dataFormRelateOperationParam(false) |
| | | } |
| | | }) |
| | | }, |
| | | // 获取工序参数类型 |