index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  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. </van-cell>
  228. </div>
  229. </van-cell-group>
  230. </div>
  231. </div>
  232. <tab-bar tabBarActive="MyList"></tab-bar>
  233. </div>
  234. </template>
  235. <script>
  236. import history from '@/assets/Icon/history.png';
  237. import addShop from '@/assets/Icon/addShop.png';
  238. import avatar from '@/assets/avatar2.png';
  239. import doubleWeekly from '@/assets/doubleWeekly.png';
  240. import daily from '@/assets/daily.png';
  241. import Weekly from '@/assets/Weekly.png';
  242. import storeselect from '@/assets/Icon/storeselect.png';
  243. import tabBar from '@/components/tabBar';
  244. import { getReportInfo, getstoreCoverPosition } from '@/api/index';
  245. import { selectAllocationPermission } from '@/api/week';
  246. export default {
  247. name: 'MyList',
  248. components: { tabBar },
  249. data() {
  250. return {
  251. history: history,
  252. avatar: avatar,
  253. addShow: false,
  254. doubleWeekly: doubleWeekly,
  255. Weekly: Weekly,
  256. daily: daily,
  257. storeselect: storeselect,
  258. addShop: addShop,
  259. powerGrade: '1',
  260. num: 0,
  261. nickName: '',
  262. postName: '',
  263. showDaily: false,
  264. showWeekly: false,
  265. showDouble: false,
  266. existReject: false,
  267. isDiy: false,
  268. historyButton: false,
  269. deptLevel: 0,
  270. list: [],
  271. addBTN: '新建工地',
  272. title: '我的客户',
  273. addShow1: false,
  274. result: '',
  275. jzTaskButton: false,
  276. summaryTaskButton: false,
  277. customerClueButton: false,
  278. customerClueNum: 0,
  279. thisWeekRemarkNum: null,
  280. notAllocationNum: 0, //待分配客资数量
  281. isAssignFlag: false,
  282. photoApprovalNum: 0,
  283. summaryApprovalButton: false,
  284. summaryPendingApprovalNum: 0,
  285. summaryApprovalFeedbackNum: 0,
  286. };
  287. },
  288. watch: {
  289. $route(to, from) {
  290. this.num = 0;
  291. if (to.path == '/My/index') {
  292. this.nickName = localStorage.getItem('nickName');
  293. this.postName = localStorage.getItem('postName');
  294. this.powerGrade = localStorage.getItem('powerGrade');
  295. this.isDiy = localStorage.getItem('isDiy');
  296. this.getstoreCoverPosition();
  297. this.getReportInfo();
  298. }
  299. },
  300. },
  301. created() {
  302. this.powerGrade = localStorage.getItem('powerGrade');
  303. this.postName = localStorage.getItem('postName');
  304. this.isDiy = localStorage.getItem('isDiy');
  305. this.nickName = localStorage.getItem('nickName');
  306. this.getstoreCoverPosition();
  307. this.getReportInfo();
  308. },
  309. methods: {
  310. getstoreCoverPosition() {
  311. getstoreCoverPosition({}).then((res) => {
  312. var postName = localStorage.getItem('postName');
  313. var postType = localStorage.getItem('postType');
  314. if (postType == 'DIY') {
  315. this.addBTN = '新建同城分销店';
  316. this.title = '我的客户';
  317. this.addShow1 = true;
  318. } else if (postType == 'JZ') {
  319. this.addBTN = '新建家装店';
  320. this.addShow1 = true;
  321. this.title = '我的客户';
  322. } else if (postType == 'GZ') {
  323. this.addBTN = '新建工地/潜在客户/公装客户仓库';
  324. this.addShow1 = false;
  325. this.title = '我的客户';
  326. }
  327. postName = postName.split(',');
  328. for (let i = 0; i < res.data.length; i++) {
  329. for (let j = 0; j < postName.length; j++) {
  330. if (res.data[i].dictLabel == postName[j]) {
  331. this.addShow = true;
  332. return false;
  333. }
  334. }
  335. }
  336. });
  337. },
  338. dailyFn(row) {
  339. this.$router.push({
  340. path: '/VisitSummaryAdd',
  341. query: { summaryId: row.summaryId, title: row.summaryTaskName },
  342. });
  343. },
  344. getReportInfo() {
  345. this.deptLevel = localStorage.getItem('deptLevel');
  346. let loading1 = this.$toast.loading({
  347. duration: 0,
  348. message: '加载中...',
  349. forbidClick: true,
  350. });
  351. // 如果有客资分配权限,获取待分配客资数量
  352. this.getSelectAllocationPermission();
  353. getReportInfo({ isContent: false }).then((res) => {
  354. loading1.clear();
  355. this.list = res.data.summaryTasks;
  356. this.historyButton = res.data.historyButton;
  357. localStorage.setItem('powerGrade', res.data.positionId);
  358. localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
  359. this.existReject = res.data.existReject;
  360. this.powerGrade = res.data.positionId;
  361. this.showButton = res.data.showButton;
  362. this.deptLevel = res.data.deptLevel;
  363. this.reportTargetAll = res.data.reportTargetAll;
  364. this.jzTaskButton = res.data.jzTaskButton;
  365. this.summaryTaskButton = res.data.summaryTaskButton;
  366. this.summaryApprovalButton = res.data.summaryApprovalButton;
  367. this.customerClueButton = res.data.customerClueButton;
  368. this.customerClueNum = res.data.customerClueNum;
  369. this.updataTime = res.data.reportTargetAll.updateTime;
  370. this.thisWeekRemarkNum = res.data.thisWeekRemarkNum; //查询本周点评的数量,null不需要展示
  371. this.photoApprovalNum = res.data.photoApprovalNum; //首页照片异常待反馈数量
  372. this.summaryPendingApprovalNum = res.data.summaryPendingApprovalNum;
  373. this.summaryApprovalFeedbackNum = res.data.summaryApprovalFeedbackNum;
  374. if (res.data.deptLevel === 0) {
  375. this.showDaily = false;
  376. this.showWeekly = false;
  377. this.showDouble = false;
  378. }
  379. if (res.data.deptLevel === 1) {
  380. this.showDaily = true;
  381. this.showWeekly = false;
  382. this.showDouble = false;
  383. }
  384. if (res.data.deptLevel === 2) {
  385. this.showDaily = true;
  386. this.showWeekly = true;
  387. this.showDouble = false;
  388. }
  389. if (res.data.deptLevel === 3) {
  390. this.showDaily = true;
  391. this.showWeekly = true;
  392. this.showDouble = true;
  393. }
  394. });
  395. },
  396. getSelectAllocationPermission() {
  397. selectAllocationPermission()
  398. .then((res) => {
  399. this.isAssignFlag = res.data.isAllocationPermission;
  400. this.notAllocationNum = res.data.notAllocationNum;
  401. })
  402. .catch((error) => {
  403. console.log(error);
  404. });
  405. },
  406. login() {
  407. if (this.num > 10) {
  408. this.$router.push('/login');
  409. } else {
  410. this.num = this.num + 1;
  411. }
  412. },
  413. onSelect(action) {
  414. if (action == 'B') {
  415. this.$router.push('/storeAdd');
  416. } else {
  417. window.location.href =
  418. 'https://weboa.nipponpaint.com.cn/4825836600585B0C/68488309EEFAC9044825805F0059C65B/_fi12rtp156lortal9ue32ww78_r_t4r5rr_09tu0qq19k09_npchina_sfs2g_?open&portalunid=AFECD3A3682ED7494825886F00242F0C&mainid=63C98CD1C79B608C4825886F0007F001';
  419. }
  420. },
  421. },
  422. };
  423. </script>
  424. <style scoped lang="scss">
  425. .userPage {
  426. height: 100%;
  427. width: 100%;
  428. display: flex;
  429. flex-direction: column;
  430. overflow: hidden;
  431. .content {
  432. flex: 1;
  433. margin-top: 46px;
  434. overflow-y: auto;
  435. }
  436. .tabBar {
  437. height: 50px;
  438. }
  439. }
  440. .myHeader {
  441. background-color: #1c84c6;
  442. padding: 24px 30px;
  443. background: url('../../assets/bg.png');
  444. background-size: cover;
  445. }
  446. .mtb10 {
  447. margin: 10px 16px;
  448. }
  449. .container {
  450. margin: 16px 0;
  451. }
  452. .zicon {
  453. margin-top: 4px;
  454. padding-right: 8px;
  455. }
  456. .avatarContent {
  457. padding: 10px 0;
  458. }
  459. .avatarContent .nickName {
  460. color: white;
  461. font-size: 14px;
  462. margin-top: 0;
  463. }
  464. .avatarContent .postName {
  465. display: inline-block;
  466. padding: 4px 6px;
  467. background-color: white;
  468. border-radius: 4px;
  469. color: #1c84c6;
  470. font-size: 12px;
  471. }
  472. .MYTile .van-tag--danger {
  473. border-radius: 20px;
  474. padding: 0 6px;
  475. }
  476. .MYTile .van-icon-arrow {
  477. font-size: 16px;
  478. line-height: 24px;
  479. color: #969799;
  480. margin-left: 6px;
  481. }
  482. </style>