| | |
| | | ></rich-text> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="工序参数" style="height: 100%"> |
| | | <el-card class="params-template"> |
| | | <div slot="header"> |
| | | <span>参数集</span> |
| | | <el-button |
| | | style="float: right; padding: 3px 0" |
| | | type="text" |
| | | size="medium" |
| | | v-if="editable && dataForm.operations.length > 0" |
| | | @click="openTempalteDialog" |
| | | >添加 |
| | | </el-button> |
| | | </div> |
| | | <el-table |
| | | ref="templateTable" |
| | | :data="operationTemplateList" |
| | | class="l-mes" |
| | | height="600" |
| | | highlight-current-row |
| | | @row-click="templateRowClick" |
| | | > |
| | | <el-table-column |
| | | label="名称" |
| | | prop="operationTemplateName" |
| | | align="center" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="类型" |
| | | prop="operationTemplateType" |
| | | align="center" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-tab-pane v-if="dataForm.id!=null" label="工序参数" style="height: 100%;"> |
| | | <el-row :gutter="10"> |
| | | <el-col :span="9"> |
| | | <el-card class="params-template"> |
| | | <div slot="header"> |
| | | <span>参数集</span> |
| | | <el-button |
| | | style="float: right; padding: 3px 0" |
| | | type="text" |
| | | size="mini" |
| | | size="medium" |
| | | v-if="editable && dataForm.operations.length > 0" |
| | | @click.stop=" |
| | | handleTemplateDelete(scope.row, scope.$index) |
| | | " |
| | | >删除 |
| | | @click="openTempalteDialog" |
| | | >添加 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | <el-card class="template-param"> |
| | | <div slot="header"> |
| | | <span>参数</span> |
| | | <div style="float: right;"> |
| | | <el-button |
| | | style="padding: 3px 0" |
| | | type="text" |
| | | size="medium" |
| | | v-if="editable && routingTemplateId != null" |
| | | @click="saveAllParamChange" |
| | | >保存 |
| | | </el-button> |
| | | <el-button |
| | | style="padding: 3px 0" |
| | | type="text" |
| | | size="medium" |
| | | v-if="editable && routingTemplateId != null" |
| | | @click="openTempalteParamDialog" |
| | | >添加 |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <el-table :data="paramData" class="l-mes" height="600"> |
| | | <el-table-column |
| | | label="参数项" |
| | | prop="parameterItem" |
| | | align="center" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span |
| | | >{{ scope.row.parameterItem }}({{ |
| | | scope.row.unit |
| | | }})</span |
| | | </div> |
| | | <el-table |
| | | ref="templateTable" |
| | | :data="operationTemplateList" |
| | | class="l-mes" |
| | | height="600" |
| | | highlight-current-row |
| | | @row-click="templateRowClick" |
| | | > |
| | | <el-table-column |
| | | label="名称" |
| | | prop="operationTemplateName" |
| | | align="center" |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="参数类型" |
| | | prop="type" |
| | | align="center" |
| | | :formatter="getParam" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column label="值" prop="paramValue" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input |
| | | v-model="scope.row.paramValue" |
| | | placeholder="值" |
| | | :disabled="!editable" |
| | | ></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | type="text" |
| | | size="mini" |
| | | v-if="editable && routingTemplateId != null" |
| | | @click.stop="handleParamDelete(scope.row, scope.$index)" |
| | | >删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="类型" |
| | | prop="operationTemplateType" |
| | | align="center" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | type="text" |
| | | size="mini" |
| | | v-if="editable && dataForm.operations.length > 0" |
| | | @click.stop=" |
| | | handleTemplateDelete(scope.row, scope.$index) |
| | | " |
| | | >删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="15"> |
| | | <el-card class="template-param"> |
| | | <div slot="header"> |
| | | <span>参数</span> |
| | | <div style="float: right;"> |
| | | <el-button |
| | | style="padding: 3px 0" |
| | | type="text" |
| | | size="medium" |
| | | v-if="editable && routingTemplateId != null" |
| | | @click="saveAllParamChange" |
| | | >保存 |
| | | </el-button> |
| | | <el-button |
| | | style="padding: 3px 0" |
| | | type="text" |
| | | size="medium" |
| | | v-if="editable && routingTemplateId != null" |
| | | @click="openTempalteParamDialog" |
| | | >添加 |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <component |
| | | :is="paramMergeTemplate" |
| | | :key="isShowTree" |
| | | :tableTreeData="paramData" |
| | | :routingTemplateId="routingTemplateId" |
| | | :handleParamDelete="handleParamDelete" |
| | | ></component> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | |
| | | import ElRow from 'element-ui/packages/row/src/row' |
| | | import ElCol from 'element-ui/packages/col/src/col' |
| | | import { getOperationParam } from '../../../api/basic/template' |
| | | import paramMergeTemplate from '../../common/param-mergeTemplate.vue' |
| | | import zttdraggable from 'vuedraggable' |
| | | |
| | | const capabilityArray = [ |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | paramMergeTemplate: '', |
| | | itemKey: '', |
| | | isShowTree: false, |
| | | typeOptions: [], |
| | | paramTemplateSelArr: [], |
| | | paramTemplateSelCol: 'operationTemplateNo', |
| | |
| | | operationPartDialog, |
| | | RichText, |
| | | editRoutingOperation, |
| | | zttdraggable |
| | | zttdraggable, |
| | | paramMergeTemplate |
| | | }, |
| | | mounted() { |
| | | window.addEventListener( |
| | |
| | | }, |
| | | // 参数集模板点击事件 |
| | | templateRowClick(row) { |
| | | if(this.isShowTree){ |
| | | this.isShowTree=false |
| | | }else{ |
| | | this.isShowTree=true |
| | | } |
| | | this.paramData=[] |
| | | this.getRoutingTemplateParam(row.id) |
| | | }, |
| | | // 根据工艺、工序id、模板id去获取模板下的参数 |
| | |
| | | }) |
| | | ).then((response) => { |
| | | if (response.data.data.length > 0) { |
| | | this.paramData = [] |
| | | this.paramData = response.data.data |
| | | this.paramMergeTemplate = 'paramMergeTemplate' |
| | | } else { |
| | | this.paramData = [] |
| | | } |
| | |
| | | |
| | | // 模板参数的选中结果返回 |
| | | selectTemplateParam(param) { |
| | | console.log(param); |
| | | let idList=[] |
| | | param.forEach(item=>{ |
| | | idList.push(item.id) |
| | | }) |
| | | console.log(idList); |
| | | let formData=new FormData() |
| | | formData.append("idList",idList) |
| | | fetchListByFather(formData).then((res) => { |
| | | console.log(res); |
| | | }) |
| | | // console.log(param); |
| | | // let idList=[] |
| | | // param.forEach(item=>{ |
| | | // idList.push(item.id) |
| | | // }) |
| | | // console.log(idList); |
| | | // let formData=new FormData() |
| | | // formData.append("idList",idList) |
| | | // fetchListByFather(formData).then((res) => { |
| | | // console.log(res); |
| | | // }) |
| | | if (param.length > 0) { |
| | | const paramrrs = { |
| | | id: this.dataForm.id, |
| | |
| | | const data = response.data |
| | | if (data.code == 0) { |
| | | const newParams = response.data.data |
| | | for (let i = 0; i < newParams.length; i++) { |
| | | this.paramData.push(newParams[i]) |
| | | } |
| | | console.log(newParams); |
| | | this.$message.success('添加成功') |
| | | } else { |
| | | this.$message.error('添加失败') |
| | |
| | | |
| | | // 删除参数 |
| | | handleParamDelete(row, index) { |
| | | this.$confirm('是否确认删除参数项为' + row.parameterItem, '提示', { |
| | | this.$confirm('是否确认删除参数项为【' + row.paramItem +'】的数据?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(function() { |
| | | return deleteRoutingTemplateParam(row.id) |
| | | let id = null |
| | | if(row.treeId && row.treeId!='null'){ |
| | | id = row.treeId |
| | | }else{ |
| | | if(row.twoId && row.twoId!='null'){ |
| | | id = row.twoId |
| | | }else{ |
| | | id = row.oneId |
| | | } |
| | | } |
| | | return deleteRoutingTemplateParam(id) |
| | | }) |
| | | .then((response) => { |
| | | const data = response.data |
| | |
| | | }, |
| | | // 保存所有参数的修改 |
| | | saveAllParamChange() { |
| | | const paramJson = { routingOperationParam: this.paramData } |
| | | let data = [] |
| | | this.paramData.forEach(ele=>{ |
| | | let o = { |
| | | id: null, |
| | | paramValue: ele.paramValue |
| | | } |
| | | if(ele.threeId && ele.threeId != 'null'){ |
| | | o.id = ele.threeId |
| | | }else{ |
| | | if(ele.twoId && ele.twoId != 'null'){ |
| | | o.id = ele.twoId |
| | | }else{ |
| | | o.id = ele.oneId |
| | | } |
| | | } |
| | | data.push(o) |
| | | }) |
| | | const paramJson = { routingOperationParam: data } |
| | | putRoutingTemplateParam(paramJson).then((response) => { |
| | | const data = response.data |
| | | if (data.code == 0) { |
| | |
| | | } |
| | | |
| | | .params-template { |
| | | float: left; |
| | | background-color: #fff; |
| | | width: 40%; |
| | | height: 687px; |
| | | padding: 10px 0px; |
| | | border: 1px solid #ddd; |
| | | } |
| | | |
| | | .template-param { |
| | | float: right; |
| | | background-color: #fff; |
| | | width: calc(60% - 10px); |
| | | height: 687px; |
| | | padding: 10px 0px; |
| | | border: 1px solid #ddd; |