check-order-manage.vue 12 KB

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