eeds_app/pages/tabBar/daiban.vue

577 lines
18 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="content">
<!-- <view class="green-bk"> </view> -->
<!-- <view>
<input class="search-input" placeholder-style="color:#fff " placeholder="搜索业务名称" />
</view> -->
<view class="num-box">
<view class="tab-title" :class="buttonType ==0 ? 'active' : '' " @click="qieHuan(0)"> 待办 </view>
<view class="tab-title" :class="buttonType ==1 ? 'active' : '' " @click="qieHuan(1)"> 已办 </view>
<view class="tab-title" :class="buttonType ==2 ? 'active' : '' " @click="qieHuan(2)"> 全部 </view>
</view>
<view class="list-box">
<view class="list-item" v-for="obj in fenYe.tableData" @click="dbClick(obj)">
<view class="list-row-1">
<view class="list-title slh">{{obj.title}}</view>
<view v-if="obj.type === '0'" class="list-state blue">
{{(obj.plate==="15" || obj.plate==="77" || obj.plate==="88" || obj.plate==="99")?'详情':'待办'}}
</view>
<view v-else class="list-state green">已完成</view>
</view>
<view class="list-row-2">
<view class="list-info-1">{{num2Text(obj.plate)}}</view>
<view class="list-info-2">{{obj.createTime}}</view>
</view>
<view class="list-row-3">
<view v-if="obj.type === '0'" class="percent orange"></view>
<view v-else class="percent green"></view>
</view>
</view>
</view>
<uni-pagination class="fen-ye" :show-icon="true" :current="fenYe.current" :pageSize="10" :total="fenYe.total"
:showIcon="true" @change="fyChange" />
<uni-popup ref="inputDialog" type="dialog" :mask-click="false">
<view :style="{'width':imgWidth,'height':imgHeight}"
style="background-color: azure;font-size: 16px;padding: 10px;border-radius: 10px;position: relative;">
<view @click="closeDialog()"
style="width: 20px;height: 20px;background-image: url('/static/examTraining/guanbi.png');background-size:20px 20px;position: absolute;right: 1px;top: 1px;">
</view>
<view>
<view style="display: inline-block;width: 35%;">{{warns.property1}}</view>
<view style="display: inline-block;width: 65%;">{{warns.value1}}</view>
</view>
<view>
<view style="display: inline-block;width: 35%;">{{warns.property2}}</view>
<view style="display: inline-block;width: 65%;">{{warns.value2}}</view>
</view>
<view>
<view style="display: inline-block;width: 35%;">{{warns.property3}}</view>
<view style="display: inline-block;width: 65%;">{{warns.value3}}</view>
</view>
<view>
<view style="display: inline-block;width: 35%;">{{warns.property4}}</view>
<view style="display: inline-block;width: 65%;">{{warns.value4}}</view>
</view>
<view>
<view style="display: inline-block;width: 35%;">{{warns.property5}}</view>
<view style="display: inline-block;width: 65%;">{{warns.value5}}</view>
</view>
</view>
</uni-popup>
<!-- 人员添加审核 -->
<uni-popup ref="addPersonDialog" type="dialog" :mask-click="false">
<view :style="{'width':imgWidth,'height':imgHeight}"
style="background-color: azure;font-size: 16px;padding: 10px;border-radius: 10px;position: relative;">
<view @click="addPersonCloseDialog()"
style="width: 20px;height: 20px;background-image: url('/static/examTraining/guanbi.png');background-size:20px 20px;position: absolute;right: 1px;top: 1px;">
</view>
<view style="flex: 1; display: flex; align-items: center; justify-content: center;">
<view>{{addPersonExamineMsg}}</view>
</view>
<view style="position: absolute; display: flex; justify-content: space-around; top: 152px; width: 98%;">
<button class="mini-btn" v-show="addPersonButtonShow" type="primary" size="mini"
@click="addPersonExamine(1)">通过审核</button>
<button class="mini-btn" v-show="addPersonButtonShow" type="warn" size="mini"
@click="addPersonExamine(0)">拒绝添加</button>
</view>
</view>
</uni-popup>
</view>
</template>
<script setup>
import {onLoad, onShow} from "@dcloudio/uni-app"
import {reactive, ref} from 'vue'
import HTTP from '/common/request.js'
const buttonType = ref(0)
const fenYe = reactive({
total: 0,
current: 1,
tableData: []
});
const position = ref("");
const inputDialog = ref();
let screenWidth = ref(0);
let screenHeight = ref(0);
const imgWidth = ref('');
const imgHeight = ref('');
const warns = reactive({
property1: null,
value1: null,
property2: null,
value2: null,
property3: null,
value3: null,
property4: null,
value4: null,
property5: null,
value5: null
})
onLoad((option) => {
uni.getStorage({
key: 'personnelPositions',
success: function(res) {
// console.log(res);
position.value = res.data;
}
});
uni.getSystemInfo({
success: (res) => {
// console.log(res);
screenWidth.value = res.windowWidth;
screenHeight.value = res.windowHeight;
imgWidth.value = 0.9 * screenWidth.value + 'px';
imgHeight.value = 0.25 * screenHeight.value + 'px';
// console.log("imgWidth"+imgWidth.value+"imgHeight"+imgHeight.value);
}
})
})
// 获取表格数据【0是待办 1是已办 2全部】
const getTable = async () => {
// const data = await HTTP.get('/backLog/getBackLogList', {
const data = await HTTP.get('/backLog/getBackLogListByApp', {
current: fenYe.current,
size: 10,
type: buttonType.value == 2 ? '' : buttonType.value
})
fenYe.total = data.total
fenYe.tableData = data.records
// console.log(toRaw(fenYe.tableData));
}
// 页面显示
onShow(() => {
getApp().globalData.reviseTabbarBySelect();
// 查询待办数量
getApp().globalData.setBadgeNumberFun();
getTable()
// 打卡页面控制
getApp().globalData.daKaUrlType = null
})
// 类别按钮切换
const qieHuan = type => {
buttonType.value = type
fenYe.total = 0
fenYe.current = 1
fenYe.tableData = []
getTable()
}
// 分页按钮点击事件
const fyChange = (e) => {
fenYe.current = e.current
getTable()
}
const addPersonExamineMsg = ref('')
const addPersonDialog = ref(false)
const addPersonButtonShow = ref(false)
// 代办点击
const dbClick = async (obj) => {
let duchaType = null;
if (obj.plate === "1" || obj.plate === "2" || obj.plate === "3" || obj.plate === "4") {
let res = await HTTP.get(`/securityCheckNotice/detail/${obj.palteId}`);
// console.log(res);
duchaType = res.type;
}
// console.log(obj);
// console.log(duchaType);
// 根据 所属板块 和 待办/已办 生成需要跳转页面详情的url
let url = num2Url(obj.plate, obj.type, duchaType);
// console.log(url);
if (url) {
url += obj.palteId
uni.navigateTo({
url
})
} else {
// 人员添加审核
if (obj.plate === '15') {
addPersonButtonShow.value = obj.type == 0
const data = await HTTP.get(`/personFile/addPersonExamine/${obj.palteId}`);
addPersonExamineMsg.value = data
personId.value = obj.palteId
addPersonDialog.value.open();
return
}
//获取临期提醒详情
const data = await HTTP.get(`/backLog/getBackLogDetail/${obj.id}`);
// console.log(data);
if (data) {
//处理临期提醒
if (obj.plate === '77') {
warns.property1 = '分包商名称';
warns.value1 = data.name;
warns.property2 = '所属单位';
warns.value2 = data.subordinateUnitsName;
warns.property3 = '资质名称';
warns.value3 = data.type1;
warns.property4 = '有效截止日期';
warns.value4 = data.endTime ? data.endTime : "临期日期不完整,请补全";
warns.property5 = '临期天数';
warns.value5 = !data.endTime ? "临期日期不全" : data.daysRemaining;
} else if (obj.plate === '88') {
warns.property1 = '工器具名称';
warns.value1 = data.name;
warns.property2 = '规格型号';
warns.value2 = data.specificationModel;
warns.property3 = '单位';
warns.value3 = data.type1;
warns.property4 = '下次实验时间';
warns.value4 = data.endTime;
warns.property5 = '临期天数';
warns.value5 = data.daysRemaining;
} else if (obj.plate === '99') {
warns.property1 = '人员姓名';
warns.value1 = data.name;
warns.property2 = '所属单位';
warns.value2 = data.subordinateUnitsName;
warns.property3 = '名称';
warns.value3 = data.type1;
warns.property4 = '有效日期';
warns.value4 = data.endTime;
warns.property5 = '临期天数';
warns.value5 = data.daysRemaining;
}
inputDialog.value.open();
} else {
uni.showToast({
title: "app暂时不支持查看此种类型数据具体请去网页端操作",
duration: 2000,
icon: 'none'
});
}
}
}
const personId = ref('')
const addPersonExamine = async (type) => {
await HTTP.post(`/personFile/addExamine/${personId.value}/${type}`)
if (type == 1) {
uni.showToast({
title: "操作成功",
duration: 2000,
icon: 'none'
});
} else {
uni.showToast({
title: "拒绝添加成功,相关添加信息已删除",
duration: 2000,
icon: 'none'
});
}
// 查询待办数量
getApp().globalData.setBadgeNumberFun();
getTable()
addPersonCloseDialog()
}
const closeDialog = () => {
inputDialog.value.close();
}
const addPersonCloseDialog = () => {
addPersonDialog.value.close()
}
// 编码转字符串【1:督察详情 2:督察审核 3:整改通知详情 4:整改通知审核 5:整改报告详情 6:整改报告审核 7:提交整改报告 8:整改报告驳回修改 9:整改回执详情 10:整改回执审核 11:整改回执驳回修改】
const num2Text = num => {
switch (num) {
case '0':
return '作业票审核'
case '1':
return '督察详情'
case '2':
return '督察审核'
case '3':
return '督察驳回待提交'
case '4':
return '督察草稿待提交'
case '5':
return '整改报告详情'
case '6':
return '整改报告审核'
case '7':
return '提交整改报告'
case '8':
return '整改报告驳回修改'
case '9':
return '整改回执详情'
case '10':
return '整改回执审核'
case '11':
return '整改回执驳回修改'
case '12':
return '提交整改回执'
case '13':
return '作业计划审核'
case '14':
return '三措审核'
case '15':
return '人员添加审核'
default:
return '其他'
}
}
// 编码转URL【1:督察详情 2:督察审核 3:整改通知详情 4:整改通知审核 5:整改报告详情 6:整改报告审核 7:提交整改报告 8:整改报告驳回修改 9:整改回执详情 10:整改回执审核 11:整改回执驳回修改】
const num2Url = (num, type, duchaType) => {
// console.log(num);
// console.log(type)// 0代办 1已办
// console.log("position"+position.value);
type = type + '';
if (num === '1' || (num === '2' && type === '1')) {
if (position.value.includes('11') || position.value.includes('22')) {
return '/pages/ducha/xiangmubuduchaxiangqing?type=daiban&businessId=';
} else {
if (duchaType === 1) {
return '/pages/ducha/duchaxiangqing?type=daiban&businessId=';
} else if (duchaType === 11) {
return '/pages/ducha/duchaxiangqingxiangmubu?type=daiban&businessId=';
}
}
} else if (num === '2' && type === '0') {
if (position.value.includes('11') || position.value.includes('22')) {
return '/pages/ducha/xiangmubuduchashehe?type=daiban&businessId=';
} else {
if (duchaType === 1) {
return '/pages/ducha/duchashehe?type=daiban&businessId=';
} else if (duchaType === 11) {
return '/pages/ducha/duchashehexiangmubu?type=daiban&businessId=';
}
}
} else if (num === '4' && type === '1') {
if (position.value.includes('22')) {
return '/pages/ducha/xiangmubuduchaxiangqing?type=daiban&businessId=';
} else if (position.value.includes('4')) {
if (duchaType === 1) {
return '/pages/ducha/duchaxiangqing?type=daiban&businessId=';
} else if (duchaType === 11) {
return '/pages/ducha/duchaxiangqingxiangmubu?type=daiban&businessId=';
}
}
} else if (num === '4' && type === '0') {
if (position.value.includes('22')) {
return '/pages/ducha/xiangmubuduchabohuitijiao?submitType=submit&type=daiban&businessId=';
} else if (position.value.includes('4')) {
if (duchaType === 1) {
return '/pages/ducha/duchabohuitijiao?submitType=submit&type=daiban&businessId=';
} else if (duchaType === 11) {
return '/pages/ducha/duchabohuitijiaoxiangmubu?submitType=submit&type=daiban&businessId=';
}
}
} else if (num === '3' && type === '1') {
if (position.value.includes('22')) {
return '/pages/ducha/xiangmubuduchaxiangqing?type=daiban&businessId=';
} else if (position.value.includes('4')) {
if (duchaType === 1) {
return '/pages/ducha/duchaxiangqing?type=daiban&businessId=';
} else if (duchaType === 11) {
return '/pages/ducha/duchaxiangqingxiangmubu?type=daiban&businessId=';
}
}
} else if (num === '3' && type === '0') {
if (position.value.includes('22')) {
return '/pages/ducha/xiangmubuduchabohuitijiao?submitType=modifySubmit&type=daiban&businessId=';
} else if (position.value.includes('4')) {
if (duchaType === 1) {
return '/pages/ducha/duchabohuitijiao?submitType=modifySubmit&type=daiban&businessId=';
} else if (duchaType === 11) {
return '/pages/ducha/duchabohuitijiaoxiangmubu?submitType=modifySubmit&type=daiban&businessId=';
}
}
} else if (num === '5' || (num === '6' && type === '1') || (num === '7' && type === '1') || (num === '8' &&
type === '1')) {
return '/pages/zhenggaibaogao/guanli/zhenggaibaogaoxiangqing?type=daiban&businessId=';
} else if (num === '6' && type === '0') {
return '/pages/zhenggaibaogao/guanli/zhenggaibaogaoshenhe?type=daiban&businessId=';
} else if (num === '7' && type === '0') {
return '/pages/zhenggaibaogao/guanli/zhenggaibaogaotijiao?type=daiban&businessId=';
} else if (num === '8' && type === '0') {
return '/pages/zhenggaibaogao/guanli/zhenggaibaogaobohuitijiao?type=daiban&businessId=';
} else if (num === '9' || (num === '10' && type === '1') || (num === '11' && type === '1') || (num === '12' &&
type === '1')) {
return '/pages/zhenggaihuizhi/guanli/zhenggaihuizhixiangqing?type=daiban&businessId=';
} else if (num === '10' && type === '0') {
return '/pages/zhenggaihuizhi/guanli/zhenggaihuizhishenhe?type=daiban&businessId=';
} else if (num === '11' && type === '0') {
return '/pages/zhenggaihuizhi/guanli/zhenggaihuizhibohuitijiao?type=daiban&businessId=';
} else if (num === '12' && type === '0') {
return '/pages/zhenggaihuizhi/guanli/zhenggaihuizhitijiao?type=daiban&businessId=';
//作业票审核
} else if (num === '0' && type === '0') {
return '/pages/zuoye/zuoyepiaoshenhe?type=daiban&businessId=';
//作业票详情
} else if ((num === '0' && type === '1') || (num === '96' && type === '0')) {
// console.log("作业票详情")
return '/pages/zuoye/zuoyepiaoxiangqing?type=daiban&businessId=';
//作业日计划
} else if (num === '13' && type === '0') {
return '/pages/zuoye/zuoyerishenhe?type=daiban&businessId=';
//作业日计划详情
} else if ((num === '13' && type === '1') || num === '97' || num === '98') {
// console.log("作业票日详情")
return '/pages/zuoye/zuoyerixiangqing?type=daiban&businessId=';
} else if (num === '14' && type === '0') {
// console.log("三措审核")
return '/pages/sancuo/sancuoshenhe?type=daiban&businessId=';
} else if (num === '14' && type === '1') {
// console.log("三措详情")
return '/pages/sancuo/sancuoxiangqing?type=daiban&businessId=';
} else {
return '';
}
}
// 1督察详情/pages/ducha/duchaxiangqing?businessId=XXX&type=daiban
// 2督察审核/pages/ducha/duchashehe?businessId=XXX&type=daiban
// 3整改通知详情/pages/zhenggaitongzhi/guanli/zhenggaitongzhixiangqing?businessId=XXX&type=daiban
// 4整改通知审核/pages/zhenggaitongzhi/guanli/zhenggaitongzhishenhe?businessId=XXX&type=daiban
// 5整改报告详情/pages/zhenggaibaogao/guanli/zhenggaibaogaoxiangqing?businessId=XXX&type=daiban
// 6整改报告审核/pages/zhenggaibaogao/guanli/zhenggaibaogaoshenhe?businessId=XXX&type=daiban
// 7提交整改报告/pages/zhenggaibaogao/guanli/zhenggaibaogaotijiao?type=daiban&businessId=
// 8整改报告被驳回修改/pages/zhenggaibaogao/guanli/zhenggaibaogaobohuitijiao?businessId=XXX&type=daiban
// 9整改回执详情/pages/zhenggaihuizhi/guanli/zhenggaihuizhixiangqing?businessId=XXX&type=daiban
// 10整改回执审核/pages/zhenggaihuizhi/guanli/zhenggaihuizhishenhe?businessId=XXX&type=daiban
// 11整改回执被驳回修改/pages/zhenggaihuizhi/guanli/zhenggaihuizhibohuitijiao?businessId=XXX&type=daiban
// 12提交整改回执/pages/zhenggaihuizhi/guanli/zhenggaihuizhitijiao?type=daiban&businessId=
</script>
<style>
.num-box {
width: 700rpx;
background-color: white;
border: 1rpx solid rgba(215, 215, 215, 1);
border-radius: 8rpx;
margin-left: 25rpx;
display: flex;
text-align: center;
}
.tab-title {
margin: 30rpx 0;
font-size: 32rpx;
position: relative;
flex: 1;
}
.tab-title.active {
color: rgb(33, 196, 198);
}
.tab-title.active::after {
content: '';
width: 100rpx;
height: 6rpx;
background-color: rgb(33, 196, 198);
position: absolute;
bottom: -18rpx;
left: 66rpx;
}
.list-box {
display: flex;
flex-direction: column;
align-items: center;
margin-left: 25rpx;
width: 700rpx;
}
.list-item {
background-color: white;
border: 1rpx solid rgba(215, 215, 215, 1);
margin-top: 20rpx;
}
.list-item:last-child {
margin-bottom: 20rpx;
}
.list-row-1,
.list-row-2,
.list-row-3 {
display: flex;
}
.list-title {
color: #333;
margin: 20rpx;
flex: 1
}
.list-state {
margin: 20rpx;
color: white;
font-size: 26rpx;
font-weight: 600;
text-align: center;
height: 40rpx;
line-height: 40rpx;
width: 100rpx;
border-radius: 40rpx;
}
.list-state.green {
background-color: rgba(8, 187, 65, 1)
}
.list-state.blue {
background-color: rgba(36, 210, 208, 1)
}
.list-row-2 {
font-size: 24rpx;
}
.list-info-1 {
margin: 0 0 20rpx 20rpx;
color: #666;
flex: 1
}
.list-info-2 {
margin: 0 20rpx 0 0;
color: #aaa;
}
.list-row-3 {
height: 6rpx;
background-color: #ddd;
margin-bottom: 20rpx;
width: 620rpx;
margin-left: 30rpx;
margin-right: 30rpx;
}
.percent.green {
width: 630rpx;
background-color: rgba(8, 187, 65, 1);
}
.percent.orange {
width: 50%;
background-color: rgba(245, 154, 35, 1);
}
.fen-ye {
width: 680rpx;
margin-left: 35rpx;
margin-bottom: 10rpx;
}
</style>