servicepersonmanage.vue 12 KB

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