123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <template>
- <a-card :bordered="false" v-if="indexShow">
- <a-tabs v-model:activeKey="searchFormState.sblx" @change="onSearch()">
- <a-tab-pane key="1" tab="备案"/>
- <a-tab-pane key="2" tab="变更"/>
- <a-tab-pane key="3" tab="作废"/>
- </a-tabs>
- <a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
- <a-row :gutter="24">
- <a-col :span="6">
- <a-form-item label="核放单预录入号" name="hfdrCode">
- <a-input v-model:value="searchFormState.hfdrCode" placeholder="请输入核放单预录入号" allow-clear/>
- </a-form-item>
- </a-col>
- <a-col :span="6">
- <a-form-item label="核放单号" name="hfdCode">
- <a-input v-model:value="searchFormState.hfdCode" placeholder="请输入核放单号" allow-clear/>
- </a-form-item>
- </a-col>
- <a-col :span="6">
- <a-form-item label="台账编号" name="ledgerCode">
- <a-input v-model:value="searchFormState.ledgerCode" placeholder="请输入台账编号" allow-clear/>
- </a-form-item>
- </a-col>
- <a-col :span="6">
- <a-form-item label="进出标志" name="jcbz">
- <a-select v-model:value="searchFormState.jcbz" placeholder="请选择进出标志" :options="jcbzOptions" show-search allow-clear option-filter-prop="label"/>
- </a-form-item>
- </a-col>
- <a-col :span="6">
- <a-form-item label="关联核注清单编号" name="glhzqdbh">
- <a-input v-model:value="searchFormState.glhzqdbh" placeholder="请输入关联核注清单编号" allow-clear/>
- </a-form-item>
- </a-col>
- <a-col :span="6">
- <a-form-item label="单据状态" name="status">
- <a-select v-model:value="searchFormState.status" placeholder="请选择单据状态" :options="statusOptions" show-search allow-clear option-filter-prop="label"/>
- </a-form-item>
- </a-col>
- <a-col :span="6" :offset="6">
- <div style="width: 100%;display: flex;justify-content: flex-end">
- <a-button type="primary" @click="onSearch()">查询</a-button>
- <a-button style="margin: 0 0 0 8px" @click="reset">重置</a-button>
- </div>
- </a-col>
- </a-row>
- </a-form>
- <s-table
- ref="tableRef"
- :columns="columns"
- :data="loadData"
- :alert="options.alert.show"
- bordered
- :row-key="(record) => record.id"
- :tool-config="toolConfig"
- :row-selection="options.rowSelection"
- v-model:filterParam="filterParam"
- :scroll="{ x: 2000 }"
- >
- <template #operator class="table-operator">
- <a-space>
- <a-button type="primary" @click="onDetail(null, false, '1')" v-if="hasPerm('qySecondlineHfdAdd') && searchFormState.sblx == 1">
- <template #icon><plus-outlined /></template>
- 新增
- </a-button>
- <!-- <xn-batch-delete-->
- <!-- v-if="hasPerm('qySecondlineHfdDelete')"-->
- <!-- :selectedRowKeys="selectedRowKeys"-->
- <!-- @batchDelete="deleteBatchQySecondlineHfd"-->
- <!-- />-->
- <a-button @click="onExport" v-if="hasPerm('qySecondlineHfdBatchExport')">
- <template #icon><export-outlined /></template>
- 批量导出
- </a-button>
- </a-space>
- </template>
- <template #bodyCell="{ column, record }">
- <template v-if="column.dataIndex === 'hfdLx'">
- {{ $TOOL.dictTypeData('hfdlx', record.hfdLx) }}
- </template>
- <template v-if="column.dataIndex === 'status'">
- {{ $TOOL.dictTypeData('djzt', record.status) }}
- </template>
- <template v-if="column.dataIndex === 'sblx'">
- {{ $TOOL.dictTypeData('lgs_sblx', record.sblx) }}
- </template>
- <template v-if="column.dataIndex === 'action'">
- <a-space>
- <a @click="onDetail(record, true)" v-if="hasPerm('qySecondlineHfdView')">查看</a>
- <a @click="onDetail(record)" v-if="hasPerm('qySecondlineHfdEdit')">编辑</a>
- <a-popconfirm title="确定要删除吗?" @confirm="deleteQySecondlineHfd(record)">
- <a-button type="link" danger size="small" v-if="hasPerm('qySecondlineHfdDelete')">删除</a-button>
- </a-popconfirm>
- <a @click="onDetail(record, false, null, true)">复制</a>
- <a @click="resultDetailRef.onOpen(record)" v-if="record.status == 3 || record.status == 4">查看回执</a>
- <a @click="onChange(record)" v-if="record.sblx == 2 && record.status == 3">变更</a>
- <a-button type="link" danger size="small" @click="onKill(record)" v-if="record.sblx == 1 && record.status == 3">作废</a-button>
- </a-space>
- </template>
- </template>
- </s-table>
- </a-card>
- <Detail v-else ref="detailRef" @onClose="indexShow = true" @successful="onSearch()" />
- <ResultDetail ref="resultDetailRef"/>
- </template>
- <script setup name="qysecondlinehfd">
- import tool from '@/utils/tool'
- import { cloneDeep } from 'lodash-es'
- import Detail from './detail.vue'
- import qySecondlineHfdApi from '@/api/yqyc/qySecondlineHfdApi'
- import downloadUtil from "@/utils/downloadUtil";
- import {Modal} from "ant-design-vue";
- import {createVNode} from "vue";
- import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
- import qyRecordInfoApi from "@/api/yqyc/qyRecordInfoApi";
- import qySecondLineHzdTzApi from "@/api/yqyc/qySecondLineHzdTzApi";
- import ResultDetail from "./result.vue";
- const { proxy } = getCurrentInstance()
- const searchFormState = ref({
- sblx: '1'
- })
- const searchFormStateReal = ref(searchFormState.value) // 点击搜索后备份的查询参数
- const searchFormRef = ref()
- const resultDetailRef = ref()
- const tableRef = ref()
- const filterParam = ref({})
- const detailRef = ref()
- const indexShow = ref(true)
- const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
- // 查询区域显示更多控制
- const advanced = ref(false)
- const toggleAdvanced = () => {
- advanced.value = !advanced.value
- }
- const columns = [
- {
- title: '核放单预录入号',
- dataIndex: 'hfdrCode',
- },
- {
- title: '核放单号',
- dataIndex: 'hfdCode',
- },
- {
- title: '核放单类型',
- dataIndex: 'hfdLx',
- },
- {
- title: '台账编号',
- dataIndex: 'ledgerCode',
- },
- {
- title: '关联核注清单编号',
- dataIndex: 'glhzqdbh',
- },
- {
- title: '申报类型',
- dataIndex: 'sblx',
- },
- {
- title: '申报时间',
- dataIndex: 'sbsj',
- sorter: true,
- },
- {
- title: '单据状态',
- dataIndex: 'status',
- },
- {
- title: '操作',
- dataIndex: 'action',
- align: 'center',
- width: 300,
- fixed: 'right',
- }
- ]
- const selectedRowKeys = ref([])
- // 列表选择配置
- const options = {
- // columns数字类型字段加入 needTotal: true 可以勾选自动算账
- alert: {
- show: true,
- clear: () => {
- selectedRowKeys.value = ref([])
- }
- },
- rowSelection: {
- onChange: (selectedRowKey, selectedRows) => {
- selectedRowKeys.value = selectedRowKey
- }
- }
- }
- const loadData = (parameter) => {
- tableRef.value.clearSelected()
- return qySecondlineHfdApi.qySecondlineHfdPage(Object.assign(parameter, searchFormStateReal.value)).then((data) => {
- return data
- })
- }
- // 搜索同时备份参数
- const onSearch = (parameter) => {
- searchFormStateReal.value = cloneDeep(Object.assign(searchFormState.value, filterParam.value))
- nextTick(() => {
- tableRef.value.refresh(parameter)
- })
- }
- // 重置
- const reset = () => {
- searchFormRef.value.resetFields()
- onSearch(true)
- }
- // 删除
- const deleteQySecondlineHfd = (record) => {
- let params = [
- {
- id: record.id
- }
- ]
- qySecondlineHfdApi.qySecondlineHfdDelete(params).then(() => {
- tableRef.value.refresh(true)
- })
- }
- // 批量删除
- const deleteBatchQySecondlineHfd = (params) => {
- qySecondlineHfdApi.qySecondlineHfdDelete(params).then(() => {
- tableRef.value.clearRefreshSelected()
- })
- }
- // 批量导出
- const onExport = () => {
- const params = {
- ...filterParam.value
- }
- if (selectedRowKeys.value.length > 0) {
- params.ids = selectedRowKeys.value
- } else {
- Object.entries(searchFormStateReal.value).forEach(([key, value]) => {
- console.log(key)
- if (proxy.$util.isValue(value)) {
- params[key] = value
- }
- })
- }
- qySecondlineHfdApi.qySecondlineHfdExport(params).then((res) => {
- downloadUtil.resultDownload(res)
- tableRef.value.clearSelected()
- })
- }
- // 切换至表单
- const onDetail = (record = null, view, type, copy) => {
- indexShow.value = false
- nextTick(() => {
- detailRef.value.onOpen(record, view, type, copy)
- })
- }
- const onChange = (record) => {
- Modal.confirm({
- title: '请确定是否变更',
- icon: createVNode(ExclamationCircleOutlined),
- content: createVNode('div', { style: 'color:red;' }, '变更后将重新进行申报'),
- centered: true,
- onOk() {
- onDetail(record, false, '2')
- },
- onCancel() {
- },
- });
- }
- const onKill = (record) => {
- Modal.confirm({
- title: '确定是否作废该核放单',
- icon: createVNode(ExclamationCircleOutlined),
- content: createVNode('div', { style: 'color:red;' }, '提交作废申请后由海关审批'),
- centered: true,
- onOk() {
- qySecondlineHfdApi.qySecondlineHfdDetail({id: record.id}).then(res => {
- const params = res
- params.baseInfo.sblx = '3'
- params.baseInfo.status = '2'
- qySecondlineHfdApi.qySecondlineHfdSubmitForm(params, record.id).then(() => {
- onSearch()
- })
- })
- },
- onCancel() {
- },
- });
- }
- const jcbzOptions = tool.dictList('jcbz')
- const statusOptions = tool.dictList('djzt')
- </script>
- <style lang="less" scoped>
- </style>
|