moveInOpenSea.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view>
  3. <!-- 转移公海 -->
  4. <u-modal
  5. :show="showMoveInModel"
  6. :showCancelButton="true"
  7. @confirm="confirmMoveInOpenSea()"
  8. @cancel="closeMoveInModel()"
  9. :asyncClose="true"
  10. title="移入公海">
  11. <view class="slot-content">
  12. <view class="flex">
  13. <text>备注:</text>
  14. <u-textarea
  15. v-model="openSeaObj.remark"
  16. placeholder="请输入内容"
  17. height="180"
  18. :count="true"
  19. maxlength="300"></u-textarea>
  20. </view>
  21. <u-text
  22. :customStyle="{ marginTop: '20rpx' }"
  23. text="* 转移到公海后此客户数据将属于公共资源,原归属人员不能再维护跟进和更新此客户数据。"></u-text>
  24. </view>
  25. </u-modal>
  26. </view>
  27. </template>
  28. <script>
  29. import customerApi from '../../../api/customer'
  30. import to from 'await-to-js'
  31. export default {
  32. data() {
  33. return {
  34. showMoveInModel: false,
  35. openSeaObj: {
  36. remark: '',
  37. ids: [],
  38. },
  39. }
  40. },
  41. methods: {
  42. open(id) {
  43. this.openSeaObj.ids = [id]
  44. this.showMoveInModel = true
  45. },
  46. // 移入公海
  47. async confirmMoveInOpenSea() {
  48. let params = this.openSeaObj
  49. const [err, res] = await to(customerApi.moveInOpenSea(params))
  50. if (err) return this.closeMoveInModel()
  51. if (res.code == 200) {
  52. this.$refs.uToast.show({
  53. type: 'loading',
  54. message: '移入公海成功',
  55. complete: () => {
  56. this.showMoveInModel = false
  57. this.$emit('fetchList')
  58. },
  59. })
  60. } else {
  61. this.closeMoveInModel()
  62. }
  63. },
  64. // 关闭移入公海模块
  65. closeMoveInModel() {
  66. this.openSeaObj.ids = []
  67. this.openSeaObj.remark = ''
  68. this.showMoveInModel = false
  69. },
  70. },
  71. }
  72. </script>
  73. <style></style>