adminreport.vue 9.2 KB

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