镇公司身份改变

This commit is contained in:
zmj 2023-11-07 09:21:19 +08:00
parent 670ab6ff0b
commit 73aa7f8c19
4 changed files with 1280 additions and 1294 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +1,89 @@
<template> <template>
<view class="all_box"> <view class="all_box">
<block v-if="skeleton"> <block v-if="skeleton">
<u-skeleton :loading="skeleton" :animate="true" title rows="2" rows-width="100%" <u-skeleton :loading="skeleton" :animate="true" title rows="2" rows-width="100%" rowsHeight="40"
rowsHeight="40" v-for="i in 3" :key="i" style="padding: 28rpx;"> v-for="i in 3" :key="i" style="padding: 28rpx;">
</u-skeleton> </u-skeleton>
</block> </block>
<block v-else> <block v-else>
<u-empty v-if="list.length==0" icon="/static/img/empty/data.png" text="没有任务"></u-empty> <u-empty v-if="list.length==0" icon="/static/img/empty/data.png" text="没有任务"></u-empty>
<view v-else class="task_list"> <view v-else class="task_list">
<!-- <taskCard class="task_card" v-for="item in 10" :key="item"></taskCard> --> <!-- <taskCard class="task_card" v-for="item in 10" :key="item"></taskCard> -->
<task-item :datas="item" v-for="item in list" :key="item.id"></task-item> <task-item :datas="item" v-for="item in list" :key="item.id"></task-item>
</view>
</block> </view>
<!-- <u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText" </block>
<!-- <u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> --> :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> -->
</view> </view>
</template> </template>
<script> <script>
import { getTaskListApi } from '@/api/oa' import {
import { Toast } from '@/libs/uniApi.js' getTaskListApi
import taskItem from "@/components/task/taskItem.vue" } from '@/api/oa'
import { taskLists } from "@/api/task.js" import {
export default { Toast
components:{ } from '@/libs/uniApi.js'
taskItem import taskItem from "@/components/task/taskItem.vue"
}, import {
data() { taskLists
return { } from "@/api/task.js"
skeleton: false, export default {
loadConfig:{ components: {
page: 1, taskItem
limit: 15, },
lastpage: '', data() {
loadingText: '努力加载中', return {
loadmoreText: '轻轻上拉', skeleton: false,
nomoreText: '我也是有底线的~~', loadConfig: {
status: 'loadmore' page: 1,
}, limit: 15,
list: [] lastpage: '',
} loadingText: '努力加载中',
}, loadmoreText: '轻轻上拉',
onLoad() { nomoreText: '我也是有底线的~~',
this.skeleton = true; status: 'loadmore'
}, },
onShow() { list: []
this.loadList(); }
}, },
onReady() { onLoad() {
uni.$on('initOaTask', this.loadList); this.skeleton = true;
}, },
methods: { onShow() {
async loadList(){ this.loadList();
let res = await taskLists({limit: 15, page: 1}); },
this.list = res.data; onReady() {
this.skeleton = false; uni.$on('initOaTask', this.loadList);
} },
}, methods: {
onPullDownRefresh() { async loadList() {
this.loadList(); let res = await taskLists({
this.$u.sleep(500).then(()=>{uni.stopPullDownRefresh()}); limit: 15,
}, page: 1
onReachBottom() { });
}, this.list = res.data;
} this.skeleton = false;
}
},
onPullDownRefresh() {
this.loadList();
this.$u.sleep(500).then(() => {
uni.stopPullDownRefresh()
});
},
onReachBottom() {},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.task_list{ .task_list {
padding-top: 28rpx; padding-top: 28rpx;
} }
.loading{
padding: 28rpx; .loading {
margin-top: 28rpx; padding: 28rpx;
} margin-top: 28rpx;
</style> }
</style>

View File

@ -172,7 +172,7 @@
</view> </view>
</view> </view>
<!-- 镇街公司 --> <!-- 镇街公司 -->
<view v-if='company_type==16'> <view v-if='company_type==41'>
<view class="info"> <view class="info">
<text>可监管车辆数量 {{datas.monitor_num}}</text> <text>可监管车辆数量 {{datas.monitor_num}}</text>
@ -397,6 +397,8 @@
res.data.apply.length >= 2 ? this.applicationList = res.data.apply : this.applicationList = res.data.apply.length >= 2 ? this.applicationList = res.data.apply : this.applicationList =
res.data.apply.slice(0, 2) res.data.apply.slice(0, 2)
this.dataList = res.data.car_list this.dataList = res.data.car_list
this.showLoading = false this.showLoading = false
}) })
} }

View File

@ -1,275 +1,286 @@
<template> <template>
<view class="task_page"> <view class="task_page">
<u-skeleton v-if="skeleton" :class="{'loading': skeleton}" :animate="true" title rows="5" rows-width="92%" <u-skeleton v-if="skeleton" :class="{'loading': skeleton}" :animate="true" title rows="5" rows-width="92%"
rowsHeight="56"> rowsHeight="56">
</u-skeleton> </u-skeleton>
<block v-else> <block v-else>
<view class="card"> <view class="card">
<view class="c_title">{{`任务名称: ${taskInfo.title||''}`}}</view> <view class="c_title">{{`任务名称: ${taskInfo.title||''}`}}</view>
<view>{{taskInfo.content||''}}</view> <view>{{taskInfo.content||''}}</view>
</view> </view>
<view class="card"> <view class="card">
<view class="c_title">{{`学习照片 ( ${study_photo.length}/5 ) 张`}}</view> <view class="c_title">{{`学习照片 ( ${study_photo.length}/5 ) 张`}}</view>
<view class="file"> <view class="file">
<view class="file_item" v-for="(item, index) in study_photo" :key="'file'+index"> <view class="file_item" v-for="(item, index) in study_photo" :key="'file'+index">
<image class="image" :src="item" @click="priview(index)"></image> <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" class="del" src="/static/icons/delete.png"
</image> @click.stop="deleteFile(index)">
</view> </image>
<view v-if="taskInfo.status==2" class="file_btn" @click="chooseFile"> </view>
<image src="/static/icons/plus.png"></image> <view v-if="taskInfo.status==2" class="file_btn" @click="chooseFile">
</view> <image src="/static/icons/plus.png"></image>
<view class="file_empty" v-for="k in placeholderLength" :key="'empty'+k"></view> </view>
</view> <view class="file_empty" v-for="k in placeholderLength" :key="'empty'+k"></view>
</view> </view>
<view class="card"> </view>
<view class="c_title">{{`签到表照片 ( ${sign_in_table?1:0}/1 ) 张`}}</view> <view class="card">
<view class="file"> <view class="c_title">{{`签到表照片 ( ${sign_in_table?1:0}/1 ) 张`}}</view>
<view v-if="sign_in_table" class="file_item"> <view class="file">
<image class="image" :src="sign_in_table" @click="priviewOne(index)"></image> <view v-if="sign_in_table" class="file_item">
<image v-if="taskInfo.status==2 && other.is_commit==0" class="del" src="/static/icons/delete.png" <image class="image" :src="sign_in_table" @click="priviewOne(index)"></image>
@click.stop="deleteFile(index, 'sign_in_table')"> <image v-if="taskInfo.status==2 && other.is_commit==0" class="del"
</image> src="/static/icons/delete.png" @click.stop="deleteFile(index, 'sign_in_table')">
</view> </image>
<view v-if="taskInfo.status==2 && other.is_commit==0 && !sign_in_table" class="file_btn" @click="chooseOneFile"> </view>
<image src="/static/icons/plus.png"></image> <view v-if="taskInfo.status==2 && other.is_commit==0 && !sign_in_table" class="file_btn"
</view> @click="chooseOneFile">
<view class="file_empty"></view> <image src="/static/icons/plus.png"></image>
<view class="file_empty"></view> </view>
</view> <view class="file_empty"></view>
</view> <view class="file_empty"></view>
<view class="card" style="margin-bottom: 160rpx;"> </view>
<view class="c_title">培训内容大纲 (50字以上)</view> </view>
<u--textarea :disabled="taskInfo.status!=2" v-model="study_content" placeholder="请输入内容" <view class="card" style="margin-bottom: 160rpx;">
placeholderStyle="font-size: 22rpx;" count maxlength="500" autoHeight <view class="c_title">培训内容大纲 (50字以上)</view>
style="font-size: 28rpx;background-color: #eee;min-height: 100px;padding-bottom: 50rpx;"></u--textarea> <u--textarea :disabled="taskInfo.status!=2" v-model="study_content" placeholder="请输入内容"
</view> placeholderStyle="font-size: 22rpx;" count maxlength="500" autoHeight
<mybtn v-if="taskInfo.status==2" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn> style="font-size: 28rpx;background-color: #eee;min-height: 100px;padding-bottom: 50rpx;"></u--textarea>
<mybtn v-else-if="taskInfo.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成')"></mybtn> </view>
<mybtn v-else-if="taskInfo.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="approve_status==3" text="已驳回,请重新提交" @click="toUpdate"></mybtn> --> <mybtn v-else-if="taskInfo.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成')">
<mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn> </mybtn>
</block> <mybtn v-else-if="taskInfo.status==5" text="已关闭" :my_btn_disabled="true" @click="showToast('任务已关闭!')">
</view> </mybtn>
<!-- <mybtn v-else-if="approve_status==3" text="已驳回,请重新提交" @click="toUpdate"></mybtn> -->
<mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn>
</block>
</view>
</template> </template>
<script> <script>
import { import {
upLoadImage, upLoadImage,
} from "@/api/file.js"; } from "@/api/file.js";
import { Toast } from "../../libs/uniApi"; import {
import { townTaskDetails, serviceTask4Commit } from "@/api/task.js" Toast
export default { } from "../../libs/uniApi";
data() { import {
return { townTaskDetails,
skeleton: true, serviceTask4Commit
other: { } from "@/api/task.js"
annex: [], // export default {
is_commit: 0, // data() {
note: "", // return {
video_annex: [] // skeleton: true,
}, other: {
taskInfo: { annex: [], //
id: '', is_commit: 0, //
title: '', note: "", //
content: '', video_annex: [] //
extend: {}, },
status: 0 taskInfo: {
}, id: '',
study_photo: [], title: '',
sign_in_table: '', content: '',
study_content: '' extend: {},
} status: 0
}, },
onLoad(options) { study_photo: [],
options.task_id ? this.taskInfo.id = options.task_id : null; sign_in_table: '',
this.initTask(); study_content: ''
}, }
onShow() {}, },
computed: { onLoad(options) {
// options.task_id ? this.taskInfo.id = options.task_id : null;
placeholderLength() { this.initTask();
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; onShow() {},
}, computed: {
}, //
methods: { placeholderLength() {
async initTask() { if (this.taskInfo.status != 2) return this.study_photo.length % 3 == 0 ? 0 : 3 - this.study_photo.length %
this.skeleton = true; 3;
let res = await townTaskDetails({ return (this.study_photo.length + 1) % 3 == 0 ? 0 : 3 - (this.study_photo.length + 1) % 3;
id: this.taskInfo.id },
}); },
this.taskInfo = res.data; methods: {
this.sign_in_table = this.taskInfo?.extend?.town_task_type_4?.sign_in_table; async initTask() {
this.study_content = this.taskInfo?.extend?.town_task_type_4?.study_content; this.skeleton = true;
this.study_photo = JSON.parse(JSON.stringify(this.taskInfo?.extend?.town_task_type_4?.study_photo || [])); let res = await townTaskDetails({
this.skeleton = false; id: this.taskInfo.id
}, });
// this.taskInfo = res.data;
async submit() { this.sign_in_table = this.taskInfo?.extend?.town_task_type_4?.sign_in_table;
if (this.study_photo.length < 5) return Toast('学习照片不能低于5张'); this.study_content = this.taskInfo?.extend?.town_task_type_4?.study_content;
if (!this.sign_in_table) return Toast('签到表照片不能为空'); this.study_photo = JSON.parse(JSON.stringify(this.taskInfo?.extend?.town_task_type_4?.study_photo ||
if (this.study_content.trim().length < 50) return Toast('培训内容不得低于50字'); []));
await serviceTask4Commit({ this.skeleton = false;
id: this.taskInfo.id, },
study_photo: this.study_photo, //
sign_in_table: this.sign_in_table, async submit() {
study_content: this.study_content if (this.study_photo.length < 5) return Toast('学习照片不能低于5张');
}); if (!this.sign_in_table) return Toast('签到表照片不能为空');
this.other.is_commit = 1; if (this.study_content.trim().length < 50) return Toast('培训内容不得低于50字');
// this.taskInfo.approve_status = 1; await serviceTask4Commit({
Toast('提交成功'); id: this.taskInfo.id,
this.$u.sleep(500).then(()=>{ study_photo: this.study_photo,
uni.navigateBack() sign_in_table: this.sign_in_table,
}) study_content: this.study_content
}, });
showToast(str) { this.other.is_commit = 1;
Toast(str) // this.taskInfo.approve_status = 1;
}, Toast('提交成功');
chooseFile() { this.$u.sleep(500).then(() => {
uni.chooseImage({ uni.navigateBack()
count: 5, })
sizeType: ['compressed'], },
success: async (res) => { showToast(str) {
for (let item of res.tempFiles) { Toast(str)
let ul = await upLoadImage({ },
filePath: item.path, chooseFile() {
name: 'file' uni.chooseImage({
}); count: 5,
this.study_photo.push(ul.data.uri); sizeType: ['compressed'],
} success: async (res) => {
} for (let item of res.tempFiles) {
}); let ul = await upLoadImage({
}, filePath: item.path,
priview(index) { name: 'file'
uni.previewImage({ });
urls: this.study_photo, this.study_photo.push(ul.data.uri);
current: index, }
longPressActions: { }
itemList: ['删除'], });
itemColor: '#ff0000', },
success(e) { priview(index) {
if (e.tapIndex == 0) this.deleteFile(e.index); uni.previewImage({
} urls: this.study_photo,
}, current: index,
}) longPressActions: {
}, itemList: ['删除'],
chooseOneFile() { itemColor: '#ff0000',
uni.chooseImage({ success(e) {
count: 1, if (e.tapIndex == 0) this.deleteFile(e.index);
sizeType: ['compressed'], }
success: async (res) => { },
let ul = await upLoadImage({ })
filePath: res.tempFilePaths[0], },
name: 'file' chooseOneFile() {
}); uni.chooseImage({
this.sign_in_table = ul.data.uri; count: 1,
} sizeType: ['compressed'],
}); success: async (res) => {
}, let ul = await upLoadImage({
priviewOne(index) { filePath: res.tempFilePaths[0],
uni.previewImage({ name: 'file'
urls: [this.sign_in_table], });
current: index, this.sign_in_table = ul.data.uri;
longPressActions: { }
itemList: ['删除'], });
itemColor: '#ff0000', },
success(e) { priviewOne(index) {
if (e.tapIndex == 0) this.sign_in_table = ''; uni.previewImage({
} urls: [this.sign_in_table],
}, current: index,
}) longPressActions: {
}, itemList: ['删除'],
// itemColor: '#ff0000',
deleteFile(index, type = 'image') { success(e) {
if (type == 'image') this.study_photo.splice(index, 1); if (e.tapIndex == 0) this.sign_in_table = '';
else if (type == 'sign_in_table') this.sign_in_table = ''; }
}, },
}, })
} },
//
deleteFile(index, type = 'image') {
if (type == 'image') this.study_photo.splice(index, 1);
else if (type == 'sign_in_table') this.sign_in_table = '';
},
},
}
</script> </script>
<style lang="scss"> <style lang="scss">
.task_page { .task_page {
padding-top: 30rpx; padding-top: 30rpx;
.card { .card {
margin: 0 auto; margin: 0 auto;
margin-bottom: 28rpx; margin-bottom: 28rpx;
width: 694rpx; width: 694rpx;
background-color: #fff; background-color: #fff;
border-radius: 26rpx; border-radius: 26rpx;
padding: 28rpx; padding: 28rpx;
.c_title { .c_title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.file { .file {
display: flex; display: flex;
justify-content: left; justify-content: left;
flex-wrap: wrap; flex-wrap: wrap;
&_item { &_item {
flex-shrink: 0; flex-shrink: 0;
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16rpx; margin-bottom: 16rpx;
border: 2px solid #ccc; border: 2px solid #ccc;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
.image { .image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.del { .del {
position: absolute; position: absolute;
height: 40rpx; height: 40rpx;
width: 40rpx; width: 40rpx;
top: 10rpx; top: 10rpx;
right: 10rpx; right: 10rpx;
} }
} }
&_btn { &_btn {
flex-shrink: 0; flex-shrink: 0;
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16rpx; margin-bottom: 16rpx;
border: 2px solid #ccc; border: 2px solid #ccc;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
border-radius: 10rpx; border-radius: 10rpx;
image { image {
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
} }
} }
&_empty { &_empty {
flex-shrink: 0; flex-shrink: 0;
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16rpx; margin-bottom: 16rpx;
border: 2px solid transparent; border: 2px solid transparent;
} }
} }
} }
.loading{ .loading {
padding: 28rpx; padding: 28rpx;
} }
} }
</style> </style>