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, // 查询弹窗所需类