From aec83434811f3f335ba073833f5918be083af8bd Mon Sep 17 00:00:00 2001
From: Aoi_Tori <2547614904@qq.com>
Date: Thu, 10 Jul 2025 13:37:11 +0800
Subject: [PATCH] 2025/7/10
---
.../project/projectPart/projectPartQuote.vue | 7 ++
src/views/modules/test/requestForTest.vue | 99 ++++++++++++++++---
2 files changed, 90 insertions(+), 16 deletions(-)
diff --git a/src/views/modules/project/projectPart/projectPartQuote.vue b/src/views/modules/project/projectPart/projectPartQuote.vue
index c5f873e..7b0d1a1 100644
--- a/src/views/modules/project/projectPart/projectPartQuote.vue
+++ b/src/views/modules/project/projectPart/projectPartQuote.vue
@@ -384,6 +384,10 @@ export default {
createExportData() {
return this.dataList;
},
+ formatDecimal(value) {
+ const num = parseFloat(value);
+ return !isNaN(num) ? num.toFixed(4) : value;
+ },
},
watch:{
part(newVal,oldVal){
@@ -427,6 +431,9 @@ export default {
{{ `${scope.row[item.columnProp]}` }}
+
+ {{ formatDecimal(scope.row.unitPriceRate) }}
+
{{ scope.row[item.columnProp]}}
![]()
diff --git a/src/views/modules/test/requestForTest.vue b/src/views/modules/test/requestForTest.vue
index e372bb2..811f44b 100644
--- a/src/views/modules/test/requestForTest.vue
+++ b/src/views/modules/test/requestForTest.vue
@@ -197,8 +197,8 @@
- 客户编码
- 客户编码
+
@@ -247,9 +247,9 @@
- 项目号
-
@@ -277,12 +277,19 @@
+
+
+
+
+
+
- 物料编码
- 物料编码
+
+
@@ -1043,7 +1050,9 @@ export default {
if (!newV) {
this.modalData.customerDesc = ''
}
- this.modalData.projectId = ''
+ if (!this.modalData.projectId){
+ this.modalData.projectId = ''
+ }
this.modalData.consignee = ''
this.modalData.consigneeContact = ''
this.modalData.sendSamplesAddress = ''
@@ -1054,7 +1063,12 @@ export default {
if (!newV) {
this.modalData.projectName = ''
}
- this.modalData.testPartNo = ''
+ if (!this.modalData.testPartNo){
+ this.modalData.testPartNo = ''
+ }
+ if (!this.modalData.customerNo){
+ this.modalData.customerNo = ''
+ }
}
},
'modalData.testPartNo'(newV, oldV) {
@@ -1063,6 +1077,9 @@ export default {
this.modalData.partName = ''
this.dialogProperties = [];
}
+ if (!this.modalData.projectId){
+ this.modalData.projectId = ''
+ }
}
},
'modalData.tracker'(newV, oldV) {
@@ -1088,6 +1105,12 @@ export default {
modalFlag(newVal, oldVal) {
if (newVal === false) {
this.detailFlag = false
+ this.modalData.customerNoFlag = false
+ this.modalData.projectIdFlag = true
+ this.modalData.testPartNoFlag = false
+ this.projectPartData.projectId = ''
+ this.searchProjectData.customerId = ''
+ this.searchProjectData.testPartNo = ''
}
},
rejectVisible(newVal, oldVal) {
@@ -1224,6 +1247,9 @@ export default {
isReject: '',
nodeId: '',
soNumber: '',
+ customerNoFlag: false,
+ projectIdFlag: true,
+ testPartNoFlag: false,
},
testDetailData: {
technicalConsiderations: '',
@@ -2230,6 +2256,7 @@ export default {
site: this.$store.state.user.site,
projectId: undefined,
projectName: undefined,
+ testPartNo: undefined,
customerId: undefined,
},
// 项目集合
@@ -2728,15 +2755,17 @@ export default {
* 获取项目物料列表
*/
getProjectPartList() {
- if (!this.modalData.projectId) {
- this.projectPartList = [];
- return
- }
+ // if (!this.modalData.projectId) {
+ // this.projectPartList = [];
+ // return
+ // }
// 先清空缓存选中
// this.$nextTick(() => this.$refs.projectPartTable.clearSelection())
// 拿到选中的产品编号
let projectPartList = this.modalData.testPartNo.split(';')
- this.projectPartData.projectId = this.modalData.projectId;
+ if (this.modalData.projectId&&this.modalData.projectId!=='') {
+ this.projectPartData.projectId = this.modalData.projectId;
+ }
let params = {
...this.projectPartData,
no: this.partPageNo,
@@ -3331,6 +3360,16 @@ export default {
if (val.Customer_no === this.modalData.customerNo) {
return
}
+ if (this.modalData.projectIdFlag&&!this.modalData.testPartNoFlag){
+ // 料号、项目、客户都没选时选客户
+ this.modalData.testPartNoFlag = true
+ this.modalData.projectIdFlag = false
+ } else if (!this.modalData.projectIdFlag&&this.modalData.testPartNoFlag){
+ // 选了客户没选项目和料号时选客户
+
+ } else if (!this.modalData.projectIdFlag&&!this.modalData.testPartNoFlag){
+ // 选了客户和料号时选客户
+ }
this.modalData.customerNo = val.Customer_no
this.modalData.customerDesc = val.Customer_desc
this.modalData.projectId = ''
@@ -3476,13 +3515,32 @@ export default {
projectClickRow(row) {
this.modalData.projectId = row.projectId
this.modalData.projectName = row.projectName
- this.getProjectPartList()
+ if (this.modalData.testPartNoFlag&&!this.modalData.customerNoFlag){
+ // 选了客户没选项目时选项目
+ this.modalData.testPartNoFlag = false
+ } else if (!this.modalData.testPartNoFlag&&!this.modalData.customerNoFlag){
+ // 选了客户选了项目时选项目
+ // this.modalData.testPartNoFlag = false
+ } else if (!this.modalData.testPartNoFlag&&this.modalData.customerNoFlag){
+ // 选了料号没选客户时选项目
+ this.modalData.customerNoFlag = false
+ }
+ if (this.modalData.customerNo&&this.modalData.customerNo!==''){
+ this.getProjectPartList()
+ } else {
+ this.modalData.customerNo = row.customerId
+ this.modalData.customerDesc = row.customerName
+ }
this.chooseProjectListFlag = false
},
// 查询searchProjectInfoList
searchProjectInfoList() {
this.projectList = [];
- this.searchProjectData.customerId = this.modalData.customerNo
+ if (this.modalData.customerNo&&this.modalData.customerNo!==''){
+ this.searchProjectData.customerId = this.modalData.customerNo
+ } else {
+ this.searchProjectData.testPartNo = this.modalData.testPartNo
+ }
searchProjectInfoList(this.searchProjectData).then(({data}) => {
if (data && data.code === 0) {
this.projectList = data.rows
@@ -3608,6 +3666,15 @@ export default {
partPropertiesList(params).then(({data}) => {
if (data && data.code === 0) {
this.dialogProperties = data.rows
+ if (this.modalData.projectIdFlag&&!this.modalData.customerNoFlag){
+ // 料号、客户、项目都没选时选料号
+ this.modalData.customerNoFlag = true
+ this.modalData.projectIdFlag = false
+ } else if (!this.modalData.projectIdFlag&&this.modalData.customerNoFlag){
+ // 选了料号没选项目和客户时选料号
+ } else if (!this.modalData.projectIdFlag&&!this.modalData.customerNoFlag){
+ // 客户和项目都选了时选料号
+ }
} else {
this.$message.warning(data.msg)
}