add-record.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357
  1. <template>
  2. <view class="container qualifications" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0' }">
  3. <view class="remarks-content">
  4. <view class="list-view-title">
  5. <view class="list-view-h1">咨询人:</view>
  6. </view>
  7. <view class="remarks-input">{{ questionMan }}</view>
  8. <view class="list-view-title">
  9. <view class="list-view-h1"><text>*</text>沟通情况:</view>
  10. </view>
  11. <view class="remarks-category">
  12. <radio-group @change="radioChange">
  13. <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items" :key="item.value">
  14. <radio
  15. :value="item.value"
  16. style="transform:scale(0.7)"
  17. color="#FF5B00"
  18. :checked="index === current"
  19. />
  20. <label :for="item.value" class="label">
  21. <text>{{ item.name }}</text>
  22. </label>
  23. </label>
  24. </radio-group>
  25. <checkbox-group v-if="current === 0" @change="checkboxChange" style="margin-top: 10rpx;">
  26. <label class="label" v-for="item in checkboItems" :key="item.value">
  27. <checkbox :value="item.value" :checked="item.checked" style="transform:scale(0.7)" color="#FF5B00" />
  28. {{item.name}}
  29. </label>
  30. </checkbox-group>
  31. </view>
  32. <view class="list-view-title">
  33. <view class="list-view-h1"><text>*</text>手机号或微信号:</view>
  34. </view>
  35. <view class="list-view-radio">
  36. <input
  37. class="input"
  38. type="text"
  39. v-model="remarksParams.mobileOrWeChat"
  40. value=""
  41. placeholder="请输入咨询人的手机号或微信号"
  42. />
  43. <text class="iconfont icon-xiangyou"></text>
  44. </view>
  45. <view class="list-view-title"> <view class="list-view-h1">客户来源:</view> </view>
  46. <view class="list-view-radio">
  47. <picker @change="bindPickerChange(4, $event)" :value="index" :range="sourceActions" range-key="name">
  48. <input
  49. class="input"
  50. type="text"
  51. disabled="false"
  52. v-model="sourceStateText"
  53. value=""
  54. placeholder="请选择"
  55. />
  56. <text class="iconfont icon-xiangyou"></text>
  57. </picker>
  58. </view>
  59. <view class="list-view-title"> <view class="list-view-h1">客户性别:</view> </view>
  60. <view class="list-view-radio">
  61. <picker @change="bindPickerChange(5, $event)" :value="index" :range="genderActions" range-key="name">
  62. <input
  63. class="input"
  64. type="text"
  65. disabled="false"
  66. v-model="genderText"
  67. value=""
  68. placeholder="请选择"
  69. />
  70. <text class="iconfont icon-xiangyou"></text>
  71. </picker>
  72. </view>
  73. <view class="list-view-title">
  74. <view class="list-view-h1">s客户年龄:</view>
  75. </view>
  76. <view class="list-view-radio">
  77. <picker @change="bindPickerChange(6, $event)" :value="index" :range="ageActions" range-key="name">
  78. <input class="input" type="text" disabled="false" v-model="customerAge" value="" placeholder="请选择" />
  79. <text class="iconfont icon-xiangyou"></text>
  80. </picker>
  81. </view>
  82. <view class="list-view-title"> <view class="list-view-h1">加群情况:</view> </view>
  83. <view class="list-view-radio">
  84. <picker @change="bindPickerChange(7, $event)" :value="index" :range="additiveActions" range-key="name">
  85. <input
  86. class="input"
  87. type="text"
  88. disabled="false"
  89. v-model="additiveText"
  90. value=""
  91. placeholder="请选择"
  92. />
  93. <text class="iconfont icon-xiangyou"></text>
  94. </picker>
  95. </view>
  96. <view class="list-view-title" v-if="current === 0">
  97. <view class="list-view-h1"><text>*</text>咨询类别:</view>
  98. </view>
  99. <view class="remarks-category" v-if="current === 0">
  100. <view
  101. class="checkbox-list"
  102. :class="category.isChecked ? 'checked' : ''"
  103. v-for="(category, index) in categorys"
  104. :key="index"
  105. @click="choiceCategorys(category, index)"
  106. >
  107. <text class="iconfont" :class="category.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"></text>
  108. {{ category.className }}
  109. </view>
  110. </view>
  111. <!--<view class="list-view-title">
  112. <view class="list-view-h1">机构类型:</view>
  113. </view>
  114. <view class="remarks-input">
  115. <input
  116. class="input"
  117. type="text"
  118. v-model="remarksParams.clubType"
  119. value=""
  120. placeholder="如美甲店,医院"
  121. maxlength="15"
  122. />
  123. </view> -->
  124. <view class="list-view-title"> <view class="list-view-h1">咨询商品:</view> </view>
  125. <view class="tui-remarks-content">
  126. <view class="tui-remarks-goods-input" v-if="handleGoods.length === 0" @click="handleShowGoodPopup">
  127. <view class="input-add"> <text class="iconfont icon-jiahao"></text> </view>
  128. <view class="input-text"> 点击添加客户咨询的商品 </view>
  129. </view>
  130. <view class="tui-remarks-showgoods" v-else>
  131. <view class="tui-remarks-goods" v-for="(pros, index) in handleGoods" :key="index">
  132. <view class="goods-image"> <image :src="pros.image" mode=""></image> </view>
  133. <view class="goods-main">
  134. <view class="name"> {{ pros.name }} </view>
  135. <view class="shop"> 供应商:{{ pros.shopName }} </view>
  136. </view>
  137. </view>
  138. <view class="tui-remarks-btn">
  139. <view class="btn delete" @click="handleClean">删除</view>
  140. <view class="btn update" @click="handleShowGoodPopup">更换</view>
  141. </view>
  142. </view>
  143. </view>
  144. <view class="list-view-title">
  145. <view class="list-view-h1">标签记录:</view>
  146. <view class="list-view-p">
  147. 请总结客户的个人画像和咨询内容,尽量使用简短的描述性词语,杜绝口语化的词语 (优先选择以下展示的标签)
  148. </view>
  149. </view>
  150. <view class="list-view-list-main">
  151. <view class="list-label-list">
  152. <text class="list-label"
  153. :class="item.isChecked ? 'active' : ''"
  154. v-for="(item, index) in labelsList"
  155. :key="index"
  156. @click="handleCheckedLabel(item,index)"
  157. >
  158. {{ item.label }}
  159. </text>
  160. </view>
  161. </view>
  162. <view class="list-view-title">
  163. <view class="list-view-h1">机构静态标签:</view>
  164. <view class="list-view-p"> (若你对客户的静态特点有更多维度进行描述,请手动填) </view>
  165. </view>
  166. <view class="list-view-list-main">
  167. <view class="list-view-list" v-for="(item, index) in staticLabelsList" :key="index">
  168. <view class="list-view-input">
  169. <input
  170. class="input"
  171. type="text"
  172. v-model="item.label"
  173. placeholder="请输入标签,不超过10个汉字"
  174. maxlength="10"
  175. @focus="hideStaticLabelsAction(item, $event)"
  176. @blur="hideStaticLabelsAction(item, $event)"
  177. @input="handleStaticLabelsAction(index, $event)"
  178. />
  179. <view class="list-view-assAction" v-if="item.isAssociation">
  180. <scroll-view class="tui-popup-scroll train" scroll-y="true">
  181. <view
  182. class="ass-list"
  183. v-for="(ass, assIndex) in staticLabelsActionList"
  184. :key="assIndex"
  185. @click="handleSelectStaticLabels(ass.label, item)"
  186. >{{ ass.label }}</view
  187. >
  188. </scroll-view>
  189. </view>
  190. </view>
  191. <view class="list-view-btn">
  192. <text
  193. class="iconfont icon-zengjia"
  194. v-if="staticLabelsList.length < 9 && index === staticLabelsList.length - 1"
  195. @click="handleAddStaticLabels(item, index)"
  196. ></text>
  197. <text
  198. class="iconfont icon-shanchu4"
  199. v-if="staticLabelsList.length > 1 && index != staticLabelsList.length - 1"
  200. @click="handleDelStaticLabels(item, index)"
  201. ></text>
  202. </view>
  203. </view>
  204. </view>
  205. <view class="list-view-title">
  206. <view class="list-view-h1">机构动态标签:</view>
  207. <view class="list-view-p"> (若你对客户的购买诉求有更多维度进行描述,请手动填) </view>
  208. </view>
  209. <view class="list-view-list-main">
  210. <view class="list-view-list" v-for="(item, index) in trendsLabelsList" :key="index">
  211. <view class="list-view-input">
  212. <input
  213. class="input"
  214. type="text"
  215. v-model="item.label"
  216. placeholder="请输入标签,不超过10个汉字"
  217. maxlength="10"
  218. @focus="hideTrendsLabelsAction(item, $event)"
  219. @blur="hideTrendsLabelsAction(item, $event)"
  220. @input="handleTrendsLabelsAction(index, $event)"
  221. />
  222. <view class="list-view-assAction" v-if="item.isAssociation">
  223. <scroll-view class="tui-popup-scroll train" scroll-y="true">
  224. <view
  225. class="ass-list"
  226. v-for="(ass, assIndex) in trendsLabelsActionList"
  227. :key="assIndex"
  228. @click="handleSelectTrendsLabels(ass.label, item)"
  229. >{{ ass.label }}</view
  230. >
  231. </scroll-view>
  232. </view>
  233. </view>
  234. <view class="list-view-btn">
  235. <text
  236. class="iconfont icon-zengjia"
  237. v-if="trendsLabelsList.length < 9 && index === trendsLabelsList.length - 1"
  238. @click="handleAddTrendsLabels(item, index)"
  239. ></text>
  240. <text
  241. class="iconfont icon-shanchu4"
  242. v-if="trendsLabelsList.length > 1 && index != trendsLabelsList.length - 1"
  243. @click="handleDelTrendsLabels(item, index)"
  244. ></text>
  245. </view>
  246. </view>
  247. </view>
  248. <view class="list-view-title">
  249. <view class="list-view-h1">关联报备:</view>
  250. <view class="list-view-p"
  251. >(若客户咨询的事项不确定采美能不能做,请创建并关联报备向上级反馈)</view
  252. >
  253. </view>
  254. <view class="list-view-radio" @click="handleShowReportPopup">
  255. <input
  256. class="input"
  257. type="text"
  258. disabled="false"
  259. v-model="reportText"
  260. value=""
  261. placeholder="请选择报备"
  262. />
  263. <text class="iconfont icon-xiangyou"></text>
  264. </view>
  265. <view class="list-view-title" v-if="current === 0">
  266. <view class="list-view-h1"><text>*</text>价格敏感度:</view>
  267. </view>
  268. <view class="list-view-radio" v-if="current === 0">
  269. <picker @change="bindPickerChange(1, $event)" :value="index" :range="priceActions" range-key="name">
  270. <input
  271. class="input"
  272. type="text"
  273. disabled="false"
  274. v-model="priceFlagText"
  275. value=""
  276. placeholder="请选择"
  277. />
  278. <text class="iconfont icon-xiangyou"></text>
  279. </picker>
  280. </view>
  281. <view class="list-view-title" v-if="current === 0">
  282. <view class="list-view-h1"><text>*</text>意向程度:</view>
  283. </view>
  284. <view class="list-view-radio" v-if="current === 0">
  285. <picker @change="bindPickerChange(2, $event)" :value="index" :range="intenActions" range-key="name">
  286. <input
  287. class="input"
  288. type="text"
  289. disabled="false"
  290. v-model="intenFlagText"
  291. value=""
  292. placeholder="请选择"
  293. />
  294. <text class="iconfont icon-xiangyou"></text>
  295. </picker>
  296. </view>
  297. <view class="list-view-title" v-if="current === 0">
  298. <view class="list-view-h1"><text>*</text>跟进状态:</view>
  299. </view>
  300. <view class="list-view-radio" v-if="current === 0">
  301. <picker @change="bindPickerChange(3, $event)" :value="index" :range="stateActions" range-key="name">
  302. <input
  303. class="input"
  304. type="text"
  305. disabled="false"
  306. v-model="followStateText"
  307. value=""
  308. placeholder="请选择"
  309. />
  310. <text class="iconfont icon-xiangyou"></text>
  311. </picker>
  312. </view>
  313. <view class="list-view-title"> <view class="list-view-h1">额外说明:</view> </view>
  314. <view class="remarks-textarea">
  315. <textarea
  316. class="textarea"
  317. v-model="remarksParams.extra"
  318. value=""
  319. placeholder="请输入其他需要说明的内容"
  320. maxlength="200"
  321. @input="conInput"
  322. />
  323. <text class="limit-text">{{ min }}/{{ max }}</text>
  324. </view>
  325. <view class="list-view-title">
  326. <view class="list-view-h1">上传图片</view>
  327. <view class="list-view-p">(可上传与客户的聊天截图或其他重要图片资料,最多10张)</view>
  328. </view>
  329. <view class="list-view-upload clearfix">
  330. <view class="photo-item" v-for="(image, imageIndex) in remarksParams.imageList" :key="imageIndex">
  331. <image
  332. :src="image"
  333. mode="aspectFill"
  334. @click.stop="previewImg(remarksParams.imageList, imageIndex)"
  335. ></image>
  336. <text
  337. class="iconfont icon-iconfontguanbi"
  338. @click.stop="deletePhotoFn(remarksParams.imageList, imageIndex)"
  339. ></text>
  340. </view>
  341. <view
  342. class="photo-item add"
  343. @click.stop="uploadPhotoFn(remarksParams.imageList)"
  344. v-if="remarksParams.imageList.length < 10 || remarksParams.imageList.length == 0"
  345. >
  346. <text class="iconfont icon-jiahao"></text>
  347. </view>
  348. </view>
  349. <view class="list-view-title">
  350. <view class="list-view-h1">上传文件</view>
  351. <view class="list-view-p">(可上传与客户相关的文件资料,最多10份,支持word,excel,ppt和pdf格式文件)</view>
  352. </view>
  353. <view class="list-view" v-for="(file, fileIndex) in remarksParams.fileList" :key="fileIndex">
  354. <view class="list-view-text">
  355. <view class="input">{{ file.fileName }}</view>
  356. <view class="delbtn" @click.stop="deleteFileFn(remarksParams.fileList, fileIndex)">删除</view>
  357. </view>
  358. </view>
  359. <view class="list-view">
  360. <view class="list-view-file" @click="uploadFile(remarksParams.fileList)">选择文件</view>
  361. </view>
  362. </view>
  363. <view class="remarks-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  364. <view class="edit-button" @click="editButtonConfim">确定</view>
  365. </view>
  366. <!-- 商品列表弹窗 -->
  367. <cm-goodspopup
  368. ref="cmgoodspopup"
  369. v-if="isGoodspopup"
  370. :show="isGoodspopup"
  371. @handleChoiceaGoods="handleChoiceaGoodsData"
  372. />
  373. <!-- 商品列表弹窗 -->
  374. <cm-reportpopup
  375. ref="cmreportpopup"
  376. v-if="isReportpopup"
  377. :show="isReportpopup"
  378. :popupType ="2"
  379. :reportInfo="reportInfo"
  380. @handleChoiceaReport="handleChoiceaReportData"
  381. />
  382. <!-- 提示弹窗 -->
  383. <tui-modal
  384. :show="modal"
  385. @click="handleClick"
  386. :content="contentModalText"
  387. :button="modalButton"
  388. color="#333"
  389. :size="32"
  390. shape="circle"
  391. :maskClosable="false"
  392. />
  393. </view>
  394. </template>
  395. <script>
  396. import { mapState, mapMutations } from 'vuex'
  397. import authorize from '@/common/config/authorize.js'
  398. import { uploadFileImage, uploadFilePdfDocDocxXlsx } from '@/services/public.js'
  399. import cmGoodspopup from '../components/cm-goods-popup'
  400. import cmReportpopup from '../components/cm-report-popup'
  401. import addMixins from './mixins/addMixins.js'
  402. var isPreviewImg
  403. export default {
  404. mixins: [addMixins],
  405. components: {
  406. cmGoodspopup,
  407. cmReportpopup
  408. },
  409. data() {
  410. return {
  411. isIphoneX: this.$store.state.isIphoneX,
  412. shopOrderId: 0,
  413. logisticsBatchId: 0,
  414. productActions: [],
  415. remarksParams: {
  416. clubType:'', //机构类型
  417. extra: '',//额外说明
  418. fileList: [],
  419. imageList: [],
  420. remarksId:0,
  421. questionManId: 0,
  422. serviceProviderId: 0,
  423. consult:'',
  424. pinceSensitve:0,//价格敏感度
  425. satisfied:0,// 意向程度
  426. followup:0,// 跟进状态
  427. communicationSituation:'', // 沟通情况 0 已沟通 1联系不上
  428. communicationMethods:'', //沟通方式 1:电话 2:微信
  429. customerSource:'',//客户来源 0 网址 1 小程序 2 公众号 3 小红书 4 微博 5 搜狐 6 其他
  430. customerGender:'',// 客户性别 0 男 1 女
  431. customerAge:'',// 客户年龄
  432. groupAddition:'' ,// 加群情况 0 以加群 1 未加群
  433. remarks: null, // 关键词
  434. trendsKeyword:null,// 动态标签
  435. stateKeyword:null ,// 静态标签
  436. mobileOrWeChat:'' //手机号 或者微信
  437. },
  438. min: 0,
  439. max: 200,
  440. handleType:'',
  441. questionMan:'',
  442. clubUserId:0,
  443. userInfo:{},
  444. checkedCategorysList:[],
  445. categorys:[],
  446. reportText:'',
  447. checkRemarkIndex:0,
  448. assActionList: [],
  449. isGoodspopup:false,
  450. isReportpopup:false,
  451. isHashReport: false,
  452. handleGoods: [],
  453. reportInfo:{
  454. questionMan:'',
  455. questionManId:0
  456. },
  457. modal: false,
  458. contentModalText: '', //操作文字提示语句
  459. modalButton: [
  460. {
  461. text: '知道了',
  462. customStyle: {
  463. color: '#fff',
  464. bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)'
  465. },
  466. plain: false
  467. }
  468. ],
  469. }
  470. },
  471. onLoad(option) {
  472. console.log(option)
  473. if (option.type == 'edit') {
  474. this.handleType = option.type
  475. this.getPriorKeyword()
  476. this.getUserClubConsults()
  477. this.getUserRemarksVisitDetail(option.remarksId)
  478. uni.setNavigationBarTitle({title:'修改记录'})
  479. } else {
  480. this.questionMan = option.questionMan
  481. this.remarksParams.remarksId = option.remarksId*1
  482. this.remarksParams.questionManId = option.questionManId
  483. this.reportInfo.questionMan = option.questionMan
  484. this.reportInfo.questionManId = option.questionManId
  485. this.initGetStotage(option)
  486. this.getPriorKeyword()
  487. this.getUserClubConsults()
  488. }
  489. },
  490. methods: {
  491. ...mapMutations(['login']),
  492. async initGetStotage(option) {
  493. const userInfo = await this.$api.getStorage()
  494. this.remarksParams.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  495. },
  496. async getUserRemarksVisitDetail(remarksId) {
  497. //修改回显资料备注信息
  498. try{
  499. const res = await this.UserService.getUserRemarksVisitDetail({ remarksId : remarksId })
  500. const data = res.data
  501. this.reportInfo.questionMan = data.questionMan
  502. this.reportInfo.questionManId = data.questionManId
  503. this.questionMan = data.questionMan
  504. this.remarksParams.questionManId = data.questionManId
  505. this.remarksParams.communicationSituation = this.current = data.communicationSituation
  506. this.remarksParams.communicationMethods = data.communicationMethods
  507. if(data.communicationMethods === '1,2' || data.communicationMethods === '2,1'){
  508. this.checkboItems = this.checkboItems.map(el => {
  509. el.checked = true
  510. return el
  511. })
  512. }else{
  513. this.checkboItems = this.checkboItems.map(el => {
  514. if (el.value*1 === data.communicationMethods*1) {
  515. el.checked = true
  516. }
  517. return el
  518. })
  519. }
  520. this.remarksParams.remarksId = data.remarksId
  521. this.remarksParams.extra = data.extra
  522. this.remarksParams.clubType = data.clubType
  523. this.remarksParams.pinceSensitve = data.pinceSensitve
  524. this.remarksParams.customerSource = data.customerSource
  525. this.remarksParams.customerGender = data.customerGender
  526. this.remarksParams.customerAge = this.customerAge = data.customerAge
  527. this.remarksParams.satisfied = data.satisfied
  528. this.remarksParams.followup = data.followup
  529. this.remarksParams.fileList = data.fileList
  530. this.remarksParams.imageList = data.imageList
  531. this.remarksParams.consult = data.consult
  532. this.remarksParams.productId = data.productId
  533. if(data.reportId){
  534. this.isHashReport = true
  535. this.remarksParams.reportId = data.reportId
  536. }
  537. this.checkedCategorysList = data.consult.split(',').map(i => parseInt(i, 0))
  538. this.categorys = this.categorys.map((el, index) => {
  539. if(this.contains(this.checkedCategorysList,el.id)){
  540. el.isChecked = true
  541. }else{
  542. el.isChecked = false
  543. }
  544. return el
  545. })
  546. if(data.productId){
  547. let pro = {
  548. image:data.mainImage,
  549. name:data.productName,
  550. shopName:data.shopName
  551. }
  552. this.handleGoods.push(pro)
  553. }
  554. if(data.remarks){
  555. this.firstLabelList = data.remarks.map((el, index) => {
  556. return el.label
  557. })
  558. this.labelsList = this.labelsList.map((el, index) => {
  559. if (this.contains(this.firstLabelList, el.label)) {
  560. el.isChecked = true
  561. }
  562. return el
  563. })
  564. }
  565. if(data.stateKeyword){
  566. this.staticLabelsList = data.stateKeyword.map((el, index) => {
  567. el.isAssociation = false
  568. return el
  569. })
  570. }
  571. if(data.trendsKeyword){
  572. this.trendsLabelsList = data.trendsKeyword.map((el, index) => {
  573. el.isAssociation = false
  574. return el
  575. })
  576. }
  577. this.reportText = data.reportText ? data.reportText : ''
  578. this.priceFlagText = this.pinceFilters(data.pinceSensitve)
  579. this.intenFlagText = this.intenActionsFilters(data.satisfied)
  580. this.followStateText = this.followupFilters(data.followup)
  581. this.sourceStateText = this.sourceActionsFilters(data.customerSource)
  582. this.genderText = this.genderActionsFilters(data.customerGender)
  583. this.additiveText = this.additiveActionsFilters(data.groupAddition)
  584. this.initGetStotage()
  585. }catch(error){
  586. //TODO handle the exception
  587. console.log('备注信息回显查询失败~')
  588. }
  589. },
  590. async getPriorKeyword() {
  591. //查询优先展示标签
  592. try{
  593. const res = await this.UserService.getPriorKeyword()
  594. const data = res.data
  595. this.labelsList = data.map((el, index) => {
  596. el.isChecked = false
  597. return el
  598. })
  599. }catch(error){
  600. console.log('=========>获取优先展示标签列表失败')
  601. }
  602. },
  603. async getUserClubConsults() {
  604. //查询咨询类别
  605. try{
  606. const res = await this.UserService.getUserClubConsults()
  607. const data = res.data
  608. this.categorys = data.map((el, index) => {
  609. el.isChecked = false
  610. return el
  611. })
  612. }catch(error){
  613. console.log('=========>获取咨询类别列表失败')
  614. }
  615. },
  616. editButtonConfim() {
  617. if (this.remarksParams.communicationSituation === '') {
  618. this.$util.msg('请选择沟通情况', 2000)
  619. return
  620. }
  621. if (!this.remarksParams.mobileOrWeChat) {
  622. this.$util.msg('请填写手机号或者微信', 2000)
  623. return
  624. }
  625. if(this.current === 0){
  626. if (this.remarksParams.consult == '') {
  627. this.$util.msg('请选择咨询类别', 2000)
  628. return
  629. }
  630. if (!this.remarksParams.pinceSensitve) {
  631. this.$util.msg('请选择价格敏感度', 2000)
  632. return
  633. }
  634. if (!this.remarksParams.satisfied) {
  635. this.$util.msg('请选择意向程度', 2000)
  636. return
  637. }
  638. if (!this.remarksParams.followup) {
  639. this.$util.msg('请选择跟进状态', 2000)
  640. return
  641. }
  642. }
  643. //统一处理静态标签
  644. let staticLabelsList = []
  645. this.staticLabelsList.forEach( el =>{
  646. if(el.label !== ''){
  647. staticLabelsList.push(el.label)
  648. }
  649. })
  650. console.log('staticLabelsList', staticLabelsList)
  651. //统一处理动态标签
  652. let trendsLabelsList = []
  653. this.trendsLabelsList.forEach( (el) =>{
  654. if(el.label !== ''){
  655. trendsLabelsList.push(el.label)
  656. }
  657. })
  658. console.log('trendsLabelsList', trendsLabelsList)
  659. // 标签必须有一项
  660. if(this.remarksParams.communicationSituation !== 1){
  661. if (!this.firstLabelList.length && !trendsLabelsList.length && !staticLabelsList.length) {
  662. this.modal = true
  663. this.contentModalText = '标签必须选择或者填写一项'
  664. return
  665. }
  666. }
  667. if(this.firstLabelList.length > 0){
  668. this.remarksParams.remarks = JSON.stringify(this.firstLabelList)
  669. }
  670. if(trendsLabelsList.length > 0){
  671. this.remarksParams.trendsKeyword = JSON.stringify(trendsLabelsList)
  672. }
  673. if(staticLabelsList.length > 0){
  674. this.remarksParams.stateKeyword = JSON.stringify(staticLabelsList)
  675. }
  676. console.log('remarksParams',this.remarksParams)
  677. this.getUserClubVisitorSaveAdd({ params: JSON.stringify(this.remarksParams) })
  678. },
  679. // 调用保存
  680. async getUserClubVisitorSaveAdd(params){
  681. try{
  682. await this.UserService.getUserClubVisitorSaveAdd(params)
  683. this.$util.msg('保存成功', 2000, true, 'success')
  684. let VisitorInfo = {
  685. questionManId: this.remarksParams.questionManId,
  686. questionMan: this.questionMan
  687. }
  688. this.$api.setStorage('VisitorInfo', VisitorInfo)
  689. setTimeout(() => {
  690. uni.navigateBack({
  691. delta: 1
  692. })
  693. },2000)
  694. }catch(error){
  695. this.$util.msg(error.msg, 2000)
  696. }
  697. },
  698. choiceCategorys(category,index){
  699. // 选择类别
  700. category.isChecked = !category.isChecked
  701. if (category.isChecked) {
  702. if(!this.contains(this.checkedCategorysList,category.id)){
  703. this.checkedCategorysList.push(category.id)
  704. }
  705. } else {
  706. this.checkedCategorysList.splice(this.checkedCategorysList.indexOf(category.id),1)
  707. }
  708. this.remarksParams.consult = this.checkedCategorysList.join(',')
  709. },
  710. handleShowReportPopup(){
  711. // 显示报备弹窗
  712. if (this.isHashReport) {
  713. this.$util.msg('请取消已有关联后再重新关联报备', 2000)
  714. return
  715. }
  716. this.isReportpopup = true
  717. },
  718. handleShowGoodPopup() {
  719. // 显示添加商品弹窗
  720. this.isGoodspopup = true
  721. },
  722. handleClean() {
  723. //删除选择的商品
  724. this.remarksParams.productId === 0
  725. this.handleGoods = []
  726. },
  727. handleChoiceaGoodsData(data) {
  728. console.log('data', data)
  729. this.handleGoods = []
  730. this.remarksParams.productId = data.productId
  731. this.handleGoods.push(data)
  732. },
  733. handleChoiceaReportData(data) {
  734. console.log('data', data)
  735. this.reportText = data.reportText
  736. this.remarksParams.reportId = data.reportId
  737. },
  738. contains(arr, val) {// 校验
  739. return arr.some(item => item === val)
  740. },
  741. uploadFile(array) {
  742. //上传资质文件
  743. console.log(array)
  744. uploadFilePdfDocDocxXlsx().then(res => {
  745. let data = JSON.parse(res.data).data
  746. let obj = {
  747. fileName: uni.getStorageSync('fileName'),
  748. ossName: data.ossName
  749. }
  750. array.push(obj)
  751. }).catch(err=>{
  752. console.log(err)
  753. })
  754. },
  755. uploadPhotoFn(array) {
  756. //添加图片
  757. uploadFileImage().then(res => {
  758. array.push(JSON.parse(res.data).data)
  759. })
  760. },
  761. deleteFileFn(array, index) {
  762. console.log(array)
  763. //删除文件
  764. this.UploadService.PostFileDelete({
  765. ossName: array[index].ossName
  766. })
  767. .then(res => {
  768. array.splice(index, 1)
  769. })
  770. .catch(error => {
  771. console.log('删除文件异常提示===>', error.msg)
  772. })
  773. },
  774. deletePhotoFn(array, index) {
  775. //删除图片
  776. array.splice(index, 1)
  777. },
  778. previewImg(image, index) {
  779. //顶部商品图片预览
  780. isPreviewImg = true
  781. let previewUrls = image
  782. uni.previewImage({
  783. current: index, //图片索引
  784. urls: previewUrls, //必须是http图片,本地图片无效
  785. longPressActions: ''
  786. })
  787. },
  788. conInput(e) {
  789. //备注文字字数限制
  790. let value = e.detail.value
  791. let len = parseInt(value.length)
  792. if (len > this.max) return
  793. this.min = len
  794. if (this.min == 200) {
  795. this.$util.msg('您输入的字数已达上限', 2000)
  796. }
  797. },
  798. handleClick() {
  799. this.modal = false
  800. },
  801. followupFilters(value) {
  802. // 订单来源
  803. const map = {
  804. 1: '跟进中',
  805. 2: '跟进完成',
  806. 3: '已放弃'
  807. }
  808. return map[value]
  809. },
  810. pinceFilters(value) {
  811. // 意向
  812. const map = {
  813. 1: '敏感',
  814. 2: '适中',
  815. 3: '不敏感',
  816. 4: '不明确'
  817. }
  818. return map[value]
  819. },
  820. intenActionsFilters(value) {
  821. // 意向
  822. const map = {
  823. 1: '意向强烈',
  824. 2: '意向一般',
  825. 3: '意向平淡',
  826. 4: '随便看看'
  827. }
  828. return map[value]
  829. },
  830. sourceActionsFilters(value) {
  831. // 客户来源
  832. const map = {
  833. 0: '搜索引擎',
  834. 1: '小程序',
  835. 2: '公众号',
  836. 3: '小红书',
  837. 4: '微博',
  838. 5: '搜狐',
  839. 7: '抖音',
  840. 8: '视频号',
  841. 9: '朋友推荐',
  842. 6: '其他',
  843. }
  844. return map[value]
  845. },
  846. genderActionsFilters(value) {
  847. // 客户性别
  848. const map = {
  849. 0: '男',
  850. 1: '女'
  851. }
  852. return map[value]
  853. },
  854. additiveActionsFilters(value) {
  855. // 加群情况
  856. const map = {
  857. 0: '已加群',
  858. 1: '未加群'
  859. }
  860. return map[value]
  861. }
  862. },
  863. onShow() {}
  864. }
  865. </script>
  866. <style lang="scss">
  867. page {
  868. height: auto;
  869. background: #ffffff;
  870. }
  871. .remarks-content {
  872. width: 100%;
  873. height: auto;
  874. box-sizing: border-box;
  875. padding: 0 24rpx;
  876. padding-bottom: 160rpx;
  877. .list-view-title {
  878. width: 100%;
  879. height: auto;
  880. margin-bottom: 16rpx;
  881. margin-top: 20rpx;
  882. .list-view-h1 {
  883. line-height: 40rpx;
  884. font-size: $font-size-28;
  885. color: #333333;
  886. text-align: left;
  887. text {
  888. color: #ff2a2a;
  889. }
  890. }
  891. .list-view-p {
  892. line-height: 30rpx;
  893. color: #fea785;
  894. font-size: $font-size-20;
  895. }
  896. }
  897. .tui-remarks-content {
  898. width: 100%;
  899. height: auto;
  900. margin-bottom: 24rpx;
  901. .tui-remarks-goods-input {
  902. width: 100%;
  903. height: 180rpx;
  904. box-sizing: border-box;
  905. background-color: #f7f7f7;
  906. padding: 26rpx;
  907. border-radius: 6rpx;
  908. .input-add {
  909. width: 128rpx;
  910. height: 128rpx;
  911. line-height: 128rpx;
  912. float: left;
  913. text-align: center;
  914. box-sizing: border-box;
  915. border: 1px dashed #b2b2b2;
  916. border-radius: 6rpx;
  917. .iconfont {
  918. font-size: 44rpx;
  919. color: #b2b2b2;
  920. }
  921. }
  922. .input-text {
  923. height: 128rpx;
  924. box-sizing: border-box;
  925. padding: 0 32rpx;
  926. line-height: 128rpx;
  927. text-align: left;
  928. font-size: 26rpx;
  929. color: #b2b2b2;
  930. float: left;
  931. }
  932. }
  933. .tui-remarks-showgoods {
  934. width: 100%;
  935. height: 180rpx;
  936. box-sizing: border-box;
  937. .tui-remarks-btn {
  938. width: 90rpx;
  939. height: 180rpx;
  940. float: right;
  941. .btn {
  942. width: 100%;
  943. height: 90rpx;
  944. float: left;
  945. line-height: 90rpx;
  946. text-align: center;
  947. font-size: 26rpx;
  948. &.delete {
  949. color: #f94b4b;
  950. }
  951. &.update {
  952. color: #1890f9;
  953. }
  954. }
  955. }
  956. .tui-remarks-goods {
  957. width: 612rpx;
  958. height: 180rpx;
  959. box-sizing: border-box;
  960. background-color: #f7f7f7;
  961. padding: 26rpx;
  962. border-radius: 6rpx;
  963. float: left;
  964. .goods-image {
  965. width: 128rpx;
  966. height: 128rpx;
  967. float: left;
  968. image {
  969. width: 128rpx;
  970. height: 128rpx;
  971. display: block;
  972. border-radius: 4rpx;
  973. }
  974. }
  975. .goods-main {
  976. width: 432rpx;
  977. height: 128rpx;
  978. box-sizing: border-box;
  979. padding-left: 32rpx;
  980. float: right;
  981. .name {
  982. width: 100%;
  983. height: 60rpx;
  984. box-sizing: border-box;
  985. line-height: 60rpx;
  986. color: #333333;
  987. text-overflow: ellipsis;
  988. overflow: hidden;
  989. display: -webkit-box;
  990. -webkit-line-clamp: 1;
  991. line-clamp: 1;
  992. -webkit-box-orient: vertical;
  993. font-size: 26rpx;
  994. }
  995. .shop {
  996. line-height: 60rpx;
  997. color: #999999;
  998. font-size: 26rpx;
  999. text-overflow: ellipsis;
  1000. overflow: hidden;
  1001. display: -webkit-box;
  1002. -webkit-line-clamp: 1;
  1003. line-clamp: 1;
  1004. -webkit-box-orient: vertical;
  1005. }
  1006. }
  1007. }
  1008. }
  1009. }
  1010. .list-view-radio {
  1011. width: 100%;
  1012. height: 90rpx;
  1013. box-sizing: border-box;
  1014. padding: 0 10rpx;
  1015. border: 1px solid #b2b2b2;
  1016. border-radius: 6rpx;
  1017. margin-bottom: 30rpx;
  1018. position: relative;
  1019. &.btn {
  1020. border: none;
  1021. margin-top: 40rpx;
  1022. }
  1023. .input {
  1024. width: 100%;
  1025. height: 90rpx;
  1026. line-height: 90rpx;
  1027. float: left;
  1028. box-sizing: border-box;
  1029. font-size: $font-size-24;
  1030. color: #333333;
  1031. padding: 0 10rpx;
  1032. padding-right: 90rpx;
  1033. }
  1034. .iconfont {
  1035. width: 50rpx;
  1036. height: 90rpx;
  1037. display: block;
  1038. line-height: 90rpx;
  1039. text-align: center;
  1040. font-size: 30rpx;
  1041. color: #999999;
  1042. position: absolute;
  1043. right: 0;
  1044. top: 0;
  1045. }
  1046. }
  1047. .list-view-list-main {
  1048. width: 100%;
  1049. height: auto;
  1050. box-sizing: border-box;
  1051. margin-bottom: 30rpx;
  1052. position: relative;
  1053. .list-label-list{
  1054. width: 100%;
  1055. height: auto;
  1056. box-sizing: border-box;
  1057. .list-label{
  1058. display: inline-block;
  1059. padding: 0 20rpx;
  1060. height: 48rpx;
  1061. line-height: 48rpx;
  1062. background: #F7F7F7;
  1063. text-align: center;
  1064. margin-right: 20rpx;
  1065. margin-bottom: 20rpx;
  1066. font-size: 26rpx;
  1067. color: #666666;
  1068. &.active{
  1069. background: #FEF6F3;
  1070. color: #FF5B00;
  1071. }
  1072. }
  1073. }
  1074. .list-view-list {
  1075. width: 100%;
  1076. height: 90rpx;
  1077. box-sizing: border-box;
  1078. margin-bottom: 30rpx;
  1079. .list-view-input {
  1080. width: 614rpx;
  1081. height: 90rpx;
  1082. float: left;
  1083. position: relative;
  1084. .input {
  1085. width: 614rpx;
  1086. height: 90rpx;
  1087. box-sizing: border-box;
  1088. padding: 0 20rpx;
  1089. border: 1px solid #b2b2b2;
  1090. border-radius: 6rpx;
  1091. font-size: $font-size-24;
  1092. color: #333333;
  1093. }
  1094. .list-view-assAction {
  1095. width: 614rpx;
  1096. min-height: 270rpx;
  1097. box-sizing: border-box;
  1098. padding: 10rpx 0;
  1099. background: rgba(255, 255, 255, 1);
  1100. box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.15);
  1101. border-radius: 6rpx;
  1102. position: absolute;
  1103. top: -288rpx;
  1104. left: 0;
  1105. z-index: 999;
  1106. overflow: hidden;
  1107. .tui-popup-scroll {
  1108. width: 100%;
  1109. height: 270rpx;
  1110. }
  1111. .ass-list {
  1112. width: 100%;
  1113. height: 90rpx;
  1114. box-sizing: border-box;
  1115. padding: 0 24rpx;
  1116. line-height: 90rpx;
  1117. font-size: $font-size-26;
  1118. color: #666666;
  1119. text-align: left;
  1120. border-bottom: 1px solid #e1e1e1;
  1121. &:last-child{
  1122. border-bottom: none;
  1123. }
  1124. }
  1125. }
  1126. }
  1127. .list-view-btn {
  1128. width: 88rpx;
  1129. height: 90rpx;
  1130. float: right;
  1131. text-align: center;
  1132. line-height: 90rpx;
  1133. .icon-zengjia {
  1134. color: #1890f9;
  1135. font-size: $font-size-48;
  1136. }
  1137. .icon-shanchu4 {
  1138. color: #FF5B00;
  1139. font-size: $font-size-48;
  1140. }
  1141. }
  1142. }
  1143. }
  1144. .remarks-category{
  1145. width: 100%;
  1146. float: left;
  1147. .label {
  1148. color: #666666;
  1149. font-size: 28rpx;
  1150. margin-right: 50rpx;
  1151. }
  1152. .checkbox-list {
  1153. height: 60rpx;
  1154. font-size: $font-size-28;
  1155. line-height: 60rpx;
  1156. border-radius: 10rpx;
  1157. margin-right: 20rpx;
  1158. margin-bottom: 10rpx;
  1159. box-sizing: border-box;
  1160. float: left;
  1161. .icon-yixuanze{
  1162. margin-right: 10rpx;
  1163. color: #FF5B00;
  1164. }
  1165. .icon-weixuanze{
  1166. margin-right: 10rpx;
  1167. color: #B2B2B2;
  1168. }
  1169. }
  1170. .item-text {
  1171. display: inline-block;
  1172. font-size: 26rpx;
  1173. color: #333333;
  1174. border-radius: 28rpx;
  1175. line-height: 50rpx;
  1176. }
  1177. }
  1178. .remarks-input {
  1179. width: 100%;
  1180. height: 90rpx;
  1181. line-height: 90rpx;
  1182. margin: 20rpx 0 0 0;
  1183. box-sizing: border-box;
  1184. .input {
  1185. width: 100%;
  1186. height: 90rpx;
  1187. line-height: 90rpx;
  1188. font-size: $font-size-26;
  1189. color: $text-color;
  1190. z-index: 1;
  1191. box-sizing: border-box;
  1192. border: 1px solid #b2b2b2;
  1193. padding: 0 16rpx;
  1194. border-radius: 6rpx;
  1195. }
  1196. }
  1197. .remarks-textarea {
  1198. width: 100%;
  1199. height: 226rpx;
  1200. padding: 16rpx;
  1201. margin: 20rpx 0 0 0;
  1202. border-radius: 6rpx;
  1203. position: relative;
  1204. border: 1px solid #b2b2b2;
  1205. box-sizing: border-box;
  1206. .textarea {
  1207. width: 100%;
  1208. height: 100%;
  1209. line-height: 36rpx;
  1210. font-size: $font-size-26;
  1211. color: $text-color;
  1212. z-index: 1;
  1213. }
  1214. .limit-text {
  1215. position: absolute;
  1216. right: 20rpx;
  1217. bottom: 16rpx;
  1218. line-height: 44rpx;
  1219. font-size: $font-size-24;
  1220. color: #b2b2b2;
  1221. }
  1222. }
  1223. .list-view {
  1224. width: 100%;
  1225. height: 40rpx;
  1226. margin-top: 20rpx;
  1227. .list-view-file {
  1228. width: 132rpx;
  1229. height: 44rpx;
  1230. line-height: 44rpx;
  1231. font-size: $font-size-20;
  1232. text-align: center;
  1233. color: #ffffff;
  1234. background-color: $color-system;
  1235. border-radius: 8rpx;
  1236. float: left;
  1237. margin-top: 10rpx;
  1238. }
  1239. .list-view-text {
  1240. width: 100%;
  1241. float: left;
  1242. .input {
  1243. width: 560rpx;
  1244. height: 44rpx;
  1245. box-sizing: border-box;
  1246. line-height: 44rpx;
  1247. color: #333333;
  1248. text-overflow: ellipsis;
  1249. overflow: hidden;
  1250. display: -webkit-box;
  1251. -webkit-line-clamp: 1;
  1252. line-clamp: 1;
  1253. -webkit-box-orient: vertical;
  1254. float: left;
  1255. }
  1256. .delbtn {
  1257. width: 96rpx;
  1258. height: 44rpx;
  1259. border-radius: 8rpx;
  1260. background-color: #fff2ec;
  1261. font-size: $font-size-24;
  1262. color: #FF5B00;
  1263. line-height: 44rpx;
  1264. text-align: center;
  1265. float: left;
  1266. }
  1267. }
  1268. }
  1269. .list-view-upload {
  1270. width: 100%;
  1271. height: auto;
  1272. .photo-item {
  1273. display: inline-block;
  1274. width: 112rpx;
  1275. height: 112rpx;
  1276. margin: 10rpx 0;
  1277. margin-right: 25rpx;
  1278. border-radius: 10rpx;
  1279. border: 1px solid #f5f5f5;
  1280. position: relative;
  1281. float: left;
  1282. &.add {
  1283. width: 112rpx;
  1284. height: 112rpx;
  1285. border-color: #b2b2b2;
  1286. text-align: center;
  1287. line-height: 112rpx;
  1288. margin-right: 0rpx;
  1289. .icon-jiahao {
  1290. font-size: $font-size-44;
  1291. color: #b2b2b2;
  1292. font-weight: bold;
  1293. }
  1294. }
  1295. .icon-iconfontguanbi {
  1296. width: 30rpx;
  1297. height: 30rpx;
  1298. border-radius: 50%;
  1299. display: block;
  1300. position: absolute;
  1301. right: -10rpx;
  1302. top: -10rpx;
  1303. background: #f94b4b;
  1304. text-align: center;
  1305. line-height: 30rpx;
  1306. color: #ffffff;
  1307. font-size: $font-size-22;
  1308. }
  1309. image {
  1310. width: 112rpx;
  1311. height: 112rpx;
  1312. border-radius: 10rpx;
  1313. }
  1314. }
  1315. .photo-list {
  1316. width: 100%;
  1317. height: 116rpx;
  1318. overflow: hidden;
  1319. white-space: nowrap;
  1320. display: flex;
  1321. align-items: flex-start;
  1322. }
  1323. }
  1324. }
  1325. .remarks-btn {
  1326. width: 100%;
  1327. padding-top: 20rpx;
  1328. position: fixed;
  1329. bottom: 0;
  1330. left: 0;
  1331. background-color: #ffffff;
  1332. z-index: 99;
  1333. .edit-button-canel {
  1334. width: 100%;
  1335. height: 88rpx;
  1336. line-height: 88rpx;
  1337. text-align: center;
  1338. color: #FF5B00;
  1339. font-size: $font-size-24;
  1340. }
  1341. .edit-button {
  1342. width: 600rpx;
  1343. height: 90rpx;
  1344. background: $btn-confirm;
  1345. line-height: 90rpx;
  1346. text-align: center;
  1347. color: #ffffff;
  1348. font-size: $font-size-30;
  1349. margin: 0 auto;
  1350. border-radius: 45rpx;
  1351. }
  1352. }
  1353. </style>