From b121c2f1e38564cfad3b44713d8e747472fc11bf Mon Sep 17 00:00:00 2001 From: "YEJIAXING-PC\\lenovo" <591141169@qq.com> Date: Fri, 6 Sep 2024 15:44:49 +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=20=20=20HL-5882?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/inspectionQ2/index.vue | 60 +++++++++++++++++-- .../qms/inspectionQ2/inspectionQ2.data.ts | 2 +- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/src/views/qms/inspectionQ2/index.vue b/src/views/qms/inspectionQ2/index.vue index 2f06c656f..5e88f8696 100644 --- a/src/views/qms/inspectionQ2/index.vue +++ b/src/views/qms/inspectionQ2/index.vue @@ -108,6 +108,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import Detail from '@/components/Detail/src/Detail.vue' import * as StdcostpriceApi from '@/api/wms/stdcostprice' +import * as SalepriceApi from '@/api/wms/saleprice' import { formatDate } from '@/utils/formatTime' import * as SupplieritemApi from '@/api/wms/supplieritem' import * as SupplierApi from '@/api/wms/supplier' @@ -171,6 +172,29 @@ const clearSearchInput = (formField) => { }) } }) + 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 { + formRef.setValues({ + standardCostPrice: 0 + }) + } + }) + } + }) } } // 查询页面返回 @@ -230,12 +254,25 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { sort: '' } params2.isSearch = true - StdcostpriceApi.getStdcostpricePage(params2).then((res) => { + SalepriceApi.getSalepricePage(params2).then((res) => { if (res.list?.length > 0) { priceObj.value = res.list[0] formRef.setValues({ standardCostPrice: priceObj.value.price }) + } else { + StdcostpriceApi.getStdcostpricePage(params2).then((res) => { + if (res.list?.length > 0) { + priceObj.value = res.list[0] + formRef.setValues({ + standardCostPrice: priceObj.value.price + }) + } else { + formRef.setValues({ + standardCostPrice: 0 + }) + } + }) } }) setV[formField] = val[0][searchField] @@ -304,8 +341,9 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { }) } }) - if (basicFormRef.value.formRef.formModel.lightItemCode == null|| - basicFormRef.value.formRef.formModel.lightItemCode == '' + if ( + basicFormRef.value.formRef.formModel.lightItemCode == null || + basicFormRef.value.formRef.formModel.lightItemCode == '' ) { setV['standardCostPrice'] = '' setV['lightQty'] = 0 @@ -322,12 +360,26 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { sort: '' } params2.isSearch = true - StdcostpriceApi.getStdcostpricePage(params2).then((res) => { + + SalepriceApi.getSalepricePage(params2).then((res) => { if (res.list?.length > 0) { priceObj.value = res.list[0] formRef.setValues({ standardCostPrice: priceObj.value.price }) + } else { + StdcostpriceApi.getStdcostpricePage(params2).then((res) => { + if (res.list?.length > 0) { + priceObj.value = res.list[0] + formRef.setValues({ + standardCostPrice: priceObj.value.price + }) + } else { + formRef.setValues({ + standardCostPrice: 0 + }) + } + }) } }) } diff --git a/src/views/qms/inspectionQ2/inspectionQ2.data.ts b/src/views/qms/inspectionQ2/inspectionQ2.data.ts index 91802924c..4112c30fd 100644 --- a/src/views/qms/inspectionQ2/inspectionQ2.data.ts +++ b/src/views/qms/inspectionQ2/inspectionQ2.data.ts @@ -341,7 +341,7 @@ export const Q2 = useCrudSchemas( componentProps: { enterSearch: true, isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择物料代码', // 输入框占位文本 + searchListPlaceholder: '请选择整灯/分总成物料代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '物料基础信息', // 查询弹窗标题 searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类