You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
4.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <modal name="delete-company-modal" :clickToClose="false">
  3. <div class="tw-p-[20px] md:tw-p-[30px] tw-overflow-auto">
  4. <div
  5. class="modal-header tw-flex tw-justify-between tw-w-full tw-items-center tw-mb-[30px]"
  6. >
  7. <div
  8. class="tw-grid tw-grid-cols-[24px_auto] tw-gap-[10px] tw-items-center tw-mr-[10px] md:tw-gap-[15px]"
  9. >
  10. <img src="~/assets/svg/deleteWarning.svg" alt="" />
  11. <div class="tw-text-[18px] tw-font-bold md:tw-text-[20px]">
  12. {{ $t("Delete Company Info") }}
  13. </div>
  14. </div>
  15. <button
  16. class="close tw-transition tw-btn-md"
  17. @click="$modal.hide('delete-company-modal')"
  18. ></button>
  19. </div>
  20. <div
  21. class="modal-content tw-text-[14px] tw-text-neutrals-800 tw-mb-[30px] md:tw-text-[16px] md:tw-mb-[40px]"
  22. >
  23. {{ $t("“" + userCompany.CompanyName + "” will be removed in your list.") }}
  24. </div>
  25. <div class="modal-footer tw-grid tw-grid-cols-2 tw-gap-[15px]">
  26. <button
  27. class="tw-bg-white tw-text-error-default tw-text-[16px] tw-rounded-[12px] tw-py-[10px] md:tw-text-[18px]"
  28. @click="$modal.hide('delete-company-modal')"
  29. >
  30. {{ $t("Cancel") }}
  31. </button>
  32. <button
  33. class="tw-bg-error-default tw-text-white tw-text-[16px] tw-rounded-[12px] tw-py-[10px] md:tw-text-[18px]"
  34. @click="deleteUserCompanyConfirm"
  35. >
  36. {{ $t("Delete") }}
  37. </button>
  38. </div>
  39. </div>
  40. </modal>
  41. <!-- <v-dialog v-model="deleteCompanyInfoDialogAcitve" :width="$vuetify.breakpoint.smAndUp ? '423px' : '294px'" @click:outside="$emit('closeCompanyDeleteDialog')" style="z-index:500">
  42. <v-card class="border-radius-16" :width="$vuetify.breakpoint.smAndUp ? '423px' : '294px' ">
  43. <v-spacer class="pa-7">
  44. <v-spacer class="d-flex align-center mb-6">
  45. <span class="font-weight-bold">{{ $t("userProfile.deleteCompanyInfo") }}</span>
  46. <v-spacer></v-spacer>
  47. <v-btn @click="$emit('closeCompanyDeleteDialog')" icon>
  48. <v-icon>mdi-close</v-icon>
  49. </v-btn>
  50. </v-spacer>
  51. <v-spacer class="mb-6">
  52. {{ '"' + companyData.company_name || '' + '"' }}
  53. {{ $t("userProfile.deleteMessage") }}
  54. </v-spacer>
  55. <v-spacer class="d-flex justify-end">
  56. <v-btn @click="$emit('closeCompanyDeleteDialog')" width="112px" class="border-radius-16 me-5 text-capitalize primary--text" color="white">
  57. <span>{{ $t("userProfile.deleteCompanyCancel") }}</span>
  58. </v-btn>
  59. <v-btn @click="deleteUserCompanyConfirm" width="112px" color="primary" class="border-radius-16 text-capitalize">
  60. <span>{{ $t("userProfile.deleteCompanyConfirm") }}</span>
  61. </v-btn>
  62. </v-spacer>
  63. </v-spacer>
  64. </v-card>
  65. </v-dialog> -->
  66. </template>
  67. <script>
  68. export default {
  69. name: "delete-company-modal",
  70. props: {
  71. deleteCompanyInfoDialogAcitve: {
  72. type: Boolean,
  73. required: true,
  74. default: false,
  75. },
  76. userCompany: {
  77. type: Object,
  78. required: true,
  79. //default: {},
  80. },
  81. },
  82. methods: {
  83. deleteUserCompanyConfirm() {
  84. // const deleteData = {
  85. // company_id: this.companyData.company_uuid,
  86. // };
  87. this.$axios
  88. .post(`/trending/api/Members/Company?CompanyID=${this.userCompany.CompanyID}`)
  89. .then((response) => {
  90. console.log(JSON.stringify(response));
  91. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  92. let data = response.data.DATA.rel
  93. if(data){
  94. console.log("刪除成功");
  95. this.$emit("refetch-company");
  96. this.$emit("closeCompanyDeleteDialog");
  97. this.$modal.hide("delete-company-modal");
  98. }
  99. }
  100. })
  101. .catch((error) => {
  102. console.log(error);
  103. });
  104. },
  105. },
  106. };
  107. </script>
  108. <style lang="scss" scoped>
  109. .close {
  110. // position: absolute;
  111. right: 30px;
  112. top: 32px;
  113. background-image: url("~/assets/svg/close.svg");
  114. background-position: center;
  115. background-repeat: no-repeat;
  116. background-size: cover;
  117. width: 14px;
  118. height: 14px;
  119. @media screen and (min-width: 768px) {
  120. right: 40px;
  121. top: 40px;
  122. }
  123. }
  124. .v--modal-overlay::v-deep {
  125. .v--modal {
  126. // max-width: 294px !important;
  127. width: fit-content !important;
  128. height: fit-content !important;
  129. border-radius: 16px;
  130. @media screen and (min-width: 768px) {
  131. width: fit-content !important;
  132. }
  133. }
  134. .v--modal-box {
  135. width: 294px !important;
  136. height: fit-content !important;
  137. @media screen and (min-width: 768px) {
  138. width: fit-content !important;
  139. }
  140. }
  141. .v--modal-background-click {
  142. display: flex;
  143. align-items: center;
  144. }
  145. }
  146. </style>