ChooseDeclarationDecord.vue 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <vxe-modal v-model="dialogVisible" :title="title" show-zoom resize show-footer destroy-on-close transfer @hide="close" :width="width" :z-index="1002">
  3. <template #default>
  4. <div class="mb-10">是否确认将该事项的专家抽取审核为通过!</div>
  5. <div class="mb-8">专家人员指定:</div>
  6. <vxe-table border :data="[props.info]" min-height="0" max-height="100%">
  7. <vxe-column title="序号" align="center" type="seq" width="50" />
  8. <vxe-column title="标准名称" field="standardName" :formatter="colNoData" />
  9. <vxe-column title="企业名称" field="cpyname" :formatter="colNoData" />
  10. <vxe-column title="申报时间" width="150">
  11. <template #default="{ row }">
  12. <span>{{ row.createTime }}</span>
  13. </template>
  14. </vxe-column>
  15. <vxe-column title="申报人" field="createByName" width="120" />
  16. <vxe-column title="事项状态" width="100">
  17. <template #default="{ row }">
  18. <DictTag :options="dm_expert_item_list" :value="row?.status"></DictTag>
  19. </template>
  20. </vxe-column>
  21. </vxe-table>
  22. </template>
  23. <template #footer>
  24. <el-button @click="close">取消</el-button>
  25. <el-button type="primary" @click="submitForm">确认添加</el-button>
  26. </template>
  27. </vxe-modal>
  28. </template>
  29. <script setup name="ChooseDeclarationDecord" lang="tsx">
  30. import { colNoData } from '@/utils/noData';
  31. import { propTypes } from '@/utils/propTypes';
  32. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  33. const { dm_expert_item_list } = toRefs<any>(proxy?.useDict( 'dm_expert_item_list'));
  34. // const { lm_person_type, dm_join_type, yes_no } = toRefs<any>(proxy?.useDict('lm_person_type', 'dm_join_type', 'yes_no', 'sys_sex_type'));
  35. const emit = defineEmits(['update:show', 'close', 'success']);
  36. const props = defineProps({
  37. show: propTypes.bool.def(false),
  38. info: propTypes.any.def(null),
  39. title: propTypes.string.def('审核通过'),
  40. width: propTypes.number.def(900),
  41. dict: propTypes.any.def(null),
  42. });
  43. const ChooseExpertRef = ref();
  44. const showChoose = ref(false);
  45. const dialogVisible = ref(props.show);
  46. const close = () => {
  47. emit('update:show', false);
  48. emit('close', false);
  49. };
  50. // const list = ref<any[]>(props.info?.personInfo.map(item => {
  51. // return {
  52. // ...item,
  53. // isAppoint: item.isAppoint || '0',
  54. // personInfos: item.personInfos || [],
  55. // };
  56. // }) || []);
  57. const list = ref()
  58. list.value =props.info
  59. const rowInfo = ref<any>(null);
  60. const addPerson = (row: any) => {
  61. rowInfo.value = row;
  62. showChoose.value = true;
  63. };
  64. const submitForm = async () => {
  65. try {
  66. // const persons = list.value.map(item => {
  67. // return {
  68. // personType: item.personType,
  69. // personCount: item.personCount,
  70. // isAppoint: item.isAppoint,
  71. // personIds: +item.isAppoint ? item.personInfos.map((person: any) => person.id) : []
  72. // };
  73. // });
  74. emit('success');
  75. } catch (error) {
  76. console.error(error);
  77. }
  78. };
  79. const changeSuccesss = (val: any) => {
  80. rowInfo.value.personInfos = [...val]
  81. };
  82. const closeTagPerson = (item: any, index: number) => {
  83. item.personInfos.splice(index, 1);
  84. };
  85. watch(
  86. () => props.show,
  87. (val) => {
  88. dialogVisible.value = val;
  89. }
  90. );
  91. </script>