distribution-modal.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view>
  3. <u-modal :show="showModal" @confirm="confirm" ref="uModal" :asyncClose="true" showCancelButton
  4. @cancel="showModal = false" cancelColor="#409eff" :confirmText="'确定'" confirmColor="#2880dd">
  5. <view class="modal_box">
  6. 原所属人: {{clueDetail.clueOwnerName}}分配给
  7. <text style="color: #108cff;" @click="handleShowclueOwner">
  8. {{clueOwnerName}}(点击选择)
  9. </text>
  10. </view>
  11. </u-modal>
  12. <ba-tree-picker :selectParent="false" v-if="listData.length > 0" ref="clueOwner" :multiple="false" border
  13. title="运营人" :localdata="listData" valueKey="id" textKey="label" childrenKey="children"
  14. :selectedValues="clueOwnerId" @select-change="clueOwnerSeletchang" />
  15. </view>
  16. </template>
  17. <script>
  18. import {
  19. cloneDeep
  20. } from 'lodash';
  21. import {
  22. filterCustomerManager
  23. } from '@/utils/util';
  24. export default {
  25. props: {
  26. clueDetail: {
  27. type: Object,
  28. required: true
  29. },
  30. },
  31. data() {
  32. return {
  33. showModal: false,
  34. clueOwnerName: this.clueDetail.clueOwnerName,
  35. clueOwnerId: this.clueDetail.clueOwnerId,
  36. listData: [], // 人员列表
  37. }
  38. },
  39. methods: {
  40. async confirm(){
  41. const { cfId , id } = this.clueDetail;
  42. await uni.$u.api.updateClueFixedFieldsClueOwner({ id : cfId , clueOwnerId : this.clueOwnerId , clueId : id });
  43. this.showModal = false;
  44. this.$emit("handleSuccess");
  45. },
  46. show() {
  47. this.showModal = true;
  48. // 获取人员
  49. uni.$u.api.getDeptOwner({ excludeDeptIds : [100,369,378,356] }).then(res => {
  50. this.listData = filterCustomerManager(res.data);
  51. });
  52. },
  53. handleShowclueOwner(){
  54. this.showModal = false;
  55. this.$refs.clueOwner._show();
  56. },
  57. clueOwnerSeletchang(ids,names) {
  58. this.showModal = true;
  59. const clueOwnerId = ids[0];
  60. const clueOwnerName = names[0];
  61. this.clueOwnerId = clueOwnerId;
  62. this.clueOwnerName = clueOwnerName;
  63. },
  64. }
  65. }
  66. </script>
  67. <style>
  68. </style>