|
@@ -9,15 +9,34 @@ Page({
|
|
|
str:' ',
|
|
|
loginStatus: wx.getStorageSync('loginStatus') ? wx.getStorageSync('loginStatus') : false,
|
|
|
roleCodeList: wx.getStorageSync('roleCodeList') ? wx.getStorageSync('roleCodeList') : '',
|
|
|
- searchVal: '',
|
|
|
- type:'',//预约类型
|
|
|
|
|
|
+ searchVal: '', //筛选条件
|
|
|
+ type:'',//预约类型
|
|
|
appointmentClassifyArray: [
|
|
|
{ label:'充电预约',value:'1' },
|
|
|
{ label:'管桩预约',value:'2' },
|
|
|
{ label:'其他预约',value:'3' },
|
|
|
], //预约类型
|
|
|
-
|
|
|
+
|
|
|
+ appointmentTypeArray: [{
|
|
|
+ dictValue: "",
|
|
|
+ dictLabel: "全部状态"
|
|
|
+ }],
|
|
|
+ appointmentTypeIndex: 0,
|
|
|
+
|
|
|
+ appointmentStatusArray: [{
|
|
|
+ dictValue: "",
|
|
|
+ dictLabel: "全部状态"
|
|
|
+ }],
|
|
|
+ appointmentStatusIndex: 0,
|
|
|
+
|
|
|
+ appointmentType: '', //切换显示
|
|
|
+ appointmentTypeSha: '', //砂石
|
|
|
+ appointmentTypeQi: '', //起卸
|
|
|
+ appointmentTypeGuan: '', //管桩
|
|
|
+ appointmentTypeChong: '', //充电桩
|
|
|
+ appointmentTypeOther: '', //其他
|
|
|
+
|
|
|
//分页
|
|
|
limit: 10,
|
|
|
requestStatu: '加载中...',
|
|
@@ -26,11 +45,15 @@ Page({
|
|
|
more: false,
|
|
|
nomore: '',
|
|
|
|
|
|
- resData:[],
|
|
|
+ //筛选E
|
|
|
+ setIndex: 0,
|
|
|
+ resData: [],
|
|
|
|
|
|
show:false,
|
|
|
auditFlag:'false',
|
|
|
appointmentReason:'',//审核备注
|
|
|
+
|
|
|
+ showQrcode:false,
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -89,6 +112,51 @@ Page({
|
|
|
if(wx.getStorageSync('loginStatus')){
|
|
|
this.getListFun();
|
|
|
}
|
|
|
+
|
|
|
+ if(this.data.appointmentStatusArray.length==1 || this.data.appointmentTypeArray.length==1){
|
|
|
+ this.getTree()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取字典数据
|
|
|
+ getTree:function(){
|
|
|
+ app.request.GET({
|
|
|
+ url:app.API.getTree,
|
|
|
+ page:this,
|
|
|
+ successFun:true
|
|
|
+ }).then(res=>{
|
|
|
+ if(this.data.appointmentStatusArray.length==1){
|
|
|
+ let treeData = res.data.data
|
|
|
+ for (const element of treeData) {
|
|
|
+ let arrStr;
|
|
|
+ switch (element.dictValue) {
|
|
|
+ case 'appointment_status':
|
|
|
+ arrStr = "appointmentStatusArray";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ let getArray = this.data.appointmentStatusArray
|
|
|
+ this.setData({
|
|
|
+ [arrStr]: getArray.concat(element.children)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.data.appointmentTypeArray.length==1){
|
|
|
+ let treeData = res.data.data
|
|
|
+ for (const element of treeData) {
|
|
|
+ let arrStr;
|
|
|
+ switch (element.dictValue) {
|
|
|
+ case 'appointment_type':
|
|
|
+ arrStr = "appointmentTypeArray";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ let getArray = this.data.appointmentTypeArray
|
|
|
+ this.setData({
|
|
|
+ [arrStr]: getArray.concat(element.children)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
//搜索框请求S
|
|
@@ -103,6 +171,12 @@ Page({
|
|
|
})
|
|
|
this.getListFun();
|
|
|
},
|
|
|
+ typeFun: function (e) {
|
|
|
+ this.setData({
|
|
|
+ appointmentType : e.currentTarget.dataset.type
|
|
|
+ })
|
|
|
+ this.getListFun()
|
|
|
+ },
|
|
|
onCancel: function () {
|
|
|
this.setData({})
|
|
|
},
|
|
@@ -116,9 +190,10 @@ Page({
|
|
|
page: 1
|
|
|
})
|
|
|
let params = {
|
|
|
- current: this.data.page,
|
|
|
- size: this.data.limit,
|
|
|
- licenseNumber:this.data.searchVal,
|
|
|
+ current : this.data.page,
|
|
|
+ size : this.data.limit,
|
|
|
+ licenseNumber : this.data.searchVal,
|
|
|
+ type : this.data.appointmentType
|
|
|
//status:1
|
|
|
}
|
|
|
app.request.pageFirst({
|
|
@@ -162,13 +237,47 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- //授权出场
|
|
|
+ // 授权出场
|
|
|
exitFun: function (e) {
|
|
|
let _this = this
|
|
|
let { id, licenseNumber } = e.currentTarget.dataset
|
|
|
wx.showModal({
|
|
|
title: '提示!',
|
|
|
- content: `确定授权【${licenseNumber}】出场?`,
|
|
|
+ content: `确定授权【${licenseNumber}】出场,操作后无法撤回,请确认?`,
|
|
|
+ confirmColor: '#FF5B5B',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ app.request.POST({
|
|
|
+ url: app.API.otherAuthorize,
|
|
|
+ params: {
|
|
|
+ id: id
|
|
|
+ },
|
|
|
+ page: _this,
|
|
|
+ isLoadingTxt: '授权中...',
|
|
|
+ successFun: true
|
|
|
+ }).then(res => {
|
|
|
+ wx.showToast({
|
|
|
+ title: '授权成功',
|
|
|
+ icon: 'success',
|
|
|
+ duration: 1000,
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ _this.getListFun(); //刷新列表
|
|
|
+ })
|
|
|
+ } else if (res.cancel) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 强制结束
|
|
|
+ overFun: function (e) {
|
|
|
+ let _this = this
|
|
|
+ let { id, licenseNumber } = e.currentTarget.dataset
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示!',
|
|
|
+ content: `确定强制结束【${licenseNumber}】预约信息,操作后无法撤回,请确认?`,
|
|
|
confirmColor: '#FF5B5B',
|
|
|
success: function (res) {
|
|
|
if (res.confirm) {
|
|
@@ -196,64 +305,64 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // 审核S
|
|
|
- showPopup(e) {
|
|
|
- let { id,type } = e.currentTarget.dataset
|
|
|
- this.setData({
|
|
|
- show: true,
|
|
|
- appointmentReason: '',
|
|
|
- type:type,
|
|
|
- id: id
|
|
|
- });
|
|
|
- },
|
|
|
- onClose() {
|
|
|
- this.setData({
|
|
|
- show: false,
|
|
|
- auditFlag:'false',
|
|
|
- appointmentReason:'',
|
|
|
- id: ''
|
|
|
- });
|
|
|
- },
|
|
|
- // 单选
|
|
|
- dangerStatusChange: function (e) {
|
|
|
- this.setData({
|
|
|
- [e.currentTarget.dataset.radiotype]: e.detail.value
|
|
|
- })
|
|
|
- },
|
|
|
- //审核
|
|
|
- formSubmit: function (e) {
|
|
|
- let formData = e.detail.value;
|
|
|
- var warn = ""; //弹框时提示的内容
|
|
|
- if (formData.auditFlag=='true' && formData.appointmentReason == '') {
|
|
|
- warn = "审核不通过时备注不能为空!";
|
|
|
+ // 审核S
|
|
|
+ showPopup(e) {
|
|
|
+ let { id,type } = e.currentTarget.dataset
|
|
|
+ this.setData({
|
|
|
+ show: true,
|
|
|
+ appointmentReason: '',
|
|
|
+ type:type,
|
|
|
+ id: id
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onClose() {
|
|
|
+ this.setData({
|
|
|
+ show: false,
|
|
|
+ auditFlag:'false',
|
|
|
+ appointmentReason:'',
|
|
|
+ id: ''
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 单选
|
|
|
+ dangerStatusChange: function (e) {
|
|
|
+ this.setData({
|
|
|
+ [e.currentTarget.dataset.radiotype]: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //审核
|
|
|
+ formSubmit: function (e) {
|
|
|
+ let formData = e.detail.value;
|
|
|
+ var warn = ""; //弹框时提示的内容
|
|
|
+ if (formData.auditFlag=='true' && formData.appointmentReason == '') {
|
|
|
+ warn = "审核不通过时备注不能为空!";
|
|
|
+ }
|
|
|
+ formData.auditFlag = formData.auditFlag=='true'
|
|
|
+ if (warn != '') {
|
|
|
+ app.util.checkForm(warn);
|
|
|
+ } else {
|
|
|
+ let url = app.API.appointmentAudit
|
|
|
+ if(this.data.type == '2'){
|
|
|
+ url = app.API.tempAudit
|
|
|
}
|
|
|
- formData.auditFlag = formData.auditFlag=='true'
|
|
|
- if (warn != '') {
|
|
|
- app.util.checkForm(warn);
|
|
|
- } else {
|
|
|
- let url = app.API.appointmentAudit
|
|
|
- if(this.data.type == '2'){
|
|
|
- url = app.API.tempAudit
|
|
|
- }
|
|
|
- app.request.POST({
|
|
|
- url: url,
|
|
|
- params: formData,
|
|
|
- page: this,
|
|
|
- isLoadingTxt: '审核中...',
|
|
|
- successFun: true
|
|
|
- }).then(res => {
|
|
|
- wx.showToast({
|
|
|
- title: '审核成功',
|
|
|
- icon: 'success',
|
|
|
- duration: 1000,
|
|
|
- mask: true
|
|
|
- })
|
|
|
- this.onClose()
|
|
|
- this.getListFun(); //刷新列表
|
|
|
+ app.request.POST({
|
|
|
+ url: url,
|
|
|
+ params: formData,
|
|
|
+ page: this,
|
|
|
+ isLoadingTxt: '审核中...',
|
|
|
+ successFun: true
|
|
|
+ }).then(res => {
|
|
|
+ wx.showToast({
|
|
|
+ title: '审核成功',
|
|
|
+ icon: 'success',
|
|
|
+ duration: 1000,
|
|
|
+ mask: true
|
|
|
})
|
|
|
- }
|
|
|
- },
|
|
|
- // 审核E
|
|
|
+ this.onClose()
|
|
|
+ this.getListFun(); //刷新列表
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 审核E
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面隐藏
|