AI销管
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364
  1. <template>
  2. <view class="pages">
  3. <!-- 日报内容部分 -->
  4. <view class="container">
  5. <!-- 头部日报卡 -->
  6. <view class="c-head-card">
  7. <view class="c-title-text">
  8. {{ projectName || '' }}销讲助手周报
  9. </view>
  10. <text class="date">{{ weekObj.createTimeName }}</text>
  11. <view class="creative-time">
  12. 生成时间:{{ weekObj.createTime || '--' }}
  13. </view>
  14. </view>
  15. </view>
  16. <view class="nodata-box" v-if="nodata">
  17. <image class="img" src="/static/images/nodata.png" mode="" />
  18. <view class="text">此项目本周还没有接待量哦~</view>
  19. </view>
  20. <template v-else>
  21. <!-- 简报 -->
  22. <view class="briefing">
  23. <view class="briefing-title">
  24. 简报
  25. </view>
  26. <!-- 简报表格部分 -->
  27. <view class="briefing-box">
  28. <block v-for="(data, index) in numlist" :key="index">
  29. <view class="briefing-box-item" @click="toAuthPage(data)">
  30. <view class="tops" :class="[data.class || '']">
  31. {{ data.name }}
  32. </view>
  33. <view class="middle" :class="[data.class || '']">
  34. {{ data.num || 0 }}
  35. </view>
  36. <view class="bottom">
  37. 对比上周: {{ data.preNum || 0 }}
  38. <text class="b-text"
  39. :class="{up: data.percent > 0, down: data.percent < 0}">{{ data.percent || '0' }}</text>
  40. <template v-if="data.percent != 0">
  41. <text style="margin-left: 8rpx;font-size: 34rpx;font-weight: bold;"
  42. :class="{up: data.percent > 0, down: data.percent < 0}">{{ data.percent > 0 ? '↑' : '↓' }}</text>
  43. </template>
  44. </view>
  45. </view>
  46. </block>
  47. </view>
  48. </view>
  49. <!-- 销讲场景执行排名 -->
  50. <view class="execution-ranking" v-if="!weekObj.orgCode">
  51. <view class="execution-ranking-title">
  52. 销讲场景执行排名
  53. </view>
  54. <template v-if="isShowXJTop1List">
  55. <view class="execution-ranking-desc" v-if="false">
  56. <text>销讲场景平均执行对比上周</text>
  57. <text>{{ rankTop('fractionPKName') }}</text>
  58. <text>{{ rankTop('fractionPK') }}</text>
  59. <text>%</text>
  60. <template v-if="rankTop('fractionBastValue') > 0">
  61. <text>,其中【{{ rankTop('fractionBastName') }}】最强为</text>
  62. <text class="up">{{ rankTop('fractionBastValue') }}</text>
  63. <text>%</text>
  64. </template>
  65. <template v-if="rankTop('fractionLastValue') < 0">
  66. <text>,【{{ rankTop('fractionLastName') }}】执行最弱为</text>
  67. <text class="down">{{ rankTop('fractionLastValue') }}</text>
  68. <text>%;</text>
  69. </template>
  70. </view>
  71. <!-- 排名百分比列表 -->
  72. <view class="ranking-box" @click="toTrendAnalysis('销讲数据')">
  73. <block v-for="(percent, index) in weekObj.XJTop1List" :key="index">
  74. <view class="ranking-item">
  75. <view class="left">{{ percent.title }}</view>
  76. <view class="middle">
  77. <u-line-progress :active-color="$options.filters.setColor(index)"
  78. inactive-color="#F2F2F2" :show-percent="false" :percent="percent.value">
  79. </u-line-progress>
  80. </view>
  81. <view class="right"> {{ percent.value || '0' }} %</view>
  82. </view>
  83. </block>
  84. </view>
  85. </template>
  86. <template v-else>
  87. <view class="empity">
  88. 暂无数据
  89. </view>
  90. </template>
  91. </view>
  92. <!-- 接待统计 -->
  93. <view class="statistics">
  94. <view class="statistics-title">
  95. 接待统计
  96. </view>
  97. <template v-if="isShowStatistics">
  98. <view class="statistics-desc" v-if="false">
  99. <text>
  100. 顾问平均执行率对比上周
  101. </text>
  102. <text>
  103. {{ rankTop('ranktype') || '' }}
  104. </text>
  105. <text :class="[rankTop('class')]">{{ rankTop('people') || '' }}</text>
  106. <text class="">
  107. 人,其中{{ rankTop('topName') || '' }}上升
  108. </text>
  109. <text class="up">{{ rankTop('topPk') || '0' }}</text>
  110. <text class="">
  111. %为最高,{{ rankTop('lastName') || '' }}下降
  112. </text>
  113. <text class="down">{{ rankTop('lastPk') || '0' }}</text>
  114. <text class="">
  115. %降幅最大。
  116. </text>
  117. </view>
  118. <view class="table">
  119. <view class="thead">
  120. <block v-for="(head, headIndex) in tableHead" :key="headIndex">
  121. <view class="thead-item"
  122. :style="[(weekObj.orgCode && head.title2) ? head.style1 : head.style]">
  123. <template v-if="weekObj.orgCode && head.title2">
  124. {{ head.title2 }}
  125. </template>
  126. <template v-else>
  127. {{ head.title }}
  128. </template>
  129. </view>
  130. </block>
  131. </view>
  132. <view class="tbody" @click="toEmployeesstatistics('顾问排名')">
  133. <block v-for="(data, index) in weekObj.customerInfo1" :key="index">
  134. <view class="tbody-item">
  135. <template v-if="!weekObj.orgCode">
  136. <view class="tbody-items name">{{ data.name }}</view>
  137. </template>
  138. <template v-else>
  139. <view class="tbody-items time">{{ data.houseName }}</view>
  140. </template>
  141. <view class="tbody-items nums">{{ data.activeCustomer }}</view>
  142. <template v-if="!weekObj.orgCode">
  143. <view class="tbody-items time">{{ tofixed2(data.avgDuration)}}m</view>
  144. </template>
  145. <template v-else>
  146. <view class="tbody-items time">{{ tofixed2(data.avgDuration/60) }}m</view>
  147. </template>
  148. <view class="tbody-items percent">{{ data.fraction }}%</view>
  149. <template v-if="!weekObj.orgCode">
  150. <view class="tbody-items week" :class="{up: data.pk > 0, down: data.pk < 0}">
  151. <template v-if="data.pk">
  152. {{ data.pk > 0 ? `+${data.pk}` : data.pk }}%
  153. </template>
  154. </view>
  155. </template>
  156. <template v-else>
  157. <view class="tbody-items week"
  158. :class="{up: data.fractionContrast > 0, down: data.fractionContrast < 0}">
  159. <template v-if="data.fractionContrast">
  160. {{ data.fractionContrast > 0 ? `+${data.fractionContrast}` : data.fractionContrast }}%
  161. </template>
  162. <template v-else>--</template>
  163. </view>
  164. </template>
  165. </view>
  166. </block>
  167. </view>
  168. </view>
  169. </template>
  170. <template v-else>
  171. <view class="empity">
  172. 暂无数据
  173. </view>
  174. </template>
  175. </view>
  176. <!-- 顾问销讲执行率排名 -->
  177. <view class="guwen-ranking">
  178. <view class="guwen-ranking-title">
  179. <template v-if="!weekObj.orgCode">
  180. 顾问销讲执行率排名(TOP10)
  181. </template>
  182. <template v-else>
  183. 项目销讲执行排名(TOP10)
  184. </template>
  185. </view>
  186. <template v-if="isShowZXLTopList">
  187. <!-- 排名百分比列表 -->
  188. <view class="ranking-box">
  189. <block v-for="(percent, index) in weekObj.ZXLTopList" :key="index">
  190. <view class="ranking-item" @click="toStaffAnalysis('销讲数据', percent)">
  191. <view class="left">{{ percent.title }}</view>
  192. <view class="middle">
  193. <u-line-progress :active-color="$options.filters.setColor(index)"
  194. inactive-color="#F2F2F2" :show-percent="false" :percent="percent.value">
  195. </u-line-progress>
  196. </view>
  197. <view class="right"> {{ percent.value || '0' }} %</view>
  198. </view>
  199. </block>
  200. </view>
  201. </template>
  202. <template v-else>
  203. <view class="empity">
  204. 暂无数据
  205. </view>
  206. </template>
  207. </view>
  208. <!-- 顾问接待量排名 -->
  209. <view class="guwen-ranking">
  210. <view class="guwen-ranking-title">
  211. <template v-if="!weekObj.orgCode">
  212. 顾问接待量排名(TOP10)
  213. </template>
  214. <template v-else>
  215. 项目有效接待排名(TOP10)
  216. </template>
  217. </view>
  218. <template v-if="isShowJDLTopList">
  219. <!-- 排名百分比列表 -->
  220. <view class="ranking-box">
  221. <block v-for="(percent, index) in weekObj.JDLTopList" :key="index">
  222. <view class="ranking-item" @click="toStaffAnalysis('销讲数据', percent)">
  223. <view class="left">{{ percent.title }}</view>
  224. <view class="middle">
  225. <u-line-progress :active-color="$options.filters.setColor(index)"
  226. inactive-color="#F2F2F2" :show-percent="false" :percent="percent.values">
  227. </u-line-progress>
  228. </view>
  229. <view class="right"> {{ percent.value || '0' }} </view>
  230. </view>
  231. </block>
  232. </view>
  233. </template>
  234. <template v-else>
  235. <view class="empity">
  236. 暂无数据
  237. </view>
  238. </template>
  239. </view>
  240. <!-- 顾问接待量排名 -->
  241. <view class="guwen-ranking" v-if="weekObj.level1List">
  242. <view class="guwen-ranking-title">
  243. 画像一级触达排名(TOP10)
  244. </view>
  245. <template v-if="weekObj.level1List">
  246. <!-- 排名百分比列表 -->
  247. <view class="ranking-box">
  248. <block v-for="(percent, index) in weekObj.level1List" :key="index">
  249. <view class="ranking-item">
  250. <view class="left">{{ percent.name }}</view>
  251. <view class="middle">
  252. <u-line-progress :active-color="$options.filters.setColor(index)"
  253. inactive-color="#F2F2F2" :show-percent="false" :percent="percent.percent">
  254. </u-line-progress>
  255. </view>
  256. <view class="right"> {{ percent.total || '0' }} </view>
  257. </view>
  258. </block>
  259. </view>
  260. </template>
  261. <template v-else>
  262. <view class="empity">
  263. 暂无数据
  264. </view>
  265. </template>
  266. </view>
  267. <view class="guwen-ranking" v-if="weekObj.level2List">
  268. <view class="guwen-ranking-title">
  269. 画像关键词触达排名(TOP10)
  270. </view>
  271. <template v-if="weekObj.level2List">
  272. <!-- 排名百分比列表 -->
  273. <view class="ranking-box">
  274. <block v-for="(percent, index) in weekObj.level2List" :key="index">
  275. <view class="ranking-item">
  276. <view class="left">{{ percent.name }}</view>
  277. <view class="middle">
  278. <u-line-progress :active-color="$options.filters.setColor(index)"
  279. inactive-color="#F2F2F2" :show-percent="false" :percent="percent.percent">
  280. </u-line-progress>
  281. </view>
  282. <view class="right"> {{ percent.total || '0' }} </view>
  283. </view>
  284. </block>
  285. </view>
  286. </template>
  287. <template v-else>
  288. <view class="empity">
  289. 暂无数据
  290. </view>
  291. </template>
  292. </view>
  293. <!-- 使用建议 -->
  294. <view class="proposal" v-if="weekObj.suggest">
  295. <view class="proposal-title">
  296. 使用建议
  297. </view>
  298. <!-- 建议的文字 -->
  299. <view class="proposal-box">
  300. <u-parse class="ql-editor" :content="weekObj.suggest" />
  301. </view>
  302. </view>
  303. <!-- 底部按钮 -->
  304. <view class="nav-footer">
  305. <view class="footer-item" @click="toHome">
  306. 回到管理端
  307. </view>
  308. <view class="footer-item full" style="margin-left: 24rpx;" @tap="forShare">
  309. <button open-type="share" class="fulls">
  310. 一键转发
  311. </button>
  312. </view>
  313. </view>
  314. </template>
  315. </view>
  316. </template>
  317. <script>
  318. import uParse from '@/components/gaoyia-parse/parse.vue'
  319. export default {
  320. components: {
  321. uParse
  322. },
  323. data() {
  324. return {
  325. nodata: false,
  326. tableHead: [{
  327. title: '顾问',
  328. title2: '项目名称',
  329. style: {
  330. flex: 1
  331. },
  332. style1: {
  333. flex: 2
  334. },
  335. },
  336. {
  337. title: '接待量',
  338. style: {
  339. flex: 1
  340. }
  341. },
  342. {
  343. title: '平均接待时长',
  344. style: {
  345. flex: 2
  346. }
  347. },
  348. {
  349. title: '平均执行率',
  350. style: {
  351. flex: 2
  352. }
  353. },
  354. {
  355. title: '对比上周',
  356. style: {
  357. flex: 1.5
  358. }
  359. },
  360. ],
  361. id: '', // id
  362. needList: ['JDLTop', 'ZXLTop', 'XJTop1'], // 需要转换数组的内容
  363. // 简报
  364. numlist: [{
  365. name: '接待量 (次)',
  366. num: '',
  367. setName: 'receptionCount1',
  368. percent: '',
  369. percentName: 'receptionCountPK',
  370. preNum: '', // 上周数量
  371. preNumName: 'receptionCount2', //
  372. path: '/pages/center/records/index',
  373. pathParms: '?activeTotal=4&refresh=refresh', // 参数
  374. auth: 'jdjl', //
  375. }, {
  376. name: '有效接待 (次)',
  377. num: '',
  378. setName: 'activeCustomer1',
  379. percent: '',
  380. percentName: 'activeCustomerPK',
  381. preNum: '', // 上周数量
  382. preNumName: 'activeCustomer2', //
  383. path: '/pages/center/records/index',
  384. pathParms: '?activeTotal=4&refresh=refresh&validInvalid=0', // 参数
  385. auth: 'jdjl', //
  386. },
  387. {
  388. name: '平均执行率(%)',
  389. num: '',
  390. setName: 'fraction1',
  391. percent: '',
  392. percentName: 'fractionPK',
  393. preNum: '', // 上周数量
  394. preNumName: 'fraction2', //
  395. path: '/pages/center/records/index',
  396. pathParms: '?activeTotal=4&refresh=refresh&validInvalid=0', // 参数
  397. auth: 'jdjl', //
  398. },
  399. {
  400. name: '平均接待时长(分)',
  401. num: '',
  402. setName: 'avgDuration1',
  403. percent: '',
  404. percentName: 'avgDurationPK',
  405. preNum: '', // 上周数量
  406. preNumName: 'avgDuration2', //
  407. path: '/pages/center/records/index',
  408. pathParms: '?activeTotal=4&refresh=refresh&validInvalid=0', // 参数
  409. auth: 'jdjl', //
  410. },
  411. {
  412. name: '违禁接待 (次)',
  413. num: '',
  414. setName: 'prohibitedNum1',
  415. percent: '',
  416. percentName: 'prohibitedNumPK',
  417. preNum: '', // 上周数量
  418. preNumName: 'prohibitedNum2', //
  419. class: 'down',
  420. path: '/pages/center/prohibited/index',
  421. pathParms: '?activeTotal=4&violatedStatus=1&refresh=refresh', // 参数
  422. auth: 'wjjl',
  423. },
  424. {
  425. name: '客户画像触达 (次)',
  426. num: '',
  427. setName: 'reachSum1',
  428. percent: '',
  429. percentName: 'reachSumPK',
  430. preNum: '', // 上周数量
  431. preNumName: 'reachSum2', //
  432. path: '/pages/center/Piabodata/Userinsightinto',
  433. pathParms: '?activeTotal=3', // 参数
  434. auth: 'xjfx',
  435. },
  436. {
  437. name: '已标记',
  438. num: '',
  439. setName: 'labelledReceptionNum1',
  440. percent: '',
  441. percentName: 'labelledReceptionNumPK',
  442. preNum: '', // 上周数量
  443. preNumName: 'labelledReceptionNum2', //
  444. path: '/pages/center/records/index',
  445. pathParms: '?activeTotal=4&refresh=refresh&markAdvisor=1', // 参数
  446. auth: 'jdjl', //
  447. },
  448. {
  449. name: '未标记',
  450. num: '',
  451. setName: 'unlabelledReceptionNum1',
  452. percent: '',
  453. percentName: 'unlabelledReceptionNumPK',
  454. preNum: '', // 上周数量
  455. preNumName: 'unlabelledReceptionNum2', //
  456. class: 'down',
  457. path: '/pages/center/records/index',
  458. pathParms: '?activeTotal=4&refresh=refresh&markAdvisor=0&validInvalid=0', // 参数
  459. auth: 'jdjl', //
  460. },
  461. ],
  462. // 周报详情
  463. weekObj: {},
  464. projectName: '', // 项目名称
  465. }
  466. },
  467. computed: {
  468. // 获取本地存储的权限列表
  469. menuList() {
  470. return uni.getStorageSync('weapp_session_Menu_data')
  471. },
  472. // 排名最高与最低
  473. rankTop() {
  474. return name => {
  475. let obj = {}
  476. try {
  477. if (this.weekObj.customerInfo1.length && this.weekObj.customerInfo2.length) {
  478. obj.ranktype = (this.weekObj.customerInfo1.length - this.weekObj.customerInfo2.length) >
  479. 0 ? '上升' : '下降'
  480. obj.people = Math.abs(this.weekObj.customerInfo1.length - this.weekObj.customerInfo2
  481. .length)
  482. }
  483. if (this.weekObj.customerInfo1 && this.weekObj.customerInfo1.length > 0) {
  484. obj.topName = this.weekObj.customerInfo1[0].name
  485. obj.topPk = Math.abs(this.weekObj.customerInfo1[0].pk)
  486. obj.lastName = this.weekObj.customerInfo1[this.weekObj.customerInfo1.length - 1].name,
  487. obj.lastPk = Math.abs(this.weekObj.customerInfo1[this.weekObj.customerInfo1.length - 1]
  488. .pk)
  489. }
  490. if (this.weekObj.customerInfo1.length && this.weekObj.customerInfo2.length) {
  491. obj.class = (this.weekObj.customerInfo1.length - this.weekObj.customerInfo2.length) > 0 ?
  492. 'up' : 'down'
  493. }
  494. if (this.weekObj.fractionPK) {
  495. obj.fractionPKName = this.weekObj.fractionPK > 0 ? '上涨' : '下跌'
  496. obj.fractionPK = Math.abs(this.weekObj.fractionPK)
  497. }
  498. if (this.weekObj.XJTop1List && this.weekObj.XJTop1List.length > 0) {
  499. obj.fractionBastName = this.weekObj.XJTop1List[0].title
  500. obj.fractionBastValue = this.weekObj.XJTop1List[0].value
  501. }
  502. if (this.weekObj.XJTop1List && this.weekObj.XJTop1List.length > 0) {
  503. obj.fractionLastName = this.weekObj.XJTop1List[this.weekObj.XJTop1List.length - 1].title
  504. obj.fractionLastValue = this.weekObj.XJTop1List[this.weekObj.XJTop1List.length - 1].value
  505. }
  506. return obj[name] || ''
  507. } catch (e) {
  508. console.log(e)
  509. return ''
  510. }
  511. }
  512. },
  513. // 接待统计
  514. isShowStatistics() {
  515. // return this.rankTop('ranktype') && this.rankTop('class') && this.rankTop('people') && this.rankTop('topName') && this.rankTop('topPk') && this.rankTop('lastName') && this.rankTop('lastPk') && this.weekObj.customerInfo1 && this.weekObj.customerInfo1.length > 0
  516. return this.weekObj.customerInfo1 && this.weekObj.customerInfo1.length > 0
  517. },
  518. isShowXJTop1List() {
  519. // return this.weekObj.XJTop1List && this.weekObj.XJTop1List.length > 0 && this.rankTop('fractionPKName') && this.rankTop('fractionPK') && this.rankTop('fractionBastName') && this.rankTop('fractionBastValue') && this.rankTop('fractionLastName') && this.rankTop('fractionLastName') && this.rankTop('fractionLastValue')
  520. return this.weekObj.XJTop1List && this.weekObj.XJTop1List.length > 0
  521. },
  522. isShowZXLTopList() {
  523. return this.weekObj.ZXLTopList && this.weekObj.ZXLTopList.length > 0
  524. },
  525. isShowJDLTopList() {
  526. return this.weekObj.JDLTopList && this.weekObj.JDLTopList.length > 0
  527. },
  528. },
  529. onLoad(option) {
  530. if (option.id) this.id = option.id
  531. this.getMessage()
  532. },
  533. onShareAppMessage() {
  534. return {
  535. title: `${this.projectName}销讲助手周报`,
  536. path: `/pages/reportExcel/weekReport?id=${this.id}`
  537. }
  538. },
  539. methods: {
  540. tofixed2(time) {
  541. if (time) {
  542. return time.toFixed(2)
  543. } else {
  544. return 0
  545. }
  546. },
  547. forShare() {
  548. this.$u.get("/zkMessage/shareMessage", {
  549. id: this.id,
  550. houseId: uni.getStorageSync('buildingID').id,
  551. username: uni.getStorageSync('weapp_session_userInfo_data').username
  552. })
  553. },
  554. // 趋势分析
  555. toTrendAnalysis(name) {
  556. return
  557. let date = this.weekObj.weekDate.split('~')
  558. let [t1, t2] = [date[0], date[1]]
  559. let time1 = new Date(t1.replace(/-/g, '/'))
  560. let time2 = new Date(t2.replace(/-/g, '/'))
  561. time1.setDate(time1.getDate() - 7)
  562. time2.setDate(time2.getDate() - 7)
  563. let res1 = `${time1.getFullYear()}-${time1.getMonth() + 1}-${time1.getDate()}`
  564. let res2 = `${time2.getFullYear()}-${time2.getMonth() + 1}-${time2.getDate()}`
  565. if (this.isPassWatch(name)) {
  566. uni.navigateTo({
  567. url: `/pages/center/Piabodata/TrendAnalysis?type=1&staTime=${date[0]}&endtime=${date[1]}&staTime1=${res1}&endtime1=${res2}`
  568. })
  569. } else {
  570. uni.showToast({
  571. title: '暂无权限',
  572. icon: "none"
  573. })
  574. }
  575. },
  576. // 顾问排名
  577. toEmployeesstatistics(name) {
  578. let date = this.weekObj.weekDate.split('~')
  579. let [t1, t2] = [date[0], date[1]]
  580. if (this.isPassWatch(name)) {
  581. uni.navigateTo({
  582. url: `/pages/center/Piabodata/Employeesstatistics?type=1&staTime=${date[0]}&endtime=${date[1]}`
  583. })
  584. } else {
  585. uni.showToast({
  586. title: '暂无权限',
  587. icon: "none"
  588. })
  589. }
  590. },
  591. // 员工分析
  592. toStaffAnalysis(name, data) {
  593. let obj = this.weekObj.customerInfo1.find(item => {
  594. return item.name == data.title
  595. })
  596. console.log(obj)
  597. let time = this.weekObj.weekDate.split('~')
  598. if (this.isPassWatch(name)) {
  599. uni.navigateTo({
  600. url: `/pages/center/Piabodata/StaffAnalysis?type=1&id=${obj.id}&startDate=${time[0]}&endDate=${time[1]}`
  601. });
  602. } else {
  603. uni.showToast({
  604. title: '暂无权限',
  605. icon: "none"
  606. })
  607. }
  608. },
  609. // 跳转对应页面
  610. toAuthPage(data) {
  611. if (!uni.getStorageSync('weapp_session_login_data').token) {
  612. this.toHome()
  613. return
  614. }
  615. if (this.isPassWatch(data.auth)) {
  616. let time = this.weekObj.weekDate.split('~')
  617. data.pathParms = `${data.pathParms}&staTime=${time[0]}&endtime=${time[1]}`
  618. uni.navigateTo({
  619. url: `${data.path}${data.pathParms}`
  620. })
  621. } else {
  622. uni.showToast({
  623. title: '暂无权限',
  624. icon: "none"
  625. })
  626. }
  627. },
  628. // 是否有权限观看
  629. isPassWatch(name) {
  630. return this.menuList[name]
  631. },
  632. // 跳转首页
  633. toHome() {
  634. uni.navigateTo({
  635. url: '/pages/index/guide'
  636. })
  637. },
  638. // 获取周报详情
  639. getMessage() {
  640. this.$u.get('/zkMessage/findByProjectId', {
  641. id: this.id,
  642. houseId: uni.getStorageSync('buildingID').id,
  643. username: uni.getStorageSync('weapp_session_userInfo_data').username
  644. }).then(res => {
  645. let data = {}
  646. if (res.zkMessage.content) {
  647. data = JSON.parse(res.zkMessage.content)
  648. this.bubbleSort(data.customerInfo1 || [], 'pk')
  649. this.bubbleSort(data.customerInfo2 || [], 'pk')
  650. data.customerInfo1 && data.customerInfo1.reverse()
  651. data.customerInfo2 && data.customerInfo2.reverse()
  652. this.weekObj = {
  653. ...res.zkMessage,
  654. ...data
  655. }
  656. } else {
  657. this.nodata = true
  658. this.weekObj = {
  659. ...res.zkMessage,
  660. }
  661. }
  662. if (this.weekObj.level1List && this.weekObj.level2List) {
  663. if (this.weekObj.level1List[0] && this.weekObj.level1List[0].total) {
  664. let max1 = this.weekObj.level1List[0].total || 1
  665. this.weekObj.level1List.forEach(item => {
  666. item.percent = Math.floor((item.total / max1) * 100)
  667. })
  668. } else {
  669. this.weekObj.level1List.forEach(item => {
  670. item.percent = 0
  671. })
  672. }
  673. if (this.weekObj.level2List[0] && this.weekObj.level2List[0].total) {
  674. let max2 = this.weekObj.level2List[0].total || 1
  675. this.weekObj.level2List.forEach(item => {
  676. item.percent = Math.floor((item.total / max2) * 100)
  677. })
  678. } else {
  679. this.weekObj.level2List.forEach(item => {
  680. item.percent = 0
  681. })
  682. }
  683. }
  684. this.weekObj.createTimeName = this.getTimeLines(this.weekObj.weekDate, 1)
  685. console.log(this.weekObj, 'this.weekObj')
  686. this.projectName = res.projectName
  687. this.numlist.forEach(item => {
  688. if (data[item.setName]) {
  689. item.num = data[item.setName]
  690. }
  691. if (data[item.percentName]) {
  692. item.percent = data[item.percentName]
  693. }
  694. if (data[item.preNumName]) {
  695. item.preNum = data[item.preNumName]
  696. }
  697. })
  698. this.init()
  699. }).catch(e => {
  700. console.log(e)
  701. })
  702. },
  703. // 把对象转成数组并在后续的步骤方便处理
  704. init() {
  705. console.log(this.weekObj, 'this.weekObj')
  706. this.needList.forEach(item => {
  707. console.log(item)
  708. if (this.weekObj[item] && Object.keys(this.weekObj[item]).length > 0) {
  709. this.weekObj[item + 'List'] = [] // 销讲执行
  710. for (let i in this.weekObj[item]) {
  711. this.weekObj[item + 'List'].push({
  712. title: i,
  713. value: this.weekObj[item][i]
  714. })
  715. }
  716. } else {
  717. this.weekObj[item + 'List'] = []
  718. }
  719. })
  720. this.sortInitArr()
  721. },
  722. // 排序对象转换后的数组
  723. sortInitArr() {
  724. this.needList.forEach(item => {
  725. if (this.weekObj[item + 'List']) {
  726. this.bubbleSort(this.weekObj[item + 'List'])
  727. this.weekObj[item + 'List'] = this.dealData(this.weekObj[item + 'List'])
  728. }
  729. })
  730. this.reverseList()
  731. },
  732. // 反转数组
  733. reverseList() {
  734. this.needList.forEach(item => {
  735. if (this.weekObj[item + 'List']) {
  736. this.weekObj[item + 'List'].reverse()
  737. }
  738. })
  739. console.log(this.weekObj, '12312312312')
  740. },
  741. // 冒泡排序
  742. bubbleSort(arr, keys = 'value') {
  743. for (let i = 0; i < arr.length - 1; i += 1) {
  744. //通过 arr.length 次把第一位放到最后,完成排序
  745. //-i是因为最后的位置是会动态改变的,当完成一次后,最后一位会变成倒数第二位
  746. for (let j = 0; j < arr.length - 1 - i; j += 1) {
  747. if (arr[j][keys] > arr[j + 1][keys]) {
  748. const temp = arr[j];
  749. arr[j] = arr[j + 1];
  750. arr[j + 1] = temp;
  751. }
  752. }
  753. }
  754. },
  755. // 定义一个公共方法对数据进行处理
  756. dealData(arr) {
  757. // 获取最大值
  758. let num = Math.max.apply(Math, arr.map((o) => {
  759. return o.value
  760. }))
  761. arr.map(item => {
  762. item.values = Math.floor(item.value / num * 100)
  763. })
  764. return arr
  765. },
  766. // 转换时间
  767. getTimeLine(date, type = 1) {
  768. let resu = '--'
  769. if (!date) return resu
  770. let time = new Date(date.replace(/-/g, '/'))
  771. time.setDate(time.getDate() - 7)
  772. let arr = date.split(' ')
  773. let str = arr[0]
  774. let result = str.split('-')
  775. let m = (time.getMonth() + 1) < 10 ? `0${time.getMonth() + 1}` : (time.getMonth() + 1)
  776. let d = time.getDate() < 10 ? `0${time.getDate()}` : time.getDate()
  777. if (type == 1) {
  778. resu = `${m}.${d}-${result[1]}.${result[2]}`
  779. } else {
  780. resu = `${m}月${d}日~${result[1]}月${result[2]}日`
  781. }
  782. return resu
  783. },
  784. // 转换时间
  785. getTimeLines(date) {
  786. if (!date) return ''
  787. let arr = date.split('~')
  788. let str0 = arr[0].split('-')
  789. let str1 = arr[1].split('-')
  790. return `${str0[1]}月${str0[2]}日~${str1[1]}月${str1[2]}日`
  791. },
  792. },
  793. filters: {
  794. // 时间格式转换
  795. fomatDate(date) {
  796. if (!date) return '--'
  797. let arr = date.split(' ')
  798. let str = arr[0]
  799. let result = str.split('-')
  800. return `${result[1]}-${result[2]}`
  801. },
  802. // 转换时间
  803. getTimeLine(date, type = 1) {
  804. if (!date) return '--'
  805. console.log(date.replace(/-/g, '/'))
  806. let time = new Date(date.replace(/-/g, '/'))
  807. time.setDate(time.getDate() - 7)
  808. let arr = date.split(' ')
  809. let str = arr[0]
  810. let result = str.split('-')
  811. let m = (time.getMonth() + 1) < 10 ? `0${time.getMonth() + 1}` : (time.getMonth() + 1)
  812. let d = time.getDate() < 10 ? `0${time.getDate()}` : time.getDate()
  813. if (type == 1) {
  814. return `${m}.${d}-${result[1]}.${result[2]}`
  815. } else {
  816. return `${m}月${d}日~${result[1]}月${result[2]}日`
  817. }
  818. },
  819. // 设置颜色
  820. setColor(index) {
  821. let color = ''
  822. switch (index) {
  823. case 0:
  824. color = '#E7483C';
  825. break;
  826. case 1:
  827. color = '#FF8C13';
  828. break;
  829. case 2:
  830. color = '#FFCC00';
  831. break;
  832. default:
  833. color = '#4FC78F';
  834. break;
  835. }
  836. return color
  837. },
  838. }
  839. }
  840. </script>
  841. <style lang="scss" scoped>
  842. @import '@/static/css/quill/quill.core.css';
  843. @import '@/static/css/quill/quill.snow.css';
  844. @import '@/static/css/quill/quill.bubble.css';
  845. .pages {
  846. width: 100vw;
  847. min-height: 100vh;
  848. display: flex;
  849. flex-direction: column;
  850. background: #F8F8F8;
  851. .nav-header {
  852. flex-shrink: 0;
  853. }
  854. .container {
  855. padding: 30rpx 30rpx 40rpx;
  856. display: flex;
  857. flex-direction: column;
  858. background: #fff;
  859. .c-head-card {
  860. padding: 30rpx;
  861. width: 100%;
  862. min-height: 252rpx;
  863. border: 2rpx solid #000000;
  864. border-radius: 12rpx;
  865. box-shadow: 10rpx 10rpx #2671E2;
  866. display: flex;
  867. flex-direction: column;
  868. .c-title-text {
  869. // position: relative;
  870. flex-grow: 1;
  871. font-size: 48rpx;
  872. font-weight: bold;
  873. color: #303030;
  874. }
  875. .date {
  876. // position: absolute;
  877. // right: 0;
  878. // bottom: 6rpx;
  879. font-size: 30rpx;
  880. color: #303030;
  881. }
  882. .creative-time {
  883. margin: 20rpx 0 0 0;
  884. flex-shrink: 0;
  885. }
  886. }
  887. }
  888. .nodata-box {
  889. width: 750rpx;
  890. flex: 1;
  891. margin: 0 auto;
  892. display: flex;
  893. justify-content: center;
  894. align-items: center;
  895. flex-direction: column;
  896. background-color: #fff;
  897. .img {
  898. width: 400rpx;
  899. height: 400rpx;
  900. }
  901. .text {
  902. text-align: center;
  903. font-size: 28rpx;
  904. font-family: PingFangSC-Regular, PingFang SC;
  905. font-weight: 400;
  906. color: #666666;
  907. line-height: 40rpx;
  908. }
  909. }
  910. .briefing {
  911. background: #fff;
  912. .briefing-title {
  913. padding: 0 30rpx;
  914. height: 90rpx;
  915. display: flex;
  916. align-items: center;
  917. border: 1rpx solid #E0E0E0;
  918. font-size: 32rpx;
  919. font-weight: bold;
  920. }
  921. .briefing-box {
  922. width: 100%;
  923. display: flex;
  924. flex-wrap: wrap;
  925. .briefing-box-item {
  926. padding: 20rpx 30rpx;
  927. width: 50%;
  928. height: 186rpx;
  929. border: 1px solid #E0E0E0;
  930. border-left: none;
  931. border-top: none;
  932. &:nth-of-type(2n) {
  933. border-right: none;
  934. }
  935. .top {
  936. font-size: 28rpx;
  937. }
  938. .middle {
  939. margin: 14rpx 0 12rpx;
  940. font-size: 32rpx;
  941. font-weight: 600;
  942. color: #333333;
  943. }
  944. .bottom {
  945. font-size: 26rpx;
  946. color: #666666;
  947. .b-text {
  948. margin-left: 20rpx;
  949. &.down {
  950. color: #E7483C;
  951. font-size: 34rpx;
  952. }
  953. &.up {
  954. font-size: 34rpx;
  955. color: #43CD80;
  956. }
  957. }
  958. }
  959. }
  960. }
  961. }
  962. .execution-ranking {
  963. margin: 20rpx 0 0 0;
  964. padding: 30rpx;
  965. background: #fff;
  966. .execution-ranking-title {
  967. font-size: 32rpx;
  968. font-weight: bold;
  969. }
  970. .execution-ranking-desc {
  971. margin-top: 20rpx;
  972. font-size: 30rpx;
  973. }
  974. .ranking-box {
  975. margin: 30rpx 0 0 0;
  976. .ranking-item {
  977. margin-bottom: 18rpx;
  978. display: flex;
  979. &:nth-last-of-type(1) {
  980. margin-bottom: 0;
  981. }
  982. .left {
  983. flex-shrink: 0;
  984. width: 270rpx;
  985. font-size: 30rpx;
  986. overflow: hidden;
  987. text-overflow: ellipsis;
  988. white-space: nowrap;
  989. }
  990. .middle {
  991. flex-grow: 1;
  992. }
  993. .right {
  994. flex-shrink: 0;
  995. width: 118rpx;
  996. font-size: 30rpx;
  997. text-align: center;
  998. }
  999. }
  1000. }
  1001. }
  1002. .statistics {
  1003. margin: 20rpx 0 0 0;
  1004. background: #fff;
  1005. .statistics-title {
  1006. padding: 30rpx 30rpx 0;
  1007. width: 100%;
  1008. font-size: 32rpx;
  1009. font-weight: bold;
  1010. }
  1011. .statistics-desc {
  1012. padding: 0 30rpx;
  1013. margin-top: 20rpx;
  1014. }
  1015. .table {
  1016. margin: 30rpx 0 0 0;
  1017. .thead {
  1018. padding: 0 30rpx;
  1019. width: 100%;
  1020. height: 72rpx;
  1021. display: flex;
  1022. align-items: center;
  1023. border: 1rpx solid #E0E0E0;
  1024. border-left: none;
  1025. border-right: none;
  1026. font-size: 26rpx;
  1027. .thead-item {
  1028. text-align: center;
  1029. }
  1030. }
  1031. .tbody {
  1032. .tbody-item {
  1033. padding: 0 30rpx;
  1034. display: flex;
  1035. align-items: center;
  1036. height: 72rpx;
  1037. background: #FAFCFF;
  1038. &:nth-of-type(2n) {
  1039. background: #FFFFFF;
  1040. }
  1041. .tbody-items {
  1042. flex: 1;
  1043. display: flex;
  1044. justify-content: center;
  1045. }
  1046. .name {
  1047. justify-content: flex-start;
  1048. overflow: hidden;
  1049. text-overflow: ellipsis;
  1050. white-space: nowrap;
  1051. }
  1052. .time {
  1053. flex: 2;
  1054. }
  1055. .percent {
  1056. flex: 2;
  1057. }
  1058. .week {
  1059. flex: 1.5;
  1060. }
  1061. }
  1062. }
  1063. .tbottom {
  1064. width: 100%;
  1065. height: 72rpx;
  1066. display: flex;
  1067. justify-content: center;
  1068. align-items: center;
  1069. font-size: 30rpx;
  1070. color: #2671E2;
  1071. background: #FAFCFF;
  1072. }
  1073. }
  1074. }
  1075. .guwen-ranking {
  1076. margin: 20rpx 0 0 0;
  1077. width: 100%;
  1078. padding: 30rpx;
  1079. background: #fff;
  1080. .guwen-ranking-title {
  1081. font-size: 32rpx;
  1082. font-weight: 500;
  1083. }
  1084. .guwen-ranking-desc {
  1085. margin-top: 20rpx;
  1086. font-size: 30rpx;
  1087. }
  1088. .ranking-box {
  1089. margin: 30rpx 0 0 0;
  1090. .ranking-item {
  1091. margin-bottom: 18rpx;
  1092. display: flex;
  1093. &:nth-last-of-type(1) {
  1094. margin-bottom: 0;
  1095. }
  1096. .left {
  1097. flex-shrink: 0;
  1098. width: 270rpx;
  1099. font-size: 30rpx;
  1100. overflow: hidden;
  1101. text-overflow: ellipsis;
  1102. white-space: nowrap;
  1103. }
  1104. .middle {
  1105. flex-grow: 1;
  1106. }
  1107. .right {
  1108. flex-shrink: 0;
  1109. width: 118rpx;
  1110. font-size: 30rpx;
  1111. text-align: center;
  1112. }
  1113. }
  1114. }
  1115. }
  1116. .proposal {
  1117. margin: 20rpx 0 0 0;
  1118. padding: 30rpx;
  1119. background: #fff;
  1120. .proposal-title {
  1121. font-size: 32rpx;
  1122. font-weight: 500;
  1123. }
  1124. .proposal-box {
  1125. margin: 30rpx 0 0 0;
  1126. .proposal-item {
  1127. margin: 20rpx 0 0 0;
  1128. display: flex;
  1129. .lside {
  1130. flex-shrink: 0;
  1131. margin: 0 12rpx 0 0;
  1132. width: 44rpx;
  1133. height: 44rpx;
  1134. border-radius: 50%;
  1135. background: #2671E2;
  1136. text-align: center;
  1137. line-height: 44rpx;
  1138. color: #fff;
  1139. }
  1140. .rside {
  1141. .rside-title {
  1142. font-size: 32rpx;
  1143. }
  1144. .rside-box {
  1145. margin: 16rpx 0 0 0;
  1146. }
  1147. }
  1148. }
  1149. }
  1150. }
  1151. .nav-footer {
  1152. position: sticky;
  1153. bottom: 0;
  1154. padding: 32rpx;
  1155. width: 100%;
  1156. display: flex;
  1157. justify-content: center;
  1158. background: #fff;
  1159. .footer-item {
  1160. flex: 1;
  1161. height: 88rpx;
  1162. display: flex;
  1163. justify-content: center;
  1164. align-items: center;
  1165. color: #2671E2;
  1166. border: 2rpx solid #2671E2;
  1167. border-radius: 8rpx;
  1168. overflow: hidden;
  1169. font-size: 32rpx;
  1170. &.full {
  1171. background: #2671E2;
  1172. color: #fff;
  1173. .fulls {
  1174. box-sizing: border-box;
  1175. width: 100%;
  1176. height: 100%;
  1177. background: transparent;
  1178. color: #fff;
  1179. font-size: 32rpx;
  1180. font-weight: normal;
  1181. line-height: 88rpx;
  1182. }
  1183. }
  1184. }
  1185. }
  1186. .up {
  1187. color: #43CD80 !important;
  1188. }
  1189. .down {
  1190. color: #E6273A !important;
  1191. }
  1192. .empity {
  1193. width: 100%;
  1194. height: 300rpx;
  1195. display: flex;
  1196. justify-content: center;
  1197. align-items: center;
  1198. font-size: 28rpx;
  1199. color: #666666;
  1200. }
  1201. }
  1202. </style>