| | |
| | | <div class="ins_order_config"> |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="6" style="padding-left: 20px;">电缆配置</el-col> |
| | | <el-col :span="6" style="padding-left: 20px;">子样品配置</el-col> |
| | | <el-col :span="18" style="text-align: right;"> |
| | | <el-button size="medium" type="primary" @click="addChild" v-if="active==1">添加子样品</el-button> |
| | | <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-if="active==1">保 存</el-button> |
| | |
| | | }) |
| | | }, |
| | | save() { |
| | | if(this.sampleList.length === 0){ |
| | | if (this.sampleList.length === 0) { |
| | | this.$message.error('缺少配置无法保存') |
| | | return |
| | | } |
| | | this.parentSample.forEach(a=>{ |
| | | this.parentSample.forEach(a => { |
| | | a.childSampleList = this.sampleList |
| | | }) |
| | | this.$message.success('已保存') |
| | |
| | | this.selectStandardTree = true |
| | | }, |
| | | selectSample(val) { |
| | | if(val === null)return |
| | | if (val === null) return |
| | | this.sampleIds = [val.id] |
| | | }, |
| | | rowClick(row, column, event) { |
| | |
| | | }, |
| | | handleChangeModel(e) { |
| | | let num = this.selectTree.split('-').length; |
| | | if (num == 4) { |
| | | if (num != 5) { |
| | | this.selectTree = this.selectTree + ' - ' + e |
| | | } else { |
| | | let arr = this.selectTree.split('-') |
| | |
| | | this.addObj.factory = trees[0] |
| | | this.addObj.laboratory = trees[1] |
| | | this.addObj.sampleType = trees[2] |
| | | this.addObj.sample = trees[3] |
| | | if(trees[3]===''){ |
| | | this.addObj.sample = (trees[4] == undefined ? null : trees[4]) |
| | | }else if(trees[3]===undefined){ |
| | | this.addObj.sample = trees[2] |
| | | }else{ |
| | | this.addObj.sample = trees[3] |
| | | } |
| | | this.addObj.model = (trees[4] == undefined ? null : trees[4]) |
| | | this.selectStandardTree = false |
| | | this.sample.joinName = null |
| | |
| | | }, |
| | | getNodeParent(val) { |
| | | if (val.parent != null) { |
| | | this.selectTree += ' - ' + val.label |
| | | if (val.data.children === null) { |
| | | this.selectTree += ' - ' + val.label + ' - ' + '' |
| | | } else { |
| | | this.selectTree += ' - ' + val.label |
| | | } |
| | | this.getNodeParent(val.parent) |
| | | } |
| | | }, |