mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-22 17:26:46 +08:00
讲师管理bug
This commit is contained in:
@@ -18,10 +18,22 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="box">
|
<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 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;">
|
<div class="table" style="padding-bottom:72px;">
|
||||||
<a-table
|
<a-table
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data-source="tableData"
|
:data-source="searchTrue?searchList:tableData"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
:scroll="{ x: 'max-content' }"
|
:scroll="{ x: 'max-content' }"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
@@ -78,6 +90,38 @@ watch(()=>props.visible,(val)=>{
|
|||||||
selectsData.value = []
|
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 loading = ref(false)
|
||||||
const selectedRowKeys = ref([])
|
const selectedRowKeys = ref([])
|
||||||
const selectsData = ref([]);
|
const selectsData = ref([]);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="top">
|
<!-- <div class="top">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<a-input @pressEnter="searchData(true)" style="border-radius: 8px;width:240px;height: 40px;" v-model:value="nameUserNo" placeholder="请输入工号/讲师名称进行搜索" allowClear />
|
<a-input @pressEnter="searchData(true)" style="border-radius: 8px;width:240px;height: 40px;" v-model:value="nameUserNo" placeholder="请输入工号/讲师名称进行搜索" allowClear />
|
||||||
</div>
|
</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="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>
|
<a-button type="primary" @click="resetData()" style="border-radius:8px;width: 100px;height: 40px;">重置</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="table">
|
<div class="table">
|
||||||
<a-table
|
<a-table
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
|||||||
@@ -396,14 +396,14 @@ export default{
|
|||||||
width: 200,
|
width: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '根节点名称',
|
title: '是否为根节点名称',
|
||||||
dataIndex: 'parentName',
|
dataIndex: 'parentName',
|
||||||
key: 'parentName',
|
key: 'parentName',
|
||||||
ellipsis: true, align: "center",
|
align: "center",
|
||||||
width: 200,
|
width: 200,
|
||||||
customRender: ({text})=>{
|
customRender: ({text,record})=>{
|
||||||
return (
|
return (
|
||||||
text || '-'
|
text ? <div>否({text})</div> : <div>是({{1:'一',2:'二',3:'三'}[record.code]}级审批)</div>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user