index.vue 17 KB

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