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 6d42ef1b5..6ae1a9a94 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'] }