transferReserve.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. flag: true,
  32. modelVisible: false,
  33. addFrom: {
  34. projConversionReason: '',
  35. id: null,
  36. },
  37. }
  38. },
  39. methods: {
  40. open(id) {
  41. this.addFrom.id = id
  42. this.modelVisible = true
  43. },
  44. // 移入公海
  45. async handleConfirm() {
  46. if (!this.flag) return
  47. let params = this.addFrom
  48. this.flag = false
  49. const [err, res] = await to(projectApi.toReserve(params))
  50. this.flag = true
  51. if (err) return this.close()
  52. if (res.code == 200) {
  53. this.$refs.uToast.show({
  54. type: 'loading',
  55. message: '转储备成功',
  56. complete: () => {
  57. this.modelVisible = false
  58. this.$emit('fetchList')
  59. },
  60. })
  61. } else {
  62. this.close()
  63. }
  64. },
  65. // 关闭移入公海模块
  66. close() {
  67. this.addFrom.id = []
  68. this.addFrom.projConversionReason = ''
  69. this.modelVisible = false
  70. },
  71. },
  72. }
  73. </script>
  74. <style></style>