equipmentinspectionplanlist.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <view class="wrap">
  3. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  4. :title="title" @clickLeft="toBack" >
  5. </uni-nav-bar>
  6. <!-- <u-gap height="75px"></u-gap> -->
  7. <view class="container">
  8. <uni-list>
  9. <uni-list-item v-for="item in list" :key="item.id">
  10. <!-- 自定义 body -->
  11. <template v-slot:body>
  12. <view style="height: 130px;width: 100%;display: flex;flex-direction: column;">
  13. <view style="display: flex;flex-direction: row;width: 100%;justify-content: flex-start;">
  14. <view style="font-size: 0.9rem;font-weight: bold;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{item.planTitle}}
  15. </view>
  16. </view>
  17. <view style="margin-top: 10rpx;">
  18. <text style="margin-right: 10px;font-size: 0.7rem;">计划开始时间:</text>
  19. <text style="font-size: 0.7rem;color: orangered;">{{item.inspectionStartTime}}</text>
  20. </view>
  21. <view style="margin-top: 10rpx;">
  22. <text style="margin-right: 10px;font-size: 0.7rem;">计划结束时间:</text>
  23. <text style="font-size: 0.7rem;color: orangered;">{{item.inspectionEndTime}}</text>
  24. </view>
  25. <view v-if="item.planClose == 2" style="margin-top: 10rpx;padding-left: 0px;padding-right: 0px;">
  26. <button style="background-color: lightblue;" type="default" @click="openPage(item.id)">开始填报</button>
  27. </view>
  28. <view v-if="item.planClose == 1" style="margin-top: 10rpx;padding-left: 0px;padding-right: 0px;">
  29. <button type="default" @click="toPlanClose(item.id)">填报已结束</button>
  30. </view>
  31. </view>
  32. </template>
  33. </uni-list-item>
  34. </uni-list>
  35. </view>
  36. <u-gap height="70"></u-gap>
  37. </view>
  38. </template>
  39. <script>
  40. import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
  41. import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
  42. import uGroup from '@/uni_modules/uni-group/uni-group.vue'
  43. import uSection from '@/uni_modules/uni-section/uni-section.vue'
  44. import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
  45. import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
  46. import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
  47. import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
  48. import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  49. import http from '@/http/api.js';
  50. export default {
  51. components: {
  52. uNavBar,
  53. uList,
  54. uListItem,
  55. uIcons,
  56. uGroup,
  57. },
  58. onLoad(option) {
  59. this.getPlanList();
  60. },
  61. data() {
  62. return {
  63. list: [],
  64. title: '巡检计划',
  65. desc: '',
  66. }
  67. },
  68. computed: {
  69. getIcon() {
  70. return path => {
  71. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  72. }
  73. },
  74. },
  75. onShow() {
  76. // uni.setNavigationBarTitle({
  77. // title: ""
  78. // });
  79. },
  80. created() {
  81. },
  82. methods: {
  83. toBack() {
  84. uni.navigateBack({
  85. delta: 1
  86. })
  87. },
  88. getPlanList() {
  89. var that = this;
  90. http.request({
  91. url: '/galaxy-test/equipment/inspection/plan/all/list',
  92. method: 'GET',
  93. }).then(res => {
  94. console.log(res)
  95. if (res.data != null) {
  96. that.list = res.data;
  97. }
  98. }).catch(err => {
  99. console.log(err)
  100. })
  101. },
  102. openPage(id) {
  103. var url = '/pages/equipment-inspection/equipmentinspectionreportrtulist?id=' + id;
  104. uni.navigateTo({
  105. url: url
  106. })
  107. },
  108. toPlanClose(id){
  109. },
  110. }
  111. }
  112. </script>
  113. <style>
  114. /* page {
  115. background-color: rgb(240, 242, 244);
  116. } */
  117. </style>
  118. <style lang="scss" scoped>
  119. .container {
  120. padding: 0 0 150rpx;
  121. }
  122. .u-cell-icon {
  123. width: 36rpx;
  124. height: 36rpx;
  125. margin-right: 8rpx;
  126. }
  127. .slot-box {
  128. /* #ifndef APP-NVUE */
  129. display: flex;
  130. /* #endif */
  131. flex-direction: row;
  132. align-items: center;
  133. }
  134. .slot-image {
  135. /* #ifndef APP-NVUE */
  136. display: block;
  137. /* #endif */
  138. margin-right: 10px;
  139. width: 30px;
  140. height: 30px;
  141. }
  142. .slot-text {
  143. flex: 1;
  144. font-size: 14px;
  145. color: #4cd964;
  146. margin-right: 10px;
  147. }
  148. .content-box {
  149. flex: 1;
  150. /* #ifdef APP-NVUE */
  151. justify-content: center;
  152. /* #endif */
  153. height: 100%;
  154. line-height: 44px;
  155. padding: 0 15px;
  156. position: relative;
  157. background-color: #fff;
  158. border-bottom-color: #f5f5f5;
  159. border-bottom-width: 1px;
  160. border-bottom-style: solid;
  161. }
  162. .content-text {
  163. font-size: 15px;
  164. }
  165. .example-body {
  166. /* #ifndef APP-NVUE */
  167. display: flex;
  168. /* #endif */
  169. flex-direction: row;
  170. justify-content: center;
  171. padding: 10px 0;
  172. background-color: #fff;
  173. }
  174. .button {
  175. border-color: #e5e5e5;
  176. border-style: solid;
  177. border-width: 1px;
  178. padding: 4px 8px;
  179. border-radius: 4px;
  180. }
  181. .button-text {
  182. font-size: 15px;
  183. }
  184. .slot-button {
  185. /* #ifndef APP-NVUE */
  186. display: flex;
  187. height: 100%;
  188. /* #endif */
  189. flex: 1;
  190. flex-direction: row;
  191. justify-content: center;
  192. align-items: center;
  193. padding: 0 20px;
  194. background-color: #ff5a5f;
  195. }
  196. .slot-button-text {
  197. color: #ffffff;
  198. font-size: 14px;
  199. }
  200. </style>