bottomBtn.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <div class="bottomBtn">
  3. <div style="color: #999; font-size: 12px; margin: 0 10px">
  4. <!-- 昨日新增的数据统一在上午9点更新.-->
  5. <span v-if="reportInfoData.newUser">
  6. <van-icon name="info-o" />
  7. &nbsp;新人入职后5个工作日不用提交日报.
  8. </span>
  9. </div>
  10. <div class="lineGrey"></div>
  11. <div v-if="approvalButton" class="contentborder">
  12. <van-cell class="homeTitle" title="汇报审批" to="/dailyApprovalList">
  13. <template #title>
  14. <span class="custom-title">汇报审批&nbsp;&nbsp;</span>
  15. <van-tag v-if="approvalPendingNum > 0" type="danger">{{ approvalPendingNum }}</van-tag>
  16. </template>
  17. <template #right-icon>
  18. <van-icon class="homeCellIcon" name="arrow" size="16" />
  19. </template>
  20. </van-cell>
  21. <div class="lineGrey"></div>
  22. </div>
  23. <!-- <div class="contentborder" v-if="todayGoal.storeAddressCheckNum>0">
  24. <van-cell class="homeTitle" title="待规范门店地址" to="/storeAddress">
  25. <template #title><span class="custom-title">待规范门店地址</span>&nbsp<van-tag type="danger">{{ todayGoal.storeAddressCheckNum }}</van-tag></template>
  26. <template #right-icon><van-icon class="homeCellIcon" name="arrow" size="16"/></template>
  27. </van-cell>
  28. <div class="lineGrey"></div>
  29. </div> -->
  30. <div class="contentborder">
  31. <van-cell class="homeTitle" title="流程审批" to="/signApprovalList">
  32. <template #title>
  33. <span class="custom-title">流程审批</span>&nbsp
  34. <van-tag v-if="proccessPendingNum > 0" type="danger">{{ proccessPendingNum }}</van-tag>
  35. </template>
  36. <template #right-icon><van-icon class="homeCellIcon" name="arrow" size="16" /></template>
  37. </van-cell>
  38. <div class="lineGrey"></div>
  39. </div>
  40. <!-- 同城店建店审批 -->
  41. <div
  42. class="contentborder"
  43. v-if="reportInfoData.storeApprovalNum != null && reportInfoData.storeApprovalNum > 0">
  44. <van-cell class="homeTitle" title="同城店建店审批" to="/newStoreApprovalList">
  45. <template #title>
  46. <span class="custom-title">同城店建店审批&nbsp;&nbsp;</span>
  47. <van-tag type="danger">{{ reportInfoData.storeApprovalNum }}</van-tag>
  48. </template>
  49. <template #right-icon>
  50. <van-icon class="homeCellIcon" name="arrow" size="16" />
  51. </template>
  52. </van-cell>
  53. <div class="lineGrey"></div>
  54. </div>
  55. <div class="contentborder">
  56. <van-button
  57. v-if="reportType == 3 && showButton"
  58. class="Btn1"
  59. plain
  60. size="small"
  61. type="info"
  62. @click="doubleWeeklyLink"
  63. >填写半月报</van-button
  64. >
  65. <van-button
  66. v-if="reportType == 2 && showButton"
  67. class="Btn1"
  68. plain
  69. size="small"
  70. type="info"
  71. @click="weeklyLink"
  72. >填写周报</van-button
  73. >
  74. <van-button
  75. v-if="reportType == 1 && showButton"
  76. class="Btn1"
  77. plain
  78. size="small"
  79. type="info"
  80. @click="dailyLink"
  81. >填写日报</van-button
  82. >
  83. <van-button
  84. v-if="reportType < 4 && isCommit"
  85. class="Btn1"
  86. plain
  87. size="small"
  88. type="info"
  89. @click="dailyLinks"
  90. >查看我的历史汇报</van-button
  91. >
  92. </div>
  93. <!-- <p class="updataTime" v-if="type != 4 && tabVal != '-1'">更新时间:{{ updataTime }}</p> -->
  94. <div class="ownerBirthdayReminds" v-if="ownerBirthdayBoxFlag && ownerBirthdayReminds">
  95. <div class="ownerBirthdayBox">
  96. <div class="title"><img :src="require('@/assets/hua.png')" />金牌店生日提醒</div>
  97. <div class="content">{{ this.ownerBirthdayReminds }},将在3日后生日,请及时送上生日祝福!</div>
  98. <img class="dangao" :src="require('@/assets/dangao.png')" />
  99. </div>
  100. <div class="close" @click="ownerBirthdayBoxFlag = false">
  101. <img :src="require('@/assets/close.png')" />
  102. </div>
  103. </div>
  104. </div>
  105. </template>
  106. <script>
  107. import { getReportInfo } from '@/api/index';
  108. import { mapState } from 'vuex';
  109. export default {
  110. computed: {
  111. ...mapState({
  112. reportInfo: (state) => state.user.reportInfo,
  113. }),
  114. },
  115. props: {
  116. tabVal: {
  117. type: [String, Number],
  118. default: '-1',
  119. },
  120. },
  121. data() {
  122. return {
  123. reportInfoData: {},
  124. approvalButton: false,
  125. JZQuota: false,
  126. GZdata: false,
  127. approvalPendingNum: 0,
  128. proccessPendingNum: 0,
  129. powerGrade: '2',
  130. showButton: false,
  131. isCommit: null,
  132. updataTime: '',
  133. type: '-1',
  134. ownerBirthdayBoxFlag: false,
  135. ownerBirthdayReminds: null,
  136. reportType: null,
  137. };
  138. },
  139. watch: {
  140. reportInfo: {
  141. handler(val) {
  142. if (val) {
  143. this.getReportInfo();
  144. }
  145. },
  146. immediate: true,
  147. },
  148. },
  149. activated() {
  150. // this.getReportInfo();
  151. },
  152. methods: {
  153. getReportInfo() {
  154. if (this.reportInfo) {
  155. let reportInfo = this.reportInfo;
  156. if (reportInfo.postType == 'GZ') {
  157. this.GZdata = true;
  158. } else {
  159. this.GZdata = false;
  160. }
  161. this.proccessPendingNum = reportInfo.proccessPendingNum;
  162. this.reportInfoData = reportInfo;
  163. this.approvalButton = reportInfo.approvalButton;
  164. this.powerGrade = reportInfo.positionId;
  165. this.showButton = reportInfo.showButton;
  166. this.reportType = reportInfo.reportType;
  167. if (reportInfo.reportTargetAll != null) {
  168. this.updataTime = reportInfo.reportTargetAll.updateTime;
  169. }
  170. this.approvalPendingNum = reportInfo.approvalPendingNum;
  171. this.type = reportInfo.userType;
  172. // 金牌店老板生日提醒
  173. if (reportInfo.ownerBirthdayReminds && reportInfo.ownerBirthdayReminds.length) {
  174. this.ownerBirthdayBoxFlag = true;
  175. this.ownerBirthdayReminds = reportInfo.ownerBirthdayReminds.join(',');
  176. }
  177. }
  178. return;
  179. getReportInfo({ isContent: false }).then((res) => {
  180. if (res.code == 200) {
  181. if (res.data.postType == 'GZ') {
  182. this.GZdata = true;
  183. } else {
  184. this.GZdata = false;
  185. }
  186. if (res.data.postType == 'JZ') {
  187. this.JZQuota = true;
  188. } else {
  189. this.JZQuota = false;
  190. }
  191. localStorage.setItem('powerGrade', res.data.positionId);
  192. localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
  193. localStorage.setItem('isDiy', res.data.diy);
  194. localStorage.setItem('uType', res.data.userType);
  195. localStorage.setItem('jzType', res.data.jzType);
  196. localStorage.setItem('customerVisits', res.data.customerManagerVisits);
  197. localStorage.setItem('postType', res.data.postType);
  198. localStorage.setItem('reportType', res.data.reportType);
  199. this.proccessPendingNum = res.data.proccessPendingNum;
  200. this.reportInfoData = res.data;
  201. this.approvalButton = res.data.approvalButton;
  202. this.powerGrade = res.data.positionId;
  203. this.showButton = res.data.showButton;
  204. this.reportType = res.data.reportType;
  205. if (res.data.reportTargetAll != null) {
  206. this.updataTime = res.data.reportTargetAll.updateTime;
  207. }
  208. this.approvalPendingNum = res.data.approvalPendingNum;
  209. this.type = res.data.userType;
  210. // 金牌店老板生日提醒
  211. if (res.data.ownerBirthdayReminds && res.data.ownerBirthdayReminds.length) {
  212. this.ownerBirthdayBoxFlag = true;
  213. this.ownerBirthdayReminds = res.data.ownerBirthdayReminds.join(',');
  214. }
  215. } else {
  216. this.$toast(res.msg);
  217. }
  218. callback && callback();
  219. });
  220. },
  221. dailyLink() {
  222. if (!this.isAllow()) return;
  223. this.$router.push('/daily');
  224. },
  225. weeklyLink() {
  226. if (!this.isAllow()) return;
  227. this.$router.push('/weekly');
  228. },
  229. doubleWeeklyLink() {
  230. if (!this.isAllow()) return;
  231. this.$router.push('/doubleWeekly');
  232. },
  233. dailyLinks() {
  234. if (!this.isAllow()) return;
  235. this.$router.push('/myHistoricalDaily');
  236. },
  237. // 是否允许填写汇报
  238. isAllow() {
  239. let reportRemark = this.reportInfoData.reportRemark;
  240. if (reportRemark) {
  241. this.$dialog
  242. .alert({
  243. message: reportRemark,
  244. })
  245. .then(() => {});
  246. return false;
  247. } else {
  248. return true;
  249. }
  250. },
  251. },
  252. };
  253. </script>
  254. <style scoped lang="scss">
  255. .bottomBtn {
  256. .ownerBirthdayReminds {
  257. width: 100%;
  258. height: 100%;
  259. position: fixed;
  260. top: 0;
  261. z-index: 999999;
  262. background: rgba(0, 0, 0, 0.5);
  263. display: flex;
  264. align-items: center;
  265. justify-content: center;
  266. flex-direction: column;
  267. .ownerBirthdayBox {
  268. width: 90%;
  269. // height: 369px;
  270. background: url('../../assets/ownerBirthdayBG.png') no-repeat center center;
  271. background-size: 100% 100%;
  272. display: flex;
  273. flex-direction: column;
  274. align-items: center;
  275. .title {
  276. text-align: center;
  277. font-size: 20px;
  278. color: #99443b;
  279. font-weight: bold;
  280. display: flex;
  281. align-items: flex-end;
  282. padding-top: 40px;
  283. position: relative;
  284. img {
  285. width: 35px;
  286. height: 35px;
  287. position: absolute;
  288. left: -55px;
  289. }
  290. }
  291. .content {
  292. width: 80%;
  293. line-height: 30px;
  294. font-size: 16px;
  295. color: #555555;
  296. text-align: center;
  297. margin-top: 20px;
  298. }
  299. .dangao {
  300. width: 80%;
  301. height: 160px;
  302. margin-top: 20px;
  303. margin-bottom: 35px;
  304. }
  305. }
  306. .close {
  307. img {
  308. width: 35px;
  309. height: 35px;
  310. margin-top: 20px;
  311. }
  312. }
  313. }
  314. }
  315. </style>