checkReportListManage.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <view class="wrap">
  3. <page-nav :desc="desc" :title="title"></page-nav>
  4. <view class="container">
  5. <uni-list>
  6. <uni-list-item v-for="(item, index) in list" :key="index">
  7. <!-- 自定义 body -->
  8. <template v-slot:body>
  9. <view style="height: 200px;width: 100%;display: flex;flex-direction: column;">
  10. <view style="display: flex;flex-direction: row;width: 100%;justify-content: flex-start;">
  11. <view style="font-size: 18px;font-weight: bold;width: 88%;">问题编号:{{item.failureCheckNo}}
  12. </view>
  13. <view style="width: 10%;" @click="delRecord(item.id)">
  14. <uni-icons type="trash" size="30"></uni-icons>
  15. </view>
  16. </view>
  17. <view>
  18. <text
  19. style="margin-right: 10px;font-weight: bolder;">检查点位:</text><text>{{item.failureCheckPointDesc}}</text>
  20. </view>
  21. <view>
  22. <text style="margin-right: 10px;font-weight: bolder;">问题描述:</text>
  23. <view style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
  24. {{item.failureHiddenDangerDesc}}
  25. </view>
  26. </view>
  27. <view style="display: flex;flex-direction: row;min-height: 30px;">
  28. <view style="width: 200px;">{{item.createTime}}</view>
  29. <view style="color: #18B566;">{{item.checkUserName}}</view>
  30. </view>
  31. <view style="margin-top: 5px;padding-left: 0px;padding-right: 0px;">
  32. <button type="default" @click="openPage(item.id)">编辑</button>
  33. </view>
  34. </view>
  35. </template>
  36. </uni-list-item>
  37. </uni-list>
  38. </view>
  39. <u-gap height="70"></u-gap>
  40. </view>
  41. </template>
  42. <script>
  43. import pageNav from '@/components/page-nav/page-nav.vue';
  44. import http from '@/http/api.js';
  45. export default {
  46. components: {
  47. pageNav
  48. },
  49. onLoad(option) {
  50. this.loadList();
  51. const current = 1;
  52. const size = 1000;
  53. const isSubmit = '0';
  54. var reportList = [];
  55. http.request({
  56. url: '/blade-business/report/failure/queryPage',
  57. method: 'GET',
  58. params: {
  59. current,
  60. size,
  61. isSubmit
  62. }
  63. }).then(res => {
  64. console.log(res.data)
  65. if (res.data.records != null) {
  66. const listSize = res.data.records['length'];
  67. for (var i = 0; i < listSize; i++) {
  68. let report = res.data.records['' + i];
  69. reportList.push(report);
  70. }
  71. }
  72. }).catch(err => {
  73. console.log(err)
  74. })
  75. this.list = reportList;
  76. },
  77. data() {
  78. return {
  79. list: [],
  80. title: '问题管理',
  81. desc: ''
  82. }
  83. },
  84. computed: {
  85. getIcon() {
  86. return path => {
  87. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  88. }
  89. },
  90. },
  91. onShow() {
  92. uni.setNavigationBarTitle({
  93. title: "问题管理"
  94. });
  95. },
  96. created() {
  97. },
  98. methods: {
  99. openPage(id) {
  100. const basePath = '/pages/checkReport/editCheckReport';
  101. const path = basePath + '?id=' + id;
  102. this.$u.route({
  103. url: path
  104. })
  105. },
  106. loadList() {
  107. const current = 1;
  108. const size = 1000;
  109. const isSubmit = '0';
  110. var reportList = [];
  111. http.request({
  112. url: '/blade-business/report/failure/queryPage',
  113. method: 'GET',
  114. params: {
  115. current,
  116. size,
  117. isSubmit
  118. }
  119. }).then(res => {
  120. if (res.data.records != null) {
  121. const listSize = res.data.records['length'];
  122. for (var i = 0; i < listSize; i++) {
  123. let report = res.data.records['' + i];
  124. reportList.push(report);
  125. }
  126. }
  127. }).catch(err => {
  128. console.log(err)
  129. })
  130. this.list = reportList;
  131. },
  132. delRecord(id) {
  133. const that = this;
  134. uni.showModal({
  135. content: '确定删除记录?',
  136. showCancel: true,
  137. success(res) {
  138. if (res.confirm) {
  139. var ids = id;
  140. http.request({
  141. url: '/blade-business/report/failure/remove',
  142. method: 'POST',
  143. params: {
  144. ids
  145. }
  146. }).then(res => {
  147. console.log(JSON.stringify(res.data))
  148. if (res.success) {
  149. uni.showModal({
  150. content: '删除已成功',
  151. showCancel: false,
  152. success(res) {
  153. if (res.confirm) {
  154. that.loadList();
  155. }
  156. }
  157. });
  158. }
  159. }).catch(err => {
  160. console.log(err)
  161. })
  162. }
  163. }
  164. });
  165. }
  166. }
  167. }
  168. </script>
  169. <style>
  170. /* page {
  171. background-color: rgb(240, 242, 244);
  172. } */
  173. </style>
  174. <style lang="scss" scoped>
  175. .u-cell-icon {
  176. width: 36rpx;
  177. height: 36rpx;
  178. margin-right: 8rpx;
  179. }
  180. .slot-box {
  181. /* #ifndef APP-NVUE */
  182. display: flex;
  183. /* #endif */
  184. flex-direction: row;
  185. align-items: center;
  186. }
  187. .slot-image {
  188. /* #ifndef APP-NVUE */
  189. display: block;
  190. /* #endif */
  191. margin-right: 10px;
  192. width: 30px;
  193. height: 30px;
  194. }
  195. .slot-text {
  196. flex: 1;
  197. font-size: 14px;
  198. color: #4cd964;
  199. margin-right: 10px;
  200. }
  201. </style>