index.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <a-card :bordered="false" v-if="indexShow">
  3. <a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
  4. <a-row :gutter="24">
  5. <a-col :span="6">
  6. <a-form-item label="预录入台账编号" name="ylTzCode">
  7. <a-input v-model:value="searchFormState.ylTzCode" placeholder="请输入预录入台账编号" allow-clear/>
  8. </a-form-item>
  9. </a-col>
  10. <a-col :span="6">
  11. <a-form-item label="台账性质" name="tzType">
  12. <a-select v-model:value="searchFormState.tzType" placeholder="请选择台账性质" :options="tzTypeOptions" show-search allow-clear option-filter-prop="label"/>
  13. </a-form-item>
  14. </a-col>
  15. <a-col :span="6">
  16. <a-form-item label="海关注册编码" name="companyMainHgCode">
  17. <a-input v-model:value="searchFormState.companyMainHgCode" placeholder="请输入海关注册编码" allow-clear/>
  18. </a-form-item>
  19. </a-col>
  20. <a-col :span="6">
  21. <a-form-item label="企业类型" name="companyType">
  22. <a-select v-model:value="searchFormState.companyType" placeholder="请选择企业类型" :options="companyTypeOptions" show-search allow-clear option-filter-prop="label"/>
  23. </a-form-item>
  24. </a-col>
  25. <a-col :span="6" :offset="18">
  26. <div style="width: 100%;display: flex;justify-content: flex-end">
  27. <a-button type="primary" @click="onSearch()">查询</a-button>
  28. <a-button style="margin: 0 0 0 8px" @click="reset">重置</a-button>
  29. </div>
  30. </a-col>
  31. </a-row>
  32. </a-form>
  33. <s-table
  34. ref="tableRef"
  35. :columns="columns"
  36. :data="loadData"
  37. :alert="options.alert.show"
  38. bordered
  39. :row-key="(record) => record.id"
  40. :tool-config="toolConfig"
  41. :row-selection="options.rowSelection"
  42. v-model:filterParam="filterParam"
  43. :scroll="{ x: 2000 }"
  44. >
  45. <template #operator class="table-operator">
  46. <a-space>
  47. <a-button type="primary" @click="onDetail()" v-if="hasPerm('qyRecordInfoAdd')">
  48. <template #icon><plus-outlined /></template>
  49. 新增
  50. </a-button>
  51. <!-- <xn-batch-delete-->
  52. <!-- v-if="hasPerm('qyRecordInfoDelete')"-->
  53. <!-- :selectedRowKeys="selectedRowKeys"-->
  54. <!-- @batchDelete="deleteBatchQyRecordInfo"-->
  55. <!-- />-->
  56. <a-button @click="onExport" v-if="hasPerm('qyRecordInfoBatchExport')">
  57. <template #icon><export-outlined /></template>
  58. 批量导出
  59. </a-button>
  60. </a-space>
  61. </template>
  62. <template #bodyCell="{ column, record }">
  63. <template v-if="column.dataIndex === 'tzType'">
  64. {{ $TOOL.dictTypeData('tzlx', record.tzType) }}
  65. </template>
  66. <template v-if="column.dataIndex === 'applyType'">
  67. {{ $TOOL.dictTypeData('qybalx', record.applyType) }}
  68. </template>
  69. <template v-if="column.dataIndex === 'companyType'">
  70. {{ $TOOL.dictTypeData('qylx', record.companyType) }}
  71. </template>
  72. <template v-if="column.dataIndex === 'status'">
  73. {{ $TOOL.dictTypeData('djzt', record.status) }}
  74. </template>
  75. <template v-if="column.dataIndex === 'action'">
  76. <a-space>
  77. <a @click="onDetail(record, true)" v-if="hasPerm('qyRecordInfoView')">查看</a>
  78. <a @click="onBack(record)" v-if="record.status == 2">撤回</a>
  79. <a @click="onDetail(record)" v-if="hasPerm('qyRecordInfoEdit') && record.status == 1">编辑</a>
  80. <a @click="resultDetailRef.onOpen(record)" v-if="record.status == 3 || record.status == 4">查看回执</a>
  81. <a @click="onDetail(record, false, 'bgsq')" v-if="record.status == 3">变更</a>
  82. <a-popconfirm title="确定要删除吗?" @confirm="deleteQyRecordInfo(record)">
  83. <a-button type="link" danger size="small" v-if="hasPerm('qyRecordInfoDelete') && (record.status == 1 || record.status == 4)">删除</a-button>
  84. </a-popconfirm>
  85. </a-space>
  86. </template>
  87. </template>
  88. </s-table>
  89. </a-card>
  90. <Detail v-else ref="detailRef" @onClose="indexShow = true" @successful="onSearch()" />
  91. <ResultDetail ref="resultDetailRef"/>
  92. </template>
  93. <script setup name="qyrecordinfo">
  94. import tool from '@/utils/tool'
  95. import { cloneDeep } from 'lodash-es'
  96. import Detail from './detail.vue'
  97. import qyRecordInfoApi from '@/api/yqyc/qyRecordInfoApi'
  98. import downloadUtil from "@/utils/downloadUtil";
  99. import ResultDetail from "./result.vue";
  100. import {Modal} from "ant-design-vue";
  101. import {createVNode} from "vue";
  102. import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
  103. const { proxy } = getCurrentInstance()
  104. const searchFormState = ref({})
  105. const searchFormStateReal = ref(searchFormState.value) // 点击搜索后备份的查询参数
  106. const searchFormRef = ref()
  107. const resultDetailRef = ref()
  108. const tableRef = ref()
  109. const filterParam = ref({})
  110. const detailRef = ref()
  111. const indexShow = ref(true)
  112. const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
  113. // 查询区域显示更多控制
  114. const advanced = ref(false)
  115. const toggleAdvanced = () => {
  116. advanced.value = !advanced.value
  117. }
  118. const columns = [
  119. {
  120. title: '预录入台账编号',
  121. dataIndex: 'ylTzCode',
  122. },
  123. {
  124. title: '台账编号',
  125. dataIndex: 'tzCode',
  126. },
  127. {
  128. title: '台账性质',
  129. dataIndex: 'tzType',
  130. },
  131. {
  132. title: '海关注册编码',
  133. dataIndex: 'companyMainHgCode',
  134. },
  135. {
  136. title: '统一社会信用代码',
  137. dataIndex: 'companyCode',
  138. },
  139. {
  140. title: '企业名称',
  141. dataIndex: 'companyName',
  142. },
  143. {
  144. title: '申报类型',
  145. dataIndex: 'applyType',
  146. },
  147. {
  148. title: '企业类型',
  149. dataIndex: 'companyType',
  150. },
  151. {
  152. title: '企业地址',
  153. dataIndex: 'companyAddress',
  154. },
  155. {
  156. title: '联系人',
  157. dataIndex: 'companyLinkMan',
  158. },
  159. {
  160. title: '联系电话',
  161. dataIndex: 'companyLegalPhone',
  162. },
  163. {
  164. title: '经营范围',
  165. dataIndex: 'companyJyFw',
  166. ellipsis: true,
  167. },
  168. {
  169. title: '审核状态',
  170. dataIndex: 'status',
  171. },
  172. {
  173. title: '申报时间',
  174. dataIndex: 'createTime',
  175. },
  176. ]
  177. // 操作栏通过权限判断是否显示
  178. if (hasPerm(['qyRecordInfoEdit', 'qyRecordInfoDelete'])) {
  179. columns.push({
  180. title: '操作',
  181. dataIndex: 'action',
  182. align: 'center',
  183. width: 200,
  184. fixed: 'right',
  185. })
  186. }
  187. const selectedRowKeys = ref([])
  188. // 列表选择配置
  189. const options = {
  190. // columns数字类型字段加入 needTotal: true 可以勾选自动算账
  191. alert: {
  192. show: true,
  193. clear: () => {
  194. selectedRowKeys.value = ref([])
  195. }
  196. },
  197. rowSelection: {
  198. onChange: (selectedRowKey, selectedRows) => {
  199. selectedRowKeys.value = selectedRowKey
  200. }
  201. }
  202. }
  203. const loadData = (parameter) => {
  204. tableRef.value.clearSelected()
  205. return qyRecordInfoApi.qyRecordInfoPage(Object.assign(parameter, searchFormStateReal.value)).then((data) => {
  206. return data
  207. })
  208. }
  209. // 搜索同时备份参数
  210. const onSearch = (parameter) => {
  211. searchFormStateReal.value = cloneDeep(Object.assign(searchFormState.value, filterParam.value))
  212. nextTick(() => {
  213. tableRef.value.refresh(parameter)
  214. })
  215. }
  216. // 重置
  217. const reset = () => {
  218. searchFormRef.value?.resetFields()
  219. onSearch(true)
  220. }
  221. // 删除
  222. const deleteQyRecordInfo = (record) => {
  223. let params = [
  224. {
  225. id: record.id
  226. }
  227. ]
  228. qyRecordInfoApi.qyRecordInfoDelete(params).then(() => {
  229. tableRef.value.refresh(true)
  230. })
  231. }
  232. // 批量删除
  233. const deleteBatchQyRecordInfo = (params) => {
  234. qyRecordInfoApi.qyRecordInfoDelete(params).then(() => {
  235. tableRef.value.clearRefreshSelected()
  236. })
  237. }
  238. // 批量导出
  239. const onExport = () => {
  240. const params = {
  241. ...filterParam.value
  242. }
  243. if (selectedRowKeys.value.length > 0) {
  244. params.ids = selectedRowKeys.value
  245. } else {
  246. Object.entries(searchFormStateReal.value).forEach(([key, value]) => {
  247. console.log(key)
  248. if (proxy.$util.isValue(value)) {
  249. params[key] = value
  250. }
  251. })
  252. }
  253. qyRecordInfoApi.qyRecordInfoExport(params).then((res) => {
  254. downloadUtil.resultDownload(res)
  255. tableRef.value.clearSelected()
  256. })
  257. }
  258. // 切换至表单
  259. const onDetail = (record = null, view, type) => {
  260. indexShow.value = false
  261. nextTick(() => {
  262. detailRef.value.onOpen(record, view, type)
  263. })
  264. }
  265. const onBack = (record) => {
  266. Modal.confirm({
  267. title: '提示',
  268. icon: createVNode(ExclamationCircleOutlined),
  269. content: '确定要对该企业台账进行撤回操作?',
  270. centered: true,
  271. onOk() {
  272. qyRecordInfoApi.qyRecordInfoDetail({id: record.id}).then(res => {
  273. const formDataParam = res
  274. formDataParam.status = '1'
  275. formDataParam.qyRecardBodyEditParams = res.qyRecardBodyAddParams
  276. formDataParam.qyRecordAttachmentEditParams = res.qyRecordAttachmentAddParams
  277. delete formDataParam.qyRecardBodyAddParams
  278. delete formDataParam.qyRecordAttachmentAddParams
  279. qyRecordInfoApi.qyRecordInfoSubmitForm(formDataParam, formDataParam.id).then(() => {
  280. onSearch()
  281. })
  282. })
  283. },
  284. onCancel() {
  285. },
  286. });
  287. }
  288. const tzTypeOptions = tool.dictList('tzlx')
  289. const companyTypeOptions = tool.dictList('qylx')
  290. </script>
  291. <style lang="less" scoped>
  292. </style>