mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 11:26:45 +08:00
Merge branch '250213-prod-master_1202-gx' into test20250220
This commit is contained in:
@@ -23,8 +23,14 @@ export const importTeacherCourseRecord = (obj) => http.post('/importTeacherCours
|
||||
export const getAddress = (obj) => http.post('/admin/teacher/getAddress', 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) =>
|
||||
http.post("/admin/teacher/teacherUpload", data, {
|
||||
headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") },
|
||||
});
|
||||
|
||||
|
||||
@@ -22,7 +22,11 @@
|
||||
<div class="main">
|
||||
<div class="minatitl">
|
||||
<div class="up1">请下载</div>
|
||||
<div class="up2" @click="downTemplate" style="cursor: pointer">
|
||||
<div
|
||||
class="up2"
|
||||
@click="downTemplate"
|
||||
style="cursor: pointer"
|
||||
>
|
||||
模板
|
||||
</div>
|
||||
<div class="up1">,按要求填写数据并导入</div>
|
||||
@@ -31,18 +35,28 @@
|
||||
<div class="text">上传:</div>
|
||||
<div class="right">
|
||||
<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"
|
||||
@change="handleChange" :showUploadList="false">
|
||||
@change="handleChange"
|
||||
:showUploadList="false"
|
||||
>
|
||||
<p class="ant-upload-drag-icon">
|
||||
<inbox-outlined></inbox-outlined>
|
||||
</p>
|
||||
<p class="ant-upload-text">点击或将文件拖拽到此处上传</p>
|
||||
<p class="ant-upload-text">
|
||||
点击或将文件拖拽到此处上传
|
||||
</p>
|
||||
<p class="ant-upload-hint">支持扩展名:.xls/.xlsx</p>
|
||||
</a-upload-dragger>
|
||||
</div>
|
||||
<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="img"></div>
|
||||
<div class="timebox">
|
||||
@@ -52,8 +66,7 @@
|
||||
</div>
|
||||
<a-progress :percent="uploadpercent" />
|
||||
</div>
|
||||
<div class="curloading">
|
||||
</div>
|
||||
<div class="curloading"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="loadborder" v-if="uploadErr">
|
||||
@@ -90,7 +103,11 @@
|
||||
<a-progress :percent="uploadpercent" />
|
||||
</div>
|
||||
<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>
|
||||
@@ -101,23 +118,41 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="uploadpercent === 100" class="defeat" style="
|
||||
<div
|
||||
v-if="uploadpercent === 100"
|
||||
class="defeat"
|
||||
style="
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 500px;
|
||||
height: 40px;" :style="{
|
||||
height: 40px;
|
||||
"
|
||||
:style="{
|
||||
background: errNum
|
||||
? 'rgba(255, 116, 116, 0.1)'
|
||||
: 'rgba(53, 174, 105, 0.1)',
|
||||
border: errNum ? '1px solid #ff7474' : '1px solid #35AE69',
|
||||
}">
|
||||
<img style="width: 14px; height: 14px; margin-left: 16px" :src="
|
||||
border: errNum
|
||||
? '1px solid #ff7474'
|
||||
: '1px solid #35AE69',
|
||||
}"
|
||||
>
|
||||
<img
|
||||
style="width: 14px; height: 14px; margin-left: 16px"
|
||||
:src="
|
||||
errNum
|
||||
? require('../../assets/images/err.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>
|
||||
@@ -138,15 +173,14 @@
|
||||
|
||||
<script>
|
||||
import { reactive, toRefs, watch, ref, computed } from "vue";
|
||||
import { exportTeacherExpense } from "../../api/Teaching";
|
||||
import { message } from "ant-design-vue";
|
||||
import { useStore } from "vuex";
|
||||
import * as api from "../../api/index1";
|
||||
import { getCookieForName } from "@/api/method";
|
||||
export default {
|
||||
name: "importWork",
|
||||
components: {
|
||||
|
||||
},
|
||||
components: {},
|
||||
props: {
|
||||
showWork: {
|
||||
type: Boolean,
|
||||
@@ -168,8 +202,7 @@ import {getCookieForName} from "@/api/method";
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
fileType: ["xls", "xlsx"],
|
||||
importHomeWork:
|
||||
process.env.VUE_APP_BASE_API + props.url,
|
||||
importHomeWork: process.env.VUE_APP_BASE_API + props.url,
|
||||
uploadpercent: -1,
|
||||
uploadErr: false, //上传失败
|
||||
addLoading: false,
|
||||
@@ -213,7 +246,7 @@ import {getCookieForName} from "@/api/method";
|
||||
state.uploadpercent = parseInt(info.file.percent);
|
||||
console.log("我是文件上传的进度---------->", info.file.percent);
|
||||
const status = info.file.status;
|
||||
console.log(info.file,'status')
|
||||
console.log(info.file, "status");
|
||||
if (status !== "uploading") {
|
||||
// console.log(info.file, info.fileList);
|
||||
}
|
||||
@@ -226,7 +259,7 @@ import {getCookieForName} from "@/api/method";
|
||||
} else {
|
||||
state.uploadErr = true;
|
||||
state.fileList = [];
|
||||
state.uploadpercent = -1
|
||||
state.uploadpercent = -1;
|
||||
message.destroy();
|
||||
message.error(info.file.response.msg);
|
||||
}
|
||||
@@ -296,7 +329,17 @@ import {getCookieForName} from "@/api/method";
|
||||
};
|
||||
function downTemplate() {
|
||||
// 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 {
|
||||
@@ -309,7 +352,7 @@ import {getCookieForName} from "@/api/method";
|
||||
downloadEeeorData,
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user