equipmentinspectionlist.vue 10 KB

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