| | |
| | | ></rich-text> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="工序参数" style="height: 100%"> |
| | | <el-tab-pane v-if="dataForm.id!=null" label="工序参数" style="height: 100%"> |
| | | <el-card class="params-template"> |
| | | <div slot="header"> |
| | | <span>参数集</span> |
| | |
| | | </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 |
| | | > |
| | | </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> |
| | | <div> |
| | | <component |
| | | :is="paramMergeTemplate" |
| | | :key="isShowTree" |
| | | :tableTreeData="paramData" |
| | | :routingTemplateId="routingTemplateId" |
| | | :handleParamDelete="handleParamDelete" |
| | | ></component> |
| | | </div> |
| | | </el-card> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | |
| | | } from '@/api/technology/routing' |
| | | import { fetchList as getBomList } from '@/api/technology/completeproductstructure' |
| | | import { getByOperation } from '@/api/aps/capability' |
| | | import { fetchListByFather} from '@/api/basic/param' |
| | | import { remote } from '@/api/admin/dict' |
| | | import diagram from './diagram' |
| | | import operationDialog from '@/views/common/operation.vue' |
| | |
| | | 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); |
| | | // }) |
| | | 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) { |