更新镇管理公司所有任务板块
This commit is contained in:
parent
b7bcb6839f
commit
05957e0b7d
@ -49,4 +49,4 @@ export const serviceTaskDetails = (data) => oahttp.get('/task/service_task_detai
|
||||
/**
|
||||
* 任务:提交督促小组服务团队学习任务
|
||||
*/
|
||||
export const serviceTask4Commit = (data) => oahttp.post('/task/commit_service_task4', data)
|
||||
export const serviceTask4Commit = (data) => oahttp.post('/task/commit_town_task_type4', data)
|
||||
|
@ -5,8 +5,8 @@
|
||||
<view>{{taskInfo.content||''}}</view>
|
||||
</view>
|
||||
<view class="card">
|
||||
<view class="c_title">判断条件:</view>
|
||||
<view>{{remark}}</view>
|
||||
<view class="c_title">判定条件:</view>
|
||||
<view style="white-space: pre-line;">{{remark}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
@ -9,10 +9,10 @@
|
||||
<view class="file">
|
||||
<view class="file_item" v-for="(item, index) in study_photo" :key="'file'+index">
|
||||
<image class="image" :src="item" @click="priview(index)"></image>
|
||||
<image v-if="!other.is_commit" class="del" src="/static/icons/delete.png" @click.stop="deleteFile(index)">
|
||||
<image v-if="taskInfo.status==2" class="del" src="/static/icons/delete.png" @click.stop="deleteFile(index)">
|
||||
</image>
|
||||
</view>
|
||||
<view v-if="!other.is_commit" class="file_btn" @click="chooseFile">
|
||||
<view v-if="taskInfo.status==2" class="file_btn" @click="chooseFile">
|
||||
<image src="/static/icons/plus.png"></image>
|
||||
</view>
|
||||
<view class="file_empty" v-for="k in placeholderLength" :key="'empty'+k"></view>
|
||||
@ -23,7 +23,7 @@
|
||||
<view class="file">
|
||||
<view v-if="sign_in_table" class="file_item">
|
||||
<image class="image" :src="sign_in_table" @click="priviewOne(index)"></image>
|
||||
<image v-if="!other.is_commit" class="del" src="/static/icons/delete.png"
|
||||
<image v-if="taskInfo.status==2" class="del" src="/static/icons/delete.png"
|
||||
@click.stop="deleteFile(index, 'sign_in_table')">
|
||||
</image>
|
||||
</view>
|
||||
@ -35,13 +35,13 @@
|
||||
</view>
|
||||
<view class="card" style="margin-bottom: 160rpx;">
|
||||
<view class="c_title">培训内容大纲 (50字以上)</view>
|
||||
<u--textarea :disabled="other.is_commit==1" v-model="study_content" placeholder="请输入内容"
|
||||
placeholderStyle="font-size: 22rpx;" style="font-size: 28rpx;background-color: #eee;min-height: 100px;"
|
||||
autoHeight maxlength="-1"></u--textarea>
|
||||
<u--textarea :disabled="taskInfo.status!=2" v-model="study_content" placeholder="请输入内容"
|
||||
placeholderStyle="font-size: 22rpx;" count maxlength="500" autoHeight
|
||||
style="font-size: 28rpx;background-color: #eee;min-height: 100px;padding-bottom: 50rpx;"></u--textarea>
|
||||
</view>
|
||||
<mybtn v-if="!other.is_commit" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn>
|
||||
<mybtn v-else-if="task_info.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成')"></mybtn>
|
||||
<mybtn v-else-if="task_info.status==5" text="已关闭" :my_btn_disabled="true" @click="showToast('任务已关闭!')"></mybtn>
|
||||
<mybtn v-if="taskInfo.status==2" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn>
|
||||
<mybtn v-else-if="taskInfo.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成')"></mybtn>
|
||||
<mybtn v-else-if="taskInfo.status==5" text="已关闭" :my_btn_disabled="true" @click="showToast('任务已关闭!')"></mybtn>
|
||||
<!-- <mybtn v-else-if="approve_status==3" text="已驳回,请重新提交" @click="toUpdate"></mybtn> -->
|
||||
<mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn>
|
||||
</view>
|
||||
@ -62,11 +62,12 @@
|
||||
note: "", // 详情描述
|
||||
video_annex: [] // 视频列表
|
||||
},
|
||||
taskInfo:{
|
||||
taskInfo: {
|
||||
id: '',
|
||||
title: '',
|
||||
content: '',
|
||||
extend: {}
|
||||
extend: {},
|
||||
status: 0
|
||||
},
|
||||
study_photo: [],
|
||||
sign_in_table: '',
|
||||
@ -74,33 +75,32 @@
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
options.task_id?this.taskInfo.id=options.task_id:null;
|
||||
options.task_id ? this.taskInfo.id = options.task_id : null;
|
||||
this.initTask();
|
||||
},
|
||||
onShow() {},
|
||||
computed: {
|
||||
// 占位长度
|
||||
placeholderLength() {
|
||||
if (this.other.is_commit == 1) return this.study_photo.length % 3 == 0 ? 0 : 3 - this.study_photo.length % 3;
|
||||
if (this.taskInfo.status!=2) return this.study_photo.length % 3 == 0 ? 0 : 3 - this.study_photo.length % 3;
|
||||
return (this.study_photo.length + 1) % 3 == 0 ? 0 : 3 - (this.study_photo.length + 1) % 3;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async initTask(){
|
||||
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||{}));
|
||||
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字');
|
||||
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 serviceTask4Commit({
|
||||
id: this.taskInfo.id,
|
||||
study_photo: this.study_photo,
|
||||
|
Loading…
x
Reference in New Issue
Block a user