orderprocesschange.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 class="view-btn">
  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. },
  58. onShow() {
  59. },
  60. created() {
  61. },
  62. methods: {
  63. toBack() {
  64. uni.navigateBack({
  65. delta: 1
  66. })
  67. },
  68. selectChange(e) {
  69. },
  70. getServicePersonList() {
  71. let that = this;
  72. http.request({
  73. url: '/galaxy-business/serviceperson/list',
  74. method: 'GET',
  75. }).then(res => {
  76. //console.log("list " + JSON.stringify(res))
  77. if (res.success) {
  78. let persons = res.data.map(function(item) {
  79. let person = {};
  80. person['value'] = item.id;
  81. person['text'] = item.realName;
  82. return person;
  83. })
  84. that.servicePersonList = persons;
  85. }
  86. }).catch(err => {
  87. console.log(err)
  88. })
  89. },
  90. toOrderChange() {
  91. let that = this;
  92. var postData = {};
  93. postData['id'] = '' + this.orderId;
  94. postData['servicePersonId'] = '' + this.selectedPersonId;
  95. //console.log(postData)
  96. http.request({
  97. url: '/galaxy-business/rtu/check/order/change',
  98. method: 'POST',
  99. data: postData
  100. }).then(res => {
  101. if (res.success) {
  102. uni.showModal({
  103. content: '任务指派操作已成功!',
  104. showCancel: true,
  105. success(res) {
  106. if (res.confirm) {
  107. that.toBack();
  108. }
  109. }
  110. });
  111. } else {
  112. uni.showModal({
  113. content: '任务指派操作失败!',
  114. showCancel: true,
  115. success(res) {
  116. }
  117. });
  118. }
  119. }).catch(err => {
  120. console.log(err)
  121. })
  122. },
  123. }
  124. }
  125. </script>
  126. <style>
  127. /* page {
  128. background-color: rgb(240, 242, 244);
  129. } */
  130. </style>
  131. <style lang="scss" scoped>
  132. .view-btn {
  133. margin-top: 10px;
  134. margin-bottom: 10px;
  135. padding-left: 10px;
  136. padding-right: 10px;
  137. }
  138. </style>