orderprocesschange.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. <view>{{contactUserName}}</view>
  21. </uni-group>
  22. </uni-section>
  23. <uni-section title="指派给" type="circle">
  24. <uni-group>
  25. <uni-data-select v-model="selectedPersonId" :localdata="servicePersonList" @change="selectChange"
  26. placeholder="请选择运维人员">
  27. </uni-data-select>
  28. </uni-group>
  29. </uni-section>
  30. <view style="margin-top: 10px;margin-bottom: 10px;padding-left: 10px;padding-right: 10px;">
  31. <button style="background-color: lightcoral;" type="default" @click="toOrderChange()">确认转派</button>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import http from '@/http/api.js';
  38. export default {
  39. components: {
  40. },
  41. onLoad(option) {
  42. this.orderId = option.orderId;
  43. this.contactUserName = option.contactUserName;
  44. this.getServicePersonList();
  45. },
  46. data() {
  47. return {
  48. orderId: '',
  49. contactUserName: '',
  50. selectedPersonId: '',
  51. servicePersonList: [],
  52. title: '维修任务转派',
  53. desc: '',
  54. }
  55. },
  56. computed: {},
  57. onShow() {},
  58. created() {},
  59. methods: {
  60. toBack() {
  61. uni.navigateBack({
  62. delta: 1
  63. })
  64. },
  65. selectChange(e) {},
  66. getServicePersonList() {
  67. let that = this;
  68. http.request({
  69. url: '/galaxy-business/serviceperson/yw/list',
  70. method: 'GET',
  71. }).then(res => {
  72. if (res.success) {
  73. let persons = res.data.map(function(item) {
  74. let person = {};
  75. person['value'] = item.id;
  76. person['text'] = item.realName;
  77. return person;
  78. })
  79. that.servicePersonList = persons;
  80. }
  81. }).catch(err => {
  82. console.log(err)
  83. })
  84. },
  85. toOrderChange() {
  86. let that = this;
  87. var postData = {};
  88. postData['id'] = '' + this.orderId;
  89. postData['servicePersonId'] = this.selectedPersonId;
  90. http.request({
  91. url: '/galaxy-business/rtu/check/order/change',
  92. method: 'POST',
  93. data: postData
  94. }).then(res => {
  95. if (res.success) {
  96. uni.showModal({
  97. content: '任务指派操作已成功!',
  98. showCancel: true,
  99. success(res) {
  100. if (res.confirm) {
  101. that.toBack();
  102. }
  103. }
  104. });
  105. } else {
  106. uni.showModal({
  107. content: '任务指派操作失败!',
  108. showCancel: true,
  109. success(res) {
  110. }
  111. });
  112. }
  113. }).catch(err => {
  114. console.log(err)
  115. })
  116. },
  117. }
  118. }
  119. </script>
  120. <style>
  121. /* page {
  122. background-color: rgb(240, 242, 244);
  123. } */
  124. </style>
  125. <style lang="scss" scoped>
  126. </style>