checkReportList.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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. <!-- <uni-swipe-action ref="swipeAction">
  10. <uni-swipe-action-item :right-options="options"
  11. @change="swipeChange($event, index)" @click="swipeClick($event, index)">
  12. <view class="content-box"> -->
  13. <view style="height: 200px;width: 100%;display: flex;flex-direction: column;">
  14. <view style="display: flex;flex-direction: row;width: 100%;justify-content: flex-start;">
  15. <view style="font-size: 18px;font-weight: bold;width: 88%;">问题编号:{{item.failureCheckNo}}
  16. </view>
  17. <view style="width: 10%;" @click="delRecord(item.id)">
  18. <uni-icons type="trash" size="30"></uni-icons>
  19. </view>
  20. </view>
  21. <view>
  22. <text
  23. style="margin-right: 10px;font-weight: bolder;">检查点位:</text><text>{{item.failureCheckPointDesc}}</text>
  24. </view>
  25. <view>
  26. <text style="margin-right: 10px;font-weight: bolder;">问题描述:</text>
  27. <view style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
  28. {{item.failureHiddenDangerDesc}}
  29. </view>
  30. </view>
  31. <view style="display: flex;flex-direction: row;min-height: 30px;">
  32. <view style="width: 200px;">{{item.createTime}}</view>
  33. <view style="color: #18B566;">{{item.checkUserName}}</view>
  34. </view>
  35. <view style="margin-top: 5px;padding-left: 0px;padding-right: 0px;">
  36. <button type="default" @click="openPage(item.id)">编辑</button>
  37. </view>
  38. </view>
  39. <!-- </view>
  40. </uni-swipe-action-item>
  41. </uni-swipe-action> -->
  42. </template>
  43. </uni-list-item>
  44. </uni-list>
  45. </view>
  46. <!-- <view class="list-wrap">
  47. <u-cell-item :titleStyle="{fontWeight: 500}" @click="openPage(item.id)" :title="getTitle(item.failureCheckNo)"
  48. v-for="(item, index) in list" :key="index" >
  49. <view>fff</view>
  50. </u-cell-item>
  51. </view> -->
  52. <u-gap height="70"></u-gap>
  53. </view>
  54. </template>
  55. <script>
  56. import pageNav from '@/components/page-nav/page-nav.vue';
  57. import http from '@/http/api.js';
  58. export default {
  59. components: {
  60. pageNav
  61. },
  62. onLoad(option) {
  63. this.loadList();
  64. },
  65. data() {
  66. return {
  67. list: [],
  68. title: '问题列表管理',
  69. desc: '',
  70. options: [{
  71. text: '置顶'
  72. },
  73. {
  74. text: '删除',
  75. style: {
  76. backgroundColor: 'rgb(255,58,49)'
  77. }
  78. }
  79. ],
  80. }
  81. },
  82. computed: {
  83. getIcon() {
  84. return path => {
  85. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  86. }
  87. },
  88. },
  89. onShow() {
  90. uni.setNavigationBarTitle({
  91. title: ""
  92. });
  93. },
  94. created() {
  95. },
  96. methods: {
  97. loadList() {
  98. const current = 1;
  99. const size = 1000;
  100. const isSubmit = '0';
  101. var reportList = [];
  102. http.request({
  103. url: '/blade-business/report/failure/queryPage',
  104. method: 'GET',
  105. params: {
  106. current,
  107. size,
  108. isSubmit
  109. }
  110. }).then(res => {
  111. if (res.data.records != null) {
  112. const listSize = res.data.records['length'];
  113. for (var i = 0; i < listSize; i++) {
  114. let report = res.data.records['' + i];
  115. reportList.push(report);
  116. }
  117. }
  118. }).catch(err => {
  119. console.log(err)
  120. })
  121. this.list = reportList;
  122. },
  123. openPage(id) {
  124. this.$u.route({
  125. url: '/pages/checkReport/editCheckReport?id=' + id
  126. })
  127. },
  128. getTitle(checkNo) {
  129. return "问题编号:" + checkNo;
  130. },
  131. swipeChange(e, index) {
  132. console.log('返回:', e);
  133. console.log('当前索引:', index);
  134. },
  135. swipeClick(e, index) {
  136. },
  137. delRecord(id) {
  138. const that = this;
  139. uni.showModal({
  140. content: '确定删除记录?',
  141. showCancel: true,
  142. success(res) {
  143. if (res.confirm) {
  144. var ids = id;
  145. http.request({
  146. url: '/blade-business/report/failure/remove',
  147. method: 'POST',
  148. params: {
  149. ids
  150. }
  151. }).then(res => {
  152. console.log(JSON.stringify(res.data))
  153. if (res.success) {
  154. uni.showModal({
  155. content: '删除已成功',
  156. showCancel: false,
  157. success(res) {
  158. if (res.confirm) {
  159. that.loadList();
  160. }
  161. }
  162. });
  163. }
  164. }).catch(err => {
  165. console.log(err)
  166. })
  167. }
  168. }
  169. });
  170. }
  171. }
  172. }
  173. </script>
  174. <style>
  175. /* page {
  176. background-color: rgb(240, 242, 244);
  177. } */
  178. </style>
  179. <style lang="scss" scoped>
  180. .u-cell-icon {
  181. width: 36rpx;
  182. height: 36rpx;
  183. margin-right: 8rpx;
  184. }
  185. .slot-box {
  186. /* #ifndef APP-NVUE */
  187. display: flex;
  188. /* #endif */
  189. flex-direction: row;
  190. align-items: center;
  191. }
  192. .slot-image {
  193. /* #ifndef APP-NVUE */
  194. display: block;
  195. /* #endif */
  196. margin-right: 10px;
  197. width: 30px;
  198. height: 30px;
  199. }
  200. .slot-text {
  201. flex: 1;
  202. font-size: 14px;
  203. color: #4cd964;
  204. margin-right: 10px;
  205. }
  206. .content-box {
  207. flex: 1;
  208. /* #ifdef APP-NVUE */
  209. justify-content: center;
  210. /* #endif */
  211. height: 100%;
  212. line-height: 44px;
  213. padding: 0 15px;
  214. position: relative;
  215. background-color: #fff;
  216. border-bottom-color: #f5f5f5;
  217. border-bottom-width: 1px;
  218. border-bottom-style: solid;
  219. }
  220. .content-text {
  221. font-size: 15px;
  222. }
  223. .example-body {
  224. /* #ifndef APP-NVUE */
  225. display: flex;
  226. /* #endif */
  227. flex-direction: row;
  228. justify-content: center;
  229. padding: 10px 0;
  230. background-color: #fff;
  231. }
  232. .button {
  233. border-color: #e5e5e5;
  234. border-style: solid;
  235. border-width: 1px;
  236. padding: 4px 8px;
  237. border-radius: 4px;
  238. }
  239. .button-text {
  240. font-size: 15px;
  241. }
  242. .slot-button {
  243. /* #ifndef APP-NVUE */
  244. display: flex;
  245. height: 100%;
  246. /* #endif */
  247. flex: 1;
  248. flex-direction: row;
  249. justify-content: center;
  250. align-items: center;
  251. padding: 0 20px;
  252. background-color: #ff5a5f;
  253. }
  254. .slot-button-text {
  255. color: #ffffff;
  256. font-size: 14px;
  257. }
  258. </style>