123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- const app = getApp()
- const util = require("../../../utils/jmsUtil.js");
- const api = require('../../../api/jms.js');
- import moment from 'moment'
- Page({
- data: {
- ticketList:[],
- totalPages:'',
- page:1,
- listQuery:{
- status:'108',
- statusVal:'加盟商处理中',
- level:'',
- levelVal:'全部'
- },
- selectVisible:false,
- columns:[],
- selectType:1,
- statusList:[
- {
- text:'全部',
- value:''
- },
- {
- text:'待处理',
- value:'101'
- },
- {
- text:'升级',
- value:'102'
- },
- {
- text:'超时驳回',
- value:'103'
- },
- {
- text:'重新打开',
- value:'104'
- },
- {
- text:'等待客户上传图片',
- value:'106'
- },
- {
- text:'客户已上传图片',
- value:'107'
- },
- {
- text:'加盟商处理中',
- value:'108'
- },
- {
- text:'加盟商已处理',
- value:'109'
- },
- {
- text:'完成',
- value:'201'
- },
- {
- text:'作废',
- value:'301'
- },
- {
- text:'创建',
- value:'0'
- },
- ],
- levelList:[
- {
- text:'全部',
- value:''
- },
- {
- text:'无',
- value:'0'
- },
- {
- text:'一般',
- value:'1'
- },
- {
- text:'严重',
- value:'2'
- },
- {
- text:'非常严重',
- value:'3'
- },
-
- ],
- statusDesc: {
- 0: "创建",
- 1: "处理中",
- 2: "已完成",
- 3: "作废",
- },
- substatusDesc: {
- 101: "待处理",
- 102: "升级",
- 103: "超时驳回",
- 104: "重新打开",
- 106: "等待客户上传图片",
- 107: "客户已上传图片",
- 108: "加盟商处理中",
- 109: "加盟商已处理",
- 201: "完成",
- 301: "作废",
- 0: "创建",
- },
- typeTag: ["", "success", "warning", "danger"],
- levelMap: {
- 0: "无",
- 1: "一般",
- 2: "严重",
- 3: "非常严重",
- },
-
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
-
- this.getTicketList();
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
- showPicker(e){
- let type=e.currentTarget.dataset.type;
- this.setData({
- selectType:type,
- columns:type==1?this.data.statusList:this.data.levelList,
- selectVisible:true,
- });
- },
- onPickerConfirm(e){
- console.log(e);
- if(this.data.selectType==1){
- this.setData({
- 'listQuery.statusVal':e.detail.value.text,
- 'listQuery.status':e.detail.value.value,
- });
- }else{
- this.setData({
- 'listQuery.levelVal':e.detail.value.text,
- 'listQuery.level':e.detail.value.value,
- });
- }
- this.setData({
-
- selectVisible:false,
- page:1,
- ticketList:[]
- });
- this.getTicketList();
- },
- onPickerCancel(){
- this.setData({
- selectVisible:false
- });
- },
-
- goDetail(e){
- let id=e.currentTarget.dataset.id;
- wx.navigateTo({
- url: '/pages/ticket/ticketDetail/ticketDetail?id='+id
- });
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- onReachBottom() {
- if (this.data.totalPages > this.data.page) {
- this.setData({
- page: this.data.page + 1
- });
- this.getTicketList();
- } else if (this.data.ticketList.length > 0) {
- wx.showToast({
- title: '没有更多工单了',
- icon: 'none',
- duration: 2000
- });
- return false;
- }
- },
- getTicketList(){
- util.request(api.TicketList, {
- page: this.data.page,
- limit: 10,
- substatus:this.data.listQuery.status,
- level:this.data.listQuery.level
- }, 'GET').then(res=>{
- if (res.errno == 0) {
-
- this.setData({
- totalPages:res.data.pages,
- ticketList:this.data.ticketList.concat(res.data.list)
- });
- }else{
- wx.showToast({
- title: res.errmsg,
- icon:'none'
- })
- }
-
- });
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- },
- })
|