From 4019314f9ebd833dd9fb69bbbaa05b2de4ed47f7 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 29 十月 2026 14:34:50 +0800
Subject: [PATCH] refactor(inspection-order): 重构委托单管理支持可重复绑定及历次下单记录
---
src/views/business/productOrder/components/addOrder.vue | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/views/business/productOrder/components/addOrder.vue b/src/views/business/productOrder/components/addOrder.vue
index 8ca6aee..2d44d25 100644
--- a/src/views/business/productOrder/components/addOrder.vue
+++ b/src/views/business/productOrder/components/addOrder.vue
@@ -667,7 +667,7 @@
import {
addInsOrderWithInspectionOrder,
getInspectionOrderForPlaceOrder,
- pageUnboundInspectionOrder
+ pageSelectableInspectionOrder
} from "@/api/cnas/process/demand/demand";
export default {
@@ -804,6 +804,7 @@
},
type: [],
inspectionOrderLoading: false,
+ inspectionOrderRequestId: null,
inspectionOrderDialogVisible: false,
inspectionOrderTableData: [],
inspectionOrderSelection: [],
@@ -976,6 +977,7 @@
},
methods: {
openInspectionOrderList() {
+ this.inspectionOrderRequestId = this.createRequestId()
this.inspectionOrderSelection = []
this.inspectionOrderQuery.inspectionOrderCode = ''
this.inspectionOrderPage.current = 1
@@ -984,7 +986,7 @@
},
getInspectionOrderList() {
this.inspectionOrderLoading = true
- pageUnboundInspectionOrder({
+ pageSelectableInspectionOrder({
...this.inspectionOrderPage,
...this.inspectionOrderQuery
}).then(res => {
@@ -1043,9 +1045,6 @@
this.addObj.appointed = inspectionOrder.appointed || this.addObj.appointed
this.addObj.send = inspectionOrder.send === null || inspectionOrder.send === undefined
? this.addObj.send : inspectionOrder.send
- if (/^\d+$/.test(inspectionOrder.quantity || '')) {
- this.addObj.sampleNum = Number(inspectionOrder.quantity)
- }
this.sample.sample = inspectionOrder.sampleName || this.sample.sample
this.sample.model = inspectionOrder.modelNo || this.sample.model
this.$message.success('宸插甫鍏ユ楠屽鎵樺崟淇℃伅')
@@ -1554,6 +1553,7 @@
const submitRequest = inspectionOrderId
? addInsOrderWithInspectionOrder({
inspectionOrderId,
+ requestId: this.inspectionOrderRequestId || (this.inspectionOrderRequestId = this.createRequestId()),
insOrder: {...insOrder, typeSource: -1},
sampleList: sampleList
})
@@ -1565,12 +1565,24 @@
this.saveLoad = false
this.$message.success('宸叉彁浜�')
this.bsm3Dia = false;
+ this.inspectionOrderRequestId = null
this.closeOpenPage()
}).catch(e=>{
this.saveLoad = false
})
}
},
+ createRequestId() {
+ if (window.crypto && typeof window.crypto.randomUUID === 'function') {
+ return window.crypto.randomUUID()
+ }
+ const bytes = new Uint8Array(16)
+ window.crypto.getRandomValues(bytes)
+ bytes[6] = (bytes[6] & 0x0f) | 0x40
+ bytes[8] = (bytes[8] & 0x3f) | 0x80
+ const hex = Array.from(bytes, value => value.toString(16).padStart(2, '0')).join('')
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`
+ },
upInsOrderOfState(state) {
if (state == 1) {
this.saveLoad = true
@@ -2487,7 +2499,7 @@
</script>
<style scoped>
->>>.warning-row {
+::v-deep .warning-row {
color: #1890FF;
}
.node_i {
--
Gitblit v1.9.3