123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- const _my = require("../../../__antmove/api/index.js")(my);
- const wx = _my;
- // pages/wx_airport/Xiaosha_registration/index.js
- var util = require("../../../utils/util");
- const {
- disinfectScanQrcode,
- disinfectCommit
- } = require("../../../utils/api/xiaosha");
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- userInfo: wx.getStorageSync("userInfo"),
- disinfectAreaId: null,
- //消杀时间id
- timeBreak: null,
- //消杀时间val
- headerData: null,
- status: "2",
- //消杀状态
- disinfectTimeBreakId: null,
- disinfectRemarks: null
- },
- // 重新扫码
- goQrcode() {
- wx.navigateTo({
- url: "/pages/wx_airport/Xiaosha_registration/scan_code/index"
- });
- },
- // 消杀状态
- onChange(event) {
- this.setData({
- status: event.detail
- });
- },
- // 下拉-消杀时间
- getTime(e) {
- let {
- disinfectAreaTimeVOList
- } = this.data.headerData;
- this.setData({
- timeBreak: disinfectAreaTimeVOList[e.detail.value].timeBreak,
- disinfectTimeBreakId: disinfectAreaTimeVOList[e.detail.value].disinfectAreaTimeId
- });
- },
- // 备注
- problemDetailFun(e) {
- this.setData({
- disinfectRemarks: e.detail.value
- });
- },
- // 上报
- report() {
- let {
- status,
- disinfectTimeBreakId,
- disinfectRemarks,
- userInfo,
- disinfectAreaId
- } = this.data;
- if (status == 2 && disinfectTimeBreakId && !disinfectRemarks) {
- wx.showToast({
- title: "标红内容不能为空",
- icon: "none"
- });
- return;
- }
- let data = {
- status,
- adminId: userInfo.orgId,
- userId: userInfo.userId,
- disinfectAreaId,
- disinfectRemarks,
- disinfectTimeBreakId
- };
- disinfectCommit(data).then(res => {
- if (res.code === 200) {
- my.alert({
- title: "提示",
- content: "上报成功!",
- success: res => {
- wx.navigateTo({
- url: "/pages/wx_airport/rlxf_pass/rlxf_pass?orgId=" + userInfo.orgId
- });
- }
- });
- } else {
- wx.showToast({
- title: res.msg,
- icon: "none"
- });
- }
- });
- },
- // 获取顶部信息
- getMsg() {
- let data = {
- adminId: this.data.userInfo.orgId,
- userId: this.data.userInfo.userId,
- disinfectAreaId: this.data.disinfectAreaId
- };
- console.log(data);
- disinfectScanQrcode(data).then(res => {
- if (res.code === 200) {
- if (res.data.waitDisinfectPipei) {
- let index = res.data.disinfectAreaTimeVOList.findIndex(item => {
- return item.timeBreak === res.data.waitDisinfectPipei;
- });
- this.setData({
- timeBreak: res.data.disinfectAreaTimeVOList[index].timeBreak,
- disinfectTimeBreakId: res.data.disinfectAreaTimeVOList[index].disinfectAreaTimeId
- });
- }
- this.setData({
- headerData: res.data
- });
- } else {
- wx.showToast({
- title: res.msg,
- icon: "none"
- });
- }
- });
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- if (options) {
- this.setData({
- disinfectAreaId: options.disinfectAreaId
- });
- }
- this.getMsg();
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {},
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {},
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {},
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {},
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {},
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {},
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {},
- antmoveAction: function () {
- //执行时动态赋值,请勿删除
- }
- });
|