From e31b2a9a2439051aad04187d082f81874c65c993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Mon, 12 Aug 2024 19:43:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BAQ1=E8=AE=A2=E5=8D=95=EF=BC=8C?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E7=89=A9=E6=96=99=E4=BB=A3=E7=A0=81=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=B8=A6=E5=87=BA=E9=87=91=E9=A2=9D?= =?UTF-8?q?=EF=BC=8C=E9=87=91=E9=A2=9D=E5=8F=96=E8=87=AA=E9=80=89=E5=AE=9A?= =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E7=9A=84=E6=A0=87=E5=87=86=E6=88=90=E6=9C=AC?= =?UTF-8?q?=EF=BC=8C=E6=A0=B9=E6=8D=AE=E6=95=B0=E9=87=8F*=E6=A0=87?= =?UTF-8?q?=E5=87=86=E6=88=90=E6=9C=AC=E5=8A=A8=E6=80=81=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/inspectionQ1/index.vue | 29 +++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/views/qms/inspectionQ1/index.vue b/src/views/qms/inspectionQ1/index.vue index 71ee2fd82..8e75df52d 100644 --- a/src/views/qms/inspectionQ1/index.vue +++ b/src/views/qms/inspectionQ1/index.vue @@ -55,6 +55,7 @@ :apiCreate="Q1Api.createQ1" @searchTableSuccess="searchTableSuccess" :isBusiness="false" + @onChange="onChange" /> @@ -77,6 +78,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' 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 { useUserStore } from '@/store/modules/user' const userStore = useUserStore() @@ -92,20 +94,45 @@ routeName.value = route.name const tableColumns = ref(Q1.allSchemas.tableColumns) // 查询页面返回 +const priceObj = ref() const searchTableSuccess = (formField, searchField, val, formRef) => { - nextTick(() => { + nextTick(async () => { const setV = {} if (formField == 'customerCode') { setV['itemCode'] = '' } if (formField == 'itemCode') { setV['uom'] = val[0]['customerUom'] + console.log(333,val[0].code) + const params = { + by: "ASC", + filters: [{column: "itemCode", action: "==", value: val[0].itemCode}], + pageNo: 1, + pageSize: 500, + sort: "" + } + params.isSearch = true + StdcostpriceApi.getStdcostpricePage(params).then((res) => { + if (res.list?.length > 0) { + priceObj.value = res.list[0] + formRef.setValues({ + claimAmount: (parseFloat(formRef.formModel.qty) * parseFloat(priceObj.value.price)).toFixed(6) + }) + } + + }) } setV[formField] = val[0][searchField] formRef.setValues(setV) }) } +const onChange =(field,e)=>{ + if (field == 'qty') { + basicFormRef.value.formRef.formModel.claimAmount = (parseFloat( basicFormRef.value.formRef.formModel.qty) * parseFloat( priceObj.value.price)).toFixed(6) +} +} + // 字段设置 更新主列表字段 const updataTableColumns = (val) => { tableColumns.value = val