酷炫直播运营系统小程序版本

planList.vue 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view>
  3. <view class="plan_box">
  4. <view class="splitLine"></view>
  5. <view class="bigTitle flex">
  6. 本周直播计划
  7. <view class="lMarauto">
  8. <text class="planWeekCss" v-for="p in planWeek" :key="p.id" :class="acweekIdx == p.id ? 'c-446EF6 fWeight600' : ''" @click="switchWeek(p)">{{p.name}}</text>
  9. </view>
  10. </view>
  11. <view class="f26">
  12. <view v-if="plandataList&&plandataList.length>0">
  13. <view class="flex dayItem" v-for="(p,pidx) in plandataList" :key="pidx">
  14. <view class="dayItem_date">{{p.date}}({{p.week_alias}})</view>
  15. <view class="flex1">
  16. <view v-for="(acc,accidx) in p.account_list" :key="accidx" class="flex accItem" :class="accidx == p.account_list.length - 1 ? '' : 'accItem_border'">
  17. <view class="accItem_info">
  18. <img class="accImg" :src="acc.account_head" alt="">
  19. <text>{{acc.account_name}}</text>
  20. </view>
  21. <view class="flex1 text-center" style="padding: 20rpx 0">
  22. <view v-for="(ti,tiIdx) in acc.time_list" :key="tiIdx" class="timeItem">{{ti.start_time}} - {{ti.end_time}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <no-data v-else></no-data>
  29. </view>
  30. </view>
  31. <view class="examine_box">
  32. <view class="splitLine"></view>
  33. <view class="bigTitle">报销审批情况</view>
  34. <!-- 审核 别人的报销单 -->
  35. <view>
  36. <swiper v-if="baoxiaoList&&baoxiaoList.length>0" class="swiper" :indicator-dots="true" indicator-color="rgba(181, 181, 181, 1)" indicator-active-color="rgba(66, 148, 235, 1)">
  37. <view v-for="b in baoxiaoList" :key="b.id">
  38. <swiper-item>
  39. <view class="unit_pad">
  40. <view class="smallTitle">{{b.submit_date?b.submit_date:'-'}}报销</view>
  41. <view v-for="b_info in b.examine_info" :key="b_info.node_idx" class="flex f28 tMar30">
  42. <view class="iconfont icon-shenpi_icon"></view>
  43. <view>{{b_info.node_idx == 1 ? '一' : (b_info.node_idx == 2 ? '二' : b_info.node_idx == 3 ? '三' : '')}}级审核</view>
  44. (<view v-for="(shenName,shenNameidx) in b_info.executors" :key="shenNameidx">{{shenName}} &nbsp;</view>)
  45. <view class="lMarauto" :style="[{color : b_info.execute_info.status == 2 ? '#446EF6' : '#B8B8B8'},{fontWeight:b_info.execute_info.status == 2 ? 600 : ''}]">
  46. {{b_info.execute_info.status == 1 ? '待审核' :
  47. (b_info.execute_info.status == 2 ? '已通过' :
  48. (b_info.execute_info.status == 3 ? '驳回' :
  49. (b_info.execute_info.status == 0 ? '保存' :
  50. '异常')))}}
  51. </view>
  52. </view>
  53. </view>
  54. </swiper-item>
  55. </view>
  56. </swiper>
  57. <no-data v-else></no-data>
  58. </view>
  59. <!-- 自己提交的未报销的报销单 -->
  60. <view v-if="shenhewei&&shenhewei.length>0">
  61. <view class="splitLine"></view>
  62. <swiper class="swiper" :indicator-dots="true" indicator-color="rgba(181, 181, 181, 1)" indicator-active-color="rgba(66, 148, 235, 1)">
  63. <view v-for="(b,index) in shenhewei" :key="index+'b'+b.id">
  64. <swiper-item>
  65. <view class="unit_pad">
  66. <view class="smallTitle">{{b.staff_name?b.staff_name:'-'}}的报销</view>
  67. <view v-for="b_info in b.examine_detail" :key="b_info.node_idx" class="flex f28 tMar30">
  68. <view class="iconfont icon-shenpi_icon"></view>
  69. <view>{{b_info.node_idx == 1 ? '一' : (b_info.node_idx == 2 ? '二' : b_info.node_idx == 3 ? '三' : '')}}级审核</view>
  70. (<view>{{b_info.executors}}</view>)
  71. <view class="lMarauto shenheNow" @click="auditEvent(index)" v-if="b_info.support_opt == 1">立即审核</view>
  72. <view class="lMarauto" :style="{color : b_info.status == 2 ? '#589C54' : '#B8B8B8'}" v-if="b_info.support_opt == 0">
  73. {{b_info.status == 1 ? '待审核' :
  74. (b_info.status == 2 ? '已通过' :
  75. (b_info.status == 3 ? '驳回' :
  76. (b_info.status == 0 ? '保存' :
  77. '异常')))}}
  78. </view>
  79. </view>
  80. </view>
  81. </swiper-item>
  82. </view>
  83. </swiper>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. export default {
  90. data(){
  91. return{
  92. plandataList: [],
  93. acweekIdx: 0,
  94. planWeek: [
  95. {
  96. id: 0,
  97. name: '本周',
  98. st_time: this.getTime(0),
  99. en_time: this.getTime(-6)
  100. },
  101. {
  102. id: 1,
  103. name: '上一周',
  104. st_time: this.getTime(7),
  105. en_time: this.getTime(1)
  106. },
  107. {
  108. id: 2,
  109. name: '下一周',
  110. st_time: this.getTime(-7),
  111. en_time: this.getTime(-13)
  112. }
  113. ],
  114. shenhewei: [],
  115. baoxiaoList: [],
  116. }
  117. },
  118. methods:{
  119. auditEvent (index) {
  120. let info = this.shenhewei[index]
  121. uni.navigateTo({
  122. url: '../reimbursementList/submitApply?p_id=' + info.p_id + '&apply_id=' + info.s_id + '&source=audit'
  123. })
  124. },
  125. init_uType_equal4_1(){
  126. // this.get_auditList()//审核别人的报销单列表,未审核
  127. // this.get_personalSubmitList() //个人提交的报销单
  128. // this.get_planList(this.planWeek[0].st_time, this.planWeek[0].en_time) //直播计划
  129. let pro1 = new Promise((resolve, reject)=>{
  130. this.get_auditList(()=>{
  131. resolve()
  132. })
  133. })
  134. let pro2 = new Promise((resolve, reject)=>{
  135. this.get_personalSubmitList(()=>{
  136. resolve()
  137. })
  138. })
  139. let pro3 = new Promise((resolve, reject)=>{
  140. this.get_planList(()=>{
  141. resolve()
  142. })
  143. })
  144. Promise.all([pro1,pro2,pro3]).then(()=>{
  145. this.$hide_init_loading()
  146. uni.stopPullDownRefresh()
  147. this.$emit('planTimerEdit',
  148. setTimeout(()=>{
  149. this.init_uType_equal4_1()
  150. },10*1000)
  151. )
  152. })
  153. },
  154. switchWeek (p) {
  155. this.acweekIdx = p.id
  156. this.get_planList('', p.st_time, p.en_time)
  157. },
  158. getTime (n) {
  159. // 0表示本周第一天 -6表示本周最后一天
  160. var now = new Date();
  161. var year = now.getFullYear();
  162. //因为月份是从0开始的,所以获取这个月的月份数要加1才行
  163. var month = now.getMonth() + 1;
  164. var date = now.getDate();
  165. var day = now.getDay();
  166. //判断是否为周日,如果不是的话,就让今天的day-1(例如星期二就是2-1)
  167. if (day !== 0) {
  168. n = n + (day - 1);
  169. } else {
  170. n = n + day;
  171. }
  172. if (day) {
  173. //这个判断是为了解决跨年的问题
  174. if (month > 1) {
  175. month = month;
  176. }
  177. //这个判断是为了解决跨年的问题,月份是从0开始的
  178. else {
  179. year = year - 1;
  180. month = 12;
  181. }
  182. }
  183. now.setDate(now.getDate() - n);
  184. year = now.getFullYear();
  185. month = now.getMonth() + 1;
  186. date = now.getDate();
  187. var s = year + "-" + (month < 10 ? ('0' + month) : month) + "-" + (date < 10 ? ('0' + date) : date);
  188. return s;
  189. },
  190. get_planList (cb, st, nt) {
  191. this.$req(this.$api.planListIndex, 'get', {
  192. start_date: st,
  193. end_date: nt
  194. }, (res) => {
  195. cb ? cb() : ''
  196. if (res && res.errno == 0) {
  197. this.plandataList = res.rst
  198. }
  199. }, (err)=>{
  200. cb ? cb() : ''
  201. })
  202. },
  203. get_personalSubmitList (cb) {
  204. this.$req(this.$api.personalSubmitList, 'get', {}, (res) => {
  205. cb ? cb() : ''
  206. if (res && res.errno == 0) {
  207. this.baoxiaoList = res.rst
  208. }
  209. },(err)=>{
  210. cb ? cb() : ''
  211. })
  212. },
  213. get_auditList (cb) {
  214. this.$req(this.$api.auditList, 'get', {
  215. is_examine: 0,
  216. show_detail: 1,
  217. page: 1,
  218. page_size: 6
  219. }, (res) => {
  220. cb ? cb() : ''
  221. if (res && res.errno == 0) {
  222. this.shenhewei = res.rst.data
  223. }
  224. },(err)=>{
  225. cb ? cb() : ''
  226. })
  227. },
  228. }
  229. }
  230. </script>
  231. <style scoped lang="scss">
  232. .plan_box {
  233. background: #373E4E;
  234. .planWeekCss {
  235. font-size: 26rpx;
  236. color: #b8b8b8;
  237. margin-left: 14rpx;
  238. }
  239. .dayItem {
  240. //padding: 20rpx 0;
  241. border-bottom: 1px solid #585c69;
  242. .flex1 {
  243. flex: 1;
  244. border-left: 1px solid #585c69;
  245. }
  246. .dayItem_date {
  247. width: 27%;
  248. text-align: center;
  249. }
  250. .accItem {
  251. .accItem_info {
  252. width: 60%;
  253. display: flex;
  254. align-items: center;
  255. padding: 20rpx;
  256. .accImg {
  257. width: 48rpx;
  258. height: 48rpx;
  259. margin-right: 10rpx;
  260. border-radius: 50%;
  261. }
  262. }
  263. .timeItem {
  264. margin: 8rpx 0;
  265. }
  266. }
  267. .accItem_border {
  268. border-bottom: 1px solid #585c69;
  269. }
  270. }
  271. }
  272. .examine_box {
  273. background: #373E4E;
  274. .swiper {
  275. min-height: 160rpx;
  276. height: 340rpx;
  277. .unit_pad {
  278. padding: 20rpx 32rpx;
  279. }
  280. }
  281. .shenheNow {
  282. background: #2e67ff;
  283. border-radius: 6rpx;
  284. padding: 4rpx 12rpx;
  285. }
  286. .icon-shenpi_icon {
  287. color: #828282;
  288. font-size: 30rpx;
  289. margin-right: 10rpx;
  290. }
  291. }
  292. .splitLine {
  293. height: 16rpx;
  294. background-color: #262C38;
  295. }
  296. .bigTitle {
  297. font-size: 32rpx;
  298. border-bottom: 2rpx solid #585c69;
  299. padding: 20rpx 32rpx;
  300. font-weight: 600;
  301. background: url("../../static/colorImg/bigTitleImg.png") no-repeat;
  302. background-size: 7%;
  303. background-position: 20rpx 10rpx;
  304. }
  305. </style>