|
@@ -162,13 +162,19 @@ const extractSN = (fullSN: string): string => {
|
|
|
}
|
|
|
|
|
|
const submitInStorageForm = () => {
|
|
|
- inStorageFormRef.value?.validate((valid: boolean) => {
|
|
|
+ inStorageFormRef.value?.validate(async (valid: boolean) => {
|
|
|
if (valid) {
|
|
|
const extractedSN = extractSN(inStorageForm.T_sn)
|
|
|
if (pendingItems.value.some((item: any) => item.T_sn === extractedSN)) {
|
|
|
ElMessage.warning('已存在相同的SN,不能添加')
|
|
|
return
|
|
|
}
|
|
|
+ const result: any = await readvaildation({ sn: extractedSN })
|
|
|
+ if ((result.Code==200)&&(result.Data.T_state == 2)) {
|
|
|
+ //1-已出库 2-待使用 3-待维修
|
|
|
+ ElMessage.warning('当前SN已入库不能重复入库')
|
|
|
+ return
|
|
|
+ }
|
|
|
pendingItems.value.unshift({ ...inStorageForm, T_sn: extractedSN })
|
|
|
inStorageForm.T_sn = ''
|
|
|
inStorageForm.Validationnumber = ''
|
|
@@ -197,10 +203,15 @@ const submitRepaidForm = () => {
|
|
|
ElMessage.warning('当前SN未入库不能归还')
|
|
|
return
|
|
|
}
|
|
|
+ if (result.Data.T_state != 1) {
|
|
|
+ //1-已出库 2-待使用 3-待维修
|
|
|
+ ElMessage.warning('当前SN未出库不能归还')
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
- pendingItems.value.unshift({ ...inStorageForm, T_sn: extractedSN })
|
|
|
+ pendingItems.value.unshift({ ...inStorageForm, T_sn: extractedSN })
|
|
|
|
|
|
- inStorageForm.T_sn = ''
|
|
|
+ inStorageForm.T_sn = ''
|
|
|
inStorageForm.Validationnumber = ''
|
|
|
inStorageForm.T_remark = ''
|
|
|
ElMessage.success('已添加到待提交列表')
|
|
@@ -279,6 +290,7 @@ const lendRules = reactive({
|
|
|
})
|
|
|
|
|
|
const submitLendForm = () => {
|
|
|
+ console.log()
|
|
|
lendFormRef.value?.validate(async (valid: boolean) => {
|
|
|
if (valid) {
|
|
|
const extractedSN = extractSN(lendForm.T_sn)
|
|
@@ -291,7 +303,10 @@ const submitLendForm = () => {
|
|
|
ElMessage.warning('当前SN未入库不能借出')
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ if (result.Data.T_state != 2) {
|
|
|
+ ElMessage.warning('当前SN未入库不能借出')
|
|
|
+ return
|
|
|
+ }
|
|
|
pendingLendItems.value.unshift({
|
|
|
T_sn: extractedSN,
|
|
|
Validationnumber: lendForm.Validationnumber,
|
|
@@ -588,7 +603,7 @@ onMounted(() => {
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
<el-button @click="showInStorageForm = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="submitInStorageForm">添加到暂存</el-button>
|
|
|
+ <el-button type="primary" @click="submitInStorageForm">添加到暂存11</el-button>
|
|
|
<!-- 新增提交按钮 -->
|
|
|
<el-button type="primary" @click="submitInStoragePendingItems">提交</el-button>
|
|
|
</span>
|