userwork.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <template>
  2. <div >
  3. <cu-custom bgColor="bg-gradual-pink" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">排班信息</block>
  6. </cu-custom>
  7. <div>
  8. <div class='month'>
  9. <ul style="list-style-type:none;">
  10. <li class='arrow' @click='pickPre(currentYear,currentMonth)'>上个月</li>
  11. <li class='year-month'>
  12. <span class='choose-year'>{{ currentYear }}年</span>
  13. <span class='choose-month'>{{ currentMonth }}月</span>
  14. </li>
  15. <li class='arrow' @click='pickNext(currentYear,currentMonth)'>下个月</li>
  16. </ul>
  17. <br>
  18. </div>
  19. </div>
  20. <view>
  21. <view class="container-list">
  22. <view class="common cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]" v-for='(item,index) in data' :key="index">
  23. <label class="content">
  24. <view class="lable-text " style="font-size: 15px;margin-left: 10px;">{{item.name}}</view>
  25. <view class="lable-text" style="font-size: 15px;">{{item.startDate}}</view>-
  26. <view class="lable-text" style="font-size: 15px;">{{item.endDate}}</view>
  27. <view class="lable-text">
  28. <span style="font-size: 15px;">{{item.shiftDate}}</span>
  29. </view>
  30. </label>
  31. </view>
  32. </view>
  33. </view>
  34. </div>
  35. </template>
  36. <script>
  37. import api from '@/api/api'
  38. export default {
  39. data() {
  40. return {
  41. currentMonth: new Date().getMonth()+1,
  42. currentYear: new Date().getFullYear(),
  43. data:[],
  44. userUrl:'/shift/shift/listShift'
  45. }
  46. },
  47. created(){
  48. this.initData(null)
  49. this.querys(this.name)
  50. },
  51. methods:{
  52. initData: function(cur) {
  53. // var leftcount = 0 // 存放剩余数量
  54. var date
  55. if (cur) {
  56. date = new Date(cur)
  57. } else {
  58. var now = new Date()
  59. var d = new Date(this.formatDate(now.getFullYear(), now.getMonth(), 1))
  60. d.setDate(35)
  61. date = new Date(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
  62. }
  63. this.currentYear = date.getFullYear()
  64. this.currentMonth = date.getMonth() + 1
  65. var str = this.formatDate(
  66. this.currentYear,
  67. this.currentMonth,
  68. )
  69. },
  70. pickPre: function(year, month) {
  71. var d = new Date(this.formatDate(year, month, 1))
  72. d.setDate(0)
  73. this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
  74. this.querys();
  75. },
  76. pickNext: function(year, month) {
  77. var d = new Date(this.formatDate(year, month, 1))
  78. var ds=this.formatDate(year, month, null);
  79. var nowDate = new Date();
  80. var dt=this.formatDate(nowDate.getFullYear(),nowDate.getMonth(),null);
  81. d.setDate(35)
  82. this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
  83. this.querys();
  84. },
  85. // 返回 类似 2016-01-02 格式的字符串
  86. formatDate: function(year, month, day) {
  87. var y = year
  88. if(month>12){
  89. month=1;
  90. y=year+1;
  91. }
  92. var m = month
  93. if (m < 10) m = '0' + m
  94. var d = day
  95. if(day!=null &&day !=""){
  96. if (d < 10) d = '0' + d
  97. return y + '-' + m + '-' + d
  98. }else{
  99. return y + '-' + m
  100. }
  101. },
  102. querys(){
  103. this.data=[];
  104. var deptid=uni.getStorageSync('id');
  105. var userid=this.$store.getters.userid;
  106. if(deptid!=null&&deptid!=""){
  107. userid=deptid;
  108. }
  109. var date=this.formatDate(this.currentYear,this.currentMonth,1);
  110. this.$http.get(this.userUrl,{params:{userid:userid,date:date}}).then(res=>{
  111. this.data=res.data;
  112. }).catch(err => {
  113. console.log(err);
  114. });
  115. },
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .month ul {
  121. margin: 0;
  122. padding: 0;
  123. display: flex;
  124. justify-content: space-between;
  125. height: 35px;
  126. }
  127. .year-month {
  128. display: flex;
  129. align-items: center;
  130. justify-content: space-around;
  131. margin-top: 10px;
  132. }
  133. .choose-month {
  134. text-align: center;
  135. font-size: 12px;
  136. }
  137. .arrow {
  138. padding: 15px;
  139. color: #999999;
  140. }
  141. .month ul li {
  142. font-size: 12px;
  143. text-transform: uppercase;
  144. letter-spacing: 3px;
  145. }
  146. #calendar {
  147. font-size: 12px;
  148. width: 100%;
  149. margin: 0 auto;
  150. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.1),
  151. 0 1px 5px 0 rgba(0, 0, 0, 0.12);
  152. }
  153. .month {
  154. width: 100%;
  155. color: #333333;
  156. background: #ffffff;
  157. }
  158. .imgs{
  159. width: 40px;
  160. height: 40px;
  161. border-radius:5px 5px 5px 5px;
  162. margin-left: 1%;
  163. }
  164. .filterBox {
  165. padding: 15rpx 32rpx;
  166. background-color: #fff;
  167. .filter-input {
  168. height: 80rpx;
  169. background-color: #eeeff0;
  170. border-radius: 40rpx;
  171. display: flex;
  172. align-items: center;
  173. padding-left: 40rpx;
  174. .filterImg {
  175. width: 32rpx;
  176. height: 32rpx;
  177. margin-right: 20rpx;
  178. margin-bottom: 5rpx;
  179. }
  180. .filterImgs {
  181. width: 32rpx;
  182. height: 32rpx;
  183. }
  184. .text {
  185. width: 84%;
  186. background-color: #eeeff0;
  187. font-size: 32rpx;
  188. color: #000;
  189. }
  190. }
  191. }
  192. .flex_between_center {
  193. display: flex;
  194. justify-content: space-between;
  195. align-items: center;
  196. }
  197. .checkbox {
  198. position: relative;
  199. margin-left: 10rpx;
  200. margin-right: 0px;
  201. .color {
  202. color: #00aaff;
  203. background-color: #00aaff;
  204. }
  205. .txt {
  206. font-size: 44rpx;
  207. width: 100%;
  208. height: 100%;
  209. display: flex;
  210. }
  211. }
  212. .checkBorder {
  213. border: 1px solid #ecdee4;
  214. }
  215. .header {
  216. width: 100%;
  217. position: fixed;
  218. background-color: #fff;
  219. z-index: 9999;
  220. .title {
  221. height: 90rpx;
  222. padding: 0 32rpx;
  223. line-height: 90rpx;
  224. font-size: 30rpx;
  225. background-color: #f5f5f5;
  226. color: #606064;
  227. }
  228. }
  229. .iconclass {
  230. display: inline-block;
  231. margin: 0 12rpx;
  232. color: #D0D4DB;
  233. font-size: 28rpx;
  234. }
  235. .container-list {
  236. overflow-y: scroll;
  237. overflow-x: hidden;
  238. padding-bottom: 160rpx;
  239. padding-top: 15rpx;
  240. .common {
  241. background-color: #fff;
  242. border-bottom: 1rpx solid #f4f4f4;
  243. padding-left: 10rpx;
  244. .content {
  245. display: flex;
  246. align-items: center;
  247. height: 70rpx;
  248. width: 100%;
  249. padding: 15rpx 0;
  250. position: relative;
  251. font-size: 32rpx;
  252. .lable-text{
  253. margin-left: 5%;
  254. font-size: 30rpx;
  255. color: #5b5757;
  256. width: 500rpx;
  257. word-break: break-all;
  258. }
  259. .right {
  260. position: absolute;
  261. right: 30rpx;
  262. color: #babdc3;
  263. font-size: 32rpx;
  264. }
  265. }
  266. }
  267. }
  268. .active {
  269. color: #4297ED !important;
  270. }
  271. .none {
  272. color: #666666;
  273. }
  274. .icon-selected{
  275. color: #0095F2!important;
  276. font-size: 40rpx!important;
  277. }
  278. .icons{
  279. color: #0095F2!important;
  280. font-size: 40rpx!important;
  281. }
  282. .inline-item {
  283. display: inline-block
  284. }
  285. .content-item{
  286. display: flex;
  287. position: relative;
  288. align-items: center;
  289. }
  290. .box_sizing {
  291. -webkit-box-sizing: border-box;
  292. -moz-box-sizing: border-box;
  293. box-sizing: border-box;
  294. }
  295. .btn {
  296. position: fixed;
  297. bottom: 0;
  298. padding: 10px;
  299. background-color: #fff;
  300. width: 100%;
  301. .sureBtn {
  302. background-color: #0095F2;
  303. color: #fff;
  304. }
  305. }
  306. // @import '@/components/xiaolu-tree/css/style.scss';
  307. @import url("@/components/xiaolu-tree/css/icon.css");
  308. </style>