myequipmentinspectionreportrtulist.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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. <uSection title="">
  9. <uni-search-bar placeholder="请录入测站编码或测站名称" @confirm="search" :focus="false" v-model="searchVal"
  10. @blur="blur" @focus="focus" @input="input" @cancel="cancel" @clear="clear">
  11. </uni-search-bar>
  12. </uSection>
  13. <uSection title="">
  14. <uList>
  15. <uni-list-item v-for="item in list" :key="item.id">
  16. <!-- 自定义 body -->
  17. <template v-slot:body>
  18. <view style="height: 100px;width: 100%;display: flex;flex-direction: column;">
  19. <view
  20. style="display: flex;flex-direction: row;width: 100%;justify-content: flex-start;">
  21. <view
  22. style="font-size: 1rem;font-weight: bold;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
  23. {{item.rtuName}}
  24. </view>
  25. </view>
  26. <view style="margin-top: 10rpx;">
  27. <text style="font-size: 0.9rem;color: gray;">{{item.rtuCode}}</text>
  28. </view>
  29. <view
  30. style="margin-top: 10rpx;padding-left: 0rpx;padding-right: 0rpx;display: flex;flex-direction: row;justify-content: center;">
  31. <view v-if="item.reportStatus == 0" style="width: 100%;">
  32. <button style="background-color: lightblue;" type="default"
  33. @click="openPage(item.rtuCode)">开始填报</button>
  34. </view>
  35. <view v-if="item.reportStatus == 1" style="width: 100%;">
  36. <button type="default" @click="toPlanClose(item.id)">已提交</button>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. </uni-list-item>
  42. </uList>
  43. </uSection>
  44. <uGroup>
  45. <view class="uni-pagination-box">
  46. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  47. @change="change" />
  48. </view>
  49. </uGroup>
  50. </view>
  51. <u-gap height="70"></u-gap>
  52. </view>
  53. </template>
  54. <script>
  55. import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
  56. import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
  57. import uGroup from '@/uni_modules/uni-group/uni-group.vue'
  58. import uSection from '@/uni_modules/uni-section/uni-section.vue'
  59. import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
  60. import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
  61. import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
  62. import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
  63. import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  64. import http from '@/http/api.js';
  65. export default {
  66. components: {
  67. uNavBar,
  68. uList,
  69. uListItem,
  70. uIcons,
  71. uGroup,
  72. uSection,
  73. },
  74. onLoad(option) {
  75. this.planId = option.id;
  76. this.getProjectTree();
  77. },
  78. data() {
  79. return {
  80. planId: 0,
  81. orgId: '',
  82. projectId: '',
  83. list: [],
  84. title: '测站巡检填报管理',
  85. desc: '',
  86. pageSize: 10,
  87. // 当前页
  88. pageCurrent: 1,
  89. // 数据总量
  90. total: 0,
  91. projectTree: [],
  92. selectedTreeNode: '',
  93. searchVal: '',
  94. }
  95. },
  96. computed: {
  97. getIcon() {
  98. return path => {
  99. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  100. }
  101. },
  102. },
  103. onShow() {
  104. // uni.setNavigationBarTitle({
  105. // title: ""
  106. // });
  107. //this.getProjectTree();
  108. //this.getRtuList();
  109. },
  110. methods: {
  111. toBack() {
  112. uni.navigateBack({
  113. delta: 1
  114. })
  115. },
  116. // 分页触发
  117. change(e) {
  118. //this.$refs.table.clearSelection()
  119. //this.selectedIndexs.length = 0
  120. this.pageCurrent = e.current;
  121. this.getRtuList()
  122. },
  123. onnodeclick(node) {
  124. this.orgId = node.orgId;
  125. this.projectId = node.projectId;
  126. console.log('1111111orgId:', this.orgId);
  127. console.log('1111111projectId:', this.projectId);
  128. },
  129. onpopupopened(e) {
  130. //console.log('popupopened');
  131. },
  132. onpopupclosed(e) {
  133. // console.log('popupclosed');
  134. },
  135. onchange(e) {
  136. console.log('onchange:', e.detail.value);
  137. this.searchVal = '';
  138. this.pageCurrent = 1;
  139. // this.orgId = e.detail.orgId;
  140. // this.projectId = e.detail.projectId;
  141. // if (e.detail.value.length > 0) {
  142. // let ids = this.selectedTreeNode.split("-");
  143. // this.orgId = ids[0];
  144. // if (ids[1] === '0') {
  145. // this.projectId = '';
  146. // } else {
  147. // this.projectId = ids[1];
  148. // }
  149. // console.log('1111111orgId:', this.orgId);
  150. // console.log('1111111projectId:', this.projectId);
  151. // } else {
  152. // this.orgId = '';
  153. // this.projectId = '';
  154. // }
  155. this.getRtuList();
  156. },
  157. search(res) {
  158. // uni.showToast({
  159. // title: '搜索:' + res.value,
  160. // icon: 'none'
  161. // })
  162. this.getRtuList();
  163. },
  164. input(res) {
  165. // console.log('----input:', res)
  166. },
  167. clear(res) {
  168. // uni.showToast({
  169. // title: 'clear事件,清除值为:' + res.value,
  170. // icon: 'none'
  171. // })
  172. this.searchVal = '';
  173. this.getRtuList();
  174. },
  175. blur(res) {
  176. // uni.showToast({
  177. // title: 'blur事件,输入值为:' + res.value,
  178. // icon: 'none'
  179. // })
  180. },
  181. focus(e) {
  182. // uni.showToast({
  183. // title: 'focus事件,输出值为:' + e.value,
  184. // icon: 'none'
  185. // })
  186. },
  187. cancel(res) {
  188. // uni.showToast({
  189. // title: '点击取消,输入值为:' + res.value,
  190. // icon: 'none'
  191. // })
  192. this.searchVal = '';
  193. this.getRtuList();
  194. },
  195. onBackPress() {
  196. // #ifdef APP-PLUS
  197. plus.key.hideSoftKeybord();
  198. // #endif
  199. },
  200. getProjectTree() {
  201. var that = this;
  202. http.request({
  203. url: '/galaxy-test/rtu/manage/tree',
  204. method: 'GET',
  205. }).then(res => {
  206. console.log(res)
  207. if (res.data != null) {
  208. that.projectTree = res.data;
  209. console.log("ffffffff " + that.projectTree[0].orgId)
  210. that.selectedTreeNode = that.projectTree[0].value;
  211. that.orgId = that.projectTree[0].orgId;
  212. that.projectId = that.projectTree[0].projectId;
  213. //that.getRtuList();
  214. }
  215. }).catch(err => {
  216. console.log(err)
  217. })
  218. },
  219. getRtuList(res) {
  220. // uni.showToast({
  221. // title: '搜索:' + res.value,
  222. // icon: 'none'
  223. // })
  224. this.getRtuList();
  225. },
  226. getRtuList() {
  227. var that = this;
  228. const current = this.pageCurrent;
  229. const size = this.pageSize;
  230. const isSubmit = '0';
  231. var postData = {};
  232. postData['id'] = this.planId;
  233. postData['orgId'] = this.orgId;
  234. postData['projectId'] = this.projectId;
  235. console.log(postData)
  236. http.request({
  237. url: '/galaxy-test/equipment/inspection/plan/my/rtu/page',
  238. method: 'GET',
  239. params: {
  240. current,
  241. size,
  242. isSubmit
  243. },
  244. data: postData,
  245. }).then(res => {
  246. console.log(res)
  247. if (res.data.records != null) {
  248. that.list = res.data.records;
  249. }
  250. this.total = res.data.total;
  251. }).catch(err => {
  252. console.log(err)
  253. })
  254. },
  255. openPage(rtuCode) {
  256. var url = '/pages/equipment-inspection/equipmentinspectionreport?planId=' + this.planId +
  257. '&rtuCode=' +
  258. rtuCode;
  259. uni.navigateTo({
  260. url: url
  261. })
  262. },
  263. toPlanClose(id) {
  264. },
  265. }
  266. }
  267. </script>
  268. <style>
  269. /* page {
  270. background-color: rgb(240, 242, 244);
  271. } */
  272. </style>
  273. <style lang="scss" scoped>
  274. .container {
  275. padding: 0 0 150rpx;
  276. }
  277. .u-cell-icon {
  278. width: 36rpx;
  279. height: 36rpx;
  280. margin-right: 8rpx;
  281. }
  282. .slot-box {
  283. /* #ifndef APP-NVUE */
  284. display: flex;
  285. /* #endif */
  286. flex-direction: row;
  287. align-items: center;
  288. }
  289. .slot-image {
  290. /* #ifndef APP-NVUE */
  291. display: block;
  292. /* #endif */
  293. margin-right: 10px;
  294. width: 30px;
  295. height: 30px;
  296. }
  297. .slot-text {
  298. flex: 1;
  299. font-size: 14px;
  300. color: #4cd964;
  301. margin-right: 10px;
  302. }
  303. .content-box {
  304. flex: 1;
  305. /* #ifdef APP-NVUE */
  306. justify-content: center;
  307. /* #endif */
  308. height: 100%;
  309. line-height: 44px;
  310. padding: 0 15px;
  311. position: relative;
  312. background-color: #fff;
  313. border-bottom-color: #f5f5f5;
  314. border-bottom-width: 1px;
  315. border-bottom-style: solid;
  316. }
  317. .content-text {
  318. font-size: 15px;
  319. }
  320. .example-body {
  321. /* #ifndef APP-NVUE */
  322. display: flex;
  323. /* #endif */
  324. flex-direction: row;
  325. justify-content: center;
  326. padding: 10px 0;
  327. background-color: #fff;
  328. }
  329. .button {
  330. border-color: #e5e5e5;
  331. border-style: solid;
  332. border-width: 1px;
  333. padding: 4px 8px;
  334. border-radius: 4px;
  335. }
  336. .button-text {
  337. font-size: 15px;
  338. }
  339. .slot-button {
  340. /* #ifndef APP-NVUE */
  341. display: flex;
  342. height: 100%;
  343. /* #endif */
  344. flex: 1;
  345. flex-direction: row;
  346. justify-content: center;
  347. align-items: center;
  348. padding: 0 20px;
  349. background-color: #ff5a5f;
  350. }
  351. .slot-button-text {
  352. color: #ffffff;
  353. font-size: 14px;
  354. }
  355. </style>