| | |
| | | background-color: #fff; |
| | | height: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | align-items: right; |
| | | justify-content: end; |
| | | } |
| | | |
| | |
| | | <el-tree :data="list" ref="tree" :props="{ children: 'children', label: 'name' }" node-key="id" |
| | | :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen" |
| | | @node-collapse="nodeClose" v-loading="treeLoad" :expand-on-click-node="false" |
| | | :default-expanded-keys="expandedKeys" :default-checked-keys="defaultCheckedKeys"> |
| | | :default-expanded-keys="expandedKeys"> |
| | | <div class="custom-tree-node" slot-scope="{ node, data }"> |
| | | <el-row style="width: 100%;"> |
| | | <el-col :span="21" :class="{sort:node.level>3}"> |
| | |
| | | <el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.name" |
| | | @keyup.enter.native="refreshTable()" @clear="refreshTable"></el-input> |
| | | </div> |
| | | <div class="search_label"> |
| | | <div class="search_label" v-if="upUserDepardLimsIdPower"> |
| | | <el-button type="primary" size="small" @click="selectUserDia = true">添加</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row class="standard_table" v-loading="tableLoad"> |
| | | <ValueTable ref="ValueTable" :url="$api.user.selectUserList" :componentData="componentData" /> |
| | | <ValueTable ref="ValueTable" :url="$api.user.selectUserList" :componentData="componentData" :delUrl="$api.user.delUserDepardLimsId"/> |
| | | </el-row> |
| | | </div> |
| | | <el-dialog title="架构新增" :visible.sync="addDia" width="400px"> |
| | |
| | | <span class="required-span">* </span>架构名称: |
| | | </el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-input v-model="addOb.name" placeholder="请输入架构名称" clearable size="small"></el-input> |
| | | <el-input v-model="addOb.name" placeholder="请输入架构名称" clearable size="small" @keyup.enter.native="addStandardTree"></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="选择用户" :visible.sync="selectUserDia" width="70%"> |
| | | <div class="search" style="margin-bottom: 9px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">用户名:</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请输入" clearable |
| | | v-model="componentData2.entity.name" @keyup.enter.native="$refs.ValueTable2.selectList()"></el-input></div> |
| | | </div> |
| | | </div> |
| | | <div class="body" style="height: 60vh;" v-if="selectUserDia"> |
| | | <ValueTable ref="ValueTable2" :url="$api.user.selectUserList" :componentData="componentData2" /> |
| | | <ValueTable ref="ValueTable2" :url="$api.user.selectUserList" :componentData="componentData2"/> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="selectUserDia = false">取 消</el-button> |
| | |
| | | isIndex: true, |
| | | showSelect: false, |
| | | select: false, |
| | | do: [], |
| | | do: [{ |
| | | id: 'delete', |
| | | font: '删除', |
| | | type: 'text', |
| | | method: 'doDiy' |
| | | }], |
| | | tagField: { |
| | | state: { |
| | | select: [{ |
| | |
| | | expandedKeys: [], |
| | | selectUserDia: false, |
| | | componentData2: { |
| | | name: null, |
| | | entity: { |
| | | isCustom: 0, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'asc' |
| | |
| | | }, |
| | | isIndex: true, |
| | | showSelect: true, |
| | | select: false, |
| | | select: true, |
| | | do: [], |
| | | tagField: { |
| | | state: { |
| | |
| | | } |
| | | }, |
| | | selectField: {}, |
| | | upUserDepardLimsIdPower: true |
| | | }, |
| | | defaultCheckedKeys:[] |
| | | currentCompaniesList: [] |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | searchFilter() { |
| | | this.$refs.tree.filter(this.search) |
| | | }, |
| | | refreshTable() { |
| | | this.$refs.ValueTable.selectList() |
| | | refreshTable(e) { |
| | | this.$refs.ValueTable.selectList(e) |
| | | }, |
| | | refresh() { |
| | | this.upIndex++; |
| | |
| | | }, |
| | | getNodeParent(val) { |
| | | if (val.parent != null) { |
| | | this.currentCompaniesList[val.level-1] = val.data.id |
| | | this.selectTree += ' - ' + val.label |
| | | this.getNodeParent(val.parent) |
| | | } |
| | |
| | | this.treeLoad = true |
| | | this.$axios.get(this.$api.department.selectDepartmentLim).then(res => { |
| | | this.list = res.data |
| | | this.refresh() |
| | | this.list.forEach(a => { |
| | | a.children.forEach(b => { |
| | | this.expandedKeys.push(b.id) |
| | | }) |
| | | }) |
| | | this.treeLoad = false |
| | | this.defaultCheckedKeys = [this.list[0].id] |
| | | this.componentData.entity.departLimsId = this.list[0].id; |
| | | this.selectTree = this.list[0].name |
| | | this.refreshTable() |
| | |
| | | let add = false |
| | | let addStandardProduct = false |
| | | let delStandardTree = false |
| | | let upUserDepardLimsId = false |
| | | let del = false |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'addDepartmentLims') { |
| | | add = true |
| | |
| | | if (power[i].menuMethod == 'delDepartmentLims') { |
| | | delStandardTree = true |
| | | } |
| | | if (power[i].menuMethod == 'upUserDepardLimsId') { |
| | | upUserDepardLimsId = true |
| | | } |
| | | if(power[i].menuMethod=='delUserDepardLimsId'){ |
| | | del = true |
| | | } |
| | | } |
| | | if(!del){ |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | this.addStandardProduct = addStandardProduct |
| | | this.delStandardTree = delStandardTree |
| | | this.upUserDepardLimsIdPower = upUserDepardLimsId |
| | | }, |
| | | selectUser() { |
| | | let selects = this.$refs.ValueTable2.multipleSelection |
| | |
| | | this.$message.error('未选择数据') |
| | | return |
| | | } |
| | | delete selects['orderBy'] |
| | | delete selects['updateUser'] |
| | | delete selects['updateTime'] |
| | | this.user = selects |
| | | var ids = [] |
| | | selects.forEach(a=>{ |
| | | ids.push(a.id) |
| | | }) |
| | | let str = '' |
| | | this.currentCompaniesList.forEach(a=>{ |
| | | str+=(a+',') |
| | | }) |
| | | this.selectUserDia = false |
| | | this.$axios.post(this.$api.user.upUserDepardLimsId,{ |
| | | ids: JSON.stringify(ids), |
| | | id: str |
| | | }).then(res=>{ |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.$message.success('添加成功') |
| | | this.refreshTable('page') |
| | | }) |
| | | } |
| | | } |
| | | } |