设备异常抄送

This commit is contained in:
caoqianming 2021-01-10 21:16:15 +08:00
parent 1b9c79c1b5
commit d5cbda9f89
3 changed files with 39 additions and 7 deletions

View File

@ -29,5 +29,5 @@
<view style="position:fixed;bottom:0;left:0;width:100%;"> <view style="position:fixed;bottom:0;left:0;width:100%;">
<view style="color:red;text-align:center">{{msg}}</view> <view style="color:red;text-align:center">{{msg}}</view>
<button class="weui-btn" type="primary" bindtap="start" disabled="{{testdisable}}">开始考试</button> <button class="weui-btn" type="primary" bindtap="start" disabled="{{testdisable}}">开始考试</button>
<button class="weui-btn" bindtap="start" wx:if="{{remainnum>0 && state==1 && notinTime ==0}}">重考({{remainnum}})</button> <button class="weui-btn" bindtap="start" wx:if="{{remainnum>0 && state==1 && notinTime ==0 && testnum!=0}}">重考({{remainnum}})</button>
</view> </view>

View File

@ -12,7 +12,9 @@ Page({
serverUrl: getApp().globalData.serverUrl, serverUrl: getApp().globalData.serverUrl,
state:1, state:1,
selected:false, selected:false,
        selected1:true         selected1:true,
csry:"",
isok:true
        },         },
    selected:function(e){     selected:function(e){
        this.setData({         this.setData({
@ -44,6 +46,7 @@ Page({
}, },
changeItems:function(val){ changeItems:function(val){
var x = [] var x = []
for(var i=0;i<this.data.itemscheck0.length;i++){ for(var i=0;i<this.data.itemscheck0.length;i++){
if(this.data.itemscheck0[i].type == val){ if(this.data.itemscheck0[i].type == val){
x.push(this.data.itemscheck0[i]) x.push(this.data.itemscheck0[i])
@ -69,12 +72,14 @@ Page({
that.data.itemscheck[e.currentTarget.dataset.index].state = '正常' that.data.itemscheck[e.currentTarget.dataset.index].state = '正常'
} }
else if (e.detail.value == '异常'){ else if (e.detail.value == '异常'){
this.setData({
isok:false
})
that.data.itemscheck[e.currentTarget.dataset.index].state = '异常待处理' that.data.itemscheck[e.currentTarget.dataset.index].state = '异常待处理'
} }
that.setData({ that.setData({
itemscheck:that.data.itemscheck itemscheck:that.data.itemscheck
}) })
console.log(that.data.itemscheck)
}, },
bindcontentInput: function (e) { bindcontentInput: function (e) {
this.data.content = e.detail.value this.data.content = e.detail.value
@ -196,7 +201,19 @@ submit:function(){
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: 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({
csryname: nst.join(','),
csry: nst1.join(','),
})
}
}, },
/** /**
@ -310,12 +327,15 @@ submit:function(){
let data1 = { let data1 = {
equipment: this.data.equipment.id, equipment: this.data.equipment.id,
state: 1, state: 1,
type: this.data.jclx type: this.data.jclx,
csry: this.data.csry
} }
let data2 = that.data.itemscheck let data2 = that.data.itemscheck
for(var i=0;i<that.data.itemscheck.length;i++){ for(var i=0;i<that.data.itemscheck.length;i++){
if (that.data.itemscheck[i].state == '异常待处理'){ if (that.data.itemscheck[i].state == '异常待处理'){
if (!that.data.itemscheck[i].img||!that.data.itemscheck[i].desc){ if (that.data.itemscheck[i].img||that.data.itemscheck[i].desc){
}else{
wx.showToast({ wx.showToast({
title: '存在异常项目没有描述或图片!', title: '存在异常项目没有描述或图片!',
icon:'none' icon:'none'

View File

@ -72,7 +72,19 @@
</view> </view>
</view> </view>
</block> </block>
<view class="weui-cell weui-cell_select" wx:if="{{!isok}}">
<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" wx:if="{{!isok}}">
{{csryname}}
</view>
</view> </view>
<view class="btn-area "> <view class="btn-area ">
<button class="weui-btn" type="primary" bindtap="submit3" >提交</button> <button class="weui-btn" type="primary" bindtap="submit3" >提交</button>