add-record.vue 34 KB

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