| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104 |
- <template>
- <cacp-search-layout>
- <template #search>
- <cacp-search-panel-layout
- :model="state.queryData"
- ref="formRef"
- :rules="rules"
- label-position="left"
- label-width="auto"
- :gutter="30"
- :colSpan="6"
- >
- <el-form-item label="报关单号" prop="entryId">
- <el-input v-model="state.queryData.entryId" clearable />
- </el-form-item>
- <el-form-item label="通关模式" prop="passMode">
- <el-select v-model="state.queryData.passMode" clearable>
- <el-option
- v-for="item in dict.pass_mode"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="运输方式" prop="trafMode">
- <el-select v-model="state.queryData.trafMode" filterable clearable>
- <el-option
- v-for="item in trafMode"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- <span style="float: left">{{ item.label }}</span>
- <span style="float: right;color: var(--el-text-color-secondary);font-size: 13px;">
- {{ item.value }}
- </span>
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="进出口标识" prop="ieFlag">
- <el-select v-model="state.queryData.ieFlag" clearable>
- <el-option
- v-for="item in dict.ie_flag"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="进出境口岸" prop="iePort">
- <el-select v-model="state.queryData.iePort" filterable
- clearable>
- <el-option
- v-for="item in iePort"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- <span style="float: left">{{ item.label }}</span>
- <span style="float: right;color: var(--el-text-color-secondary);font-size: 13px;">
- {{ item.value }}
- </span>
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="隶属海关" prop="customsCode" v-show="state.isSelect">
- <el-select v-model="state.queryData.customsCode"
- clearable>
- <el-option
- v-for="item in dict.affiliation_customs_info"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="监管方式" prop="tradeMode">
- <el-select v-model="state.queryData.tradeMode" clearable>
- <el-option
- v-for="item in tradeMode"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- <span style="float: left">{{ item.label }}</span>
- <span style="float: right;color: var(--el-text-color-secondary);font-size: 13px;">
- {{ item.value }}
- </span>
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="报关模式" prop="declMode">
- <el-select v-model="state.queryData.declMode"
- clearable>
- <el-option
- v-for="item in dict.decl_mode"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="是否查验" prop="checkFlag">
- <el-select v-model="state.queryData.checkFlag"
- clearable>
- <el-option
- v-for="item in dict.yes_no"
- :key="item.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="结关开始时间" prop="beginReleaseDate">
- <el-date-picker type="date" value-format="YYYY-MM-DD" v-model="state.queryData.beginReleaseDate"
- :disabled-date="beginDatePickerOptions" clearable />
- </el-form-item>
- <el-form-item label="结关结束时间" prop="endReleaseDate">
- <el-date-picker type="date" value-format="YYYY-MM-DD" v-model="state.queryData.endReleaseDate"
- :disabled-date="endDatePickerOptions" clearable />
- </el-form-item>
- <template #buttonGroup>
- <el-button type="primary" @click="onSearch">查询</el-button>
- <el-button type="info" @click="onReset">重置</el-button>
- </template>
- </cacp-search-panel-layout>
- </template>
- <cacp-complex-table
- :actions="actions"
- :data="tableData"
- :pagination="tablePagination"
- :actionsWidth="50"
- @on-page-change="onPageChange"
- @on-size-change="onSizeChange"
- :loading="loading"
- >
- <!-- 动态渲染所有列 -->
- <template v-for="column in dynamicColumns.visibleColumns.value" :key="column.key">
- <el-table-column v-bind="getColumnProps(column)">
- <template #default="scope">
- <template v-if="column.isDict">
- <dict-tag
- :options="getDictOptions(column.dictKey!)"
- :dictValue="scope.row[column.property!]"
- :whole-match="column.key === 'goodsType'"
- />
- </template>
- <template v-else-if="column.isDate">
- {{ scope.row[column.property!] ? dayjs(scope.row[column.property!]).format('YYYY-MM-DD HH:mm:ss'):'' }}
- </template>
- <template v-else-if="getFormatter(column.key)">
- {{ getFormatter(column.key)!(scope.row[column.property!]) }}
- </template>
- <template v-else>
- {{ scope.row[column.property!] }}
- </template>
- </template>
- </el-table-column>
- </template>
- </cacp-complex-table>
- <!-- 动态列设置对话框 -->
- <DynamicColumnDialog
- v-model="showColumnDialog"
- :width="'70%'"
- :columns="allColumnConfigs"
- :selected-keys="dynamicColumns.selectedKeys.value"
- @update:selected-keys="dynamicColumns.updateSelectedKeys"
- />
- </cacp-search-layout>
- </template>
- <script setup lang="ts">
- import { useLoading } from '@cacp/ui'
- import { exportList, getList} from '@/apis/analyze/goodsEntry'
- import type {EntryQuery, Entry} from '@/types/analyze/goodsEntry'
- import config from '@/config'
- import { getBaseCodeList } from '@/apis/base/baseCode'
- import dayjs from 'dayjs'
- import {
- SuccessResultCode,
- useComplexTable,
- type SearchPanelLayoutInstance,
- type TableAction
- } from '@cacp/ui'
- import type { FormRules } from 'element-plus'
- import { ref, reactive, onBeforeMount } from 'vue'
- import { useRouter } from 'vue-router'
- import { permissionStatus } from '@/utils/globalPermission'
- import { useDictType } from '@/components/useDict'
- import { useCoreStore } from '@/stores'
- import DictTag from "@/components/DictTag/dictTag.vue";
- import DynamicColumnDialog, { type ColumnConfig } from '@/components/DynamicColumnSelector/DynamicColumnDialog.vue'
- import { useDynamicColumns } from '@/hooks/useDynamicColumns'
- const coreStore = useCoreStore()
- interface State {
- queryData: EntryQuery
- isSelect: boolean
- }
- const { loading, setLoading } = useLoading()
- const { dict } = useDictType('affiliation_customs_info', 'proc_idea', 'proc_result', 'yes_no', 'decl_mode', 'pass_mode', 'ie_flag','goods_type')
- const tableHooks = useComplexTable<Entry>(config)
- const { tableData, tablePagination, setPagination, setPageIndex, setPageSizes } = tableHooks
- const router = useRouter()
- const formRef = ref<SearchPanelLayoutInstance>()
- //基础数据返回jsonObject
- const iePort = ref([]);
- const trafMode = ref([]);
- const tradeMode = ref([]);
- const tradeCountry = ref([]);
- const countryIso = ref([]);
- const now = dayjs();
- const endDatePickerOptions = (time:Date) => {
- if (!state.queryData.beginReleaseDate) return false // 如果没有选择开始日期,结束日期不受限制
- return time.getTime() < new Date(state.queryData.beginReleaseDate).getTime() - 8.64e7;//如果没有后面的-8.64e7就是不可以选择今天的
- }
- const beginDatePickerOptions = (time:Date) => {
- if (!state.queryData.endReleaseDate) return false // 如果没有选择开始日期,结束日期不受限制
- return time.getTime() > new Date(state.queryData.endReleaseDate).getTime() - 8.64e6;//如果没有后面的-8.64e6就是不可以选择今天的
- }
- // 定义所有列的配置
- const allColumnConfigs: ColumnConfig[] = [
- {
- key: 'entryId',
- property: 'entryId',
- label: '报关单号',
- width: 160,
- sortable: true,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true
- },
- {
- key: 'passMode',
- property: 'passMode',
- label: '通关模式',
- width: 80,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true,
- isDict: true,
- dictKey: 'pass_mode'
- },
- {
- key: 'trafMode',
- property: 'trafMode',
- label: '运输方式',
- width: 80,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true
- },
- {
- key: 'ieFlag',
- property: 'ieFlag',
- label: '出入境标志',
- width: 90,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true,
- isDict: true,
- dictKey: 'ie_flag'
- },
- {
- key: 'iePort',
- property: 'iePort',
- label: '进出境口岸',
- width: 100,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true
- },
- {
- key: 'customsCode',
- property: 'customsCode',
- label: '隶属海关',
- width: 100,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true,
- isDict: true,
- dictKey: 'affiliation_customs_info'
- },
- {
- key: 'tradeMode',
- property: 'tradeMode',
- label: '监管方式',
- width: 80,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true
- },
- {
- key: 'declMode',
- property: 'declMode',
- label: '报关模式',
- width: 80,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true,
- isDict: true,
- dictKey: 'decl_mode'
- },
- {
- key: 'tradeCountry',
- property: 'tradeCountry',
- label: '贸易国别',
- width: 80,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true
- },
- {
- key: 'ieDate',
- property: 'ieDate',
- label: '进出口时间',
- width: 150,
- sortable: true,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true,
- isDate: true
- },
- {
- key: 'declDate',
- property: 'declDate',
- label: '申报时间',
- width: 150,
- sortable: true,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true,
- isDate: true
- },
- {
- key: 'releaseDate',
- property: 'releaseDate',
- label: '结关时间',
- width: 150,
- sortable: true,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true,
- isDate: true
- },
- {
- key: 'declAdvanceFlag',
- property: 'declAdvanceFlag',
- label: '是否提前申报',
- width: 110,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDict: true,
- dictKey: 'yes_no'
- },
- {
- key: 'acceptDate',
- property: 'acceptDate',
- label: '自动受理时间',
- width: 150,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'exInPortDate',
- property: 'exInPortDate',
- label: '货物进港时间',
- width: 150,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'orderReceiveDate',
- property: 'orderReceiveDate',
- label: '现场接单时间',
- width: 150,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'certRlsDate',
- property: 'certRlsDate',
- label: '单证放行时间',
- width: 150,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'preReleaseDate',
- property: 'preReleaseDate',
- label: '担保放行时间',
- width: 150,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'examDate',
- property: 'examDate',
- label: '转关数据发送时间',
- width: 150,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'checkDate',
- property: 'checkDate',
- label: '转关数据核销时间',
- width: 150,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'assessStartDate',
- property: 'assessStartDate',
- label: '现场验估时间',
- width: 150,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'assessEndDate',
- property: 'assessEndDate',
- label: '验估处置完毕时间',
- width: 150,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'newTwoStepFlag',
- property: 'newTwoStepFlag',
- label: '是否新两步申报',
- width: 120,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false,
- isDict: true,
- dictKey: 'yes_no'
- },
- // 单位信息组
- {
- key: 'consignCode',
- property: 'consignCode',
- label: '境内收发货人代码',
- width: 130,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'consignName',
- property: 'consignName',
- label: '境内收发货人名称',
- width: 130,
- showOverflowTooltip: true,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'frnConsignCode',
- property: 'frnConsignCode',
- label: '境外收发货人代码',
- width: 130,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'frnConsignName',
- property: 'frnConsignName',
- label: '境外收发货人名称(中文)',
- width: 170,
- showOverflowTooltip: true,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'agentCode',
- property: 'agentCode',
- label: '申报单位代码',
- width: 110,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'agentName',
- property: 'agentName',
- label: '申报单位名称',
- width: 110,
- showOverflowTooltip: true,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'ownerCode',
- property: 'ownerCode',
- label: '生产销售单位代码',
- width: 130,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'ownerName',
- property: 'ownerName',
- label: '生产销售单位名称',
- width: 130,
- showOverflowTooltip: true,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- // 货运信息组
- {
- key: 'grossWt',
- property: 'grossWt',
- label: '货运量毛重',
- width: 90,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'netWt',
- property: 'netWt',
- label: '货运量净重',
- width: 90,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'rmbPrice',
- property: 'rmbPrice',
- label: '货运值人民币(总)',
- width: 130,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'usdPrice',
- property: 'usdPrice',
- label: '货运值美元(总)',
- width: 130,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- // 时效信息组
- {
- key: 'orderReceiveCost',
- property: 'orderReceiveCost',
- label: '接单耗时(小时)',
- width: 120,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'cuCost',
- property: 'cuCost',
- label: '海关通关时间(小时)',
- width: 140,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true
- },
- {
- key: 'totalCost',
- property: 'totalCost',
- label: '整体通关时间(小时)',
- width: 140,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: true
- },
- {
- key: 'beforeDeclCost',
- property: 'beforeDeclCost',
- label: '申报前准备时间(小时)',
- width: 150,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- {
- key: 'noteS',
- property: 'noteS',
- label: '备注',
- showOverflowTooltip: true,
- groupKey: 'entry',
- groupTitle: '报关单信息',
- defaultVisible: false
- },
- // 查验信息组
- {
- key: 'checkFlag',
- property: 'checkFlag',
- label: '是否查验',
- width: 80,
- groupKey: 'inspection',
- groupTitle: '查验信息',
- defaultVisible: false,
- isDict: true,
- dictKey: 'yes_no'
- },
- {
- key: 'checkCustomsCode',
- property: 'checkCustomsCode',
- label: '查验海关',
- width: 100,
- groupKey: 'inspection',
- groupTitle: '查验信息',
- defaultVisible: false,
- isDict: true,
- dictKey: 'affiliation_customs_info'
- },
- {
- key: 'manCreateTime',
- property: 'manCreateTime',
- label: '查验指令下达时间',
- width: 150,
- groupKey: 'inspection',
- groupTitle: '查验信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'manChkTimeStart',
- property: 'manChkTimeStart',
- label: '查验开始时间',
- width: 150,
- sortable: true,
- groupKey: 'inspection',
- groupTitle: '查验信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'manChkTimeEnd',
- property: 'manChkTimeEnd',
- label: '查验结束时间',
- width: 150,
- groupKey: 'inspection',
- groupTitle: '查验信息',
- defaultVisible: false,
- isDate: true
- },
- {
- key: 'manProcResult',
- property: 'manProcResult',
- label: '处理结果',
- width: 80,
- showOverflowTooltip: true,
- groupKey: 'inspection',
- groupTitle: '查验信息',
- defaultVisible: false,
- isDict: true,
- dictKey: 'proc_result'
- },
- {
- key: 'manProcIdea',
- property: 'manProcIdea',
- label: '处理意见',
- width: 80,
- showOverflowTooltip: true,
- groupKey: 'inspection',
- groupTitle: '查验信息',
- defaultVisible: false,
- isDict: true,
- dictKey: 'proc_idea'
- },
- {
- key: 'profVerifyFlag',
- property: 'profVerifyFlag',
- label: '是否专业审单',
- width: 110,
- groupKey: 'inspection',
- groupTitle: '查验信息',
- defaultVisible: false,
- isDict: true,
- dictKey: 'yes_no'
- },
- // 商品信息组
- {
- key: 'gno',
- property: 'gno',
- label: '商品项号',
- width: 80,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: true
- },
- {
- key: 'iqCode',
- property: 'iqCode',
- label: '检验检疫编码',
- width: 120,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false
- },
- {
- key: 'codeTs',
- property: 'codeTs',
- label: '商品编码',
- width: 100,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: true
- },
- {
- key: 'gname',
- property: 'gname',
- label: '商品名称',
- width: 100,
- showOverflowTooltip: true,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: true
- },
- {
- key: 'gmodel',
- property: 'gmodel',
- label: '规格型号',
- width: 100,
- showOverflowTooltip: true,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: true
- },
- {
- key: 'qty1',
- property: 'qty1',
- label: '第一(法定)数量',
- width: 120,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false
- },
- {
- key: 'rmbPriceList',
- property: 'rmbPriceList',
- label: '商品货运值人民币',
- width: 130,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false
- },
- {
- key: 'usdPriceList',
- property: 'usdPriceList',
- label: '商品货运值美元',
- width: 130,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false
- },
- {
- key: 'gCertFlag',
- property: 'gCertFlag',
- label: '每项商品需要监管证件',
- width: 160,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false
- },
- {
- key: 'ungid',
- property: 'ungid',
- label: 'UN编码',
- width: 70,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false
- },
- {
- key: 'ungFlag',
- property: 'ungFlag',
- label: '非危险化学品',
- width: 110,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false,
- isDict: true,
- dictKey: 'yes_no'
- },
- {
- key: 'ungModel',
- property: 'ungModel',
- label: '危包规格',
- width: 110,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false
- },
- {
- key: 'ungClassify',
- property: 'ungClassify',
- label: '危包类别',
- width: 80,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false
- },
- {
- key: 'ungGName',
- property: 'ungGName',
- label: '危险货物名称',
- width: 110,
- showOverflowTooltip: true,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false
- },
- {
- key: 'productCharCode',
- property: 'productCharCode',
- label: '货物属性代码',
- width: 110,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: false
- },
- {
- key: 'goodsType',
- property: 'goodsType',
- label: '危险品类型',
- width: 130,
- groupKey: 'goods',
- groupTitle: '商品信息',
- defaultVisible: true,
- isDict: true,
- dictKey: 'goods_type'
- }
- ];
- // 使用动态列 Hook
- const dynamicColumns = useDynamicColumns({
- storageKey: 'goods_entry_columns',
- defaultVisibleKeys: allColumnConfigs
- .filter(col => col.defaultVisible)
- .map(col => col.key),
- columns: allColumnConfigs
- })
- // 对话框显示状态
- const showColumnDialog = ref(false)
- const state = reactive<State>({
- queryData: {
- entryId: '',
- beginReleaseDate: now.subtract(1, 'month').format('YYYY-MM-DD'),
- endReleaseDate: now.format('YYYY-MM-DD'),
- ieFlag: '',
- iePort: '',
- customsCode: '',
- passMode: '',
- trafMode: '',
- tradeMode: '',
- declMode: '',
- checkFlag: '',
- goodsType: '2'
- },
- isSelect: false,
- })
- const rules = reactive<FormRules<EntryQuery>>({
- beginReleaseDate: [{ required: true, message: '请输入结关开始时间', trigger: 'change' }],
- endReleaseDate: [{ required: true, message: '请输入结关结束时间', trigger: 'change' }]
- })
- const actions = <Array<TableAction>>[
- {
- key: '1',
- text: '查看',
- onclick: onView,
- limit: permissionStatus('one', 'GOODS_ENTRY_VIEW_BT'),
- type: 'primary'
- },
- {
- key: '2',
- text: '动态列设置',
- onclick: onColumnsSelector,
- limit: 'none',
- type: 'primary'
- },
- {
- key: '3',
- text: '导出',
- confirm: true,
- onclick: onExportData,
- limit: permissionStatus('none', 'GOODS_ENTRY_EXPORT_BT'),
- type: 'primary'
- },
- ]
- const getColumnProps = (column: any) => {
- // 类型断言为 ColumnConfig
- const col = column as ColumnConfig
- const props: Record<string, any> = {
- property: col.property || col.key,
- label: col.label
- }
- if (col.width) props.width = col.width
- if (col.sortable) props.sortable = col.sortable
- if (col.showOverflowTooltip) props['show-overflow-tooltip'] = col.showOverflowTooltip
- return props
- }
- function onSearch() {
- onPageChange(1)
- }
- function onReset() {
- formRef.value.resetFields()
- onPageChange(1)
- }
- function onColumnsSelector() {
- showColumnDialog.value = true;
- }
- function onView(row: Entry) {
- router.push({
- path: '/get-goods',
- query: {
- entryId: row.entryId
- }
- })
- }
- function onPageChange(page: number) {
- setPageIndex(page)
- onLoadData()
- }
- function onSizeChange(size: number) {
- setPageSizes(size)
- onLoadData()
- }
- // 运输方式
- function formatTrafMode(code: string): string {
- const result = trafMode.value.find((item) => item.value == code)
- if (result) {
- return result.label
- }
- return ''
- }
- // 监管方式
- function formatTradeMode(code: string): string {
- const result = tradeMode.value.find((item) => item.value == code)
- if (result) {
- return result.label
- }
- return ''
- }
- // 监管方式
- function formatCountryIso(code: string): string {
- const result = countryIso.value.find((item) => item.value == code)
- if (result) {
- return result.label
- }
- return ''
- }
- // 进出境口岸
- function formatIePort(code: string): string {
- const result = iePort.value.find((item) => item.value == code)
- if (result) {
- return result.label
- }
- return ''
- }
- // 获取字典选项
- const getDictOptions = (dictKey: string) => {
- return dict.value?.[dictKey] || []
- }
- // 根据列键获取格式化函数
- const getFormatter = (key: string): ((value: any) => string) | undefined => {
- const formatters: Record<string, (value: any) => string> = {
- 'trafMode': formatTrafMode,
- 'tradeMode': formatTradeMode,
- 'tradeCountry': formatCountryIso,
- 'iePort': formatIePort
- }
- return formatters[key]
- }
- // 加载数据
- async function onLoadData() {
- const loginCustomsCode = coreStore.currentUser.customsCode;
- if("4700" === loginCustomsCode){
- state.isSelect = true;
- }else{
- state.queryData.customsCode = loginCustomsCode;
- state.isSelect = false;
- }
- const query = { ...state.queryData, pageIndex: tablePagination.currentPage, pageSize: tablePagination.pageSize }
- setLoading(true)
- const res = await getList(query)
- if (res.code == SuccessResultCode) {
- setPagination(res.data)
- }
- setLoading(false)
- }
- // 加载数据
- async function onExportData() : Promise<void>{
- const query = { ...state.queryData,exportHeadList:dynamicColumns.selectedKeys.value.toString()}
- await exportList(query);
- }
- async function getTrafMode() {
- const traf = await getBaseCodeList("TransitMode")
- if (traf.code == SuccessResultCode) {
- trafMode.value = traf.data
- }
- }
- async function getCustoms() {
- const traf = await getBaseCodeList("customsCode")
- if (traf.code == SuccessResultCode) {
- iePort.value = traf.data
- }
- }
- async function getTradeMode() {
- const traf = await getBaseCodeList("tradeCode")
- if (traf.code == SuccessResultCode) {
- tradeMode.value = traf.data
- }
- }
- async function getTradeCountry() {
- const traf = await getBaseCodeList("countryCode")
- if (traf.code == SuccessResultCode) {
- tradeCountry.value = traf.data
- }
- }
- async function getCountryIso() {
- const traf = await getBaseCodeList("countryIsoE")
- if (traf.code == SuccessResultCode) {
- countryIso.value = traf.data
- }
- }
- onBeforeMount(async () => {
- await Promise.all([ getCustoms(),getTrafMode(),getTradeMode(),getTradeCountry(),getCountryIso()])
- setTimeout(() => {
- onLoadData()
- }, 500)
- // console.log(dict);
- })
- </script>
|