index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <template>
  2. <div class="userPage">
  3. <div class="navBarTOP">
  4. <van-nav-bar class="navBar" title="我的" />
  5. </div>
  6. <div class="content">
  7. <div class="myHeader">
  8. <van-row>
  9. <van-col span="7">
  10. <van-image round width="8rem" height="8rem" :src="avatar" @click="login" />
  11. </van-col>
  12. <van-col span="17">
  13. <div class="avatarContent">
  14. <p class="nickName">{{ nickName }}</p>
  15. <p>
  16. <span class="postName">{{ postName }}</span>
  17. </p>
  18. </div>
  19. </van-col>
  20. </van-row>
  21. </div>
  22. <!-- 主体内容-->
  23. <div class="container">
  24. <!-- 门店及拜访-->
  25. <van-cell-group inset class="mtb10">
  26. <van-cell :title="addBTN" is-link @click="onSelect('B')" v-if="addShow">
  27. <template #icon>
  28. <van-icon :name="addShop" class="zicon" />
  29. </template>
  30. </van-cell>
  31. <van-cell title="新增专卖店/金牌店" is-link @click="onSelect('A')" v-if="addShow1">
  32. <template #icon>
  33. <van-icon :name="addShop" class="zicon" />
  34. </template>
  35. </van-cell>
  36. <van-cell :title="title" is-link to="/storemanagementlist">
  37. <template #icon>
  38. <van-icon :name="storeselect" class="zicon" />
  39. </template>
  40. </van-cell>
  41. <van-cell title="历史拜访" is-link to="/historAllVisit">
  42. <template #icon>
  43. <van-icon :name="history" class="zicon" />
  44. </template>
  45. </van-cell>
  46. </van-cell-group>
  47. <van-cell-group inset class="mtb10">
  48. <van-cell title="设置" is-link to="/systemSettings">
  49. <template #icon>
  50. <van-icon name="setting-o" class="zicon" color="#0158ba" />
  51. </template>
  52. </van-cell>
  53. </van-cell-group>
  54. <!-- 客资类-->
  55. <van-cell-group inset class="mtb10">
  56. <van-cell title="客资&投诉任务" to="/clew" v-if="customerClueButton">
  57. <template #icon>
  58. <van-icon :name="history" class="zicon" />
  59. </template>
  60. <template #title>
  61. <span>客资&投诉任务</span>
  62. &nbsp;<van-tag type="danger" v-if="customerClueNum > 0">{{
  63. customerClueNum
  64. }}</van-tag>
  65. </template>
  66. <template #right-icon>
  67. <van-icon name="arrow" size="16" />
  68. </template>
  69. </van-cell>
  70. <van-cell title="待分配客资" to="/assignAwait" v-if="isAssignFlag">
  71. <template #icon>
  72. <van-icon :name="history" class="zicon" />
  73. </template>
  74. <template #title>
  75. <span>待分配客资</span>
  76. &nbsp;<van-tag type="danger" v-if="notAllocationNum > 0">{{
  77. notAllocationNum
  78. }}</van-tag>
  79. </template>
  80. <template #right-icon>
  81. <van-icon name="arrow" size="16" />
  82. </template>
  83. </van-cell> </van-cell-group
  84. ><!--拜访照片识别异常反馈 部主管及以上-->
  85. <van-cell-group inset class="mtb10">
  86. <van-cell title="拜访照片识别异常反馈" to="/AIImage">
  87. <template #icon>
  88. <van-icon :name="history" class="zicon" />
  89. </template>
  90. <template #title>
  91. <span>拜访照片识别异常反馈</span>
  92. <span
  93. style="font-weight: 600; font-size: 16px; color: red; margin-left: 15px"
  94. v-if="photoApprovalNum"
  95. >({{ photoApprovalNum }})</span
  96. >
  97. </template>
  98. <template #right-icon>
  99. <van-icon name="arrow" size="16" />
  100. </template>
  101. </van-cell>
  102. </van-cell-group>
  103. <!-- 汇报类-->
  104. <van-cell-group inset class="mtb10">
  105. <van-cell
  106. title="我的历史汇报"
  107. v-if="historyButton"
  108. is-link
  109. to="/myHistoricalDaily"
  110. class="MYTile">
  111. <template #title>
  112. <span class="custom-title">我的历史汇报&nbsp;&nbsp;</span>
  113. </template>
  114. <template #icon>
  115. <van-icon :name="daily" class="zicon" />
  116. </template>
  117. <template #right-icon>
  118. <van-tag type="danger" v-if="existReject">退回待处理</van-tag>
  119. <van-icon name="arrow" />
  120. </template>
  121. </van-cell>
  122. <van-cell v-if="showDaily || isDiy == 'true'" is-link to="/subordinateHistoricalDaily">
  123. 下属业务员历史日报
  124. <span
  125. style="font-weight: 600; font-size: 16px; color: red; margin-left: 15px"
  126. v-if="thisWeekRemarkNum != null"
  127. >{{ thisWeekRemarkNum }}/5</span
  128. >
  129. <template #icon>
  130. <van-icon :name="daily" class="zicon" />
  131. </template>
  132. </van-cell>
  133. <van-cell
  134. title="下属部主管历史周报"
  135. v-if="showWeekly || isDiy == 'true'"
  136. is-link
  137. to="/subordinateHistoricalWeekly">
  138. <template #icon>
  139. <van-icon :name="daily" class="zicon" />
  140. </template>
  141. </van-cell>
  142. <van-cell
  143. title="下属大区主管历史半月报"
  144. v-if="showDouble || isDiy == 'true'"
  145. is-link
  146. to="/doubleWeeklyHistorical">
  147. <template #icon>
  148. <van-icon :name="daily" class="zicon" />
  149. </template>
  150. </van-cell>
  151. <van-cell
  152. title="下属汇报率审批率统计"
  153. v-if="showDaily || showWeekly || showDouble || isDiy == 'true'"
  154. is-link
  155. to="/reportingRate">
  156. <template #icon>
  157. <van-icon :name="daily" class="zicon" />
  158. </template>
  159. </van-cell>
  160. </van-cell-group>
  161. <!-- 物料类-->
  162. <van-cell-group inset class="mtb10">
  163. <van-cell title="我的物料库存" is-link to="/myInventory" class="MYTile">
  164. <template #title>
  165. <span class="custom-title">我的物料库存&nbsp;&nbsp;</span>
  166. </template>
  167. <template #icon>
  168. <van-icon :name="daily" class="zicon" />
  169. </template>
  170. </van-cell>
  171. </van-cell-group>
  172. <!-- <p style="margin: -8px 16px 8px;color: #888;" v-if="list">主管任务</p>-->
  173. <van-cell-group inset>
  174. <div style="border-radius: 6px; overflow: hidden">
  175. <van-cell
  176. is-link
  177. v-for="(item, index) in list"
  178. :key="index"
  179. :to="
  180. '/VisitSummaryAdd?summaryId=' + item.summaryId + '&title=' + item.summaryTaskName
  181. ">
  182. <template #title>
  183. <span class="custom-title">{{ item.summaryTaskName }}</span>
  184. </template>
  185. <template #icon>
  186. <van-icon :name="daily" class="zicon" />
  187. </template>
  188. </van-cell>
  189. <van-cell title="主管任务查询" is-link to="/VisitSummary" v-if="summaryTaskButton">
  190. <template #icon>
  191. <van-icon :name="history" class="zicon" />
  192. </template>
  193. <template #title>
  194. <span>主管任务查询</span>
  195. <span
  196. style="font-weight: 600; font-size: 16px; color: red; margin-left: 15px"
  197. v-if="summaryApprovalFeedbackNum"
  198. >({{ summaryApprovalFeedbackNum }})</span
  199. >
  200. </template>
  201. </van-cell>
  202. <van-cell
  203. title="主管任务审批"
  204. is-link
  205. to="/SUPTaskApproval"
  206. v-if="summaryApprovalButton">
  207. <template #icon>
  208. <van-icon :name="history" class="zicon" />
  209. </template>
  210. <template #title>
  211. <span>主管任务审批</span>
  212. <span
  213. style="font-weight: 600; font-size: 16px; color: red; margin-left: 15px"
  214. v-if="summaryPendingApprovalNum"
  215. >({{ summaryPendingApprovalNum }})</span
  216. >
  217. </template>
  218. </van-cell>
  219. <van-cell
  220. title="家装推广会历史提报查询"
  221. is-link
  222. to="/VisitSummaryMy"
  223. v-if="jzTaskButton">
  224. <template #icon>
  225. <van-icon :name="history" class="zicon" />
  226. </template>
  227. <template #title>
  228. <span>家装推广会历史提报查询</span>
  229. <span
  230. style="font-weight: 600; font-size: 16px; color: red; margin-left: 15px"
  231. v-if="summaryApprovalFeedbackNum"
  232. >({{ summaryApprovalFeedbackNum }})</span
  233. >
  234. </template>
  235. </van-cell>
  236. </div>
  237. </van-cell-group>
  238. </div>
  239. </div>
  240. <tab-bar tabBarActive="MyList"></tab-bar>
  241. </div>
  242. </template>
  243. <script>
  244. import history from '@/assets/Icon/history.png';
  245. import addShop from '@/assets/Icon/addShop.png';
  246. import avatar from '@/assets/avatar2.png';
  247. import doubleWeekly from '@/assets/doubleWeekly.png';
  248. import daily from '@/assets/daily.png';
  249. import Weekly from '@/assets/Weekly.png';
  250. import storeselect from '@/assets/Icon/storeselect.png';
  251. import tabBar from '@/components/tabBar';
  252. import { getReportInfo, getstoreCoverPosition } from '@/api/index';
  253. import { selectAllocationPermission } from '@/api/week';
  254. export default {
  255. name: 'MyList',
  256. components: { tabBar },
  257. data() {
  258. return {
  259. history: history,
  260. avatar: avatar,
  261. addShow: false,
  262. doubleWeekly: doubleWeekly,
  263. Weekly: Weekly,
  264. daily: daily,
  265. storeselect: storeselect,
  266. addShop: addShop,
  267. powerGrade: '1',
  268. num: 0,
  269. nickName: '',
  270. postName: '',
  271. showDaily: false,
  272. showWeekly: false,
  273. showDouble: false,
  274. existReject: false,
  275. isDiy: false,
  276. historyButton: false,
  277. deptLevel: 0,
  278. list: [],
  279. addBTN: '新建工地',
  280. title: '我的客户',
  281. addShow1: false,
  282. result: '',
  283. jzTaskButton: false,
  284. summaryTaskButton: false,
  285. customerClueButton: false,
  286. customerClueNum: 0,
  287. thisWeekRemarkNum: null,
  288. notAllocationNum: 0, //待分配客资数量
  289. isAssignFlag: false,
  290. photoApprovalNum: 0,
  291. summaryApprovalButton: false,
  292. summaryPendingApprovalNum: 0,
  293. summaryApprovalFeedbackNum: 0,
  294. };
  295. },
  296. watch: {
  297. $route(to, from) {
  298. this.num = 0;
  299. if (to.path == '/My/index') {
  300. this.nickName = localStorage.getItem('nickName');
  301. this.postName = localStorage.getItem('postName');
  302. this.powerGrade = localStorage.getItem('powerGrade');
  303. this.isDiy = localStorage.getItem('isDiy');
  304. this.getstoreCoverPosition();
  305. this.getReportInfo();
  306. }
  307. },
  308. },
  309. created() {
  310. this.powerGrade = localStorage.getItem('powerGrade');
  311. this.postName = localStorage.getItem('postName');
  312. this.isDiy = localStorage.getItem('isDiy');
  313. this.nickName = localStorage.getItem('nickName');
  314. this.getstoreCoverPosition();
  315. this.getReportInfo();
  316. },
  317. methods: {
  318. getstoreCoverPosition() {
  319. getstoreCoverPosition({}).then((res) => {
  320. var postName = localStorage.getItem('postName');
  321. var postType = localStorage.getItem('postType');
  322. if (postType == 'DIY') {
  323. this.addBTN = '新建同城分销店';
  324. this.title = '我的客户';
  325. this.addShow1 = true;
  326. } else if (postType == 'JZ') {
  327. this.addBTN = '新建家装店';
  328. this.addShow1 = true;
  329. this.title = '我的客户';
  330. } else if (postType == 'GZ') {
  331. this.addBTN = '新建工地/潜在客户/公装客户仓库';
  332. this.addShow1 = false;
  333. this.title = '我的客户';
  334. }
  335. postName = postName.split(',');
  336. for (let i = 0; i < res.data.length; i++) {
  337. for (let j = 0; j < postName.length; j++) {
  338. if (res.data[i].dictLabel == postName[j]) {
  339. this.addShow = true;
  340. return false;
  341. }
  342. }
  343. }
  344. });
  345. },
  346. dailyFn(row) {
  347. this.$router.push({
  348. path: '/VisitSummaryAdd',
  349. query: { summaryId: row.summaryId, title: row.summaryTaskName },
  350. });
  351. },
  352. getReportInfo() {
  353. this.deptLevel = localStorage.getItem('deptLevel');
  354. let loading1 = this.$toast.loading({
  355. duration: 0,
  356. message: '加载中...',
  357. forbidClick: true,
  358. });
  359. // 如果有客资分配权限,获取待分配客资数量
  360. this.getSelectAllocationPermission();
  361. getReportInfo({ isContent: false }).then((res) => {
  362. loading1.clear();
  363. this.list = res.data.summaryTasks;
  364. this.historyButton = res.data.historyButton;
  365. localStorage.setItem('powerGrade', res.data.positionId);
  366. localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
  367. this.existReject = res.data.existReject;
  368. this.powerGrade = res.data.positionId;
  369. this.showButton = res.data.showButton;
  370. this.deptLevel = res.data.deptLevel;
  371. this.reportTargetAll = res.data.reportTargetAll;
  372. this.jzTaskButton = res.data.jzTaskButton;
  373. this.summaryTaskButton = res.data.summaryTaskButton;
  374. this.summaryApprovalButton = res.data.summaryApprovalButton;
  375. this.customerClueButton = res.data.customerClueButton;
  376. this.customerClueNum = res.data.customerClueNum;
  377. this.updataTime = res.data.reportTargetAll.updateTime;
  378. this.thisWeekRemarkNum = res.data.thisWeekRemarkNum; //查询本周点评的数量,null不需要展示
  379. this.photoApprovalNum = res.data.photoApprovalNum; //首页照片异常待反馈数量
  380. this.summaryPendingApprovalNum = res.data.summaryPendingApprovalNum;
  381. this.summaryApprovalFeedbackNum = res.data.summaryApprovalFeedbackNum;
  382. if (res.data.deptLevel === 0) {
  383. this.showDaily = false;
  384. this.showWeekly = false;
  385. this.showDouble = false;
  386. }
  387. if (res.data.deptLevel === 1) {
  388. this.showDaily = true;
  389. this.showWeekly = false;
  390. this.showDouble = false;
  391. }
  392. if (res.data.deptLevel === 2) {
  393. this.showDaily = true;
  394. this.showWeekly = true;
  395. this.showDouble = false;
  396. }
  397. if (res.data.deptLevel === 3) {
  398. this.showDaily = true;
  399. this.showWeekly = true;
  400. this.showDouble = true;
  401. }
  402. });
  403. },
  404. getSelectAllocationPermission() {
  405. selectAllocationPermission()
  406. .then((res) => {
  407. this.isAssignFlag = res.data.isAllocationPermission;
  408. this.notAllocationNum = res.data.notAllocationNum;
  409. })
  410. .catch((error) => {
  411. console.log(error);
  412. });
  413. },
  414. login() {
  415. if (this.num > 10) {
  416. this.$router.push('/login');
  417. } else {
  418. this.num = this.num + 1;
  419. }
  420. },
  421. onSelect(action) {
  422. if (action == 'B') {
  423. this.$router.push('/storeAdd');
  424. } else {
  425. window.location.href =
  426. 'https://weboa.nipponpaint.com.cn/4825836600585B0C/68488309EEFAC9044825805F0059C65B/_fi12rtp156lortal9ue32ww78_r_t4r5rr_09tu0qq19k09_npchina_sfs2g_?open&portalunid=AFECD3A3682ED7494825886F00242F0C&mainid=63C98CD1C79B608C4825886F0007F001';
  427. }
  428. },
  429. },
  430. };
  431. </script>
  432. <style scoped lang="scss">
  433. .userPage {
  434. height: 100%;
  435. width: 100%;
  436. display: flex;
  437. flex-direction: column;
  438. overflow: hidden;
  439. .content {
  440. flex: 1;
  441. margin-top: 46px;
  442. overflow-y: auto;
  443. }
  444. .tabBar {
  445. height: 50px;
  446. }
  447. }
  448. .myHeader {
  449. background-color: #1c84c6;
  450. padding: 24px 30px;
  451. background: url('../../assets/bg.png');
  452. background-size: cover;
  453. }
  454. .mtb10 {
  455. margin: 10px 16px;
  456. }
  457. .container {
  458. margin: 16px 0;
  459. }
  460. .zicon {
  461. margin-top: 4px;
  462. padding-right: 8px;
  463. }
  464. .avatarContent {
  465. padding: 10px 0;
  466. }
  467. .avatarContent .nickName {
  468. color: white;
  469. font-size: 14px;
  470. margin-top: 0;
  471. }
  472. .avatarContent .postName {
  473. display: inline-block;
  474. padding: 4px 6px;
  475. background-color: white;
  476. border-radius: 4px;
  477. color: #1c84c6;
  478. font-size: 12px;
  479. }
  480. .MYTile .van-tag--danger {
  481. border-radius: 20px;
  482. padding: 0 6px;
  483. }
  484. .MYTile .van-icon-arrow {
  485. font-size: 16px;
  486. line-height: 24px;
  487. color: #969799;
  488. margin-left: 6px;
  489. }
  490. </style>