YangYuGang
2025-03-11 bfdfeb40c7ba97511584a30477acf5ad801398ba
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
<!--
 * @Description: file content
 * @Author: Ben Lin
 * @version: 
 * @Date: 2024-06-18 15:09:48
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-17 04:50:55
-->
<template>
  <div>
    <BasicTable @register="registerTable">
      <template #toolbar>
        <a-button v-if="is_active" type="primary" @click="handleCreate"> 新增调拨单 </a-button>
      </template>
      <template #action="{ record }">
        <TableAction :actions="[
          {
            icon: 'clarity:info-standard-line',
            tooltip: bt('查看单据详情'),
            onClick: handleEdit.bind(null, record),
          },
        ]" />
      </template>
    </BasicTable>
    <TransferModal @register="registerModal" @success="handleSuccess" />
  </div>
</template>
<script lang="ts" setup>
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { columns, searchFormSchema } from './transfer.data';
import { getTransferListByPage } from '/@/api/tigerapi/wms/transfer';
import { useI18n } from '/@/hooks/web/useI18n';
import { useGo } from '/@/hooks/web/usePage';
import TransferModal from './TransferModal.vue';
import { useUserStore } from '/@/store/modules/user';
import { useModal } from '/@/components/Modal';
const [registerModal, { openModal: openTransferModal }] = useModal();
const { t: bt } = useI18n();
const go = useGo();
const id = '8c3da85182d044e7a4839dd2e11ac809';
const roles = useUserStore().getUserInfo.roles
const is_active = roles.some(item => item.MENU_CODE === id)
const [registerTable, { reload }] = useTable({
  title: bt('调拨单列表'),
  api: getTransferListByPage,
  columns,
  formConfig: {
    labelWidth: 120,
    schemas: searchFormSchema,
  },
  actionColumn: {
    width: 80,
    title: bt('操作'),
    dataIndex: 'action',
    slots: { customRender: 'action' },
    fixed: 'right', //undefined,
  },
  canResize: true,
  useSearchForm: true,
  showTableSetting: true,
  bordered: true,
  showIndexColumn: false,
});
// function handleCreate() {
//   openDrawer(true, {
//     isUpdate: false,
//   });
// }
function handleCreate() {
  openTransferModal(true, {
        data: 'content',
        info: 'Info',
    });
}
function handleSuccess() {
  reload();
}
function handleEdit(record: Recordable) {
  go('/transferDetail/' + record.BILLCODE);
}
</script>