check.vue 3.8 KB

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