checkorderlist.vue 13 KB

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