resetrecord.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="work-container">
  3. <view class="header">
  4. <u-search placeholder="请输入设备名称" :clearabled="true" @clear="searchDevice" @custom="searchDevice" v-model="search.deviceName" @search="searchDevice"></u-search>
  5. </view>
  6. <view style="margin-top: 10px">
  7. <uni-card v-for="item in resetList" :title="item.deviceName" :extra="item.createTime">
  8. <view style="position: relative">
  9. <view>设备编号:{{item.deviceNo}}</view>
  10. <view>操作人:{{item.userName}}</view>
  11. <view>原机构:{{item.oriDeptName}}</view>
  12. <!-- <view v-if="item.status != 3" style="width: 50px;position: absolute;right:-10px;bottom:0px"><u-button @click="handle(item)" type="error" :plain="true" size="mini" text="处理"></u-button>-->
  13. <!-- </view>-->
  14. </view>
  15. </uni-card>
  16. <uni-load-more @clickLoadMore="getMore" :contentText="contenText" :status="loadStatus"></uni-load-more>
  17. <u-modal :show="showErrDlg" title="处理结果" @confirm="close" >
  18. <view class="slot-content">
  19. <u--textarea style="width:500rpx" autoheight v-model="chooseItem.result" disabled="" ></u--textarea>
  20. </view>
  21. </u-modal>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import {resetList} from '@/api/device/device';
  27. export default {
  28. data() {
  29. return {
  30. show:true,
  31. resetList:[],
  32. search:{
  33. deviceName:""
  34. },
  35. pageNum:1,
  36. pageSize:10,
  37. chooseItem: {},
  38. contenText:{contentdown: "点击加载更多",contentrefresh: "正在加载...",contentnomore: "没有更多数据了"},
  39. loadStatus:"more",
  40. showErrDlg:false,
  41. }
  42. },
  43. onLoad(){
  44. this.getresetList();
  45. },
  46. methods: {
  47. searchDevice(){
  48. this.pageNum =1;
  49. this.resetList=[];
  50. this.getresetList();
  51. },
  52. getMore(){
  53. this.pageNum ++;
  54. this.getresetList();
  55. },
  56. open(item) {
  57. this.chooseItem = item;
  58. this.showErrDlg = true;
  59. },
  60. close() {
  61. this.chooseItem = {};
  62. this.showErrDlg = false;
  63. },
  64. confirm(text){
  65. if(!text){
  66. uni.showToast({
  67. icon:"error",
  68. title:"请输入内容"
  69. })
  70. return;
  71. }
  72. let item = this.chooseItem;
  73. item.remark = text;
  74. this.close();
  75. handleAlert(item).then(res=>{
  76. if(res.code == 200){
  77. item.status = 3;
  78. }
  79. })
  80. },
  81. searchDept(){
  82. this.getDeptList();
  83. },
  84. watchResult(item){
  85. this.open(item);
  86. },
  87. handle(item){
  88. this.open(item);
  89. },
  90. getresetList(){
  91. this.loadStatus = "loading"
  92. resetList(this.pageNum,this.pageSize,this.search.deviceName).then(res=>{
  93. if(res.total == this.resetList.length){
  94. uni.showToast({
  95. icon:"none",
  96. title:"没有更多了"
  97. })
  98. this.loadStatus = "noMore"
  99. return;
  100. }
  101. this.loadStatus = "more"
  102. this.resetList = this.resetList.concat(res.rows);
  103. });
  104. }
  105. }
  106. }
  107. </script>
  108. <style lang="scss">
  109. /* #ifndef APP-NVUE */
  110. .u-collapse-content{
  111. display: flex;
  112. flex-direction: column;
  113. }
  114. page {
  115. display: flex;
  116. flex-direction: column;
  117. box-sizing: border-box;
  118. background-color: #fff;
  119. min-height: 100%;
  120. height: auto;
  121. }
  122. view {
  123. font-size: 14px;
  124. line-height: inherit;
  125. }
  126. /* #endif */
  127. .text {
  128. text-align: center;
  129. font-size: 26rpx;
  130. margin-top: 10rpx;
  131. }
  132. .grid-item-box {
  133. flex: 1;
  134. /* #ifndef APP-NVUE */
  135. display: flex;
  136. /* #endif */
  137. flex-direction: column;
  138. align-items: center;
  139. justify-content: center;
  140. padding: 15px 0;
  141. }
  142. .uni-margin-wrap {
  143. width: 690rpx;
  144. width: 100%;
  145. ;
  146. }
  147. .swiper {
  148. height: 300rpx;
  149. }
  150. .swiper-box {
  151. height: 150px;
  152. }
  153. .swiper-item {
  154. /* #ifndef APP-NVUE */
  155. display: flex;
  156. /* #endif */
  157. flex-direction: column;
  158. justify-content: center;
  159. align-items: center;
  160. color: #fff;
  161. height: 300rpx;
  162. line-height: 300rpx;
  163. }
  164. @media screen and (min-width: 500px) {
  165. .uni-swiper-dot-box {
  166. width: 400px;
  167. /* #ifndef APP-NVUE */
  168. margin: 0 auto;
  169. /* #endif */
  170. margin-top: 8px;
  171. }
  172. .image {
  173. width: 100%;
  174. }
  175. }
  176. </style>