@@ -135,24 +135,13 @@ const close = () => {
modalVisible.value = false;
}
const handleConfirm = () => {
- // if(numTime.value >= 10){
- // message.error('提交审批次数已达上限')
- // return
- // }
- // numTime.value+=1
- // localStorage.setItem('numTime',numTime.value)
- // 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('暂无可提交的数据')
- // }
modalVisible.value = false;
emit('example',true)
+ const idList = []
+ activeList.value?.map(item=>{
+ idList.push(...timesList.value[item])
+ })
+ const ids = idList?.map(item=>item.id)
api.teacherExpenseConfirm({ids:ids?.join(',')}).then(res=>{
console.log(res,'resssss')
api.submitApproval({ids:res.data?.data?.join(',')}).then(res=>{
@@ -184,13 +173,13 @@ const expenseList = ref([])
const searchList = ref([])
const timesList = ref([])
const clickItem = (item,i) => {
- expenseList.value = item.expenseList
indexList.value = i
- resetData()
+ resetData(i,false)
}
const pageHeight = computed(() => {
return window.innerHeight - 450
});
+const searchConditions = ref([{ nameUserNo: '', dateValue: [] }])
watch(()=>props.visible,(val)=>{
if(val){
loadingData.value = true
@@ -207,17 +196,21 @@ watch(()=>props.visible,(val)=>{
).then(res=>{
if(res.data.code === 200){
forData.value = res.data.data
- expenseList.value = res.data.data[indexList.value]?.expenseList || []
+ forData.value.forEach((item,i) => {
+ searchConditions.value.push({ nameUserNo: '', dateValue: [] });
+ expenseList.value.push(forData.value[i]?.expenseList || [])
+ timesList.value.push(forData.value[i]?.expenseList || [])
+ });
}
loadingData.value = false
- resetData()
- }).catch(()=>{
+ resetData(indexList.value,true)
+ }).catch((err)=>{
message.error('获取数据失败,请重新尝试')
loadingData.value = false
})
}else{
- nameUserNo.value = null
- dateValue.value = null
+ searchConditions.value = [{ nameUserNo: '', dateValue: [] }]
+ timesList.value = []
indexList.value = 0
activeList.value = []
drawerContent.value?.$el.querySelector('.ant-table-body')?.scrollTo({top:0,behavior: 'smooth'})
@@ -235,11 +228,10 @@ const removeId = (e,i) =>{
})
})
if(searchTrue.value){
- // searchList.value = searchList.value.filter(item=>item.id !== e.id)
- timesList.value = timesList.value.filter(item=>item.id !== e.id)
- expenseList.value = expenseList.value.filter(item=>item.id !== e.id)
+ timesList.value[indexList.value] = timesList.value[indexList.value].filter(item=>item.id !== e.id)
+ expenseList.value[indexList.value] = expenseList.value[indexList.value].filter(item=>item.id !== e.id)
}else{
- expenseList.value = expenseList.value.filter(item=>item.id !== e.id)
+ expenseList.value[indexList.value] = expenseList.value[indexList.value].filter(item=>item.id !== e.id)
}
forData.value[indexList.value].summaryTotal = (forData.value[indexList.value]?.summaryTotal - e.expense).toFixed(2)
if(!forData.value[indexList.value].expenseList.length){
@@ -249,8 +241,6 @@ const removeId = (e,i) =>{
}
})
}
-const nameUserNo = ref(null)
-const dateValue = ref(null)
const searchTrue = ref(false)
const drawerContent = ref(null)
const customRow = (record) => {
@@ -261,7 +251,7 @@ const customRow = (record) => {
};
};
let timeout = null
-const searchData = (val) => {
+const searchData = (val,index) => {
searchTrue.value = val
loadingData.value = true
if (timeout) {
@@ -269,43 +259,32 @@ const searchData = (val) => {
}
timeout = setTimeout(() => {
loadingData.value = false;
- if(!nameUserNo.value&&!dateValue.value){
+ const { nameUserNo, dateValue } = searchConditions.value[index];
+ if(!nameUserNo&&!dateValue.length){
searchList.value = [];
- timesList.value = expenseList.value
- forData.value[indexList.value].summaryTotal = expenseList.value.reduce((sum, item) => sum + (Number(item.expense) || 0), 0);
+ timesList.value[indexList.value] = expenseList.value[indexList.value]
+ forData.value[indexList.value].summaryTotal = expenseList.value[indexList.value].reduce((sum, item) => sum + (Number(item.expense) || 0), 0);
return
}
- //搜索 数组expenseList.value 参数名字或者工号:nameUserNo.value 日期:dateValue.value
- // const filteredList = expenseList.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;
- // });
- const timesLists = expenseList.value.filter(item => {
+ const timesLists = expenseList.value[indexList.value].filter(item => {
const teachingDateTimestamp = new Date(item.teachingDate).getTime();
- if(dateValue.value==null){
- return expenseList.value
+ if(dateValue==null||!dateValue.length){
+ return expenseList.value[indexList.value]
}
- const startDateTimestamp = new Date(dateValue.value[0]).getTime();
- const endDateTimestamp = new Date(dateValue.value[1]).getTime();
+ const startDateTimestamp = new Date(dateValue[0]).getTime();
+ const endDateTimestamp = new Date(dateValue[1]).getTime();
const isDateInRange = teachingDateTimestamp >= startDateTimestamp && teachingDateTimestamp <= endDateTimestamp;
return isDateInRange;
});
const filteredList = timesLists.filter(item => {
- const isNameMatch = (item.name + item.userNo).includes(nameUserNo.value);
+ if(!nameUserNo){
+ return
+ }
+ const isNameMatch = (item.name + item.userNo).includes(nameUserNo);
return isNameMatch
});
searchList.value = filteredList;
- timesList.value = timesLists
+ timesList.value[indexList.value] = timesLists
forData.value[indexList.value].summaryTotal = timesLists.reduce((sum, item) => sum + (Number(item.expense) || 0), 0);
let scrollHeight = null
filteredList.length && (scrollHeight = timesLists.findIndex(item => item.id === filteredList[0].id))
@@ -314,10 +293,9 @@ const searchData = (val) => {
}
}, 500);
}
-const resetData = () => {
- nameUserNo.value = null
- dateValue.value = null
- searchData(false)
+const resetData = (index,val) => {
+ val && (searchConditions.value[index] = { nameUserNo: '', dateValue: [] });
+ searchData(true,index);
}
const emit = defineEmits(['update:visible'])
const columns = [
@@ -341,6 +319,7 @@ const columns = [
key: 'courseName',
align: 'left',
width:160,
+ ellipsis:true,
customCell :() => {return {style: {maxWidth: '200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis',cursor:'pointer'}}},
},
{
@@ -486,24 +465,19 @@ const columns = [
const closeDrawer = () => emit("update:visible", false);
const activeList = ref([])
const setList = (item) => {
- const index = activeList.value.findIndex(listItem => listItem === item.trainOrgId);
+ const index = activeList.value.findIndex(listItem => listItem === item);
if (index > -1) {
activeList.value.splice(index, 1);
} else {
- activeList.value.push(item.trainOrgId);
+ activeList.value.push(item);
}
}
const qureyDrawer = () => {
- const filterList = forData.value.filter(item=>{
- return activeList.value.includes(item.trainOrgId)
+ const idList = []
+ activeList.value?.map(item=>{
+ idList.push(...timesList.value[item])
})
- const ids = filterList?.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)
- // }
+ const ids = idList?.map(item=>item.id)
if(!ids.length){
return message.error('暂无可提交的数据')
}
@@ -528,23 +502,15 @@ const qureyDrawer = () => {
})
}
const config = () => {
- const filterList = forData.value.filter(item=>{
- return activeList.value.includes(item.trainOrgId)
+ const idList = []
+ activeList.value?.map(item=>{
+ idList.push(...timesList.value[item])
})
- const ids = filterList?.flatMap(item => item.expenseList?.map(item => item.id));
+ const ids = idList?.map(item=>item.id)
if(!ids.length){
message.error('暂无可提交的数据')
return
}
- // 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('暂无可提交的数据')
- // }
modalVisible.value = true;
}
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 92407261..86fe5564 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -57,6 +57,12 @@ export function checkOwner(per) {
export function checkMenu(path = "") {
return store?.state?.menus.some(t => path.split(",").some(s => "/" + s === t));
}
+export function checkBtn(path = "") {
+ return store?.state?.menus.some(t => path.split(",").some(s => s === t));
+}
+export function lecturerRoute(path = []) {
+ return path.split(",").findIndex(t => store?.state?.menus.some(s => s === "/" + t));
+}
export function checkOrgs(){
return store?.state?.userInfoOrgs.length > 0
}
diff --git a/src/views/lecturer/InsideLecturer.vue b/src/views/lecturer/InsideLecturer.vue
index b84cb365..bcd146df 100644
--- a/src/views/lecturer/InsideLecturer.vue
+++ b/src/views/lecturer/InsideLecturer.vue
@@ -90,7 +90,7 @@
handleLook(record, String(record.courseform))">查看
- handleModify(record, String(record.courseform))">编辑
+ handleModify(record, String(record.courseform))">编辑
handleOperate(record, String(record.courseform))">停用
+
+
+
+
-
+
@@ -99,13 +105,13 @@
导入
-
-
+
+
一键确认讲师费
-
+
批量确认讲师费
@@ -117,12 +123,13 @@
+ {{record.status==0?'停用':'启用'}}
handleLook(record, String(record.courseform))">查看
- handleModify(record, String(record.courseform))">编辑
+ handleModify(record, String(record.courseform))">编辑
-
+ 删除
@@ -283,7 +290,7 @@
/>
费用类型
-
@@ -305,7 +312,7 @@
-
+
@@ -326,7 +333,7 @@
v-model:value="formParam.sourceBelongId"
v-model:name="formParam.sourceBelongFullName"
> -->
-
@@ -341,7 +348,7 @@
/>
{{formParam.courseType==2?'课程':'授课'}}日期 :
-
@@ -376,7 +383,7 @@
/>
参训人数
-
@@ -394,7 +401,7 @@
/>
评分
-
@@ -528,7 +535,7 @@
{{formParam.expense?formParam.expense+'元': '-'}}
-
{{{0:'待确认' ,1:'待提交' ,2:'审核中', 3:'审核通过', 4:'审核拒绝',5:'待提交'}[formParam?.status]}}
+
{{{0:'待确认' ,1:'待提交' ,2:'审核中', 3:'审核通过', 4:'审核拒绝',5:'停用'}[formParam?.status]}}
{{formParam.remark || '-'}}
@@ -583,7 +590,7 @@
import ImportWork from "../../components/lecturer/ImportWork.vue";
import SearchTeacher from "@/components/project/SearchTeacher";
import {getTeacherFeeList,getTeacherFeeDetail,getListByTeacherExpenseId,addTeacherFee ,getListByIds,updateTeacherFee,updateStatusSubmit,approveTeacherFee,getTeacherLevel,deleteInTeacher,confirm} from "../../api/lecturerFeeManagement";
- import {getTeacherSystemList, getAllLevelList,getPayRollPlace,fileUp,submitApproval } from "../../api/Lecturer";
+ import {getTeacherSystemList, getAllLevelList,getPayRollPlace,fileUp,submitApproval,deleteLecturerFee,updateLecturerFee } from "../../api/Lecturer";
// lecturerFeeManagement
// import {getProjSt} from "../../api/indexProjStu";
// import AddTeacher from "../../components/drawers/project/AddTeacher"
@@ -661,6 +668,7 @@
name:null,
trainOrgId:null,
tSystemId:null,
+ courseName: null,
tLevelName:null,
courseType:null,
certStatus:null,
@@ -840,7 +848,7 @@ getAllLevelList().then((res) => {
state.moreid=1
// state.searchParam.certStatus=null
// state.searchParam.salaryName=null
- // state.searchParam.status=null
+ state.searchParam.status=null
state.searchParam.tSystemId = null
state.searchParam.tLevelName = null
}
@@ -1051,7 +1059,7 @@ getAllLevelList().then((res) => {
"2": "审核中",
"3": "审核通过",
'4': '审核拒绝',
- '5': '待提交',
+ '5': '停用',
}[value.record.status + ""] || ""
: "-"}
@@ -1102,7 +1110,7 @@ getAllLevelList().then((res) => {
key: 'operation',
ellipsis: true, align: "center",
fixed: "right",
- width: 160,
+ width: 180,
scopedSlots: { customRender: "action" },
},
@@ -1125,6 +1133,7 @@ getAllLevelList().then((res) => {
beginTime:null,
userNo:null,
tSystemId:null,
+ courseName: null,
tLevelName:null,
courseType:null,
certStatus:null,
@@ -1275,10 +1284,43 @@ getAllLevelList().then((res) => {
}
};
//删除弹窗
- // const deleteModal = (record) => {
- // state.deleteInTeacherdialog = true
- // state.delTeacherId = record.id
- // };
+ const deleteModal = (record) => {
+ dialog({
+ content: '是否确认进行删除?',
+ ok: () => {
+ deleteLecturerFee({id:record.id}).then(res=>{
+ if(typeof (res.data.data) != 'object'){
+ message.error(res.data.data)
+ return
+ }
+ message.success("删除成功");
+ searchSubmit()
+ }).catch(err=>{
+ message.destroy()
+ message.error(err.data.msg)
+ })
+ }
+ })
+ };
+ const updateModal = (record) => {
+ dialog({
+ content: `是否确认${record.status == 5 ? '启用':'停用'}?`,
+ ok: () => {
+ const status = record.status ==0 ? 5 : 0
+ updateLecturerFee({id:record.id,status}).then(res=>{
+ if(typeof (res.data.data) != 'object'){
+ message.error(res.data.data)
+ return
+ }
+ message.success(`${status == 0 ? '启用':'停用'}成功`);
+ searchSubmit()
+ }).catch(err=>{
+ message.destroy()
+ message.error(err.data.msg)
+ })
+ }
+ })
+ }
//修改状态窗口
const handleOperate = (record) => {
dialog({
@@ -1742,7 +1784,7 @@ const column = ref([
"2": "审核中",
"3": "审核通过",
'4': '审核拒绝',
- '5': '待提交',
+ '5': '停用',
}[value.record.status + ""] || ""
: "-"}
@@ -1787,7 +1829,7 @@ const column = ref([
const handleExport = ()=>{
window.open (
`${process.env.VUE_APP_BASE_API}/admin/export/exportTeacherExpense?name=${state.searchParam.name || ""
- }&status=${ state.searchParam.status || ""}&trainOrgId=${ state.searchParam.trainOrgId || ""}&type=${state.searchParam.type || ""}&tSystemId=${ state.searchParam.tSystemId || ""}&tLevelName=${ state.searchParam.tLevelName || ""}&beginTime=${state.searchParam.beginTime || ""}&endTime=${state.searchParam.endTime || ""}`
+ }&status=${ state.searchParam.status || ""}&trainOrgId=${ state.searchParam.trainOrgId || ""}&type=${state.searchParam.type || ""}&courseName=${ state.searchParam.courseName || ""}&tSystemId=${ state.searchParam.tSystemId || ""}&tLevelName=${ state.searchParam.tLevelName || ""}&beginTime=${state.searchParam.beginTime || ""}&endTime=${state.searchParam.endTime || ""}`
);
// this.download('lesson_records/export', {
// ...state.searchParam
@@ -1866,7 +1908,8 @@ const column = ref([
handleLook,
orgSplit,
cancel,
- // deleteModal,
+ deleteModal,
+ updateModal,
handleModify,
// closeDeleteTeacher,
createTeacherDialog,
diff --git a/src/views/lecturer/MonthlyStatistics.vue b/src/views/lecturer/MonthlyStatistics.vue
index 3151ab0d..a4fe3608 100644
--- a/src/views/lecturer/MonthlyStatistics.vue
+++ b/src/views/lecturer/MonthlyStatistics.vue
@@ -69,6 +69,9 @@
-->
+