transferReserve.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. console.log(res.code)
  49. if (res.code == 200) {
  50. this.$refs.uToast.show({
  51. type: 'loading',
  52. message: '转储备成功',
  53. complete: () => {
  54. this.modelVisible = false
  55. this.$emit('fetchList')
  56. },
  57. })
  58. } else {
  59. this.close()
  60. }
  61. },
  62. // 关闭移入公海模块
  63. close() {
  64. this.addFrom.id = []
  65. this.addFrom.projConversionReason = ''
  66. this.modelVisible = false
  67. },
  68. },
  69. }
  70. </script>
  71. <style></style>