|
|
@@ -3,9 +3,42 @@
|
|
|
<!--布局容器-->
|
|
|
<el-container style="height: 100%" direction="vertical">
|
|
|
<el-main ref="elMain" style="padding: 0px">
|
|
|
- <!-- 新增展开折叠 -->
|
|
|
- <div style="margin-bottom: 20px; margin-top: 15px" class="flex a-start">
|
|
|
- <el-button size="small" type="info" plain icon="el-icon-sort" @click="fold()">展开折叠</el-button>
|
|
|
+ <Split :gutterSize="2" style="height: calc(100vh - 120px)">
|
|
|
+ <!-- 左侧树Start -->
|
|
|
+ <SplitArea :size="leftSplitWidth" :minSize="240">
|
|
|
+ <!-- 左侧树形结构 -->
|
|
|
+ <el-tree
|
|
|
+ :data="ztreeNodes"
|
|
|
+ :props="{ children: 'children', label: 'name' }"
|
|
|
+ node-key="id"
|
|
|
+ :default-expanded-keys="['9']"
|
|
|
+ @node-click="onZTreeClick"
|
|
|
+ ></el-tree>
|
|
|
+ </SplitArea>
|
|
|
+ <SplitArea :size="rightSplitWidth">
|
|
|
+ <templateTable
|
|
|
+ :formList="formList"
|
|
|
+ :searchData.sync="queryFrom"
|
|
|
+ :tableConfig="tableConfig"
|
|
|
+ :data="pageResult"
|
|
|
+ @getList="findPage"
|
|
|
+ :btnGroup="btnGroup"
|
|
|
+ @selectionChange="handleSelectionChange"
|
|
|
+ @handleSearchList="handleSearchList"
|
|
|
+ :pagination="pageData"
|
|
|
+ >
|
|
|
+ <template slot="领导人" >
|
|
|
+ <el-select size="small" v-model="queryFrom.leaderName" placeholder="请选择" clearable filterable>
|
|
|
+ <el-option
|
|
|
+ v-for="item in searchLeaderOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.name">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </templateTable>
|
|
|
+ <!-- <div style="margin-bottom: 20px; margin-top: 15px" class="flex a-start">
|
|
|
<el-form :inline="true" class="demo-form-inline" size="small" style="margin-left: 30px">
|
|
|
<el-form-item label="机构编码:">
|
|
|
<el-input clearable v-model="peopledeptid" placeholder="请输入机构编码"></el-input>
|
|
|
@@ -22,9 +55,8 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <!-- 表格渲染 -->
|
|
|
<el-table height="600" row-key="id"
|
|
|
- v-loading="loading" border :data="ztreeNodes"
|
|
|
+ v-loading="loading" border :data="tableData"
|
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChilkdren' }" :header-cell-style="{
|
|
|
background: '#F2F7FC',
|
|
|
fontWeight: '900',
|
|
|
@@ -64,12 +96,15 @@
|
|
|
@click.native.stop="handleEdit(scope.row)"></KtButton>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- </el-table>
|
|
|
+ </el-table> -->
|
|
|
+ </SplitArea>
|
|
|
+ </Split>
|
|
|
+
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
<el-dialog :title="deptDialogTitle" width="20%" :visible.sync="deptDialogVisible" :close-on-click-modal="false"
|
|
|
v-dialogDrag @close="closeDeptDialog">
|
|
|
- 选择报价单 : <el-select v-model="themeId" placeholder="请选择" size="small">
|
|
|
+ 选择报价单 : <el-select multiple v-model="themeId" placeholder="请选择" size="small">
|
|
|
<el-option
|
|
|
v-for="item in themeIdOptions"
|
|
|
:key="item.themeCode"
|
|
|
@@ -93,15 +128,20 @@ import KtButton from "@/views/Core/KtButton"; //按钮权限组件
|
|
|
import tree from "@/components/ztree.vue"; //机构树组件
|
|
|
import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
|
|
|
import CommonUtil from "@/utils/comutil.js";
|
|
|
+import templateTable from "../../components/TemplateTable/index.vue";
|
|
|
+
|
|
|
export default {
|
|
|
name: "Deptall",
|
|
|
components: {
|
|
|
KtButton,
|
|
|
tree,
|
|
|
KtCommonTable,
|
|
|
+ templateTable
|
|
|
},
|
|
|
created() {
|
|
|
- this.findTreeData(); // 获取左边机构树数据
|
|
|
+ this.findPage(); // 获取列表树数据
|
|
|
+ this.searchLeaderFun()
|
|
|
+ this.findLeftTreeData(); // 获取机构树的数据
|
|
|
//获取所有下拉框数据
|
|
|
this.getDictItems("comlevel");
|
|
|
this.getDictItems("comattribute");
|
|
|
@@ -119,10 +159,97 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.filters.id = "9";
|
|
|
+ this.changeTreeWidth(240); // 初始化树的宽度
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- themeId:'',
|
|
|
+ btnGroup:[
|
|
|
+ {
|
|
|
+ name:'报价单配置',
|
|
|
+ click:(row, index) => {return this.batchEditing()},
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ searchLeaderOptions:[],
|
|
|
+ queryFrom: {}, // 右侧列表查询数据Start
|
|
|
+ formList: [
|
|
|
+ //树右侧搜索数据列
|
|
|
+ {
|
|
|
+ label: "工号",
|
|
|
+ prop: "userId",
|
|
|
+ type: "input",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "姓名",
|
|
|
+ prop: "name",
|
|
|
+ type: "input",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "手机号",
|
|
|
+ prop: "mobile",
|
|
|
+ type: "input",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "状态",
|
|
|
+ prop: "status",
|
|
|
+ type: "select",
|
|
|
+ options: JSON.parse(localStorage.getItem("user_statusoptions")),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "领导人",
|
|
|
+ name: "领导人",
|
|
|
+ type: "slot",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ tableConfig: {
|
|
|
+ columns: [
|
|
|
+ // 数据列
|
|
|
+ { prop: "deptId", label: "部门编码", type: "text" },
|
|
|
+ {
|
|
|
+ prop: "pdeptName",
|
|
|
+ label: "机构名称",
|
|
|
+ type: "text",
|
|
|
+ },
|
|
|
+ { prop: "deptName", label: "部门名称", type: "text" },
|
|
|
+
|
|
|
+ { prop: "userId", label: "工号", type: "text" },
|
|
|
+ { prop: "name", label: "姓名", type: "text" },
|
|
|
+ { prop: "mobile", label: "联系电话", type: "text" },
|
|
|
+ {
|
|
|
+ prop: "roleId",
|
|
|
+ label: "角色",
|
|
|
+ type: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "managementSource",
|
|
|
+ label: "来源",
|
|
|
+ type: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "status",
|
|
|
+ label: "状态",
|
|
|
+ type: "text",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ loading: true,
|
|
|
+ isPaginationShow: true,
|
|
|
+ isShowIndex: true,
|
|
|
+ isCheckBox:true
|
|
|
+ // optBtns: [
|
|
|
+ // {
|
|
|
+ // type: "primary",
|
|
|
+ // label: "编辑",
|
|
|
+ // perm:'sys:teamchannel:edit',
|
|
|
+ // icon: "fa fa-edit",
|
|
|
+ // click: (row, index) => {
|
|
|
+ // return this.handleTableEdit(row);
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ },
|
|
|
+ selectList:[],
|
|
|
+ leftSplitWidth: 20,
|
|
|
+ rightSplitWidth: 80,
|
|
|
+ themeId:[],
|
|
|
deptDialogTitle:'编辑',
|
|
|
themeIdOptions:[],
|
|
|
loading: false,
|
|
|
@@ -140,8 +267,7 @@ export default {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
- pageResult: {},
|
|
|
-
|
|
|
+ pageResult: [],
|
|
|
//------------下拉框数据 begin-----------------
|
|
|
comleveloptions: [],
|
|
|
comattributeoptions: [],
|
|
|
@@ -153,11 +279,74 @@ export default {
|
|
|
expanded: false, // 在这里定义了展开与否的标志
|
|
|
// 部门DialogEnd
|
|
|
ztreeNodes:[],
|
|
|
+ tableData:[],
|
|
|
organizationId:'',
|
|
|
- checkedKeys:false
|
|
|
+ checkedKeys:false,
|
|
|
+ currentTreeNode: null,
|
|
|
+ deptId: JSON.parse(localStorage.getItem("user_data")).deptId,
|
|
|
+ pageData: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ searchLeaderFun(){
|
|
|
+ this.$api.user
|
|
|
+ .findBackListByDeptId({ deptId: this.deptId })
|
|
|
+ .then((res) => {
|
|
|
+ this.searchLeaderOptions = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSearchList(data) {
|
|
|
+ this.findPage(data);
|
|
|
+ },
|
|
|
+ onZTreeClick: function (evt, treeId, treeNode) {
|
|
|
+ // 点击事件
|
|
|
+ this.currentTreeNode = evt;
|
|
|
+ // this.pageData.deptId = this.currentTreeNode.id;
|
|
|
+ this.deptId = this.currentTreeNode.id
|
|
|
+ this.pageData.pageNum =1;
|
|
|
+ this.findPage()
|
|
|
+ this.searchLeaderFun();
|
|
|
+ // this.formData.deptId = [];
|
|
|
+ this.platform(treeId);
|
|
|
+ },
|
|
|
+ platform(array) {
|
|
|
+ if (!array.parent) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // this.formData.deptId.unshift(array.data.id);
|
|
|
+ this.platform(array.parent);
|
|
|
+ },
|
|
|
+ changeTreeWidth(widthVal) {
|
|
|
+ // 初始化树的宽度
|
|
|
+ this.leftSplitWidth = Math.ceil(
|
|
|
+ (widthVal / this.$refs.elMain.$el.clientWidth) * 100
|
|
|
+ );
|
|
|
+ this.rightSplitWidth = 100 - this.leftSplitWidth;
|
|
|
+ },
|
|
|
+ findLeftTreeData: function () {
|
|
|
+ this.$api.dept.findTree().then((res) => {
|
|
|
+ // console.log(treeTypeNum);
|
|
|
+ this.treeDataRecursion({...res.data, treeTypeNum:1});
|
|
|
+ this.ztreeNodes = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //树过滤五级机构递归
|
|
|
+ treeDataRecursion(data, num, one) {
|
|
|
+ data = data || this.ztreeNodes;
|
|
|
+ one = one || 0;
|
|
|
+ one++;
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].comlevel == 5 && (data[i].managementSource != num)) {
|
|
|
+ data.splice(i, 1);
|
|
|
+ i = i - 1;
|
|
|
+ } else {
|
|
|
+ this.treeDataRecursion(data[i].children, num, one);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
//点击每一行的事件
|
|
|
rowClick(row, treeNode) {
|
|
|
//点每行展开折叠
|
|
|
@@ -178,10 +367,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
//展开收起树列表
|
|
|
- fold() {
|
|
|
- this.isshow = !this.isshow;
|
|
|
- this.forTableData(this.ztreeNodes, this.isshow);
|
|
|
- },
|
|
|
+ // fold() {
|
|
|
+ // this.isshow = !this.isshow;
|
|
|
+ // this.forTableData(this.ztreeNodes, this.isshow);
|
|
|
+ // },
|
|
|
|
|
|
//--数据字典 begin --
|
|
|
getDictItems(typeName) {
|
|
|
@@ -189,7 +378,6 @@ export default {
|
|
|
.findByLableName(typeName)
|
|
|
.then((response) => {
|
|
|
this[typeName + "options"] = response.data; // 把获取到的数据赋给this.data
|
|
|
- // this.ztreeNodes = this[typeName + "options"];
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
this[typeName + "options"] = [];
|
|
|
@@ -203,29 +391,24 @@ export default {
|
|
|
})
|
|
|
|
|
|
},
|
|
|
- findTreeData() {
|
|
|
- // 获取机构树的数据
|
|
|
+ findPage(data) {
|
|
|
+ this.tableConfig.loading = true;
|
|
|
this.loading = true;
|
|
|
- this.$api.menu.findTree(this.peopledeptid, "").then((res) => {
|
|
|
- this.ztreeNodes = res.data;
|
|
|
- this.loading = false;
|
|
|
+ this.$api.menu.findUserList({
|
|
|
+ ...this.pageData,
|
|
|
+ dto: { ...data, deptId: this.deptId, agentFlag: "1"
|
|
|
+ ,leaderName:this.queryFrom.leaderName },
|
|
|
+ }).then((res) => {
|
|
|
+ if(res.code == 200){
|
|
|
+ this.tableConfig.loading = false;
|
|
|
+ this.pageResult = res.data.records;
|
|
|
+ this.pageData.pageNum = res.data.current;
|
|
|
+ this.pageData.pageSize = res.data.size;
|
|
|
+ this.pageData.totalSize = res.data.total;
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
- managementSourceQuery() {
|
|
|
- this.loading = true;
|
|
|
- this.$api.menu
|
|
|
- .findTree(this.peopledeptid, this.managementSource)
|
|
|
- .then((res) => {
|
|
|
- this.ztreeNodes = res.data;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- handleCreated(ztreeObj) {
|
|
|
- this.ztreeObj = ztreeObj;
|
|
|
- // onCreated 中操作ztreeObj对象展开第一个节点
|
|
|
- ztreeObj.expandNode(ztreeObj.getNodes()[0], true);
|
|
|
- this.currentTreeNode = ztreeObj.getNodes()[0];
|
|
|
- },
|
|
|
//-- formatter begin--
|
|
|
comlevelFormatter(row, column) {
|
|
|
let comlevel = row.comlevel;
|
|
|
@@ -254,16 +437,18 @@ export default {
|
|
|
data: comtype,
|
|
|
});
|
|
|
},
|
|
|
- handleSelectionChange(select, row) {
|
|
|
-
|
|
|
- if (!row.children) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (this.$refs.expandTable.selection.includes(row)) {
|
|
|
- this.checkRow(row.children, true); // 调用选中递归方法
|
|
|
- } else {
|
|
|
- this.checkRow(row.children, false);
|
|
|
+ handleSelectionChange(select) {
|
|
|
+ if(select.length>0){
|
|
|
+ this.selectList=select
|
|
|
}
|
|
|
+ // if (!row.children) {
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // if (this.$refs.expandTable.selection.includes(row)) {
|
|
|
+ // this.checkRow(row.children, true); // 调用选中递归方法
|
|
|
+ // } else {
|
|
|
+ // this.checkRow(row.children, false);
|
|
|
+ // }
|
|
|
},
|
|
|
handleSelectionChangeAll(selection){
|
|
|
this.checkedKeys = !this.checkedKeys;
|
|
|
@@ -281,21 +466,22 @@ export default {
|
|
|
// 编辑机构或部门
|
|
|
handleEdit(row) {
|
|
|
this.deptDialogTitle='编辑'
|
|
|
- this.themeId=''
|
|
|
+ this.themeId=[]
|
|
|
this.organizationId=row.id
|
|
|
this.deptDialogVisible=true
|
|
|
},
|
|
|
deptSubmitForm() {
|
|
|
let data={
|
|
|
- organizationIds:this.deptDialogTitle=='编辑'?[this.organizationId]:this.$refs.expandTable.selection.map(e=>e.id),
|
|
|
- themeCode:this.themeId
|
|
|
+ // organizationIds:this.deptDialogTitle=='编辑'?[this.organizationId]:this.$refs.expandTable.selection.map(e=>e.id),
|
|
|
+ authorizationIds:this.selectList.map(e=>e.id),
|
|
|
+ themecodes:this.themeId
|
|
|
}
|
|
|
this.$api.menu
|
|
|
.quotationBatch(data)
|
|
|
.then((res) => {
|
|
|
if(res.code==200){
|
|
|
this.deptDialogVisible=false
|
|
|
- this.findTreeData()
|
|
|
+ this.findPage()
|
|
|
this.$message({ message: res.msg, type: "success" });
|
|
|
}
|
|
|
else{
|
|
|
@@ -304,8 +490,8 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
batchEditing(){
|
|
|
- this.themeId=''
|
|
|
- this.deptDialogTitle='批量编辑'
|
|
|
+ this.themeId=[]
|
|
|
+ this.deptDialogTitle='报价单配置'
|
|
|
this.deptDialogVisible=true
|
|
|
},
|
|
|
//关闭部门弹框
|