check.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div style="height: 160px;">
  3. <BasicForm @register="registerForm" :minHeight="160">
  4. <template #descinfo>
  5. <div class="basic-info-title">审核信息</div>
  6. </template>
  7. </BasicForm>
  8. </div>
  9. </template>
  10. <script lang="ts">
  11. import { defineComponent, ref, computed, unref, onMounted } from 'vue';
  12. import { BasicModal, useModalInner } from '/@/components/Modal';
  13. import { BasicForm, useForm } from '/@/components/Form/index';
  14. import { accountFormSchema } from './map.data.ts';
  15. import { filterRoleList } from '/@/api/system/system';
  16. import { useMessage } from '/@/hooks/web/useMessage';
  17. import { TOption } from '/@/views/rule/linkedge/config/config.data';
  18. import { PlusOutlined } from '@ant-design/icons-vue';
  19. import { subminExamineResult } from '/@/api/resource/examine';
  20. import { session } from '/@/utils/Memory.js';
  21. import { object } from 'vue-types';
  22. import eventBus from '/@/utils/eventBus';
  23. export default defineComponent({
  24. name: 'AccountModal',
  25. components: {
  26. BasicModal,
  27. BasicForm,
  28. PlusOutlined,
  29. },
  30. emits: ['success', 'register'],
  31. setup(_, { emit }) {
  32. const tenantLogo = ref('');
  33. const loading = ref(false);
  34. const roleOptions = ref<TOption[]>([]);
  35. const isUpdate = ref(true);
  36. const bussid = ref('');
  37. const userinfo = session.getItem('userInfo');
  38. const getRoleList = async () => {
  39. const res = await filterRoleList();
  40. console.log(res);
  41. roleOptions.value = res.map((m) => {
  42. return {
  43. label: m.name,
  44. value: m.id,
  45. };
  46. });
  47. };
  48. onMounted(async () => {
  49. //await getRoleList(); //这个会导致查询失败
  50. });
  51. const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
  52. labelWidth: 100,
  53. schemas: accountFormSchema,
  54. showActionButtonGroup: false,
  55. actionColOptions: {
  56. span: 18,
  57. },
  58. });
  59. const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
  60. await resetFields();
  61. setModalProps({ confirmLoading: false });
  62. isUpdate.value = !!data?.isUpdate;
  63. if (unref(isUpdate)) {
  64. bussid.value = data.record.bussid;
  65. setFieldsValue(data.record);
  66. }
  67. });
  68. const getTitle = '审核';
  69. async function handleSubmit(bussid) {
  70. //setModalProps({ confirmLoading: true });
  71. try {
  72. const { createMessage } = useMessage();
  73. const values = await validate(); //validate(['parentId']);
  74. console.log('userinfo', userinfo)
  75. const params = {
  76. bussInfoId: bussid, //业务id
  77. ispass: values.ispass, //是否通过
  78. opinion: values.opinion, //意见
  79. }
  80. const res = await subminExamineResult(params) as any
  81. if (res && res.resp_code === 0) {
  82. var type = res.resp_code == 0 ? 'success' : 'error';
  83. createMessage[type](res.resp_msg);
  84. eventBus.on('shsqUpdate')
  85. return true
  86. } else {
  87. eventBus.on('shsqUpdate')
  88. return false
  89. }
  90. } finally {
  91. // setTimeout(() => {
  92. // setModalProps({ confirmLoading: false });
  93. // }, 300);
  94. }
  95. }
  96. return {
  97. registerModal,
  98. registerForm,
  99. handleSubmit,
  100. getTitle,
  101. roleOptions,
  102. tenantLogo,
  103. loading,
  104. };
  105. },
  106. });
  107. </script>
  108. <style scoped lang="less">
  109. :deep(.vben-basic-tree) {
  110. width: 100% !important;
  111. }
  112. :deep(.is-unflod) {
  113. display: none !important;
  114. }
  115. :deep(.is-flod) {
  116. display: none !important;
  117. }
  118. .basic-info-title {
  119. height: 19px;
  120. line-height: 18px;
  121. padding-left: 6px;
  122. margin-left: 20px;
  123. border-left: 3px solid #0671dd;
  124. font-family: Source Han Sans CN;
  125. font-size: 16px;
  126. font-weight: 350;
  127. letter-spacing: 0px;
  128. }
  129. :deep(.ant-calendar-picker) {
  130. width: 100% !important;
  131. }
  132. </style>