uncomfirecheckorderlist.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <!--
  2. * @Title:
  3. * @Description: 新任务,可以进行确认操作
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="wrap">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view class="nav-title">
  14. <text>{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <view style="padding-left: 5px;padding-right: 5px;">
  19. <uni-collapse v-model="value">
  20. <uni-collapse-item title="异常类别筛选条件" :show-animation="true">
  21. <view class="select-checkbox">
  22. <uni-data-checkbox v-model="warnKindOption" :localdata="warnKindItems"
  23. @change="warnKindOptionChange">
  24. </uni-data-checkbox>
  25. </view>
  26. </uni-collapse-item>
  27. </uni-collapse>
  28. </view>
  29. <uni-list>
  30. <uni-list-item v-for="item in list" :key="item.id">
  31. <template v-slot:body>
  32. <view class="list-item-block">
  33. <view class="items-line">
  34. <view class="block">
  35. <image class="item-title-run-status-icon" style="box-shadow:0 0 2px 2px lightblue"
  36. src="/static/images/list/order_item.png" mode="widthFix">
  37. </image>
  38. </view>
  39. <text class="item-title-rtu-name">{{item.rtuName}}</text>
  40. <text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
  41. </view>
  42. <view class="items-line">
  43. <uni-icons class="input-uni-icon" type="location" size="18" color="lightblue" />
  44. <text class="item-text-lable">行政区划:</text>
  45. <text class="item-text-content">{{item.areaName}}</text>
  46. </view>
  47. <view class="items-line">
  48. <uni-icons class="input-uni-icon" type="bars" size="18" color="lightblue" />
  49. <text class="item-text-lable">异常类型:</text>
  50. <text class="item-text-content-ellipsis">{{item.warnKindInfo}}</text>
  51. </view>
  52. <view class="items-line">
  53. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  54. <text class="item-text-lable">任务创建时长:</text>
  55. <text class="item-text-content">{{item.taskCreateDuration}}</text>
  56. </view>
  57. <view class="items-line">
  58. <uni-icons class="input-uni-icon" type="auth" size="18" color="lightblue" />
  59. <text class="item-text-lable">运维公司管理员:</text>
  60. <text class="item-text-content">{{item.manageCompanyAdminName}}</text>
  61. </view>
  62. <view class="items-line">
  63. <uni-icons class="input-uni-icon" type="phone" size="18" color="lightblue" />
  64. <text class="item-text-lable">联系电话:</text>
  65. <view v-if="item.manageCompanyAdminPhone != null" @click="call(item.manageCompanyAdminPhone)">
  66. <text class="item-text-content-phone">{{item.manageCompanyAdminPhone}}</text>
  67. </view>
  68. </view>
  69. <view class="item-button-group">
  70. <view class="item-button" @click="onLocationClick(item)">
  71. <view class="items-line">
  72. <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
  73. <text class="button-text">导航</text>
  74. </view>
  75. </view>
  76. <view class="item-button" @click="call(item.manageCompanyAdminPhone)">
  77. <view class="items-line">
  78. <uni-icons class="input-uni-icon" type="phone" size="18" color="coral" />
  79. <text class="button-text">电 话</text>
  80. </view>
  81. </view>
  82. <view class="item-button" @click="onComfireCheckOrderClick(item.id)">
  83. <view class="items-line">
  84. <uni-icons class="input-uni-icon" type="auth" size="18" color="coral" />
  85. <text class="button-text">查看任务</text>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </template>
  91. </uni-list-item>
  92. </uni-list>
  93. <uni-group>
  94. <view class="pagination-block">
  95. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  96. @change="pageChange" />
  97. </view>
  98. </uni-group>
  99. </view>
  100. </view>
  101. </template>
  102. <script>
  103. import {
  104. role
  105. } from "@/api/role.js";
  106. import http from '@/http/api.js';
  107. export default {
  108. components: {},
  109. onLoad(option) {
  110. if (this.userInfo.role_name === role['admin']) {
  111. this.permission.admin = true;
  112. } else if (this.userInfo.role_name === role['orgAdmin']) {
  113. this.permission.orgAdmin = true;
  114. } else if (this.userInfo.role_name === role['companyAdmin']) {
  115. this.permission.companyAdmin = true;
  116. } else if (this.userInfo.role_name === role['companyServciePerson']) {
  117. this.permission.companyServciePerson = true;
  118. }
  119. this.query = {};
  120. this.query['orderConfirm'] = 0;
  121. this.query['orderClose'] = 0;
  122. this.getPage();
  123. },
  124. data() {
  125. return {
  126. title: '新任务',
  127. permission: {
  128. 'admin': false,
  129. 'orgAdmin': false,
  130. 'companyAdmin': false,
  131. 'companyServciePerson': false,
  132. },
  133. value: ['0'],
  134. warnKindItems: [{
  135. 'value': 0,
  136. 'text': '全部'
  137. }, {
  138. 'value': 1,
  139. 'text': '离线'
  140. }, {
  141. 'value': 2,
  142. 'text': '时钟异常'
  143. }, {
  144. 'value': 3,
  145. 'text': '雨量漏报'
  146. }, {
  147. 'value': 4,
  148. 'text': '水位漏报'
  149. }, {
  150. 'value': 5,
  151. 'text': '5分钟上报延时'
  152. }, {
  153. 'value': 6,
  154. 'text': '雨量小时上报延时'
  155. }, {
  156. 'value': 7,
  157. 'text': '水位小时上报延时'
  158. }, {
  159. 'value': 8,
  160. 'text': '雨量疑似异常值'
  161. }],
  162. warnKindOption: 0,
  163. pageSize: 10,
  164. pageCurrent: 1,
  165. total: 0,
  166. list: [],
  167. query: {},
  168. }
  169. },
  170. computed: {},
  171. onShow() {},
  172. methods: {
  173. //返回上一页
  174. toBack() {
  175. uni.navigateBack({
  176. delta: 1
  177. })
  178. },
  179. onBackPress() {
  180. // #ifdef APP-PLUS
  181. plus.key.hideSoftKeybord();
  182. // #endif
  183. },
  184. // 分页触发
  185. pageChange(e) {
  186. this.pageCurrent = e.current;
  187. this.getPage()
  188. },
  189. warnKindOptionChange: function(evt) {
  190. let params = {};
  191. this.getPage(params);
  192. },
  193. call(phone) {
  194. console.log(phone)
  195. uni.showModal({
  196. content: '是否需要拨打[' + phone + ']?',
  197. showCancel: true,
  198. success(res) {
  199. if (res.confirm) {
  200. uni.makePhoneCall({
  201. phoneNumber: phone
  202. });
  203. }
  204. }
  205. });
  206. },
  207. onLocationClick(item) {
  208. let lat = item.lat;
  209. let lng = item.lng;
  210. let name = item.rtuName;
  211. let add = item.locationDesc;
  212. uni.openLocation({
  213. latitude: Number(lat),
  214. longitude: Number(lng),
  215. name: name,
  216. address: "",
  217. success() {}
  218. })
  219. },
  220. onComfireCheckOrderClick(id) {
  221. let url =
  222. '/pages/check-order/order-confirm?id=' + id;
  223. uni.navigateTo({
  224. url: url
  225. })
  226. },
  227. getPage(params = {}) {
  228. if (this.warnKindOption == 0) {} else {
  229. params['warnKind'] = this.warnKindOption;
  230. }
  231. const current = this.pageCurrent;
  232. const size = this.pageSize;
  233. let postData = Object.assign(params, this.query);
  234. let that = this;
  235. http.request({
  236. url: '/galaxy-business/rtu/check/order/unconfirm/page',
  237. method: 'GET',
  238. params: {
  239. current,
  240. size,
  241. },
  242. data: postData,
  243. }).then(res => {
  244. if (res.data.records != null) {
  245. that.list = res.data.records;
  246. }
  247. this.total = res.data.total;
  248. }).catch(err => {
  249. console.log(err)
  250. })
  251. },
  252. }
  253. }
  254. </script>
  255. <style lang="scss" scoped>
  256. .select-checkbox {
  257. margin-top: 0px;
  258. margin-bottom: 5px;
  259. padding-left: 15px;
  260. }
  261. </style>