| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item prop="partName" label="零件名称"> |
| | | <el-tooltip class="item" effect="dark" :content="dataForm.partName" > |
| | | <el-input |
| | | v-model="dataForm.partName" |
| | | placeholder="零件名称" |
| | | readonly |
| | | style="width: 100%" |
| | | ></el-input> |
| | | </el-tooltip> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="BOM" prop="bomId"> |
| | | <el-select style="width:100%" :disabled="dataForm.id != null" v-model="dataForm.bomId" placeholder="" filterable> |
| | | <el-select style="width:100%" v-model="dataForm.bomId" placeholder="" filterable> |
| | | <el-option |
| | | v-for="item in bomList" |
| | | :key="item.id" |
| | |
| | | <el-button |
| | | style="float: right; padding: 3px 0" |
| | | type="text" |
| | | @click=";(showOperation = true), (last = true)" |
| | | @click=";(showOperation = true), (last = true),(multiSelect=true)" |
| | | v-if="editable" |
| | | >添加</el-button |
| | | > |
| | |
| | | '--dragitemwidth': '250px' |
| | | }" |
| | | > |
| | | <div |
| | | :style="{ |
| | | width: 265 * dataForm.operations.length - 15 + 'px' |
| | | }" |
| | | > |
| | | <div |
| | | class="dragHead" |
| | | v-for="x in dataForm.operations.length" |
| | | :key="x" |
| | | > |
| | | <div :style="{ width: 265 * dataForm.operations.length - 15 + 'px' }"> |
| | | <div class="dragHead" v-for="x in dataForm.operations.length" :key="x" > |
| | | <div class="idx">{{ x }}</div> |
| | | </div> |
| | | <zttdraggable |
| | |
| | | effect="dark" |
| | | > |
| | | {{ item.label }} |
| | | </el-tag> |
| | | </el-tag> |
| | | </div> --> |
| | | <el-divider content-position="left">备注</el-divider> |
| | | <div class="node-content-remark"> |
| | |
| | | |
| | | <operationDialog |
| | | :currshowlist.sync="showOperation" |
| | | :multiSelect="multiSelect" |
| | | @handleSelectionChange="insertOperation" |
| | | @listenToOperationEvent="insertOperation" |
| | | /> |
| | | <partDialog :currshowlist.sync="showPart" @listenToPartEvent="selectPart" /> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | multiSelect: true, |
| | | itemKey: '', |
| | | typeOptions: [], |
| | | paramTemplateSelArr: [], |
| | |
| | | editRoutingOperation, |
| | | zttdraggable |
| | | }, |
| | | created(){ |
| | | }, |
| | | mounted() { |
| | | window.addEventListener( |
| | | 'hashchange', |
| | |
| | | }, |
| | | false |
| | | ) |
| | | |
| | | // this.rowDrop() |
| | | }, |
| | | |
| | | computed: { |
| | |
| | | this.operationPart.remark = val |
| | | }, |
| | | insertTechnologyOperation(row) { |
| | | this.multiSelect = false |
| | | this.showOperation = true |
| | | this.last = false |
| | | this.operationIndex = row.index |
| | |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | operation.operationName = operation.name |
| | | operation.operationId = operation.id |
| | | operation.id = null |
| | | if (this.last) { |
| | | // 行最后添加 |
| | | operation.index = this.dataForm.operations.length + 1 |
| | | this.dataForm.operations.push(operation) |
| | | } else { |
| | | // 插入前一行 |
| | | operation.index = this.operationIndex |
| | | this.dataForm.operations = [ |
| | | ...this.dataForm.operations.slice(0, operation.index - 1), |
| | | operation, |
| | | ...this.dataForm.operations.slice(operation.index - 1) |
| | | ] |
| | | if(this.multiSelect){ |
| | | operation.forEach(item => { |
| | | let obj = {}; |
| | | obj.operationName = item.name; |
| | | obj.operationId = item.id; |
| | | if (this.last){ |
| | | // 行最后添加 |
| | | obj.index = this.dataForm.operations.length + 1 |
| | | this.dataForm.operations.push(obj) |
| | | }else{ |
| | | // 插入前一行 |
| | | obj.index = this.operationIndex |
| | | this.dataForm.operations = [ |
| | | ...this.dataForm.operations.slice(0, obj.index - 1), |
| | | obj, |
| | | ...this.dataForm.operations.slice(obj.index - 1) |
| | | ] |
| | | } |
| | | this.dataForm.operations.forEach((e, idx) => { |
| | | e.index = idx + 1 |
| | | }) |
| | | this.$forceUpdate() |
| | | this.$refs.operationTable.sort('index') |
| | | Promise.all([this.save()]).then((res) => { |
| | | this.selectByIndex(obj.index) |
| | | }) |
| | | }) |
| | | }else{ |
| | | operation.operationName = operation.name |
| | | operation.operationId = operation.id |
| | | operation.id = null |
| | | if (this.last) { |
| | | // 行最后添加 |
| | | operation.index = this.dataForm.operations.length + 1 |
| | | this.dataForm.operations.push(operation) |
| | | } else { |
| | | // 插入前一行 |
| | | operation.index = this.operationIndex |
| | | this.dataForm.operations = [ |
| | | ...this.dataForm.operations.slice(0, operation.index - 1), |
| | | operation, |
| | | ...this.dataForm.operations.slice(operation.index - 1) |
| | | ] |
| | | } |
| | | this.dataForm.operations.forEach((e, idx) => { |
| | | e.index = idx + 1 |
| | | }) |
| | | this.$forceUpdate() |
| | | this.$refs.operationTable.sort('index') |
| | | Promise.all([this.save()]).then((res) => { |
| | | this.selectByIndex(operation.index) |
| | | }) |
| | | } |
| | | this.dataForm.operations.forEach((e, idx) => { |
| | | e.index = idx + 1 |
| | | }) |
| | | this.$forceUpdate() |
| | | this.$refs.operationTable.sort('index') |
| | | Promise.all([this.save()]).then((res) => { |
| | | this.selectByIndex(operation.index) |
| | | }) |
| | | }, |
| | | |
| | | handleDelete(row) { |
| | |
| | | // 保存所有参数的修改 |
| | | saveAllParamChange() { |
| | | const paramJson = { routingOperationParam: this.paramData } |
| | | let num = 0 |
| | | this.paramData.forEach(e=>{ |
| | | var regex=/^[^\(\)|^,]+$/; |
| | | if(!regex.test(e.paramValue)){ |
| | | num+=1 |
| | | } |
| | | }) |
| | | if(num>0){ |
| | | this.$message.error("参数值不能包含英文括号或逗号,请检查") |
| | | return |
| | | } |
| | | putRoutingTemplateParam(paramJson).then((response) => { |
| | | const data = response.data |
| | | if (data.code == 0) { |