orderHandle.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="order-handle form-box">
  3. <uni-forms label-position="top" :modelValue="formData">
  4. <uni-forms-item label="处理内容" name="remark">
  5. <uni-easyinput type="textarea" v-model="formData.remark" placeholder="请输入处理内容"></uni-easyinput>
  6. </uni-forms-item>
  7. <uni-forms-item label="附件">
  8. <upload ref="upload" :list="attachment" type="insert"></upload>
  9. </uni-forms-item>
  10. </uni-forms>
  11. <view class="hui-button-box">
  12. <view class="hui-button" @click="submit">提交处理</view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import {
  18. putOrderProcess
  19. } from '@/request/api/order.js'
  20. import upload from '@/components/common/upload.vue';
  21. export default {
  22. data() {
  23. return {
  24. formData: {
  25. remark: ''
  26. },
  27. attachment: [],
  28. operationId: ''
  29. }
  30. },
  31. onLoad(body) {
  32. if (body.operationId) this.operationId = body.operationId;
  33. },
  34. methods: {
  35. submit() {
  36. if (!this.operationId) return;
  37. if (!this.formData.remark) return this.$toast('请输入处理内容');
  38. let postData = {
  39. id: this.operationId,
  40. remark: this.formData.remark,
  41. attachment: JSON.stringify(this.$refs.upload.getFile()),
  42. status: 1
  43. }
  44. putOrderProcess(postData).then(res => {
  45. if (res.code === 200) {
  46. this.$toast('操作成功');
  47. uni.$emit('reloadOrderDetail');
  48. setTimeout(() => {
  49. this.$navigateBack();
  50. }, 400)
  51. }
  52. })
  53. }
  54. },
  55. components: {
  56. upload
  57. },
  58. }
  59. </script>
  60. <style lang="scss">
  61. .order-handle {
  62. padding: 30rpx;
  63. }
  64. </style>