| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- const _Http = getApp().globalData.http;
- Page({
- data: {
- "id": 20230208140203,
- "content": {
- "nocache": true,
- "pageNumber": 1,
- "pageSize": 20,
- "where": {
- "status": ['待接单'], //工单状态,可多选
- "type": "", //工单类型
- "servicetype": "", //服务类型
- "begindate": "", //创建时间
- "enddate": "" //创建时间
- },
- },
- tabColorS: {
- 售前: {
- bgColor: "#E1EAFE",
- color: "#3874F6"
- },
- 售中: {
- bgColor: "#FEF0E1",
- color: "#F69E38"
- },
- 售后: {
- bgColor: "#FCE4E4",
- color: "#ED4949"
- },
- 紧急: {
- bgColor: "#FCE4E4",
- color: "#ED4949"
- },
- 历史售后: {
- bgColor: "#eeeeee",
- color: "#888888"
- }
- },
- filtratelist: []
- },
- async onLoad(options) {
- this.getList()
- getApp().globalData.Language.getLanguagePackage(this, '工单');
- let filtratelist = [{
- label: "工单类型",
- index: null,
- showName: "value", //显示字段
- valueKey: "type", //返回Key
- selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
- value: "", //选中值
- list: await _Http.getTypes('serviceworktype', _Http)
- }, {
- label: "服务类型",
- index: null,
- showName: "value", //显示字段
- valueKey: "servicetype", //返回Key
- selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
- value: "", //选中值
- list: await _Http.basic({
- id: 20230206112003,
- "content": {},
- }).then(res => {
- console.log("获取服务类型", res)
- return res.code == 1 ? res.data : []
- })
- }, {
- label: "客诉大类",
- index: null,
- showName: "value", //显示字段
- valueKey: "class2", //返回Key
- selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
- value: "", //选中值
- list: await _Http.getTypes('customerclass', _Http)
- }, {
- label: "是否外包",
- index: null,
- showName: "value", //显示字段
- valueKey: "isout", //返回Key
- selectKey: "id", //传参 代表选着字段 不传参返回整个选择对象
- value: "", //选中值
- list: [{
- id: 1,
- value: '是'
- }, {
- id: 0,
- value: '否'
- }]
- }]
- this.setData({
- filtratelist
- })
- },
- getList(init = false) {
- _Http.init(this.data.content, init).then(content => {
- _Http.basic({
- id: this.data.id,
- content
- }).then(res => {
- console.log("工单列表", res)
- this.selectComponent('#ListBox').RefreshToComplete();
- if (res.code != '1') return wx.showToast({
- title: res.msg,
- icon: "none"
- })
- this.setData({
- content: _Http.paging(content, res),
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
- })
- })
- })
- },
- onSearch({
- detail
- }) {
- this.data.content.where.condition = detail;
- this.getList(true)
- },
- onChangeTab({
- detail
- }) {
- let value = [detail.title];
- delete this.data.content.where.isconfirmation;
- if (detail.title == '已确认') {
- value = []
- this.data.content.where.isconfirmation = 1;
- }
- this.setData({
- 'content.where.status': value,
- })
- this.getList(true)
- },
- handleFilter({
- detail
- }) {
- detail.condition = this.data.content.where.condition;
- detail.status = this.data.content.where.status;
- detail.begindate = detail.startdate;
- detail.enddate = detail.enddate;
- detail.begindate2 = detail.startdate;
- detail.enddate2 = detail.enddate;
- delete detail.startdate;
- delete detail.enddate;
- delete detail.periodstart;
- delete detail.periodend;
- this.data.content.where = detail;
- this.getList(true);
- },
- })
|