add-record.vue 36 KB

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