clewent.vue 35 KB

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