check-order-manage.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  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. <uni-section title="工单统计" type="circle">
  19. <uni-group>
  20. <uni-row>
  21. <uni-col :span="12">
  22. <view class="list-item-block">
  23. <view class="line">
  24. <view class="text" style="color: gray;">工单共有:<span
  25. style="margin-left: 10px;color: cornflowerblue;">{{countInfo.orderCount}}</span>
  26. </view>
  27. </view>
  28. <view class="line">
  29. <view class="text" style="color: gray;">待处理工单共有:<span
  30. style="margin-left: 10px;color: cornflowerblue;">{{countInfo.orderProcessingCount}}</span>
  31. </view>
  32. </view>
  33. <view class="line">
  34. <view class="text" style="color: gray;">完结工单共有:<span
  35. style="margin-left: 10px;color: cornflowerblue;">{{countInfo.closeOrderCount}}</span>
  36. </view>
  37. </view>
  38. </view>
  39. </uni-col>
  40. <uni-col :span="12">
  41. <view class="list-item-block">
  42. <view class="line">
  43. <view class="text" style="color: gray;">未接工单共有:<span
  44. style="margin-left: 10px;color: cornflowerblue;">{{countInfo.orderUnconfirmCount}}</span>
  45. </view>
  46. </view>
  47. <view class="line">
  48. <view class="text" style="color: gray;">待完结审批共有:<span
  49. style="margin-left: 10px;color: cornflowerblue;">{{countInfo.closeApproveOrderCount}}</span>
  50. </view>
  51. </view>
  52. </view>
  53. </uni-col>
  54. </uni-row>
  55. </uni-group>
  56. </uni-section>
  57. <uni-section title="工单查询" type="circle">
  58. <view class="search-block">
  59. <view style="margin-top: 10px;padding-left: 10px;padding-right: 10px;">
  60. <view class="select-checkbox">
  61. <uni-data-checkbox v-model="orderStatusOption" :localdata="orderStatusItems">
  62. </uni-data-checkbox>
  63. </view>
  64. </view>
  65. <view class="submit-btn">
  66. <button type="default" @click="search">查 询</button>
  67. </view>
  68. </view>
  69. </uni-section>
  70. <uni-section title="工单列表信息" type="circle">
  71. <uni-list>
  72. <uni-list-item v-for="item in list" :key="item.id" showArrow clickable
  73. @click="toOrderProcessDetail(item)">
  74. <template v-slot:body>
  75. <view class="list-item-block">
  76. <view class="line">
  77. <uni-icons class="input-uni-icon" type="refresh" size="18" color="lightblue" />
  78. <view class="text" style="color: gray;">工单状态:<span
  79. style="margin-left: 10px;color: cornflowerblue;">{{item.orderStatusName}}</span>
  80. </view>
  81. </view>
  82. <view class="line">
  83. <uni-icons class="input-uni-icon" type="personadd" size="18" color="lightblue" />
  84. <view class="text" style="color: gray;">创建人:<span
  85. style="margin-left: 10px;color: cornflowerblue;">{{item.createOrderPersonName}}</span>
  86. </view>
  87. </view>
  88. <view class="line">
  89. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  90. <view class="text" style="color: gray;">创建时间:<span
  91. style="margin-left: 10px;color: cornflowerblue;">{{item.createTime}}</span>
  92. </view>
  93. </view>
  94. <view class="line">
  95. <uni-icons class="input-uni-icon" type="help" size="18" color="lightblue" />
  96. <view class="text text-ellipsis" style="color: gray;width: 90%;"
  97. @click="toOrderProcessDetail(item)">故障问题描述:<span class="text-underline"
  98. style="margin-left: 10px;color: cornflowerblue;">{{item.orderDesc}}</span>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. </uni-list-item>
  104. </uni-list>
  105. </uni-section>
  106. <uni-group>
  107. <view class="pagination-block">
  108. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  109. @change="pageChange" />
  110. </view>
  111. </uni-group>
  112. </view>
  113. </view>
  114. </template>
  115. <script>
  116. import {
  117. role
  118. } from "@/api/role.js";
  119. import http from '@/http/api.js';
  120. export default {
  121. components: {},
  122. data() {
  123. return {
  124. title: '工单管理',
  125. permission: {
  126. 'admin': false,
  127. 'orgAdmin': false,
  128. 'companyAdmin': false,
  129. 'companyServciePerson': false,
  130. },
  131. postName: '',
  132. searchorderstatus: ['0'],
  133. searchwarnstatus: [],
  134. orderStatusItems: [{
  135. 'value': 0,
  136. 'text': '全部'
  137. }, {
  138. 'value': 1,
  139. 'text': '未接工单'
  140. }, {
  141. 'value': 2,
  142. 'text': '待处理工单'
  143. }, {
  144. 'value': 6,
  145. 'text': '待完结审批工单'
  146. }, {
  147. 'value': 7,
  148. 'text': '工单完结'
  149. }],
  150. orderStatusOption: 0,
  151. countInfo: {
  152. orderCount: 0,
  153. orderUnconfirmCount: 0,
  154. orderProcessingCount: 0,
  155. closeApproveOrderCount: 0,
  156. closeOrderCount: 0,
  157. },
  158. warnKindItems: [{
  159. 'value': 0,
  160. 'text': '全部'
  161. }, {
  162. 'value': 1,
  163. 'text': '离线'
  164. }, {
  165. 'value': 2,
  166. 'text': '时钟异常'
  167. }, {
  168. 'value': 3,
  169. 'text': '雨量漏报'
  170. }, {
  171. 'value': 4,
  172. 'text': '水位漏报'
  173. }, {
  174. 'value': 5,
  175. 'text': '5分钟上报延时'
  176. }, {
  177. 'value': 6,
  178. 'text': '雨量小时上报延时'
  179. }, {
  180. 'value': 7,
  181. 'text': '水位小时上报延时'
  182. }, {
  183. 'value': 8,
  184. 'text': '雨量疑似异常值'
  185. }],
  186. warnKindOption: 0,
  187. selectUnconfirm: 0,
  188. selectProcess: 0,
  189. pageSize: 10,
  190. pageCurrent: 1,
  191. total: 0,
  192. list: [],
  193. regionTree: [],
  194. regionCode: '',
  195. selectedTreeNode: '',
  196. searchRtuNameVal: '',
  197. searchRtuCodeVal: '',
  198. query: {},
  199. inputStyles: {
  200. color: '#808080',
  201. borderColor: '#d3d3d3'
  202. }
  203. }
  204. },
  205. computed: {
  206. },
  207. onLoad(option) {
  208. this.permission.admin = false;
  209. this.permission.orgAdmin = false;
  210. this.permission.companyAdmin = false;
  211. this.permission.companyServciePerson = false;
  212. if (this.userInfo.role_name === role.admin) {
  213. this.permission.admin = true;
  214. } else if (this.userInfo.role_name === role.orgAdmin) {
  215. this.permission.orgAdmin = true;
  216. } else if (this.userInfo.role_name === role.companyAdmin) {
  217. this.permission.companyAdmin = true;
  218. } else if (this.userInfo.role_name === role.companyServciePerson) {
  219. this.permission.companyServciePerson = true;
  220. if (this.userInfo.post_id == '1706859505948098562') {
  221. this.postName = "engineer";
  222. } else if (this.userInfo.post_id == '1730535542909140993') {
  223. this.postName = "servicePerson";
  224. }
  225. }
  226. this.getCountInfo();
  227. this.pageCurrent = 1;
  228. this.getPage()
  229. },
  230. onShow() {
  231. this.permission.admin = false;
  232. this.permission.orgAdmin = false;
  233. this.permission.companyAdmin = false;
  234. this.permission.companyServciePerson = false;
  235. if (this.userInfo.role_name === role.admin) {
  236. this.permission.admin = true;
  237. } else if (this.userInfo.role_name === role.orgAdmin) {
  238. this.permission.orgAdmin = true;
  239. } else if (this.userInfo.role_name === role.companyAdmin) {
  240. this.permission.companyAdmin = true;
  241. } else if (this.userInfo.role_name === role.companyServciePerson) {
  242. this.permission.companyServciePerson = true;
  243. if (this.userInfo.post_id == '1706859505948098562') {
  244. this.postName = "engineer";
  245. } else if (this.userInfo.post_id == '1730535542909140993') {
  246. this.postName = "servicePerson";
  247. }
  248. }
  249. },
  250. methods: {
  251. //返回上一页
  252. toBack() {
  253. uni.navigateBack({
  254. delta: 1
  255. })
  256. },
  257. onBackPress() {
  258. // #ifdef APP-PLUS
  259. plus.key.hideSoftKeybord();
  260. // #endif
  261. },
  262. // 分页触发
  263. pageChange(e) {
  264. this.pageCurrent = e.current;
  265. this.getPage()
  266. },
  267. //行政区划选择
  268. onTreeNodeClick(node) {
  269. console.log(JSON.stringify(node))
  270. },
  271. onTreePopupOpened(e) {
  272. console.log(JSON.stringify(e))
  273. },
  274. onTreePopupClosed(e) {
  275. console.log(JSON.stringify(e))
  276. },
  277. onTreeChange(e) {
  278. console.log(JSON.stringify(e))
  279. let nodes = e.detail.value;
  280. if (nodes.length > 0) {
  281. let node = nodes[nodes.length - 1];
  282. this.regionCode = node.value;
  283. this.query = {};
  284. this.query['adCode'] = this.regionCode;
  285. this.searchRtuNameVal = '';
  286. this.searchRtuCodeVal = '';
  287. this.pageCurrent = 1;
  288. this.getPage();
  289. this.getCountInfo(this.regionCode);
  290. } else {
  291. this.regionCode = '';
  292. this.query = {};
  293. this.searchRtuNameVal = '';
  294. this.searchRtuCodeVal = '';
  295. this.pageCurrent = 1;
  296. this.getPage();
  297. this.getCountInfo(this.regionCode);
  298. }
  299. },
  300. onCreateOrderClick() {
  301. let url = '/pages/check-order/order-add';
  302. uni.navigateTo({
  303. url: url
  304. })
  305. },
  306. toOrderProcessDetail(item) {
  307. let url = '/pages/check-order/processcheckorderlistview?orderType=' + item.orderType + '&orderId=' + item
  308. .id + '&orderClose=' + item.orderClose + '&orderRate=' + item.orderRate;
  309. uni.navigateTo({
  310. url: url
  311. })
  312. },
  313. //录入查询
  314. search() {
  315. this.pageCurrent = 1;
  316. let params = {};
  317. params['orderStatusOption'] = this.orderStatusOption;
  318. this.getPage(params);
  319. },
  320. searchRtuNameValClear(e) {
  321. if (e == null || e.length == 0) {
  322. this.searchRtuNameVal = '';
  323. if (this.searchRtuNameVal.length == 0) {
  324. let params = {};
  325. if (this.searchRtuCodeVal.length > 0) {
  326. params['rtuCode'] = this.searchRtuCodeVal;
  327. }
  328. this.getPage(params);
  329. }
  330. }
  331. },
  332. searchRtuCodeValClear(e) {
  333. if (e == null || e.length == 0) {
  334. this.searchRtuCodeVal = '';
  335. if (this.searchRtuCodeVal.length == 0) {
  336. let params = {};
  337. if (this.searchRtuNameVal.length > 0) {
  338. params['rtuName'] = this.searchRtuNameVal;
  339. }
  340. this.getPage(params);
  341. }
  342. }
  343. },
  344. call(phone) {
  345. console.log(phone)
  346. uni.showModal({
  347. content: '是否需要拨打[' + phone + ']?',
  348. showCancel: true,
  349. success(res) {
  350. if (res.confirm) {
  351. uni.makePhoneCall({
  352. phoneNumber: phone
  353. });
  354. }
  355. }
  356. });
  357. },
  358. onDetailViewClick(id) {
  359. let url = '/pages/check-order/orderprocessreportdetail?orderId=' + id;
  360. uni.navigateTo({
  361. url: url
  362. })
  363. },
  364. onCheckOrderChangeClick(item) {
  365. let contactUserName = '无';
  366. if (item.orderConfirm == 1) {
  367. contactUserName = item.contactUserName;
  368. }
  369. let url = '/pages/check-order/orderprocesschange?orderId=' + item.id + "&contactUserName=" +
  370. contactUserName;
  371. uni.navigateTo({
  372. url: url
  373. })
  374. },
  375. onLocationClick(item) {
  376. if (item.lat && item.lat) {
  377. let lat = item.lat;
  378. let lng = item.lng;
  379. let name = item.rtuName;
  380. let add = '';
  381. if (item.locationDesc) {
  382. add = item.locationDesc;
  383. }
  384. uni.openLocation({
  385. latitude: Number(lat),
  386. longitude: Number(lng),
  387. name: name,
  388. address: "",
  389. success() {}
  390. })
  391. } else {
  392. uni.showModal({
  393. content: '经纬度为空,请确认!',
  394. showCancel: true,
  395. success(res) {
  396. if (res.confirm) {
  397. }
  398. }
  399. });
  400. }
  401. },
  402. onManuallyCloseOrderClick(id) {
  403. uni.navigateTo({
  404. url: '/pages/check-order/manuallyclosecheckorder?id=' + id
  405. })
  406. },
  407. onComfireCheckOrderClick(id) {
  408. let url =
  409. '/pages/check-order/order-confirm?id=' + id;
  410. uni.navigateTo({
  411. url: url
  412. })
  413. },
  414. orderStatusOptionChange: function(evt) {
  415. console.log(JSON.stringify(evt))
  416. console.log(this.orderStatusOption)
  417. this.pageCurrent = 1;
  418. let params = {};
  419. this.getPage(params);
  420. },
  421. warnKindOptionChange: function(evt) {
  422. let params = {};
  423. this.pageCurrent = 1;
  424. this.getPage(params);
  425. },
  426. getRegionTree() {
  427. var that = this;
  428. http.request({
  429. url: '/galaxy-business/baseinfo/region/tree',
  430. method: 'GET',
  431. }).then(res => {
  432. if (res.data != null) {
  433. that.regionTree = res.data;
  434. that.regionCode = that.regionTree[0].id;
  435. that.selectedTreeNode = that.regionTree[0].id;
  436. that.query = {};
  437. that.query['adCode'] = that.regionCode;
  438. that.getPage();
  439. that.getCountInfo(that.regionCode);
  440. }
  441. }).catch(err => {
  442. console.log(err)
  443. })
  444. },
  445. getCountInfo() {
  446. let that = this;
  447. http.request({
  448. url: '/galaxy-business/order/count',
  449. method: 'GET',
  450. }).then(res => {
  451. that.countInfo = res.data;
  452. })
  453. },
  454. getPage(params = {}) {
  455. const current = this.pageCurrent;
  456. const size = this.pageSize;
  457. let postData = Object.assign(params, this.query);
  458. let that = this;
  459. http.request({
  460. url: '/galaxy-business/order/page',
  461. method: 'GET',
  462. params: {
  463. current,
  464. size,
  465. },
  466. data: postData,
  467. }).then(res => {
  468. if (res.data.records != null) {
  469. that.list = res.data.records;
  470. }
  471. this.total = res.data.total;
  472. }).catch(err => {
  473. console.log(err)
  474. })
  475. },
  476. }
  477. }
  478. </script>
  479. <style lang="scss" scoped>
  480. .select-checkbox {
  481. margin-top: 0px;
  482. margin-bottom: 5px;
  483. padding-left: 15px;
  484. }
  485. </style>