| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- /*******************************************************************************
- * Copyright(c) 2022 dongke All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:
- * 2.新增接待
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * yjb 2022-0-12 1.00
- *******************************************************************************/
- const Constants = require('@/utils/Constants.js');
- const util = require('@/utils/util.js')
- const mixins = require('@/mixins/index.js')
- const app = getApp()
- Page({
- mixins: [mixins],
- /**
- * 页面的初始数据
- */
- data: {
- tagList: [{ title: mixins.$t('allReceptions'), code: 'all' }, { title: mixins.$t('followUpTasks'), code: mixins.$t('followStatusFollowUp') }, { title: mixins.$t('followStatusInvitationName'), code: mixins.$t('followStatusInvitation') }, { title: mixins.$t('followStatusFootName'), code: mixins.$t('followStatusFoot') }],
- buttonSaveList: [{ code: 'add', title: mixins.$t('add')}],
- contentSaveList: [{ code: 'need', title: mixins.$t('together'), type: 'count', color: '#1B365D', tail: mixins.$t('receptionInformation'), bill: 1, fontSize: '15px' }],
- // 查询条件
- searchContent: [
- { code: 'createtime', title: mixins.$t('pastThirthtyDays'), defaultValue: 5, searchType: Constants.searchType.date },
- { code: 'staff', title: mixins.$t('staffId'), dropType: 'staff' },
- { code: 'choose', title: mixins.$t('choose'), searchType: Constants.searchType.pick }
- ],
- // 查询条件-筛选
- pullMenuList: [
- { code: 'followStatus', pullType: 'mSelect', typeName: 'followStatus' },
- { code: 'followCount', dataType: 'number' },
- { code: 'nextFollowTime', dataType: 'date' }
- ],
- // 列表区(内容)
- contentList: [
- { name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
- { name: 'addressFull', title: mixins.$t('addressFull') },
- { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '' }], title: mixins.$t('storeInformation') },
- { name: 'followTime', title: mixins.$t('followTime') }
- ],
- contentObj: {
- '跟进状态-跟进': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
- { name: 'addressFull', title: mixins.$t('addressFull') },
- { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
- { name: 'followTime', title: mixins.$t('followTime') }],
- '跟进状态-报备': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
- { name: 'addressFull', title: mixins.$t('addressFull') },
- { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
- { name: 'followTime', title: mixins.$t('followTime') }],
- '跟进状态-邀约': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
- { name: 'addressFull', title: mixins.$t('addressFull') },
- { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
- { name: 'followTime', title: mixins.$t('followTime') }],
- '跟进状态-约尺': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
- { name: 'addressFull', title: mixins.$t('addressFull') },
- { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
- { name: 'followTime', title: mixins.$t('followTime') }],
- '跟进状态-接待': [
- { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
- { name: 'followTime', title: mixins.$t('followTime') }],
- '跟进状态-成交': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
- { name: 'addressFull', title: mixins.$t('addressFull') },
- { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
- { name: 'followTime', title: mixins.$t('followTime') }],
- '跟进状态-报价': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
- { name: 'addressFull', title: mixins.$t('addressFull') },
- { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
- { name: 'followTime', title: mixins.$t('followTime') }],
- },
- // 列表区(脚部信息)
- footerInfo: [{
- prefix: mixins.$t('followedUp'),
- name: 'followCount',
- title: mixins.$t('next')
- },],
- // 弹出按钮
- buttonList: [
- { name: 'followUp', title: mixins.$t('follow') },
- { name: 'followUpTasks', title: mixins.$t('followUpTasks') },
- { name: 'orderAdd', title: mixins.$t('saleOrder') },
- { name: 'cusCollection', title: mixins.$t("cusCollection"), idKey: 'cusId' },//跳转客户收款
- ],
- totallength: 0, //视图下方提醒数量
- // 路由
- routeObjName: 'cusFollow',
- followStatus: 'all',
- active: 0
- },
- /**
- * @desc : 跳转客户详情
- * @date : 2024年5月27日
- * @author : 姜永辉
- */
- toTitle(e) {
- let cusId = e.detail.item.cusId
- wx.navigateTo({
- url: this.data.route.detailCustomer.url,
- success: function (res) {
- // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
- res.eventChannel.emit('params', {
- id: cusId,
- formMode: Constants.formMode.edit
- })
- }
- })
- },
- /**
- * @desc : 点击三个点事件
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
- toPoint(e) {
- let item = e.detail.item
- let buttonList = this.data.buttonList
-
- if (item.followStatus == mixins.$t('followStatusFoot') && item.measureStatus == mixins.$t('scaleStatusMeasured')) {
- buttonList = [
- { name: 'followUp', title: mixins.$t('follow') },
- { name: 'followUpTasks', title: mixins.$t('followUpTasks') },
- { name: 'orderAdd', title: mixins.$t('saleOrder') },
- { name: 'cusCollection', title: mixins.$t("cusCollection"), idKey: 'cusId' },//跳转客户收款
- { name: 'measureTo', title: mixins.$t('measuringScaleReceipt') }
- ]
- } else {
- buttonList = [
- { name: 'followUp', title: mixins.$t('follow') },
- { name: 'followUpTasks', title: mixins.$t('followUpTasks') },
- { name: 'orderAdd', title: mixins.$t('saleOrder') },
- { name: 'cusCollection', title: mixins.$t("cusCollection"), idKey: 'cusId' },//跳转客户收款
- ]
- }
- this.setData({
- buttonList: buttonList
- })
- },
- /**
- * @desc : 跳转
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
- toDetail(e) {
- let item = e.detail.item
- let url = null
- let title = undefined
- if (item.followStatus == '跟进状态-报备' || item.followStatus == '跟进状态-接待') {
- url = this.data.route.toFollowStatus1.url
- } else if (item.followStatus == '跟进状态-跟进' || item.followStatus == '跟进状态-邀约') {
- title = '跟进详情'
- url = this.data.route.toFollowStatus2.url
- } else if (item.followStatus == '跟进状态-约尺') {
- url = this.data.route.toFollowStatus3.url
- }
- let _this = this;
- wx.navigateTo({
- url: url,
- events: {
- // 保存成功后刷新页面
- refresh: function (data) {
- // 刷新一览界面
- _this.searchData();
- }
- },
- success: function (res) {
- let data = {}
- data.id = item.followId
- data.formMode = Constants.formMode.edit
- data.formType = Constants.formMode.detail
- data.title = title
- res.eventChannel.emit('params', data);
- }
- })
- },
- /**
- * @desc : 切换
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
- onChangeTabs(e) {
- let code = e.detail.detail.code
- this.setData({
- followStatus: code,
- })
- this.searchData()
- },
- /**
- * @desc : 设置查询参数
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
- setSearchParams(params) {
- //销售状态
- params.followStatus = this.data.followStatus == 'all' ? '' : this.data.followStatus
-
- // if(this.data.followStatus === "跟进状态-约尺"){
- // params.measureSe = "量尺状态-已量尺"
- // }
- params.nextFollowTime = null
- return params
- },
- /**
- * @desc : 处理接口返回数据
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
- handleSearchData(tableData) {
- let contentSaveList = this.data.contentSaveList
- contentSaveList[0].bill = tableData.length
- tableData.forEach(res => {
- if (res.followStatus == mixins.$t('followStatusFoot') && res.measureStatus == mixins.$t('scaleStatusMeasured')) {
- res.measureStatusName = ''
- }
- if(res.addressFull){
- const addressNo = res.addressNo? res.addressNo: ''
- res.addressFull = res.addressFull + addressNo
- }
- })
- this.setData({
- tableData: tableData,
- contentSaveList: contentSaveList
- })
- },
- /**
- * @desc : 查询
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
- getData(params) {
- return this.excute(this.data.service, this.data.service.selectByCond, params);
- },
- })
|