131 lines
3.0 KiB
Vue
131 lines
3.0 KiB
Vue
<template>
|
||
<view class="pad-x120">
|
||
<!-- 头部 -->
|
||
<status-nav navBarTitle="公告管理"></status-nav>
|
||
<view class="content" :style="{'padding-top':statusHeight+50+'px'}">
|
||
<!-- 公告状态 -->
|
||
<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>
|
||
</view>
|
||
</view>
|
||
<!-- 公告内容 -->
|
||
<view class="notick-txt">
|
||
<view class="notick-tips font26">请编辑公告内容</view>
|
||
<textarea class="input font26" name="msg"></textarea>
|
||
</view>
|
||
<!-- 审核按钮 -->
|
||
<view class="enter-detail-btns color-white font30">
|
||
<view class="btn" @tap="submitEv(1)">发布</view>
|
||
<view class="btn" @tap="ifReason=true">取消</view>
|
||
</view>
|
||
</view>
|
||
<!-- 尾部 -->
|
||
<tabbar :userType="userType" current="2"></tabbar>
|
||
</view>
|
||
</template>
|
||
<script>
|
||
import tabbar from '@/components/tabbar/tabbar';
|
||
export default {
|
||
components:{
|
||
tabbar
|
||
},
|
||
data() {
|
||
return {
|
||
statusHeight:uni.getSystemInfoSync().statusBarHeight, //状态栏高度
|
||
userType:'director', //账户类型 工人:worker 负责人:director
|
||
radioList:['开启','禁用'],
|
||
radioIndex:0, //当前选择
|
||
centerDetail:{}, //工人信息
|
||
reasonMsg:'', //退回理由
|
||
ifReason:false, //是否退回
|
||
id:0, //工人id
|
||
}
|
||
},
|
||
onLoad(op) {
|
||
if(op.id){
|
||
this.id = op.id;
|
||
}
|
||
},
|
||
onShow() {
|
||
// 获取工人信息
|
||
this.getEnterDetail();
|
||
},
|
||
onShareAppMessage(res) {
|
||
let shareObj = {
|
||
title:'工地打卡',
|
||
path: '/pages/pagehome/pagehome',
|
||
imageUrl:'/static/share-logo.jpg',
|
||
}
|
||
// 返回shareObj
|
||
return shareObj;
|
||
},
|
||
methods: {
|
||
// 改变公告开启状态
|
||
changeNotickStatus(index){
|
||
if(this.radioIndex !== index){
|
||
this.radioIndex = index;
|
||
}
|
||
},
|
||
|
||
// 获取工人信息
|
||
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;
|
||
}
|
||
})
|
||
},
|
||
|
||
// 确认&退回
|
||
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 = '';
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
<style scoped>
|
||
|
||
</style> |