index.vue 17 KB

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