Browse Source

fix: 历史记录bug

master
guoapeng 3 days ago
parent
commit
1534072b22
  1. 1
      package.json
  2. 15
      src/pages/Index/History.vue
  3. 23
      src/pages/Index/Index.vue

1
package.json

@ -20,6 +20,7 @@
"el-table-infinite-scroll": "^3.0.6", "el-table-infinite-scroll": "^3.0.6",
"element-plus": "^2.8.5", "element-plus": "^2.8.5",
"less": "^4.2.0", "less": "^4.2.0",
"loadsh": "^0.0.4",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"nanoid": "^5.0.7", "nanoid": "^5.0.7",

15
src/pages/Index/History.vue

@ -154,7 +154,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watchEffect } from 'vue' import { ref, watchEffect } from 'vue'
import { uniqBy } from 'lodash';
import { HistoryWarn } from './components/index' import { HistoryWarn } from './components/index'
import { import {
getHistoryInfo, getHistoryInfo,
@ -302,14 +302,15 @@ const showActionConfirm = (actionType: string) => {
} }
} }
const onRefresh = () => {
currentPage.value = 1
const onRefresh = async () => {
tableData.value = []
currentPage.value = 0
pageSize.value = 25 pageSize.value = 25
total.value = 0 total.value = 0
totalPage.value = 0 totalPage.value = 0
tableData.value = []
disabled.value = false disabled.value = false
load()
// console.log(111)
await load()
systemStore.clearReactionRecordList() systemStore.clearReactionRecordList()
} }
@ -323,7 +324,7 @@ const total = ref(0)
const totalPage = ref(0) const totalPage = ref(0)
const disabled = ref(false) const disabled = ref(false)
const load = () => {
const load = async () => {
if (disabled.value) return; if (disabled.value) return;
loading.value = true loading.value = true
@ -334,7 +335,7 @@ const load = () => {
currentPage.value++; currentPage.value++;
total.value = res.data.total total.value = res.data.total
totalPage.value = res.data.totalPage totalPage.value = res.data.totalPage
tableData.value = tableData.value.concat(res.data.list)
tableData.value = uniqBy(tableData.value.concat(res.data.list), 'id')
if (currentPage.value > totalPage.value) { if (currentPage.value > totalPage.value) {
disabled.value = true disabled.value = true
} }

23
src/pages/Index/Index.vue

@ -1142,22 +1142,23 @@ async function startInit() {
await pollingInitState() await pollingInitState()
// ID // ID
const res = await getIdCardInfo() const res = await getIdCardInfo()
console.log(res)
if (!res) { if (!res) {
return return
} }
consumableStore.setIdCardInserted(true) consumableStore.setIdCardInserted(true)
consumableStore.setIdCardInfo(res) consumableStore.setIdCardInfo(res)
//id
idCardInserted.value = true
//v-html
idCardMessage.value = `
<div style='line-height:0.5;margin-top: -90px;'>
<div style='margin-left:25%'>
<div style='display:flex'><div>项目名称</div><div>${res.projName}</div></div>
<div style='display:flex'><div>批次号</div><div>${res.lotId}</div></div>
<div style='display:flex'><div>过期时间</div><div>${formatDate(res.expiryDate)}</div></div>
</div>
</div>`
// //id
// idCardInserted.value = true
// //v-html
// idCardMessage.value = `
// <div style='line-height:0.5;margin-top: -90px;'>
// <div style='margin-left:25%'>
// <div style='display:flex'><div></div><div>${res.projName}</div></div>
// <div style='display:flex'><div></div><div>${res.lotId}</div></div>
// <div style='display:flex'><div></div><div>${formatDate(res.expiryDate)}</div></div>
// </div>
// </div>`
} }
const pollingInitState = async () => { const pollingInitState = async () => {

Loading…
Cancel
Save