Browse Source

fix: 历史记录bug

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

3
package.json

@ -20,6 +20,7 @@
"el-table-infinite-scroll": "^3.0.6",
"element-plus": "^2.8.5",
"less": "^4.2.0",
"loadsh": "^0.0.4",
"mitt": "^3.0.1",
"mockjs": "^1.1.0",
"nanoid": "^5.0.7",
@ -60,4 +61,4 @@
"vite": "^5.4.11",
"vue-tsc": "^2.1.6"
}
}
}

15
src/pages/Index/History.vue

@ -154,7 +154,7 @@
<script setup lang="ts">
import { ref, watchEffect } from 'vue'
import { uniqBy } from 'lodash';
import { HistoryWarn } from './components/index'
import {
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
total.value = 0
totalPage.value = 0
tableData.value = []
disabled.value = false
load()
// console.log(111)
await load()
systemStore.clearReactionRecordList()
}
@ -323,7 +324,7 @@ const total = ref(0)
const totalPage = ref(0)
const disabled = ref(false)
const load = () => {
const load = async () => {
if (disabled.value) return;
loading.value = true
@ -334,7 +335,7 @@ const load = () => {
currentPage.value++;
total.value = res.data.total
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) {
disabled.value = true
}

23
src/pages/Index/Index.vue

@ -1142,22 +1142,23 @@ async function startInit() {
await pollingInitState()
// ID
const res = await getIdCardInfo()
console.log(res)
if (!res) {
return
}
consumableStore.setIdCardInserted(true)
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 () => {

Loading…
Cancel
Save