moveInOpenSea.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. flag: true,
  35. showMoveInModel: false,
  36. openSeaObj: {
  37. remark: '',
  38. ids: [],
  39. },
  40. }
  41. },
  42. methods: {
  43. open(id) {
  44. this.openSeaObj.ids = [id]
  45. this.showMoveInModel = true
  46. },
  47. // 移入公海
  48. async confirmMoveInOpenSea() {
  49. if (!this.flag) return
  50. let params = this.openSeaObj
  51. this.flag = false
  52. const [err, res] = await to(customerApi.moveInOpenSea(params))
  53. this.flag = true
  54. if (err) return this.closeMoveInModel()
  55. if (res.code == 200) {
  56. this.$refs.uToast.show({
  57. type: 'loading',
  58. message: '移入公海成功',
  59. complete: () => {
  60. this.showMoveInModel = false
  61. this.$emit('fetchList')
  62. },
  63. })
  64. } else {
  65. this.closeMoveInModel()
  66. }
  67. },
  68. // 关闭移入公海模块
  69. closeMoveInModel() {
  70. this.openSeaObj.ids = []
  71. this.openSeaObj.remark = ''
  72. this.showMoveInModel = false
  73. },
  74. },
  75. }
  76. </script>
  77. <style></style>