add-record.vue 34 KB

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