|
@@ -54,7 +54,8 @@ const options = reactive([
|
|
|
{name: '已出库', id: 1},
|
|
|
{name: '未出库', id: 2},
|
|
|
{name: '维修中', id: 3},
|
|
|
- {name: '已报废', id: 4}
|
|
|
+ {name: '已报废', id: 4},
|
|
|
+ {name: '已损坏', id: 5}
|
|
|
])
|
|
|
const searchHandle = () => {
|
|
|
TableRef.value?.searchTable()
|
|
@@ -272,10 +273,21 @@ const submitLendForm = () => {
|
|
|
ElMessage.warning('当前SN未入库不能借出')
|
|
|
return
|
|
|
}
|
|
|
+ if (result.Data.T_state == 5) {
|
|
|
+ ElMessage.warning('设备已损坏')
|
|
|
+ if ('speechSynthesis' in window) {
|
|
|
+ const utterance = new SpeechSynthesisUtterance('设备已损坏')
|
|
|
+ window.speechSynthesis.speak(utterance)
|
|
|
+ } else {
|
|
|
+ console.warn('Web Speech API 不被支持')
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
if (result.Data.T_state != 2) {
|
|
|
ElMessage.warning('当前SN未入库不能借出')
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
pendingLendItems.value.unshift({
|
|
|
T_sn: extractedSN,
|
|
|
Validationnumber: lendForm.Validationnumber,
|
|
@@ -283,6 +295,9 @@ const submitLendForm = () => {
|
|
|
LendUser: lendForm.LendUser,
|
|
|
T_project: lendForm.T_project
|
|
|
})
|
|
|
+ pendingLendItems.value = pendingLendItems.value.filter((value:any, index:any, self:any) => { //去重
|
|
|
+ return self.findIndex((t:any) => (t.T_sn === value.T_sn)) === index;
|
|
|
+ });
|
|
|
lendForm.T_sn = ''
|
|
|
lendForm.T_remark = ''
|
|
|
ElMessage.success('已添加到待提交列表')
|
|
@@ -569,6 +584,7 @@ onMounted(() => {
|
|
|
<el-tag v-if="row.T_state == 2" effect="dark">未出库</el-tag>
|
|
|
<el-tag v-if="row.T_state == 3" effect="dark" type="warning">维修中</el-tag>
|
|
|
<el-tag v-if="row.T_state == 4" effect="dark" type="danger">已报废</el-tag>
|
|
|
+ <el-tag v-if="row.T_state == 5" effect="dark" type="info">已损坏</el-tag>
|
|
|
</template>
|
|
|
<template #T_class="{ row }">
|
|
|
<el-tag>{{ Pruductoptions.find(option => option.Id === row.T_class)?.T_name || '' }}</el-tag>
|