From 726ea79abb9b123bf6dd5fe7e8beb8c301240754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Fri, 22 Oct 2021 15:33:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E8=B4=A5=E5=AE=A2=E6=88=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/js/config.js | 2 +- commons/js/utils/apiQuery.js | 14 +++++ pages/customer/detail/index.js | 77 +++++++++++++++++++++++----- pages/customer/detail/index.wxml | 6 +-- pages/customer/filterList/index.js | 4 ++ pages/customer/filterList/index.wxml | 1 + pages/customer/index.wxml | 2 +- pages/customer/optDefeat/index.js | 16 +++--- pages/customer/optDefeat/index.wxml | 2 +- pages/index/index.wxml | 42 +++++---------- 10 files changed, 108 insertions(+), 58 deletions(-) diff --git a/commons/js/config.js b/commons/js/config.js index 1e3ffb2..d8b6fc3 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -77,7 +77,7 @@ api = { materialStatisticsCal: 'material/statistics/cal', //数据分析_累计数据 materialStatisticsChart: 'material/statistics/chart', //数据分析_图表 - + appCustomersDefeats: 'app/customers/defeats', //战败客户列表 /战败/再战申请 } diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index c2f10f5..530e62a 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -502,4 +502,18 @@ apiQuery.getMaterialStatisticsChart = function (params) { }) } +//战败客户列表 +apiQuery.getAppCustomersDefeats = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appCustomersDefeats, 2, params, "GET", resolve, reject) + }) +} + +//战败/再战申请 +apiQuery.putAppCustomersDefeats = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appCustomersDefeats, 2, params, "PUT", resolve, reject) + }) +} + export default apiQuery; \ No newline at end of file diff --git a/pages/customer/detail/index.js b/pages/customer/detail/index.js index 55de086..7f8c9b3 100644 --- a/pages/customer/detail/index.js +++ b/pages/customer/detail/index.js @@ -49,6 +49,7 @@ Page({ timeArray:[],//预计购车时间列表 timeIndex:-1,//预计购车时间索引 cf_clues:'',//线索来源 + defeat_reason:'',//战败理由 submitFlag:false, }, onLoad(options) { @@ -255,6 +256,7 @@ Page({ a_num:'',//到店次数 t_num:'',//试驾次数 statuskey:-10,//状态值 + defeat_reason:'',//战败理由 isShowSelectStatus:true, }) }, @@ -270,27 +272,50 @@ Page({ putAppCustomers(e){ let params = {}; params['id'] = this.data.id; - if(this.data.statuskey != -10){ - params['status'] = this.data.statuskey; - } if(this.data.t_num != ''){ params['t_num'] = this.data.t_num; } if(this.data.a_num != ''){ params['a_num'] = this.data.a_num; } - _.apiQuery.putAppCustomers(params).then(res=>{ - this.setData({ - isShowSelectStatus:false, + if(this.data.statuskey != -10){ + params['status'] = this.data.statuskey; + if(this.data.statuskey == 3&&this.data.defeat_reason == ''){ + wx.showToast({ + title: '请填写战败理由', + icon: 'none' + }) + }else{ + if(this.data.defeat_reason != ''){ + params['defeat_reason'] = this.data.defeat_reason; + } + _.apiQuery.putAppCustomers(params).then(res=>{ + this.setData({ + isShowSelectStatus:false, + }) + wx.showToast({ + title: res.msg, + icon: 'none' + }) + + this.onPullDownRefresh() + + }) + } + }else{ + _.apiQuery.putAppCustomers(params).then(res=>{ + this.setData({ + isShowSelectStatus:false, + }) + wx.showToast({ + title: res.msg, + icon: 'none' + }) + + this.onPullDownRefresh() + }) - wx.showToast({ - title: res.msg, - icon: 'none' - }) - - this.onPullDownRefresh() - - }) + } }, //推送链接 @@ -493,6 +518,30 @@ Page({ }) }, + //战败/再战申请 + putAppCustomersDefeats(e){ + + let params = {}; + params['id'] = this.data.id; + params['type'] = e.currentTarget.dataset.type; + _.apiQuery.putAppCustomersDefeats(params).then(res => { + wx.showModal({ + title: '', + content: '操作成功', + confirmText: "知道了", + showCancel:false, + success(resm) { + if (resm.confirm) { + wx.navigateBack({ + delta: 1 + }) + } + } + }) + }) + + }, + /*************************** 编辑 **********************************/ //获取车型品牌 getAppSeriesBrands(){ diff --git a/pages/customer/detail/index.wxml b/pages/customer/detail/index.wxml index dd5c1ca..32babd0 100644 --- a/pages/customer/detail/index.wxml +++ b/pages/customer/detail/index.wxml @@ -193,8 +193,8 @@ - - + + @@ -270,7 +270,7 @@ -