123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <template>
- <a-card :bordered="false" v-if="indexShow">
- <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="ylTzCode">
- <a-input v-model:value="searchFormState.ylTzCode" placeholder="请输入预录入台账编号" allow-clear/>
- </a-form-item>
- </a-col>
- <a-col :span="6">
- <a-form-item label="台账性质" name="tzType">
- <a-select v-model:value="searchFormState.tzType" placeholder="请选择台账性质" :options="tzTypeOptions" show-search allow-clear option-filter-prop="label"/>
- </a-form-item>
- </a-col>
- <a-col :span="6">
- <a-form-item label="海关注册编码" name="companyMainHgCode">
- <a-input v-model:value="searchFormState.companyMainHgCode" placeholder="请输入海关注册编码" allow-clear/>
- </a-form-item>
- </a-col>
- <a-col :span="6">
- <a-form-item label="企业类型" name="companyType">
- <a-select v-model:value="searchFormState.companyType" placeholder="请选择企业类型" :options="companyTypeOptions" show-search allow-clear option-filter-prop="label"/>
- </a-form-item>
- </a-col>
- <a-col :span="6" :offset="18">
- <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()" v-if="hasPerm('qyRecordInfoAdd')">
- <template #icon><plus-outlined /></template>
- 新增
- </a-button>
- <!-- <xn-batch-delete-->
- <!-- v-if="hasPerm('qyRecordInfoDelete')"-->
- <!-- :selectedRowKeys="selectedRowKeys"-->
- <!-- @batchDelete="deleteBatchQyRecordInfo"-->
- <!-- />-->
- <a-button @click="onExport" v-if="hasPerm('qyRecordInfoBatchExport')">
- <template #icon><export-outlined /></template>
- 批量导出
- </a-button>
- </a-space>
- </template>
- <template #bodyCell="{ column, record }">
- <template v-if="column.dataIndex === 'tzType'">
- {{ $TOOL.dictTypeData('tzlx', record.tzType) }}
- </template>
- <template v-if="column.dataIndex === 'applyType'">
- {{ $TOOL.dictTypeData('qybalx', record.applyType) }}
- </template>
- <template v-if="column.dataIndex === 'companyType'">
- {{ $TOOL.dictTypeData('qylx', record.companyType) }}
- </template>
- <template v-if="column.dataIndex === 'status'">
- {{ $TOOL.dictTypeData('djzt', record.status) }}
- </template>
- <template v-if="column.dataIndex === 'action'">
- <a-space>
- <a @click="onDetail(record, true)" v-if="hasPerm('qyRecordInfoView')">查看</a>
- <a @click="onBack(record)" v-if="record.status == 2">撤回</a>
- <a @click="onDetail(record)" v-if="hasPerm('qyRecordInfoEdit') && record.status == 1">编辑</a>
- <a @click="resultDetailRef.onOpen(record)" v-if="record.status == 3 || record.status == 4">查看回执</a>
- <a @click="onDetail(record, false, 'bgsq')" v-if="record.status == 3">变更</a>
- <a-popconfirm title="确定要删除吗?" @confirm="deleteQyRecordInfo(record)">
- <a-button type="link" danger size="small" v-if="hasPerm('qyRecordInfoDelete') && (record.status == 1 || record.status == 4)">删除</a-button>
- </a-popconfirm>
- </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="qyrecordinfo">
- import tool from '@/utils/tool'
- import { cloneDeep } from 'lodash-es'
- import Detail from './detail.vue'
- import qyRecordInfoApi from '@/api/yqyc/qyRecordInfoApi'
- import downloadUtil from "@/utils/downloadUtil";
- import ResultDetail from "./result.vue";
- import {Modal} from "ant-design-vue";
- import {createVNode} from "vue";
- import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
- const { proxy } = getCurrentInstance()
- const searchFormState = ref({})
- 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: 'ylTzCode',
- },
- {
- title: '台账编号',
- dataIndex: 'tzCode',
- },
- {
- title: '台账性质',
- dataIndex: 'tzType',
- },
- {
- title: '海关注册编码',
- dataIndex: 'companyMainHgCode',
- },
- {
- title: '统一社会信用代码',
- dataIndex: 'companyCode',
- },
- {
- title: '企业名称',
- dataIndex: 'companyName',
- },
- {
- title: '申报类型',
- dataIndex: 'applyType',
- },
- {
- title: '企业类型',
- dataIndex: 'companyType',
- },
- {
- title: '企业地址',
- dataIndex: 'companyAddress',
- },
- {
- title: '联系人',
- dataIndex: 'companyLinkMan',
- },
- {
- title: '联系电话',
- dataIndex: 'companyLegalPhone',
- },
- {
- title: '经营范围',
- dataIndex: 'companyJyFw',
- ellipsis: true,
- },
- {
- title: '审核状态',
- dataIndex: 'status',
- },
- {
- title: '申报时间',
- dataIndex: 'createTime',
- },
- ]
- // 操作栏通过权限判断是否显示
- if (hasPerm(['qyRecordInfoEdit', 'qyRecordInfoDelete'])) {
- columns.push({
- title: '操作',
- dataIndex: 'action',
- align: 'center',
- width: 200,
- 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 qyRecordInfoApi.qyRecordInfoPage(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 deleteQyRecordInfo = (record) => {
- let params = [
- {
- id: record.id
- }
- ]
- qyRecordInfoApi.qyRecordInfoDelete(params).then(() => {
- tableRef.value.refresh(true)
- })
- }
- // 批量删除
- const deleteBatchQyRecordInfo = (params) => {
- qyRecordInfoApi.qyRecordInfoDelete(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
- }
- })
- }
- qyRecordInfoApi.qyRecordInfoExport(params).then((res) => {
- downloadUtil.resultDownload(res)
- tableRef.value.clearSelected()
- })
- }
- // 切换至表单
- const onDetail = (record = null, view, type) => {
- indexShow.value = false
- nextTick(() => {
- detailRef.value.onOpen(record, view, type)
- })
- }
- const onBack = (record) => {
- Modal.confirm({
- title: '提示',
- icon: createVNode(ExclamationCircleOutlined),
- content: '确定要对该企业台账进行撤回操作?',
- centered: true,
- onOk() {
- qyRecordInfoApi.qyRecordInfoDetail({id: record.id}).then(res => {
- const formDataParam = res
- formDataParam.status = '1'
- formDataParam.qyRecardBodyEditParams = res.qyRecardBodyAddParams
- formDataParam.qyRecordAttachmentEditParams = res.qyRecordAttachmentAddParams
- delete formDataParam.qyRecardBodyAddParams
- delete formDataParam.qyRecordAttachmentAddParams
- qyRecordInfoApi.qyRecordInfoSubmitForm(formDataParam, formDataParam.id).then(() => {
- onSearch()
- })
- })
- },
- onCancel() {
- },
- });
- }
- const tzTypeOptions = tool.dictList('tzlx')
- const companyTypeOptions = tool.dictList('qylx')
- </script>
- <style lang="less" scoped>
- </style>
|