You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.vue 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div>
  3. <crud-template ref="crudRef" class="as-weight" :submit-state="false" :home-data="field" :tableData="tableData"
  4. @btnSearch="btnSearch" @CurrentChange="handleCurrentChange" @importData="importData" @download="downloadHandle"
  5. @refreshLeft="refreshLeft" @add="Adds" @cancel="cancel" @submit="submitAdd" @handleEdit="itemEdit">
  6. <template #search>
  7. <el-input maxlength="60" v-trim clearable v-model="searchForm.batchNo" style="width: 200px" placeholder="请输入批次号" />
  8. <el-input maxlength="60" v-trim clearable v-model="searchForm.serialNo" style="width: 200px" placeholder="请输入合同序列号" />
  9. <!-- <el-input maxlength="60" v-trim clearable v-model="searchForm.startSerialNo" style="width: 200px" placeholder="请输入起始OBU合同序列号" />-->
  10. <!-- <el-input maxlength="60" v-trim clearable v-model="searchForm.endSerialNo" style="width: 200px" placeholder="请输入结束OBU合同序列号" />-->
  11. <el-select maxlength="60" v-trim clearable v-model="searchForm.encryptType" style="width: 200px" placeholder="请选OBU择类型" >
  12. <el-option v-for="item in ENCRYPT_TYPE" :key="item.value" :label="item.label" :value="item.value"/>
  13. </el-select>
  14. <el-select maxlength="60" v-trim clearable v-model="searchForm.status" style="width: 200px" placeholder="请选择发行状态" >
  15. <el-option v-for="item in ISSUE_STATUS" :key="item.value" :label="item.label" :value="item.value"/>
  16. </el-select>
  17. <!-- <el-input maxlength="60" v-trim clearable v-model="searchForm.formatTime" style="width: 200px" placeholder="请输入格式化日期" />-->
  18. <!-- <el-input maxlength="60" v-trim clearable v-model="searchForm.lastUpdateTime" style="width: 200px" placeholder="请输入最后修改日期" />-->
  19. </template>
  20. </crud-template>
  21. </div>
  22. </template>
  23. <script setup lang="ts">
  24. import { ref, onMounted } from 'vue'
  25. // @ts-ignore crudFrom模板
  26. import CrudTemplate from '@/crud/index.vue'
  27. import BaseService from '@/utils/baseService' //引入接口请求
  28. import {
  29. ElMessage,
  30. } from 'element-plus' //提示
  31. import { getZxqdFindConfig,ISSUE_STATUS,ENCRYPT_TYPE } from "./data.js";
  32. import { useRoute } from 'vue-router'
  33. import { exportFn } from '@/views/settlement/exportFn'
  34. //或取路由传入过来的对象数据
  35. const route = useRoute()
  36. const widthBase = '120px';
  37. const crudRef = ref()
  38. let tableData: any = ref([])
  39. const itemStartValue = ref("1")
  40. //查询参数
  41. const searchForm = ref({ agencyId: '' })
  42. const agencyIdList = ref([])
  43. const field = ref(getZxqdFindConfig(route, agencyIdList));
  44. onMounted(() => {
  45. getList()
  46. })
  47. // 导出
  48. function downloadHandle() {
  49. exportFn('/invw/api/queryGmobus/export', searchForm.value, 'OBU一发')
  50. }
  51. //获取列表
  52. function getList() {
  53. crudRef.value.tableLoding = true
  54. let params: any = {
  55. pageNo: field.value.paging.currentPage,
  56. pageSize: field.value.paging.pageSize,
  57. }
  58. //赋值查询参数
  59. let searchFormList = { ...searchForm.value }
  60. for (let key in searchFormList) {
  61. if (searchFormList[key]) {
  62. params[key] = searchFormList[key]
  63. }
  64. }
  65. if(searchFormList.status === 0){
  66. params.status = 0
  67. }
  68. BaseService.postN('/invw/api/queryGmobus/page', params).then((res: any) => {
  69. if (res && res.code === 0) {
  70. //数据转换
  71. let bizContent = res.data
  72. let data = bizContent.result || []
  73. //数据渲染
  74. tableData.value = data
  75. crudRef.value.tableLoding = false
  76. //分页总数
  77. field.value.paging.total = bizContent.totalCount
  78. } else {
  79. crudRef.value.tableLoding = false
  80. ElMessage.error(res.message)
  81. }
  82. })
  83. }
  84. const Adds = () => {
  85. itemStartValue.value = 1
  86. }
  87. //表单编辑按钮
  88. function itemEdit(idx: any, row: any) {
  89. itemStartValue.value = 2
  90. }
  91. // 添加
  92. const submitAdd = (data: any) => {
  93. request(data, itemStartValue.value)
  94. }
  95. const request = (data: any, type: any) => {
  96. data.optType = type //操作类型 1新增 2修改
  97. BaseService.postN(itemStartValue.value == 1 ? '/userw/wxCar/add' : '/userw/wxCar/update', data).then((res: any) => {
  98. if (res && res.code === 0) {
  99. getList()
  100. crudRef.value.reset();
  101. crudRef.value.dialogFormVisible = false;
  102. } else {
  103. ElMessage.error(res.message)
  104. }
  105. })
  106. }
  107. // 删除
  108. const deleteHandle = (index) => {
  109. addForm.value.locationModels.splice(index, 1)
  110. }
  111. // 搜索按钮
  112. function btnSearch() {
  113. field.value.paging.currentPage = 1
  114. getList()
  115. }
  116. //标签分页
  117. function handleClick(tab, event) {
  118. orderStep.value = tab.props.name
  119. getList()
  120. }
  121. //分页
  122. function handleCurrentChange(val: number) {
  123. field.value.paging.currentPage = val
  124. getList()
  125. }
  126. function handleAvatarSuccess(response: any, row) {
  127. }
  128. // 搜索重置
  129. function refreshLeft() {
  130. searchForm.value = {}
  131. getList()
  132. }
  133. // 获取所有渠道
  134. function getAgencyList() {
  135. }
  136. //编辑
  137. function handleEdit() {
  138. }
  139. // 删除
  140. function handleDetele() {
  141. }
  142. // 取消
  143. function cancel() {
  144. }
  145. </script>
  146. <style lang="scss" scoped></style>