transferReserve.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view>
  3. <!-- 转储备项目 -->
  4. <u-modal
  5. :show="modelVisible"
  6. :showCancelButton="true"
  7. @confirm="handleConfirm()"
  8. @cancel="close()"
  9. :asyncClose="true"
  10. title="转储备项目">
  11. <view class="slot-content" style="width: 100%">
  12. <view class="flex">
  13. <text>转化原因:</text>
  14. <u-textarea
  15. v-model="addFrom.projConversionReason"
  16. placeholder="请输入转化原因"
  17. height="180"
  18. :count="true"
  19. maxlength="500"></u-textarea>
  20. </view>
  21. </view>
  22. </u-modal>
  23. </view>
  24. </template>
  25. <script>
  26. import projectApi from '../../../api/project'
  27. import to from 'await-to-js'
  28. export default {
  29. data() {
  30. return {
  31. modelVisible: false,
  32. addFrom: {
  33. projConversionReason: '',
  34. id: null,
  35. },
  36. }
  37. },
  38. methods: {
  39. open(id) {
  40. this.addFrom.id = id
  41. this.modelVisible = true
  42. },
  43. // 移入公海
  44. async handleConfirm() {
  45. let params = this.addFrom
  46. const [err, res] = await to(projectApi.toReserve(params))
  47. if (err) return this.close()
  48. if (res.code == 200) {
  49. this.$refs.uToast.show({
  50. type: 'loading',
  51. message: '转储备成功',
  52. complete: () => {
  53. this.modelVisible = false
  54. this.$emit('fetchList')
  55. },
  56. })
  57. } else {
  58. this.close()
  59. }
  60. },
  61. // 关闭移入公海模块
  62. close() {
  63. this.addFrom.id = []
  64. this.addFrom.projConversionReason = ''
  65. this.modelVisible = false
  66. },
  67. },
  68. }
  69. </script>
  70. <style></style>