Browse Source

Merge branch 'qin_v21'

han_v1
herenshan112 7 months ago
parent
commit
bd5183dc0e
  1. 1
      src/components/DesignForm/public/form/formItem.vue
  2. 285
      src/views/matrix/matrixcont/setupmatrixuser.vue
  3. 597
      src/views/matrix/orgoruser/pickorg.vue

1
src/components/DesignForm/public/form/formItem.vue

@ -1241,6 +1241,7 @@ const diGuiJilian = (val: any, options: any[]) => {
v-model="value"
:disabled="judgeIsDisabled(data.name)"
type="textarea"
:autosize="{ minRows: 2, maxRows: 20 }"
:placeholder="
data.control.placeholder
? data.control.placeholder

285
src/views/matrix/matrixcont/setupmatrixuser.vue

@ -3,41 +3,45 @@
@ 时间: 2023-07-05 15:03:42
@ 备注: 设置字段值
-->
<script lang='ts' setup>
import { matrixTable,objectStruct,orgAndUserMatrixCont } from '@/api/matrixapi/type'
import { getMatrixField,getNumber,submitMatrixData,haveMatrixCont } from '@/api/matrixapi';
import { Search } from '@element-plus/icons-vue'
<script lang="ts" setup>
import { matrixTable, objectStruct, orgAndUserMatrixCont } from "@/api/matrixapi/type";
import {
getMatrixField,
getNumber,
submitMatrixData,
haveMatrixCont,
} from "@/api/matrixapi";
import { Search } from "@element-plus/icons-vue";
/**
* 引入页面
*/
import PickOrg from '@/views/matrix/orgoruser/pickorg.vue'
import PickOrg from "@/views/matrix/orgoruser/pickorg.vue";
const props = defineProps({
userShow:{
type:Boolean,
default:false
userShow: {
type: Boolean,
default: false,
},
matrixcont: {
type: Object,
default() {
return {};
},
},
matrixcont:{
type:Object,
default(){
return {}
}
}
});
const emits = defineEmits(["update:userShow"]); //
const addFieldLoading = ref(false)
const tabelColumn = reactive<matrixTable[]>([])
const tableList = reactive<any[]>([])
const loading = ref(false)
const addFieldLoading = ref(false);
const tabelColumn = reactive<matrixTable[]>([]);
const tableList = reactive<any[]>([]);
const loading = ref(false);
const orgOrUserBox = ref(false); //
const judgePage = ref(false);
const orguseInfo = reactive<orgAndUserMatrixCont[]>([])
const orguseInfo = reactive<orgAndUserMatrixCont[]>([]);
const systemMenuTreeProps = {
children: "child",
label: "name",
value:"id"
}
value: "id",
};
const orgOptionsList = ref<any>(); //
const tableValue = ref<any>(); //
const ids = ref<number[]>([]); //ID
@ -53,96 +57,99 @@ const field_is_Show = computed({
/**
* 关闭弹窗
*/
function handleCloseBox(){
function handleCloseBox() {
emits("update:userShow", false);
initData()
initData();
}
/**
* 初始化数据
*/
function initData(){
orgOptionsList.value?.splice(0,orgOptionsList.value.length);
function initData() {
orgOptionsList.value?.splice(0, orgOptionsList.value.length);
// console.log("tableList-------->",tableList.length)
tableList.splice(0, tableList.length);
}
/**
* 监听数据
*/
watch(() => props.userShow,() => {
if(props.userShow){
getMatrixField({id:props.matrixcont.id})
.then(({data})=>{
// console.log("---->",data)
tabelColumn.splice(0,tabelColumn.length)
data.factor.forEach(item=>{
watch(
() => props.userShow,
() => {
if (props.userShow) {
getMatrixField({ id: props.matrixcont.id })
.then(({ data }) => {
console.log("监听数据---->", data);
tabelColumn.splice(0, tabelColumn.length);
data.factor.forEach((item) => {
tabelColumn.push({
id:item.id,
label:item.name,
prop:item.pinyin,
types:item.types
})
})
data.outcome.forEach(item=>{
id: item.id,
label: item.name,
prop: item.pinyin,
types: item.types,
});
});
data.outcome.forEach((item) => {
tabelColumn.push({
id:item.id,
label:item.name,
prop:item.pinyin,
types:item.types
})
})
})
.finally(()=>{
tableList.splice(0,tableList.length)
haveMatrixCont({id:props.matrixcont.id})
.then((data)=>{
if(data.data&&data.data.length>0){
data.data.forEach((item:any)=>{
tableList.push(item)
id: item.id,
label: item.name,
prop: item.pinyin,
types: item.types,
});
});
})
.finally(() => {
tableList.splice(0, tableList.length);
haveMatrixCont({ id: props.matrixcont.id })
.then((data) => {
console.log("监听数据--11111-->", data);
if (data.data && data.data.length > 0) {
data.data.forEach((item: any) => {
tableList.push(item);
});
}
})
.finally(()=>{
if(tableList.length<1){
.finally(() => {
if (tableList.length < 1) {
addTableHang();
}
})
})
});
});
}
});
}
);
/**
* 添加行
*/
function addTableHang(){
function addTableHang() {
//
getNumber({id:8})
.then((data)=>{
var jks:objectStruct = {}
tabelColumn.forEach(item=>{
jks[item.prop]={
id:item.id,
types:item.types,
number:data.data.uuidstring,
userlist:[],
orgid:0,
namelist:[],
isedit:false,
pinyin:item.prop
}
})
tableList.push(jks)
})
getNumber({ id: 8 }).then((data) => {
var jks: objectStruct = {};
tabelColumn.forEach((item) => {
jks[item.prop] = {
id: item.id,
types: item.types,
number: data.data.uuidstring,
userlist: [],
orgid: 0,
namelist: [],
isedit: false,
pinyin: item.prop,
};
});
tableList.push(jks);
});
// console.log("-1111->",props.orglist,props.orgtree)
}
/**
* 提交使用人
*/
function submitAddMatrixUser(){
if(orguseInfo&&orguseInfo.length>0){
orguseInfo.splice(0,orguseInfo.length)
function submitAddMatrixUser() {
if (orguseInfo && orguseInfo.length > 0) {
orguseInfo.splice(0, orguseInfo.length);
}
// console.log("-->",tableList)
if(tableList&&tableList.length > 0){
tableList.forEach((item)=>{
if (tableList && tableList.length > 0) {
tableList.forEach((item) => {
// console.log("-4->",item,item.bm)
// if(item&&item.length>=0){
// item.forEach((items: any)=>{
@ -150,74 +157,86 @@ function submitAddMatrixUser(){
// })
// }
const entries = Object.entries(item);
entries.map((val:any)=>{
entries.map((val: any) => {
// console.log("-2->",val,val[val.length-1].number)
let typeClass = 1
if(val[val.length-1].types == 1){
typeClass = 2
let typeClass = 1;
if (val[val.length - 1].types == 1) {
typeClass = 2;
}
orguseInfo.push({
id:0,
number:val[val.length-1].number,
userlist:val[val.length-1].userlist,
types:typeClass,
mcid:props.matrixcont.id,
mhid:val[val.length-1].id,
})
})
})
id: 0,
number: val[val.length - 1].number,
userlist: val[val.length - 1].userlist,
types: typeClass,
mcid: props.matrixcont.id,
mhid: val[val.length - 1].id,
});
});
});
}
submitMatrixData(orguseInfo)
.then((data)=>{
submitMatrixData(orguseInfo).then((data) => {
// console.log("-66666->",data)
handleCloseBox();
})
});
// console.log("-1->",orguseInfo)
}
function sdfdsf(cont:any){
function sdfdsf(cont: any) {
// console.log("-2222222->",cont)
if(cont.types<1){
judgePage.value = true
}else{
judgePage.value = false
if (cont.types < 1) {
judgePage.value = true;
} else {
judgePage.value = false;
}
cont.isedit=true
orgOrUserBox.value = true
tableValue.value = cont
cont.isedit = true;
orgOrUserBox.value = true;
tableValue.value = cont;
}
/**
* 删除行
*/
function delTableHang(id:any){
function delTableHang(id: any) {
// console.log("",id)
tableList.splice(id,1)
if(tableList.length<1){
tableList.splice(id, 1);
if (tableList.length < 1) {
addTableHang();
}
}
</script>
<template>
<el-dialog v-model="field_is_Show" custom-class="dialog_box" title="矩阵数据维护" :before-close="handleCloseBox" width="80%" draggable>
<PickOrg v-model:orgBoxShow="orgOrUserBox" :ismultiselect="false" :tabledata="tableValue" />
<el-table
v-loading="loading"
highlight-current-row
:data="tableList"
border
<el-dialog
v-model="field_is_Show"
custom-class="dialog_box"
title="矩阵数据维护"
:before-close="handleCloseBox"
width="80%"
draggable
>
<el-table-column v-for="(item,index) in tabelColumn" :key="index" align="center">
<PickOrg
v-model:orgBoxShow="orgOrUserBox"
:ismultiselect="false"
:tabledata="tableValue"
/>
<el-table v-loading="loading" highlight-current-row :data="tableList" border>
<el-table-column v-for="(item, index) in tabelColumn" :key="index" align="center">
<!-- 自定义表头 -->
<template #header>
{{item.label}}
{{ item.label }}
</template>
<!-- 自定义表项/单元格内容 -->
<template #default="scope">
<div v-if="!scope.row[item.prop].isedit" class="edit_table_row" @dblclick="sdfdsf(scope.row[item.prop])" >
<el-tag v-for="(itemtext,ti) in scope.row[item.prop].userlist" :key="ti" class="ml-2" size="small">{{ itemtext.name }}</el-tag>&nbsp;
<div
v-if="!scope.row[item.prop].isedit"
class="edit_table_row"
@dblclick="sdfdsf(scope.row[item.prop])"
>
<el-tag
v-for="(itemtext, ti) in scope.row[item.prop].userlist"
:key="ti"
class="ml-2"
size="small"
>{{ itemtext.name }}</el-tag
>&nbsp;
</div>
<div v-else>
<el-input
@ -230,7 +249,9 @@ function delTableHang(id:any){
</el-table-column>
<el-table-column label="操作" width="80" align="center">
<template #default="scope">
<el-button type="danger" link @click="delTableHang(scope.$index)">删除</el-button>
<el-button type="danger" link @click="delTableHang(scope.$index)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -241,23 +262,25 @@ function delTableHang(id:any){
<el-button type="warning" @click="addTableHang">添加数据</el-button>
</div>
<div>
<el-button type="primary" :loading="addFieldLoading" @click="submitAddMatrixUser" > </el-button>
<el-button
type="primary"
:loading="addFieldLoading"
@click="submitAddMatrixUser"
> </el-button
>
<el-button @click="handleCloseBox"> </el-button>
</div>
</div>
</template>
</el-dialog>
</template>
<style lang='scss' scoped>
.edit_table_row{
<style lang="scss" scoped>
.edit_table_row {
display: block;
width: 100%;
height: 100%;
}
.left_right{
.left_right {
display: flex;
justify-content: space-between;
align-items: center;

597
src/views/matrix/orgoruser/pickorg.vue

@ -3,49 +3,53 @@
@ 时间: 2023-07-07 09:11:55
@ 备注: 选择行政组织
-->
<script lang='ts' setup>
import { Search } from '@element-plus/icons-vue' //
import { ElDivider } from 'element-plus'
import { orgInfo,breadCrumbs,employeesCont,childDepartmentsCont } from '@/api/displayboardapi/types'
import { getOrgChiled,getBasisOrgChiled } from '@/api/displayboardapi/indexapi'
import { shuttleFramePickData } from '@/api/matrixapi/type'
<script lang="ts" setup>
import { Search } from "@element-plus/icons-vue"; //
import { ElDivider } from "element-plus";
import {
orgInfo,
breadCrumbs,
employeesCont,
childDepartmentsCont,
} from "@/api/displayboardapi/types";
import { getOrgChiled, getBasisOrgChiled } from "@/api/displayboardapi/indexapi";
import { shuttleFramePickData } from "@/api/matrixapi/type";
import { queryPeopleCont } from '@/api/hr/people/type'
import { searchUserCont } from '@/api/hr/people/index'
import { queryPeopleCont } from "@/api/hr/people/type";
import { searchUserCont } from "@/api/hr/people/index";
const spacer = h(ElDivider, { direction: 'vertical' })
const spacer = h(ElDivider, { direction: "vertical" });
const props = defineProps({
orgBoxShow:{
type:Boolean,
default:false
orgBoxShow: {
type: Boolean,
default: false,
},
ismultiselect: {
type: Boolean,
default: false,
},
tabledata: {
type: Object,
default() {
return {};
},
ismultiselect:{
type:Boolean,
default:false
},
tabledata:{
type:Object,
default(){
return {}
}
}
});
const emits = defineEmits(["update:orgBoxShow"]); //
const dialogTitle = ref<string>()
const dialogTitle = ref<string>();
const addOrgUserLoading = ref(false);
const searchKeywords = ref<string>()
const keywordsTitle = ref<string>()
const orgInfoList = ref<orgInfo[]>()
const orgBreadCrumbs = ref<breadCrumbs[]>()
const employees = ref<employeesCont[]>()
const childDepartments = ref<childDepartmentsCont[]>()
const searchKeywords = ref<string>();
const keywordsTitle = ref<string>();
const orgInfoList = ref<orgInfo[]>();
const orgBreadCrumbs = ref<breadCrumbs[]>();
const employees = ref<employeesCont[]>();
const childDepartments = ref<childDepartmentsCont[]>();
const isCheckBox = ref(false); //
const pickDataList = ref<any>()
const duoxuanVal = reactive<shuttleFramePickData[]>([])
const pickDataList = ref<any>();
const duoxuanVal = reactive<shuttleFramePickData[]>([]);
// const danxuanVal = ref<shuttleFramePickData>()
const countPick=ref(0)
const countPick = ref(0);
/**
* 弹窗显示控制
*/
@ -58,15 +62,15 @@ const pickorg_is_Show = computed({
/**
* 关闭弹窗
*/
function closeBox(){
function closeBox() {
// eslint-disable-next-line vue/no-mutating-props
props.tabledata.isedit = false;
pickDataList.value =[]
orgInfoList.value = []
duoxuanVal.slice(0,duoxuanVal.length)
let emptyOrg = new Array
duoxuanVal.length = 0
searchKeywords.value=""
pickDataList.value = [];
orgInfoList.value = [];
duoxuanVal.slice(0, duoxuanVal.length);
let emptyOrg = new Array();
duoxuanVal.length = 0;
searchKeywords.value = "";
// //console.log("",duoxuanVal)
// eslint-disable-next-line vue/no-mutating-props
// props.tabledata.namelist=["",""]
@ -75,287 +79,288 @@ function closeBox(){
/**
* 获取行政组织
*/
function getOrgList(orgId:number){
getOrgChiled({id:orgId})
.then(({data})=>{
function getOrgList(orgId: number) {
getOrgChiled({ id: orgId })
.then(({ data }) => {
// //console.log("",data)
orgInfoList.value = data.list
orgBreadCrumbs.value = data.tabval
})
.finally(()=>{
isPick()
orgInfoList.value = data.list;
orgBreadCrumbs.value = data.tabval;
})
.finally(() => {
isPick();
});
}
/**
* 判断是否选中
*/
function isPick(id?:number|string){
function isPick(id?: number | string) {
// //console.log("orgInfoList->",orgInfoList)
// //console.log("pickDataList->",pickDataList)
if(pickDataList.value && pickDataList.value.length > 0){
orgInfoList.value?.forEach(item=>{
if(id == item.id){
item.isActiveItem = false
}
pickDataList.value.forEach((items: any)=>{
if(item.id == items.id){
item.isActiveItem = true
}
})
})
employees.value?.forEach(item=>{
if(id == item.id){
item.ispick = false
}
pickDataList.value.forEach((items: any)=>{
if(item.id == items.id){
item.ispick = true
}
})
})
}else{
orgInfoList.value?.forEach(item=>{
if(id == item.id){
item.isActiveItem = false
if (pickDataList.value && pickDataList.value.length > 0) {
orgInfoList.value?.forEach((item) => {
if (id == item.id) {
item.isActiveItem = false;
}
pickDataList.value.forEach((items: any) => {
if (item.id == items.id) {
item.isActiveItem = true;
}
});
});
employees.value?.forEach((item) => {
if (id == item.id) {
item.ispick = false;
}
pickDataList.value.forEach((items: any) => {
if (item.id == items.id) {
item.ispick = true;
}
});
});
} else {
orgInfoList.value?.forEach((item) => {
if (id == item.id) {
item.isActiveItem = false;
}
});
employees.value?.forEach((items) => {
if (id == items.id) {
items.ispick = false;
}
});
}
})
employees.value?.forEach(items=>{
if(id == items.id){
items.ispick = false
}
})
}
}
/**
* 监听数据
*/
watch(() => props.orgBoxShow,() => {
duoxuanVal.slice(0,duoxuanVal.length)
if(props.orgBoxShow){
isCheckBox.value = props.ismultiselect
pickDataList.value = props.tabledata.userlist
watch(
() => props.orgBoxShow,
() => {
duoxuanVal.slice(0, duoxuanVal.length);
if (props.orgBoxShow) {
isCheckBox.value = props.ismultiselect;
pickDataList.value = props.tabledata.userlist;
// //console.log("-----sd3------>",isCheckBox.value)
switch(props.tabledata.types){
switch (props.tabledata.types) {
case 2:
dialogTitle.value = "选择行政组织"
keywordsTitle.value = "请输入关键字"
dialogTitle.value = "选择行政组织";
keywordsTitle.value = "请输入关键字";
break;
case 3:
dialogTitle.value = "选择分部"
keywordsTitle.value = "请输入关键字"
dialogTitle.value = "选择分部";
keywordsTitle.value = "请输入关键字";
break;
default:
dialogTitle.value = "选择成员"
keywordsTitle.value = "请输入姓名或工号"
dialogTitle.value = "选择成员";
keywordsTitle.value = "请输入姓名或工号";
}
if (props.tabledata.types > 1) {
getOrgList(313);
} else {
getOrgAndPeople(313);
}
if(props.tabledata.types > 1){
getOrgList(313)
}else{
getOrgAndPeople(313)
}
}
})
);
/**
* 选定值
*/
function pickval(cont:any){
function pickval(cont: any) {
// //console.log("----",duoxuanVal)
if(isCheckBox.value){
cont.isActiveItem = true
if (isCheckBox.value) {
cont.isActiveItem = true;
let xieRu = true;
duoxuanVal.forEach(item =>{
if(item.id == cont.id){
xieRu=false;
duoxuanVal.forEach((item) => {
if (item.id == cont.id) {
xieRu = false;
}
})
if(xieRu){
});
if (xieRu) {
duoxuanVal.push({
id:cont.id.toString(),
name:cont.name,
icon:""
})
pickDataList.value = duoxuanVal
}
}else{
pickDataList.value =[
id: cont.id.toString(),
name: cont.name,
icon: "",
});
pickDataList.value = duoxuanVal;
}
} else {
pickDataList.value = [
{
id:cont.id.toString(),
name:cont.name,
icon:""
}
]
orgInfoList.value?.forEach(item=>{
if(cont.id == item.id){
item.isActiveItem = true
}else{
item.isActiveItem = false
id: cont.id.toString(),
name: cont.name,
icon: "",
},
];
orgInfoList.value?.forEach((item) => {
if (cont.id == item.id) {
item.isActiveItem = true;
} else {
item.isActiveItem = false;
}
})
});
}
countPick.value = pickDataList.value.length
countPick.value = pickDataList.value.length;
}
/**
* 选定人员
*/
function pickuserval(cont:any){
if(cont.ispick){
cont.ispick = false
let dxval = new Array
pickDataList.value.forEach((item: any)=>{
if(item.id != cont.id){
function pickuserval(cont: any) {
if (cont.ispick) {
cont.ispick = false;
let dxval = new Array();
pickDataList.value.forEach((item: any) => {
if (item.id != cont.id) {
dxval.push(item);
}
})
});
duoxuanVal.splice(0,duoxuanVal.length)
dxval.forEach(items=>{
duoxuanVal.push(items)
})
pickDataList.value = dxval
}else{
cont.ispick = true
let iconVal = cont.icon
if(iconVal == "" || iconVal == null) iconVal = cont.iconToBase64
duoxuanVal.splice(0, duoxuanVal.length);
dxval.forEach((items) => {
duoxuanVal.push(items);
});
pickDataList.value = dxval;
} else {
cont.ispick = true;
let iconVal = cont.icon;
if (iconVal == "" || iconVal == null) iconVal = cont.iconToBase64;
duoxuanVal.push({
id:cont.id.toString(),
name:cont.employeeName,
icon:iconVal
})
pickDataList.value = duoxuanVal
id: cont.id.toString(),
name: cont.employeeName,
icon: iconVal,
});
pickDataList.value = duoxuanVal;
//console.log("--1->",cont)
//console.log("--2->",pickDataList)
//console.log("--3->",duoxuanVal)
//console.log("--4->",iconVal)
}
countPick.value = pickDataList.value.length
countPick.value = pickDataList.value.length;
}
/**
* 删除已经选择
*/
function delPickData(cont:any,index:number){
function delPickData(cont: any, index: number) {
pickDataList.value.splice(index, 1);
isPick(cont.id)
isPick(cont.id);
}
function delPickUserData(cont:any,index:number){
function delPickUserData(cont: any, index: number) {
pickDataList.value.splice(index, 1);
isPick(cont.id)
isPick(cont.id);
}
/**
* 提交数据
*/
function submitPickOrgOrUser(){
function submitPickOrgOrUser() {
// eslint-disable-next-line vue/no-mutating-props
props.tabledata.isedit = false;
// eslint-disable-next-line vue/no-mutating-props
// props.tabledata.namelist=["",""]
if(pickDataList.value && pickDataList.value.length > 0){
let nameAry = new Array
let userAry = new Array
pickDataList.value.forEach((item: any)=>{
nameAry.push(item.name)
if (pickDataList.value && pickDataList.value.length > 0) {
let nameAry = new Array();
let userAry = new Array();
pickDataList.value.forEach((item: any) => {
nameAry.push(item.name);
userAry.push({
id:item.id.toString(),
name:item.name,
icon:item.icon
})
})
id: item.id.toString(),
name: item.name,
icon: item.icon,
});
});
// eslint-disable-next-line vue/no-mutating-props
props.tabledata.namelist = nameAry
props.tabledata.namelist = nameAry;
// eslint-disable-next-line vue/no-mutating-props
props.tabledata.userlist = userAry
}else{
props.tabledata.userlist = userAry;
} else {
// eslint-disable-next-line vue/no-mutating-props
props.tabledata.namelist = []
props.tabledata.namelist = [];
// eslint-disable-next-line vue/no-mutating-props
props.tabledata.userlist = []
props.tabledata.userlist = [];
}
closeBox();
}
/**
* 清空
*/
function emptyPickList(){
pickDataList.value =[]
duoxuanVal.slice(0,duoxuanVal.length)
let emptyOrg = new Array
duoxuanVal.length = 0
orgInfoList.value?.forEach(item=>{
item.isActiveItem = false
})
function emptyPickList() {
pickDataList.value = [];
duoxuanVal.slice(0, duoxuanVal.length);
let emptyOrg = new Array();
duoxuanVal.length = 0;
orgInfoList.value?.forEach((item) => {
item.isActiveItem = false;
});
}
/** =========================================分割线。以下是行政组织人员相关内容=============================================================== */
/**
* 清空已选择的人员
*/
function emptyPickuserList(){
pickDataList.value =[]
duoxuanVal.slice(0,duoxuanVal.length)
let emptyOrg = new Array
duoxuanVal.length = 0
employees.value?.forEach(item=>{
item.ispick = false
})
function emptyPickuserList() {
pickDataList.value = [];
duoxuanVal.slice(0, duoxuanVal.length);
let emptyOrg = new Array();
duoxuanVal.length = 0;
employees.value?.forEach((item) => {
item.ispick = false;
});
}
/**
* 获取行政组织和人员
*/
function getOrgAndPeople(orgid:number){
getBasisOrgChiled({id:orgid.toString()})
.then(({data})=>{
function getOrgAndPeople(orgid: number) {
getBasisOrgChiled({ id: orgid.toString() })
.then(({ data }) => {
//console.log("",data)
orgBreadCrumbs.value = data.titleDepartments
employees.value = data.employees
childDepartments.value = data.childDepartments
})
.finally(()=>{
isPick()
orgBreadCrumbs.value = data.titleDepartments;
employees.value = data.employees;
childDepartments.value = data.childDepartments;
})
.finally(() => {
isPick();
});
}
/**
* 搜索人员
*/
function searchPeople(){
if(searchKeywords.value != ""){
childDepartments.value = new Array
searchUserCont({page:1,pagesize:20,name:searchKeywords.value})
.then(({data})=>{
function searchPeople() {
if (searchKeywords.value != "") {
childDepartments.value = new Array();
searchUserCont({ page: 1, pagesize: 20, name: searchKeywords.value }).then(
({ data }) => {
//console.log("",data)
let usAry = new Array
data.list.forEach(item=>{
let pickVal = false
if(pickDataList.value && pickDataList.value.length > 0){
pickDataList.value.forEach((items: any)=>{
if(item.id == items.id){
pickVal = true
let usAry = new Array();
data.list.forEach((item) => {
let pickVal = false;
if (pickDataList.value && pickDataList.value.length > 0) {
pickDataList.value.forEach((items: any) => {
if (item.id == items.id) {
pickVal = true;
}
})
});
}
usAry.push({
"id":item.id, //string //"95196156539179008",
"employeeName":item.employeeName, //string //"",
"isLeave":item.isLeave, //string //"0",
"open":item.open, //boolean //"false",
"icon":item.icon, //string //"",
"iconToBase64":item.iconToBase64, //string //"",
"wechat":item.wechat, //string //"",
"departmentid":item.departmentid, //number //102,
"departmentname":item.departmentname, //string //"",
"postid":item.postid, //number //798,
"postname":item.postname, //string //"",
"tema":item.tema, //number //0,
"temaname":item.temaname, //string //""
"ispick":pickVal, //boolean //
})
})
employees.value = usAry
})
}else{
getOrgAndPeople(313)
id: item.id, //string //"95196156539179008",
employeeName: item.employeeName, //string //"",
isLeave: item.isLeave, //string //"0",
open: item.open, //boolean //"false",
icon: item.icon, //string //"",
iconToBase64: item.iconToBase64, //string //"",
wechat: item.wechat, //string //"",
departmentid: item.departmentid, //number //102,
departmentname: item.departmentname, //string //"",
postid: item.postid, //number //798,
postname: item.postname, //string //"",
tema: item.tema, //number //0,
temaname: item.temaname, //string //""
ispick: pickVal, //boolean //
});
});
employees.value = usAry;
}
);
} else {
getOrgAndPeople(313);
}
}
</script>
@ -369,7 +374,7 @@ function searchPeople(){
:before-close="closeBox"
>
<el-row v-if="props.tabledata.types > 1" class="biankuang_all">
<el-col :span="12" class="col_body ">
<el-col :span="12" class="col_body">
<div class="input_box">
<el-input
v-model="searchKeywords"
@ -381,10 +386,19 @@ function searchPeople(){
</div>
<el-space :size="-2" :spacer="spacer" class="mianbaoxue">
<el-text class="allSearch" @click="getOrgList(313)">所有</el-text>
<el-text v-for="(it,ind) in orgBreadCrumbs" :key="ind" @click="getOrgList(parseInt(it.id))">{{ it.departmentName }}</el-text>
<el-text
v-for="(it, ind) in orgBreadCrumbs"
:key="ind"
@click="getOrgList(parseInt(it.id))"
>{{ it.departmentName }}</el-text
>
</el-space>
<ul class="select-box">
<li v-for="(item,index) in orgInfoList" :key="index" :class="{active: item.isActiveItem}">
<li
v-for="(item, index) in orgInfoList"
:key="index"
:class="{ active: item.isActiveItem }"
>
<div class="orgboxdiv">
<el-tooltip
class="box-item"
@ -393,10 +407,14 @@ function searchPeople(){
placement="left"
>
<el-text truncated @click="pickval(item)">
<img src="@/assets/image/icon_file.png">{{ item.name }}
<img src="@/assets/image/icon_file.png" />{{ item.name }}
</el-text>
</el-tooltip>
<i v-if="item.ischild&&props.tabledata.types!=3" @click="getOrgList(item.id)">下级</i>
<i
v-if="item.ischild && props.tabledata.types != 3"
@click="getOrgList(item.id)"
>下级</i
>
</div>
</li>
</ul>
@ -407,7 +425,7 @@ function searchPeople(){
<span class="emptyPick" @click="emptyPickList">清空</span>
</div>
<ul class="pick_select_box">
<li v-for="(item,index) in pickDataList" :key="index">
<li v-for="(item, index) in pickDataList" :key="index">
<el-tooltip
class="box-item"
effect="dark"
@ -415,18 +433,22 @@ function searchPeople(){
placement="right"
>
<el-text truncated>
<img src="@/assets/image/icon_file.png">{{ item.name }}
<img src="@/assets/image/icon_file.png" />{{ item.name }}
</el-text>
</el-tooltip>
<svg-icon icon-class="cc_k" class="right_5" @click="delPickData(item,index)" />
<svg-icon
icon-class="cc_k"
class="right_5"
@click="delPickData(item, index)"
/>
</li>
</ul>
</el-col>
</el-row>
<!--选择人员-->
<el-row v-if="props.tabledata.types < 2" class="biankuang_all">
<el-col :span="12" class="col_body ">
<el-col :span="12" class="col_body">
<div class="input_box">
<el-input
v-model="searchKeywords"
@ -439,10 +461,19 @@ function searchPeople(){
</div>
<el-space :size="-2" :spacer="spacer" class="mianbaoxue">
<el-text class="allSearch" @click="getOrgAndPeople(313)">所有</el-text>
<el-text v-for="(it,ind) in orgBreadCrumbs" :key="ind" @click="getOrgAndPeople(parseInt(it.id))">{{ it.departmentName }}</el-text>
<el-text
v-for="(it, ind) in orgBreadCrumbs"
:key="ind"
@click="getOrgAndPeople(parseInt(it.id))"
>{{ it.departmentName }}</el-text
>
</el-space>
<ul class="select-box">
<li v-for="(item,index) in childDepartments" :key="index" :class="{active: item.isActiveItem}">
<li
v-for="(item, index) in childDepartments"
:key="index"
:class="{ active: item.isActiveItem }"
>
<div class="orgboxdiv">
<el-tooltip
class="box-item"
@ -451,18 +482,30 @@ function searchPeople(){
placement="left"
>
<el-text truncated>
<img src="@/assets/image/icon_file.png">{{ item.departmentName }}
<img src="@/assets/image/icon_file.png" />{{ item.departmentName }}
</el-text>
</el-tooltip>
<i @click="getOrgAndPeople(parseInt(item.id))">下级</i>
</div>
</li>
<li v-for="(item,index) in employees" :key="index" :class="{active: item.ispick}">
<li
v-for="(item, index) in employees"
:key="index"
:class="{ active: item.ispick }"
>
<div class="userboxdiv" @click="pickuserval(item)">
<svg-icon v-if="item.ispick" icon-class="select3" /><svg-icon v-else icon-class="select1" />
<img v-if="item.icon && item.icon != ''" :src="item.icon">
<img v-else-if="item.icon == '' && item.iconToBase64 && item.iconToBase64 != ''" :src="item.iconToBase64">
<img v-else src="@/assets/image/icon_people.png">
<svg-icon v-if="item.ispick" icon-class="select3" /><svg-icon
v-else
icon-class="select1"
/>
<img v-if="item.icon && item.icon != ''" :src="item.icon" />
<img
v-else-if="
item.icon == '' && item.iconToBase64 && item.iconToBase64 != ''
"
:src="item.iconToBase64"
/>
<img v-else src="@/assets/image/icon_people.png" />
{{ item.employeeName }}
</div>
</li>
@ -474,7 +517,7 @@ function searchPeople(){
<span class="emptyPick" @click="emptyPickuserList">清空</span>
</div>
<ul class="pick_select_box">
<li v-for="(item,index) in pickDataList" :key="index">
<li v-for="(item, index) in pickDataList" :key="index">
<el-tooltip
class="box-item"
effect="dark"
@ -482,37 +525,48 @@ function searchPeople(){
placement="right"
>
<el-text truncated>
<img v-if="item.icon && item.icon != ''" :src="item.icon"><img v-else src="@/assets/image/icon_people.png">{{ item.name }}
<img v-if="item.icon && item.icon != ''" :src="item.icon" /><img
v-else
src="@/assets/image/icon_people.png"
/>{{ item.name }}
</el-text>
</el-tooltip>
<svg-icon icon-class="cc_k" class="right_5" @click="delPickUserData(item,index)" />
<svg-icon
icon-class="cc_k"
class="right_5"
@click="delPickUserData(item, index)"
/>
</li>
</ul>
</el-col>
</el-row>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" :loading="addOrgUserLoading" @click="submitPickOrgOrUser" > </el-button>
<el-button
type="primary"
:loading="addOrgUserLoading"
@click="submitPickOrgOrUser"
> </el-button
>
<el-button @click="closeBox"> </el-button>
</div>
</template>
</el-dialog>
</template>
<style lang='scss' scoped>
.biankuang_all{
<style lang="scss" scoped>
.biankuang_all {
border: 1px solid rgb(220, 223, 230);
}
.biankuang_left{
.biankuang_left {
border-left: 1px solid rgb(220, 223, 230);
}
.col_body{
.col_body {
height: 502px;
padding:0 0px;
padding: 0 0px;
}
.input_box{
.input_box {
border-bottom: 1px solid rgb(220, 223, 230);
}
.inputDeep {
@ -525,10 +579,10 @@ function searchPeople(){
}
}
.mianbaoxue{
.mianbaoxue {
width: 100%;
overflow-x: auto;
white-space:nowrap;
white-space: nowrap;
padding: 5px 5px;
cursor: pointer;
}
@ -536,19 +590,18 @@ function searchPeople(){
height: 430px;
overflow-y: auto;
border-top: 1px solid rgb(220, 223, 230);
li{
li {
padding: 5px 0;
.userboxdiv{
.userboxdiv {
padding: 0 5px;
cursor: pointer;
}
.orgboxdiv{
.orgboxdiv {
display: flex;
justify-content: space-between;
align-items: center;
}
i{
i {
min-width: 60px;
padding-left: 24px;
padding-right: 10px;
@ -564,21 +617,21 @@ function searchPeople(){
margin-right: 5px;
margin-left: 5px;
}
.el-text{
.el-text {
cursor: pointer;
}
}
li.active{
li.active {
color: #3195f8;
i{
i {
background: url(@/assets/image/next_level_active.png) no-repeat 10px center;
}
.el-text{
.el-text {
color: #3195f8;
}
}
}
.pick_head{
.pick_head {
width: 100%;
height: 41px;
display: flex;
@ -586,10 +639,10 @@ function searchPeople(){
align-items: center;
padding: 0 5px;
}
.pick_select_box{
.pick_select_box {
height: 460px;
overflow-y: auto;
li{
li {
display: flex;
justify-content: space-between;
align-items: center;
@ -600,14 +653,14 @@ function searchPeople(){
margin-right: 5px;
margin-left: 5px;
}
.right_5{
.right_5 {
min-width: 20px;
margin-right: 5px;
cursor: pointer;
}
}
}
.emptyPick{
.emptyPick {
cursor: pointer;
}
</style>

Loading…
Cancel
Save