讲师管理bug

This commit is contained in:
zhangsir
2024-12-14 17:08:13 +08:00
parent f13cf1802c
commit ea86a35087
3 changed files with 51 additions and 7 deletions

View File

@@ -18,10 +18,22 @@
<div class="content">
<div class="box">
<div style="margin-bottom: 20px;font-size: 18px;font-weight: 700;">选择讲师费汇总:<span style="color:red;margin-left:20px;">{{payableExpense.toFixed(2)||0}}</span></div>
<div class="top">
<div class="item">
<a-input @pressEnter="searchData(true)" style="border-radius: 8px;width:240px;height: 40px;" v-model:value="nameUserNo" placeholder="请输入工号/讲师名称进行搜索" allowClear />
</div>
<div class="item">
<a-range-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" style="border-radius: 8px;width:360px;height: 40px;" v-model:value="dateValue" />
</div>
<div class="item">
<a-button type="primary" @click="searchData(true)" style="margin-right:20px;border-radius:8px;width: 100px;height: 40px;">搜索</a-button>
<a-button type="primary" @click="resetData()" style="border-radius:8px;width: 100px;height: 40px;">重置</a-button>
</div>
</div>
<div class="table" style="padding-bottom:72px;">
<a-table
:columns="columns"
:data-source="tableData"
:data-source="searchTrue?searchList:tableData"
:pagination="false"
:scroll="{ x: 'max-content' }"
row-key="id"
@@ -78,6 +90,38 @@ watch(()=>props.visible,(val)=>{
selectsData.value = []
}
})
const nameUserNo = ref(null)
const dateValue = ref(null)
const searchTrue = ref(false)
const searchList = ref([])
const resetData = () => {
nameUserNo.value = null
dateValue.value = null
searchData(false)
}
const searchData = (val) => {
searchTrue.value = val
if(!nameUserNo.value&&!dateValue.value){
searchList.value = tableData.value;
return
}
//搜索 数组expenseList.value 参数名字或者工号nameUserNo.value 日期dateValue.value
const filteredList = tableData.value.filter(item => {
const isNameMatch = (item.name + item.userNo).includes(nameUserNo.value);
const teachingDateTimestamp = new Date(item.teachingDate).getTime();
if(dateValue.value==null){
return isNameMatch
}
const startDateTimestamp = new Date(dateValue.value[0]).getTime();
const endDateTimestamp = new Date(dateValue.value[1]).getTime();
const isDateInRange = teachingDateTimestamp >= startDateTimestamp && teachingDateTimestamp <= endDateTimestamp;
if(nameUserNo.value&&startDateTimestamp&&endDateTimestamp){
return isNameMatch && isDateInRange;
}
return isNameMatch || isDateInRange;
});
searchList.value = filteredList;
}
const loading = ref(false)
const selectedRowKeys = ref([])
const selectsData = ref([]);

View File

@@ -30,7 +30,7 @@
</div>
</div>
<div class="box">
<div class="top">
<!-- <div class="top">
<div class="item">
<a-input @pressEnter="searchData(true)" style="border-radius: 8px;width:240px;height: 40px;" v-model:value="nameUserNo" placeholder="请输入工号/讲师名称进行搜索" allowClear />
</div>
@@ -41,7 +41,7 @@
<a-button type="primary" @click="searchData(true)" style="margin-right:20px;border-radius:8px;width: 100px;height: 40px;">搜索</a-button>
<a-button type="primary" @click="resetData()" style="border-radius:8px;width: 100px;height: 40px;">重置</a-button>
</div>
</div>
</div> -->
<div class="table">
<a-table
:columns="columns"

View File

@@ -396,14 +396,14 @@ export default{
width: 200,
},
{
title: '根节点名称',
title: '是否为根节点名称',
dataIndex: 'parentName',
key: 'parentName',
ellipsis: true, align: "center",
align: "center",
width: 200,
customRender: ({text})=>{
customRender: ({text,record})=>{
return (
text || '-'
text ? <div>({text})</div> : <div>({{1:'一',2:'二',3:'三'}[record.code]}级审批)</div>
)
},
},