| | |
| | | upUserPassword: "/user/upUserPassword", //修改用户密码 |
| | | upUserDepardLimsId: "/user/upUserDepardLimsId", //修改人员明细所在组织架构 |
| | | delUserDepardLimsId: "/user/delUserDepardLimsId", //删除人员明细所在组织架构 |
| | | upCustom: "/user/upCustom", //修改客户信息 |
| | | selectCustomEnum: "/user/selectCustomEnum", //获取客户枚举 |
| | | } |
| | | |
| | | const dataReporting = { |
| | |
| | | selectDepartmentLim: "/department/selectDepartmentLim", //获取部门树 |
| | | addDepartmentLims: "/department/addDepartmentLims", //添加部门 |
| | | delDepartmentLims: "/department/delDepartmentLims", //删除部门 |
| | | selectDepartmentEnum: "/department/selectDepartmentEnum", //获取组织架构枚举 |
| | | } |
| | | |
| | | const report = { |
| | |
| | | selectCompaniesList: "/companies/selectCompaniesList", //获取人事系统组织 |
| | | selectSimpleList: "/companies/selectSimpleList", //获取人事系统组织下的人员 |
| | | addPersonUser: "/companies/addPersonUser", //获取人事系统组织下的人员 |
| | | selectPersonUser: "/companies/selectPersonUser", //通过员工号获取员工 |
| | | } |
| | |
| | | </div> |
| | | </el-col> |
| | | <el-col class="search_thing" :span="6"> |
| | | <div class="search_label">是否留样:</div> |
| | | <div class="search_input"> |
| | | <el-radio-group v-model="addObj.isLeave"> |
| | | <el-radio :label="0">不留样</el-radio> |
| | | <el-radio :label="1">留样</el-radio> |
| | | </el-radio-group> |
| | | </div> |
| | | </el-col> |
| | | <el-col class="search_thing" :span="6"> |
| | | <div class="search_label" style="width: 175px;">是否涉及配套样品:</div> |
| | | <div class="search_input" style="width: calc(100% - 175px);"> |
| | | <el-radio-group v-model="addObj.mating" @change="$refs.sampleTable.doLayout()"> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </div> |
| | | </el-col> |
| | | <el-col class="search_thing" :span="6"> |
| | | <div class="search_label">OTC订单号:</div> |
| | | <div class="search_input"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addObj.otcCode" :readonly="active>1"></el-input> |
| | | </div> |
| | | </el-col> |
| | | <el-col class="search_thing" :span="6"> |
| | | <div class="search_label"><span class="required-span">* </span>工程名称:</div> |
| | | <div class="search_input"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addObj.engineering" :readonly="active>1"></el-input> |
| | |
| | | <div class="search_label"><span class="required-span">* </span>生产单位EN:</div> |
| | | <div class="search_input"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addObj.productionEn" :readonly="active>1"></el-input> |
| | | </div> |
| | | </el-col> |
| | | <el-col class="search_thing" :span="6"> |
| | | <div class="search_label">是否留样:</div> |
| | | <div class="search_input"> |
| | | <el-radio-group v-model="addObj.isLeave"> |
| | | <el-radio :label="0">不留样</el-radio> |
| | | <el-radio :label="1">留样</el-radio> |
| | | </el-radio-group> |
| | | </div> |
| | | </el-col> |
| | | <el-col class="search_thing" :span="6"> |
| | | <div class="search_label" style="width: 175px;">是否涉及配套样品:</div> |
| | | <div class="search_input" style="width: calc(100% - 175px);"> |
| | | <el-radio-group v-model="addObj.mating" @change="$refs.sampleTable.doLayout()"> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </div> |
| | | </el-col> |
| | | <el-col class="search_thing" :span="6"> |
| | | <div class="search_label">OTC订单号:</div> |
| | | <div class="search_input"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="addObj.otcCode" :readonly="active>1"></el-input> |
| | | </div> |
| | | </el-col> |
| | | <el-col class="search_thing" :span="6" style="align-items: flex-start;margin: 8px 0;"> |
| | |
| | | engineeringEn: null, |
| | | production: null, |
| | | productionEn: null, |
| | | companyId: null |
| | | }, |
| | | sample: { |
| | | sampleCode: null, |
| | |
| | | this.$message.error('未选择数据') |
| | | return |
| | | } |
| | | delete selects['orderBy'] |
| | | delete selects['updateUser'] |
| | | delete selects['updateTime'] |
| | | this.addObj.userId = selects.id |
| | | this.addObj.company = selects.company |
| | | this.addObj.custom = selects.name |
| | | this.addObj.code = selects.code |
| | | this.addObj.phone = selects.phone |
| | | this.addObj.companyId = selects.id |
| | | this.selectUserDia = false |
| | | }, |
| | | save() { |
| | | if (!this.addObj.custom) { |
| | | this.$message.error('未选择下单客户') |
| | | if (!this.addObj.companyId) { |
| | | this.$message.error('未选择客户单位') |
| | | return |
| | | } |
| | | if (!this.addObj.type) { |
| | |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">客户名称:</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.name" |
| | | <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.company" |
| | | @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">账号状态:</div> |
| | | <div class="search_input"> |
| | | <el-select size="small" v-model="componentData.entity.state" style="width: 100%;" @change="refreshTable()"> |
| | | <el-option label="全部" :value="null"></el-option> |
| | | <el-option label="启用" :value="1"></el-option> |
| | | <el-option label="停用" :value="0"></el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px;"> |
| | | <el-button size="small" @click="refresh()">重 置</el-button> |
| | |
| | | </div> |
| | | <div class="table"> |
| | | <ValueTable ref="ValueTable" :url="$api.user.selectCustomPageList" :delUrl="$api.user.delCustomById" |
| | | :componentData="componentData" :key="upIndex" /> |
| | | :componentData="componentData" :key="upIndex" :upUrl="$api.user.upCustom"/> |
| | | </div> |
| | | <el-dialog title="新增客户" :visible.sync="addDia" width="450px"> |
| | | <div style="margin-bottom: 15px;"> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;"> |
| | | <span class="required-span">* </span>客户名称:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.name" readonly size="small"> |
| | | <template slot="append"><el-button slot="append" icon="el-icon-search" |
| | | @click="selectUserDia = true"></el-button></template> |
| | | </el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;"><span class="required-span">* |
| | | </span>客户账户:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.account" readonly size="small"></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;">电子邮箱:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.email" size="small" clearable></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;"><span class="required-span">* |
| | | </span>电话号码:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.phone" size="small" clearable></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;"><span class="required-span">* |
| | | </span>客户单位:</el-col> |
| | | </span>客户名称:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.company" size="small" clearable></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;"><span class="required-span">* |
| | | </span>单位EN:</el-col> |
| | | </span>客户单位EN:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.companyEn" size="small" clearable></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;"><span class="required-span">* |
| | | </span>工厂域:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.code" size="small" clearable></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 15px;"> |
| | |
| | | </el-row> |
| | | <el-row style="margin-top: 15px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;"><span class="required-span">* |
| | | </span>地址EN:</el-col> |
| | | </span>客户地址EN:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input type="textarea" v-model="user.addressEn" size="small" clearable |
| | | :autosize="{minRows: 2, maxRows: 4}"></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;"><span class="required-span">* |
| | | </span>加急额度:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.num" size="small" clearable></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;">单位电话:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.phone" size="small" clearable></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;">工厂域:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.code" size="small" clearable></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="7" style="text-align: right;padding-right: 8px;"><span class="required-span">* |
| | | </span>客户编号:</el-col> |
| | | <el-col :span="15"> |
| | | <el-input v-model="user.code2" size="small" clearable></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | |
| | | return { |
| | | componentData: { |
| | | entity: { |
| | | name: null, |
| | | state: null, |
| | | company: null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'asc' |
| | |
| | | font: '协议记录', |
| | | type: 'text', |
| | | method: 'protocol' |
| | | },{ |
| | | id: 'update', |
| | | font: '编辑', |
| | | type: 'text', |
| | | method: 'doDiy', |
| | | field:[] |
| | | }, { |
| | | id: 'delete', |
| | | font: '删除', |
| | |
| | | } |
| | | }, |
| | | requiredAdd: [], |
| | | requiredUp: [] |
| | | requiredUp: ['company','address','code2','companyEn','addressEn','num'] |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | |
| | | this.upIndex++ |
| | | }, |
| | | customAdd() { |
| | | if (this.user.name == '' || this.user.name == null) { |
| | | this.$message.error('请填写客户名称') |
| | | return |
| | | } |
| | | if (this.user.account == '' || this.user.account == null) { |
| | | this.$message.error('请填写客户账户') |
| | | return |
| | | } |
| | | if (this.user.phone == '' || this.user.phone == null) { |
| | | this.$message.error('请填写电话号码') |
| | | return |
| | | } |
| | | if (this.user.company == '' || this.user.company == null) { |
| | | this.$message.error('请填写客户单位') |
| | | return |
| | | } |
| | | if (this.user.code == '' || this.user.code == null) { |
| | | this.$message.error('请填写工厂域') |
| | | return |
| | | } |
| | | if (this.user.address == '' || this.user.address == null) { |
| | |
| | | } |
| | | if (this.user.addressEn == '' || this.user.addressEn == null) { |
| | | this.$message.error('请填写英文单位地址') |
| | | return |
| | | } |
| | | if (this.user.code2 == '' || this.user.code2 == null) { |
| | | this.$message.error('请填写客户编号') |
| | | return |
| | | } |
| | | if (this.user.code2 == '' || this.user.code2 == null) { |
| | | this.$message.error('请填写加急额度') |
| | | return |
| | | } |
| | | this.loading = true |
| | |
| | | if (power[i].menuMethod == 'addCustom') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'upCustom') { |
| | | up = true |
| | | } |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(3, 1) |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(2, 1) |
| | | } |
| | | this.addPower = add |
| | |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-input placeholder="输入关键字进行搜索" suffix-icon="el-icon-search" v-model="search" size="small" |
| | | style="margin-bottom: 5px;" clearable @blur="searchFilter" @clear="searchFilter" |
| | | @keyup.enter.native="searchFilter()"></el-input> |
| | | style="margin-bottom: 5px;" clearable @clear="searchFilter" @keyup.enter.native="searchFilter()"></el-input> |
| | | </el-col> |
| | | <el-col :span="4" style="text-align: center;line-height: 30px;" v-if="addPower"> |
| | | <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="handleAdd"></el-button> |
| | |
| | | </el-row> |
| | | <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="[1]"> |
| | | @node-collapse="nodeClose" v-loading="treeLoad" :expand-on-click-node="false" default-expand-all> |
| | | <div class="custom-tree-node" slot-scope="{ node, data }"> |
| | | <el-row style="width: 100%;"> |
| | | <el-col :span="21" :class="{sort:node.level>3}"> |
| | |
| | | <el-dialog title="获取人事系统人员信息" :visible.sync="addthirdParty" width="70%"> |
| | | <div class="body"> |
| | | <el-row> |
| | | <el-col :span="9" style="height: 70vh;overflow: hidden;"> |
| | | <el-col :span="8" style="height: 70vh;overflow: hidden;"> |
| | | <el-input placeholder="输入关键字搜索" v-model="search2" size="small" style="width: 90%;padding: 0 5% 10px 5%;" |
| | | clearable @blur="searchFilter2" @clear="searchFilter2" @keyup.enter.native="searchFilter2()"> |
| | | clearable @clear="searchFilter2" @keyup.enter.native="searchFilter2()"> |
| | | </el-input> |
| | | <el-tree :data="datathirdParty" node-key="id" :props="defaultProps" @node-click="nodeClick2" |
| | | style="height: calc(100% - 42px);" |
| | | @node-expand="nodeOpen0" :filter-node-method="filterNode2" ref="tree2" highlight-current> |
| | | <el-tree :data="datathirdParty" node-key="companyId" :props="defaultProps" @node-click="nodeClick2" |
| | | style="height: calc(100% - 42px);" @node-expand="nodeOpen0" :filter-node-method="filterNode2" ref="tree2" |
| | | highlight-current> |
| | | </el-tree> |
| | | </el-col> |
| | | <el-col :span="15" style="height: 70vh;padding-left: 8px;"> |
| | | <div class="search_thing" style="width: 360px;margin-bottom: 10px;"> |
| | | <div class="search_label" style="width: 140px;">员工号/员工姓名:</div> |
| | | <div class="search_input"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请输入工号/员工姓名" |
| | | @clear="searchPerson" |
| | | clearable |
| | | v-model="userSearch2" |
| | | @keyup.enter.native="searchPerson()"> |
| | | <i slot="suffix" class="el-input__icon el-icon-search" style="cursor: pointer;" @click="searchPerson"></i></el-input> |
| | | <el-col :span="16" style="height: 70vh;padding-left: 8px;"> |
| | | <div class="search_thing" style="width: 100%;margin-bottom: 10px;justify-content: right;"> |
| | | <div class="search_label" style="width: 200px;">员工号/员工姓名:</div> |
| | | <div class="search_input" style="width: 250px;"> |
| | | <el-input size="small" placeholder="请输入工号/员工姓名" @clear="searchPerson" clearable v-model="userSearch2" |
| | | @keyup.enter.native="searchPerson()"></el-input> |
| | | </div> |
| | | <!-- <div class="search_label" style="width: 200px;">员工号:</div> |
| | | <div class="search_input"> |
| | | <el-input size="small" placeholder="请输入工号" @clear="searchPerson" clearable v-model="searchEmployeeID" |
| | | @keyup.enter.native="searchPerson2()"></el-input> |
| | | </div> --> |
| | | </div> |
| | | <el-table height="67vh" border stripe :data="personList" v-loading="personLoad" ref="personTable" |
| | | @selection-change="handleSelectionChange"> |
| | |
| | | <el-table-column prop="employeeID" label="员工号"> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="员工姓名"> |
| | | </el-table-column> |
| | | <el-table-column prop="department" label="部门" min-width="200"> |
| | | </el-table-column> |
| | | <el-table-column prop="isLive" label="已存在" width="80" align="center"> |
| | | <template slot-scope="scope"> |
| | |
| | | datathirdParty: [], |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'label' |
| | | label: 'companyName' |
| | | }, |
| | | addthirdParty: false, |
| | | componentData: { |
| | |
| | | name: null, |
| | | state: null, |
| | | company: null, |
| | | departId: null, |
| | | roleId: null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'asc' |
| | |
| | | type: 'text', |
| | | method: 'doDiy', |
| | | field: ['roleName', '角色=roleId', '密码=password', |
| | | '姓名EN=nameEn','年龄=age','邮箱=email','单位=company','签名=pictureUrl','本人照=signatureUrl'] |
| | | '姓名EN=nameEn', '年龄=age', '邮箱=email', '单位=company', '签名=pictureUrl', '本人照=signatureUrl' |
| | | ] |
| | | }], |
| | | tagField: { |
| | | state: { |
| | |
| | | }, |
| | | roleId: { |
| | | select: [] |
| | | } |
| | | }, |
| | | company: {select: []} |
| | | }, |
| | | /* cascaderField:{ |
| | | departId:{ |
| | |
| | | delStandardTree: true, |
| | | addDia0: false, |
| | | addOb: { |
| | | fatherId: '', |
| | | fatherId: 10001, |
| | | name: '', |
| | | }, |
| | | search: null, |
| | | list: [], |
| | | selectTree: '', |
| | | treeLoad: false, |
| | | expandedKeys: [], |
| | | addLoad: false, |
| | | personList: [], |
| | | personListCopy:[], |
| | |
| | | multipleSelection: [], |
| | | companiesList:[], |
| | | currentCompaniesList: [], |
| | | userSearch2:'' |
| | | userSearch2: '', |
| | | searchEmployeeID: null |
| | | } |
| | | }, |
| | | // watch: { |
| | |
| | | mounted() { |
| | | this.selectTreeList() |
| | | this.selectRole() |
| | | this.selectCustomEnum() |
| | | this.entityCopy = this.HaveJson(this.componentData.entity) |
| | | this.getPower() |
| | | }, |
| | |
| | | openthirdParty() { |
| | | this.addthirdParty = true; |
| | | this.$axios.get(this.$api.companies.selectCompaniesList).then(res => { |
| | | this.companiesList = JSON.parse(JSON.stringify(res.data)); |
| | | this.datathirdParty = [] |
| | | for (let ai = 0; ai < res.data.length; ai++) { |
| | | let a = res.data[ai] |
| | | if (a.parentCompanyId === 'ROOT') { |
| | | this.datathirdParty.push({ |
| | | id: a.companyId, |
| | | label: a.companyName, |
| | | children: [] |
| | | this.companiesList = this.HaveJson(res.data); |
| | | this.datathirdParty = this.tranListToTreeData(res.data, "ROOT"); |
| | | }) |
| | | res.data.splice(ai, 1) |
| | | ai-- |
| | | } else { |
| | | this.getOrganizational(a, ai, this.datathirdParty, res.data) |
| | | } |
| | | } |
| | | }) |
| | | if(this.componentData.entity.roleId > 10000)this.$message.warning('由于未选中具体角色,新增用户将成为默认角色') |
| | | }, |
| | | getOrganizational(a, ai, children, list) { |
| | | for (let bi = 0; bi < children.length; bi++) { |
| | | let b = children[bi] |
| | | if (a.parentCompanyId === b.id) { |
| | | b.children.push({ |
| | | id: a.companyId, |
| | | label: a.companyName, |
| | | children: [] |
| | | }) |
| | | list.splice(ai, 1) |
| | | ai-- |
| | | break |
| | | } else { |
| | | this.getOrganizational(a, ai, b.children, list) |
| | | tranListToTreeData(list, rootValue) { |
| | | const arr = []; |
| | | list.forEach((item) => { |
| | | if (item.parentCompanyId === rootValue) { |
| | | const children = this.tranListToTreeData(list, item.companyId); |
| | | if (children.length) { |
| | | item.children = children; |
| | | } |
| | | arr.push(item); |
| | | } |
| | | }); |
| | | return arr; |
| | | }, |
| | | refreshTable() { |
| | | this.$refs['ValueTable'].selectList() |
| | |
| | | }) |
| | | }, |
| | | opeaAdd() { |
| | | if (!this.addOb.fatherId || this.selectTree == '' || this.selectTree == '全部') { |
| | | this.$message.error('请选择一个组织') |
| | | return |
| | | } |
| | | this.$refs.ValueTable.openAddDia(this.$api.user.addUser); |
| | | this.$refs['ValueTable'].upData.departId = this.selectTree |
| | | }, |
| | |
| | | this.addUserPower = addUserPower |
| | | }, |
| | | handleAdd() { |
| | | console.log(`output->this.addOb.fatherId`,this.addOb.fatherId) |
| | | console.log(`output->this.addOb.name`,this.addOb.name) |
| | | if (this.addOb.fatherId||this.addOb.name=='全部') { |
| | | this.addDia = true; |
| | | } else { |
| | | this.$message.error('请选择一个架构层级') |
| | | } |
| | | }, |
| | | searchFilter() { |
| | | this.$refs.tree.filter(this.search) |
| | |
| | | this.$refs.tree2.filter(this.search2) |
| | | }, |
| | | filterNode(value, data) { |
| | | console.log(data); |
| | | if (!value) return true; |
| | | return data.name.indexOf(value) !== -1; |
| | | }, |
| | | filterNode2(value, data) { |
| | | if (!value) return true; |
| | | return data.label.indexOf(value) !== -1; |
| | | return data['companyName'].indexOf(value) !== -1; |
| | | }, |
| | | handleNodeClick(val, node, el) { //树的值 |
| | | this.selectTree = '' |
| | |
| | | data2 += " - " + data[index] |
| | | } |
| | | this.selectTree = data2.replace(' - ', '') |
| | | this.addOb.fatherId = val.id; |
| | | this.componentData.entity.departId = val.id + ','; |
| | | this.componentData.entity.roleId = val.id; |
| | | this.refreshTable() |
| | | }, |
| | | nodeOpen(data, node, el) { |
| | |
| | | this.treeLoad = true |
| | | this.$axios.get(this.$api.department.selectDepartment).then(res => { |
| | | this.list = res.data |
| | | this.list.forEach(a => { |
| | | a.children.forEach(b => { |
| | | b.children.forEach(c => { |
| | | this.expandedKeys.push(c.id) |
| | | }) |
| | | }) |
| | | }) |
| | | this.treeLoad = false |
| | | this.componentData.entity.departId = this.list[0].id; |
| | | this.selectTree = '全部' |
| | | this.componentData.entity.roleId = this.list[0].id; |
| | | this.refreshTable() |
| | | }) |
| | | }, |
| | |
| | | this.selectTreeList() |
| | | this.addLoad = false |
| | | this.addOb.name = '' |
| | | this.addOb.fatherId = '' |
| | | }).catch(e => { |
| | | this.addDia = false |
| | | this.addLoad = false |
| | |
| | | }, |
| | | nodeClick2(ob, node, el) { |
| | | this.getNodeParent(node) |
| | | if (ob.id !== 'SC21') { |
| | | if (ob.companyId !== 'SC21') { |
| | | this.personLoad = true |
| | | this.$axios.post(this.$api.companies.selectSimpleList, { |
| | | companyId: ob.id |
| | | companyId: ob.companyId |
| | | }).then(res => { |
| | | this.personListCopy = JSON.parse(JSON.stringify(res.data)) |
| | | this.personList = res.data |
| | |
| | | } |
| | | }, |
| | | getNodeParent(val){ |
| | | this.currentCompaniesList[val.level-1] = val.data.id |
| | | this.currentCompaniesList[val.level - 1] = val.data.companyId |
| | | if(val.parent!=null){ |
| | | this.getNodeParent(val.parent) |
| | | } |
| | |
| | | this.addLoad = true |
| | | this.$axios.post(this.$api.companies.addPersonUser, { |
| | | company: arr, |
| | | person: this.multipleSelection |
| | | person: this.multipleSelection, |
| | | roleId: this.componentData.entity.roleId |
| | | }, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | |
| | | this.$message.success('操作成功') |
| | | this.multipleSelection = [] |
| | | this.$refs.personTable.clearSelection() |
| | | this.addthirdParty = false |
| | | this.addLoad = false |
| | | this.personList = [] |
| | | this.userSearch2 = '' |
| | | this.selectTreeList() |
| | | }).catch(e => { |
| | | this.addthirdParty = false |
| | | this.addLoad = false |
| | | }) |
| | | }, |
| | |
| | | return true |
| | | } |
| | | }) |
| | | }, |
| | | searchPerson2(){ |
| | | if(this.searchEmployeeID===null||this.searchEmployeeID===''){ |
| | | this.searchPerson() |
| | | return |
| | | } |
| | | this.$axios.post(this.$api.companies.selectPersonUser, { |
| | | code: this.searchEmployeeID |
| | | }).then(res=>{ |
| | | this.personList = [] |
| | | this.personList.push(res.data) |
| | | }) |
| | | }, |
| | | selectCustomEnum(){ |
| | | this.$axios.get(this.$api.user.selectCustomEnum).then(res=>{ |
| | | this.componentData.selectField.company.select = [] |
| | | res.data.forEach(a=>{ |
| | | this.componentData.selectField.company.select.push({ |
| | | label: a.company, |
| | | value: a.id |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | :componentData="componentData" :key="upIndex" @upRole="upRole" @selectRole="selectRole" /> |
| | | </div> |
| | | <el-dialog :title="type" :visible.sync="addDia" width="550px" @closed="closed"> |
| | | <div style="max-height: 500px;overflow-y: auto;padding: 10px;" v-if="addDia"> |
| | | <el-row style="line-height: 40px;margin-bottom: 20px;"> |
| | | <el-col :span="8" style="font-size: 16px;"><span class="required-span">* </span>角色名</el-col> |
| | | <el-col :span="16"> |
| | | <div style="max-height: 550px;overflow-y: auto;padding: 10px 20px;" v-if="addDia"> |
| | | <el-row style="line-height: 42px;"> |
| | | <el-col :span="7" style="font-size: 14px;"><span class="required-span">* </span>角色名</el-col> |
| | | <el-col :span="17"> |
| | | <el-input v-model="addData.roleName" size="medium" placeholder="需唯一角色名" clearable |
| | | :disabled="type=='查看'"></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 42px;margin-bottom: 20px;"> |
| | | <el-col :span="7" style="font-size: 14px;"><span class="required-span">* </span>角色分类</el-col> |
| | | <el-col :span="17"> |
| | | <el-select v-model="addData.category" size="medium" :disabled="type=='查看'" style="width: 100%;"> |
| | | <el-option v-for="(a, i) in deaprtEnum" :key="i" :label="a.name" :value="a.id"></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider content-position="left">权限分配</el-divider> |
| | |
| | | type: 'text', |
| | | method: 'selectRole', |
| | | }], |
| | | tagField: {}, |
| | | tagField: { |
| | | category: { |
| | | select: [] |
| | | } |
| | | }, |
| | | selectField: {} |
| | | }, |
| | | entityCopy: {}, |
| | |
| | | addData: { |
| | | roleId2: null, |
| | | roleName: null, |
| | | category: null, |
| | | powers: [] |
| | | }, |
| | | menu: [], |
| | | menuCategroy: [], |
| | | menuCopy: [], |
| | | type: '新增', |
| | | addPower: true |
| | | addPower: true, |
| | | deaprtEnum: [] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.entityCopy = this.HaveJson(this.componentData.entity) |
| | | this.selectMenuList() |
| | | this.selectDepartmentEnum() |
| | | this.getPower() |
| | | }, |
| | | methods: { |
| | |
| | | upRole(row) { |
| | | this.type = '修改' |
| | | this.addData.roleName = row.name |
| | | this.addData.category = row.category |
| | | this.selectPowerByRoleId(row.id) |
| | | }, |
| | | selectRole(row) { |
| | | this.type = '查看' |
| | | this.addData.roleName = row.name |
| | | this.addData.category = row.category |
| | | this.selectPowerByRoleId(row.id) |
| | | }, |
| | | openAdd() { |
| | |
| | | saveAddData() { |
| | | if (this.addData.roleName == '' || this.addData.roleName == null) { |
| | | this.$message.error('请填写角色名') |
| | | return |
| | | } |
| | | if (this.addData.category == '' || this.addData.category == null) { |
| | | this.$message.error('请选择角色分类') |
| | | return |
| | | } |
| | | this.addLoad = true |
| | |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | }, |
| | | selectDepartmentEnum(){ |
| | | this.$axios.get(this.$api.department.selectDepartmentEnum).then(res=>{ |
| | | this.deaprtEnum = res.data |
| | | this.componentData.tagField.category.select = [] |
| | | res.data.forEach(a=>{ |
| | | this.componentData.tagField.category.select.push({ |
| | | label: a.name, |
| | | value: a.id |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |