From eff6968666db6d5efb56135884c24d572d3b9b7c Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期六, 08 八月 2026 16:17:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_长治_祥雨远见科技' into dev_长治_祥雨远见科技
---
src/views/qualityManagement/finalInspection/components/formDia.vue | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/views/qualityManagement/finalInspection/components/formDia.vue b/src/views/qualityManagement/finalInspection/components/formDia.vue
index 6a3e774..ff2040c 100644
--- a/src/views/qualityManagement/finalInspection/components/formDia.vue
+++ b/src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -58,7 +58,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="鏁伴噺锛�" prop="quantity">
- <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="璇疯緭鍏�" clearable :precision="2"/>
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="璇疯緭鍏�" clearable :precision="2" :disabled="quantityDisabled"/>
</el-form-item>
</el-col>
</el-row>
@@ -114,7 +114,7 @@
</PIMTable>
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
+ <el-button type="primary" :loading="submitting" @click="submitForm">纭</el-button>
<el-button @click="closeDia">鍙栨秷</el-button>
</div>
</template>
@@ -123,7 +123,7 @@
</template>
<script setup>
-import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
+import {ref, reactive, toRefs, computed, getCurrentInstance, nextTick} from "vue";
import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
@@ -134,6 +134,7 @@
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
+const submitting = ref(false);
const operationType = ref('')
const data = reactive({
form: {
@@ -164,6 +165,11 @@
},
});
const { form, rules } = toRefs(data);
+// 缂栬緫鏃讹細productMainId 鎴� purchaseLedgerId 浠讳竴鏈夊�煎垯鏁伴噺缃伆
+const quantityDisabled = computed(() => {
+ const v = form.value || {};
+ return !!(v.productMainId != null || v.purchaseLedgerId != null);
+});
const supplierList = ref([]);
const productOptions = ref([]);
const tableColumn = ref([
@@ -338,6 +344,9 @@
}
// 鎻愪氦浜у搧琛ㄥ崟
const submitForm = () => {
+ if (submitting.value) {
+ return;
+ }
proxy.$refs.formRef.validate(valid => {
if (valid) {
form.value.inspectType = 2
@@ -347,15 +356,20 @@
})
}
const data = {...form.value, qualityInspectParams: tableData.value}
+ submitting.value = true;
if (operationType.value === "add") {
qualityInspectAdd(data).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
+ }).catch(() => {}).finally(() => {
+ submitting.value = false;
})
} else {
qualityInspectUpdate(data).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
+ }).catch(() => {}).finally(() => {
+ submitting.value = false;
})
}
}
--
Gitblit v1.9.3