Browse Source

修改组织排序

qin_24
herenshan112 3 months ago
parent
commit
8ad0e97c37
  1. 1
      src/api/hr/org/type.ts
  2. 39
      src/views/hr/company/companyduty.vue
  3. 10
      src/views/hr/company/savePage.vue
  4. 106
      src/views/hr/organization/orgcont/addorgcont.vue
  5. 114
      src/views/hr/organization/orgcont/editorgcont.vue

1
src/api/hr/org/type.ts

@ -100,6 +100,7 @@ export interface addOrgInfo{
abbreviation?: string, //简称
wechatid?: string //企业微信对照吗
kingdeeid?: string //金蝶对照码
sort?:number //排序
}
/**
*

39
src/views/hr/company/companyduty.vue

@ -9,9 +9,11 @@ import {
getYearMonthWorkMan,
delOneDayDuty,
} from "@/api/hr/paiban/index";
import { get_org } from "@/api/opk/zxy/news/api";
import SavePage from "@/views/hr/company/savePage.vue";
const currOrgManList = ref([]);
const currOrgCont = ref(309);
const pickMonth = ref("");
const initConter = ref("");
const isSelect = ref(false);
@ -36,12 +38,21 @@ const initInfo = () => {
companyDutyInit().then((res: any) => {
console.log("初始化数据:", res.data);
initConter.value = res.data;
currOrgCont.value = res.data.currentOrg;
getOrgList(res.data.currentOrg, res.data.year, res.data.month);
get_org({
id: res.data.currentOrg.toString(),
all: 1,
}).then((res: any) => {
console.log("获取行政组织人员信息get_org", res);
currOrgManList.value = res.data;
});
});
};
//
const getOrgList = (orgid: any, years: any, months: any) => {
currOrgCont.value = orgid;
getYearMonthWorkMan({
orgId: orgid,
years: years,
@ -62,7 +73,15 @@ const delTag = () => {
};
//
const pickOrg = (val: any) => {
currOrgCont.value = val;
getOrgList(val, initConter.value.year, initConter.value.month);
get_org({
id: val.toString(),
all: 1,
}).then((res: any) => {
console.log("获取行政组织人员信息get_org", res);
currOrgManList.value = res.data;
});
};
//
const saveData = (ord: any, val: any) => {
@ -119,6 +138,24 @@ const isShowOrg = (item: any) => {
}
// return true
};
//
// watch(
// () => currOrgCont.value,
// (val: any) => {
// get_org({
// id: val.toString(),
// all: 1,
// })
// .then((res: any) => {
// console.log("get_org", res);
// orgPeopleList.value = res.data;
// })
// },
// {
// deep: true,
// }
// );
</script>
<template>
<div class="comBox">

10
src/views/hr/company/savePage.vue

@ -21,6 +21,12 @@ const props = defineProps({
return {};
},
},
currOrgManList: {
type: Object,
default() {
return {};
},
},
});
const loading = ref(false);
const emits = defineEmits(["update:isOpen", "pickRefresh"]);
@ -69,8 +75,10 @@ const getOrgPeople = () => {
saveInfo.value.isCompany = 1;
})
.finally(() => {
console.log("------------>", saveInfo.value.isCompany);
// console.log("------------>", props.currOrgManList);
if (saveInfo.value.isCompany == 1) {
// orgPeopleList.value = props.currOrgManList;
// loading.value = false;
get_org({
id: props.cumpanyId.toString(),
all: 1,

106
src/views/hr/organization/orgcont/addorgcont.vue

@ -3,39 +3,39 @@
@ 时间: 2023-06-05 16:11:54
@ 备注: 添加行政组织
-->
<script lang='ts' setup>
import { addOrgInfo,orgInfo } from '@/api/hr/org/type'
import { addOrgInfoApi,getOrgTreeList } from '@/api/hr/org/index'
<script lang="ts" setup>
import { addOrgInfo, orgInfo } from "@/api/hr/org/type";
import { addOrgInfoApi, getOrgTreeList } from "@/api/hr/org/index";
const props = defineProps({
addOrgIsShow: {
type: Boolean,
default:false
default: false,
},
addorginfocont: {
type: Object,
default() {
return {organizationtype:0}
}
return { organizationtype: 0 };
},
},
orgclasslistary: {
type: Object,
default() {
return {id:0}
}
}
return { id: 0 };
},
},
});
const addOrgFormRef = ref(ElForm); //
const emits = defineEmits(["update:addOrgIsShow", "refreshorgtree"]);
const titlename = ref(""); //
const addOrgLoading = ref(false) //
const addOrgCont = reactive<addOrgInfo>({}) //
const addOrgLoading = ref(false); //
const addOrgCont = reactive<addOrgInfo>({}); //
const orgOptionsList = ref<orgInfo[]>();
const optLoading = ref(false);
const systemMenuTreeProps = {
children: "child",
label: "name",
value:"id"
}
value: "id",
};
/**
* 弹窗显示控制
*/
@ -57,8 +57,8 @@ function handleCloseAddOrg(){
*/
function initOriginalData() {
addOrgFormRef.value.resetFields();
addOrgCont.superior = ""
titlename.value=""
addOrgCont.superior = "";
titlename.value = "";
orgOptionsList.value?.splice(orgOptionsList.value.length);
addOrgLoading.value = false;
}
@ -70,7 +70,6 @@ const addOrgRules = reactive({
name: [{ required: true, message: "请输入行政组织名称", trigger: "blur" }],
number: [{ required: true, message: "请输入行政组织编号", trigger: "blur" }],
govclass: [{ required: true, message: "请选择行政组织分类", trigger: "blur" }],
});
/**
* 提交行政组织数据
@ -80,22 +79,23 @@ function submitAddOrgForm(){
addOrgFormRef.value.validate((isValid: boolean) => {
if (isValid) {
addOrgCont.superior = addOrgCont.superior?.toString()
addOrgCont.govclass = addOrgCont.govclass?.toString()
addOrgCont.number = addOrgCont.number?.toString()
addOrgCont.superior = addOrgCont.superior?.toString();
addOrgCont.govclass = addOrgCont.govclass?.toString();
addOrgCont.number = addOrgCont.number?.toString();
// addOrgCont.wechatid = addOrgCont.wechatid*1
// console.log("====>",addOrgCont)
addOrgInfoApi(addOrgCont)
.then((data) => {
ElMessage.success("新增成功");
handleCloseAddOrg();
emits('refreshorgtree');
}).finally(() =>{addOrgLoading.value = false;})
emits("refreshorgtree");
})
.finally(() => {
addOrgLoading.value = false;
});
}
});
};
}
/**
* 获取行政组织数据
*/
@ -103,38 +103,49 @@ function haveOrgTreeInfo(){
optLoading.value = true;
getOrgTreeList({})
.then(({ data }) => {
orgOptionsList.value = data
orgOptionsList.value = data;
orgOptionsList.value.push({
id: 0,
name:"顶级行政组织"
name: "顶级行政组织",
});
})
}).finally(()=>{optLoading.value = false;})
.finally(() => {
optLoading.value = false;
});
}
/**
* 监听数据
*/
watch(() => props.addOrgIsShow,() => {
watch(
() => props.addOrgIsShow,
() => {
// console.log("---",props.addorginfocont)
if (props.addOrgIsShow) {
if (props.addorginfocont.organizationtype) {
addOrgCont.superior = props.addorginfocont.organizationtype*1
addOrgCont.superior = props.addorginfocont.organizationtype * 1;
}
if (props.addorginfocont.name != "" && props.addorginfocont.name != null) {
titlename.value = "添加"+props.addorginfocont.name+"下属行政组织"
titlename.value = "添加" + props.addorginfocont.name + "下属行政组织";
} else {
titlename.value = "添加顶级行政组织"
titlename.value = "添加顶级行政组织";
}
haveOrgTreeInfo();
} else {
addOrgCont.superior = ""
addOrgCont.superior = "";
}
});
}
);
</script>
<template>
<el-dialog v-model="add_org_is_Show" custom-class="dialog_box" :title="titlename" :before-close="handleCloseAddOrg" width="400">
<el-dialog
v-model="add_org_is_Show"
custom-class="dialog_box"
:title="titlename"
:before-close="handleCloseAddOrg"
width="400"
>
<el-form
ref="addOrgFormRef"
:model="addOrgCont"
@ -150,9 +161,8 @@ function haveOrgTreeInfo(){
check-strictly
:render-after-expand="false"
:props="systemMenuTreeProps"
style="width: 100%;"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="行政组织全称" prop="name">
<el-input v-model="addOrgCont.name" placeholder="请输入行政组织全称" />
@ -164,7 +174,11 @@ function haveOrgTreeInfo(){
<el-input v-model="addOrgCont.number" placeholder="请输入行政组织编码" />
</el-form-item>
<el-form-item label="行政组织类别" prop="govclass">
<el-select v-model="addOrgCont.govclass" placeholder="请选择行政组织类别" style="width: 100%;">
<el-select
v-model="addOrgCont.govclass"
placeholder="请选择行政组织类别"
style="width: 100%"
>
<el-option
v-for="item in props.orgclasslistary"
:key="item.id"
@ -177,15 +191,23 @@ function haveOrgTreeInfo(){
<el-form-item label="企业微信对照码" prop="wechatid">
<el-input v-model="addOrgCont.wechatid" placeholder="请输入企业微信对照码" />
</el-form-item>
<el-form-item label="排序" prop="wechatid">
<el-input-number
v-model="addOrgCont.sort"
:min="1"
:max="1000"
placeholder="请输入序号"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" :loading="addOrgLoading" @click="submitAddOrgForm" > </el-button>
<el-button type="primary" :loading="addOrgLoading" @click="submitAddOrgForm"
> </el-button
>
<el-button @click="handleCloseAddOrg"> </el-button>
</div>
</template>
</el-dialog>
</template>
<style lang='scss' scoped>
</style>
<style lang="scss" scoped></style>

114
src/views/hr/organization/orgcont/editorgcont.vue

@ -3,39 +3,39 @@
@ 时间: 2023-06-06 11:06:04
@ 备注: 编辑行政组织内容
-->
<script lang='ts' setup>
import { addOrgInfo,orgInfo } from '@/api/hr/org/type'
import { editOrgInfoApi,getOrgTreeList } from '@/api/hr/org/index'
<script lang="ts" setup>
import { addOrgInfo, orgInfo } from "@/api/hr/org/type";
import { editOrgInfoApi, getOrgTreeList } from "@/api/hr/org/index";
const props = defineProps({
editOrgIsShow: {
type: Boolean,
default:false
default: false,
},
editorginfocont: {
type: Object,
default() {
return {organizationtype:0}
}
return { organizationtype: 0 };
},
},
orgclasslistary: {
type: Object,
default() {
return {id:0}
}
}
return { id: 0 };
},
},
});
const editOrgFormRef = ref(ElForm); //
const emits = defineEmits(["update:editOrgIsShow", "refreshorgtree"]);
const titlename = ref(""); //
const editOrgLoading = ref(false) //
const editOrgCont = reactive<addOrgInfo>({}) //
const editOrgLoading = ref(false); //
const editOrgCont = reactive<addOrgInfo>({}); //
const orgOptionsList = ref<orgInfo[]>();
const optLoading = ref(false);
const systemMenuTreeProps = {
children: "child",
label: "name",
value:"id"
}
value: "id",
};
/**
* 弹窗显示控制
*/
@ -57,7 +57,7 @@ function handleCloseEditOrg(){
*/
function initOriginalData() {
editOrgFormRef.value.resetFields();
titlename.value=""
titlename.value = "";
orgOptionsList.value?.splice(orgOptionsList.value.length);
editOrgLoading.value = false;
}
@ -69,7 +69,6 @@ function handleCloseEditOrg(){
name: [{ required: true, message: "请输入行政组织名称", trigger: "blur" }],
number: [{ required: true, message: "请输入行政组织编号", trigger: "blur" }],
govclass: [{ required: true, message: "请选择行政组织分类", trigger: "blur" }],
});
/**
* 获取行政组织数据
@ -78,33 +77,39 @@ function handleCloseEditOrg(){
optLoading.value = true;
getOrgTreeList({})
.then(({ data }) => {
orgOptionsList.value = data
orgOptionsList.value = data;
orgOptionsList.value.push({
id: 0,
name:"顶级行政组织"
name: "顶级行政组织",
});
})
}).finally(()=>{optLoading.value = false;})
.finally(() => {
optLoading.value = false;
});
}
/**
* 监听数据
*/
watch(() => props.editOrgIsShow,() => {
watch(
() => props.editOrgIsShow,
() => {
// console.log("---",props.editorginfocont)
if (props.editOrgIsShow) {
editOrgCont.id = props.editorginfocont.id
editOrgCont.name = props.editorginfocont.name //
editOrgCont.number = props.editorginfocont.number //
editOrgCont.superior = props.editorginfocont.superior //
editOrgCont.govclass = props.editorginfocont.organizationtype //
editOrgCont.abbreviation = props.editorginfocont.abbreviation //
editOrgCont.wechatid = props.editorginfocont.wechatorganizationid //
editOrgCont.kingdeeid = props.editorginfocont.kingdeeid //
titlename.value = "编辑<" + props.editorginfocont.name + ">信息"
editOrgCont.id = props.editorginfocont.id;
editOrgCont.name = props.editorginfocont.name; //
editOrgCont.number = props.editorginfocont.number; //
editOrgCont.superior = props.editorginfocont.superior; //
editOrgCont.govclass = props.editorginfocont.organizationtype; //
editOrgCont.abbreviation = props.editorginfocont.abbreviation; //
editOrgCont.wechatid = props.editorginfocont.wechatorganizationid; //
editOrgCont.kingdeeid = props.editorginfocont.kingdeeid; //
editOrgCont.sort = props.editorginfocont.sort;
titlename.value = "编辑<" + props.editorginfocont.name + ">信息";
haveOrgTreeInfo();
} else {
}
});
}
);
/**
* 提交数据
*/
@ -113,24 +118,32 @@ function submitEditOrgForm(){
editOrgFormRef.value.validate((isValid: boolean) => {
if (isValid) {
editOrgCont.superior = editOrgCont.superior?.toString()
editOrgCont.govclass = editOrgCont.govclass?.toString()
editOrgCont.number = editOrgCont.number?.toString()
editOrgCont.wechatid = editOrgCont.wechatid?.toString()
editOrgCont.superior = editOrgCont.superior?.toString();
editOrgCont.govclass = editOrgCont.govclass?.toString();
editOrgCont.number = editOrgCont.number?.toString();
editOrgCont.wechatid = editOrgCont.wechatid?.toString();
// console.log("====>",editOrgCont)
editOrgInfoApi(editOrgCont)
.then((data) => {
ElMessage.success("编辑成功");
handleCloseEditOrg();
emits('refreshorgtree');
}).finally(() =>{editOrgLoading.value = false;})
emits("refreshorgtree");
})
.finally(() => {
editOrgLoading.value = false;
});
}
});
}
</script>
<template>
<el-dialog v-model="edit_org_is_Show" custom-class="dialog_box" :title="titlename" :before-close="handleCloseEditOrg" width="400">
<el-dialog
v-model="edit_org_is_Show"
custom-class="dialog_box"
:title="titlename"
:before-close="handleCloseEditOrg"
width="400"
>
<el-form
ref="editOrgFormRef"
:model="editOrgCont"
@ -146,9 +159,8 @@ function submitEditOrgForm(){
check-strictly
:render-after-expand="false"
:props="systemMenuTreeProps"
style="width: 100%;"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="行政组织全称" prop="name">
<el-input v-model="editOrgCont.name" placeholder="请输入行政组织全称" />
@ -160,7 +172,11 @@ function submitEditOrgForm(){
<el-input v-model="editOrgCont.number" placeholder="请输入行政组织编码" />
</el-form-item>
<el-form-item label="行政组织类别" prop="govclass">
<el-select v-model="editOrgCont.govclass" placeholder="请选择行政组织类别" style="width: 100%;">
<el-select
v-model="editOrgCont.govclass"
placeholder="请选择行政组织类别"
style="width: 100%"
>
<el-option
v-for="item in props.orgclasslistary"
:key="item.id"
@ -173,15 +189,23 @@ function submitEditOrgForm(){
<el-form-item label="企业微信对照码" prop="wechatid">
<el-input v-model="editOrgCont.wechatid" placeholder="请输入企业微信对照码" />
</el-form-item>
<el-form-item label="排序" prop="wechatid">
<el-input-number
v-model="editOrgCont.sort"
:min="1"
:max="1000"
placeholder="请输入序号"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" :loading="editOrgLoading" @click="submitEditOrgForm" > </el-button>
<el-button type="primary" :loading="editOrgLoading" @click="submitEditOrgForm"
> </el-button
>
<el-button @click="handleCloseEditOrg"> </el-button>
</div>
</template>
</el-dialog>
</template>
<style lang='scss' scoped>
</style>
<style lang="scss" scoped></style>

Loading…
Cancel
Save