add-record.vue 35 KB

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