讲师管理bug

This commit is contained in:
zhangsir
2025-01-08 11:50:21 +08:00
parent 245a3a763d
commit cad23a1599
7 changed files with 92 additions and 16 deletions

View File

@@ -77,6 +77,10 @@ import * as lecturerApi from "@/api/Lecturer.js";
AddContentList:{
type:Array,
default: ()=>[],
},
isParent:{
type:String,
default: '',
}
})
const emit = defineEmits({})
@@ -119,7 +123,7 @@ import * as lecturerApi from "@/api/Lecturer.js";
});
const notLists = ref([])
const getNot = () => {
lecturerApi.getUnSelectOrg().then(res=>{
lecturerApi.getUnSelectOrg(props.isParent).then(res=>{
if(res.data.code == 200){
notLists.value = res.data.data
}
@@ -144,7 +148,10 @@ import * as lecturerApi from "@/api/Lecturer.js";
const onCheck = async (checkedKey, {checked: bool, checkedNodes, node, event}) => {
// "965356037047586816"
let length = treeAddData.value.length
if(checkedNodes.length > length){
const checkedNodeIds = checkedNodes.map(item => item.id);
const treeAddDataOrgIds = treeAddData.value.map(item => item.orgId);
const combinedUniqueIds = [...new Set([...checkedNodeIds, ...treeAddDataOrgIds])];
if(combinedUniqueIds.length > length){
await lecturerApi.getSelectOrg(node.id).then(res=>{
const targetNode = checkedNodes.find(item=>item.id == res?.data?.data[0]?.orgId)
if(targetNode){

View File

@@ -27,6 +27,7 @@
<div class="org" :title="item?.trainOrgName">{{item?.trainOrgName||'-'}}</div>
<div class="text org" :title="Number(item?.summaryTotal).toFixed(2)">{{item?.summaryTotal?Number(item?.summaryTotal).toFixed(2)+'元':'-'}}</div>
</div>
<div class="icon" :class="activeList.includes(item.trainOrgId)?'active':'not'" @click.stop="setList(item)"></div>
</div>
</div>
<div class="box">
@@ -140,16 +141,16 @@ const handleConfirm = () => {
// }
// numTime.value+=1
// localStorage.setItem('numTime',numTime.value)
const ids = forData.value.flatMap(item => item.expenseList.map(item => item.id));
// const ids = forData.value.flatMap(item => item.expenseList.map(item => item.id));
// let ids = []
// if(searchTrue.value){
// ids = timesList.value.map(item=>item.id)
// }else{
// ids = expenseList.value.map(item=>item.id)
// }
if(!ids.length){
return message.error('暂无可提交的数据')
}
// if(!ids.length){
// return message.error('暂无可提交的数据')
// }
modalVisible.value = false;
emit('example',true)
api.teacherExpenseConfirm({ids:ids?.join(',')}).then(res=>{
@@ -218,6 +219,7 @@ watch(()=>props.visible,(val)=>{
nameUserNo.value = null
dateValue.value = null
indexList.value = 0
activeList.value = []
drawerContent.value?.$el.querySelector('.ant-table-body')?.scrollTo({top:0,behavior: 'smooth'})
}
})
@@ -482,8 +484,20 @@ const columns = [
},
]
const closeDrawer = () => emit("update:visible", false);
const activeList = ref([])
const setList = (item) => {
const index = activeList.value.findIndex(listItem => listItem === item.trainOrgId);
if (index > -1) {
activeList.value.splice(index, 1);
} else {
activeList.value.push(item.trainOrgId);
}
}
const qureyDrawer = () => {
const ids = forData.value.flatMap(item => item.expenseList.map(item => item.id));
const filterList = forData.value.filter(item=>{
return activeList.value.includes(item.trainOrgId)
})
const ids = filterList?.flatMap(item => item.expenseList?.map(item => item.id));
// let ids = []
// if(searchTrue.value){
// ids = timesList.value.map(item=>item.id)
@@ -493,7 +507,6 @@ const qureyDrawer = () => {
if(!ids.length){
return message.error('暂无可提交的数据')
}
console.log(ids,'idssssss')
dialog({
content: '是否确认讲师费信息无误?提交后按“培训发生组织”汇总至审批中心,等待验证后“提交”进入审批流程。',
ok: () => {
@@ -515,7 +528,11 @@ const qureyDrawer = () => {
})
}
const config = () => {
if(!expenseList.value.length){
const filterList = forData.value.filter(item=>{
return activeList.value.includes(item.trainOrgId)
})
const ids = filterList?.flatMap(item => item.expenseList?.map(item => item.id));
if(!ids.length){
message.error('暂无可提交的数据')
return
}
@@ -679,7 +696,7 @@ const config = () => {
justify-content: space-between;
align-items: center;
// background-color: red;
margin-bottom: 20px;
// margin-bottom: 20px;
.headerTitle {
margin: 24px 0;
@@ -696,6 +713,7 @@ const config = () => {
display: flex;
align-items: center;
overflow-x: auto;
padding-top: 20px;
.list{
display: flex;
align-items: center;
@@ -706,6 +724,25 @@ const config = () => {
border-radius:6px;
margin-right: 20px;
margin-bottom: 20px;
position: relative;
.icon{
position: absolute;
right: -10px;
top: -10px;
width:24px;
height:24px;
cursor: pointer;
// background: url('@/assets/icon.png') no-repeat;
// background-size: 100% 100%;
}
.active{
background: url('@/assets/icon.png') no-repeat;
background-size: 100% 100%;
}
.not{
background: url('@/assets/iconnot.png') no-repeat;
background-size: 100% 100%;
}
.left{
width: 35%;
min-width: 86px;