Merge branch '250213-prod-master_1202-gx' into test20250220

This commit is contained in:
gengxin
2025-02-21 15:36:18 +08:00
2 changed files with 236 additions and 187 deletions

View File

@@ -23,8 +23,14 @@ export const importTeacherCourseRecord = (obj) => http.post('/importTeacherCours
export const getAddress = (obj) => http.post('/admin/teacher/getAddress', obj) export const getAddress = (obj) => http.post('/admin/teacher/getAddress', obj)
//讲师费发放情况 //讲师费发放情况
export const getCharges = (obj) => http.post('/teacher/fee/getCharges', obj) export const getCharges = (obj) => http.post('/teacher/fee/getCharges', obj)
//讲师费发放情况
export const exportTeacherExpense = (obj) => http.get('/admin/export/exportTeacherExpense', {params: obj})
//上传组件 //上传组件
export const teacherUpload = (data) => export const teacherUpload = (data) =>
http.post("/admin/teacher/teacherUpload", data, { http.post("/admin/teacher/teacherUpload", data, {
headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") }, headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") },
}); });

View File

@@ -22,7 +22,11 @@
<div class="main"> <div class="main">
<div class="minatitl"> <div class="minatitl">
<div class="up1">请下载</div> <div class="up1">请下载</div>
<div class="up2" @click="downTemplate" style="cursor: pointer"> <div
class="up2"
@click="downTemplate"
style="cursor: pointer"
>
模板 模板
</div> </div>
<div class="up1">按要求填写数据并导入</div> <div class="up1">按要求填写数据并导入</div>
@@ -31,18 +35,28 @@
<div class="text">上传</div> <div class="text">上传</div>
<div class="right"> <div class="right">
<div style="height: 176px; margin-bottom: 20px"> <div style="height: 176px; margin-bottom: 20px">
<a-upload-dragger v-model:fileList="fileList" :action="importHomeWork" name="uploadFile" <a-upload-dragger
v-model:fileList="fileList"
:action="importHomeWork"
name="uploadFile"
:headers="headers" :headers="headers"
@change="handleChange" :showUploadList="false"> @change="handleChange"
:showUploadList="false"
>
<p class="ant-upload-drag-icon"> <p class="ant-upload-drag-icon">
<inbox-outlined></inbox-outlined> <inbox-outlined></inbox-outlined>
</p> </p>
<p class="ant-upload-text">点击或将文件拖拽到此处上传</p> <p class="ant-upload-text">
点击或将文件拖拽到此处上传
</p>
<p class="ant-upload-hint">支持扩展名.xls/.xlsx</p> <p class="ant-upload-hint">支持扩展名.xls/.xlsx</p>
</a-upload-dragger> </a-upload-dragger>
</div> </div>
<div class="loadstate"> <div class="loadstate">
<div class="loadborder" v-if="uploadpercent < 100 && uploadpercent !== -1"> <div
class="loadborder"
v-if="uploadpercent < 100 && uploadpercent !== -1"
>
<div class="content"> <div class="content">
<div class="img"></div> <div class="img"></div>
<div class="timebox"> <div class="timebox">
@@ -52,8 +66,7 @@
</div> </div>
<a-progress :percent="uploadpercent" /> <a-progress :percent="uploadpercent" />
</div> </div>
<div class="curloading"> <div class="curloading"></div>
</div>
</div> </div>
</div> </div>
<div class="loadborder" v-if="uploadErr"> <div class="loadborder" v-if="uploadErr">
@@ -90,7 +103,11 @@
<a-progress :percent="uploadpercent" /> <a-progress :percent="uploadpercent" />
</div> </div>
<div class="curloading"> <div class="curloading">
<div class="cancel" style="margin-left: 20px; cursor: pointer" @click="removeUpload"> <div
class="cancel"
style="margin-left: 20px; cursor: pointer"
@click="removeUpload"
>
删除 删除
</div> </div>
</div> </div>
@@ -101,23 +118,41 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="uploadpercent === 100" class="defeat" style=" <div
v-if="uploadpercent === 100"
class="defeat"
style="
display: flex; display: flex;
align-items: center; align-items: center;
width: 500px; width: 500px;
height: 40px;" :style="{ height: 40px;
"
:style="{
background: errNum background: errNum
? 'rgba(255, 116, 116, 0.1)' ? 'rgba(255, 116, 116, 0.1)'
: 'rgba(53, 174, 105, 0.1)', : 'rgba(53, 174, 105, 0.1)',
border: errNum ? '1px solid #ff7474' : '1px solid #35AE69', border: errNum
}"> ? '1px solid #ff7474'
<img style="width: 14px; height: 14px; margin-left: 16px" :src=" : '1px solid #35AE69',
}"
>
<img
style="width: 14px; height: 14px; margin-left: 16px"
:src="
errNum errNum
? require('../../assets/images/err.png') ? require('../../assets/images/err.png')
: require('../../assets/images/success.png') : require('../../assets/images/success.png')
" /> "
<div style="margin-left: 8px" :style="{ color: errNum ? '#ff7474' : 'rgba(0,0,0,0.65)' }"> />
{{ succNum }}条数据导入成功{{ errNum }}条数据导入失败 <div
style="margin-left: 8px"
:style="{
color: errNum ? '#ff7474' : 'rgba(0,0,0,0.65)',
}"
>
{{ succNum }}条数据导入成功{{
errNum
}}条数据导入失败
</div> </div>
</div> </div>
</div> </div>
@@ -137,16 +172,15 @@
</template> </template>
<script> <script>
import { reactive, toRefs, watch,ref,computed } from "vue"; import { reactive, toRefs, watch, ref, computed } from "vue";
import { exportTeacherExpense } from "../../api/Teaching";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { useStore } from "vuex"; import { useStore } from "vuex";
import * as api from "../../api/index1"; import * as api from "../../api/index1";
import {getCookieForName} from "@/api/method"; import { getCookieForName } from "@/api/method";
export default { export default {
name: "importWork", name: "importWork",
components: { components: {},
},
props: { props: {
showWork: { showWork: {
type: Boolean, type: Boolean,
@@ -156,11 +190,11 @@ import {getCookieForName} from "@/api/method";
type: String, type: String,
default: null, default: null,
}, },
title:{ title: {
type: String, type: String,
default: null, default: null,
}, },
template:{ template: {
type: String, type: String,
default: null, default: null,
}, },
@@ -168,8 +202,7 @@ import {getCookieForName} from "@/api/method";
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
fileType: ["xls", "xlsx"], fileType: ["xls", "xlsx"],
importHomeWork: importHomeWork: process.env.VUE_APP_BASE_API + props.url,
process.env.VUE_APP_BASE_API + props.url,
uploadpercent: -1, uploadpercent: -1,
uploadErr: false, //上传失败 uploadErr: false, //上传失败
addLoading: false, addLoading: false,
@@ -213,20 +246,20 @@ import {getCookieForName} from "@/api/method";
state.uploadpercent = parseInt(info.file.percent); state.uploadpercent = parseInt(info.file.percent);
console.log("我是文件上传的进度---------->", info.file.percent); console.log("我是文件上传的进度---------->", info.file.percent);
const status = info.file.status; const status = info.file.status;
console.log(info.file,'status') console.log(info.file, "status");
if (status !== "uploading") { if (status !== "uploading") {
// console.log(info.file, info.fileList); // console.log(info.file, info.fileList);
} }
if (status === "done") { if (status === "done") {
state.fileName = info.file.name; state.fileName = info.file.name;
if(info.file.response.code == 200){ if (info.file.response.code == 200) {
state.succNum = Number(info.file.response.data.success); state.succNum = Number(info.file.response.data.success);
state.errNum = Number(info.file.response.data.failed); state.errNum = Number(info.file.response.data.failed);
state.downloadErrUrl = info.file.response.data.path; state.downloadErrUrl = info.file.response.data.path;
}else{ } else {
state.uploadErr = true; state.uploadErr = true;
state.fileList = []; state.fileList = [];
state.uploadpercent = -1 state.uploadpercent = -1;
message.destroy(); message.destroy();
message.error(info.file.response.msg); message.error(info.file.response.msg);
} }
@@ -296,7 +329,17 @@ import {getCookieForName} from "@/api/method";
}; };
function downTemplate() { function downTemplate() {
// window.open(`${process.env.VUE_APP_BOE_API_URL}/upload/template/${props.template}`); // window.open(`${process.env.VUE_APP_BOE_API_URL}/upload/template/${props.template}`);
window.open(`${process.env.VUE_APP_BOE_API_URL}/admin/export/exportExpenseTemplate`); exportTeacherExpense({})
.then((res) => {
console.log("exportTeacherExpense res",res)
})
.catch((err) => {
console.error("downTemplate err", err);
});
window.open(
`${process.env.VUE_APP_BOE_API_URL}/admin/export/exportExpenseTemplate`
);
} }
return { return {
@@ -309,7 +352,7 @@ import {getCookieForName} from "@/api/method";
downloadEeeorData, downloadEeeorData,
}; };
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -361,12 +404,12 @@ import {getCookieForName} from "@/api/method";
background-size: 100% 100%; background-size: 100% 100%;
} }
} }
.line{ .line {
height: 1px; height: 1px;
margin-top: 16px; margin-top: 16px;
background-color: #f0f0f0; background-color: #f0f0f0;
} }
.contents{ .contents {
display: flex; display: flex;
min-height: 500px; min-height: 500px;
.drawerMain { .drawerMain {