bottomBtn.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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" />&nbsp;新人入职后5个工作日不用提交日报.</span
  7. >
  8. </div>
  9. <div class="lineGrey"></div>
  10. <div v-if="approvalButton && !GZdata" class="contentborder">
  11. <van-cell class="homeTitle" title="汇报审批" to="/dailyApprovalList">
  12. <template #title>
  13. <span class="custom-title">汇报审批&nbsp;&nbsp;</span>
  14. <van-tag v-if="approvalPendingNum > 0" type="danger">{{ approvalPendingNum }}</van-tag>
  15. </template>
  16. <template #right-icon>
  17. <van-icon class="homeCellIcon" name="arrow" size="16" />
  18. </template>
  19. </van-cell>
  20. <div class="lineGrey"></div>
  21. </div>
  22. <!-- <div class="contentborder" v-if="todayGoal.storeAddressCheckNum>0">
  23. <van-cell class="homeTitle" title="待规范门店地址" to="/storeAddress">
  24. <template #title><span class="custom-title">待规范门店地址</span>&nbsp<van-tag type="danger">{{ todayGoal.storeAddressCheckNum }}</van-tag></template>
  25. <template #right-icon><van-icon class="homeCellIcon" name="arrow" size="16"/></template>
  26. </van-cell>
  27. <div class="lineGrey"></div>
  28. </div> -->
  29. <div class="contentborder">
  30. <van-cell class="homeTitle" title="流程审批" to="/signApprovalList">
  31. <template #title
  32. ><span class="custom-title">流程审批</span>&nbsp<van-tag
  33. v-if="proccessPendingNum > 0"
  34. type="danger"
  35. >{{ proccessPendingNum }}</van-tag
  36. ></template
  37. >
  38. <template #right-icon><van-icon class="homeCellIcon" name="arrow" size="16" /></template>
  39. </van-cell>
  40. <div class="lineGrey"></div>
  41. </div>
  42. <!-- 同城店建店审批 -->
  43. <div
  44. class="contentborder"
  45. v-if="reportInfoData.storeApprovalNum != null && reportInfoData.storeApprovalNum > 0">
  46. <van-cell class="homeTitle" title="同城店建店审批" to="/newStoreApprovalList">
  47. <template #title>
  48. <span class="custom-title">同城店建店审批&nbsp;&nbsp;</span>
  49. <van-tag type="danger">{{ reportInfoData.storeApprovalNum }}</van-tag>
  50. </template>
  51. <template #right-icon>
  52. <van-icon class="homeCellIcon" name="arrow" size="16" />
  53. </template>
  54. </van-cell>
  55. <div class="lineGrey"></div>
  56. </div>
  57. <div class="contentborder">
  58. <van-button
  59. v-if="powerGrade == 3 && showButton"
  60. class="Btn1"
  61. plain
  62. size="small"
  63. type="info"
  64. @click="doubleWeeklyLink"
  65. >填写半月报</van-button
  66. >
  67. <van-button
  68. v-if="powerGrade == 2 && showButton"
  69. class="Btn1"
  70. plain
  71. size="small"
  72. type="info"
  73. @click="weeklyLink"
  74. >填写周报</van-button
  75. >
  76. <van-button
  77. v-if="powerGrade == 1 && showButton"
  78. class="Btn1"
  79. plain
  80. size="small"
  81. type="info"
  82. @click="dailyLink"
  83. >填写日报</van-button
  84. >
  85. <van-button
  86. v-if="powerGrade < 4 && isCommit"
  87. class="Btn1"
  88. plain
  89. size="small"
  90. type="info"
  91. @click="dailyLinks"
  92. >查看我的历史汇报</van-button
  93. >
  94. </div>
  95. <!-- <p class="updataTime" v-if="type != 4 && tabVal != '-1'">更新时间:{{ updataTime }}</p> -->
  96. </div>
  97. </template>
  98. <script>
  99. import { getReportInfo } from '@/api/index';
  100. export default {
  101. props: {
  102. tabVal: {
  103. type: [String, Number],
  104. default: '-1',
  105. },
  106. },
  107. data() {
  108. return {
  109. reportInfoData: {},
  110. approvalButton: false,
  111. JZQuota: false,
  112. GZdata: false,
  113. approvalPendingNum: 0,
  114. proccessPendingNum: 0,
  115. powerGrade: '2',
  116. showButton: false,
  117. isCommit: null,
  118. updataTime: '',
  119. type: '-1',
  120. };
  121. },
  122. activated() {
  123. this.getReportInfo();
  124. },
  125. methods: {
  126. getReportInfo(callback) {
  127. getReportInfo({ isContent: false }).then((res) => {
  128. if (res.code == 200) {
  129. if (res.data.postType == 'GZ') {
  130. this.GZdata = true;
  131. } else {
  132. this.GZdata = false;
  133. }
  134. if (res.data.postType == 'JZ') {
  135. this.JZQuota = true;
  136. } else {
  137. this.JZQuota = false;
  138. }
  139. localStorage.setItem('powerGrade', res.data.positionId);
  140. localStorage.setItem('isDiy', res.data.diy);
  141. localStorage.setItem('uType', res.data.userType);
  142. localStorage.setItem('jzType', res.data.jzType);
  143. localStorage.setItem('customerVisits', res.data.customerManagerVisits);
  144. localStorage.setItem('postType', res.data.postType);
  145. this.proccessPendingNum = res.data.proccessPendingNum;
  146. this.reportInfoData = res.data;
  147. this.approvalButton = res.data.approvalButton;
  148. this.powerGrade = res.data.positionId;
  149. this.showButton = res.data.showButton;
  150. if (res.data.reportTargetAll != null) {
  151. this.updataTime = res.data.reportTargetAll.updateTime;
  152. }
  153. this.approvalPendingNum = res.data.approvalPendingNum;
  154. this.type = res.data.userType;
  155. } else {
  156. this.$toast(res.msg);
  157. }
  158. callback && callback();
  159. });
  160. },
  161. dailyLink() {
  162. if (!this.isAllow()) return;
  163. this.$router.push('/daily');
  164. },
  165. weeklyLink() {
  166. if (!this.isAllow()) return;
  167. this.$router.push('/weekly');
  168. },
  169. doubleWeeklyLink() {
  170. if (!this.isAllow()) return;
  171. this.$router.push('/doubleWeekly');
  172. },
  173. dailyLinks() {
  174. if (!this.isAllow()) return;
  175. this.$router.push('/myHistoricalDaily');
  176. },
  177. // 是否允许填写汇报
  178. isAllow() {
  179. let reportRemark = this.reportInfoData.reportRemark;
  180. if (reportRemark) {
  181. this.$dialog
  182. .alert({
  183. message: reportRemark,
  184. })
  185. .then(() => {});
  186. return false;
  187. } else {
  188. return true;
  189. }
  190. },
  191. },
  192. };
  193. </script>
  194. <style scoped lang="scss"></style>