index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <a-card :bordered="false">
  3. <a-form ref="searchFormRef" :model="searchFormState" class="ant-advanced-search-form">
  4. <a-row :gutter="24">
  5. <a-col :span="6">
  6. <a-form-item label="姓名">
  7. <a-input v-model:value="searchFormState.name" placeholder="请输入姓名" allow-clear/>
  8. </a-form-item>
  9. </a-col>
  10. <a-col :span="6">
  11. <a-form-item label="性别">
  12. <a-select v-model:value="searchFormState.gender" placeholder="请选择性别"
  13. :options="sexOptions" show-search allow-clear optionFilterProp="label"/>
  14. </a-form-item>
  15. </a-col>
  16. <a-col :span="6">
  17. <a-form-item label="身份证号">
  18. <a-input v-model:value="searchFormState.idNo" placeholder="请输入身份证号" allow-clear/>
  19. </a-form-item>
  20. </a-col>
  21. <a-col :span="6">
  22. <a-form-item label="国籍">
  23. <a-select v-model:value="searchFormState.nationality" placeholder="请选择国籍"
  24. :options="cityOptions" show-search allow-clear optionFilterProp="label"/>
  25. </a-form-item>
  26. </a-col>
  27. <a-col :span="6">
  28. <a-form-item label="居住地">
  29. <a-input v-model:value="searchFormState.address" placeholder="请输入居住地" allow-clear/>
  30. </a-form-item>
  31. </a-col>
  32. <a-col :span="6">
  33. <a-form-item label="车次/航班号">
  34. <a-input v-model:value="searchFormState.travelNo" placeholder="请输入车次/航班号" allow-clear/>
  35. </a-form-item>
  36. </a-col>
  37. <a-col :span="6">
  38. <a-form-item label="航/车次(班)日期">
  39. <a-range-picker v-model:value="searchFormState.travelTime" show-time allow-clear/>
  40. </a-form-item>
  41. </a-col>
  42. <a-col :span="6">
  43. <a-form-item label="入场时间">
  44. <a-range-picker v-model:value="searchFormState.admissionTime" show-time allow-clear/>
  45. </a-form-item>
  46. </a-col>
  47. <a-col :span="6">
  48. <a-form-item label="放行时间">
  49. <a-range-picker v-model:value="searchFormState.passTime" show-time allow-clear/>
  50. </a-form-item>
  51. </a-col>
  52. <a-col :span="6">
  53. <a-button type="primary" @click="onSearch()">查询</a-button>
  54. <a-button style="margin: 0 8px" @click="reset">重置</a-button>
  55. </a-col>
  56. </a-row>
  57. </a-form>
  58. <s-table
  59. ref="tableRef"
  60. :columns="columns"
  61. :data="loadData"
  62. bordered
  63. :row-key="(record) => record.id"
  64. :tool-config="toolConfig"
  65. v-model:filterParam="filterParam"
  66. :scroll="{ x: 2000 }"
  67. >
  68. <template #bodyCell="{ column, record }">
  69. <template v-if="column.dataIndex === 'gender'">
  70. {{ $TOOL.dictTypeData('lvke_sex', record.gender) }}
  71. </template>
  72. <template v-if="column.dataIndex === 'nationality'">
  73. {{ $TOOL.dictTypeData('lvke_city', record.nationality) }}
  74. </template>
  75. <template v-if="column.dataIndex === 'checkType'">
  76. {{ $TOOL.dictTypeData('lvke_checkType', record.checkType) }}
  77. </template>
  78. <template v-if="column.dataIndex === 'action'">
  79. <a-space>
  80. <a @click="ref_detail.onOpen(record)">查看</a>
  81. </a-space>
  82. </template>
  83. </template>
  84. </s-table>
  85. </a-card>
  86. <Detail ref="ref_detail"/>
  87. </template>
  88. <script setup name="demo2">
  89. import tool from '@/utils/tool'
  90. import {cloneDeep} from 'lodash-es'
  91. import Detail from './detail.vue'
  92. import basicApi from '@/api/gsc/basic'
  93. const {proxy} = getCurrentInstance()
  94. const searchFormState = ref({})
  95. const searchFormStateReal = ref({}) // 点击搜索后备份的查询参数
  96. const searchFormRef = ref()
  97. const tableRef = ref()
  98. const filterParam = ref({})
  99. const ref_detail = ref()
  100. const toolConfig = {refresh: true, height: true, columnSetting: true, striped: false}
  101. const columns = [
  102. {
  103. title: '姓名',
  104. dataIndex: 'name',
  105. },
  106. {
  107. title: '性别',
  108. dataIndex: 'gender',
  109. },
  110. {
  111. title: '身份证号',
  112. dataIndex: 'idNo',
  113. },
  114. {
  115. title: '国籍',
  116. dataIndex: 'nationality',
  117. },
  118. {
  119. title: '居住地',
  120. dataIndex: 'address',
  121. },
  122. {
  123. title: '车次/航班号',
  124. dataIndex: 'travelNo',
  125. },
  126. {
  127. title: '航/车次(班)日期',
  128. dataIndex: 'travelTime',
  129. },
  130. {
  131. title: '类型',
  132. dataIndex: 'checkType',
  133. },
  134. {
  135. title: '入场时间',
  136. dataIndex: 'admissionTime',
  137. },
  138. {
  139. title: '放行时间',
  140. dataIndex: 'passTime',
  141. },
  142. {
  143. title: '操作',
  144. dataIndex: 'action',
  145. align: 'center',
  146. width: 100,
  147. fixed: 'right',
  148. }
  149. ]
  150. const selectedRowKeys = ref([])
  151. // 列表选择配置
  152. const options = {
  153. // columns数字类型字段加入 needTotal: true 可以勾选自动算账
  154. alert: {
  155. show: true,
  156. clear: () => {
  157. selectedRowKeys.value = ref([])
  158. }
  159. },
  160. rowSelection: {
  161. onChange: (selectedRowKey, selectedRows) => {
  162. selectedRowKeys.value = selectedRowKey
  163. }
  164. }
  165. }
  166. const loadData = (parameter) => {
  167. if (searchFormStateReal.value.travelTime?.length > 0) {
  168. searchFormStateReal.value.travelTimeStart = proxy.$util.YMDHms(searchFormStateReal.value.travelTime[0])
  169. searchFormStateReal.value.travelTimeEnd = proxy.$util.YMDHms(searchFormStateReal.value.travelTime[1])
  170. delete searchFormStateReal.value.travelTime
  171. }
  172. if (searchFormStateReal.value.admissionTime?.length > 0) {
  173. searchFormStateReal.value.admissionTimeStart = proxy.$util.YMDHms(searchFormStateReal.value.admissionTime[0])
  174. searchFormStateReal.value.admissionTimeEnd = proxy.$util.YMDHms(searchFormStateReal.value.admissionTime[1])
  175. delete searchFormStateReal.value.admissionTime
  176. }
  177. if (searchFormStateReal.value.passTime?.length > 0) {
  178. searchFormStateReal.value.passTimeStart = proxy.$util.YMDHms(searchFormStateReal.value.passTime[0])
  179. searchFormStateReal.value.passTimeEnd = proxy.$util.YMDHms(searchFormStateReal.value.passTime[1])
  180. delete searchFormStateReal.value.passTime
  181. }
  182. return basicApi.passengerInfoPage(Object.assign(parameter, searchFormStateReal.value, {queryType: 3})).then((data) => {
  183. return data
  184. })
  185. }
  186. // 搜索同时备份参数
  187. const onSearch = (parameter) => {
  188. searchFormStateReal.value = cloneDeep(searchFormState.value)
  189. tableRef.value.refresh(parameter)
  190. }
  191. // 重置
  192. const reset = () => {
  193. searchFormRef.value.resetFields()
  194. onSearch(true)
  195. }
  196. const sexOptions = tool.dictList('lvke_sex')
  197. const cityOptions = tool.dictList('lvke_city')
  198. const isNoOptions = tool.dictList('lvke_isNo')
  199. const departurePortOptions = tool.dictList('lvke_departurePort')
  200. const arrivingPortOptions = tool.dictList('lvke_arrivingPort')
  201. </script>