ordercancel.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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-group>
  19. <uni-forms ref="baseForm" :model="formData">
  20. <uni-section title="取消说明" ftitleFontSize="0.8rem" style="width: 100%;">
  21. <template v-slot:decoration>
  22. <view class="decoration"></view>
  23. </template>
  24. <view style="padding-top: 10px;padding-bottom: 0px;padding-left: 15px;padding-right: 15px;">
  25. <uni-forms-item>
  26. <uni-easyinput :styles="styles" type="textarea" v-model="formData.orderDesc"
  27. placeholder="请录入工单取消说明" />
  28. </uni-forms-item>
  29. </view>
  30. </uni-section>
  31. </uni-forms>
  32. <view class="view-btn">
  33. <button style="background-color: lightcoral;" type="default"
  34. @click="onOrderCancelClick()">提交操作</button>
  35. </view>
  36. </uni-group>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import http from '@/http/api.js';
  42. import {
  43. devUrl,
  44. prodUrl
  45. } from '@/common/setting';
  46. export default {
  47. components: {},
  48. data() {
  49. return {
  50. title: '工单取消',
  51. id: '',
  52. formData: {
  53. orderDesc: '',
  54. },
  55. styles: {
  56. color: '#333',
  57. borderColor: '#e5e5e5',
  58. disableColor: '#FFFFFF'
  59. },
  60. baseURL: '',
  61. }
  62. },
  63. computed: {},
  64. onLoad(option) {
  65. this.id = option.id;
  66. this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
  67. },
  68. onShow() {},
  69. methods: {
  70. toBack() {
  71. uni.navigateBack({
  72. delta: 2
  73. })
  74. },
  75. onOrderCancelClick() {
  76. let that = this;
  77. uni.showModal({
  78. content: '是否确定取消工单?',
  79. showCancel: true,
  80. success(res) {
  81. if (res.confirm) {
  82. that.cancelOrderSubmit();
  83. }
  84. }
  85. });
  86. },
  87. cancelOrderSubmit() {
  88. let that = this;
  89. this.formData['id'] = this.id;
  90. console.log("id "+JSON.stringify(this.formData))
  91. http.request({
  92. url: '/galaxy-business/order/cancel',
  93. method: 'POST',
  94. params: this.formData
  95. }).then(res => {
  96. if (res.success) {
  97. uni.showModal({
  98. content: '已成功提交',
  99. showCancel: false,
  100. success(res) {
  101. that.toBack();
  102. }
  103. });
  104. } else {
  105. uni.showModal({
  106. content: '' + res.msg,
  107. showCancel: false
  108. });
  109. }
  110. }).catch(err => {
  111. console.log(err)
  112. })
  113. },
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. .view-btn {
  119. margin-top: 20px;
  120. margin-bottom: 20px;
  121. padding-left: 10px;
  122. padding-right: 10px;
  123. }
  124. .line-space {
  125. margin-top: 4px;
  126. }
  127. </style>