index.vue 17 KB

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