report.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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. <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text"
  11. activeColor="#4cd964"></uni-segmented-control>
  12. <view class="content">
  13. <view v-show="current === 0">
  14. <uGroup>
  15. <uni-table ref="order_table" border stripe type="" emptyText="暂无更多数据">
  16. <uni-tr>
  17. <uni-th width="120" align="center"><view style="text-align: center;color: black;">运维人员姓名</view></uni-th>
  18. <uni-th width="120" align="center"><view style="text-align: center;color: black;">已接工单</view></uni-th>
  19. <uni-th width="120" align="center"><view style="text-align: center;color: black;">未完成工单</view></uni-th>
  20. </uni-tr>
  21. <uni-tr v-for="(item, index) in orderTableData" :key="index">
  22. <uni-td>
  23. <view style="text-align: center;">{{ item.servicePersonName }}</view>
  24. </uni-td>
  25. <!-- <uni-td>
  26. <view v-if="item.rtuName" style="text-align: center;">
  27. {{ item.rtuName }}
  28. </view>
  29. <view v-else style="text-align: center;">
  30. {{ item.rtuCode }}
  31. </view>
  32. </uni-td> -->
  33. <uni-td align="center">
  34. <view style="text-align: center;color: coral;">{{ item.orderCount }}</view>
  35. </uni-td>
  36. <uni-td align="center">
  37. <view style="text-align: center;color: coral;">{{ item.processingOrderCount }}</view>
  38. </uni-td>
  39. </uni-tr>
  40. </uni-table>
  41. </uGroup>
  42. </view>
  43. <view v-show="current === 1">
  44. <uGroup>
  45. <uni-table ref="equipment_inspection_table" border stripe type="" emptyText="暂无更多数据">
  46. <uni-tr>
  47. <uni-th width="150" align="center"><view style="text-align: center;color: black;">运维人员姓名</view></uni-th>
  48. <uni-th align="center"><view style="text-align: center;color: black;">已完成巡检任务</view></uni-th>
  49. <!-- <uni-th width="120" align="center">降水量</uni-th> -->
  50. </uni-tr>
  51. <uni-tr v-for="(item, index) in equipmentInspectionTableData" :key="index">
  52. <uni-td>
  53. <view style="text-align: center;">{{ item.servicePersonName }}</view>
  54. </uni-td>
  55. <!-- <uni-td>
  56. <view v-if="item.rtuName" style="text-align: center;">
  57. {{ item.rtuName }}
  58. </view>
  59. <view v-else style="text-align: center;">
  60. {{ item.rtuCode }}
  61. </view>
  62. </uni-td> -->
  63. <uni-td align="center">
  64. <view style="text-align: center;color: coral;">{{ item.completeCount }}</view>
  65. </uni-td>
  66. </uni-tr>
  67. </uni-table>
  68. </uGroup>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
  76. import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
  77. import uGroup from '@/uni_modules/uni-group/uni-group.vue'
  78. import uSection from '@/uni_modules/uni-section/uni-section.vue'
  79. import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
  80. import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
  81. import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
  82. import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
  83. import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  84. import uSegmentedControl from '@/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue'
  85. import uniTable from '@/uni_modules/uni-table/components/uni-table/uni-table.vue'
  86. import http from '@/http/api.js';
  87. export default {
  88. components: {
  89. uNavBar,
  90. uList,
  91. uListItem,
  92. uIcons,
  93. uGroup,
  94. uPagination,
  95. uBreadcrumb,
  96. uSection,
  97. uDataPicker,
  98. uSegmentedControl,
  99. uniTable
  100. },
  101. onLoad(option) {
  102. },
  103. data() {
  104. return {
  105. list: [],
  106. title: '统计报表',
  107. items: ['工单统计', '巡检统计'],
  108. current: 0,
  109. desc: '',
  110. orderTableData: [],
  111. equipmentInspectionTableData: [],
  112. pageSize: 10,
  113. // 当前页
  114. pageCurrent: 1,
  115. // 数据总量
  116. total: 0,
  117. orgId: '',
  118. projectId: '',
  119. projectTree: [],
  120. selectedTreeNode: '',
  121. searchVal: '',
  122. }
  123. },
  124. computed: {
  125. getIcon() {
  126. return path => {
  127. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  128. }
  129. },
  130. },
  131. onShow() {
  132. this.getOrderList();
  133. this.getInspectionCountList();
  134. },
  135. methods: {
  136. toBack() {
  137. uni.navigateBack({
  138. delta: 1
  139. })
  140. },
  141. onClickItem(e) {
  142. if (this.current != e.currentIndex) {
  143. this.current = e.currentIndex;
  144. }
  145. },
  146. // 分页触发
  147. change(e) {
  148. //this.$refs.table.clearSelection()
  149. //this.selectedIndexs.length = 0
  150. this.pageCurrent = e.current;
  151. this.getOrderList()
  152. },
  153. onnodeclick(node) {
  154. if (node.projectId != null) {
  155. this.orgId = node.orgId;
  156. this.projectId = node.projectId;
  157. this.searchVal = '';
  158. this.pageCurrent = 1;
  159. this.getOrderList();
  160. }
  161. },
  162. onpopupopened(e) {
  163. },
  164. onpopupclosed(e) {
  165. },
  166. onchange(e) {
  167. },
  168. search(res) {
  169. this.getOrderList();
  170. },
  171. input(res) {
  172. },
  173. clear(res) {
  174. this.searchVal = '';
  175. this.getOrderList();
  176. },
  177. blur(res) {},
  178. focus(e) {},
  179. cancel(res) {
  180. this.searchVal = '';
  181. this.getOrderList();
  182. },
  183. onBackPress() {
  184. // #ifdef APP-PLUS
  185. plus.key.hideSoftKeybord();
  186. // #endif
  187. },
  188. getProjectTree() {
  189. var that = this;
  190. http.request({
  191. url: '/galaxy-test/rtu/manage/tree',
  192. method: 'GET',
  193. }).then(res => {
  194. console.log(res)
  195. if (res.data != null) {
  196. that.projectTree = res.data;
  197. that.selectedTreeNode = that.projectTree[0].value;
  198. that.orgId = that.projectTree[0].orgId;
  199. that.projectId = that.projectTree[0].projectId;
  200. that.getOrderList();
  201. }
  202. }).catch(err => {
  203. console.log(err)
  204. })
  205. },
  206. getOrderList() {
  207. var that = this;
  208. http.request({
  209. url: '/galaxy-test/rtu/check/order/statistics',
  210. method: 'GET',
  211. }).then(res => {
  212. if (res.data != null) {
  213. that.orderTableData = res.data;
  214. }
  215. }).catch(err => {
  216. console.log(err)
  217. })
  218. },
  219. getInspectionCountList() {
  220. var that = this;
  221. http.request({
  222. url: '/galaxy-test/equipment/inspection/statistics',
  223. method: 'GET',
  224. }).then(res => {
  225. if (res.data != null) {
  226. that.equipmentInspectionTableData = res.data;
  227. }
  228. }).catch(err => {
  229. console.log(err)
  230. })
  231. },
  232. toDetailPage(id) {
  233. var url = '/pages/check-order/orderprocessrecord?id=' + id;
  234. uni.navigateTo({
  235. url: url
  236. })
  237. },
  238. toOrderReport(id) {
  239. var url = '/pages/check-order/orderprocesslist?id=' + id;
  240. uni.navigateTo({
  241. url: url
  242. })
  243. },
  244. toOrderConfirm(id) {
  245. var that = this;
  246. uni.showModal({
  247. content: '确定进行接单确认操作?',
  248. showCancel: true,
  249. success(res) {
  250. if (res.confirm) {
  251. var postData2 = {};
  252. postData2['id'] = id;
  253. http.request({
  254. url: '/galaxy-test/rtu/check/order/confirm',
  255. method: 'POST',
  256. data: postData2
  257. }).then(res => {
  258. console.log(res)
  259. if (res.success) {
  260. uni.showModal({
  261. content: '接单已成功,是否立即填报?',
  262. showCancel: true,
  263. success(res) {
  264. if (res.confirm) {
  265. var url =
  266. '/pages/check-order/orderprocesslist?id=' + id;
  267. uni.navigateTo({
  268. url: url
  269. })
  270. }
  271. }
  272. });
  273. }
  274. }).catch(err => {
  275. console.log(err)
  276. })
  277. }
  278. }
  279. });
  280. },
  281. toLocation(item) {
  282. let lat = item.lat;
  283. let lng = item.lng;
  284. let name = item.rtuName;
  285. let add = item.locationDesc;
  286. uni.openLocation({
  287. latitude: Number(lat),
  288. longitude: Number(lng),
  289. name: name,
  290. address: "",
  291. success() {}
  292. })
  293. },
  294. }
  295. }
  296. </script>
  297. <style>
  298. </style>
  299. <style lang="scss" scoped>
  300. .container {
  301. padding: 0 0 100rpx;
  302. }
  303. .u-cell-icon {
  304. width: 36rpx;
  305. height: 36rpx;
  306. margin-right: 8rpx;
  307. }
  308. .slot-box {
  309. /* #ifndef APP-NVUE */
  310. display: flex;
  311. /* #endif */
  312. flex-direction: row;
  313. align-items: center;
  314. }
  315. .slot-image {
  316. /* #ifndef APP-NVUE */
  317. display: block;
  318. /* #endif */
  319. //margin-right: 10px;
  320. width: 20px;
  321. height: 20px;
  322. }
  323. .order-title-image {
  324. /* #ifndef APP-NVUE */
  325. display: block;
  326. /* #endif */
  327. // margin-right: 10px;
  328. width: 20px;
  329. height: 20px;
  330. border-radius: 50%;
  331. }
  332. .slot-text {
  333. flex: 1;
  334. font-size: 14px;
  335. color: #4cd964;
  336. margin-right: 10px;
  337. }
  338. .content-box {
  339. flex: 1;
  340. /* #ifdef APP-NVUE */
  341. justify-content: center;
  342. /* #endif */
  343. height: 100%;
  344. line-height: 44px;
  345. padding: 0 15px;
  346. position: relative;
  347. background-color: #fff;
  348. border-bottom-color: #f5f5f5;
  349. border-bottom-width: 1px;
  350. border-bottom-style: solid;
  351. }
  352. .content-text {
  353. font-size: 15px;
  354. }
  355. .example-body {
  356. /* #ifndef APP-NVUE */
  357. display: flex;
  358. /* #endif */
  359. flex-direction: row;
  360. justify-content: center;
  361. padding: 10px 0;
  362. background-color: #fff;
  363. }
  364. .button {
  365. border-color: #e5e5e5;
  366. border-style: solid;
  367. border-width: 1px;
  368. padding: 4px 8px;
  369. border-radius: 4px;
  370. }
  371. .button-text {
  372. font-size: 15px;
  373. }
  374. .slot-button {
  375. /* #ifndef APP-NVUE */
  376. display: flex;
  377. height: 100%;
  378. /* #endif */
  379. flex: 1;
  380. flex-direction: row;
  381. justify-content: center;
  382. align-items: center;
  383. padding: 0 20px;
  384. background-color: #ff5a5f;
  385. }
  386. .slot-button-text {
  387. color: #ffffff;
  388. font-size: 14px;
  389. }
  390. </style>