equipmentinspectionreportlist.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <view class="wrap">
  3. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  4. @clickLeft="toBack">
  5. <view style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
  6. <text style="color: white;font-size: 1rem;">{{title}}</text>
  7. </view>
  8. </uni-nav-bar>
  9. <view class="container">
  10. <uSection title="查询" titleFontSize="0.8rem" type="line" style="padding-left: 10px;padding-right: 10px;">
  11. <uni-data-picker placeholder="请选择机构" popup-title="请选择所在地区" :localdata="projectTree"
  12. v-model="selectedTreeNode" @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened"
  13. @popupclosed="onpopupclosed">
  14. </uni-data-picker>
  15. </uSection>
  16. <view>
  17. <uni-search-bar placeholder="请录入测站编码或测站名称" @confirm="search" :focus="false" v-model="searchValue"
  18. @blur="blur" @focus="focus" @input="input" @cancel="cancel" @clear="clear">
  19. </uni-search-bar>
  20. </view>
  21. <uSection title="">
  22. <uList>
  23. <uni-list-item v-for="item in list" :key="item.id">
  24. <template v-slot:body>
  25. <view style="width: 100%;display: flex;flex-direction: column;">
  26. <view
  27. style="width:100%;display:flex;flex-direction: row;justify-content: flex-start;align-items: center;">
  28. <image class="order-title-image" style="box-shadow:0 0 2px 2px lightblue"
  29. src="/static/images/home/n3.png" mode="widthFix">
  30. </image>
  31. <text
  32. style="margin-left: 10rpx; font-size: 1rem;font-weight: bold;">{{item.rtuName}}</text>
  33. <text style="margin-left:8rpx;font-size: 0.9rem;">[{{item.rtuCode}}]</text>
  34. </view>
  35. <view style="display: flex;flex-direction: row;align-items: center;">
  36. <uIcons class="input-uni-icon" type="auth" size="18" color="skyblue" />
  37. <view style="margin-left:5px;font-size: 0.8rem;">
  38. {{item.servicePersonName}}
  39. </view>
  40. </view>
  41. <view style="margin-top: 5px;display: flex;flex-direction: row;align-items: center;">
  42. <uIcons class="input-uni-icon" type="notification" size="18" color="skyblue" />
  43. <text style="font-size: 0.8rem;">填报时间:</text>
  44. <text
  45. style="margin-left:5px;font-size: 0.8rem;color:green">{{item.updateTime}}</text>
  46. </view>
  47. <view
  48. style="height:22%;padding-top:4px;display: flex;flex-direction: row;justify-content: flex-end;">
  49. <view
  50. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  51. @click="onToDetailClick(item.id)">
  52. <view style="display:flex;flex-direction: column;justify-content: center;">
  53. <uIcons class="input-uni-icon" type="compose" size="18" color="coral" />
  54. </view>
  55. <view
  56. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  57. <text style="color:black;font-size:0.7rem">查看详情</text>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. </uni-list-item>
  64. </uList>
  65. </uSection>
  66. <uGroup>
  67. <view class="uni-pagination-box">
  68. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  69. @change="change" />
  70. </view>
  71. </uGroup>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
  77. import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
  78. import uGroup from '@/uni_modules/uni-group/uni-group.vue'
  79. import uSection from '@/uni_modules/uni-section/uni-section.vue'
  80. import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
  81. import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
  82. import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
  83. import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
  84. import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  85. import http from '@/http/api.js';
  86. export default {
  87. components: {
  88. uNavBar,
  89. uList,
  90. uListItem,
  91. uIcons,
  92. uGroup,
  93. uSection,
  94. uDataPicker,
  95. uPagination,
  96. uBreadcrumb,
  97. },
  98. onLoad(option) {
  99. this.getProjectTree();
  100. },
  101. data() {
  102. return {
  103. planId: 0,
  104. orgId: '',
  105. projectId: '',
  106. list: [],
  107. title: '设备巡检填报信息',
  108. desc: '',
  109. pageSize: 10,
  110. // 当前页
  111. pageCurrent: 1,
  112. // 数据总量
  113. total: 0,
  114. projectTree: [],
  115. selectedTreeNode: '',
  116. searchValue: '',
  117. }
  118. },
  119. computed: {
  120. getIcon() {
  121. return path => {
  122. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  123. }
  124. },
  125. },
  126. onShow() {
  127. },
  128. methods: {
  129. toBack() {
  130. uni.navigateBack({
  131. delta: 1
  132. })
  133. },
  134. // 分页触发
  135. change(e) {
  136. this.pageCurrent = e.current;
  137. this.getReportRecord()
  138. },
  139. onnodeclick(node) {
  140. if (node.projectId != null) {
  141. this.orgId = node.orgId;
  142. this.projectId = node.projectId;
  143. this.searchValue = '';
  144. this.pageCurrent = 1;
  145. this.getReportRecord();
  146. }
  147. },
  148. onpopupopened(e) {
  149. },
  150. onpopupclosed(e) {
  151. },
  152. onchange(e) {
  153. },
  154. search(res) {
  155. this.getReportRecord();
  156. },
  157. input(res) {
  158. },
  159. clear(res) {
  160. this.searchValue = '';
  161. this.getReportRecord();
  162. },
  163. blur(res) {
  164. },
  165. focus(e) {
  166. },
  167. cancel(res) {
  168. this.searchValue = '';
  169. this.getReportRecord();
  170. },
  171. onBackPress() {
  172. // #ifdef APP-PLUS
  173. plus.key.hideSoftKeybord();
  174. // #endif
  175. },
  176. getProjectTree() {
  177. var that = this;
  178. http.request({
  179. url: '/galaxy-test/rtu/manage/tree',
  180. method: 'GET',
  181. }).then(res => {
  182. if (res.data != null) {
  183. that.projectTree = res.data;
  184. that.selectedTreeNode = that.projectTree[0].value;
  185. that.orgId = that.projectTree[0].orgId;
  186. that.projectId = that.projectTree[0].projectId;
  187. that.getReportRecord();
  188. }
  189. }).catch(err => {
  190. console.log(err)
  191. })
  192. },
  193. getReportRecord() {
  194. const that = this;
  195. const current = this.pageCurrent;
  196. const size = this.pageSize;
  197. const isSubmit = '0';
  198. let postData = {};
  199. http.request({
  200. url: '/galaxy-test/equipment/inspection/report/my/page',
  201. method: 'GET',
  202. params: {
  203. current,
  204. size,
  205. isSubmit
  206. },
  207. data: postData,
  208. }).then(res => {
  209. if (res.data != null) {
  210. if (res.data.records != null) {
  211. that.list = res.data.records;
  212. }
  213. this.total = res.data.total;
  214. }
  215. }).catch(err => {
  216. console.log(err)
  217. })
  218. },
  219. onToDetailClick(id) {
  220. var url = '/pages/equipment-inspection/equipmentinspectionreportdetail?id=' + id;
  221. uni.navigateTo({
  222. url: url
  223. })
  224. },
  225. }
  226. }
  227. </script>
  228. <style>
  229. /* page {
  230. background-color: rgb(240, 242, 244);
  231. } */
  232. </style>
  233. <style lang="scss" scoped>
  234. .container {
  235. padding: 0 0 150rpx;
  236. }
  237. .order-title-image {
  238. /* #ifndef APP-NVUE */
  239. display: block;
  240. /* #endif */
  241. // margin-right: 10px;
  242. width: 20px;
  243. height: 20px;
  244. border-radius: 50%;
  245. }
  246. .u-cell-icon {
  247. width: 36rpx;
  248. height: 36rpx;
  249. margin-right: 8rpx;
  250. }
  251. .slot-box {
  252. /* #ifndef APP-NVUE */
  253. display: flex;
  254. /* #endif */
  255. flex-direction: row;
  256. align-items: center;
  257. }
  258. .slot-image {
  259. /* #ifndef APP-NVUE */
  260. display: block;
  261. /* #endif */
  262. margin-right: 10px;
  263. width: 30px;
  264. height: 30px;
  265. }
  266. .slot-text {
  267. flex: 1;
  268. font-size: 14px;
  269. color: #4cd964;
  270. margin-right: 10px;
  271. }
  272. .content-box {
  273. flex: 1;
  274. /* #ifdef APP-NVUE */
  275. justify-content: center;
  276. /* #endif */
  277. height: 100%;
  278. line-height: 44px;
  279. padding: 0 15px;
  280. position: relative;
  281. background-color: #fff;
  282. border-bottom-color: #f5f5f5;
  283. border-bottom-width: 1px;
  284. border-bottom-style: solid;
  285. }
  286. .content-text {
  287. font-size: 15px;
  288. }
  289. .example-body {
  290. /* #ifndef APP-NVUE */
  291. display: flex;
  292. /* #endif */
  293. flex-direction: row;
  294. justify-content: center;
  295. padding: 10px 0;
  296. background-color: #fff;
  297. }
  298. .button {
  299. border-color: #e5e5e5;
  300. border-style: solid;
  301. border-width: 1px;
  302. padding: 4px 8px;
  303. border-radius: 4px;
  304. }
  305. .button-text {
  306. font-size: 15px;
  307. }
  308. .slot-button {
  309. /* #ifndef APP-NVUE */
  310. display: flex;
  311. height: 100%;
  312. /* #endif */
  313. flex: 1;
  314. flex-direction: row;
  315. justify-content: center;
  316. align-items: center;
  317. padding: 0 20px;
  318. background-color: #ff5a5f;
  319. }
  320. .slot-button-text {
  321. color: #ffffff;
  322. font-size: 14px;
  323. }
  324. </style>