index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <!-- 停用客户资料-->
  3. <a-modal class="commonModal warehouse-disable" title="停用客户资料" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
  4. <template #footer>
  5. <a-button key="submit" class="cancelBtn" :loading="loading" :disabled="loading" @click="cancel">取消 </a-button>
  6. <a-button key="submit" type="primary" :loading="loading" :disabled="loading" @click="submit">确认停用 </a-button>
  7. </template>
  8. <Detail :selectedRow="selectedRow" />
  9. </a-modal>
  10. </template>
  11. <script lang="ts">
  12. import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
  13. import { _closeModal } from '@/common/setup/modal/modal';
  14. import { UpdateUserAccountStatus } from '@/services/go/ermcp/customInfo';
  15. import { QueryCustomInfoType, UpdateUserAccountReq } from '@/services/go/ermcp/customInfo/interface';
  16. import { Modal } from 'ant-design-vue';
  17. import { defineComponent, PropType, ref } from 'vue';
  18. import Detail from '../common-detail/index.vue';
  19. export default defineComponent({
  20. name: 'custom-disable',
  21. emits: ['cancel', 'update'],
  22. components: { Detail },
  23. props: {
  24. selectedRow: {
  25. type: Object as PropType<QueryCustomInfoType>,
  26. default: {},
  27. },
  28. },
  29. setup(props, context) {
  30. const { visible, cancel } = _closeModal(context);
  31. const maskClosableFlag = ref<boolean>(false);
  32. const loading = ref<boolean>(false);
  33. function submit() {
  34. Modal.confirm({
  35. title: '是否确认停用客户资料',
  36. okText: '确认停用',
  37. cancelText: '取消',
  38. onOk() {
  39. let reqParams: UpdateUserAccountReq = {
  40. userID: props.selectedRow.userid,
  41. accountStatus: 6,
  42. };
  43. requestResultLoadingAndInfo(UpdateUserAccountStatus, reqParams, loading, ['停用成功', '停用失败:']).then(() => {
  44. cancel(true);
  45. });
  46. },
  47. onCancel() { },
  48. });
  49. }
  50. return {
  51. visible,
  52. cancel,
  53. submit,
  54. loading,
  55. maskClosableFlag,
  56. };
  57. },
  58. });
  59. </script>