| | |
| | | }`"></i> |
| | | {{ data.label }} |
| | | </div> |
| | | <div v-if="(node.data.children === null || node.data.children === undefined)" style="width:50px"> |
| | | <el-button v-if="checkPermi(['standard:standardLibrary:delStandardTree'])" size="mini" type="text" |
| | | <div v-if="(node.data.children === null || node.data.children === undefined)" style="width:80px"> |
| | | <el-button style="margin-left: 2px;" v-if="checkPermi(['standard:standardLibrary:delStandardTree'])" size="mini" type="text" |
| | | @click.stop="editTreeName(node.data)"> |
| | | <i class="el-icon-edit"></i> |
| | | </el-button> |
| | | <el-button style="margin-left: 0" size="mini" |
| | | <el-button style="margin-left: 2px;" size="mini" |
| | | v-if="checkPermi(['standard:standardLibrary:delStandardTree'])" type="text" |
| | | @click.stop="remove(node, data)"> |
| | | <i class="el-icon-delete"></i> |
| | | </el-button> |
| | | <el-popover |
| | | placement="right" |
| | | width="100%" |
| | | @show="showModelDetail(node.data)" |
| | | trigger="hover"> |
| | | <el-table border :data="modelDetailTableData" :header-cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}"> |
| | | <el-table-column width="120" property="sampleType" label="产品大类" show-overflow-tooltip></el-table-column> |
| | | <el-table-column width="120" property="sample" label="样品名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column width="120" property="model" label="型号" show-overflow-tooltip></el-table-column> |
| | | <el-table-column width="80" property="createUserName" label="创建人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column width="160" property="createTime" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column width="80" property="updateUserName" label="更新人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column width="160" property="updateTime" label="更新时间" show-overflow-tooltip></el-table-column> |
| | | </el-table> |
| | | <el-button slot="reference" size="mini" type="text" > |
| | | <i class="el-icon-view"></i> |
| | | </el-button> |
| | | </el-popover> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <el-button :loading="addLoad" type="primary" @click="addStandardTree">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="updateDia" title="分类修改" width="400px"> |
| | | <el-dialog :visible.sync="updateDia" title="分类修改" width="400px" @close="()=>{this.addOb.model=''}"> |
| | | <div class="body"> |
| | | <el-row style="line-height: 50px"> |
| | | <el-col :span="6" style="text-align: right"> |
| | |
| | | selectsStandardMethodByFLSSM, |
| | | upStandardProductList, |
| | | selectStandardProductListByMethodId, |
| | | selectStandardTreeById, |
| | | updateSection, |
| | | upStandardProducts, |
| | | getStandardTemplate, |
| | |
| | | updateDia: false, // 修改树名字弹框 |
| | | oldModel: "", |
| | | addOb: { |
| | | id: null, |
| | | factory: null, |
| | | laboratory: null, |
| | | sampleType: null, |
| | |
| | | batchCopyDia: false, |
| | | VUE_APP_BASE_API: process.env.VUE_APP_BASE_API, |
| | | moreSelects: [], |
| | | modelDetailTableData:[], |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | showModelDetail(nodeData) { |
| | | if(nodeData){ |
| | | let standardTreeId = nodeData.standardTreeId |
| | | selectStandardTreeById(standardTreeId).then(res=>{ |
| | | if(res.code===200){ |
| | | this.modelDetailTableData = [res.data] |
| | | } |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | }) |
| | | } |
| | | }, |
| | | // 修改最子级名字 |
| | | editTreeName(info) { |
| | | this.addOb.model = info.label; |
| | | this.updateDia = true; |
| | | this.oldModel = info.label; |
| | | }, |
| | | // 拖拽时判定目标节点能否被放置 |
| | | // 'prev'、'inner' 和 'next',前、插入、后 |
| | |
| | | if (node.childNodes.length === 0) { |
| | | this.selectsStandardMethodByFLSSM(); |
| | | } |
| | | let trees = this.selectTree.split(" - "); |
| | | let trees = this.selectTree.split(" - ").map(a => { |
| | | if (a === "null") { |
| | | return null; |
| | | } |
| | | return a; |
| | | }); |
| | | this.addOb.factory = trees[0]; |
| | | this.addOb.laboratory = trees[1]; |
| | | this.addOb.sampleType = trees[2]; |
| | | this.addOb.sample = trees[3]; |
| | | this.addOb.id = val.standardTreeId || null |
| | | }, |
| | | getNodeParent(val) { |
| | | if (val.parent != null) { |
| | |
| | | selectStandardTreeList().then((res) => { |
| | | this.list = res.data; |
| | | this.list.forEach((a) => { |
| | | this.expandedKeys.push(a.label); |
| | | if(a.children){ |
| | | a.children.forEach(f=>{ |
| | | this.expandedKeys.push(f.label); |
| | | }) |
| | | } |
| | | }); |
| | | this.treeLoad = false; |
| | | }); |
| | |
| | | return; |
| | | } |
| | | this.addLoad = true; |
| | | addStandardTree(this.addOb) |
| | | .then((res) => { |
| | | this.$message.success("添加成功"); |
| | | this.addDia = false; |
| | | this.list |
| | | .find((a) => a.label == this.addOb.factory) |
| | | .children.find((a) => a.label == this.addOb.laboratory) |
| | | .children.find((a) => a.label == this.addOb.sampleType) |
| | | .children.find((a) => a.label == this.addOb.sample) |
| | | .children.push({ |
| | | code: "[5]", |
| | | label: this.addOb.model, |
| | | value: this.addOb.model, |
| | | }); |
| | | this.addLoad = false; |
| | | }) |
| | | addStandardTree(this.addOb).then((res) => { |
| | | if(res.code===200){ |
| | | this.$message.success("添加成功"); |
| | | this.selectStandardTreeList(); |
| | | } |
| | | this.$nextTick(()=>{ |
| | | this.addDia = false; |
| | | this.addLoad = false; |
| | | }) |
| | | }) |
| | | .catch((e) => { |
| | | this.addDia = false; |
| | | this.addLoad = false; |
| | |
| | | } |
| | | |
| | | .custom-tree-node .el-icon-delete { |
| | | color: #3a7bfa; |
| | | color:rgb(245, 108, 108); |
| | | opacity: 0; |
| | | font-size: 18px; |
| | | } |
| | |
| | | } |
| | | |
| | | .custom-tree-node .el-icon-edit { |
| | | color: #3a7bfa; |
| | | opacity: 0; |
| | | font-size: 18px; |
| | | } |
| | |
| | | opacity: 1; |
| | | } |
| | | |
| | | .custom-tree-node .el-icon-view { |
| | | opacity: 0; |
| | | font-size: 18px; |
| | | } |
| | | |
| | | .custom-tree-node:hover .el-icon-view { |
| | | opacity: 1; |
| | | } |
| | | |
| | | .node_i { |
| | | color: orange; |
| | | font-size: 18px; |