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" v-model="value"
:disabled="judgeIsDisabled(data.name)" :disabled="judgeIsDisabled(data.name)"
type="textarea" type="textarea"
:autosize="{ minRows: 2, maxRows: 20 }"
:placeholder=" :placeholder="
data.control.placeholder data.control.placeholder
? data.control.placeholder ? data.control.placeholder

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

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

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

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

Loading…
Cancel
Save