完善督促小组学习任务详情和提交任务

This commit is contained in:
weipengfei 2023-09-22 18:17:25 +08:00
parent afa354464d
commit adb164a770
2 changed files with 36 additions and 8 deletions

View File

@ -41,3 +41,12 @@ export const taskOtherTaskDetail = (data) => oahttp.get('/task/other_task_detail
*/
export const taskOtherTaskCommit = (data) => oahttp.post('/task/cimmit_other_task', data)
/**
* 任务:服务任务详情
*/
export const serviceTaskDetails = (data) => oahttp.get('/task/service_task_detail', data)
/**
* 任务:提交督促小组服务团队学习任务
*/
export const serviceTask4Commit = (data) => oahttp.post('/task/cimmit_service_task4', data)

View File

@ -50,8 +50,9 @@
<script>
import {
upLoadImage,
} from "@/api/file.js"
} from "@/api/file.js";
import { Toast } from "../../libs/uniApi";
import { serviceTaskDetails, serviceTask4Commit } from "@/api/task.js"
export default {
data() {
return {
@ -61,13 +62,21 @@
note: "", //
video_annex: [] //
},
taskInfo:{},
taskInfo:{
id: '',
title: '',
content: '',
extend: {}
},
study_photo: [],
sign_in_table: '',
study_content: ''
}
},
onLoad() {},
onLoad(options) {
options.task_id?this.taskInfo.task_id=options.task_id:null;
this.initTask();
},
onShow() {},
computed: {
//
@ -77,16 +86,26 @@
},
},
methods: {
async initTask(){
let res = await serviceTaskDetails({
id: this.taskInfo.id
});
console.log(res);
this.taskInfo = res.data;
this.sign_in_table = this.taskInfo?.extend?.town_task_type_4?.sign_in_table;
this.study_content = this.taskInfo?.extend?.town_task_type_4?.study_content;
this.study_photo = JSON.parse(JSON.stringify(this.taskInfo?.extend?.town_task_type_4?.study_photo||{}));
},
//
async submit() {
if(this.study_photo.length<5)return Toast('学习照片不能低于5张');
if(!this.sign_in_table)return Toast('签到表照片不能为空');
if(this.study_content.trim().length <50) return Toast('培训内容不得低于50字');
await taskOtherTaskCommit({
id: this.task_id,
note: this.note,
annex: this.fileList,
video_annex: this.videoList
await serviceTask4Commit({
id: this.taskInfo.id,
study_photo: this.study_photo,
sign_in_table: this.sign_in_table,
study_content: this.study_content
});
this.other.is_commit = 1;
Toast('提交成功');