monthAccounts_body.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <!DOCTYPE html>
  2. <html class="">
  3. <!--STATUS OK-->
  4. <head>
  5. <meta name="referrer" content="always" />
  6. <meta charset='utf-8' />
  7. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="x-dns-prefetch-control" content="on">
  9. <meta name="description" content="">
  10. <meta name="format-detection" content="telephone=no" />
  11. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  13. <link rel="stylesheet" type="text/css" href="css/main.css" />
  14. <script src="js/vue.js"></script>
  15. <script src="js/vant-ui.js"></script>
  16. <script src="js/main.js"></script>
  17. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  18. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  19. <title>月度结算</title>
  20. </head>
  21. <style>
  22. .chukujilu {
  23. background-color: #fff !important;
  24. }
  25. .chukujilu .chukuTimer {
  26. background-color: #00a0ea !important;
  27. color: #fff !important;
  28. }
  29. .mescroll{
  30. position: relative;
  31. /*height: 73%;/*如设置bottom:50px,则需height:auto才能生效*/*/
  32. }
  33. /*车主订单详情*/
  34. .monthAccounts{
  35. background-color: #fff !important;
  36. font-size: .32rem;
  37. }
  38. .info-container{
  39. flex-wrap: wrap;
  40. }
  41. .info-cel{
  42. flex-grow: 0;
  43. padding: 0 .24rem;
  44. margin-bottom: .26rem;
  45. }
  46. .perc100{
  47. width: 100%;
  48. }
  49. .perc80{
  50. width: 80%
  51. }
  52. .perc60{
  53. width: 60%
  54. }
  55. .perc50{
  56. width: 50%;
  57. }
  58. .perc40{
  59. width: 40%;
  60. }
  61. .perc20{
  62. width: 20%;
  63. }
  64. .info-column{
  65. display: inline-block;
  66. }
  67. .info-line{
  68. width: 100%;
  69. border-bottom: 6px solid #F5F5F5;
  70. margin: .16rem 0 .36rem 0;
  71. }
  72. .white-text{
  73. color: #ffffff;
  74. }
  75. .black-text{
  76. color: #333333
  77. }
  78. .blue-text{
  79. color: #159BF7;
  80. }
  81. .base-wrap{
  82. padding: .26rem;
  83. background: #159BF7;
  84. align-items: center;
  85. border-bottom: .87rem solid #159BF7;
  86. border-bottom-left-radius: 12%;
  87. border-bottom-right-radius: 12%;
  88. }
  89. .strong-title{
  90. font-size: .38rem;
  91. line-height: .46rem;
  92. }
  93. .progress-container{
  94. margin: .08rem 0;
  95. }
  96. .msg-text{
  97. font-size: .18rem;
  98. }
  99. .avatar-container{
  100. justify-content: flex-end;;
  101. }
  102. .avatar-container img{
  103. width: 1.6rem;
  104. height: 1.6rem;
  105. background: #F7F7F7;
  106. border-radius: 0.8rem;
  107. }
  108. .section{
  109. border-radius: .12rem;
  110. box-shadow: 0px 3px 10px 0px rgba(0, 0, 0, 0.1);
  111. background: #ffffff;
  112. width: 7.02rem;
  113. margin: 0 auto .26rem auto;
  114. z-index: 200;
  115. }
  116. .section:first-of-type{
  117. margin-top: -.8rem;
  118. }
  119. .section-title{
  120. padding: .26rem;
  121. border-bottom: 1px solid #E6E6E6;
  122. }
  123. .section-title span{
  124. padding: 0 .26rem;
  125. border-left: 8px solid #159BF7;
  126. line-height: .34rem;
  127. font-size: .28rem;
  128. font-weight: 600;
  129. }
  130. .section-content{
  131. justify-content: space-around;
  132. padding-bottom: .26rem;
  133. }
  134. .section-content-item{
  135. padding-top: .26rem;
  136. }
  137. .item-number{
  138. font-size:
  139. .32rem;
  140. width: 1.02rem;
  141. height: 1.02rem;
  142. border-radius: 50%;
  143. background: #F7F7F7;
  144. margin-bottom: .08rem;
  145. align-items: center;
  146. justify-content: center;
  147. }
  148. .item-number span{
  149. font-size: .22rem;
  150. }
  151. .item-text{
  152. font-size: .22rem;
  153. color: #999999;
  154. }
  155. .noconfirmStatus{
  156. color: red;
  157. }
  158. .enableclick{
  159. opacity: 0.6
  160. }
  161. </style>
  162. <body>
  163. <!-- v-cloak -->
  164. <div id="app" v-cloak>
  165. <div class="pageView monthAccounts col filterpage">
  166. <div class="mescroll-touch-y mescroll" id="mescroll">
  167. <van-field
  168. style="background:#ecf0ef"
  169. readonly
  170. clickable
  171. label="选择年份"
  172. :value="currentY"
  173. placeholder="选择年份"
  174. @click="showCalendar = true"
  175. ></van-field>
  176. <van-popup v-model="showCalendar" round position="bottom">
  177. <van-picker
  178. show-toolbar
  179. :columns="dateColumns"
  180. @cancel="showCalendar = false"
  181. @confirm="onConfirm"
  182. />
  183. </van-popup>
  184. <div class=" info-container meberList">
  185. <div class="item flex a-center jlr" v-for="item in monthColums" :class="item.enable?'enableclick':item.status==0?'noconfirmStatus':'confirmStatus'" :key="item.month" v-on:click="openWin('monthAccountsDetails',item)">
  186. <h4>{{item.month}}月1日 - {{item.month}}月{{currentY+"-"+item.month | formatM}}日</h4>
  187. <div class="flex a-center" :class="item.enable?'enableclick':item.status==0?'noconfirmStatus':'confirmStatus'">
  188. {{item.status | formatStatus}}
  189. <i class="iconfont icon-right"></i>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. </body>
  197. <script type="text/javascript" src="../script/aui-scroll.js"></script>
  198. <script type="text/javascript" src="../script/api.js"></script>
  199. <script type="text/javascript" src="../script/httpRequest.js"></script>
  200. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  201. <script type="text/javascript">
  202. apiready = function() {
  203. new Vue({
  204. el: '#app',
  205. data: {
  206. storeId: "",
  207. showCalendar: false,
  208. currentY: 0,//默认年份
  209. dateColumns: [],
  210. startY: 2020,//开始年份
  211. defaultindexY: 0,//默认选中的年份下标
  212. registTime: ['2020','06','09'],
  213. monthColums: [{
  214. month: 1,
  215. status: 0,//确认状态;0未确认,1确认
  216. enable: false
  217. },{
  218. month: 2,
  219. status: 0,//确认状态;0未确认,1确认
  220. enable: false
  221. },{
  222. month: 3,
  223. status: 0,//确认状态;0未确认,1确认
  224. enable: false
  225. },{
  226. month: 4,
  227. status: 0,//确认状态;0未确认,1确认
  228. enable: false
  229. },{
  230. month: 5,
  231. status: 0,//确认状态;0未确认,1确认
  232. enable: false
  233. },{
  234. month: 6,
  235. status: 0,//确认状态;0未确认,1确认
  236. enable: false
  237. },{
  238. month: 7,
  239. status: 0,//确认状态;0未确认,1确认
  240. enable: false
  241. },{
  242. month: 8,
  243. status: 0,//确认状态;0未确认,1确认
  244. enable: false
  245. },{
  246. month: 9,
  247. status: 0,//确认状态;0未确认,1确认
  248. enable: false
  249. },{
  250. month: 10,
  251. status: 0,//确认状态;0未确认,1确认
  252. enable: false
  253. },{
  254. month: 11,
  255. status: 0,//确认状态;0未确认,1确认
  256. enable: false
  257. },{
  258. month: 12,
  259. status: 0,//确认状态;0未确认,1确认
  260. enable: false
  261. }] //默认年份所在的列
  262. },
  263. watch: {
  264. keyword: function(nw, od) {
  265. this.current = 1;
  266. }
  267. },
  268. methods: {
  269. // 打开新页面
  270. openWin: function (src,monthObi) {
  271. var dateParams = {
  272. paramsY: this.currentY,
  273. paramsM: monthObi
  274. };
  275. if(monthObi.enable){
  276. api.toast({
  277. msg: '该时间段不在您的注册时间【'+this.registTime[0]+'-'+this.registTime[1]+'-'+this.registTime[2]+'】范围内',
  278. duration: 2000,
  279. location: 'center'
  280. });
  281. }else{
  282. this.goWin(src, src + '_win.html', dateParams);
  283. }
  284. },
  285. // 获取门店注册时间
  286. handleGetRegistTime: function(){
  287. var data = {
  288. "storeId": parseInt(this.storeId),
  289. "url": "json",
  290. "type": "body"
  291. },
  292. _this = this,
  293. url = "getRegistTime";
  294. var paramStr = "storeId="+parseInt(this.storeId);
  295. this.$getOption(url, paramStr, function(ret) {
  296. if(ret.code==0||ret.code=="0"){
  297. _this.registTime = ret.registTime.split(".");
  298. _this.startY = parseInt(_this.registTime[0]);
  299. //设置时间选项 [注册年开始,当前年结束]
  300. var endY = new Date().getFullYear();
  301. var rangeY = new Date().getFullYear() - _this.startY;
  302. if(rangeY<=0){
  303. _this.dateColumns.push( _this.startY);
  304. }else{
  305. for(var i=0; i<=rangeY; i++){
  306. _this.dateColumns.push(_this.startY+i);
  307. }
  308. };
  309. // 设置年份选择器是当前年份
  310. _this.defaultindexY = _this.dateColumns.length-1;
  311. _this.currentY = _this.dateColumns[_this.defaultindexY];
  312. // 设置是否可点击,如果在注册月份之前的话是置灰,不能点击
  313. _this.handleSetEnable();
  314. _this.handleInit();
  315. }else{
  316. api.toast({
  317. msg: ret.msg,
  318. duration: 2000,
  319. location: 'center'
  320. });
  321. }
  322. })
  323. },
  324. // 设置是否可点击,如果在注册月份之前的话是置灰,不能点击
  325. handleSetEnable: function(){
  326. var _this = this;
  327. _this.monthColums.map(function(v){
  328. if(_this.currentY<_this.registTime[0]){
  329. _this.monthColums[v.month-1].enable = true
  330. }else if(v.month<_this.registTime[1]){
  331. _this.monthColums[v.month-1].enable = true
  332. }else{
  333. _this.monthColums[v.month-1].enable = false
  334. }
  335. });
  336. },
  337. // 获取已确认月份
  338. handleInit: function(){
  339. var data = {
  340. "storeId": parseInt(this.storeId),
  341. "year": this.currentY+"",
  342. "url": "json",
  343. "type": "body"
  344. },
  345. _this = this,
  346. url = "getConfirmMonth";
  347. var paramStr = "storeId="+parseInt(this.storeId)+"&year="+this.currentY;
  348. this.$getOption(url, paramStr, function(ret) {
  349. if(ret.code==0||ret.code=="0"){
  350. if (typeof ret.monthList != 'undefined' && ret.monthList != [] && ret.monthList != null) {
  351. ret.monthList.map(function(v){
  352. _this.monthColums[parseInt(v)-1].status = 1;
  353. })
  354. }else{
  355. _this.monthColums.map(function(v){
  356. v.status = 1;
  357. })
  358. };
  359. }else{
  360. api.toast({
  361. msg: ret.msg,
  362. duration: 2000,
  363. location: 'center'
  364. });
  365. }
  366. })
  367. },
  368. onConfirm: function(v){
  369. this.currentY = v;
  370. this.showCalendar = false;
  371. this.handleSetEnable();
  372. this.handleInit();
  373. this.$forceUpdate();
  374. }
  375. },
  376. filters: {
  377. formatM: function(v){
  378. // 计算二月份的最后一天
  379. let dateStr = v +"-1"; //需要获取此月最后一天的日期
  380. let dateObj = new Date(dateStr);
  381. let nextMonth = dateObj.getMonth()+1; //0-11,下一个月
  382. //设置当前日期为下个月的1号
  383. dateObj.setMonth(nextMonth);
  384. dateObj.setDate(1); //1-31
  385. let nextMonthFirstDayTime = dateObj.getTime(); //下个月一号对应毫秒
  386. let theMonthLastDayTime = nextMonthFirstDayTime-24*60*60*1000; //下个月一号减去一天,正好是这个月最后一天
  387. let theMonthDay = (new Date(theMonthLastDayTime)).getDate();
  388. val = theMonthDay;
  389. return val;
  390. },
  391. formatStatus: function(v){
  392. switch (v) {
  393. case 0:
  394. return "未确认"
  395. break;
  396. default:
  397. return "已确认"
  398. }
  399. }
  400. },
  401. mounted: function() {
  402. this.storeId = $api.getStorage('userid');
  403. this.handleGetRegistTime();
  404. var _this = this;
  405. this.addEvent("refreshMonth",function(){
  406. _this.handleInit();
  407. })
  408. }
  409. })
  410. }
  411. </script>
  412. </html>