manuallyaddcheckorder.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
  14. <text style="color: white;font-size: 1rem;">{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <uni-section title="任务说明" type="circle">
  19. <view style="margin-top: 20px;margin-bottom: 40px;;padding-left: 10px;padding-right: 10px;">
  20. <uni-easyinput :styles="inputStyles" prefixIcon="search" v-model="orderDesc" placeholder="请输入任务说明">
  21. </uni-easyinput>
  22. </view>
  23. </uni-section>
  24. <view style="margin-top: 10px;margin-bottom: 10px;padding-left: 10px;padding-right: 10px;">
  25. <button style="background-color: lightcoral;" type="default"
  26. @click="onCheckOrderSubmitClick()">提交任务</button>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import http from '@/http/api.js';
  33. export default {
  34. components: {
  35. },
  36. onLoad(option) {
  37. this.rtuCode = option.rtuCode;
  38. },
  39. data() {
  40. return {
  41. rtuCode: '',
  42. orderDesc: '',
  43. title: '人工添加维修任务',
  44. inputStyles: {
  45. color: '#808080',
  46. borderColor: '#d3d3d3'
  47. },
  48. checkOrderForm: {
  49. id: '',
  50. rtuName: '',
  51. rtuCode: '',
  52. orderDesc: '',
  53. },
  54. query: {}
  55. }
  56. },
  57. computed: {
  58. },
  59. onShow() {
  60. },
  61. created() {
  62. },
  63. methods: {
  64. toBack() {
  65. uni.navigateBack({
  66. delta: 1
  67. })
  68. },
  69. onCheckOrderSubmitClick() {
  70. let that = this;
  71. this.checkOrderForm['rtuCode'] = this.rtuCode;
  72. this.checkOrderForm['orderDesc'] = this.orderDesc;
  73. let postData = Object.assign(this.checkOrderForm, this.query);
  74. http.request({
  75. url: '/galaxy-business/rtu/check/order/manually',
  76. method: 'POST',
  77. data: postData
  78. }).then(res => {
  79. console.log(JSON.stringify(res))
  80. if (res.success) {
  81. uni.showModal({
  82. content: '人工派单操作已成功!',
  83. showCancel: true,
  84. success(res) {
  85. if (res.confirm) {
  86. that.toBack();
  87. }
  88. }
  89. });
  90. } else {
  91. uni.showModal({
  92. content: '人工派单操作失败!',
  93. showCancel: true,
  94. success(res) {
  95. if (res.confirm) {
  96. that.toBack();
  97. }
  98. }
  99. });
  100. }
  101. }).catch(err => {
  102. console.log("err" + JSON.stringify(err))
  103. uni.showModal({
  104. content: err.data.msg,
  105. showCancel: true,
  106. success(res) {
  107. if (res.confirm) {
  108. that.toBack();
  109. }
  110. }
  111. });
  112. })
  113. },
  114. }
  115. }
  116. </script>
  117. <style>
  118. /* page {
  119. background-color: rgb(240, 242, 244);
  120. } */
  121. </style>
  122. <style lang="scss" scoped>
  123. .container {
  124. padding: 0 0 150rpx;
  125. }
  126. </style>