wupengfei
2025-03-28 acaec313ab0e3c9381060e36bf3ce4abc606dc9a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<template>
  <ProDialog title="批改信息" v-model="innerVisible" width="1200px" destroy-on-close>
    <ProDialogTableWrapper :height="400">
      <ProTableV2
        :table-data="proTableProps.tableData"
        :columns="column"
        :show-operation-column="false"
      >
        <template #changeType="{ row }"> {{ BatchChangeTypeEnumText[row.changeType] }}</template>
      </ProTableV2>
    </ProDialogTableWrapper>
  </ProDialog>
</template>
 
<script setup lang="ts">
import { ProDialog, ProTableV2, ProDialogTableWrapper, useTable } from '@bole-core/components';
import { OrderInputType } from '@bole-core/core';
import { paginateList } from '@/utils';
import { BatchChangeTypeEnumText } from '@/constants';
 
defineOptions({
  name: 'BatchChangeRecordDetailDialog',
});
 
type Props = {
  modelValue: boolean;
  form?: {
    id: string;
    staffList: API.InsureBatchBillDetailDto[];
  };
};
 
const props = withDefaults(defineProps<Props>(), {
  modelValue: false,
});
 
const emit = defineEmits<{
  (e: 'update:modelValue', value: boolean): void;
  (e: 'onCancel'): void;
}>();
 
const column: API.CustomModuleColumnDto[] = [
  {
    id: '1',
    enCode: 'changeType',
    name: '批改类型',
  },
  {
    id: '2',
    enCode: 'name',
    name: '姓名',
  },
  {
    id: '3',
    enCode: 'idNumber',
    name: '身份证号',
  },
  {
    id: '4',
    enCode: 'workType',
    name: '雇员工种',
  },
  {
    id: '5',
    enCode: 'gender',
    name: '性别',
  },
  {
    id: '6',
    enCode: 'age',
    name: '年龄',
  },
  {
    id: '7',
    enCode: 'birthDay',
    name: '出生日期',
  },
  {
    id: '8',
    enCode: 'phoneNumber',
    name: '电话号码',
  },
  {
    id: '9',
    enCode: 'modifyInfo',
    name: '修改内容',
  },
];
 
const innerVisible = computed({
  get() {
    return props.modelValue;
  },
  set(val) {
    emit('update:modelValue', val);
  },
});
 
watch(
  () => props.modelValue,
  (val) => {
    if (val) {
      getList();
    }
  },
  {
    immediate: true,
  }
);
 
const {
  getDataSource: getList,
  proTableProps,
  paginationState,
  extraParamState,
  reset,
} = useTable(
  async ({ pageIndex, pageSize }, extraParamState) => {
    try {
      return Promise.resolve({
        pageModel: {
          rows: pageSize,
          page: pageIndex,
          totalCount: props.form.staffList.length,
        },
        data: paginateList(props.form.staffList, pageIndex, pageSize),
      });
    } catch (error) {}
  },
  {
    defaultExtraParams: {
      keyWord: '',
      orderInput: [{ property: 'id', order: OrderInputType.Asc }],
    },
  }
);
</script>
 
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
</style>