更新市场部长任务

This commit is contained in:
weipengfei 2023-10-19 18:10:22 +08:00
parent b276f6f126
commit d09a14803d
2 changed files with 61 additions and 10 deletions

View File

@ -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() {

View File

@ -8,15 +8,21 @@
<view class="c_title">{{`任务名称: ${taskInfo.title||''}`}}</view>
<view>{{taskInfo.content||''}}</view>
</view>
<view class="card" v-if="taskInfo.approve_status==3">
<view class="c_title" style="color: #FF7C32;">驳回提示</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="text" style="color: #FF7C32;">{{taskInfo.deny_notes}}</view>
<button v-if="other.is_commit==1" class="btn" @click="toUpdate">去修改</button>
</view>
<view class="card">
<view class="c_title">任务完成证明</view>
<view class="file">
<view class="file_item" v-for="(item, index) in imgList" :key="'file'+index">
<image class="image" :src="item" @click="priview(index)"></image>
<image v-if="taskInfo.status==2" class="del" src="/static/icons/delete.png" @click.stop="deleteFile(index)">
<image v-if="taskInfo.status==2 && other.is_commit==0" class="del" src="/static/icons/delete.png" @click.stop="deleteFile(index)">
</image>
</view>
<view v-if="taskInfo.status==2" class="file_btn" @click="chooseFile">
<view v-if="taskInfo.status==2 && other.is_commit==0" 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>
@ -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;"></u--textarea>
</view>
<mybtn v-if="taskInfo.status==2" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn>
<mybtn v-if="taskInfo.status==2&&other.is_commit==0" 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-if="taskInfo.approve_status==3" text="已驳回,请重新提交" @click="toUpdate"></mybtn>
<mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn>
</block>
</view>
@ -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;