Browse Source

修改人员选取范围

qin_24
herenshan112 3 months ago
parent
commit
fac2d15d4f
  1. 14
      src/views/hr/company/companyduty.vue
  2. 232
      src/views/hr/company/savePage copy.vue
  3. 71
      src/views/hr/company/savePage.vue
  4. 196
      vite.config.ts.timestamp-1755149733847-ba4fb4e590f87.mjs

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

@ -144,7 +144,7 @@ watch(
</template> </template>
<div class="deep_card__body"> <div class="deep_card__body">
<table> <table>
<tr> <tr class="tabelFirst">
<td></td> <td></td>
<td <td
align="center" align="center"
@ -237,6 +237,13 @@ watch(
:deep table { :deep table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
th: first-child;
td: first-child;
th:first-child {
z-index: 3;
/*左上角单元格z-index,切记要设置,不然表格纵向横向滚动时会被该单元格右方或者下方的单元格遮挡*/
background: #f4f4f5;
}
th, th,
td { td {
border: 1px solid #ddd; border: 1px solid #ddd;
@ -258,5 +265,10 @@ watch(
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
margin-top: 5px; margin-top: 5px;
} }
.tabelFirst {
position: sticky;
left: 0;
top: 0;
}
} }
</style> </style>

232
src/views/hr/company/savePage copy.vue

@ -0,0 +1,232 @@
<!--
@ 作者: 秦东
@ 时间: 2025-08-12 15:48:52
@ 备注: 编辑排班记录
-->
<script lang="ts" setup>
import { geiOrgAllPeople, saveEditDutyInfo, getDutyCont } from "@/api/hr/paiban/index";
import { get_org } from "@/api/opk/zxy/news/api";
const props = defineProps({
isOpen: {
type: Boolean,
default: false,
},
cumpanyId: {
type: Number,
default: "",
},
dutyCont: {
type: Object,
default() {
return {};
},
},
});
const loading = ref(false);
const emits = defineEmits(["update:isOpen", "pickRefresh"]);
const isShow = computed({
get() {
// console.log("",props.isOpen);
return props.isOpen;
},
set(val: boolean) {
// console.log("",props.isOpen);
emits("update:isOpen", val);
},
});
const currtOrg = ref(props.cumpanyId);
const saveInfo = ref(props.dutyCont);
const orgPeopleList = ref([]);
//
const closeSavePage = () => {
emits("update:isOpen", false);
};
//
watch(
() => props.isOpen,
(val: boolean) => {
if (val) {
getOrgPeople();
}
},
{
deep: true,
}
);
//
const getOrgPeople = () => {
loading.value = true;
getDutyCont({ id: saveInfo.value.id.toString() }).then((res) => {
console.log("获取单一排版信息", res);
saveInfo.value.allDay = res.data.allDayAry;
saveInfo.value.baiTian = res.data.baiTianAry;
saveInfo.value.night = res.data.nightAry;
});
// if (saveInfo.value.isCompany == 1) {
get_org({
id: currtOrg.value.toString(),
all: 1,
})
.then((res: any) => {
console.log("获取行政组织人员信息get_org", res);
orgPeopleList.value = res.data;
loading.value = false;
})
.finally(() => {
loading.value = false;
});
// } else {
// geiOrgAllPeople({
// orgId: saveInfo.value.orgid * 1,
// companyId: currtOrg.value * 1,
// isAll: saveInfo.value.isCompany * 1,
// })
// .then((res: any) => {
// console.log("geiOrgAllPeople", res);
// orgPeopleList.value = res.data;
// loading.value = false;
// })
// .finally(() => {
// loading.value = false;
// });
// }
};
//
const saveCenter = () => {
console.log("提交数据", saveInfo.value);
saveInfo.value.holiday = saveInfo.value.holiday.toString();
saveEditDutyInfo(saveInfo.value).then((res: any) => {
closeSavePage();
emits(
"pickRefresh",
props.cumpanyId,
saveInfo.value.years,
saveInfo.value.month,
saveInfo.value.orgid
);
});
};
const orgTreeProps = {
children: "child",
label: "name",
}; //
</script>
<template>
<el-dialog
v-model="isShow"
:title="
saveInfo.years + '年' + saveInfo.month + '月' + saveInfo.days + '日编辑值班信息'
"
width="500"
:before-close="closeSavePage"
>
<el-form ref="ruleFormRef" :model="saveInfo">
<el-form-item label="行政组织" prop="orgname">
<el-input v-model="saveInfo.orgname" disabled />
</el-form-item>
<el-form-item label="节假日" prop="holiday">
<el-switch
v-model="saveInfo.holiday"
active-value="1"
inline-prompt
inactive-value="2"
active-text="是"
inactive-text="否"
/>
</el-form-item>
<el-form-item v-if="saveInfo.holiday == 1" label="白天" prop="baiTian">
<el-tree-select
v-if="saveInfo.isCompany == 1"
v-model="saveInfo.baiTian"
:data="orgPeopleList"
multiple
clearable
filterable
:props="orgTreeProps"
node-key="id"
:render-after-expand="false"
style="width: 300px"
v-loading="loading"
/>
<el-tree-select
v-else
v-model="saveInfo.baiTian"
:data="orgPeopleList"
multiple
clearable
filterable
:props="orgTreeProps"
node-key="userKey"
:render-after-expand="false"
style="width: 300px"
v-loading="loading"
/>
</el-form-item>
<el-form-item v-if="saveInfo.holiday == 1" label="夜晚" prop="night">
<el-tree-select
v-if="saveInfo.isCompany == 1"
v-model="saveInfo.night"
:data="orgPeopleList"
multiple
clearable
filterable
:props="orgTreeProps"
node-key="id"
:render-after-expand="false"
style="width: 300px"
v-loading="loading"
/>
<el-tree-select
v-else
v-model="saveInfo.night"
:data="orgPeopleList"
multiple
clearable
filterable
:props="orgTreeProps"
node-key="userKey"
:render-after-expand="false"
style="width: 300px"
v-loading="loading"
/>
</el-form-item>
<el-form-item v-else label="值班" prop="allDay">
<el-tree-select
v-if="saveInfo.isCompany == 1"
v-model="saveInfo.allDay"
:data="orgPeopleList"
multiple
clearable
filterable
:props="orgTreeProps"
node-key="id"
:render-after-expand="false"
style="width: 300px"
v-loading="loading"
/>
<el-tree-select
v-else
v-model="saveInfo.allDay"
:data="orgPeopleList"
multiple
clearable
filterable
:props="orgTreeProps"
node-key="userKey"
:render-after-expand="false"
style="width: 300px"
v-loading="loading"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeSavePage">取消</el-button>
<el-button type="primary" @click="saveCenter"> 确定 </el-button>
</div>
</template>
</el-dialog>
</template>
<style lang="scss" scoped></style>

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

@ -58,40 +58,45 @@ watch(
const getOrgPeople = () => { const getOrgPeople = () => {
loading.value = true; loading.value = true;
getDutyCont({ id: saveInfo.value.id.toString() }).then((res) => { getDutyCont({ id: saveInfo.value.id.toString() })
console.log("获取单一排版信息", res); .then((res) => {
saveInfo.value.allDay = res.data.allDayAry; console.log("获取单一排版信息", res);
saveInfo.value.baiTian = res.data.baiTianAry; saveInfo.value.allDay = res.data.allDayAry;
saveInfo.value.night = res.data.nightAry; saveInfo.value.baiTian = res.data.baiTianAry;
}); saveInfo.value.night = res.data.nightAry;
if (saveInfo.value.isCompany == 1) { saveInfo.value.isCompany = 1;
get_org({
id: currtOrg.value.toString(),
all: 1,
})
.then((res: any) => {
console.log("获取行政组织人员信息get_org", res);
orgPeopleList.value = res.data;
loading.value = false;
})
.finally(() => {
loading.value = false;
});
} else {
geiOrgAllPeople({
orgId: saveInfo.value.orgid * 1,
companyId: currtOrg.value * 1,
isAll: saveInfo.value.isCompany * 1,
}) })
.then((res: any) => { .finally(() => {
console.log("获取行政组织人员信息geiOrgAllPeople", res); console.log("------------>", saveInfo.value.isCompany);
orgPeopleList.value = res.data; if (saveInfo.value.isCompany == 1) {
loading.value = false; get_org({
}) id: props.cumpanyId.toString(),
.finally(() => { all: 1,
loading.value = false; })
}); .then((res: any) => {
} console.log("获取行政组织人员信息get_org", res);
orgPeopleList.value = res.data;
loading.value = false;
})
.finally(() => {
loading.value = false;
});
} else {
geiOrgAllPeople({
orgId: saveInfo.value.orgid * 1,
companyId: currtOrg.value * 1,
isAll: saveInfo.value.isCompany * 1,
})
.then((res: any) => {
console.log("获取行政组织人员信息geiOrgAllPeople", res);
orgPeopleList.value = res.data;
loading.value = false;
})
.finally(() => {
loading.value = false;
});
}
});
}; };
// //
const saveCenter = () => { const saveCenter = () => {

196
vite.config.ts.timestamp-1755149733847-ba4fb4e590f87.mjs

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save