From 8c6777cf57f27deff75991e55c077eb2a5f78a0d Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Thu, 21 Mar 2024 19:42:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E5=87=BA=E5=BA=93=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E4=BB=B7=E5=92=8C=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scrap/scrapRequestMain/index.vue | 27 ++++++++++ .../scrapRequestMain/scrapRequestMain.data.ts | 50 ++++++++++++++++++- .../productscrapRequestMain/index.vue | 16 +++--- 3 files changed, 84 insertions(+), 9 deletions(-) diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue index aa9d8e2e9..76183c8cf 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue @@ -53,6 +53,7 @@ @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" + @inputNumberChange="inputNumberChange" @submitForm="submitForm" @tableFormSelectOnBlur="tableFormSelectOnBlur" /> @@ -70,6 +71,7 @@ :apiDelete="ScrapRequestDetailApi.deleteScrapRequestDetail" :Echo="Echo" @searchTableSuccessDetail="searchTableSuccessDetail" + @detailBasicFormOnChange="qtyOnChange" :detailValidate="detailValidate" @onBlur="onBlur" /> @@ -86,6 +88,7 @@ import { ScrapRequestMain,ScrapRequestMainRules,ScrapRequestDetail,ScrapRequestD import * as ScrapRequestMainApi from '@/api/wms/scrapRequestMain' import * as ScrapRequestDetailApi from '@/api/wms/scrapRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' +import * as StdcostpriceApi from '@/api/wms/stdcostprice' // 报废出库申请 defineOptions({ name: 'ScrapRequestMain' }) @@ -113,6 +116,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => row['batch'] = val[0]['batch'] row['fromLocationCode'] = val[0]['locationCode'] row['itemCode'] = val[0]['itemCode'] + row['uom'] = val[0]['uom'] + // 查询标准价格 + let param = {'itemCode':val[0]['itemCode'] as string} + StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => { + row['singlePrice'] = res.price + }) } else { const setV = {} setV[formField] = val[0][searchField] @@ -129,6 +138,12 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { setV['batch'] = val[0]['batch'] setV['fromLocationCode'] = val[0]['locationCode'] setV['itemCode'] = val[0]['itemCode'] + setV['uom'] = val[0]['uom'] + // 查询标准价格 + let param = {'itemCode':val[0]['itemCode'] as string} + StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => { + setV['singlePrice'] = res.price + }) formRef.setValues(setV) }) } @@ -458,6 +473,18 @@ const tableFormSelectOnBlur = (field, val, row, index) => { } } +const inputNumberChange = (field, index, row, val) => { + if(field == 'qty' || field == 'singlePrice'){ + row.amount = row.qty * row.singlePrice + } +} + +const qtyOnChange = (field,val) =>{ + if(field == 'qty' || field == 'singlePrice'){ + detailRef.value.formRef.formRef.formModel.amount = detailRef.value.formRef.formRef.formModel.qty * detailRef.value.formRef.formRef.formModel.singlePrice + } +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts index fd4b2414c..435d7e11a 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts @@ -539,6 +539,50 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ precision: 6 } }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + disabled: true, + min: 0, + precision: 6 + }, + }, + tableForm: { + disabled: true, + type: 'InputNumber', + min: 0, + precision: 6 + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + disabled:true, + min: 0, + precision: 6, + } + }, + tableForm: { + type: 'InputNumber', + disabled:true, + min: 0, + precision: 6, + }, + }, { label: '计量单位', field: 'uom', @@ -547,9 +591,13 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ isTable: true, sort: 'custom', table: { - width: 150 + width: 150, + componentProps:{ + disabled:true, + } }, tableForm: { + disabled:true, type: 'Select' } }, diff --git a/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue b/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue index 03c3535ba..94a03692a 100644 --- a/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue +++ b/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue @@ -304,12 +304,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => row['itemCode'] = val[0]['itemCode'] row['bomVersion'] = '' row['childList'] = [] - let param = {'itemCode':val[0]['itemCode'] as string} - StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => { - console.log(res) - row['uom'] = res.uom - row['singlePrice'] = res.price - }) + // 查询标准价格 + let param = {'itemCode':val[0]['itemCode'] as string} + StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => { + console.log(res) + row['uom'] = res.uom + row['singlePrice'] = res.price + }) }else if(formField == 'bomVersion'){ row['bomVersion'] = val[0]['version'] } @@ -337,12 +338,11 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { setV['itemCode'] = val[0]['itemCode'] setV['bomVersion'] = '' setV['childList'] = [] - // + // 查询标准价格 let param = {'itemCode':val[0]['itemCode'] as string} StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => { console.log(res) }) - }else if(formField == 'bomVersion'){ setV['bomVersion'] = val[0]['version'] }