clewent.vue 41 KB

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