小程序任务

This commit is contained in:
shilixia 2020-04-02 15:05:35 +08:00
parent b80ed4c5c9
commit ae4b7715d3
20 changed files with 1224 additions and 2 deletions

View File

@ -75,7 +75,9 @@
"pages/data/index", "pages/data/index",
"pages/examtest/rate", "pages/examtest/rate",
"pages/data/detail", "pages/data/detail",
"pages/totalrate/index" "pages/totalrate/index",
"pages/checkjob/yanshou",
"pages/checkjob/job"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",

View File

@ -19,7 +19,7 @@ Page({
}, },
denglu: function(){ denglu: function(){
var that=this var that=this
// console.log(that.data) console.log(that.data)
wx.request({ wx.request({
url: getApp().globalData.serverUrl + 'bindmp', url: getApp().globalData.serverUrl + 'bindmp',
header: { header: {

99
pages/checkjob/detail.js Normal file
View File

@ -0,0 +1,99 @@
var util = require('../../utils/util.js')
// pages/observe/observedetail.js
Page({
/**
* 页面的初始数据
*/
data: {
serverUrl: getApp().globalData.serverUrl
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getGcdetail(options.id);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
lookimgPreview: function (e) {
var current = e.target.dataset.src
wx.previewImage({
current: current,
urls: this.data.lookimg
})
},
getGcdetail: function (id) {
wx.showLoading({
title: '加载中',
}),
wx.request({
url: this.data.serverUrl + 'api/checkproject?a=checkjobdetail&id=' + id,
header: {
'content-type': 'application/json', // 默认值
'Cookie': getApp().globalData.sessionId,
},
data: {
},
success: res => {
wx.hideLoading();
console.log(res.data);
if (res.statusCode === 200) {
var data = res.data
//格式化观察信息
this.setData(data)
}
}
});
},
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

101
pages/checkjob/detail.wxml Normal file
View File

@ -0,0 +1,101 @@
<view class="topban">任务详情</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>任务名称</view>
</view>
<view class="weui-cell__ft">
{{checktask__checktaskname}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查人</view>
</view>
<view class="weui-cell__ft">
{{checkname__username}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查时间</view>
</view>
<view class="weui-cell__ft">
{{checktask__checktime}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查内容</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{checktask__checktype__checkcontent}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查发现问题</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{checkquestion}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>整改情况</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{zgjg}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查状态</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{taskstate==1?'正在检查':'检查完毕'}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查地点</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{checktask__checkplace}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>处罚内容</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{content}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>被处罚人员</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{bcfr==[]?'kkl':bcfr}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>验收人</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{yanshouren__name}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>验收时间</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{yanshou}}
</view>
</view>
</view>

View File

@ -0,0 +1,20 @@
.weui-btn{
width:auto;
margin: 5px;
}
.container {
background-color: #fff;
color: #939393;
}
.head{
color:#fff;
background-color: cornflowerblue;
text-align: center;
}
.topban{
color:#fff;
background-color: rgb(26, 182, 143);
height:30x;
text-align: center;
}

277
pages/checkjob/index.js Normal file
View File

@ -0,0 +1,277 @@
// pages/suggest/suggest.js
var sliderWidth = 96;
Page({
/**
* 页面的初始数据
*/
data: {
page: 1,
serverUrl: getApp().globalData.serverUrl,
alllist: [],
tabs: ["我的任务", "全部任务", "验收任务"],
activeIndex: 1,
sliderOffset: 0,
sliderLeft: 0
},
tabClick: function (e) {
var that = this
that.setData({
sliderOffset: e.currentTarget.offsetLeft,
activeIndex: e.currentTarget.id
});
if (that.data.activeIndex == 0) {
that.getmylist(1)
that.data.mypage = 1
}
else if (that.data.activeIndex == 1) {
that.gettodolist(1)
that.data.todopage = 1
}
else if (that.data.activeIndex == 2) {
that.getalllist(1)
that.data.page = 1
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
sliderLeft: (res.windowWidth / that.data.tabs.length - sliderWidth) / 2,
sliderOffset: res.windowWidth / that.data.tabs.length * that.data.activeIndex
});
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var that = this;
that.onPullDownRefresh();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
var that = this;
if (that.data.activeIndex == 0) {
that.getmylist(1)
wx.stopPullDownRefresh();
that.data.mypage = 1
}
else if (that.data.activeIndex == 1) {
that.gettodolist(1)
wx.stopPullDownRefresh();
that.data.todopage = 1
}
else if (that.data.activeIndex == 2) {
that.getalllist(1)
wx.stopPullDownRefresh();
that.data.page = 1
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
//上拉分页,将页码加1然后调用分页函数
var that = this;
if (that.data.activeIndex == 0) {
this.data.mypage = this.data.mypage + 1;
this.getmylist();
}
else if (that.data.activeIndex == 1) {
this.data.todopage = this.data.todopage + 1;
this.gettodolist();
}
else if (that.data.activeIndex == 2) {
this.data.page = this.data.page + 1;
this.getalllist();
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
getalllist: function (page) {
var that = this;
if (page != 1) { page = that.data.page }
wx.showLoading({
title: '加载中',
}),
wx.request({
url: this.data.serverUrl + 'api/checkproject?a=listchuli&rows=10&page=' + page,
header: {
'content-type': 'application/json', // 默认值
'Cookie': getApp().globalData.sessionId,
},
success: res => {
if (res.statusCode === 200) {
if (res.data.rows.length == 0) {
if (page == 1) {
this.setData({
total: 0,
alllist: []
})
}
else {
wx.showModal({
content: "已经到底啦!",
showCancel: false,
confirmText: "确定",
})
}
} else {
let list
if (page == 1) {
list = res.data.rows
} else {
list = this.data.alllist.concat(res.data.rows)
}
this.setData({
total: res.data.total,
alllist: list
})
}
}
wx.hideLoading();
}
});
},
getmylist: function (page) {
var that = this;
if (page != 1) { page = that.data.mypage }
wx.showLoading({
title: '加载中',
}),
wx.request({
url: this.data.serverUrl + 'api/checkproject?a=listself&rows=10&page=' + page,
header: {
'content-type': 'application/json', // 默认值
'Cookie': getApp().globalData.sessionId,
},
success: res => {
if (res.statusCode === 200) {
if (res.data.rows.length == 0) {
if (page == 1) {
this.setData({
donetotal: 0,
donelist: []
})
}
else {
wx.showModal({
content: "已经到底啦!",
showCancel: false,
confirmText: "确定",
})
}
} else {
let list
if (page == 1) {
list = res.data.rows
} else {
list = this.data.donelist.concat(res.data.rows)
}
this.setData({
donetotal: res.data.total,
donelist: list
})
}
}
wx.hideLoading();
}
});
},
scan: function () {
wx.scanCode({
onlyFromCamera: true,
success(res) {
console.log(res)
let id = res.result.split('=')[1]
wx.navigateTo({
url: 'check?riskact=' + id,
})
}
})
},
gettodolist: function (page) {
var that = this;
if (page != 1) { page = that.data.todopage }
wx.showLoading({
title: '加载中',
}),
wx.request({
url: this.data.serverUrl + 'api/checkproject?a=listallx&rows=10&page=' + page,
header: {
'content-type': 'application/json', // 默认值
'Cookie': getApp().globalData.sessionId,
},
success: res => {
if (res.statusCode === 200) {
console.log(res.data)
if (res.data.rows.length == 0) {
if (page == 1) {
this.setData({
todototal: 0,
todolist: []
})
}
else {
wx.showModal({
content: "已经到底啦!",
showCancel: false,
confirmText: "确定",
})
}
} else {
let list
if (page == 1) {
list = res.data.rows
} else {
list = this.data.todolist.concat(res.data.rows)
}
this.setData({
todototal: res.data.total,
todolist: list
})
}
}
wx.hideLoading();
}
});
},
})

View File

@ -0,0 +1,5 @@
{
"navigationBarTitleText": "排查任务",
"enablePullDownRefresh": true,
"onReachBottomDistance": 20
}

106
pages/checkjob/index.wxml Normal file
View File

@ -0,0 +1,106 @@
<view class="weui-tab">
<view class="weui-navbar">
<block wx:for="{{tabs}}" wx:key="*this">
<view id="{{index}}" class="weui-navbar__item {{activeIndex == index ? 'weui-bar__item_on' : ''}}" bindtap="tabClick">
<view class="weui-navbar__title">{{item}}</view>
</view>
</block>
<view class="weui-navbar__slider" style="left: {{sliderLeft}}px; transform: translateX({{sliderOffset}}px); -webkit-transform: translateX({{sliderOffset}}px);"></view>
</view>
<!-- 我的任务 -->
<view class="weui-tab__panel">
<view class="weui-tab__content" hidden="{{activeIndex != 0}}">
<view class="head">共{{donetotal}}条</view>
<view class="weui-cells weui-cells_after-title">
<block wx:for="{{donelist}}" wx:key="unique">
<navigator url="job?id={{item.id}}" class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-media-box__title">
<span style="background-color:green;color:white"></span>
{{item.checktask__checktaskname}}
</view>
<view class="weui-media-box__desc">
<span style="background-color:orange;color:white"></span>
<view class="weui-media-box__title" wx:if="{{item.jobstate == 1}}" style="font-size:12px;color:green">可执行</view>
<view class="weui-media-box__title" wx:if="{{item.jobstate == 2}}" style="font-size:12px;color:red">已过期</view>
</view>
<view class="weui-media-box__desc">任务开始时间:{{item.starttime}}</view>
<view class="weui-media-box__desc">任务过期时间:{{item.endtime}}</view>
</view>
<view class="weui-panel__ft weui-cell__ft_in-access">
<view class="weui-media-box__title" wx:if="{{item.taskstate == 1}}" style="background-color:blue;color:white">正在检查</view>
<view class="weui-media-box__title" wx:if="{{item.taskstate == 2}}" style="background-color:yellow">检查完毕</view>
<view class="weui-media-box__title" wx:if="{{item.taskstate == 3}}" style="background-color:orange">任务关闭</view>
</view>
</navigator>
</block>
</view>
</view>
<!-- 全部任务 -->
<view class="weui-tab__content" hidden="{{activeIndex != 1}}">
<view class="head">共{{todototal}}条任务</view>
<view class="weui-cells weui-cells_after-title">
<block wx:for="{{todolist}}" wx:key="unique">
<navigator url="detail?id={{item.id}}" class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-media-box__title">
{{item.checktask__checktaskname}}
</view>
<view class="weui-media-box__desc">
<span style="background-color:green;color:white">{{item.checkname__username}} </span>
<view class="weui-media-box__title" wx:if="{{item.jobstate == 1}}" style="font-size:12px;color:green">可执行</view>
<view class="weui-media-box__title" wx:if="{{item.jobstate == 2}}" style="font-size:12px;color:red">已过期</view>
</view>
<view class="weui-media-box__desc">任务开始时间:{{item.starttime}}</view>
<view class="weui-media-box__desc">任务过期时间:{{item.endtime}}</view>
</view>
<view class="weui-panel__ft weui-cell__ft_in-access">
<view class="weui-media-box__title" wx:if="{{item.taskstate == 1}}" style="background-color:green;color:white">正在检查</view>
<view class="weui-media-box__title" wx:if="{{item.taskstate == 2}}" style="background-color:red">检查完毕</view>
<view class="weui-media-box__title" wx:if="{{item.taskstate == 3}}" style="background-color:orange">任务关闭</view>
</view>
</navigator>
</block>
</view>
</view>
<!-- 验收任务 -->
<view class="weui-tab__content" hidden="{{activeIndex != 2}}">
<view class="head">共{{total}}条任务</view>
<view class="weui-cells weui-cells_after-title">
<block wx:for="{{alllist}}" wx:key="unique">
<navigator url="yanshou?id={{item.id}}" class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-media-box__title">
{{item.checktask__checktaskname}}
</view>
<view class="weui-media-box__desc">
<view class="weui-media-box__title" wx:if="{{item.jobstate == 1}}" style="font-size:12px;color:green">可执行</view>
<view class="weui-media-box__title" wx:if="{{item.jobstate == 2}}" style="font-size:12px;color:red">已过期</view>
</view>
<view class="weui-media-box__desc">任务开始时间:{{item.starttime}}</view>
<view class="weui-media-box__desc">任务过期时间:{{item.endtime}}</view>
</view>
<view class="weui-panel__ft weui-cell__ft_in-access">
<view class="weui-media-box__title" wx:if="{{item.taskstate == 1}}" style="background-color:blue;color:white">正在检查</view>
<view class="weui-media-box__title" wx:if="{{item.taskstate == 2}}" style="background-color:yellow">检查完毕</view>
<view class="weui-media-box__title" wx:if="{{item.taskstate == 3}}" style="background-color:orange">任务关闭</view>
</view>
</navigator>
</block>
</view>
</view>
</view>
</view>
<!-- <view style="position:fixed;bottom:0;left:0;width:100%;" hidden="{{activeIndex != 1}}">
<button class="weui-btn" type="primary" style="width:auto;margin:5px" bindtap="scan">扫一扫风险点</button>
</view> -->

14
pages/checkjob/index.wxss Normal file
View File

@ -0,0 +1,14 @@
.weui-btn{
width:auto;
margin: 5px;
}
.container {
background-color: #fff;
color: #939393;
}
.head{
color:#fff;
background-color: cornflowerblue;
text-align: center;
}

199
pages/checkjob/job.js Normal file
View File

@ -0,0 +1,199 @@
var util = require('../../utils/util.js')
// pages/observe/observedetail.js
Page({
/**
* 页面的初始数据
*/
data: {
serverUrl: getApp().globalData.serverUrl,
items: [
{ name: '1', value: '正在整改中'},
{ name: '2', value: '已整改完成' },
]
},
bindjcwtInput: function (e) {
this.data.jcwt = e.detail.value
},
bindzgqkInput: function (e) {
this.data.zgqk = e.detail.value
},
bindcfnrInput: function (e) {
this.data.cfnr = e.detail.value
},
radioChange: function (e) {
this.data.jczt = e.detail.value
},
submit: function () {
if (!this.data.jcwt) {
this.Tap1('请填写检查问题!')
}
else if (!this.data.zgqk) {
this.Tap1('请填写整改情况!')
}
else if (!this.data.jczt) {
this.Tap1('请选择检查状态!')
}
else {
this.addjob()
}
},
Tap1: function (x) {
wx.showModal({
title: "系统提示",
content: x,
showCancel: false,
confirmText: "确定"
})
},
addjob: function () {
var jobdata = {
checkquestion: this.data.jcwt,//检查问题
zgjg: this.data.zgqk,//整改情况
content: this.data.cfnr,//处罚内容
taskstate: this.data.jczt,//检查状态
participant: this.data.cjry,//处罚人
}
console.log(jobdata)
wx.showModal({
title: '系统提示',
content: '确认提交!',
confirmText: "确定",
cancelText: "取消",
success: (res)=> {
if (res.confirm) {
wx.showLoading({
title: '正在提交...',
})
wx.request({
url: getApp().globalData.serverUrl + 'api/checkproject?a=addjobwx&jobid=' + this.data.jobid,
header: {
'content-type': 'application/x-www-form-urlencoded', //
'Cookie': getApp().globalData.sessionId,
},
method: 'POST',
data:jobdata ,
success: res => {
if (res.statusCode === 200) {
wx.hideLoading();
wx.navigateBack()
}
}
});
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getGcdetail(options.id);
this.setData({
jobid: options.id
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let lst = getApp().globalData.selectPeopleList
let nst = []
let nst1 = []
if (lst) {
for (var i = 0; i < lst.length; i++) {
nst.push(lst[i]['name'])
nst1.push(lst[i]['id'])
}
this.setData({
cjryname: nst.join(','),
cjry: nst1.join(','),
cjrs: nst1.length
})
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
getGcdetail: function (id) {
wx.showLoading({
title: '加载中',
}),
wx.request({
url: this.data.serverUrl + 'api/checkproject?a=checkjobdetail&id=' + id,
header: {
'content-type': 'application/json', // 默认值
'Cookie': getApp().globalData.sessionId,
},
data: {
},
success: res => {
wx.hideLoading();
console.log(res.data);
if (res.statusCode === 200) {
var data = res.data
//格式化观察信息
this.setData(data)
}
}
});
},
})

3
pages/checkjob/job.json Normal file
View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

108
pages/checkjob/job.wxml Normal file
View File

@ -0,0 +1,108 @@
<!--pages/checkjob/job.wxml-->
<view class="page">
<view class="page__bd">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>任务名称</view>
</view>
<view class="weui-cell__ft">
{{checktask__checktaskname}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查人</view>
</view>
<view class="weui-cell__ft">
{{checkname__username}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查时间</view>
</view>
<view class="weui-cell__ft">
{{checktask__checktime}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查内容</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{checktask__checktype__checkcontent}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查地点</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{checktask__checkplace}}
</view>
</view>
<view class="weui-cells__title">检查发现问题</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell">
<view class="weui-cell__bd">
<textarea class="weui-textarea" placeholder="请输入" style="height: 4.6em" bindinput="bindjcwtInput" maxlength="-1" />
</view>
</view>
</view>
<view class="weui-cells__title">整改情况</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell">
<view class="weui-cell__bd">
<textarea class="weui-textarea" placeholder="请输入" style="height: 4.6em" bindinput="bindzgqkInput" maxlength="-1" />
</view>
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查状态</view>
</view>
<view class="section section_gap">
<radio-group class="radio-group" bindchange="radioChange">
<radio class="radio" wx:for-items="{{items}}" wx:key="name" value="{{item.name}}" checked="{{item.checked}}">
<text>{{item.value}}</text>
</radio>
</radio-group>
</view>
</view>
<view class="weui-cells__title">处罚内容</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell">
<view class="weui-cell__bd">
<textarea class="weui-textarea" placeholder="非必填项" style="height: 4.6em" bindinput="bindcfnrInput" maxlength="-1" />
</view>
</view>
</view>
<view class="weui-cell weui-cell_select">
<view class="weui-cell__hd weui-cell__hd_in-select-after">
<view class="weui-label">被处罚人</view>
</view>
<view class="weui-cell__bd">
<navigator url="/pages/userSelect/userSelect">
<view class="weui-select">请选择</view>
</navigator>
</view>
</view>
<view class="weui-cell weui-cell_access" style="height: 5.3em">
{{cjryname}}
</view>
<view class="btn-area">
<button class="weui-btn" type="primary" bindtap="submit">提交</button>
</view>
</view>
</view>
</view>

1
pages/checkjob/job.wxss Normal file
View File

@ -0,0 +1 @@
/* pages/checkjob/job.wxss */

125
pages/checkjob/yanshou.js Normal file
View File

@ -0,0 +1,125 @@
var util = require('../../utils/util.js')
// pages/observe/observedetail.js
Page({
/**
* 页面的初始数据
*/
data: {
serverUrl: getApp().globalData.serverUrl
},
submit: function (e) {
wx.request({
url: getApp().globalData.serverUrl + 'api/checkproject?a=yanshou&id=' + this.data.ysid,
header: {
'content-type': 'application/x-www-form-urlencoded', //
'Cookie': getApp().globalData.sessionId,
},
method: 'get',
success: res => {
if (res.statusCode === 200) {
wx.hideLoading();
wx.navigateBack()
}
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getGcdetail(options.id);
this.setData({
ysid: options.id
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
lookimgPreview: function (e) {
var current = e.target.dataset.src
wx.previewImage({
current: current,
urls: this.data.lookimg
})
},
getGcdetail: function (id) {
wx.showLoading({
title: '加载中',
}),
wx.request({
url: this.data.serverUrl + 'api/checkproject?a=checkjobdetail&id=' + id,
header: {
'content-type': 'application/json', // 默认值
'Cookie': getApp().globalData.sessionId,
},
data: {
},
success: res => {
wx.hideLoading();
console.log(res.data);
if (res.statusCode === 200) {
var data = res.data
//格式化观察信息
this.setData(data)
}
}
});
},
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

109
pages/checkjob/yanshou.wxml Normal file
View File

@ -0,0 +1,109 @@
<!--pages/checkjob/job.wxml-->
<view class="page">
<view class="page__bd">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>任务名称</view>
</view>
<view class="weui-cell__ft">
{{checktask__checktaskname}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查人</view>
</view>
<view class="weui-cell__ft">
{{checkname__username}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查时间</view>
</view>
<view class="weui-cell__ft">
{{checktask__checktime}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查内容</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{checktask__checktype__checkcontent}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查发现问题</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{checkquestion}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>整改情况</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{zgjg}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查状态</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{taskstate==1?'正在检查':'检查完毕'}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>检查地点</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{checktask__checkplace}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>处罚内容</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{content}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>被处罚人员</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{bcfr==[]?'kkl':bcfr}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>验收人</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{yanshouren__name}}
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd weui-cell_primary">
<view>验收时间</view>
</view>
<view class="weui-cell__ft" style="width:200px">
{{yanshou}}
</view>
</view>
<view class="btn-area">
<button class="weui-btn" type="primary" bindtap="submit">验收</button>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,20 @@
.weui-btn{
width:auto;
margin: 5px;
}
.container {
background-color: #fff;
color: #939393;
}
.head{
color:#fff;
background-color: cornflowerblue;
text-align: center;
}
.topban{
color:#fff;
background-color: rgb(26, 182, 143);
height:30x;
text-align: center;
}

View File

@ -14,6 +14,7 @@ Page({
wsnoread: 0, wsnoread: 0,
jytodonum: 0, jytodonum: 0,
tasknum: 0, tasknum: 0,
checknum:0,
serverUrl: getApp().globalData.serverUrl, serverUrl: getApp().globalData.serverUrl,
isGjjt:false, isGjjt:false,
// Banner数据 // Banner数据
@ -123,6 +124,7 @@ Page({
this.getwsnoreadnum()//未遂未读 this.getwsnoreadnum()//未遂未读
this.getjytodonum() this.getjytodonum()
this.gettasknum() this.gettasknum()
this.getchecknum()//检查任务
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
@ -336,6 +338,26 @@ Page({
} }
}); });
}, },
getchecknum: function () {
var that = this
//获取待考
wx.request({
url: this.data.serverUrl + 'api/checkproject?a=listself',
header: {
'content-type': 'application/json', // 默认值
'Cookie': getApp().globalData.sessionId,
},
data: {},
success: res => {
if (res.statusCode === 200) {
//console.log(res.data)
this.setData({
checknum: res.data.total,
})
}
}
});
},
taptest: function () { taptest: function () {
if (getApp().globalData.userInfo.perms != undefined) { if (getApp().globalData.userInfo.perms != undefined) {
if (getApp().globalData.userInfo.perms.indexOf(25) != -1) {//考试功能 if (getApp().globalData.userInfo.perms.indexOf(25) != -1) {//考试功能

View File

@ -57,6 +57,11 @@
<image class="weui-grid__icon" src="../images/inspect.png" /> <image class="weui-grid__icon" src="../images/inspect.png" />
<view class="weui-grid__label">设备巡检</view> <view class="weui-grid__label">设备巡检</view>
</view> </view>
<navigator url="/pages/checkjob/index" class="weui-grid" hover-class="weui-grid_active">
<image class="weui-grid__icon" src="../images/task.png" />
<view class="weui-grid__label">检查任务</view>
<view class="weui-badge" style="position: absolute;top: 1em;right: 1em;" wx:if="{{checknum!=0}}">{{checknum}}</view>
</navigator>
</view> </view>
<view class="weui-cells__title"> <view class="weui-cells__title">
<span wx:if="{{!isGjjt}}">学习园地</span> <span wx:if="{{!isGjjt}}">学习园地</span>