index.vue 17 KB

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