customer-reception.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992
  1. const app = getApp();
  2. const api = require('../../../utils/api.js');
  3. const Constants = require('../../../utils/Constants.js');
  4. const util = require('../../../utils/util.js')
  5. const common = require('../../../utils/common.js')
  6. import Dialog from '../../../dist/dialog/dialog.js';
  7. Page({
  8. /**
  9. * 页面的初始数据
  10. */
  11. data: {
  12. statusItem_org: {
  13. text: '业务部门',
  14. value: -1
  15. },
  16. staffIds: [],
  17. selectflag: false,
  18. checked_1: false,
  19. checked_2: false,
  20. checked_3: false,
  21. checked_4: false,
  22. checked_5: false,
  23. checked_6: false,
  24. checked_7: false,
  25. checked_8: false,
  26. checked_9: false,
  27. checked_10: false,
  28. checked_11: false,
  29. checked_12: false,
  30. show: false,
  31. showTime: false,
  32. activeboxNames: [],
  33. customerName: '',
  34. noMore: false,
  35. loading: false,
  36. pageInfo: {
  37. pageSize: 6,
  38. currentPage: 1
  39. },
  40. list: [],
  41. totallength: 0, //视图下方提醒数量
  42. active: 0,
  43. createTimeType: {
  44. text: '近30天',
  45. value: 5
  46. },
  47. followUpPerson: {
  48. text: '张三',
  49. value: -1
  50. },
  51. followUpOrg: {
  52. text: '佛山居然店',
  53. value: -1
  54. },
  55. columns: [],
  56. currentDate: new Date().getTime() + 100,
  57. formatter(type, value) {
  58. if (type === 'year') {
  59. return `${value}年`;
  60. }
  61. if (type === 'month') {
  62. return `${value}月`;
  63. }
  64. if (type === 'day') {
  65. return `${value}日`;
  66. }
  67. if (type === 'hour') {
  68. return `${value}时`;
  69. }
  70. if (type === 'minute') {
  71. return `${value}分`;
  72. }
  73. return value;
  74. },
  75. form: {
  76. LeaveTime: '请选择',
  77. LeaveTime_: '请选择',
  78. OtherName: '其他',
  79. remindTime: '',
  80. followCount: '',
  81. followCount_: '',
  82. nextFollowTimeList: [],
  83. nextFollowTime: '',
  84. nextFollowTime_: '',
  85. },
  86. list: [],
  87. searchText: '',
  88. searchFormNumber: 0,
  89. //筛选字段
  90. searchForm: {
  91. overDueStatus:0,
  92. followStatusList: [],
  93. nextFollowTimeList: [],
  94. },
  95. nextFollowTime: '',
  96. },
  97. toAdd() {
  98. wx.navigateTo({
  99. url: './add/add?type=add',
  100. })
  101. },
  102. onChangePickDate() {
  103. this.setData({
  104. showTime: true
  105. })
  106. },
  107. /**
  108. * @desc : 跳转客户收款新建
  109. * @date : 2022/7/9 15:01
  110. * @author : 常皓宁
  111. */
  112. toCollectionAdd(e) {
  113. let customerItem = e.currentTarget.dataset.item
  114. if (!customerItem.customerId) {
  115. wx.showToast({
  116. title: '无此联系人,或陌生接待',
  117. icon: 'none'
  118. })
  119. return
  120. }
  121. this.setData({
  122. showShare: false
  123. })
  124. wx.navigateTo({
  125. url: '/package4/pages/order-billing/customer-collection/add/add?customerItem=' + encodeURIComponent(JSON.stringify(customerItem)),
  126. })
  127. },
  128. /**
  129. * 跳转
  130. */
  131. toDetail(e) {
  132. let item = e.currentTarget.dataset.item
  133. if(this.data.active ==1 ){
  134. wx.navigateTo({
  135. url: '/package-basic-data/pages/customer-follow-up/detail/detail?item=' + encodeURIComponent(JSON.stringify(item)),
  136. })
  137. return
  138. }
  139. wx.navigateTo({
  140. url: './detail/detail?item=' + encodeURIComponent(JSON.stringify(item)),
  141. })
  142. },
  143. onCloseChooseDate() {
  144. this.setData({
  145. showTime: false
  146. })
  147. },
  148. /**
  149. * 留店时长
  150. */
  151. showPopup() {
  152. this.setData({
  153. LeaveTimeFlag: true
  154. });
  155. },
  156. /**
  157. * @desc : 打电话
  158. * @date : 2022/5/18 15:49
  159. * @author : 于继渤
  160. */
  161. openTelPhone(e) {
  162. let tel = e.currentTarget.dataset.item.customerPhone
  163. if (tel) {
  164. wx.makePhoneCall({
  165. phoneNumber: tel,
  166. })
  167. } else {
  168. wx.showModal({
  169. title: '手机号不正确',
  170. message: ''
  171. })
  172. }
  173. },
  174. //抽屉打开
  175. openSearchPop() {
  176. this.setData({
  177. show: true,
  178. })
  179. let that = this
  180. setTimeout(function () {
  181. that.setData({
  182. activeboxNames: ['1', '2'],
  183. })
  184. }, 100)
  185. },
  186. closeSearchPop() {
  187. this.selectComponent("#pick").toggle(false) //取消选中样式
  188. this.setData({
  189. show: false
  190. })
  191. },
  192. onChangefollowCount(e) {
  193. let form = this.data.form
  194. form.followCount_ = e.detail
  195. this.setData({
  196. form: form
  197. })
  198. },
  199. onChangebox(e) {
  200. this.setData({
  201. activeboxNames: e.detail
  202. })
  203. },
  204. //抽屉确定
  205. doSearchData(e) {
  206. this.selectComponent("#pick").toggle(false) //取消选中样式
  207. let form = this.data.form
  208. let searchFormNumber = 0
  209. form.followCount = this.data.form.followCount_
  210. form.nextFollowTime = this.data.nextFollowTime
  211. form.LeaveTime = this.data.form.LeaveTime_
  212. let specsList_ = this.data.specsList_
  213. let specsList_flag = false
  214. specsList_.forEach(element => {
  215. if (element.checked) {
  216. specsList_flag = true
  217. }
  218. });
  219. let receptionStatusList_ = this.data.receptionStatusList_
  220. let receptionStatusList_flag = false
  221. receptionStatusList_.forEach(element => {
  222. if (element.checked) {
  223. receptionStatusList_flag = true
  224. }
  225. });
  226. if (this.data.form.LeaveTime_ != '请选择') {
  227. searchFormNumber++
  228. }
  229. if (this.data.form.followCount_ != '') {
  230. searchFormNumber++
  231. }
  232. if (this.data.form.nextFollowTime_ != '') {
  233. searchFormNumber++
  234. }
  235. if (specsList_flag) {
  236. searchFormNumber++
  237. }
  238. if (receptionStatusList_flag) {
  239. searchFormNumber++
  240. }
  241. this.setData({
  242. show: false,
  243. specsList: this.data.specsList_,
  244. receptionStatusList: this.data.receptionStatusList_,
  245. form,
  246. searchFormNumber
  247. })
  248. this.doSearch()
  249. },
  250. onTimeClose() {
  251. this.setData({
  252. LeaveTimeFlag: false,
  253. })
  254. },
  255. /**
  256. * @desc : 抽屉重置
  257. * @author : 于继渤
  258. * @date : 2022/6/7 19:16
  259. */
  260. clearSearchForm() {
  261. let searchForm = this.data.searchForm
  262. searchForm = {
  263. followStatusList: [],
  264. nextFollowTimeList: [],
  265. }
  266. let form = this.data.form
  267. form.LeaveTime_ = '请选择',
  268. form.followCount_ = '',
  269. form.nextFollowTime_ = '',
  270. this.setData({
  271. specsList_: this.data.specsList_center,
  272. receptionStatusList_: this.data.receptionStatusList_center,
  273. form,
  274. searchFormNumber: 0
  275. })
  276. this.selectComponent("#followStatus").clearForm()
  277. this.setData({
  278. searchForm: searchForm,
  279. nextFollowTime: '',
  280. })
  281. },
  282. /**
  283. * @desc : 跟进时间确认事件
  284. * @author : 于继渤
  285. * @date : 2022/5/26 17:16
  286. */
  287. onConfirmChooseDate(e) {
  288. let key = e.currentTarget.dataset.key
  289. //跟进时间
  290. if (key === 'nextFollowTime') {
  291. let form = this.data.form
  292. form.nextFollowTimeList = [util.formatDayTime(new Date(this.data.nextFollowTimeDefaultSearch)) + ' 00:00:00', util.formatDayTime(new Date(this.data.nextFollowTimeDefaultSearch)) + ' 23:59:59'],
  293. form.nextFollowTime_ = util.formatDayTime(new Date(this.data.nextFollowTimeDefaultSearch)),
  294. this.setData({
  295. form: form,
  296. nextFollowTimeFlag: false,
  297. })
  298. } else if (key === 'leaveTime') {
  299. let form = this.data.form
  300. let columns = this.data.columns
  301. form.LeaveTime_ = this.data.form.LeaveTime_ == "请选择" ? columns[0] : this.data.form.LeaveTime_
  302. this.setData({
  303. form: form,
  304. LeaveTimeFlag: false
  305. })
  306. }
  307. },
  308. /**
  309. * 留店时长
  310. * @param {*} e
  311. */
  312. onChange(e) {
  313. let form = this.data.form
  314. form.LeaveTime_ = e.detail.value
  315. this.setData({
  316. form: form,
  317. })
  318. },
  319. onCloseChooseDate() {
  320. this.setData({
  321. showTime: false
  322. })
  323. },
  324. /**
  325. * @desc :跟进时间变化事件
  326. * @author : 于继渤
  327. * @date :2022/6/8 9:16
  328. */
  329. changeDate(e) {
  330. let key = e.currentTarget.dataset.key
  331. //跟进时间
  332. if (key === 'nextFollowTime') {
  333. this.setData({
  334. nextFollowTimeDefaultSearch: e.detail
  335. })
  336. }
  337. },
  338. /**
  339. * @desc : 筛选选择跟进提醒时间
  340. * @author : 于继渤
  341. * @date : 2022/6/8 9:16
  342. */
  343. onClickTime(e) {
  344. let key = e.currentTarget.dataset.key
  345. if (key === 'nextFollowTime') {
  346. this.setData({
  347. nextFollowTimeDefaultSearch: new Date().getTime() + 100,
  348. nextFollowTimeFlag: true
  349. })
  350. }
  351. },
  352. //抽屉离焦关闭
  353. onClose() {
  354. this.setData({
  355. showShare: false,
  356. LeaveTimeFlag: false,
  357. show: false
  358. })
  359. this.selectComponent("#pick").toggle(false) //取消选中样式
  360. },
  361. /**
  362. * @desc : 调取企业微信会话
  363. * @date : 2022/5/18 15:49
  364. * @author : 于继渤
  365. */
  366. openWeChat(e) {
  367. if (!app.globalData.SystemInfo.environment) {
  368. wx.showToast({
  369. title: '请在企业微信模式下运行',
  370. icon: 'none'
  371. })
  372. return
  373. }
  374. let item = e.currentTarget.dataset.item
  375. wx.qy.openEnterpriseChat({
  376. // 注意:userIds和externalUserIds至少选填一个,且userIds+externalUserIds总数不能超过2000,如果externalUserIds有微信联系人,则总数不能超过40人。
  377. userIds: '', //参与会话的企业成员列表,格式为userid1;userid2;...,用分号隔开。
  378. // 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
  379. externalUserIds: item.qvExternalUserid,
  380. groupName: '', // 必填,会话名称。单聊时该参数传入空字符串""即可。
  381. chatId: "", //新建会话时,chatId必须为空串
  382. success: function (res) {
  383. // 回调
  384. var chatId = res.chatId; //返回chatId仅在企业微信3.0.36及以后版本支持;
  385. },
  386. fail: function (res) {
  387. // 失败处理
  388. wx.showToast({
  389. title: res.data.message,
  390. icon: 'none'
  391. })
  392. }
  393. });
  394. },
  395. /**
  396. * tabs切换
  397. * @param {*} e
  398. */
  399. onChangeTabs(e) {
  400. this.setData({
  401. list: []
  402. })
  403. let title = e.detail.title
  404. if (title === '所有接待') {
  405. this.setData({
  406. active: 0
  407. })
  408. }
  409. if (title === '跟进任务') {
  410. this.setData({
  411. active: 1
  412. })
  413. }
  414. if (title === '邀约进店') {
  415. this.setData({
  416. active: 2
  417. })
  418. }
  419. if (title === '预约量尺') {
  420. this.setData({
  421. active: 3
  422. })
  423. }
  424. // this.getData()
  425. this.doSearch()
  426. },
  427. /**
  428. * @desc : 日期组件后的回调
  429. * @author : 于继渤
  430. * @date : 2022/5/24 12:16
  431. */
  432. dateCommit(e) {
  433. let dateType = e.detail.dateType
  434. if (dateType === 'createtime') {
  435. let data = e.detail.date
  436. this.setData({
  437. createTimeSearch: data,
  438. createTimeType: e.detail.dateDefault
  439. })
  440. this.selectComponent('#create-time-type').toggle();
  441. }
  442. this.doSearch()
  443. },
  444. /**
  445. * @desc : 下拉多选关闭
  446. * @author : 于继渤
  447. * @date : 2022/5/26 12:16
  448. */
  449. muticloseAll(e) {
  450. let id = e.currentTarget.id
  451. if (id === 'staff') {
  452. this.setData({
  453. staffFlag: false
  454. })
  455. this.selectComponent("#statusItemStaff").toggle()
  456. }
  457. if (id === 'org') {
  458. this.setData({
  459. orgFlag: false
  460. })
  461. this.selectComponent("#statusItemOrg").toggle()
  462. }
  463. },
  464. onSearchText(e) {
  465. this.setData({
  466. searchText: e.detail,
  467. searchTextFlag: e.detail ? true : false//TOP搜索输入标识
  468. })
  469. },
  470. /**
  471. * @desc : 获取数据
  472. * @author : 于继渤
  473. * @date : 2022/5/23 15:16
  474. */
  475. getData(e) {
  476. let list = [{
  477. "addressArea": {
  478. "province": "辽宁省",
  479. "city": "沈阳市",
  480. "district": "铁西区"
  481. },
  482. "addressFull": "辽宁省沈阳市铁西区小四川水煮鱼(鑫丰中心里店)12313123122",
  483. "addressGcj02": {
  484. "latitude": 41.810535,
  485. "longitude": 123.38065
  486. },
  487. "addressName": "小四川水煮鱼(鑫丰中心里店)",
  488. "addressNo": "12313123122",
  489. "annexCount": 0,
  490. "annexPaths": [],
  491. "competitiveBrands": "",
  492. "cpId": 20760,
  493. "createTime": "2024-01-23",
  494. "customerCode": "12313123122-100310",
  495. "customerId": 3924,
  496. "customerName": "12313123122",
  497. "customerPhone": "13112122111",
  498. "designName": null,
  499. "designUser": null,
  500. "flgAgainMeasure": null,
  501. "flgValid": true,
  502. "followCount": 1,
  503. "followData": "11",
  504. "followId": 1928,
  505. "followQvRecord": null,
  506. "followStatus": "跟进状态-报备",
  507. "followStatusName": "留资接待",
  508. "followTime": "2024-01-23 16:07",
  509. "followTimeLen": null,
  510. "followType": "跟进方式-进店",
  511. "followTypeName": "进店",
  512. "followUser": 643,
  513. "followUserName": "王英杰",
  514. "hourTime": null,
  515. "intention": "客户意向-有意向",
  516. "intentionInfo": [],
  517. "intentionName": "有意向",
  518. "intentionTags": [],
  519. "intentionTagsName": null,
  520. "inviteResult": null,
  521. "inviteTime": null,
  522. "loseReasonName": null,
  523. "measureAnnex": null,
  524. "measureRemarks": null,
  525. "measureStatus": null,
  526. "measureTime": null,
  527. "nextFollowPlan": "",
  528. "nextFollowTime": null,
  529. "orgName": "北海富安居店",
  530. "qvChatId": null,
  531. "qvExternalUserid": null,
  532. "remarks": null,
  533. "saleStatus": "客成状态-成交",
  534. "saleStatusName": "成交",
  535. "stayTimeLen": "留店时长-0-10分钟",
  536. "tagName": [],
  537. "weekTime": null
  538. }];
  539. this.setData({
  540. list
  541. })
  542. },
  543. /**
  544. * @desc : 查询
  545. * @author : 于继渤
  546. * @date : 2022/5/24 08:49
  547. */
  548. doSearch() {
  549. let pageInfo = this.data.pageInfo;
  550. pageInfo.pageSize = 6;
  551. pageInfo.currentPage = 1;
  552. this.setData({
  553. show: false,
  554. noMore: false,
  555. pageInfo: pageInfo,
  556. list: []
  557. })
  558. this.getData()
  559. },
  560. /**
  561. * @desc : 页面上拉触底事件的处理函数
  562. * @author : 于继渤
  563. * @date : 2022/5/24 08:49
  564. */
  565. onReachBottom: function () {
  566. if (this.data.loading || this.data.noMore) {
  567. return;
  568. }
  569. this.setData({
  570. pageInfo: {
  571. pageSize: this.data.pageInfo.pageSize,
  572. currentPage: this.data.pageInfo.currentPage + 1
  573. }
  574. })
  575. this.getData('more')
  576. },
  577. /**
  578. * 生命周期函数--监听页面加载
  579. */
  580. onLoad: function (options) {
  581. //按钮权限
  582. // let Receive_Customer_Add = common.hasButtonRight(Constants.Receive_Customer_Add) //新建
  583. // let Receive_Customer_Follow = common.hasButtonRight(Constants.Receive_Customer_Follow) //跟进
  584. // let Receive_Customer_Task = common.hasButtonRight(Constants.Receive_Customer_Task) //跟进任务
  585. // let Receive_Customer_Order = common.hasButtonRight(Constants.Receive_Customer_Order) //销售订单
  586. // let Receive_Customer_Receive = common.hasButtonRight(Constants.Receive_Customer_Receive) //客户收款
  587. // let Receive_Customer_Measure = common.hasButtonRight(Constants.Receive_Customer_Measure) //量尺回执
  588. this.setData({
  589. Receive_Customer_Add: true,
  590. Receive_Customer_Follow: true,
  591. Receive_Customer_Task: true,
  592. Receive_Customer_Order: true,
  593. Receive_Customer_Receive: true,
  594. Receive_Customer_Measure: true,
  595. })
  596. this.doSearch()
  597. },
  598. /**
  599. * 生命周期函数--监听页面显示
  600. */
  601. onShow: function () {
  602. if (this.data.selectflag) {
  603. this.doSearch()
  604. this.followTime_init_base()
  605. }
  606. },
  607. /**
  608. * 页面相关事件处理函数--监听用户下拉动作
  609. */
  610. onPullDownRefresh: function () {
  611. let that = this
  612. //调用刷新时将执行的方法
  613. that.setData({
  614. loadingShow: true,
  615. })
  616. this.doSearch()
  617. this.followTime_init_base()
  618. //隐藏导航条加载动画
  619. wx.hideNavigationBarLoading();
  620. setTimeout(function () {
  621. that.setData({
  622. loadingShow: false,
  623. })
  624. //停止下拉刷新
  625. wx.stopPullDownRefresh();
  626. }, 800)
  627. },
  628. /**
  629. * 获取接待时常数据
  630. */
  631. followTime_init_base() {
  632. return
  633. let param = {
  634. dataSourceCode: 'followTime'
  635. }
  636. api.request(Constants.BASIC_COMMON_API + 'get_wx_init_data', 'POST', param).then(res => {
  637. if (res.data.code === 200) {
  638. let followTime = []
  639. let columns = []
  640. followTime = res.data.data
  641. followTime.forEach(element => {
  642. columns.push(element.name)
  643. });
  644. this.setData({
  645. columns
  646. })
  647. }
  648. })
  649. },
  650. /**
  651. * @desc : 下拉多选确定
  652. * @author : 于继渤
  653. * @date : 2022/5/26 12:16
  654. */
  655. mutiSearchAll(e) {
  656. let id = e.currentTarget.id
  657. if (id === 'staff') {
  658. this.setData({
  659. staffIds: e.detail.idList,
  660. staffNames: e.detail.names,
  661. staffFlag: false
  662. })
  663. this.selectComponent("#statusItemStaff").toggle(false)
  664. this.doSearch()
  665. }
  666. if (id === 'org') {
  667. this.setData({
  668. orgIds: e.detail.idList,
  669. orgNames: e.detail.names,
  670. orgFlag: false
  671. })
  672. this.selectComponent("#statusItemOrg").toggle(false)
  673. this.doSearch()
  674. }
  675. },
  676. /**
  677. * @desc : 下拉多选事件
  678. * @author : 于继渤
  679. * @date : 2022/5/26 12:16
  680. */
  681. openDropdown(e) {
  682. this.setData({
  683. staffFlag: true
  684. })
  685. },
  686. /**
  687. * @desc : 下拉多选事件
  688. * @author : 于继渤
  689. * @date : 2022/5/26 12:16
  690. */
  691. dropdowncommit(e) {
  692. this.setData({
  693. orgFlag: true
  694. })
  695. },
  696. /**
  697. * 获取意向品类数据源
  698. */
  699. getGoodsSpecs() {
  700. let param = {
  701. dataSourceCode: "商品规格分类"
  702. }
  703. param.cpId = app.globalData.user.cpId
  704. api.request(Constants.BASIC_COMMON_API + 'get_wx_init_data', 'POST', param).then(res => {
  705. if (res.data.code === 200) {
  706. let specsList = []
  707. specsList = res.data.data
  708. specsList.forEach(element => {
  709. element.checked = false
  710. });
  711. this.setData({
  712. specsList,
  713. specsList_: specsList,
  714. specsList_center: specsList
  715. })
  716. }
  717. })
  718. },
  719. /**
  720. * 获取接待状态数据源
  721. */
  722. getReceptionStatus() {
  723. let param = {
  724. dataSourceCode: "接待状态"
  725. }
  726. param.cpId = app.globalData.user.cpId
  727. api.request(Constants.BASIC_COMMON_API + 'get_wx_init_data', 'POST', param).then(res => {
  728. if (res.data.code === 200) {
  729. let receptionStatusList = []
  730. receptionStatusList = res.data.data
  731. receptionStatusList.forEach(element => {
  732. element.checked = false
  733. element.id = element.code
  734. });
  735. this.setData({
  736. receptionStatusList,
  737. receptionStatusList_: receptionStatusList,
  738. receptionStatusList_center: receptionStatusList
  739. })
  740. }
  741. })
  742. },
  743. /**
  744. *手风琴 复选框 数据源监听事件 ---接待状态
  745. */
  746. onReceptionStatusDataChange(e) {
  747. this.setData({
  748. receptionStatusList_: e.detail.dataList
  749. })
  750. },
  751. /**
  752. *手风琴 复选框 数据源监听事件 ---意向品类
  753. */
  754. onSpecsDataChange(e) {
  755. this.setData({
  756. specsList_: e.detail.dataList
  757. })
  758. },
  759. //3点
  760. onclik(e) {
  761. this.setData({
  762. showShare: true,
  763. bottomItem: e.currentTarget.dataset.item,
  764. customerName: e.currentTarget.dataset.item.customerName,
  765. onclikItem: e.currentTarget.dataset.item
  766. })
  767. },
  768. follow() {
  769. wx.navigateTo({
  770. url: '/package-basic-data/pages/customer-follow-up/customer-follow-up' ,
  771. })
  772. },
  773. followtask() {
  774. this.setData({
  775. showShare: false
  776. })
  777. wx.navigateTo({
  778. // url: '/package-basic-data/pages/follow-up-tasks/follow-up-tasks',
  779. url: '/package-basic-data/pages/customer-follow-up/follow-up-tasks/follow-up-tasks' ,
  780. })
  781. },
  782. //量尺回执
  783. measure() {
  784. this.setData({
  785. showShare: false
  786. })
  787. wx.navigateTo({
  788. url: '/package3/pages/customer-follow-up/measure-to/measure-to?item=' + encodeURIComponent(JSON.stringify(this.data.onclikItem)),
  789. })
  790. },
  791. /**
  792. * @desc : 跳转预算报价新建
  793. * @date : 2022/7/7 14:12
  794. * @author : 于继渤
  795. */
  796. toOrderAdd(e) {
  797. let customerItem = e.currentTarget.dataset.item
  798. if (!customerItem.customerId) {
  799. wx.showToast({
  800. title: '无此联系人,或陌生接待',
  801. icon: 'none'
  802. })
  803. return
  804. }
  805. this.setData({
  806. showShare: false
  807. })
  808. wx.navigateTo({
  809. url: '/package4/pages/order-billing/choose-goods/choose-goods?orderType=1&customerItem=' + encodeURIComponent(JSON.stringify(customerItem)),
  810. })
  811. },
  812. /**
  813. * @desc : 筛选数据源组件点击事件
  814. * @author : 于继渤
  815. * @date : 2022/5/31 08:59
  816. */
  817. onClickTag(e) {
  818. let key = e.detail.key
  819. let dataList = e.detail.dataList
  820. let searchForm = this.data.searchForm
  821. if (key === 'followStatus') {
  822. let tempList = []
  823. //客意品类-智能,客意品类-定制
  824. dataList.forEach(res => {
  825. if (res == 0) {
  826. tempList.push('跟进状态-报备')
  827. }
  828. if (res == 1) {
  829. tempList.push('跟进状态-接待')
  830. }
  831. })
  832. searchForm.followStatusList = tempList
  833. }
  834. if (key === 'overDueStatus') {
  835. let tempList = []
  836. let overDueStatus = 0
  837. dataList.forEach(res => {
  838. if (res == 0) {
  839. tempList.push('逾期状态-未逾期')
  840. overDueStatus = 0
  841. }
  842. if (res == 1) {
  843. tempList.push('逾期状态-逾期')
  844. overDueStatus = 1
  845. }
  846. if (res == 2) {
  847. tempList.push('逾期状态-完结')
  848. overDueStatus = 2
  849. }
  850. if (res == 3) {
  851. tempList.push('逾期状态-全部')
  852. overDueStatus = 3
  853. }
  854. })
  855. // searchForm.overdueStatusList = tempList
  856. searchForm.overDueStatus = overDueStatus
  857. }
  858. this.setData({
  859. searchForm: searchForm
  860. })
  861. },
  862. /**
  863. * @desc : 筛选选择跟进提醒时间确认事件
  864. * @author : 于继渤
  865. * @date : 2022/7/5 18:16
  866. */
  867. nextFollowTimeDateCommit(e) {
  868. let searchForm = this.data.searchForm
  869. let nextFollowTime = this.data.nextFollowTime
  870. searchForm.nextFollowTimeList = e.detail.date
  871. nextFollowTime = e.detail.date[0] + '-' + e.detail.date[1]
  872. this.setData({
  873. searchForm: searchForm,
  874. nextFollowTime: nextFollowTime
  875. })
  876. //调查询
  877. },
  878. toOk() {
  879. this.setData({
  880. showShare: false
  881. })
  882. let _this = this
  883. Dialog.confirm({
  884. message: '确认完成跟进任务吗?',
  885. }).then(() => {
  886. let bottomItem = this.data.bottomItem
  887. _this.isFlgvaild(bottomItem.planId)
  888. instance.close();
  889. }).catch(() => {
  890. // _this.setData({
  891. // showShare: true
  892. // })
  893. });
  894. },
  895. isFlgvaild(planId) {
  896. this.setData({
  897. loading: true
  898. })
  899. api.request(Constants.SALE_CUSTOMERFOLLOW_PLAN_API + 'update_by_follow_plan_id' , 'POST', {
  900. planId:planId
  901. }).then(res => {
  902. this.setData({
  903. loading: false
  904. })
  905. if (res.data.code === 200) {
  906. wx.showToast({
  907. title: '操作成功',
  908. image: '/static/image/success.png',
  909. duration: 1000
  910. })
  911. this.doSearch()
  912. }
  913. })
  914. },
  915. })