clewent.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057
  1. <template>
  2. <div class="bgcolor clewent" v-if="infoData">
  3. <!-- 顶部条-->
  4. <div class="navBarTOP">
  5. <van-nav-bar class="navBar" left-arrow :title="title" @click-left="onClickLeft" />
  6. </div>
  7. <!-- 主体内容-->
  8. <div class="lineGrey"></div>
  9. <div class="lineGrey"></div>
  10. <div class="lineGrey"></div>
  11. <div class="lineGrey"></div>
  12. <div class="lineGrey"></div>
  13. <clewentDetails v-if="infoData" :infoData="infoData">
  14. <!-- <van-button
  15. type="info"
  16. v-if="infoData.customerClueStatus == 0"
  17. style="
  18. float: right;
  19. background: #0057ba;
  20. border-color: #0057ba;
  21. color: #fff;
  22. margin-top: -36px;
  23. border-radius: 5px;
  24. "
  25. size="small"
  26. plain
  27. class="centerBtn"
  28. @click="onstopVisit"
  29. >转交其他组织</van-button
  30. > -->
  31. </clewentDetails>
  32. <!-- 催办历史 -->
  33. <hasten
  34. v-if="infoData && infoData.customerClueInfoUrgeList"
  35. :hastenList="infoData.customerClueInfoUrgeList"></hasten>
  36. <p style="margin: 0 16px 8px; color: #888" v-if="infoData.userCustomerClueList">
  37. 该客资历史跟进记录
  38. </p>
  39. <van-cell-group inset class="cardclewContentCell">
  40. <div style="border-radius: 6px; overflow: hidden">
  41. <van-cell
  42. is-link
  43. v-for="(item, index) in infoData.userCustomerClueList"
  44. :key="index"
  45. @click="viewFn(item.userCustomerClueId)">
  46. <template #title>
  47. <span class="custom-title">{{ item.nickName }}</span>
  48. </template>
  49. <div class="cardContent">
  50. <p class="textLeft" style="padding-bottom: 0px; margin: 0">{{ item.createTime }}</p>
  51. </div>
  52. </van-cell>
  53. </div>
  54. </van-cell-group>
  55. <!-- 批量采购 -->
  56. <template v-if="infoData && infoData.isClose != 1">
  57. <div class="taskGather" v-if="taskGather">
  58. <radioGroup :clueOptionList="taskGather"></radioGroup>
  59. </div>
  60. </template>
  61. <br />
  62. <div v-if="infoData && infoData.isClose != 1" class="tc" style="padding: 0 16px">
  63. <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
  64. 提交
  65. </van-button>
  66. </div>
  67. <br />
  68. <br />
  69. <br />
  70. <br />
  71. <br />
  72. <van-dialog v-model="show" title="转发客资" show-cancel-button :before-close="confirm">
  73. <p>
  74. <van-notice-bar wrapable :scrollable="false" text="一旦转交出去,则无法再查看,请确认!" />
  75. </p>
  76. <van-row class="serchInput">
  77. <van-col span="24">
  78. <van-cell
  79. class="monthNow selectcell"
  80. :title="companyName"
  81. is-link
  82. arrow-direction="down"
  83. @click="regionClick" />
  84. </van-col>
  85. <van-col span="24">
  86. <van-cell
  87. class="monthNow selectcell"
  88. :title="regionName"
  89. is-link
  90. @click="SalesRegionClick"
  91. arrow-direction="down" />
  92. </van-col>
  93. <van-col span="24">
  94. <van-cell
  95. class="monthNow selectcell"
  96. :title="deptName"
  97. is-link
  98. @click="SalesDepartmentClick"
  99. arrow-direction="down" />
  100. </van-col>
  101. </van-row>
  102. </van-dialog>
  103. <van-dialog
  104. v-model="showView"
  105. title="客资历史"
  106. show-cancel-button
  107. cancel-button-text="关闭"
  108. :show-confirm-button="confirmBtn"
  109. class="dialogz">
  110. <br />
  111. <div
  112. class="container linep containertext"
  113. style="
  114. background-color: #fff;
  115. width: 94%;
  116. margin: 0px auto;
  117. border-radius: 6px;
  118. font-size: 14px;
  119. ">
  120. <van-form ref="tabstoreVal">
  121. <div v-for="(item, index) in customItemList" :key="index">
  122. <div
  123. class="formLabel z-cell z-cells z-celly"
  124. v-if="item.answerType == 'sz' || item.answerType == 'rq'">
  125. <van-cell>
  126. <template #title
  127. >{{ index + 1 }}.{{ item.customerClueName }}
  128. <span
  129. style="
  130. color: #444;
  131. font-size: 12px;
  132. margin: 0;
  133. padding: 10px 0;
  134. text-align: right;
  135. "
  136. >{{ item.remark }}</span
  137. ></template
  138. >
  139. </van-cell>
  140. <p class="mg0" style="word-break: break-all">{{ item.answerValue }}</p>
  141. </div>
  142. <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType == 'zp'">
  143. <van-cell>
  144. <template #title>{{ index + 1 }}.{{ item.customerClueName }}</template>
  145. </van-cell>
  146. <delete-upload-imgv :imgs="item.fileInfoList"></delete-upload-imgv>
  147. </div>
  148. <div
  149. class="formLabel z-cell z-cells z-celly"
  150. v-if="item.answerType == 'wb' && viewTextShow">
  151. <van-cell>
  152. <template #title>{{ index + 1 }}.{{ item.customerClueName }}</template>
  153. </van-cell>
  154. <div class="selesetText">
  155. <p class="mg0" style="word-break: break-all">{{ item.answerValue }}</p>
  156. </div>
  157. <p
  158. style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
  159. {{ item.remark }}
  160. </p>
  161. <delete-upload-imgv :imgs="item.fileInfoList"></delete-upload-imgv>
  162. </div>
  163. <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType == 'duox'">
  164. <van-cell>
  165. <template #title>{{ index + 1 }}.{{ item.customerClueName }}</template>
  166. </van-cell>
  167. <div class="selesetText">
  168. <div
  169. class="mg0"
  170. v-for="(item1, index1) in item.customerClueOptionList"
  171. :key="index1">
  172. <p style="color: #0057ba" v-if="item1.checked">
  173. <i
  174. style="
  175. border: 1px solid #0057ba;
  176. margin-right: 10px;
  177. border-radius: 2px;
  178. padding: 2px;
  179. "
  180. class="van-icon van-icon-success"></i>
  181. <span>{{ item1.customerClueOption }}</span>
  182. </p>
  183. <p v-if="!item1.checked">
  184. <i
  185. style="
  186. border: 1px solid #ccc;
  187. margin-right: 10px;
  188. border-radius: 2px;
  189. color: #fff;
  190. padding: 2px;
  191. "
  192. class="van-icon van-icon-success"></i>
  193. <span>{{ item1.customerClueOption }}</span>
  194. </p>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType == 'dx'">
  199. <van-cell>
  200. <template #title> {{ index + 1 }}.{{ item.customerClueName }} </template>
  201. </van-cell>
  202. <div class="selesetText">
  203. <div
  204. class="mg0"
  205. v-for="(item2, index2) in item.customerClueOptionList"
  206. :key="index2">
  207. <p style="color: #0057ba" v-if="item2.checked">
  208. <i
  209. style="
  210. border: 1px solid #0057ba;
  211. border-radius: 40px;
  212. margin-right: 10px;
  213. padding: 2px;
  214. "
  215. class="van-icon van-icon-success"></i>
  216. <span>{{ item2.customerClueOption }}</span>
  217. </p>
  218. <p v-if="!item2.checked">
  219. <i
  220. style="
  221. border: 1px solid #ccc;
  222. border-radius: 40px;
  223. margin-right: 10px;
  224. color: #fff;
  225. padding: 2px;
  226. "
  227. class="van-icon van-icon-success"></i>
  228. <span>{{ item2.customerClueOption }}</span>
  229. </p>
  230. </div>
  231. </div>
  232. <delete-upload-imgv :imgs="item.fileInfoList"></delete-upload-imgv>
  233. </div>
  234. <div class="formLabel z-cell z-cells z-celly" v-if="item.answerType == 'bg'">
  235. <van-cell>
  236. <template #title> {{ index + 1 }}.{{ item.customerClueName }} </template>
  237. </van-cell>
  238. <div class="selesetText">
  239. <el-table
  240. :data="JSON.parse(item.answerValue).data"
  241. style="width: 100%; position: relative; left: -10px">
  242. <el-table-column
  243. v-for="(item, index) in JSON.parse(item.answerValue).title"
  244. :prop="item.prop"
  245. :label="item.label"
  246. align="center">
  247. <template slot-scope="scope">
  248. <template v-if="item.answerType == 'text'">
  249. {{ scope.row[item.prop] }}
  250. </template>
  251. <template v-if="item.answerType == 'wb'">
  252. <span>{{ scope.row[item.prop] }}</span>
  253. </template>
  254. <template v-if="item.answerType == 'sz'">
  255. <span>{{ scope.row[item.prop] }}</span>
  256. </template>
  257. </template>
  258. </el-table-column>
  259. </el-table>
  260. </div>
  261. </div>
  262. </div>
  263. </van-form>
  264. </div>
  265. </van-dialog>
  266. <van-calendar
  267. v-model="showCalendar"
  268. @confirm="onConfirm"
  269. color="#0057ba"
  270. :min-date="minDate"
  271. :max-date="maxDate"
  272. :show-confirm="false" />
  273. <van-popup v-model="RegionShow" capture position="bottom">
  274. <van-picker
  275. :columns="companyList"
  276. show-toolbar
  277. value-key="deptName"
  278. @cancel="RegionShow = false"
  279. @confirm="onregionConfirm" />
  280. </van-popup>
  281. <van-popup v-model="SalesRegionShow" capture position="bottom">
  282. <van-picker
  283. :columns="regionList"
  284. show-toolbar
  285. value-key="deptName"
  286. @cancel="SalesRegionShow = false"
  287. @confirm="onSalesRegionConfirm" />
  288. </van-popup>
  289. <van-popup v-model="SalesDepartmentShow" capture position="bottom">
  290. <van-picker
  291. :columns="deptList"
  292. show-toolbar
  293. value-key="deptName"
  294. @cancel="SalesDepartmentShow = false"
  295. @confirm="onSalesDepartmentConfirm" />
  296. </van-popup>
  297. <van-popup v-model="StaffShow" capture position="bottom">
  298. <van-picker
  299. :columns="userList"
  300. show-toolbar
  301. value-key="nickName"
  302. @cancel="StaffShow = false"
  303. @confirm="onStaffConfirm" />
  304. </van-popup>
  305. <van-popup v-model="StartTimeShow" capture position="bottom">
  306. <van-datetime-picker
  307. v-model="strtcurrentDate"
  308. :max-date="strtmaxDate"
  309. :min-date="strtminDate"
  310. title="选择查找开始时间"
  311. type="date"
  312. @cancel="StartTimeShow = false"
  313. @confirm="onStartTimeConfirm" />
  314. </van-popup>
  315. <van-popup v-model="EndTimeShow" capture position="bottom">
  316. <van-datetime-picker
  317. v-model="endcurrentDate"
  318. :max-date="endmaxDate"
  319. :min-date="endminDate"
  320. title="选择查找结束时间"
  321. type="date"
  322. @cancel="EndTimeShow = false"
  323. @confirm="onEndTimeConfirm" />
  324. </van-popup>
  325. </div>
  326. </template>
  327. <script>
  328. import timeico from '@/assets/Icon/datatims.png';
  329. import zRadio from '@/components/zRadiokz';
  330. import zCheckbox from '@/components/zCheckbox1';
  331. import uploadImg from '@/components/uploadKTask';
  332. import deleteUploadImg from '@/components/deleteUploadImg2';
  333. import deleteUploadImgv from '@/components/deleteUploadImg';
  334. import {
  335. getCustomerClueInfoById,
  336. insertCustomerClueAnswer,
  337. getDeptInfo,
  338. updateCustomerClueDept,
  339. getCustomerClueAnswerById,
  340. } from '@/api/clew';
  341. import { ImagePreview } from 'vant';
  342. import clewentDetails from './clewentDetails';
  343. import radioGroup from './complaintDetail/radioGroup';
  344. import { clewMixins } from '@/mixin/clew.js';
  345. import store from '@/store';
  346. import hasten from './hasten';
  347. export default {
  348. name: 'MyHistoricalWeekly',
  349. mixins: [clewMixins],
  350. components: {
  351. zRadio,
  352. zCheckbox,
  353. uploadImg,
  354. deleteUploadImg,
  355. deleteUploadImgv,
  356. clewentDetails,
  357. radioGroup,
  358. hasten,
  359. },
  360. data() {
  361. return {
  362. timeico: timeico,
  363. show: false,
  364. RegionShow: false,
  365. SalesRegionShow: false,
  366. SalesDepartmentShow: false,
  367. StaffShow: false,
  368. StartTimeShow: false,
  369. confirmBtn: false,
  370. dateIndex: '',
  371. EndTimeShow: false,
  372. uploadid2: 'uploadid2',
  373. strtminDate: new Date(2022, 0, 1),
  374. endminDate: new Date(2022, 0, 1),
  375. minDate: new Date(2020, 0, 1),
  376. maxDate: new Date(2090, 0, 31),
  377. strtmaxDate: new Date(),
  378. endmaxDate: new Date(),
  379. strtcurrentDate: new Date(),
  380. endcurrentDate: new Date(),
  381. companyName: '',
  382. deptName: '',
  383. regionName: '',
  384. showView: false,
  385. viewTextShow: false,
  386. companyCode: '',
  387. deptCode: '',
  388. regionCode: '',
  389. userCode: '',
  390. companyList: [],
  391. title: '',
  392. deptList: [],
  393. regionList: [],
  394. userList: [],
  395. deptForm: { type: '', parentId: '' },
  396. list: [],
  397. loading: false,
  398. finished: true,
  399. showCalendar: false,
  400. formData: {
  401. type: '2', // 汇报类型或入口 1-下属业务员日报 2-下属销售部主管周报 3-下属大区主管半月报
  402. companyId: '', // 公司id,必传 Long类型
  403. regionId: '', // 大区id,必传 Long类型
  404. deptId: '', // 部门id,如果为周报或日报为必传 Long类型
  405. userId: '', // 业务员id,如果为日报为必传 Long类型
  406. startTime: '', // 开始时间,必传 格式:yyyy-MM-dd String类型
  407. endTime: '', // 结束时间,必传 格式:yyyy-MM-dd String类型
  408. pageNum: 1, // 当前页码 int类型
  409. pageSize: 10, // 当前每页条数 int类型
  410. },
  411. tableList: [],
  412. collectionItemList: [],
  413. collectionAnswerlisd: [],
  414. flagclick: true,
  415. infoData: null,
  416. imgList: [],
  417. info: {},
  418. showv: false,
  419. isClose: '',
  420. customItemList: [],
  421. followUpResult: '',
  422. SBshow: false,
  423. requ: false,
  424. showvnum: false,
  425. tipSHow: false,
  426. namesss: '',
  427. tipText: '',
  428. totalMoneyFlag: '', //是否显示出货总金额
  429. taskGather: null, //跟进任务集合
  430. };
  431. },
  432. activated() {
  433. this.getCustomerClueInfoById();
  434. },
  435. created() {
  436. this.formData.startTime = this.getThreeDaysAgo();
  437. this.strtcurrentDate = new Date(this.getThreeDaysAgo());
  438. this.formData.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + '';
  439. this.endminDate = new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'), 2));
  440. this.powerGrade = localStorage.getItem('powerGrade');
  441. this.id = this.$route.query.id;
  442. this.getDeptInfo();
  443. // this.getCustomerClueInfoById();
  444. },
  445. watch: {
  446. $route(to, from) {
  447. if (to.path == '/clewent') {
  448. this.isClose = '';
  449. this.showv = false;
  450. this.SBshow = false;
  451. this.tipSHow = false;
  452. this.followUpResult = '';
  453. // this.getCustomerClueInfoById();
  454. }
  455. },
  456. },
  457. methods: {
  458. pviewFn(val, imgVal) {
  459. var imgList = [];
  460. var photos = this.reportTarget.photos[val].photos;
  461. for (let i = 0; i < photos.length; i++) {
  462. imgList.push(photos[i].fileUrl);
  463. }
  464. ImagePreview({ images: imgList, startPosition: imgVal });
  465. },
  466. viewFn(val) {
  467. this.viewTextShow = false;
  468. this.showView = true;
  469. this.getDetailById(val);
  470. },
  471. getDetailById(val) {
  472. let loading1 = this.$toast.loading({
  473. duration: 0,
  474. message: '加载中...',
  475. forbidClick: true,
  476. });
  477. getCustomerClueAnswerById({ userCustomerClueId: val }).then((res) => {
  478. loading1.clear();
  479. this.reportTargetAll = res.data.reportTargetAll;
  480. this.info = res.data;
  481. this.customItemList = res.data.customerClue.customerClueItemList;
  482. this.type = res.data.userType;
  483. // if(res.data.status==3){
  484. // this.successContent=res.data.successContent
  485. // }else{
  486. // this.successContent=res.data.failContent
  487. // }
  488. for (var pl = 0; pl < this.customItemList[1].customerClueOptionList.length; pl++) {
  489. if (
  490. this.customItemList[1].customerClueOptionList[pl].customerClueOption.indexOf(
  491. '跟进中'
  492. ) != -1
  493. ) {
  494. if (this.customItemList[1].customerClueOptionList[pl].value == 'Y') {
  495. this.viewTextShow = true;
  496. if (
  497. this.customItemList[1].customerClueOptionList[pl].customerClueOption.indexOf(
  498. '跟进'
  499. ) != -1
  500. ) {
  501. this.customItemList[2].customerClueName =
  502. '具体合作意向反馈(拜访时间、合同方向、预估合作时间)';
  503. }
  504. }
  505. } else {
  506. if (this.customItemList[1].customerClueOptionList[pl].value == 'Y') {
  507. this.viewTextShow = true;
  508. if (
  509. this.customItemList[1].customerClueOptionList[pl].customerClueOption.indexOf(
  510. '意向'
  511. ) != -1
  512. ) {
  513. this.customItemList[2].customerClueName = '没有意向原因';
  514. this.customItemList[2].remark = '请输入';
  515. }
  516. if (
  517. this.customItemList[1].customerClueOptionList[pl].customerClueOption.indexOf(
  518. '开户'
  519. ) != -1
  520. ) {
  521. this.customItemList[2].customerClueName = '开户经销商代码(例:0110067321)';
  522. this.customItemList[2].remark = '请输入';
  523. }
  524. if (
  525. this.customItemList[1].customerClueOptionList[pl].customerClueOption.indexOf(
  526. '开店'
  527. ) != -1
  528. ) {
  529. this.customItemList[2].customerClueName = '开户门店代码(例:0190129032)';
  530. this.customItemList[2].remark = '请输入';
  531. }
  532. if (
  533. this.customItemList[1].customerClueOptionList[pl].customerClueOption.indexOf(
  534. '出货'
  535. ) != -1
  536. ) {
  537. this.customItemList[2].customerClueName = '填写具体的产品和数量';
  538. }
  539. }
  540. }
  541. }
  542. this.reportContents = res.data.reportContents;
  543. var imgList = [];
  544. if (res.data.photos != null) {
  545. for (var k = 0; k < res.data.photos.length; k++) {
  546. imgList.push(res.data.photos[k].fileUrl + '');
  547. }
  548. }
  549. this.imgList = imgList;
  550. });
  551. },
  552. confirm(action, done) {
  553. if (action === 'confirm') {
  554. if (this.deptCode != '') {
  555. updateCustomerClueDept({
  556. customerClueInfoId: this.$route.query.id,
  557. deptId: this.deptCode,
  558. }).then((require) => {
  559. if (require.code == 200) {
  560. this.$toast.success('转发成功');
  561. this.show = false;
  562. if (this.$route.query.token != undefined) {
  563. window.location.replace(window.location.origin + '/mobile/clew');
  564. } else {
  565. store.dispatch('setRefreshClewPage', true);
  566. // 返回上一页不会刷新页面
  567. this.$router.go(-1);
  568. }
  569. return done(true);
  570. } else {
  571. this.$toast(res.msg);
  572. }
  573. });
  574. } else {
  575. this.$toast('请选择要转发销售部');
  576. return done(false);
  577. }
  578. } else {
  579. return done(true);
  580. this.show = false;
  581. }
  582. },
  583. onstopVisit() {
  584. this.deptCode = '';
  585. this.regionList = [];
  586. this.deptList = [];
  587. this.companyName = '请选择公司';
  588. this.companyCode = '';
  589. this.regionName = '请选择大区';
  590. this.regionCode = '';
  591. this.deptName = '请选择销售部';
  592. this.deptCode = '';
  593. this.show = true;
  594. },
  595. getCustomerClueInfoById() {
  596. this.id = this.$route.query.id;
  597. this.collectionAnswerlisd = [];
  598. this.collectionItemList = [];
  599. getCustomerClueInfoById({ customerClueInfoId: this.id }).then((response) => {
  600. if (response.code == 200) {
  601. this.infoData = response.data;
  602. this.title = response.data.name;
  603. if (response.data.customerClue != null) {
  604. this.collectionItemList = response.data.customerClue.customerClueItemList;
  605. this.taskGather = response.data.customerClue.customerClueItemList;
  606. } else {
  607. this.collectionItemList = [];
  608. }
  609. } else {
  610. this.$toast(res.msg);
  611. }
  612. });
  613. },
  614. showCalendarClick(val) {
  615. this.dateIndex = val;
  616. this.showCalendar = true;
  617. },
  618. formatDate(date) {
  619. var Month = date.getMonth() + 1;
  620. var Day = date.getDate();
  621. if (Month < 10) {
  622. Month = '0' + Month;
  623. }
  624. if (Day < 10) {
  625. Day = '0' + Day;
  626. }
  627. return `${date.getFullYear()}-${Month}-${Day}`;
  628. },
  629. onConfirm(date) {
  630. this.showCalendar = false;
  631. this.collectionItemList[this.dateIndex].answerValue = this.formatDate(date);
  632. },
  633. formatter(value) {
  634. return value.replace(
  635. /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
  636. ''
  637. );
  638. },
  639. numberFn(val, index) {
  640. if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerValue)) {
  641. this.collectionItemList[index].answerValue = this.collectionItemList[
  642. index
  643. ].answerValue.replace(
  644. /\.\d{2,}$/,
  645. this.collectionItemList[index].answerValue.substr(
  646. this.collectionItemList[index].answerValue.indexOf('.'),
  647. 3
  648. )
  649. );
  650. }
  651. },
  652. zSelectVal(value) {
  653. this.tipText = '';
  654. if (value.Tindex == 1) {
  655. this.totalMoneyFlag = false;
  656. if (value.customerClueOption == '已出货') {
  657. // 判断是否显示出货总金额
  658. let isFlag = this.collectionItemList.find(
  659. (item) => item.customerClueName == '出货总金额' && item.answerType == 'sz'
  660. );
  661. if (isFlag) {
  662. this.totalMoneyFlag = true;
  663. }
  664. }
  665. this.tipSHow = false;
  666. this.collectionItemList[2].answerValue = '';
  667. for (var iv = 0; iv < value.value.length; iv++) {
  668. if (value.value[iv].customerClueOption.indexOf('跟进中') != -1) {
  669. if (value.value[iv].value == 'Y') {
  670. this.showv = true;
  671. this.requ = false;
  672. this.showvnum = false;
  673. if (value.value[iv].customerClueOption.indexOf('跟进中') != -1) {
  674. this.collectionItemList[2].customerClueName =
  675. '具体合作意向反馈(拜访时间、合同方向、预估合作时间)';
  676. this.collectionItemList[2].remark = '请输入';
  677. }
  678. } else {
  679. this.requ = true;
  680. this.showv = true;
  681. }
  682. } else {
  683. if (value.value[iv].value == 'Y') {
  684. if (value.value[iv].customerClueOption.indexOf('意向') != -1) {
  685. this.collectionItemList[2].customerClueName = '没有意向原因';
  686. this.collectionItemList[2].remark = '请输入意想原因';
  687. this.showvnum = false;
  688. }
  689. if (value.value[iv].customerClueOption.indexOf('开户') != -1) {
  690. this.collectionItemList[2].customerClueName = '开户经销商代码(例:0110067321)';
  691. this.collectionItemList[2].remark = '例:0110067321';
  692. this.tipText =
  693. '若该客户正在开户流程中,请勾选为“跟进中”,待流程走完,再将客资状态更新为“已开户”,并填写开户经销商代码。';
  694. this.showvnum = true;
  695. this.tipSHow = true;
  696. this.showv = false;
  697. }
  698. if (value.value[iv].customerClueOption.indexOf('开店') != -1) {
  699. this.collectionItemList[2].customerClueName = '开户门店代码(例:0190129032)';
  700. this.tipText =
  701. '若该客户正在开店流程中,请勾选为“跟进中”,待流程走完,再将客资状态更新为“已开店”,并填写开店编码。';
  702. this.collectionItemList[2].remark = '例:0190129032';
  703. this.showvnum = true;
  704. this.tipSHow = true;
  705. this.showv = false;
  706. }
  707. if (value.value[iv].customerClueOption.indexOf('出货') != -1) {
  708. this.showvnum = false;
  709. this.collectionItemList[2].customerClueName = '填写具体的产品和数量';
  710. this.collectionItemList[2].remark = '例:100桶时时丽,50包超好贴';
  711. }
  712. }
  713. }
  714. }
  715. } else {
  716. if (value.value[1].value == 'Y') {
  717. this.SBshow = false;
  718. } else {
  719. this.SBshow = true;
  720. }
  721. }
  722. var collectionAnswerlisd = this.collectionAnswerlisd;
  723. if (collectionAnswerlisd.length > 0) {
  724. var num = 0;
  725. for (var a = 0; a < collectionAnswerlisd.length; a++) {
  726. if (collectionAnswerlisd[a].id == value.id) {
  727. collectionAnswerlisd[a] = value;
  728. num = 0;
  729. } else {
  730. num = 1;
  731. }
  732. }
  733. if (num > 0) {
  734. collectionAnswerlisd.push(value);
  735. }
  736. } else {
  737. collectionAnswerlisd.push(value);
  738. }
  739. this.collectionAnswerlisd = collectionAnswerlisd;
  740. },
  741. imgClick(val, index) {
  742. this.collectionId = val.collectionId + '';
  743. this.indeximg = index;
  744. this.show = true;
  745. },
  746. newimgarr1(val) {
  747. if (
  748. this.collectionItemList[val.index].fileInfoList == null ||
  749. this.collectionItemList[val.index].fileInfoList == undefined
  750. ) {
  751. this.collectionItemList[val.index].fileInfoList = [];
  752. this.collectionItemList[val.index].fileIdList = [];
  753. }
  754. this.collectionItemList[val.index].fileInfoList.push(val);
  755. this.collectionItemList[val.index].fileIdList.push(val.id);
  756. },
  757. dateFn(val) {
  758. return val.slice(0, 4) + '-' + val.slice(4, 6) + '-' + val.slice(6, 8);
  759. },
  760. onLoad() {},
  761. onSubmit() {
  762. // Mixins
  763. this.purchaseSubmit((data) => {
  764. var form = {
  765. isClose: this.infoData.isClose,
  766. followUpResult: this.infoData.followUpResult,
  767. customerClueItemList: data.customerClueItemList,
  768. };
  769. this.toastLoading(0, '加载中...', true);
  770. insertCustomerClueAnswer(form).then((res) => {
  771. this.toastLoading().clear();
  772. if (res.code == 200) {
  773. if (this.$route.query.token != undefined) {
  774. window.location.replace(window.location.origin + '/mobile/clew');
  775. } else {
  776. store.dispatch('setRefreshClewPage', true);
  777. // 返回上一页不会刷新页面
  778. this.$router.go(-1);
  779. }
  780. } else {
  781. this.$toast(res.msg);
  782. }
  783. });
  784. });
  785. },
  786. getThreeDaysAgo() {
  787. let myDate = new Date();
  788. let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 14); //最后一个数字30可改,30天的意思
  789. let lastY = lw.getFullYear();
  790. let lastM = lw.getMonth() + 1;
  791. let lastD = lw.getDate();
  792. let startData =
  793. lastY + '-' + (lastM < 10 ? '0' + lastM : lastM) + '-' + (lastD < 10 ? '0' + lastD : lastD); //三十天之前日期
  794. return startData;
  795. },
  796. GetPreMonthDay(date, monthNum, type) {
  797. var dateArr = date.split('-');
  798. var year = dateArr[0]; //获取当前日期的年份
  799. var month = dateArr[1]; //获取当前日期的月份
  800. var day = dateArr[2]; //获取当前日期的日
  801. var days = new Date(year, month, 0);
  802. days = days.getDate(); //获取当前日期中月的天数
  803. var year2 = year;
  804. var month2 = parseInt(month) - monthNum;
  805. if (month2 <= 0) {
  806. var absM = Math.abs(month2);
  807. year2 = parseInt(year2) - Math.ceil(absM / 12 == 0 ? 1 : parseInt(absM) / 12);
  808. month2 = 12 - (absM % 12);
  809. }
  810. var day2 = day;
  811. var days2 = new Date(year2, month2, 0);
  812. days2 = days2.getDate();
  813. if (day2 > days2) {
  814. day2 = days2;
  815. }
  816. if (month2 < 10) {
  817. month2 = '0' + month2;
  818. }
  819. var t2 = '';
  820. if (monthNum > 0) {
  821. t2 = year2 + '-' + month2 + '-01';
  822. } else {
  823. if (type == 'end') {
  824. var Months = new Date().getMonth() + 1;
  825. var days111 = new Date().getDate();
  826. if (Months < 10) {
  827. Months = '0' + Months;
  828. }
  829. if (days111 < 10) {
  830. days111 = '0' + days111;
  831. }
  832. if (parseInt(month2) >= new Date().getMonth() + 1) {
  833. t2 = year2 + '-' + Months + '-' + days111;
  834. } else {
  835. var daysd = this.getMonthDays(year2, month2);
  836. t2 = year2 + '-' + month2 + '-' + daysd;
  837. }
  838. } else {
  839. t2 = year2 + '-' + month2 + '-' + day2;
  840. }
  841. }
  842. return t2;
  843. },
  844. getMonthDays(year, month) {
  845. var stratDate = new Date(year, month - 1, 1),
  846. endData = new Date(year, month, 1);
  847. var days = (endData - stratDate) / (1000 * 60 * 60 * 24);
  848. return days;
  849. },
  850. getDeptInfo(type, grade) {
  851. this.deptForm.type = type;
  852. if (grade == '1') {
  853. this.deptForm.parentId = this.companyCode;
  854. } else if (grade == '2') {
  855. this.deptForm.parentId = this.regionCode;
  856. } else {
  857. this.deptForm.type = '';
  858. this.deptForm.parentId = '';
  859. }
  860. getDeptInfo(this.deptForm).then((res) => {
  861. res.data.forEach((item) => {
  862. delete item.children;
  863. });
  864. if (grade == '1') {
  865. this.regionList = res.data;
  866. } else if (grade == '2') {
  867. this.deptList = res.data;
  868. } else {
  869. this.companyList = res.data;
  870. }
  871. });
  872. },
  873. onClickLeft() {
  874. this.$router.go(-1);
  875. },
  876. regionClick() {
  877. this.RegionShow = true;
  878. },
  879. SalesRegionClick(val) {
  880. this.SalesRegionShow = true;
  881. },
  882. SalesDepartmentClick() {
  883. this.SalesDepartmentShow = true;
  884. },
  885. StaffClick() {
  886. this.StaffShow = true;
  887. },
  888. StartTimeClick() {
  889. this.StartTimeShow = true;
  890. },
  891. EndTimeClick() {
  892. this.EndTimeShow = true;
  893. },
  894. onregionConfirm(val) {
  895. this.RegionShow = false;
  896. this.companyName = val.deptName;
  897. this.companyCode = val.deptId;
  898. this.regionName = '请选择大区';
  899. this.regionCode = '';
  900. this.deptName = '请选择销售部';
  901. this.deptCode = '';
  902. this.getDeptInfo('dept', 1);
  903. },
  904. onSalesRegionConfirm(val) {
  905. this.SalesRegionShow = false;
  906. this.regionName = val.deptName;
  907. this.regionCode = val.deptId;
  908. if (val.deptId != '') {
  909. this.getDeptInfo('dept', 2);
  910. }
  911. this.deptName = '全部销售部';
  912. this.deptCode = '';
  913. },
  914. onSalesDepartmentConfirm(val) {
  915. this.SalesDepartmentShow = false;
  916. this.deptName = val.deptName;
  917. if (val.deptId != '') {
  918. this.deptCode = val.deptId;
  919. this.getDeptInfo('user');
  920. }
  921. this.userName = '全部业务员';
  922. this.userCode = '';
  923. },
  924. onStaffConfirm(val) {
  925. this.StaffShow = false;
  926. this.userName = val.nickName;
  927. this.userCode = val.userId;
  928. },
  929. onStartTimeConfirm(val) {
  930. this.formData.startTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
  931. this.StartTimeShow = false;
  932. this.endminDate = new Date(val);
  933. this.endmaxDate = new Date(this.GetPreMonthDay(this.formData.startTime, -2, 'end'));
  934. if (
  935. new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime() ||
  936. new Date(this.endmaxDate).getTime() < new Date(this.formData.endTime).getTime()
  937. ) {
  938. this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + '';
  939. this.endcurrentDate = this.GetPreMonthDay(this.formData.startTime, -2);
  940. }
  941. this.list = [];
  942. this.formData.pageNum = 1;
  943. },
  944. onEndTimeConfirm(val) {
  945. this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}');
  946. this.strtmaxDate = new Date(val);
  947. if (new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime()) {
  948. this.formData.startTime = this.formData.endTime;
  949. }
  950. this.list = [];
  951. this.formData.pageNum = 1;
  952. this.EndTimeShow = false;
  953. },
  954. },
  955. };
  956. </script>
  957. <style scoped lang="scss">
  958. .clewent {
  959. .container {
  960. background-color: white;
  961. }
  962. .formLabel {
  963. margin: 0 16px;
  964. border-bottom: 1px solid #f1f1f1;
  965. }
  966. .formLabel .van-cell {
  967. padding: 10px 0;
  968. font-size: 14px;
  969. }
  970. .formLabel .van-cell::after {
  971. border: 0;
  972. }
  973. .formLabeltext .van-field {
  974. border: 1px solid #f1f1f1;
  975. padding: 6px;
  976. width: 100%;
  977. border-radius: 4px;
  978. overflow: hidden;
  979. }
  980. .formLabel .van-field__control {
  981. padding: 0 10px;
  982. }
  983. .z-checkbox .van-radio {
  984. padding: 6px 0;
  985. }
  986. .z-cell .van-cell__title {
  987. font-size: 14px;
  988. }
  989. .taskGather {
  990. padding-left: 20px;
  991. padding-bottom: 20px;
  992. .title {
  993. font-size: 15px;
  994. font-weight: 600;
  995. padding: 5px 0;
  996. }
  997. }
  998. }
  999. </style>
  1000. <style lang="scss">
  1001. .cardclewContentCell {
  1002. margin: 0 10px;
  1003. }
  1004. .formLabel .van-radio__label,
  1005. .formLabel .van-checkbox__label {
  1006. font-size: 14px;
  1007. }
  1008. .van-dialog__confirm,
  1009. .van-dialog__confirm:active {
  1010. color: #1989fa;
  1011. }
  1012. .cardclewContent {
  1013. background: #fff;
  1014. box-sizing: border-box;
  1015. padding: 10px 16px;
  1016. margin: 6px 10px 10px;
  1017. }
  1018. .cardclewContent .info {
  1019. font-size: 14px;
  1020. color: #444;
  1021. line-height: 28px;
  1022. }
  1023. .cardclewContent .title p {
  1024. padding: 0;
  1025. margin: 0;
  1026. }
  1027. .cardclewContent .title .textLeft {
  1028. display: inline-block;
  1029. padding-bottom: 10px;
  1030. }
  1031. .dialogz {
  1032. width: 100%;
  1033. }
  1034. .dialogz .van-dialog__content {
  1035. height: 72vh;
  1036. overflow-y: auto;
  1037. }
  1038. .radioboxss .van-radio {
  1039. margin-bottom: 6px;
  1040. }
  1041. .fieldNumber {
  1042. border: 1px solid #f1f1f1;
  1043. padding-left: 5px !important;
  1044. }
  1045. .containertext {
  1046. .el-table {
  1047. .el-table__cell {
  1048. padding: 3px 0;
  1049. }
  1050. }
  1051. }
  1052. </style>