| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- /*******************************************************************************
- * 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: {
- radioFollowUp: '1',
- routeObjName: 'cusFollow',
- cardList: ['main'],
- buttonSaveList: [{ code: 'add', title: mixins.$t('save'), width: '120rpx' }],
- contentObj: {
- main: [
- { code: 'cusName', type: 'str', required: true, title: mixins.$t('customerName') },
- { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
- { code: 'addressFull', type: 'address', title: mixins.$t('addressFull'), required: false },
- { code: 'addressNo', type: 'str', required: false, title: mixins.$t('addressNo') },
- { code: 'intention', name: 'intentionName', type: 'drop', required: true, dropType: 'customerIntention', title: mixins.$t('intention') },
- { code: 'remarks', type: 'textarea', rows: '5', required: true, showWordLimit: true, title: mixins.$t('followData') },
- { code: 'nextFollowTime', type: 'dateTime', required: true, title: mixins.$t('nextFollowTime') },
- { code: 'stayTimeLen', name: 'stayTimeLenName', required: true, title: mixins.$t('stayTimeLen'), dropType: 'storeRetentionTime', type: 'drop', },
- { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
- ]
- },
- table: Constants.tables.cusFollow,
- customerService: app.globalData['customerService'],
- followStatus: mixins.$t('followStatusReporting')
- },
- /**
- * @desc : 设置保存参数
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
- setParams(params) {
- params.followStatus = this.data.followStatus
- params.followOrg = app.globalData.user.orgId
- return params
- },
- /**
- * @desc : 保存数据服务
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
- saveData() {
- return this.excute(this.data.service, this.data.service.insert, this.data.params);
- },
- /**
- * @desc : 手机号离开焦点事件
- * @date : 2024/4/8 15:49
- * @author : 于继渤
- */
- changePhoneblur(e) {
- let phone = e.detail.detail.detail.value
- if (phone) {
- //查询客户信息
- this.getCustomerData({ cusPhone: phone })
- }
- },
- /**
- * @desc : 查询客户信息
- * @author : 于继渤
- * @date : 2024/1/23 9:16
- */
- getCustomerData(params) {
- return this.excute(this.data.customerService, this.data.customerService.selectByCondNoPage, params).then(res => {
- if (res.data.code == 200) {
- if (res.data.data.length > 0) {
- let formData = JSON.parse(this.data.formData)
- let item = res.data.data[0]
- formData.cusCode = item.cusCode
- formData.cusId = item.cusId
- formData.cusName = item.cusName
- formData.cusFromName = item.cusFromName
- //处理地址
- formData.address = {
- address: item.addressFull,
- addressFull: item.addressFull,
- addressArea: item.addressArea,
- addressGcj02: item.addressGcj02,
- addressName: item.addressName,
- }
- formData.addressArea = item.addressArea
- formData.addressFull = item.addressFull
- formData.addressGcj02 = item.addressGcj02
- formData.addressName = item.addressName
- formData.addressNo = item.addressNo
- this.setData({
- formData: JSON.stringify(formData)
- })
- }
- }
- });
- },
- /**
- * @desc : 顶部切换
- * @date : 2024/4/8 15:49
- * @author : 于继渤
- */
- onRadioFollowUp(e) {
- let detail = e.detail
- this.setFormContent(detail)
- this.setData({
- radioFollowUp: detail,
- formData: null
- })
- console.log('onRadioFollowUp', e.detail)
- },
- /**
- * @desc : 跳转购物车
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
- toShopping(){
- },
- /**
- * @desc : 设置跟进form 字段
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
- setFormContent(radioFollowUp) {
- let radioFollowUpOnelist = [
- { code: 'cusName', type: 'str', required: true, title: mixins.$t('customerName') },
- { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
- { code: 'addressFull', type: 'address', title: mixins.$t('addressFull'), required: false },
- { code: 'addressNo', type: 'str', required: false, title: mixins.$t('addressNo') },
- { code: 'intention', name: 'intentionName', type: 'drop', required: true, dropType: 'customerIntention', title: mixins.$t('intention') },
- { code: 'remarks', type: 'textarea', rows: '5', required: true, showWordLimit: true, title: mixins.$t('followData') },
- { code: 'nextFollowTime', type: 'dateTime', required: true, title: mixins.$t('nextFollowTime') },
- { code: 'stayTimeLen', name: 'stayTimeLenName', required: true, title: mixins.$t('stayTimeLen'), dropType: 'storeRetentionTime', type: 'drop', },
- { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
- ]
- let radioFollowUpTwolist = [
- { code: 'intention', name: 'intentionName', type: 'drop', required: true, dropType: 'customerIntention', title: mixins.$t('intention') },
- { code: 'remarks', type: 'textarea', rows: '5', required: true, showWordLimit: true, title: mixins.$t('followData') },
- { code: 'stayTimeLen', name: 'stayTimeLenName', required: true, title: mixins.$t('stayTimeLen'), dropType: 'storeRetentionTime', type: 'drop', },
- { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
- ]
- let contentObj = this.data.contentObj
- let followStatus = this.data.followStatus
- if (radioFollowUp == '1') {
- followStatus = mixins.$t('followStatusReporting')
- contentObj.main = radioFollowUpOnelist
- }
- if (radioFollowUp == '2') {
- followStatus = mixins.$t('followStatusReception')
- contentObj.main = radioFollowUpTwolist
- }
- this.setData({
- followStatus, followStatus,
- contentObj: contentObj
- })
- }
- })
|