moveInOpenSea.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. // console.log(res.code)
  52. if (res.code == 200) {
  53. this.$refs.uToast.show({
  54. type: 'loading',
  55. message: '移入公海成功',
  56. complete: () => {
  57. this.showMoveInModel = false
  58. this.$emit('fetchList')
  59. },
  60. })
  61. } else {
  62. this.closeMoveInModel()
  63. }
  64. },
  65. // 关闭移入公海模块
  66. closeMoveInModel() {
  67. this.openSeaObj.ids = []
  68. this.openSeaObj.remark = ''
  69. this.showMoveInModel = false
  70. },
  71. },
  72. }
  73. </script>
  74. <style></style>