|
@@ -1,4 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
|
|
+ <el-alert v-if="currentStatus === -1" :title="ruleFormData.returnReason" type="warning" />
|
|
|
<main class="safety-platform-container__main">
|
|
<main class="safety-platform-container__main">
|
|
|
<BasicForm
|
|
<BasicForm
|
|
|
ref="basicFormRef"
|
|
ref="basicFormRef"
|
|
@@ -123,7 +124,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { computed, onMounted, ref, reactive } from 'vue';
|
|
import { computed, onMounted, ref, reactive } from 'vue';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
- import { ElMessage } from 'element-plus';
|
|
|
|
|
|
|
+ import { ElMessage, ElAlert } from 'element-plus';
|
|
|
import BasicForm from '@/components/BasicForm.vue';
|
|
import BasicForm from '@/components/BasicForm.vue';
|
|
|
import BasicDialog from '@/components/BasicDialog.vue';
|
|
import BasicDialog from '@/components/BasicDialog.vue';
|
|
|
import { useFormConfigHook } from '@/hooks/useFormConfigHook';
|
|
import { useFormConfigHook } from '@/hooks/useFormConfigHook';
|
|
@@ -346,14 +347,15 @@
|
|
|
const res = await basicFormRef.value.validateForm();
|
|
const res = await basicFormRef.value.validateForm();
|
|
|
return res;
|
|
return res;
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+const ReceiptRecordData = ref({})
|
|
|
const getDetail = async () => {
|
|
const getDetail = async () => {
|
|
|
if (!currentId.value) return;
|
|
if (!currentId.value) return;
|
|
|
try {
|
|
try {
|
|
|
const res = await queryClaimItemsLogDetail(currentId.value);
|
|
const res = await queryClaimItemsLogDetail(currentId.value);
|
|
|
if (res) {
|
|
if (res) {
|
|
|
|
|
+ ReceiptRecordData.value = res;
|
|
|
currentStatus.value = res.status;
|
|
currentStatus.value = res.status;
|
|
|
- ruleFormData.itemId = res.pimId;
|
|
|
|
|
|
|
+ ruleFormData.itemId = res.stuffName;
|
|
|
ruleFormData.outboundDate = res.outStoreTime ? res.outStoreTime.split('T')[0] : '';
|
|
ruleFormData.outboundDate = res.outStoreTime ? res.outStoreTime.split('T')[0] : '';
|
|
|
ruleFormData.outboundQuantity = res.claimQty;
|
|
ruleFormData.outboundQuantity = res.claimQty;
|
|
|
ruleFormData.receiptNumber = res.orderNumber;
|
|
ruleFormData.receiptNumber = res.orderNumber;
|
|
@@ -390,7 +392,9 @@
|
|
|
const message = isCreateMode.value ? '添加' : '修改';
|
|
const message = isCreateMode.value ? '添加' : '修改';
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- const selectedInventory = inventoryList.value.find((item) => item.id === ruleFormData.itemId);
|
|
|
|
|
|
|
+ const selectedInventory = inventoryList.value.find((item) => {
|
|
|
|
|
+ return item.id === ruleFormData.itemId || item.id ===ReceiptRecordData.value.pimId
|
|
|
|
|
+ });
|
|
|
if (!selectedInventory) {
|
|
if (!selectedInventory) {
|
|
|
ElMessage.error('请选择有效的奖品名称');
|
|
ElMessage.error('请选择有效的奖品名称');
|
|
|
return;
|
|
return;
|
|
@@ -428,6 +432,7 @@
|
|
|
? (createRes as any).id
|
|
? (createRes as any).id
|
|
|
: undefined;
|
|
: undefined;
|
|
|
} else if (isEditMode.value && currentId.value) {
|
|
} else if (isEditMode.value && currentId.value) {
|
|
|
|
|
+
|
|
|
await updateClaimItemsLog({
|
|
await updateClaimItemsLog({
|
|
|
id: currentId.value,
|
|
id: currentId.value,
|
|
|
...basePayload,
|
|
...basePayload,
|