Browse Source

优化耗材数量及试管页面

master
LiLongLong 4 months ago
parent
commit
0e3814aefc
  1. 2
      components.d.ts
  2. 2
      src/pages/Index/History.vue
  3. 33
      src/pages/Index/Regular/TestTube.vue
  4. 10
      src/pages/Index/Regular/type.ts
  5. 4
      src/pages/Index/components/History/HistoryTable.vue
  6. 2
      src/pages/Login/Login.vue
  7. 2
      src/utils/getServerInfo.ts

2
components.d.ts

@ -9,10 +9,12 @@ declare module 'vue' {
export interface GlobalComponents {
Confirm: typeof import('./src/components/Confirm.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElCol: typeof import('element-plus/es')['ElCol']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElFooter: typeof import('element-plus/es')['ElFooter']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElRow: typeof import('element-plus/es')['ElRow']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ErrorModal: typeof import('./src/components/dialogs/ErrorModal.vue')['default']

2
src/pages/Index/History.vue

@ -405,6 +405,8 @@ const handleConfirmDelete = async () => {
}
eMessage.success('删除成功')
//
getTableData()
} catch (error) {
eMessage.error('删除失败')
} finally {

33
src/pages/Index/Regular/TestTube.vue

@ -93,10 +93,12 @@ import {
useConsumablesStore,
useTestTubeStore,
useSettingTestTubeStore,
} from '../../../store'
import { ElDialog } from 'element-plus'
import { BloodType, ReactionPlateGroup, TestTubeRack } from '@/websocket/socket'
import { eMessage } from '../utils'
import { reactionPlateGroupItem } from './type'
const router = useRouter()
@ -265,6 +267,37 @@ const updateTubeSettings = async (rackIdx: number, tubeIdx: number) => {
eMessage.error('试管架已激活,不能修改')
return
}
//
if(consumablesStore.consumableData && consumablesStore.consumableData.reactionPlateGroup){
let reactionPlateGroup = consumablesStore.consumableData.reactionPlateGroup
let list:reactionPlateGroupItem[] = []
reactionPlateGroup.forEach((item:any) => {
if(item.projId && selectedProjIds.value.includes(item.projId) && item.num <=0){
list.push(item.projName)
}
})
if(list.length){
eMessage.error(`项目${list.join(',')}耗材不足,请添加耗材`)
return;
}
}
//
if(consumablesStore.projectsAvailable){
let list = consumablesStore.projectsAvailable.map((item:any) => {
console.log('projIdCntMap===', projIdCntMap)
let cn = projIdCntMap[item.projId || 1];
console.log('cn===', cn , item.num)
if(cn > item.num){
return item;
}
})
if(list && list.length){
eMessage.error(`耗材已用尽,请添加耗材`)
return;
}
}
if (tubeIdx < rack.tubeSettings.length) {
const setting = rack.tubeSettings[tubeIdx]
const updSetting = {

10
src/pages/Index/Regular/type.ts

@ -0,0 +1,10 @@
export type reactionPlateGroupItem = {
projId?: number
projName: string
projShortName: string
lotId: string
color?: string
num?: number
isInstall: boolean
reserveNum: number
}

4
src/pages/Index/components/History/HistoryTable.vue

@ -25,7 +25,7 @@
<td colspan="8" class="no-data-row">暂无数据</td>
</tr>
<tr
v-for="item in tableData"
v-for="(item, index) in tableData"
:key="item.id"
:class="{
'row-selected': selectedRows.includes(item),
@ -41,7 +41,7 @@
class="custom-checkbox"
/>
</td>
<td>{{ item.id }}</td>
<td>{{ index+1 }}</td>
<td @click="selectRow(item)">{{ formatDate(item.creatDate) }}</td>
<td
class="ellipsis"

2
src/pages/Login/Login.vue

@ -130,7 +130,7 @@ const submitPin = async () => {
loginStatus.value = '请选择用户'
return
} else if (pin.value.length !== maxPinLength) {
loginStatus.value = '请输入合法的pin码'
loginStatus.value = '请输入码'
return
}
const params = {

2
src/utils/getServerInfo.ts

@ -8,7 +8,7 @@ export function getServerInfo(wsPath: string = '/api/v1/app/ws/state') {
const host = window.location.hostname;
// const host = "192.168.1.119";
// const port = '8082' // 使用固定的后端端口;由于本地开发时,8080被占用导致ws连接失败,所以使用8082
const port = "8888"
const port = "80"
// 构建 WebSocket URL
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
const wsUrl = `${wsProtocol}//${host}:${port}${wsPath}`

Loading…
Cancel
Save