From 1d58a4f622f57dfd317d4cf1d7127ae2415f3282 Mon Sep 17 00:00:00 2001 From: "YEJIAXING-PC\\lenovo" <591141169@qq.com> Date: Fri, 6 Sep 2024 23:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Q2=E9=80=9A=E7=9F=A5=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E9=94=80=E5=94=AE=E4=BB=B7=E6=A0=BC=E5=8F=96=E5=80=BC?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=20HL-5882?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/inspectionQ2/index.vue | 135 ++++++++++++------ src/views/qms/inspectionQ3/index.vue | 4 +- .../qms/inspectionQ3/inspectionQ3.data.ts | 8 +- 3 files changed, 101 insertions(+), 46 deletions(-) diff --git a/src/views/qms/inspectionQ2/index.vue b/src/views/qms/inspectionQ2/index.vue index 5e88f8696..48af18b0f 100644 --- a/src/views/qms/inspectionQ2/index.vue +++ b/src/views/qms/inspectionQ2/index.vue @@ -142,10 +142,62 @@ const clearSearchInput = (formField) => { item.componentProps.options = [] } }) + if (basicFormRef.value.formRef.formModel.lightItemCode) { + basicFormRef.value.formRef.setValues({ + lightQty: 0, + claimAmount: '', + otherClaimAmount: 0, + summaryAmount: 0, + disbursementAmount: 0, + remainingAmount: 0 + }) + + const params2 = { + by: 'ASC', + filters: [ + { + column: 'itemCode', + action: '==', + value: basicFormRef.value.formRef.formModel.lightItemCode + } + ], + pageNo: 1, + pageSize: 500, + sort: '' + } + params2.isSearch = true + SalepriceApi.getSalepricePage(params2).then((res) => { + if (res.list?.length > 0) { + priceObj.value = res.list[0] + + basicFormRef.value.formRef.setValues({ + standardCostPrice: priceObj.value.price + }) + } else { + params2.isSearch = true + StdcostpriceApi.getStdcostpricePage(params2).then((res) => { + if (res.list?.length > 0) { + priceObj.value = res.list[0] + + basicFormRef.value.formRef.setValues({ + standardCostPrice: priceObj.value.price + }) + } else { + basicFormRef.value.formRef.setValues({ + standardCostPrice: 0 + }) + } + }) + } + }) + } else { + basicFormRef.value.formRef.setValues({ + standardCostPrice: '' + }) + } } if (formField == 'lightItemCode') { basicFormRef.value.formRef.setValues({ - standardCostPrice: '', lightItemName: '', lightQty: 0, claimAmount: '', @@ -154,47 +206,47 @@ const clearSearchInput = (formField) => { disbursementAmount: 0, remainingAmount: 0 }) - const params2 = { - by: 'ASC', - filters: [ - { column: 'itemCode', action: '==', value: basicFormRef.value.formRef.formModel.itemCode } - ], - pageNo: 1, - pageSize: 500, - sort: '' - } - params2.isSearch = true - StdcostpriceApi.getStdcostpricePage(params2).then((res) => { - if (res.list?.length > 0) { - priceObj.value = res.list[0] - basicFormRef.value.formRef.setValues({ - standardCostPrice: priceObj.value.price - }) + + if (basicFormRef.value.formRef.formModel.itemCode) { + const params2 = { + by: 'ASC', + filters: [ + { column: 'itemCode', action: '==', value: basicFormRef.value.formRef.formModel.itemCode } + ], + pageNo: 1, + pageSize: 500, + sort: '' } - }) - SalepriceApi.getSalepricePage(params2).then((res) => { - if (res.list?.length > 0) { - priceObj.value = res.list[0] + params2.isSearch = true + SalepriceApi.getSalepricePage(params2).then((res) => { + if (res.list?.length > 0) { + priceObj.value = res.list[0] - basicFormRef.value.formRef.setValues({ - standardCostPrice: priceObj.value.price - }) - } else { - StdcostpriceApi.getStdcostpricePage(params2).then((res) => { - if (res.list?.length > 0) { - priceObj.value = res.list[0] + basicFormRef.value.formRef.setValues({ + standardCostPrice: priceObj.value.price + }) + } else { + params2.isSearch = true + StdcostpriceApi.getStdcostpricePage(params2).then((res) => { + if (res.list?.length > 0) { + priceObj.value = res.list[0] - basicFormRef.value.formRef.setValues({ - standardCostPrice: priceObj.value.price - }) - } else { - formRef.setValues({ - standardCostPrice: 0 - }) - } - }) - } - }) + basicFormRef.value.formRef.setValues({ + standardCostPrice: priceObj.value.price + }) + } else { + basicFormRef.value.formRef.setValues({ + standardCostPrice: 0 + }) + } + }) + } + }) + } else { + basicFormRef.value.formRef.setValues({ + standardCostPrice: '' + }) + } } } // 查询页面返回 @@ -261,6 +313,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { standardCostPrice: priceObj.value.price }) } else { + params2.isSearch = true StdcostpriceApi.getStdcostpricePage(params2).then((res) => { if (res.list?.length > 0) { priceObj.value = res.list[0] @@ -360,14 +413,16 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { sort: '' } params2.isSearch = true - + console.log(123) SalepriceApi.getSalepricePage(params2).then((res) => { + console.log(456) if (res.list?.length > 0) { priceObj.value = res.list[0] formRef.setValues({ standardCostPrice: priceObj.value.price }) } else { + params2.isSearch = true StdcostpriceApi.getStdcostpricePage(params2).then((res) => { if (res.list?.length > 0) { priceObj.value = res.list[0] diff --git a/src/views/qms/inspectionQ3/index.vue b/src/views/qms/inspectionQ3/index.vue index a061d7ab9..a444cafdf 100644 --- a/src/views/qms/inspectionQ3/index.vue +++ b/src/views/qms/inspectionQ3/index.vue @@ -106,6 +106,7 @@ import * as InspectionQ3MainApi from '@/api/qms/inspectionQ3/inspectionQ3Main' import * as InspectionQ3DetailApi from '@/api/qms/inspectionQ3/inspectionQ3Detail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as ProductionlineitemApi from '@/api/wms/productionlineitem' +import * as ProductionlineApi from '@/api/wms/productionline' import * as StdcostpriceApi from '@/api/wms/stdcostprice' import { formatDate } from '@/utils/formatTime' import { async } from '@antv/x6/lib/registry/marker/async' @@ -173,7 +174,7 @@ const setTableFormsValues = async (val, index1) => { newRow['uom'] = val[index1]['uom'] newRow['qty'] = 0 newRow.defectLocation = val[index1]['productionLineCode'] - await ProductionlineitemApi.selectItemCodeToProductionLineCode(val[index1].itemCode).then( + await ProductionlineApi.getProductionlineNoPage({}).then( (res) => { console.log(res) if (res?.length > 0) { @@ -419,7 +420,6 @@ const submitForm = async (formType, submitData) => { return; } let flag = false; - console.log(1111) data.subList.forEach((item) => { if(item.qty == 0){ message.warning("数量不能为0") diff --git a/src/views/qms/inspectionQ3/inspectionQ3.data.ts b/src/views/qms/inspectionQ3/inspectionQ3.data.ts index dd059b76e..8fbdeb017 100644 --- a/src/views/qms/inspectionQ3/inspectionQ3.data.ts +++ b/src/views/qms/inspectionQ3/inspectionQ3.data.ts @@ -485,16 +485,16 @@ export const InspectionQ3Detail = useCrudSchemas( filterable: true, options: [], optionsAlias: { - labelField: 'productionLineName', - valueField: 'productionLineCode' + labelField: 'name', + valueField: 'code' } } }, tableForm: { type: 'Select', filterable: true, - valueField: 'productionLineName', - labelField: 'productionLineCode' + valueField: 'name', + labelField: 'code' } }, {