#
Junjie
2025-02-14 ac4341ea6b66ae02427d39d35f41d42d78b2eb2e
zy-asrs-admin/src/views/base/zpalletBarcode/index.vue
@@ -7,6 +7,7 @@
import EditView from './edit.vue'
import { formatMessage } from '@/utils/localeUtils.js';
import ZpalletBarcodePrint from '@/components/print/zpalletBarcodePrint/index.vue';
import useTableSearch from '@/utils/tableUtils.jsx';
const context = getCurrentInstance()?.appContext.config.globalProperties;
const router = useRouter();
@@ -22,8 +23,18 @@
let generateBarcodeValue = ref("80000001");
let generateNum = ref(100);
const state = reactive({
  selectedRowKeys: [],
  loading: false,
});
let tableData = ref([]);
getPage();
const {
  getColumnSearchProps,
  handleResizeColumn,
} = useTableSearch();
const columns = [
  {
@@ -31,18 +42,21 @@
    dataIndex: 'barcode',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('barcode'),
  },
  {
    title: formatMessage('db.man_zpallet_barcode.flag', '标识'),
    dataIndex: 'flag',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('flag'),
  },
  {
    title: formatMessage('db.man_zpallet_barcode.barcode_print', '打印状态'),
    dataIndex: 'barcodePrint$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('barcodePrint$'),
  },
  // {
  //   title: formatMessage('db.man_zpallet_barcode.uuid', '编号'),
@@ -55,6 +69,7 @@
    dataIndex: 'status$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('status$'),
  },
  // {
  //   title: formatMessage('db.man_zpallet_barcode.create_time', '添加时间'),
@@ -85,6 +100,7 @@
    dataIndex: 'memo',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('memo'),
  },
  {
@@ -96,10 +112,7 @@
  },
];
const state = reactive({
  selectedRowKeys: [],
  loading: false,
});
const hasSelected = computed(() => state.selectedRowKeys.length > 0);
const start = () => {
  state.loading = true;
@@ -115,6 +128,7 @@
};
function getPage() {
  state.loading = true;
  post('/api/zpalletBarcode/page', {
    current: currentPage,
    pageSize: pageSize,
@@ -124,6 +138,8 @@
    if (result.code == 200) {
      let data = result.data;
      tableData.value = data;
      state.loading = false;
    } else if (result.code === 401) {
      message.error(result.msg);
      logout()
@@ -256,7 +272,7 @@
    <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
      :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
      :pagination="{ total: tableData.total, onChange: onPageChange }"
      :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns">
      :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn" :loading="state.loading">
      <template #bodyCell="{ column, text, record }">
        <template v-if="column.dataIndex === 'oper'">
          <div style="display: flex;justify-content: space-evenly;">