index.vue 2.4 KB

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