| | |
| | | 询</span></el-button> |
| | | </div> |
| | | |
| | | <div v-if="this.typeselect == 0"> |
| | | <div class="contentTable" v-if="this.typeselect == 0"> |
| | | <technology :tableType="tableType" :tableData="tableData"></technology> |
| | | </div> |
| | | <div v-if="this.typeselect == 1"> |
| | | 技术指标 |
| | | </div> |
| | | <div v-if="this.typeselect == 1">技术指标</div> |
| | | <div v-if="this.typeselect == 2"> |
| | | <material :tableType="tableType" :tableData="tableData"></material> |
| | | <bom :tableType="tableType" :tableData="tableData"></bom> |
| | | </div> |
| | | <div v-if="this.typeselect == 3"> |
| | | 生产工艺 |
| | | </div> |
| | | <!-- <div class="table"> |
| | | <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology> |
| | | </div> --> |
| | | <!-- <div class="table"> |
| | | <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology> |
| | | </div> --> |
| | | <div v-if="this.typeselect == 3">生产工艺</div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="bom-add-model"> |
| | | <el-dialog title="BOM新增" :visible.sync="bomAddModelVisible" width="30%"> |
| | | <el-form> |
| | | |
| | | |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="bomAddModelVisible = false">取 消</el-button> |
| | |
| | | <script> |
| | | import technology from "./standard-table/technology.vue" |
| | | import material from "./standard-table/material.vue" |
| | | import bom from "./standard-table/bom.vue" |
| | | export default { |
| | | components: { technology,material }, |
| | | components: { technology,material,bom }, |
| | | |
| | | data() { |
| | | return { |
| | |
| | | checkTreeNode: {},// 点击选中树节点 |
| | | tableData: [], |
| | | bomAddModelVisible: false,// 控制bom新增模态框是否显示 |
| | | list: [], |
| | | typeselect: 0, |
| | | returntree: { |
| | | id:28, |
| | |
| | | |
| | | }, |
| | | TYPE(val) {//类型.数据 |
| | | console.log(val); |
| | | // console.log(val); |
| | | this.typeselect = val |
| | | |
| | | // console.log(this.typeselect); |
| | | console.log(this.typeselect); |
| | | this.selectVersion() |
| | | }, |
| | | handleNodeClick(val) {//树的值 |
| | | console.log(val); |
| | | // console.log(val); |
| | | this.returntree = val |
| | | }, |
| | | async selectVersion() {//版本 |
| | |
| | | }) |
| | | this.character=v |
| | | this.VER="v"+v |
| | | console.log(this.character); |
| | | this.selectAll() |
| | | }, |
| | | //右侧数据 |
| | |
| | | version: this.character,//版本 |
| | | } |
| | | }).then(res => { |
| | | console.log(res.data); |
| | | this.tableData = res.data |
| | | let arr = res.data; |
| | | console.log(arr); |
| | | for(var i=0;i<arr.length;i++){ |
| | | arr[i].id = "0" + i; |
| | | } |
| | | this.tableData = arr; |
| | | }) |
| | | }, |
| | | verevent(val) { |
| | | console.log(val); |
| | | // console.log(val); |
| | | let cc = val.replace('v', '') |
| | | console.log(cc); |
| | | // console.log(cc); |
| | | this.character = cc |
| | | this.selectAll() |
| | | // const { v, ...newObj } = val; |
| | |
| | | // console.log(newObj); |
| | | }, |
| | | //五级树 |
| | | async selectMaterialTree() { |
| | | let _that=this |
| | | let res=await this.$axios.get(this.$api.url.selectTreeByMaterial).then( res => { |
| | | _that.list = res.data |
| | | selectMaterialTree() { |
| | | this.$axios.get(this.$api.url.selectTreeByMaterial).then( res => { |
| | | this.list=res.data |
| | | this.list.forEach((el, idx, arr) => { |
| | | if (idx == 0) { |
| | | arr[idx].name = '成品' |
| | |
| | | } |
| | | }) |
| | | this.selectDataList() |
| | | return _that.list |
| | | // 默认第一个五级节点搜索,新增配置项 |
| | | const treeOptions = JSON.parse(JSON.stringify(this.list)); |
| | | this.getDefault(treeOptions, 0); |
| | | this.formTypeOptions = treeOptions; |
| | | this.$nextTick().then(() => { |
| | | const firstNode = document.querySelector( |
| | | ".el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node" |
| | | ); |
| | | try { |
| | | firstNode.click(); |
| | | } catch (e) { |
| | | //TODO handle the exception |
| | | } |
| | | }); |
| | | }) |
| | | let s= this.filterChildren(res) |
| | | console.log(s); |
| | | }, |
| | | filterChildren(list){ |
| | | let one=list.filter(item=>{ |
| | | return item.children!=undefined |
| | | })[0] |
| | | let two=one.children.filter(item=>{ |
| | | return item.children!=undefined |
| | | })[0] |
| | | let three=two.children.filter(item=>{ |
| | | return item.children!=undefined |
| | | })[0] |
| | | let four=three.children.filter(item=>{ |
| | | return item.children!=undefined |
| | | })[0] |
| | | return four.children[0] |
| | | }, |
| | | isObject(param) { |
| | | return typeof param === 'object' && param !== null; |
| | | }, |
| | | isArray(param) { |
| | | return Array.isArray(param); |
| | | }, |
| | | getDefault(arr, index) { |
| | | for (const item of arr) { |
| | | if (item.children && item.children.length > 0) { |
| | | // 有子节点 |
| | | this.getDefault(item.children, index + 1); |
| | | if (index === 2) { |
| | | item.children = null; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | filterNode(value, data) { |
| | | if (!value) return true; |
| | | return data.label.indexOf(value) !== -1; |
| | |
| | | <style scoped> |
| | | .standard {} |
| | | |
| | | .standard .contentTable{ |
| | | } |
| | | |
| | | .standard .title .el-button { |
| | | height: 32px; |
| | | border: 1px solid rgba(190, 190, 190, 0.44); |