clewent.vue 35 KB

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