agent.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <PageWrapper contentBackground>
  3. <template #footer>
  4. <a-tabs v-model:activeKey="state" @change="changeTable">
  5. <a-tab-pane :key="0" tab="待处理" />
  6. <a-tab-pane :key="1" tab="已处理" />
  7. </a-tabs>
  8. </template>
  9. <div class="desc-wrap-BasicTable">
  10. <BasicTable @register="registerTimeTable" >
  11. <template #toolbar>
  12. <a-button type="primary" @click="emailTemplate" v-if="getCheckPerm('agent-set')"> 邮件模板</a-button>
  13. </template>
  14. <template #action="{ record }">
  15. <TableAction
  16. stopButtonPropagation
  17. :actions="[
  18. {
  19. label: '处理',
  20. icon: 'icon-park-outline:door-handle',
  21. ifShow: getCheckPerm('agent-deal') && record.state == 0,
  22. onClick: handleWithdraw.bind(null, record),
  23. },
  24. ]"
  25. />
  26. </template>
  27. </BasicTable>
  28. </div>
  29. <addMessgeModal @register="register" @update="reload" />
  30. </PageWrapper>
  31. </template>
  32. <script lang="ts">
  33. import { defineComponent, ref } from 'vue';
  34. import { BasicTable, useTable, TableAction, FormProps } from '/@/components/Table';
  35. import { PageWrapper } from '/@/components/Page';
  36. import { Divider, Card, Empty, Descriptions, Steps, Tabs } from 'ant-design-vue';
  37. import { agentAuditList, agentAuditHandle } from '/@/api/operate'
  38. import { useI18n } from '/@/hooks/web/useI18n';
  39. import addMessgeModal from './components/agent/addModal.vue'
  40. import { useModal } from '/@/components/Modal';
  41. import { agentSchema, refundTimeTableData } from './data';
  42. import { usePermissionStore } from '/@/store/modules/permission';
  43. export default defineComponent({
  44. components: {
  45. BasicTable,
  46. PageWrapper,
  47. TableAction,
  48. addMessgeModal,
  49. [Divider.name]: Divider,
  50. [Card.name]: Card,
  51. Empty,
  52. [Descriptions.name]: Descriptions,
  53. [Descriptions.Item.name]: Descriptions.Item,
  54. [Steps.name]: Steps,
  55. [Steps.Step.name]: Steps.Step,
  56. [Tabs.name]: Tabs,
  57. [Tabs.TabPane.name]: Tabs.TabPane,
  58. },
  59. setup() {
  60. const { t } = useI18n();
  61. const [register, { openModal }] = useModal();
  62. const permissionStore = usePermissionStore();
  63. const { getCheckPerm } = permissionStore;
  64. const state = ref<number>(0); //未处理,0已处理(默认1)
  65. const searchForm: Partial<FormProps> = {
  66. labelWidth: 100,
  67. autoSubmitOnEnter:true,
  68. schemas: [
  69. {
  70. field: 'payTime',
  71. label: '提交时间',
  72. component: 'RangePicker',
  73. componentProps: {
  74. maxLength: 100,
  75. format: 'YYYY-MM-DD',
  76. valueFormat:'YYYY-MM-DD',
  77. // showTime: true,
  78. },
  79. colProps: {
  80. xl: 11,
  81. xxl: 11,
  82. },
  83. },
  84. {
  85. field: 'companyName',
  86. label: '公司名称',
  87. component: 'Input',
  88. colProps: {
  89. xl: 6,
  90. xxl: 6,
  91. },
  92. },
  93. ],
  94. };
  95. const [registerTimeTable,{reload}] = useTable({
  96. api: agentAuditList,
  97. // title: '',
  98. rowKey: 'id',
  99. fetchSetting: {
  100. pageField: 'pageNum',
  101. sizeField: 'pageSize',
  102. listField: 'list',
  103. totalField: 'total',
  104. },
  105. searchInfo: { handleState:state },
  106. columns: agentSchema,
  107. formConfig: searchForm,
  108. useSearchForm: true,
  109. dataSource: refundTimeTableData,
  110. showTableSetting: true,
  111. showIndexColumn: false,
  112. // pagination: { pageSize: 20 },
  113. beforeFetch:(params)=>{
  114. return {
  115. ...params,
  116. startTime: params.payTime && params.payTime[0],
  117. endTime: params.payTime && params.payTime[1],
  118. }
  119. },
  120. // scroll: { y: 300 },
  121. actionColumn: {
  122. width: 100,
  123. title: '操作',
  124. // ifShow:state.value == 1,
  125. dataIndex: 'action',
  126. slots: { customRender: 'action' },
  127. },
  128. });
  129. function changeTable(val: string) {
  130. state.value = val;
  131. reload();
  132. }
  133. function emailTemplate(){
  134. console.log('emailTemplate',val)
  135. }
  136. async function handleWithdraw(record: Recordable) {
  137. openModal(true,record)
  138. }
  139. return {
  140. registerTimeTable,
  141. handleWithdraw,
  142. changeTable,
  143. state,
  144. reload,
  145. emailTemplate,
  146. register,
  147. openModal,
  148. getCheckPerm,
  149. };
  150. },
  151. });
  152. </script>