index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <ContentWrap>
  3. <!-- 搜索工作栏 -->
  4. <el-form
  5. class="-mb-15px"
  6. :model="queryParams"
  7. ref="queryFormRef"
  8. :inline="true"
  9. label-width="68px"
  10. >
  11. <el-form-item label="统一社会信用代码" prop="unifiedSocialCreditCode">
  12. <el-input
  13. v-model="queryParams.unifiedSocialCreditCode"
  14. placeholder="请输入统一社会信用代码"
  15. clearable
  16. @keyup.enter="handleQuery"
  17. class="!w-240px"
  18. />
  19. </el-form-item>
  20. <el-form-item label="名称" prop="businessName">
  21. <el-input
  22. v-model="queryParams.businessName"
  23. placeholder="请输入名称"
  24. clearable
  25. @keyup.enter="handleQuery"
  26. class="!w-240px"
  27. />
  28. </el-form-item>
  29. <el-form-item label="类型" prop="businessType">
  30. <el-select
  31. v-model="queryParams.businessType"
  32. placeholder="请选择类型"
  33. clearable
  34. class="!w-240px"
  35. >
  36. <el-option label="请选择字典生成" value="" />
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item label="法定代表人" prop="legalRepresentative">
  40. <el-input
  41. v-model="queryParams.legalRepresentative"
  42. placeholder="请输入法定代表人"
  43. clearable
  44. @keyup.enter="handleQuery"
  45. class="!w-240px"
  46. />
  47. </el-form-item>
  48. <el-form-item label="注册资本" prop="registeredCapital">
  49. <el-input
  50. v-model="queryParams.registeredCapital"
  51. placeholder="请输入注册资本"
  52. clearable
  53. @keyup.enter="handleQuery"
  54. class="!w-240px"
  55. />
  56. </el-form-item>
  57. <el-form-item label="成立日期" prop="establishmentDate">
  58. <el-date-picker
  59. v-model="queryParams.establishmentDate"
  60. value-format="YYYY-MM-DD HH:mm:ss"
  61. type="daterange"
  62. start-placeholder="开始日期"
  63. end-placeholder="结束日期"
  64. :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
  65. class="!w-220px"
  66. />
  67. </el-form-item>
  68. <el-form-item label="住所" prop="businessAddress">
  69. <el-input
  70. v-model="queryParams.businessAddress"
  71. placeholder="请输入住所"
  72. clearable
  73. @keyup.enter="handleQuery"
  74. class="!w-240px"
  75. />
  76. </el-form-item>
  77. <el-form-item label="经营范围" prop="businessScope">
  78. <el-input
  79. v-model="queryParams.businessScope"
  80. placeholder="请输入经营范围"
  81. clearable
  82. @keyup.enter="handleQuery"
  83. class="!w-240px"
  84. />
  85. </el-form-item>
  86. <el-form-item label="登记机关" prop="registrationAuthority">
  87. <el-input
  88. v-model="queryParams.registrationAuthority"
  89. placeholder="请输入登记机关"
  90. clearable
  91. @keyup.enter="handleQuery"
  92. class="!w-240px"
  93. />
  94. </el-form-item>
  95. <el-form-item label="发证日期" prop="issueDate">
  96. <el-date-picker
  97. v-model="queryParams.issueDate"
  98. value-format="YYYY-MM-DD HH:mm:ss"
  99. type="daterange"
  100. start-placeholder="开始日期"
  101. end-placeholder="结束日期"
  102. :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
  103. class="!w-220px"
  104. />
  105. </el-form-item>
  106. <el-form-item label="创建时间" prop="createTime">
  107. <el-date-picker
  108. v-model="queryParams.createTime"
  109. value-format="YYYY-MM-DD HH:mm:ss"
  110. type="daterange"
  111. start-placeholder="开始日期"
  112. end-placeholder="结束日期"
  113. :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
  114. class="!w-220px"
  115. />
  116. </el-form-item>
  117. <el-form-item label="相关照片" prop="infoImages">
  118. <el-input
  119. v-model="queryParams.infoImages"
  120. placeholder="请输入相关照片"
  121. clearable
  122. @keyup.enter="handleQuery"
  123. class="!w-240px"
  124. />
  125. </el-form-item>
  126. <el-form-item label="数据使用状态 0 使用 1 作废 2 异常" prop="infoStatus">
  127. <el-select
  128. v-model="queryParams.infoStatus"
  129. placeholder="请选择数据使用状态 0 使用 1 作废 2 异常"
  130. clearable
  131. class="!w-240px"
  132. >
  133. <el-option
  134. v-for="dict in getStrDictOptions(DICT_TYPE.INFO_STATUS)"
  135. :key="dict.value"
  136. :label="dict.label"
  137. :value="dict.value"
  138. />
  139. </el-select>
  140. </el-form-item>
  141. <el-form-item>
  142. <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
  143. <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
  144. <el-button
  145. type="primary"
  146. plain
  147. @click="openForm('create')"
  148. v-hasPermi="['member:user-business-license:create']"
  149. >
  150. <Icon icon="ep:plus" class="mr-5px" /> 新增
  151. </el-button>
  152. <el-button
  153. type="success"
  154. plain
  155. @click="handleExport"
  156. :loading="exportLoading"
  157. v-hasPermi="['member:user-business-license:export']"
  158. >
  159. <Icon icon="ep:download" class="mr-5px" /> 导出
  160. </el-button>
  161. </el-form-item>
  162. </el-form>
  163. </ContentWrap>
  164. <!-- 列表 -->
  165. <ContentWrap>
  166. <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
  167. <el-table-column label="自增主键" align="center" prop="id" />
  168. <el-table-column label="统一社会信用代码" align="center" prop="unifiedSocialCreditCode" />
  169. <el-table-column label="名称" align="center" prop="businessName" />
  170. <el-table-column label="类型" align="center" prop="businessType" />
  171. <el-table-column label="法定代表人" align="center" prop="legalRepresentative" />
  172. <el-table-column label="注册资本" align="center" prop="registeredCapital" />
  173. <el-table-column label="成立日期" align="center" prop="establishmentDate" />
  174. <el-table-column label="住所" align="center" prop="businessAddress" />
  175. <el-table-column label="经营范围" align="center" prop="businessScope" />
  176. <el-table-column label="登记机关" align="center" prop="registrationAuthority" />
  177. <el-table-column label="发证日期" align="center" prop="issueDate" />
  178. <el-table-column
  179. label="创建时间"
  180. align="center"
  181. prop="createTime"
  182. :formatter="dateFormatter"
  183. width="180px"
  184. />
  185. <el-table-column label="相关照片" align="center" prop="infoImages" />
  186. <el-table-column label="数据使用状态 0 使用 1 作废 2 异常" align="center" prop="infoStatus">
  187. <template #default="scope">
  188. <dict-tag :type="DICT_TYPE.INFO_STATUS" :value="scope.row.infoStatus" />
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="操作" align="center" min-width="120px">
  192. <template #default="scope">
  193. <el-button
  194. link
  195. type="primary"
  196. @click="openForm('update', scope.row.id)"
  197. v-hasPermi="['member:user-business-license:update']"
  198. >
  199. 编辑
  200. </el-button>
  201. <el-button
  202. link
  203. type="danger"
  204. @click="handleDelete(scope.row.id)"
  205. v-hasPermi="['member:user-business-license:delete']"
  206. >
  207. 删除
  208. </el-button>
  209. </template>
  210. </el-table-column>
  211. </el-table>
  212. <!-- 分页 -->
  213. <Pagination
  214. :total="total"
  215. v-model:page="queryParams.pageNo"
  216. v-model:limit="queryParams.pageSize"
  217. @pagination="getList"
  218. />
  219. </ContentWrap>
  220. <!-- 表单弹窗:添加/修改 -->
  221. <UserBusinessLicenseForm ref="formRef" @success="getList" />
  222. </template>
  223. <script setup lang="ts">
  224. import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
  225. import { dateFormatter } from '@/utils/formatTime'
  226. import download from '@/utils/download'
  227. import { UserBusinessLicenseApi, UserBusinessLicenseVO } from '@/api/member/userbusinesslicense'
  228. import UserBusinessLicenseForm from './UserBusinessLicenseForm.vue'
  229. /** 营业执照信息 列表 */
  230. defineOptions({ name: 'UserBusinessLicense' })
  231. const message = useMessage() // 消息弹窗
  232. const { t } = useI18n() // 国际化
  233. const loading = ref(true) // 列表的加载中
  234. const list = ref<UserBusinessLicenseVO[]>([]) // 列表的数据
  235. const total = ref(0) // 列表的总页数
  236. const queryParams = reactive({
  237. pageNo: 1,
  238. pageSize: 10,
  239. unifiedSocialCreditCode: undefined,
  240. businessName: undefined,
  241. businessType: undefined,
  242. legalRepresentative: undefined,
  243. registeredCapital: undefined,
  244. establishmentDate: [],
  245. businessAddress: undefined,
  246. businessScope: undefined,
  247. registrationAuthority: undefined,
  248. issueDate: [],
  249. createTime: [],
  250. infoImages: undefined,
  251. infoStatus: undefined
  252. })
  253. const queryFormRef = ref() // 搜索的表单
  254. const exportLoading = ref(false) // 导出的加载中
  255. /** 查询列表 */
  256. const getList = async () => {
  257. loading.value = true
  258. try {
  259. const data = await UserBusinessLicenseApi.getUserBusinessLicensePage(queryParams)
  260. list.value = data.list
  261. total.value = data.total
  262. } finally {
  263. loading.value = false
  264. }
  265. }
  266. /** 搜索按钮操作 */
  267. const handleQuery = () => {
  268. queryParams.pageNo = 1
  269. getList()
  270. }
  271. /** 重置按钮操作 */
  272. const resetQuery = () => {
  273. queryFormRef.value.resetFields()
  274. handleQuery()
  275. }
  276. /** 添加/修改操作 */
  277. const formRef = ref()
  278. const openForm = (type: string, id?: number) => {
  279. formRef.value.open(type, id)
  280. }
  281. /** 删除按钮操作 */
  282. const handleDelete = async (id: number) => {
  283. try {
  284. // 删除的二次确认
  285. await message.delConfirm()
  286. // 发起删除
  287. await UserBusinessLicenseApi.deleteUserBusinessLicense(id)
  288. message.success(t('common.delSuccess'))
  289. // 刷新列表
  290. await getList()
  291. } catch {}
  292. }
  293. /** 导出按钮操作 */
  294. const handleExport = async () => {
  295. try {
  296. // 导出的二次确认
  297. await message.exportConfirm()
  298. // 发起导出
  299. exportLoading.value = true
  300. const data = await UserBusinessLicenseApi.exportUserBusinessLicense(queryParams)
  301. download.excel(data, '营业执照信息.xls')
  302. } catch {
  303. } finally {
  304. exportLoading.value = false
  305. }
  306. }
  307. /** 初始化 **/
  308. onMounted(() => {
  309. getList()
  310. })
  311. </script>