2022-11-18 10:33:37 +00:00
|
|
|
|
<template>
|
|
|
|
|
<view class="pad-x120">
|
|
|
|
|
<!-- 头部 -->
|
2022-12-22 08:47:05 +00:00
|
|
|
|
<status-nav navBarTitle="公告管理"></status-nav>
|
2022-11-18 10:33:37 +00:00
|
|
|
|
<view class="content" :style="{'padding-top':statusHeight+50+'px'}">
|
2022-12-22 08:47:05 +00:00
|
|
|
|
<!-- 公告状态 -->
|
|
|
|
|
<view class="notick-status">
|
|
|
|
|
<view class="radio-item" @tap="changeNotickStatus(index)" v-for="(item,index) in radioList" :key="index">
|
|
|
|
|
<view :class="radioIndex==index?'checked':''"></view>
|
|
|
|
|
<view class="font26">{{item}}</view>
|
2022-12-08 10:07:45 +00:00
|
|
|
|
</view>
|
2022-11-18 10:33:37 +00:00
|
|
|
|
</view>
|
2022-12-22 08:47:05 +00:00
|
|
|
|
<!-- 公告内容 -->
|
|
|
|
|
<view class="notick-txt">
|
|
|
|
|
<view class="notick-tips font26">请编辑公告内容</view>
|
|
|
|
|
<textarea class="input font26" name="msg"></textarea>
|
2022-11-18 10:33:37 +00:00
|
|
|
|
</view>
|
2022-12-22 08:47:05 +00:00
|
|
|
|
<!-- 审核按钮 -->
|
|
|
|
|
<view class="enter-detail-btns color-white font30">
|
|
|
|
|
<view class="btn" @tap="submitEv(1)">发布</view>
|
|
|
|
|
<view class="btn" @tap="ifReason=true">取消</view>
|
2022-12-08 10:07:45 +00:00
|
|
|
|
</view>
|
2022-11-18 10:33:37 +00:00
|
|
|
|
</view>
|
|
|
|
|
<!-- 尾部 -->
|
2022-12-22 09:36:10 +00:00
|
|
|
|
<tabbar :userType="userType" current="2"></tabbar>
|
2022-11-18 10:33:37 +00:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import tabbar from '@/components/tabbar/tabbar';
|
|
|
|
|
export default {
|
|
|
|
|
components:{
|
|
|
|
|
tabbar
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
statusHeight:uni.getSystemInfoSync().statusBarHeight, //状态栏高度
|
|
|
|
|
userType:'director', //账户类型 工人:worker 负责人:director
|
2022-12-22 08:47:05 +00:00
|
|
|
|
radioList:['开启','禁用'],
|
|
|
|
|
radioIndex:0, //当前选择
|
2022-12-08 10:07:45 +00:00
|
|
|
|
centerDetail:{}, //工人信息
|
|
|
|
|
reasonMsg:'', //退回理由
|
2022-11-24 06:05:03 +00:00
|
|
|
|
ifReason:false, //是否退回
|
2022-11-18 10:33:37 +00:00
|
|
|
|
id:0, //工人id
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad(op) {
|
|
|
|
|
if(op.id){
|
|
|
|
|
this.id = op.id;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
|
|
|
|
// 获取工人信息
|
|
|
|
|
this.getEnterDetail();
|
2022-12-08 10:07:45 +00:00
|
|
|
|
},
|
|
|
|
|
onShareAppMessage(res) {
|
|
|
|
|
let shareObj = {
|
|
|
|
|
title:'工地打卡',
|
|
|
|
|
path: '/pages/pagehome/pagehome',
|
|
|
|
|
imageUrl:'/static/share-logo.jpg',
|
|
|
|
|
}
|
|
|
|
|
// 返回shareObj
|
|
|
|
|
return shareObj;
|
2022-11-18 10:33:37 +00:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2022-12-22 08:47:05 +00:00
|
|
|
|
// 改变公告开启状态
|
|
|
|
|
changeNotickStatus(index){
|
|
|
|
|
if(this.radioIndex !== index){
|
|
|
|
|
this.radioIndex = index;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2022-11-18 10:33:37 +00:00
|
|
|
|
// 获取工人信息
|
|
|
|
|
getEnterDetail(){
|
|
|
|
|
this.$requst.post('/api/v1/manager/check-detail',{id:this.id}).then(res=>{
|
|
|
|
|
if(res.code == 0){
|
|
|
|
|
console.log(res,'工人信息');
|
|
|
|
|
this.centerDetail = res.data;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 确认&退回
|
2022-12-08 10:07:45 +00:00
|
|
|
|
submitEv(type){
|
|
|
|
|
if(type==0){
|
|
|
|
|
let params = {
|
|
|
|
|
id:this.id,
|
|
|
|
|
type:type,
|
|
|
|
|
reason:this.reasonMsg
|
|
|
|
|
}
|
|
|
|
|
// 提交
|
|
|
|
|
this.submitApi(params,type);
|
|
|
|
|
}else{
|
|
|
|
|
let params = {
|
|
|
|
|
id:this.id,
|
|
|
|
|
type:type
|
|
|
|
|
}
|
|
|
|
|
// 提交
|
|
|
|
|
this.submitApi(params,type);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 提交
|
|
|
|
|
submitApi(params,type){
|
|
|
|
|
console.log(params,type,123)
|
|
|
|
|
this.$requst.post('/api/v1/manager/check-info',params).then(res=>{
|
|
|
|
|
if(res.code == 0){
|
|
|
|
|
if(type==0){
|
|
|
|
|
this.$toolAll.tools.showToast('已退回');
|
|
|
|
|
}else{
|
|
|
|
|
this.$toolAll.tools.showToast('已确认');
|
|
|
|
|
}
|
|
|
|
|
uni.reLaunch({
|
|
|
|
|
url:'/pages/director/enter/enter'
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.$toolAll.tools.showToast(res.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 关闭退回弹窗
|
|
|
|
|
closeReason(){
|
|
|
|
|
this.ifReason = false;
|
|
|
|
|
this.reasonMsg = '';
|
2022-11-18 10:33:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
</style>
|