Commit 89b26c9c authored by 杨梦雪's avatar 杨梦雪

11

parent 0c2a5775
...@@ -43,6 +43,7 @@ export default { ...@@ -43,6 +43,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import "a/scss/common"; @import "a/scss/common";
.footer { .footer {
margin-top: 20px;
font-family: PingFang SC; font-family: PingFang SC;
font-size: 14px; font-size: 14px;
height: 169px; height: 169px;
......
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
恭喜你顺利结业!点击【获取营地证书】确认收货地址,证书将以纸质形式邮寄上门 恭喜你顺利结业!点击【获取营地证书】确认收货地址,证书将以纸质形式邮寄上门
</div> </div>
<div> <div>
<img src="@/assets/img/signUp/offer.png" alt="" /> <img src="@/assets/img/certificate.jpg" alt="" style="width: 25%" />
</div> </div>
<div class="btn"> <div class="btn">
<el-button @click="getCertifi">获得营地证书</el-button> <el-button @click="getCertifi">获得营地证书</el-button>
</div> </div>
</div> </div>
<!-- <!--
<div class="pay_bottom"> <div class="pay_bottom">
<div>注意事项:</div> <div>注意事项:</div>
<div> <div>
...@@ -36,12 +36,7 @@ ...@@ -36,12 +36,7 @@
</div> --> </div> -->
</div> </div>
<!-- 确认收货地址对话框 --> <!-- 确认收货地址对话框 -->
<el-dialog <el-dialog title="确认收货地址" :visible.sync="dialogVisible" width="40%">
title="确认收货地址"
:visible.sync="dialogVisible"
width="40%"
@open="getAddress"
>
<el-form ref="addressRef" :model="addressForm" :rules="addressRules"> <el-form ref="addressRef" :model="addressForm" :rules="addressRules">
<el-form-item label="收件人" prop="certificate_name"> <el-form-item label="收件人" prop="certificate_name">
<el-input <el-input
...@@ -166,14 +161,14 @@ export default { ...@@ -166,14 +161,14 @@ export default {
certificate_province: [ certificate_province: [
{ {
required: true, required: true,
message: "请选择所在学校省份!", message: "请选择所在省份!",
trigger: "change", trigger: "change",
}, },
], ],
certificate_city: [ certificate_city: [
{ {
required: true, required: true,
message: "请选择所在学校城市!", message: "请选择所在城市!",
trigger: "change", trigger: "change",
}, },
], ],
...@@ -206,6 +201,9 @@ export default { ...@@ -206,6 +201,9 @@ export default {
}, },
watch: {}, watch: {},
methods: { methods: {
getCertifi() {
this.getAddress();
},
getAddress() { getAddress() {
// console.log(111111) // console.log(111111)
getAddress({}).then((res) => { getAddress({}).then((res) => {
...@@ -213,18 +211,27 @@ export default { ...@@ -213,18 +211,27 @@ export default {
if (res.data.code != 200) { if (res.data.code != 200) {
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
// console.log(Object.keys(res.data.info),'info')
if (Object.keys(res.data.info).length != 0) {
return this.$message.error("已保存地址");
}
this.dialogVisible = true;
this.addressForm.certificate_name = res.data.info.certificate_name; this.addressForm.certificate_name = res.data.info.certificate_name;
this.addressForm.certificate_phone = res.data.info.certificate_phone; this.addressForm.certificate_phone = res.data.info.certificate_phone;
this.addressForm.certificate_province = res.data.info.certificate_province; this.addressForm.certificate_province =
res.data.info.certificate_province;
this.addressForm.certificate_city = res.data.info.certificate_city; this.addressForm.certificate_city = res.data.info.certificate_city;
this.selectCitySchool = this.getCurrentCityLists(this.addressForm.certificate_province); this.selectCitySchool = this.getCurrentCityLists(
this.county = res.data.info.certificate_address.split("-")[0]; this.addressForm.certificate_province
this.certificate_address = res.data.info.certificate_address.split("-")[1]; );
if (res.data.info.certificate_address) {
this.county = res.data.info.certificate_address.split("-")[0];
this.certificate_address =
res.data.info.certificate_address.split("-")[1];
}
}); });
}, },
getCertifi() {
this.dialogVisible = true;
},
// 获取省份城市 // 获取省份城市
getProAndCity() { getProAndCity() {
......
...@@ -15,14 +15,12 @@ ...@@ -15,14 +15,12 @@
<div class="each_content" v-for="item in homeworkList" :key="item.id"> <div class="each_content" v-for="item in homeworkList" :key="item.id">
<div class="top flex"> <div class="top flex">
<div class="homework_name flex"> <div class="homework_name flex">
<div>作业名称:{{ item.work_name }}</div> <div class="work_name">{{ item.work_name }}</div>
<span v-if="item.student_status == 0">未完成</span> <span class="status_0" v-if="item.student_status == 0">未完成</span>
<span v-if="item.student_status == 1">待评分</span> <span class="status_1" v-if="item.student_status == 1">待评分</span>
<span v-if="item.student_status == 2">已评分</span> <span class="status_2" v-if="item.student_status == 2">已评分</span>
</div> </div>
<el-button size="mini" round @click="toRefer(item)" <div class="btn_refer" @click="toRefer(item)">查看作业</div>
>查看作业</el-button
>
</div> </div>
<div class="line"></div> <div class="line"></div>
<div class="bottom"> <div class="bottom">
...@@ -39,7 +37,8 @@ ...@@ -39,7 +37,8 @@
<el-pagination <el-pagination
layout="prev, pager, next" layout="prev, pager, next"
:page-size="pageSize" :page-size="pageSize"
:total="this.homeworkList.length" :current-page="currentPage"
:total="total"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
> >
...@@ -51,6 +50,7 @@ ...@@ -51,6 +50,7 @@
:work_contexts="work_context" :work_contexts="work_context"
:enclosure_urls="enclosure_url" :enclosure_urls="enclosure_url"
:work_nums="work_num" :work_nums="work_num"
:order_nums="order_num"
:student_status="student_status" :student_status="student_status"
@closeDialog="closeDialog" @closeDialog="closeDialog"
></refer> ></refer>
...@@ -68,13 +68,15 @@ export default { ...@@ -68,13 +68,15 @@ export default {
}, },
data() { data() {
return { return {
pageSize: 1, pageSize: 10,
currentPage: 1, currentPage: 1,
total: 0,
homeworkList: {}, homeworkList: {},
dialogVisibleFu: false, dialogVisibleFu: false,
work_context: "", work_context: "",
enclosure_url: "", enclosure_url: "",
work_num: 0, work_num: 0,
order_num: 0,
student_status: 0, student_status: 0,
}; };
}, },
...@@ -95,6 +97,7 @@ export default { ...@@ -95,6 +97,7 @@ export default {
// 子组件触发,关闭确认报名弹框 // 子组件触发,关闭确认报名弹框
closeDialog(val, type) { closeDialog(val, type) {
this.dialogVisibleFu = val; this.dialogVisibleFu = val;
this.getTeacherWork();
}, },
toRefer(item) { toRefer(item) {
//time_out:提交作业时间状态 //time_out:提交作业时间状态
...@@ -103,7 +106,8 @@ export default { ...@@ -103,7 +106,8 @@ export default {
// console.log(item.work_num,'val') // console.log(item.work_num,'val')
this.work_context = item.work_context; this.work_context = item.work_context;
this.enclosure_url = item.enclosure_url; this.enclosure_url = item.enclosure_url;
this.work_num = item.work_num; this.work_num = item.id;
this.order_num = item.work_num;
this.student_status = item.student_status; this.student_status = item.student_status;
} else if (item.time_out == 2) { } else if (item.time_out == 2) {
return this.$message.error("填写作业时间未开始"); return this.$message.error("填写作业时间未开始");
...@@ -113,12 +117,13 @@ export default { ...@@ -113,12 +117,13 @@ export default {
}, },
getTeacherWork() { getTeacherWork() {
getTeacherWork({ page: this.currentPage }).then((res) => { getTeacherWork({ page: this.currentPage }).then((res) => {
console.log(res, "getTeacherWork"); // console.log(res, "getTeacherWork");
if (res.data.code != 200) { if (res.data.code != 200) {
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
this.homeworkList = res.data.data; this.homeworkList = res.data.data.list;
this.$message.success(res.data.message); this.total = res.data.data.count;
// this.$message.success(res.data.message);
}); });
}, },
}, },
...@@ -127,11 +132,13 @@ export default { ...@@ -127,11 +132,13 @@ export default {
<style lang="scss" > <style lang="scss" >
@import "a/scss/btn";
.flex { .flex {
display: flex; display: flex;
} }
.homework { .homework {
font-family: PingFangSC-Medium, PingFang SC;
// background: #ffffff; // background: #ffffff;
// width: 856px; // width: 856px;
...@@ -174,34 +181,81 @@ export default { ...@@ -174,34 +181,81 @@ export default {
.each_content { .each_content {
padding: 25px 30px; padding: 25px 30px;
background-color: #eceaea; background-color: #f7f7f7;
margin: 0 30px 20px 30px; margin: 0 30px 20px 30px;
// border-radius: 25px; // border-radius: 25px;
.top { .top {
margin-bottom: 10px; margin-bottom: 10px;
justify-content: space-between; justify-content: space-between;
.homework_name { .homework_name {
div { .work_name {
padding: 7px 20px 7px 0; padding: 7px 20px 7px 0;
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
} }
span { span {
background-color: white; width: 65px;
padding: 7px 15px; line-height: 34px;
border-radius: 45px; text-align: center;
font-size: 10px; border-radius: 10px;
font-size: 12px;
font-weight: 500;
}
.status_0 {
background: #ffebf9;
color: #60194a;
}
.status_1 {
background: #fff0e5;
color: #ff6f00;
}
.status_2 {
background: #e4fff9;
color: #0a9071;
} }
} }
.btn_refer {
width: 88px;
background: #60194a;
border-radius: 4px;
opacity: 0.9;
font-size: 14px;
text-align: center;
font-weight: 400;
color: #ffffff;
line-height: 33px;
cursor: pointer;
}
} }
.line { .line {
border-bottom: 1px solid; border-bottom: 1px solid #d8d8d8;
} }
.bottom { .bottom {
//+ 相邻选择器 //+ 相邻选择器
// p+div{ // p+div{
// font-size: 20px; // font-size: 20px;
// } // }
:first-child {
margin-bottom: 10px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.time > div { .time > div {
margin-right: 20px; margin-right: 20px;
font-size: 12px;
font-weight: 400;
color: #999999;
line-height: 12px;
} }
} }
} }
......
...@@ -10,10 +10,8 @@ ...@@ -10,10 +10,8 @@
> >
<div class="referHome"> <div class="referHome">
<el-form <el-form
v-loading="loading"
ref="formRef"
:model="formData" :model="formData"
:rules="referRules"
label-position="top" label-position="top"
class="readForm" class="readForm"
> >
...@@ -58,78 +56,74 @@ ...@@ -58,78 +56,74 @@
<div class="line"></div> <div class="line"></div>
我的作业 我的作业
</div> </div>
<el-form ref="formRef_stu" :rules="referRules" :model="formData">
<el-form-item <el-form-item
label="文字描述(如超过300字,建议以附件形式上传)" label="文字描述(如超过300字,建议以附件形式上传)"
prop="stu_answer" prop="stu_answer"
> >
<el-input <el-input
type="textarea" type="textarea"
v-model="formData.stu_answer" v-model="formData.stu_answer"
placeholder="请输入300字以内的描述" placeholder="请输入300字以内的描述"
size="small" size="small"
:maxlength="300" :maxlength="300"
show-word-limit show-word-limit
/> />
</el-form-item> </el-form-item>
<el-form-item label="相关附件" prop="studentUrl"> <el-form-item label="相关附件" prop="studentUrl">
<div class="fj_info">1、请上传1-10份相关附件;</div> <div class="fj_info">1、请上传1-10份相关附件;</div>
<div class="fj_info"> <div class="fj_info">
2、单个附件大小不超过100M,支持JPG、JPEG、PNG、docx、doc、pdf、mp4等格式; 2、单个附件大小不超过100M,支持JPG、JPEG、PNG、docx、doc、pdf、mp4等格式;
</div> </div>
<div class="upload_box"> <div class="upload_box">
<div <div
class="img_list" class="img_list"
v-for="(item, index) in fileList" v-for="(item, index) in fileList"
:key="index" :key="index"
> >
<div> <div>
<el-image :src="fileImg"></el-image> <el-image :src="fileImg"></el-image>
<div class="item_name">{{ item.name }}</div> <div class="item_name">{{ item.name }}</div>
<div class="item_remove" @click="handleRemove(item)"> <div class="item_remove" @click="handleRemove(item)">
删除 删除
</div>
</div> </div>
</div> </div>
</div>
<el-upload <el-upload
v-if="fileList.length < 10" v-if="fileList.length < 10"
ref="systemLogo" ref="systemLogo"
name="multipartFile" name="multipartFile"
action="#" action="#"
:file-list="fileList" :file-list="fileList"
:disabled="isUploading || fileList.length >= 10" :disabled="isUploading || fileList.length >= 10"
:limit="10" :limit="10"
list-type="picture-card" list-type="picture-card"
:show-file-list="false" :show-file-list="false"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
:on-progress="handleUploadProgress" :http-request="uploadPicture"
:on-success="uploadSuccess" >
:http-request="uploadPicture" <i
> v-if="!isUploading"
<i class="el-icon-plus avatar-uploader-icon"
v-if="!upLoading" ></i>
class="el-icon-plus avatar-uploader-icon" <i
></i> v-if="isUploading"
<i class="el-icon-loading avatar-uploader-icon"
v-if="upLoading" ></i>
class="el-icon-loading avatar-uploader-icon" </el-upload>
></i> </div>
</el-upload> </el-form-item>
</div> </el-form>
</el-form-item>
</div> </div>
<!-- 我的作业(已提交待评分 -不可编辑 )--> <!-- 我的作业(已提交待评分 -不可编辑 )-->
<div v-if="this.student_status == 1"> <div v-if="this.student_status == 1 || this.student_status == 2">
<div class="cont_title"> <div class="cont_title">
<div class="line"></div> <div class="line"></div>
我的作业 我的作业
</div> </div>
<el-form-item <el-form-item label="文字描述(如超过300字,建议以附件形式上传)">
label="文字描述(如超过300字,建议以附件形式上传)"
v-show="formData.stu_answer"
>
<el-input <el-input
type="textarea" type="textarea"
v-model="formData.stu_answer" v-model="formData.stu_answer"
...@@ -140,11 +134,7 @@ ...@@ -140,11 +134,7 @@
:disabled="true" :disabled="true"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="相关附件">
label="相关附件"
prop="teacherUrl"
v-show="!stu_fileList === []"
>
<div class="fj_info">1、请上传1-10份相关附件;</div> <div class="fj_info">1、请上传1-10份相关附件;</div>
<div class="fj_info"> <div class="fj_info">
2、单个附件大小不超过100M,支持JPG、JPEG、PNG、docx、doc、pdf、mp4等格式; 2、单个附件大小不超过100M,支持JPG、JPEG、PNG、docx、doc、pdf、mp4等格式;
...@@ -158,36 +148,13 @@ ...@@ -158,36 +148,13 @@
<div> <div>
<el-image :src="fileImg"></el-image> <el-image :src="fileImg"></el-image>
<div class="item_name">{{ item.name }}</div> <div class="item_name">{{ item.name }}</div>
<!-- <div class="item_remove" @click="handleRemove(item)">
删除
</div> -->
</div> </div>
</div> </div>
<div v-if="stu_fileList.length <= 0" class="img_list">
<!-- <el-upload <div>
v-if="stu_fileList.length < 10" <div class="item_name">暂无相关附件</div>
ref="systemLogo" </div>
name="multipartFile" </div>
action="#"
:file-list="stu_fileList"
:disabled="isUploading || fileList.length >= 10"
:limit="10"
list-type="picture-card"
:show-file-list="false"
:before-upload="beforeAvatarUpload"
:on-progress="handleUploadProgress"
:on-success="uploadSuccess"
:http-request="uploadPicture"
>
<i
v-if="!upLoading"
class="el-icon-plus avatar-uploader-icon"
></i>
<i
v-if="upLoading"
class="el-icon-loading avatar-uploader-icon"
></i>
</el-upload> -->
</div> </div>
</el-form-item> </el-form-item>
</div> </div>
...@@ -202,7 +169,7 @@ ...@@ -202,7 +169,7 @@
<div class="cont_title_2">导师评分</div> <div class="cont_title_2">导师评分</div>
<div class="cont_info">{{ score }}</div> <div class="cont_info">{{ score }}</div>
<div class="cont_title_2">导师评语</div> <div class="cont_title_2">导师评语</div>
<div v-html="this.teacher_commment" class="cont_info">}</div> <div v-html="teacher_commment" class="cont_info">}</div>
<div class="cont_title_2">相关附件</div> <div class="cont_title_2">相关附件</div>
<div class="upload_box"> <div class="upload_box">
<div v-if="tea_scoreFileList.length > 0"> <div v-if="tea_scoreFileList.length > 0">
...@@ -256,10 +223,26 @@ export default { ...@@ -256,10 +223,26 @@ export default {
enclosure_urls: [Object, String], //老师作业地址 enclosure_urls: [Object, String], //老师作业地址
work_nums: [Number], work_nums: [Number],
student_status: [Number], //作业状态 student_status: [Number], //作业状态
order_nums: [Number], //作业状态
}, },
data() { data() {
var validateNum = (rule, value, callback) => { var validateNum = (rule, value, callback) => {
if (!this.formData.stu_answer && !this.formData.stu_enclosure_url) { console.log(value, "value");
// let code = this.$store.state.indexIdentity;
// this.formData.stu_enclosure_url = window.localStorage.getItem(
// "student_file_" + window.localStorage.getItem("phone" + code) + code
// );
// console.log(
// this.stu_fileList,' this.stu_fileList'
// );
// return
// this.formData.stu_enclosure_url = this.stu_fileList
console.log(this.formData.stu_answer);
console.log(this.formData.stu_enclosure_url);
if (
this.formData.stu_answer == "" &&
this.formData.stu_enclosure_url == []
) {
callback(new Error("请至少填写一项")); callback(new Error("请至少填写一项"));
} else { } else {
callback(); callback();
...@@ -283,21 +266,21 @@ export default { ...@@ -283,21 +266,21 @@ export default {
loading: false, loading: false,
dialogVisible: this.dialogVisibleFu, dialogVisible: this.dialogVisibleFu,
dialogVisibleimage: false, dialogVisibleimage: false,
stuWork: {}, // 学生-作业 // stuWork: {}, // 学生-作业
formData: { formData: {
stu_work_num: "", teacher_id: "",
stu_answer: "", stu_answer: "",
stu_enclosure_url: "", stu_enclosure_url: "",
}, // 老师-评阅结果 }, // 老师-评阅结果
upLoading: false, // 老师-上传loading // upLoading: false, // 老师-上传loading
disabled: false, //限制输入框 disabled: false, //限制输入框
stu_fileListoss: [], // 学生-上传相关附件(展示-存在缓存) stu_fileListoss: [], // 学生-上传相关附件(展示-存在缓存)
teaFileList: [], // 老师-布置作业附件 teaFileList: [], // 老师-布置作业附件
fileList: [], //学生上传的作业文件 fileList: [], //学生上传的作业文件
stu_fileList: [], //学生上传的文件(传给接口的格式) stu_fileList: [], //学生上传的文件(传给接口的格式)
score: false, //老师评分 score: "", //老师评分
teacher_commment: false, //老师评语 teacher_commment: "", //老师评语
tea_scoreFileList: [], //老师评语的附件 tea_scoreFileList: [], //老师评语的附件
}; };
}, },
...@@ -312,20 +295,20 @@ export default { ...@@ -312,20 +295,20 @@ export default {
}, },
methods: { methods: {
open() { open() {
this.titleName = this.work_nums; this.titleName = this.order_nums;
// console.log(this.student_status); // console.log(this.student_status);
this.getTeachList(); this.getTeachList();
if (this.student_status == 0) { if (this.student_status == 0) {
} else if (this.student_status == 1) { } else if (this.student_status == 1) {
this.getStudentWork(); this.getStudentWork(this.student_status);
} else if (this.student_status == 2) { } else if (this.student_status == 2) {
this.getStudentWork(); this.getStudentWork(this.student_status);
} }
}, },
//老师作业展示 //老师作业展示
getTeachList() { getTeachList() {
let url = this.enclosure_urls; let url = this.enclosure_urls;
console.log(this.enclosure_urls); // console.log(this.enclosure_urls);
if (this.enclosure_urls) { if (this.enclosure_urls) {
let arr = url.split(","); let arr = url.split(",");
arr.forEach((item) => { arr.forEach((item) => {
...@@ -355,8 +338,14 @@ export default { ...@@ -355,8 +338,14 @@ export default {
if (res.data.code != 200) { if (res.data.code != 200) {
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
let url = res.data.url;
let reg = /^.+(\.pdf|\.txt|\.mp3|\.mp4)$/;
if (reg.test(url)) {
window.open(url, "_black");
} else {
window.open(url, "_self");
}
this.$message.success("下载成功"); this.$message.success("下载成功");
window.location.href = res.data.url;
}); });
}, },
// 下载老师评分结果 // 下载老师评分结果
...@@ -366,15 +355,21 @@ export default { ...@@ -366,15 +355,21 @@ export default {
if (res.data.code != 200) { if (res.data.code != 200) {
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
let url = res.data.url;
let reg = /^.+(\.pdf|\.txt|\.mp3|\.mp4)$/;
if (reg.test(url)) {
window.open(url, "_black");
} else {
window.open(url, "_self");
}
this.$message.success("下载成功"); this.$message.success("下载成功");
window.location.href = res.data.url;
}); });
}, },
// 学生作业回显 // 学生作业回显
getStudentWork() { getStudentWork() {
let stu_work_num = this.work_nums; let stu_work_num = this.work_nums;
getStudentWork({ stu_work_num: stu_work_num }).then((res) => { getStudentWork({ teacher_id: stu_work_num }).then((res) => {
console.log(res); console.log(res, "getStudentWork");
if (res.data.code != 200) { if (res.data.code != 200) {
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
...@@ -388,24 +383,38 @@ export default { ...@@ -388,24 +383,38 @@ export default {
url: item, url: item,
}; };
}); });
this.score = res.data.data.score; //老师评分 // console.log(this.stu_fileList, "stu_fileList");
this.teacher_commment = res.data.data.teacher_commment; //老师评语 //老师已评阅
let scoreFileList = res.data.data.teacher_url; if (this.student_status == 2) {
let arr = scoreFileList.split(","); this.score = res.data.data.score; //老师评分
console.log(arr, "arr"); this.teacher_commment = res.data.data.teacher_commment; //老师评语
this.tea_scoreFileList = arr.map((item) => { // console.log(res.data.data.teacher_commment, " this.teacher_commment");
return { let scoreFileList = res.data.data.teacher_url;
name: item.split("workforstudent/")[1], let arr = scoreFileList.split(",");
url: item, // console.log(arr, "arr");
}; this.tea_scoreFileList = arr.map((item) => {
}); return {
name: item.split("workforstudent/")[1],
url: item,
};
});
}
}); });
}, },
// 未完成 // 未完成
notReadHandle() { notReadHandle() {
this.formData.stu_work_num = this.work_nums; this.formData.teacher_id = this.work_nums;
this.formData.stu_enclosure_url = this.stu_fileList; if (!this.formData.stu_enclosure_url) {
delete this.formData.stu_enclosure_url;
} else {
this.formData.stu_enclosure_url = this.stu_fileListoss;
}
if (!this.formData.stu_answer) {
delete this.formData.stu_answer;
}
console.log(this.stu_fileList, "this.stu_fileList");
// return
subStudentWork(this.formData) subStudentWork(this.formData)
.then((response) => { .then((response) => {
console.log(response); console.log(response);
...@@ -422,7 +431,7 @@ export default { ...@@ -422,7 +431,7 @@ export default {
// 待评阅 // 待评阅
yiReadHandle() { yiReadHandle() {
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
this.formData.stu_work_num = this.work_nums; this.formData.teacher_id = this.work_nums;
this.formData.stu_enclosure_url = window.localStorage.getItem( this.formData.stu_enclosure_url = window.localStorage.getItem(
"student_file_" + window.localStorage.getItem("phone" + code) + code "student_file_" + window.localStorage.getItem("phone" + code) + code
); );
...@@ -445,10 +454,11 @@ export default { ...@@ -445,10 +454,11 @@ export default {
window.localStorage.removeItem( window.localStorage.removeItem(
"student_file_" + window.localStorage.getItem("phone" + code) + code "student_file_" + window.localStorage.getItem("phone" + code) + code
); );
this.stuWork = {};
this.stu_fileList = []; this.stu_fileList = [];
this.stu_fileListoss = []; this.stu_fileListoss = [];
// this.teaFileList = []; this.teaFileList = [];
this.formData.stu_answer = "";
this.$refs["formRef"].resetFields(); this.$refs["formRef"].resetFields();
this.dialogVisible = false; this.dialogVisible = false;
this.$emit("closeDialog", this.dialogVisible, true); this.$emit("closeDialog", this.dialogVisible, true);
...@@ -459,47 +469,25 @@ export default { ...@@ -459,47 +469,25 @@ export default {
window.localStorage.removeItem( window.localStorage.removeItem(
"student_file_" + window.localStorage.getItem("phone" + code) + code "student_file_" + window.localStorage.getItem("phone" + code) + code
); );
this.stuWork = {};
this.stu_fileList = []; this.stu_fileList = [];
this.stu_fileListoss = []; this.stu_fileListoss = [];
// this.teaFileList = []; this.teaFileList = [];
this.formData.stu_answer = "";
this.dialogVisible = false; this.dialogVisible = false;
this.$emit("closeDialog", this.dialogVisible, false); this.$emit("closeDialog", this.dialogVisible, false);
}, },
//上传前 //上传前
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
const isLt10M = file.size / 1024 / 1024 < 10; const isLt100M = file.size / 1024 / 1024 < 100;
if (!isLt10M) { if (!isLt100M) {
this.$message.info("上传图片大小不能超过 10MB!"); this.$message.info("上传图片大小不能超过 100MB!");
} }
return isLt10M; return isLt100M;
}, },
// handlePictureCardPreview(file) {
// console.log(file, "11111111");
// this.resultPicture = file.url;
// this.dialogVisibleimage = true;
// },
// 文件上传中处理
handleUploadProgress(event, file, fileList) {
// console.log(fileList);
this.isUploading = true;
if (this.stu_fileList.lenge < 10) {
return this.$message.info("chaochushuliamng");
}
},
uploadSuccess(res, file, fileList) {
// console.log(res, "res");
console.log(file, "file");
// console.log(fileList, "fileList");
this.referForm.achievementPath = res;
this.stu_fileList = {
name: file.name,
url: res,
};
this.$refs["imgUrl"].clearFiles(); //上传成功之后清除历史记录
},
uploadPicture(params) { uploadPicture(params) {
this.isUploading = true;
console.log("已经准备好上传图片", params); console.log("已经准备好上传图片", params);
this.file = params.file; this.file = params.file;
console.log(this.file, "1111"); console.log(this.file, "1111");
...@@ -512,19 +500,13 @@ export default { ...@@ -512,19 +500,13 @@ export default {
this.getOssConfigs(image, params.file); this.getOssConfigs(image, params.file);
}, },
async getOssConfigs(image, file) { async getOssConfigs(image, file) {
// let code = this.$store.state.indexIdentity;
// let stu_work_num = window.localStorage.getItem("stu_work_num" + code);
// console.log(
// window.localStorage.getItem("stu_work_num" + code),
// "stu_work_num"
// );
let obj = { let obj = {
url: "", url: "",
savefile: "", savefile: "",
}; };
await PostWorkStudentOss({ await PostWorkStudentOss({
image: image, image: image,
stu_work_num: this.work_nums, teacher_id: this.work_nums,
}) })
.then((res) => { .then((res) => {
console.log(res, "开始上传图片"); console.log(res, "开始上传图片");
...@@ -546,6 +528,7 @@ export default { ...@@ -546,6 +528,7 @@ export default {
console.log(ress, "ress"); console.log(ress, "ress");
if (ress.data.code != 200) { if (ress.data.code != 200) {
console.log(ress, "ress"); console.log(ress, "ress");
this.isUploading = false;
return this.$message.error(ress.data.message); return this.$message.error(ress.data.message);
} }
this.resultPicture = filename + "?t=" + Date.parse(new Date()); this.resultPicture = filename + "?t=" + Date.parse(new Date());
...@@ -554,21 +537,16 @@ export default { ...@@ -554,21 +537,16 @@ export default {
obj = { obj = {
url: ress.data.picture_path, url: ress.data.picture_path,
savefile: res.data.config.savefile, savefile: res.data.config.savefile,
name: res.data.config.savefile.split("/work/")[1],
}; };
this.fileList.push(obj); this.fileList.push(obj);
console.log(this.fileList); console.log(this.fileList, "fileList");
// let stu_obj = {
// url: ress.data.picture_path,
// };
// this.stu_fileList.push(stu_obj);
// let arrNew = [];
this.stu_fileListoss = this.fileList this.stu_fileListoss = this.fileList
.map((item) => { .map((item) => {
return item.url; return item.url;
}) })
.join(","); .join(",");
console.log(this.stu_fileListoss); console.log(this.stu_fileListoss, "stu_fileListoss");
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
window.localStorage.setItem( window.localStorage.setItem(
"student_file_" + "student_file_" +
...@@ -576,15 +554,19 @@ export default { ...@@ -576,15 +554,19 @@ export default {
code, code,
JSON.stringify(this.stu_fileListoss) JSON.stringify(this.stu_fileListoss)
); );
this.isUploading = false;
}) })
.catch((err) => { .catch((err) => {
this.isUploading = false;
this.$message.error(err); this.$message.error(err);
}); });
} else { } else {
this.isUploading = false;
this.$message.error(res.data.message); this.$message.error(res.data.message);
} }
}) })
.catch((err) => { .catch((err) => {
this.isUploading = false;
// console.log(err); // console.log(err);
}); });
}, },
...@@ -611,34 +593,32 @@ export default { ...@@ -611,34 +593,32 @@ export default {
let savefile = str[1]; let savefile = str[1];
// console.log(savefile, "savefile"); // console.log(savefile, "savefile");
let stu_work_num = this.work_nums; let stu_work_num = this.work_nums;
delPic({ object: savefile, stu_work_num: stu_work_num }).then( delPic({ object: savefile, teacher_id: stu_work_num }).then((res) => {
(res) => { console.log(res, "delpic");
console.log(res, "delpic"); if (res.data.code != 200) {
if (res.data.code != 200) { return this.$message.error(res.data.message);
return this.$message.error(res.data.message); }
console.log(this.fileList);
this.fileList.forEach((item, idx) => {
// console.log(item.url == file.url);
if (item.url == file.url) {
this.fileList.splice(idx, 1);
let code = this.$store.state.indexIdentity;
window.localStorage.setItem(
"student_file_" +
window.localStorage.getItem("phone" + code) +
code,
JSON.stringify(this.stu_fileListoss)
);
} }
console.log(this.fileList); });
this.fileList.forEach((item, idx) => {
// console.log(item.url == file.url);
if (item.url == file.url) {
this.fileList.splice(idx, 1);
let code = this.$store.state.indexIdentity;
window.localStorage.setItem(
"student_file_" +
window.localStorage.getItem("phone" + code) +
code,
JSON.stringify(this.stu_fileListoss)
);
}
});
// console.log(this.fileList); // console.log(this.fileList);
this.$message.success(res.data.message); this.$message.success(res.data.message);
} });
);
}) })
.catch((err) => { .catch((err) => {
console.log(err, "err"); // console.log(err, "err");
this.$message({ this.$message({
type: "info", type: "info",
message: "取消删除", message: "取消删除",
...@@ -647,13 +627,14 @@ export default { ...@@ -647,13 +627,14 @@ export default {
}, },
// 提交按钮 // 提交按钮
confirm() { confirm() {
this.$refs["formRef"].validate((valid) => { this.$refs["formRef_stu"].validate((valid) => {
if (!valid) return; if (!valid) return;
console.log(valid, "valid");
if (this.student_status == 0) { if (this.student_status == 0) {
// 未完成 // 未完成
this.notReadHandle(); this.notReadHandle();
} else if (this.student_status == 1) { } else if (this.student_status == 1) {
console.log(11111); // console.log(11111);
// 已完成 // 已完成
this.yiReadHandle(); this.yiReadHandle();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment