add-record.vue 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334
  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. getUserRemarksVisitDetail(remarksId) {
  481. //修改回显资料备注信息
  482. this.UserService.getUserRemarksVisitDetail({
  483. remarksId : remarksId
  484. })
  485. .then(response => {
  486. let data = response.data
  487. this.reportInfo.questionMan = data.questionMan
  488. this.reportInfo.questionManId = data.questionManId
  489. this.questionMan = data.questionMan
  490. this.remarksParams.questionManId = data.questionManId
  491. this.remarksParams.communicationSituation = this.current = data.communicationSituation
  492. this.remarksParams.communicationMethods = data.communicationMethods
  493. if(data.communicationMethods === '1,2' || data.communicationMethods === '2,1'){
  494. this.checkboItems = this.checkboItems.map(el => {
  495. el.checked = true
  496. return el
  497. })
  498. }else{
  499. this.checkboItems = this.checkboItems.map(el => {
  500. if (el.value*1 === data.communicationMethods*1) {
  501. el.checked = true
  502. }
  503. return el
  504. })
  505. }
  506. this.remarksParams.remarksId = data.remarksId
  507. this.remarksParams.extra = data.extra
  508. this.remarksParams.clubType = data.clubType
  509. this.remarksParams.pinceSensitve = data.pinceSensitve
  510. this.remarksParams.customerSource = data.customerSource
  511. this.remarksParams.customerGender = data.customerGender
  512. this.remarksParams.customerAge = this.customerAge = data.customerAge
  513. this.remarksParams.satisfied = data.satisfied
  514. this.remarksParams.followup = data.followup
  515. this.remarksParams.fileList = data.fileList
  516. this.remarksParams.imageList = data.imageList
  517. this.remarksParams.consult = data.consult
  518. this.remarksParams.productId = data.productId
  519. if(data.reportId){
  520. this.isHashReport = true
  521. this.remarksParams.reportId = data.reportId
  522. }
  523. this.checkedCategorysList = data.consult.split(',').map(i => parseInt(i, 0))
  524. this.categorys = this.categorys.map((el, index) => {
  525. if(this.contains(this.checkedCategorysList,el.id)){
  526. el.isChecked = true
  527. }else{
  528. el.isChecked = false
  529. }
  530. return el
  531. })
  532. if(data.productId){
  533. let pro = {
  534. image:data.mainImage,
  535. name:data.productName,
  536. shopName:data.shopName
  537. }
  538. this.handleGoods.push(pro)
  539. }
  540. if(data.remarks){
  541. this.firstLabelList = data.remarks.map((el, index) => {
  542. return el.label
  543. })
  544. this.labelsList = this.labelsList.map((el, index) => {
  545. if (this.contains(this.firstLabelList, el.label)) {
  546. el.isChecked = true
  547. }
  548. return el
  549. })
  550. }
  551. if(data.stateKeyword){
  552. this.staticLabelsList = data.stateKeyword.map((el, index) => {
  553. el.isAssociation = false
  554. return el
  555. })
  556. }
  557. if(data.trendsKeyword){
  558. this.trendsLabelsList = data.trendsKeyword.map((el, index) => {
  559. el.isAssociation = false
  560. return el
  561. })
  562. }
  563. this.reportText = data.reportText ? data.reportText : ''
  564. this.priceFlagText = this.pinceFilters(data.pinceSensitve)
  565. this.intenFlagText = this.intenActionsFilters(data.satisfied)
  566. this.followStateText = this.followupFilters(data.followup)
  567. this.sourceStateText = this.sourceActionsFilters(data.customerSource)
  568. this.genderText = this.genderActionsFilters(data.customerGender)
  569. this.additiveText = this.additiveActionsFilters(data.groupAddition)
  570. this.initGetStotage()
  571. })
  572. .catch(error => {
  573. this.$util.msg(error.msg, 2000)
  574. })
  575. },
  576. async getPriorKeyword() {
  577. //查询优先展示标签
  578. try{
  579. const res = await this.UserService.getPriorKeyword()
  580. const data = res.data
  581. this.labelsList = data.map((el, index) => {
  582. el.isChecked = false
  583. return el
  584. })
  585. }catch(error){
  586. console.log('=========>获取优先展示标签列表失败')
  587. }
  588. },
  589. async getUserClubConsults() {
  590. //查询咨询类别
  591. try{
  592. const res = await this.UserService.getUserClubConsults()
  593. const data = res.data
  594. this.categorys = data.map((el, index) => {
  595. el.isChecked = false
  596. return el
  597. })
  598. }catch(error){
  599. console.log('=========>获取咨询类别列表失败')
  600. }
  601. },
  602. editButtonConfim() {
  603. if(this.current === 0){
  604. if (this.remarksParams.consult == '') {
  605. this.$util.msg('请选择咨询类别', 2000)
  606. return
  607. }
  608. if (!this.remarksParams.pinceSensitve) {
  609. this.$util.msg('请选择价格敏感度', 2000)
  610. return
  611. }
  612. if (!this.remarksParams.satisfied) {
  613. this.$util.msg('请选择意向程度', 2000)
  614. return
  615. }
  616. if (!this.remarksParams.followup) {
  617. this.$util.msg('请选择跟进状态', 2000)
  618. return
  619. }
  620. }
  621. //统一处理静态标签
  622. let staticLabelsList = []
  623. this.staticLabelsList.forEach( el =>{
  624. if(el.label !== ''){
  625. staticLabelsList.push(el.label)
  626. }
  627. })
  628. console.log('staticLabelsList', staticLabelsList)
  629. //统一处理动态标签
  630. let trendsLabelsList = []
  631. this.trendsLabelsList.forEach( (el) =>{
  632. if(el.label !== ''){
  633. trendsLabelsList.push(el.label)
  634. }
  635. })
  636. console.log('trendsLabelsList', trendsLabelsList)
  637. // 标签必须有一项
  638. if(this.remarksParams.communicationSituation !== 1){
  639. if (!this.firstLabelList.length && !trendsLabelsList.length && !staticLabelsList.length) {
  640. this.modal = true
  641. this.contentModalText = '标签必须选择或者填写一项'
  642. return
  643. }
  644. }
  645. if(this.firstLabelList.length > 0){
  646. this.remarksParams.remarks = JSON.stringify(this.firstLabelList)
  647. }
  648. if(trendsLabelsList.length > 0){
  649. this.remarksParams.trendsKeyword = JSON.stringify(trendsLabelsList)
  650. }
  651. if(staticLabelsList.length > 0){
  652. this.remarksParams.stateKeyword = JSON.stringify(staticLabelsList)
  653. }
  654. console.log('remarksParams',this.remarksParams)
  655. this.getUserClubVisitorSaveAdd({ params: JSON.stringify(this.remarksParams) })
  656. },
  657. // 调用保存
  658. async getUserClubVisitorSaveAdd(params){
  659. try{
  660. await this.UserService.getUserClubVisitorSaveAdd(params)
  661. this.$util.msg('保存成功', 2000, true, 'success')
  662. let VisitorInfo = {
  663. questionManId: this.remarksParams.questionManId,
  664. questionMan: this.questionMan
  665. }
  666. this.$api.setStorage('VisitorInfo', VisitorInfo)
  667. setTimeout(() => {
  668. uni.navigateBack({
  669. delta: 1
  670. })
  671. },2000)
  672. }catch(error){
  673. this.$util.msg(error.msg, 2000)
  674. }
  675. },
  676. choiceCategorys(category,index){
  677. // 选择类别
  678. category.isChecked = !category.isChecked
  679. if (category.isChecked) {
  680. if(!this.contains(this.checkedCategorysList,category.id)){
  681. this.checkedCategorysList.push(category.id)
  682. }
  683. } else {
  684. this.checkedCategorysList.splice(this.checkedCategorysList.indexOf(category.id),1)
  685. }
  686. this.remarksParams.consult = this.checkedCategorysList.join(',')
  687. },
  688. handleShowReportPopup(){
  689. // 显示报备弹窗
  690. if (this.isHashReport) {
  691. this.$util.msg('请取消已有关联后再重新关联报备', 2000)
  692. return
  693. }
  694. this.isReportpopup = true
  695. },
  696. handleShowGoodPopup() {
  697. // 显示添加商品弹窗
  698. this.isGoodspopup = true
  699. },
  700. handleClean() {
  701. //删除选择的商品
  702. this.remarksParams.productId === 0
  703. this.handleGoods = []
  704. },
  705. handleChoiceaGoodsData(data) {
  706. console.log('data', data)
  707. this.handleGoods = []
  708. this.remarksParams.productId = data.productId
  709. this.handleGoods.push(data)
  710. },
  711. handleChoiceaReportData(data) {
  712. console.log('data', data)
  713. this.reportText = data.reportText
  714. this.remarksParams.reportId = data.reportId
  715. },
  716. contains(arr, val) {// 校验
  717. return arr.some(item => item === val)
  718. },
  719. uploadFile(array) {
  720. //上传资质文件
  721. console.log(array)
  722. uploadFilePdfDocDocxXlsx().then(res => {
  723. let data = JSON.parse(res.data).data
  724. let obj = {
  725. fileName: uni.getStorageSync('fileName'),
  726. ossName: data.ossName
  727. }
  728. array.push(obj)
  729. }).catch(err=>{
  730. console.log(err)
  731. })
  732. },
  733. uploadPhotoFn(array) {
  734. //添加图片
  735. uploadFileImage().then(res => {
  736. array.push(JSON.parse(res.data).data)
  737. })
  738. },
  739. deleteFileFn(array, index) {
  740. console.log(array)
  741. //删除文件
  742. this.UploadService.PostFileDelete({
  743. ossName: array[index].ossName
  744. })
  745. .then(res => {
  746. array.splice(index, 1)
  747. })
  748. .catch(error => {
  749. console.log('删除文件异常提示===>', error.msg)
  750. })
  751. },
  752. deletePhotoFn(array, index) {
  753. //删除图片
  754. array.splice(index, 1)
  755. },
  756. previewImg(image, index) {
  757. //顶部商品图片预览
  758. isPreviewImg = true
  759. let previewUrls = image
  760. uni.previewImage({
  761. current: index, //图片索引
  762. urls: previewUrls, //必须是http图片,本地图片无效
  763. longPressActions: ''
  764. })
  765. },
  766. conInput(e) {
  767. //备注文字字数限制
  768. let value = e.detail.value
  769. let len = parseInt(value.length)
  770. if (len > this.max) return
  771. this.min = len
  772. if (this.min == 200) {
  773. this.$util.msg('您输入的字数已达上限', 2000)
  774. }
  775. },
  776. handleClick() {
  777. this.modal = false
  778. },
  779. followupFilters(value) {
  780. // 订单来源
  781. const map = {
  782. 1: '跟进中',
  783. 2: '跟进完成',
  784. 3: '已放弃'
  785. }
  786. return map[value]
  787. },
  788. pinceFilters(value) {
  789. // 意向
  790. const map = {
  791. 1: '敏感',
  792. 2: '适中',
  793. 3: '不敏感',
  794. 4: '不明确'
  795. }
  796. return map[value]
  797. },
  798. intenActionsFilters(value) {
  799. // 意向
  800. const map = {
  801. 1: '意向强烈',
  802. 2: '意向一般',
  803. 3: '意向平淡',
  804. 4: '随便看看'
  805. }
  806. return map[value]
  807. },
  808. sourceActionsFilters(value) {
  809. // 客户来源
  810. const map = {
  811. 0: '搜素引擎',
  812. 1: '小程序',
  813. 2: '公众号',
  814. 3: '小红书',
  815. 4: '微博',
  816. 5: '搜狐',
  817. 7: '抖音',
  818. 8: '视频号',
  819. 9: '朋友推荐',
  820. 6: '其他',
  821. }
  822. return map[value]
  823. },
  824. genderActionsFilters(value) {
  825. // 客户性别
  826. const map = {
  827. 0: '男',
  828. 1: '女'
  829. }
  830. return map[value]
  831. },
  832. additiveActionsFilters(value) {
  833. // 加群情况
  834. const map = {
  835. 0: '已加群',
  836. 1: '未加群'
  837. }
  838. return map[value]
  839. }
  840. },
  841. onShow() {}
  842. }
  843. </script>
  844. <style lang="scss">
  845. page {
  846. height: auto;
  847. background: #ffffff;
  848. }
  849. .remarks-content {
  850. width: 100%;
  851. height: auto;
  852. box-sizing: border-box;
  853. padding: 0 24rpx;
  854. padding-bottom: 160rpx;
  855. .list-view-title {
  856. width: 100%;
  857. height: auto;
  858. margin-bottom: 16rpx;
  859. margin-top: 20rpx;
  860. .list-view-h1 {
  861. line-height: 40rpx;
  862. font-size: $font-size-28;
  863. color: #333333;
  864. text-align: left;
  865. text {
  866. color: #ff2a2a;
  867. }
  868. }
  869. .list-view-p {
  870. line-height: 30rpx;
  871. color: #fea785;
  872. font-size: $font-size-20;
  873. }
  874. }
  875. .tui-remarks-content {
  876. width: 100%;
  877. height: auto;
  878. margin-bottom: 24rpx;
  879. .tui-remarks-goods-input {
  880. width: 100%;
  881. height: 180rpx;
  882. box-sizing: border-box;
  883. background-color: #f7f7f7;
  884. padding: 26rpx;
  885. border-radius: 6rpx;
  886. .input-add {
  887. width: 128rpx;
  888. height: 128rpx;
  889. line-height: 128rpx;
  890. float: left;
  891. text-align: center;
  892. box-sizing: border-box;
  893. border: 1px dashed #b2b2b2;
  894. border-radius: 6rpx;
  895. .iconfont {
  896. font-size: 44rpx;
  897. color: #b2b2b2;
  898. }
  899. }
  900. .input-text {
  901. height: 128rpx;
  902. box-sizing: border-box;
  903. padding: 0 32rpx;
  904. line-height: 128rpx;
  905. text-align: left;
  906. font-size: 26rpx;
  907. color: #b2b2b2;
  908. float: left;
  909. }
  910. }
  911. .tui-remarks-showgoods {
  912. width: 100%;
  913. height: 180rpx;
  914. box-sizing: border-box;
  915. .tui-remarks-btn {
  916. width: 90rpx;
  917. height: 180rpx;
  918. float: right;
  919. .btn {
  920. width: 100%;
  921. height: 90rpx;
  922. float: left;
  923. line-height: 90rpx;
  924. text-align: center;
  925. font-size: 26rpx;
  926. &.delete {
  927. color: #f94b4b;
  928. }
  929. &.update {
  930. color: #1890f9;
  931. }
  932. }
  933. }
  934. .tui-remarks-goods {
  935. width: 612rpx;
  936. height: 180rpx;
  937. box-sizing: border-box;
  938. background-color: #f7f7f7;
  939. padding: 26rpx;
  940. border-radius: 6rpx;
  941. float: left;
  942. .goods-image {
  943. width: 128rpx;
  944. height: 128rpx;
  945. float: left;
  946. image {
  947. width: 128rpx;
  948. height: 128rpx;
  949. display: block;
  950. border-radius: 4rpx;
  951. }
  952. }
  953. .goods-main {
  954. width: 432rpx;
  955. height: 128rpx;
  956. box-sizing: border-box;
  957. padding-left: 32rpx;
  958. float: right;
  959. .name {
  960. width: 100%;
  961. height: 60rpx;
  962. box-sizing: border-box;
  963. line-height: 60rpx;
  964. color: #333333;
  965. text-overflow: ellipsis;
  966. overflow: hidden;
  967. display: -webkit-box;
  968. -webkit-line-clamp: 1;
  969. line-clamp: 1;
  970. -webkit-box-orient: vertical;
  971. font-size: 26rpx;
  972. }
  973. .shop {
  974. line-height: 60rpx;
  975. color: #999999;
  976. font-size: 26rpx;
  977. text-overflow: ellipsis;
  978. overflow: hidden;
  979. display: -webkit-box;
  980. -webkit-line-clamp: 1;
  981. line-clamp: 1;
  982. -webkit-box-orient: vertical;
  983. }
  984. }
  985. }
  986. }
  987. }
  988. .list-view-radio {
  989. width: 100%;
  990. height: 90rpx;
  991. box-sizing: border-box;
  992. padding: 0 10rpx;
  993. border: 1px solid #b2b2b2;
  994. border-radius: 6rpx;
  995. margin-bottom: 30rpx;
  996. position: relative;
  997. &.btn {
  998. border: none;
  999. margin-top: 40rpx;
  1000. }
  1001. .input {
  1002. width: 100%;
  1003. height: 90rpx;
  1004. line-height: 90rpx;
  1005. float: left;
  1006. box-sizing: border-box;
  1007. font-size: $font-size-24;
  1008. color: #333333;
  1009. padding: 0 10rpx;
  1010. padding-right: 90rpx;
  1011. }
  1012. .iconfont {
  1013. width: 50rpx;
  1014. height: 90rpx;
  1015. display: block;
  1016. line-height: 90rpx;
  1017. text-align: center;
  1018. font-size: 30rpx;
  1019. color: #999999;
  1020. position: absolute;
  1021. right: 0;
  1022. top: 0;
  1023. }
  1024. }
  1025. .list-view-list-main {
  1026. width: 100%;
  1027. height: auto;
  1028. box-sizing: border-box;
  1029. margin-bottom: 30rpx;
  1030. position: relative;
  1031. .list-label-list{
  1032. width: 100%;
  1033. height: auto;
  1034. box-sizing: border-box;
  1035. .list-label{
  1036. display: inline-block;
  1037. padding: 0 20rpx;
  1038. height: 48rpx;
  1039. line-height: 48rpx;
  1040. background: #F7F7F7;
  1041. text-align: center;
  1042. margin-right: 20rpx;
  1043. margin-bottom: 20rpx;
  1044. font-size: 26rpx;
  1045. color: #666666;
  1046. &.active{
  1047. background: #FEF6F3;
  1048. color: #FF5B00;
  1049. }
  1050. }
  1051. }
  1052. .list-view-list {
  1053. width: 100%;
  1054. height: 90rpx;
  1055. box-sizing: border-box;
  1056. margin-bottom: 30rpx;
  1057. .list-view-input {
  1058. width: 614rpx;
  1059. height: 90rpx;
  1060. float: left;
  1061. position: relative;
  1062. .input {
  1063. width: 614rpx;
  1064. height: 90rpx;
  1065. box-sizing: border-box;
  1066. padding: 0 20rpx;
  1067. border: 1px solid #b2b2b2;
  1068. border-radius: 6rpx;
  1069. font-size: $font-size-24;
  1070. color: #333333;
  1071. }
  1072. .list-view-assAction {
  1073. width: 614rpx;
  1074. min-height: 270rpx;
  1075. box-sizing: border-box;
  1076. padding: 10rpx 0;
  1077. background: rgba(255, 255, 255, 1);
  1078. box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.15);
  1079. border-radius: 6rpx;
  1080. position: absolute;
  1081. top: -288rpx;
  1082. left: 0;
  1083. z-index: 999;
  1084. overflow: hidden;
  1085. .tui-popup-scroll {
  1086. width: 100%;
  1087. height: 270rpx;
  1088. }
  1089. .ass-list {
  1090. width: 100%;
  1091. height: 90rpx;
  1092. box-sizing: border-box;
  1093. padding: 0 24rpx;
  1094. line-height: 90rpx;
  1095. font-size: $font-size-26;
  1096. color: #666666;
  1097. text-align: left;
  1098. border-bottom: 1px solid #e1e1e1;
  1099. &:last-child{
  1100. border-bottom: none;
  1101. }
  1102. }
  1103. }
  1104. }
  1105. .list-view-btn {
  1106. width: 88rpx;
  1107. height: 90rpx;
  1108. float: right;
  1109. text-align: center;
  1110. line-height: 90rpx;
  1111. .icon-zengjia {
  1112. color: #1890f9;
  1113. font-size: $font-size-48;
  1114. }
  1115. .icon-shanchu4 {
  1116. color: #FF5B00;
  1117. font-size: $font-size-48;
  1118. }
  1119. }
  1120. }
  1121. }
  1122. .remarks-category{
  1123. width: 100%;
  1124. float: left;
  1125. .label {
  1126. color: #666666;
  1127. font-size: 28rpx;
  1128. margin-right: 50rpx;
  1129. }
  1130. .checkbox-list {
  1131. height: 60rpx;
  1132. font-size: $font-size-28;
  1133. line-height: 60rpx;
  1134. border-radius: 10rpx;
  1135. margin-right: 20rpx;
  1136. margin-bottom: 10rpx;
  1137. box-sizing: border-box;
  1138. float: left;
  1139. .icon-yixuanze{
  1140. margin-right: 10rpx;
  1141. color: #FF5B00;
  1142. }
  1143. .icon-weixuanze{
  1144. margin-right: 10rpx;
  1145. color: #B2B2B2;
  1146. }
  1147. }
  1148. .item-text {
  1149. display: inline-block;
  1150. font-size: 26rpx;
  1151. color: #333333;
  1152. border-radius: 28rpx;
  1153. line-height: 50rpx;
  1154. }
  1155. }
  1156. .remarks-input {
  1157. width: 100%;
  1158. height: 90rpx;
  1159. line-height: 90rpx;
  1160. margin: 20rpx 0 0 0;
  1161. box-sizing: border-box;
  1162. .input {
  1163. width: 100%;
  1164. height: 90rpx;
  1165. line-height: 90rpx;
  1166. font-size: $font-size-26;
  1167. color: $text-color;
  1168. z-index: 1;
  1169. box-sizing: border-box;
  1170. border: 1px solid #b2b2b2;
  1171. padding: 0 16rpx;
  1172. border-radius: 6rpx;
  1173. }
  1174. }
  1175. .remarks-textarea {
  1176. width: 100%;
  1177. height: 226rpx;
  1178. padding: 16rpx;
  1179. margin: 20rpx 0 0 0;
  1180. border-radius: 6rpx;
  1181. position: relative;
  1182. border: 1px solid #b2b2b2;
  1183. box-sizing: border-box;
  1184. .textarea {
  1185. width: 100%;
  1186. height: 100%;
  1187. line-height: 36rpx;
  1188. font-size: $font-size-26;
  1189. color: $text-color;
  1190. z-index: 1;
  1191. }
  1192. .limit-text {
  1193. position: absolute;
  1194. right: 20rpx;
  1195. bottom: 16rpx;
  1196. line-height: 44rpx;
  1197. font-size: $font-size-24;
  1198. color: #b2b2b2;
  1199. }
  1200. }
  1201. .list-view {
  1202. width: 100%;
  1203. height: 40rpx;
  1204. margin-top: 20rpx;
  1205. .list-view-file {
  1206. width: 132rpx;
  1207. height: 44rpx;
  1208. line-height: 44rpx;
  1209. font-size: $font-size-20;
  1210. text-align: center;
  1211. color: #ffffff;
  1212. background-color: $color-system;
  1213. border-radius: 8rpx;
  1214. float: left;
  1215. margin-top: 10rpx;
  1216. }
  1217. .list-view-text {
  1218. width: 100%;
  1219. float: left;
  1220. .input {
  1221. width: 560rpx;
  1222. height: 44rpx;
  1223. box-sizing: border-box;
  1224. line-height: 44rpx;
  1225. color: #333333;
  1226. text-overflow: ellipsis;
  1227. overflow: hidden;
  1228. display: -webkit-box;
  1229. -webkit-line-clamp: 1;
  1230. line-clamp: 1;
  1231. -webkit-box-orient: vertical;
  1232. float: left;
  1233. }
  1234. .delbtn {
  1235. width: 96rpx;
  1236. height: 44rpx;
  1237. border-radius: 8rpx;
  1238. background-color: #fff2ec;
  1239. font-size: $font-size-24;
  1240. color: #FF5B00;
  1241. line-height: 44rpx;
  1242. text-align: center;
  1243. float: left;
  1244. }
  1245. }
  1246. }
  1247. .list-view-upload {
  1248. width: 100%;
  1249. height: auto;
  1250. .photo-item {
  1251. display: inline-block;
  1252. width: 112rpx;
  1253. height: 112rpx;
  1254. margin: 10rpx 0;
  1255. margin-right: 25rpx;
  1256. border-radius: 10rpx;
  1257. border: 1px solid #f5f5f5;
  1258. position: relative;
  1259. float: left;
  1260. &.add {
  1261. width: 112rpx;
  1262. height: 112rpx;
  1263. border-color: #b2b2b2;
  1264. text-align: center;
  1265. line-height: 112rpx;
  1266. margin-right: 0rpx;
  1267. .icon-jiahao {
  1268. font-size: $font-size-44;
  1269. color: #b2b2b2;
  1270. font-weight: bold;
  1271. }
  1272. }
  1273. .icon-iconfontguanbi {
  1274. width: 30rpx;
  1275. height: 30rpx;
  1276. border-radius: 50%;
  1277. display: block;
  1278. position: absolute;
  1279. right: -10rpx;
  1280. top: -10rpx;
  1281. background: #f94b4b;
  1282. text-align: center;
  1283. line-height: 30rpx;
  1284. color: #ffffff;
  1285. font-size: $font-size-22;
  1286. }
  1287. image {
  1288. width: 112rpx;
  1289. height: 112rpx;
  1290. border-radius: 10rpx;
  1291. }
  1292. }
  1293. .photo-list {
  1294. width: 100%;
  1295. height: 116rpx;
  1296. overflow: hidden;
  1297. white-space: nowrap;
  1298. display: flex;
  1299. align-items: flex-start;
  1300. }
  1301. }
  1302. }
  1303. .remarks-btn {
  1304. width: 100%;
  1305. padding-top: 20rpx;
  1306. position: fixed;
  1307. bottom: 0;
  1308. left: 0;
  1309. background-color: #ffffff;
  1310. z-index: 99;
  1311. .edit-button-canel {
  1312. width: 100%;
  1313. height: 88rpx;
  1314. line-height: 88rpx;
  1315. text-align: center;
  1316. color: #FF5B00;
  1317. font-size: $font-size-24;
  1318. }
  1319. .edit-button {
  1320. width: 600rpx;
  1321. height: 90rpx;
  1322. background: $btn-confirm;
  1323. line-height: 90rpx;
  1324. text-align: center;
  1325. color: #ffffff;
  1326. font-size: $font-size-30;
  1327. margin: 0 auto;
  1328. border-radius: 45rpx;
  1329. }
  1330. }
  1331. </style>