From d09a14803d42933eefee6e7064e222f3c281794c Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 19 Oct 2023 18:10:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B8=82=E5=9C=BA=E9=83=A8?= =?UTF-8?q?=E9=95=BF=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/task/taskItem.vue | 2 +- subpkg/townTask/marketTask10.vue | 69 +++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 10 deletions(-) diff --git a/components/task/taskItem.vue b/components/task/taskItem.vue index 598be73..f2da66b 100644 --- a/components/task/taskItem.vue +++ b/components/task/taskItem.vue @@ -124,7 +124,7 @@ taskRoleTypeList: ['town_task_type', 'town_task_type_marketing_director', 'town_task_type_master'], townServiceList: [44,45,46,47,48,49,50], // 镇农科服务部长任务 navToTownServiceList: [44,45,46,48,49,50], // 镇农科服务部长跳转/subpkg/townTask/townTask的任务 0 - navToTownMarketList: [51,53,54,55,57,58,59] // 镇农科市场部长跳转/subpkg/townTask/townTask的任务 1 + navToTownMarketList: [51,52,53,54,55,57,58,59] // 镇农科市场部长跳转/subpkg/townTask/townTask的任务 1 }; }, mounted() { diff --git a/subpkg/townTask/marketTask10.vue b/subpkg/townTask/marketTask10.vue index 1610084..6b153dd 100644 --- a/subpkg/townTask/marketTask10.vue +++ b/subpkg/townTask/marketTask10.vue @@ -8,15 +8,21 @@ {{`任务名称: ${taskInfo.title||''}`}} {{taskInfo.content||''}} + + 驳回提示 + + {{taskInfo.deny_notes}} + + 任务完成证明 - + - + @@ -28,10 +34,10 @@ placeholderStyle="font-size: 22rpx;" count maxlength="500" autoHeight style="font-size: 28rpx;background-color: #eee;min-height: 100px;padding-bottom: 50rpx;"> - + - + @@ -42,7 +48,7 @@ upLoadImage, } from "@/api/file.js"; import { Toast } from "../../libs/uniApi"; - import { townTaskDetails, marketTask10Commit } from "@/api/task.js" + import { marketTask10Detail, marketTask10Commit } from "@/api/task.js" export default { data() { return { @@ -79,26 +85,62 @@ computed: { // 占位长度 placeholderLength() { - if (this.taskInfo.status != 2) return this.imgList.length % 3 == 0 ? 0 : 3 - this.imgList.length % 3; + if (this.taskInfo.status != 2||this.other.is_commit==1) return this.imgList.length % 3 == 0 ? 0 : 3 - this.imgList.length % 3; return (this.imgList.length + 1) % 3 == 0 ? 0 : 3 - (this.imgList.length + 1) % 3; }, }, methods: { async initTask() { this.skeleton = true; - let res = await townTaskDetails({ + let res = await marketTask10Detail({ id: this.taskInfo.id }); + // approve_status 状态 0待审核,1审核中,2审核通过,3审核不通过,4撤销审核 this.taskInfo = res.data; - // console.log(this.taskInfo); + if(!this.taskInfo.approve_status)this.taskInfo.approve_status=0; + if(this.taskInfo?.extend?.file){ + // 判断该任务是否提交过 + if(this.taskInfo.extend.stage4?.is_commit==1)this.other.is_commit = 1; + else if(this.taskInfo.extend.stage3?.is_commit==1)this.other.is_commit = 1; + else if(this.taskInfo.extend.stage2?.is_commit==1)this.other.is_commit = 1; + else if(this.taskInfo.extend.stage1?.is_commit==1)this.other.is_commit = 1; + else this.other.is_commit = 0; + let task = JSON.parse(JSON.stringify(this.taskInfo.extend)) + this.imgList = task.file; + this.remark = task.remark; + } // this.sign_in_table = this.taskInfo?.extend?.town_task_type_4?.sign_in_table; // this.remark = this.taskInfo?.extend?.town_task_type_4?.remark; // this.imgList = JSON.parse(JSON.stringify(this.taskInfo?.extend?.town_task_type_4?.imgList || [])); this.skeleton = false; }, + // 被驳回时点击重新修改 + toUpdate() { + this.other.is_commit = 0; + }, + // 判断内容是否更改, 返回true代表更改 + isReject(){ + if (this.taskInfo.approve_status == 3) { // 被驳回,重新提交需要修改内容后方可提交 + let other = { + file: this.imgList, + remark: this.remark + } + let flag = true; + if(JSON.stringify(other)==JSON.stringify({ + file: this.taskInfo.extend.file, + remark: this.taskInfo.extend.remark + })) flag = false; + if (!flag) { + Toast('未检测到您的修改,请修改后提交') + } + return flag; + } + else return true; + }, // 提交 async submit() { if (this.imgList.length < 1) return Toast('证明数量不得小于1'); + if(!this.isReject()) return; let that = this; switch (that.stage) { case 1: @@ -131,7 +173,7 @@ }, chooseFile() { uni.chooseImage({ - count: 5, + count: 9, sizeType: ['compressed'], success: async (res) => { for (let item of res.tempFiles) { @@ -209,6 +251,15 @@ color: #333333; margin-bottom: 20rpx; } + + .btn { + background-color: $theme-oa-color; + color: #FFFFFF; + font-size: 28rpx; + height: 60rpx; + line-height: 60rpx; + margin-top: 16rpx; + } .file { display: flex;