index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div class="business">
  3. <Head :headText="headText"></Head>
  4. <div class="count-top-right">
  5. <date-temp :types="1" @pickerVal="pickerVal"></date-temp>
  6. </div>
  7. <el-calendar class="doBusinessContainer" :first-day-of-week="7">
  8. <template slot="dateCell" slot-scope="{date, data}">
  9. <div class="time-duration">
  10. <el-time-picker
  11. is-range
  12. v-model="value1"
  13. size="mini"
  14. range-separator="-"
  15. start-placeholder="开始时间"
  16. end-placeholder="结束时间"
  17. placeholder="选择时间范围"
  18. format="hh:mm"
  19. @change="setHours"
  20. ></el-time-picker>
  21. </div>
  22. <div class="dataJoin">{{ data.day.split('-').slice(2).join('')}}</div>
  23. </template>
  24. </el-calendar>
  25. </div>
  26. </template>
  27. <script>
  28. import Head from "../main/index";
  29. import DateTemp from "../evaluate/dateTemp";
  30. import {queryHours,updateHours} from '@/api/doBusiness/business.js'
  31. export default {
  32. data() {
  33. return {
  34. headText: "营业时间调整",
  35. value1: [new Date(), new Date()],
  36. date:""
  37. };
  38. },
  39. components: {
  40. Head,
  41. DateTemp
  42. },
  43. methods: {
  44. pickerVal(val) {
  45. console.log(val);
  46. this.date = val
  47. },
  48. getHours(){
  49. let params = {
  50. postParams:{
  51. criteria:{
  52. projectId:'Pj4419000005',
  53. date:'201902'
  54. }
  55. }
  56. }
  57. queryHours(params).then(res=>{
  58. console.log(res)
  59. })
  60. },
  61. setHours(){
  62. let params = {
  63. postParams:{
  64. projectId:'Pj4419000005',
  65. date:'201902',
  66. openTime:'080000',
  67. endTime:'220000'
  68. }
  69. }
  70. updateHours(params).then(res=>{
  71. console.log(res)
  72. })
  73. }
  74. },
  75. mounted(){
  76. this.getHours()
  77. }
  78. };
  79. </script>
  80. <style lang="scss" scoped>
  81. .count-top-right {
  82. width: 148px;
  83. padding: 16px;
  84. }
  85. .doBusinessContainer {
  86. margin-top: 20px;
  87. background: #fff;
  88. .time-duration {
  89. .el-input__inner {
  90. width: 134px;
  91. padding: 0;
  92. border: none;
  93. font-size: 14px;
  94. font-family: PingFangSC-Regular, PingFang SC;
  95. font-weight: 400;
  96. color: rgba(100, 108, 115, 1);
  97. line-height: 24px;
  98. padding: 1px 12px;
  99. height: 24px;
  100. background: rgba(245, 246, 247, 1);
  101. border-radius: 12px;
  102. margin-right: 17px;
  103. }
  104. .el-range-editor .el-range-input {
  105. border: none;
  106. background: rgba(245, 246, 247, 1);
  107. }
  108. }
  109. .dataJoin {
  110. height: 22px;
  111. font-size: 16px;
  112. font-family: PingFangSC-Regular, PingFang SC;
  113. font-weight: 400;
  114. color: rgba(31, 36, 41, 1);
  115. line-height: 22px;
  116. }
  117. }
  118. </style>
  119. <style lang="scss">
  120. .business {
  121. .el-calendar-table thead th {
  122. text-align: right;
  123. height: 20px;
  124. font-size: 14px;
  125. font-family: PingFangSC-Regular, PingFang SC;
  126. font-weight: 400;
  127. color: rgba(100, 106, 115, 1);
  128. line-height: 20px;
  129. padding-right: 15px;
  130. }
  131. .el-calendar__header {
  132. display: none;
  133. }
  134. .el-range-editor--mini .el-range-input {
  135. background: #f5f6f7;
  136. }
  137. .el-calendar-table .el-calendar-day {
  138. display: flex;
  139. }
  140. }
  141. </style>