appointmentHistory.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <div class="historyListBody">
  3. <div class="historyItem" v-for="item in historyList">
  4. <div class="tags">{{item.resourceTypeStr}}</div>
  5. <div class="historyItemTitle">{{item.subject}}</div>
  6. <div class="historyItemInfo">使用日期:{{item.useTime}}</div>
  7. <div class="historyItemInfo">资源名称:{{item.resourceName}}</div>
  8. <div class="historyItemInfo">位置:{{item.position}}</div>
  9. <div class="historyItemInfo">预约时间:{{item.appointTime}}</div>
  10. <div class="historyItemBottom">
  11. <span class="typeInfo" :class="item.stateStr==='已通过'?'tgType':item.stateStr==='已取消'?'qxType':''">{{item.stateStr}}</span>
  12. <button @tap="toAdd(item)" class="btn" :class="item.stateStr==='暂存'?'zcBtn':''" v-if="item.stateStr !=='已取消'">{{item.stateStr==='暂存'?'编辑':'取消'}}</button>
  13. </div>
  14. </div>
  15. <van-dialog
  16. use-slot
  17. title="取消预约"
  18. :show="show"
  19. show-cancel-button
  20. confirm-button-open-type="getUserInfo"
  21. @confirm="confirm"
  22. @cancel="show=false"
  23. >
  24. <div class="dialogBox">
  25. <van-field
  26. :value="contant"
  27. autosize
  28. type="textarea"
  29. placeholder="请输入取消原因"
  30. class="myField2"
  31. maxlength="800"
  32. show-word-limit
  33. @change="changeMsg"
  34. />
  35. </div>
  36. </van-dialog>
  37. </div>
  38. </template>
  39. <script>
  40. import {getByCodes, getMeetingAppointListApp, getUserLocalStorageInfo} from "@/js_sdk/http";
  41. export default {
  42. name: "appointmentHistory",
  43. data(){
  44. return{
  45. contant:'',
  46. show:false,
  47. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  48. historyList:[
  49. {stateStr:'审核中'},
  50. {stateStr:'已通过'},
  51. {stateStr:'已取消'},
  52. {stateStr:'暂存'},
  53. ]
  54. }
  55. },
  56. created() {
  57. this.getList()
  58. },
  59. onShow() {
  60. },
  61. methods:{
  62. changeMsg(e){
  63. this.contant = e.detail
  64. },
  65. getList() {
  66. const _this = this
  67. _this.historyList = []
  68. const data = {
  69. pageNum : 1,
  70. pageSize : 100,
  71. createdId : getUserLocalStorageInfo().userId,
  72. states: '1,5,6,7'
  73. }
  74. getMeetingAppointListApp(data).then(res => {
  75. if (res.data) {
  76. res.data.forEach(function (item) {
  77. const jsonMap = _this.getItemJson(item)
  78. _this.historyList.push(jsonMap)
  79. })
  80. }
  81. })
  82. },
  83. getItemJson(item) {
  84. return item
  85. },
  86. toAdd(data) {
  87. if(data.stateStr == '暂存'){
  88. uni.navigateTo({
  89. url: '/pages/subPackages/resourceReservation_manage/add?id=' + data.id
  90. })
  91. }else if(data.stateStr == '审核中'){
  92. this.show = true
  93. }
  94. },
  95. confirm(e){
  96. console.log('我确定取消了')
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss">
  102. .historyListBody{
  103. margin-top: 24rpx;
  104. display: flex;
  105. flex-direction: column;
  106. align-items: center;
  107. padding-bottom: 100rpx;
  108. .historyItem{
  109. width: 686rpx;
  110. padding: 24rpx 0;
  111. background: white;
  112. box-sizing: border-box;
  113. position: relative;
  114. border-radius: 16rpx;
  115. margin-bottom: 24rpx;
  116. .tags{
  117. width: 148rpx;
  118. height: 56rpx;
  119. position: absolute;
  120. top: 0;
  121. right: 0;
  122. display: flex;
  123. align-items: center;
  124. justify-content: center;
  125. font-size: 26rpx;
  126. color: rgba(3, 101, 249, 1);
  127. background: url('https://www.idea-co-sf.com/gardenProduct/image/bj04.png') no-repeat;
  128. background-size: 100%;
  129. }
  130. .historyItemTitle{
  131. padding: 8rpx 32rpx;
  132. width: 480rpx;
  133. color: rgba(34, 34, 34, 1);
  134. font-size: 32rpx;
  135. line-height: 40rpx;
  136. font-weight: 500;
  137. }
  138. .historyItemInfo{
  139. color: rgba(102, 102, 102, 1);
  140. font-size: 28rpx;
  141. padding: 10rpx 32rpx;
  142. }
  143. .historyItemBottom{
  144. display: flex;
  145. justify-content: space-between;
  146. align-items: center;
  147. padding: 28rpx 32rpx 0 32rpx;
  148. border-top: 1px solid rgba(232, 237, 245, 1);
  149. margin-top: 22rpx;
  150. .typeInfo{
  151. font-size: 28rpx;
  152. color: rgba(226, 81, 0, 1);
  153. }
  154. .tgType{
  155. color: rgba(3, 101, 249, 1);
  156. }
  157. .qxType{
  158. color:rgba(242, 25, 18, 1);
  159. }
  160. .btn{
  161. display: flex;
  162. align-items: center;
  163. justify-content: center;
  164. font-size: 28rpx;
  165. width: 160rpx;
  166. height: 60rpx;
  167. border-radius: 32rpx;
  168. border: 2rpx solid rgba(255, 107, 24, 1);
  169. color:rgba(255, 107, 24, 1);
  170. &::after{
  171. border: none;
  172. }
  173. }
  174. .zcBtn{
  175. background: linear-gradient( 316deg, #84AAFF 0%, #0365F9 100%);
  176. color: white;
  177. border: none;
  178. }
  179. }
  180. }
  181. }
  182. .dialogBox{
  183. padding: 32rpx;
  184. }
  185. .myField2 {
  186. .van-cell{
  187. background: #F5F7FA !important;
  188. border-radius: 8rpx;
  189. font-size: 28rpx;
  190. }
  191. }
  192. </style>