Browse Source

线边报废申请--单价,金额计算

hella_online_20240919
yufei_wang 2 months ago
parent
commit
859e988aad
  1. 2
      src/api/wms/stdcostprice/index.ts
  2. 15
      src/views/wms/issueManage/productionscrap/productionscrapRequestMain/index.vue

2
src/api/wms/stdcostprice/index.ts

@ -59,6 +59,6 @@ export const importTemplate = () => {
// 查询标准成本价格单列表 // 查询标准成本价格单列表
export const queryStdcostpriceByItemCode = async (data: StdcostpriceVO) => { export const queryStdcostpriceByItemCode = async (data) => {
return await request.post({ url: `/wms/stdcostprice/queryStdcostpriceByItemCode`, data }) return await request.post({ url: `/wms/stdcostprice/queryStdcostpriceByItemCode`, data })
} }

15
src/views/wms/issueManage/productionscrap/productionscrapRequestMain/index.vue

@ -59,6 +59,7 @@
@tableSelectionDelete="tableSelectionDelete" @tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@inputNumberChange="inputNumberChange"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -101,6 +102,7 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import * as StdcostpriceApi from '@/api/wms/stdcostprice'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { ProductionscrapRequestMain,ProductionscrapRequestMainRules,ProductionscrapRequestDetail,ProductionscrapRequestDetailRules,ProductionscrapRequestDetailLabel,ProductionscrapRequestDetailLabelRules, SupplierdeliverRequestPackage } from './productionscrapRequestMain.data' import { ProductionscrapRequestMain,ProductionscrapRequestMainRules,ProductionscrapRequestDetail,ProductionscrapRequestDetailRules,ProductionscrapRequestDetailLabel,ProductionscrapRequestDetailLabelRules, SupplierdeliverRequestPackage } from './productionscrapRequestMain.data'
import * as ProductionscrapRequestMainApi from '@/api/wms/productionscrapRequestMain' import * as ProductionscrapRequestMainApi from '@/api/wms/productionscrapRequestMain'
@ -183,7 +185,11 @@ const isItemType = async (itemCode, labelTypeParams) => {
if (!isType) labelType.value = labelTypeOld if (!isType) labelType.value = labelTypeOld
return isType return isType
} }
const inputNumberChange = (field, index, row, val) => {
if(field == 'qty' ){
row.amount = Number(Number(row.qty * row.singlePrice).toFixed(2))
}
}
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(async () => { nextTick(async () => {
@ -216,6 +222,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
item.tableForm.max = val[0]['qty'] item.tableForm.max = val[0]['qty']
} }
}) })
let param = {'itemCodes':val[0]['itemCode']}
let resyStdcost = await StdcostpriceApi.queryStdcostpriceByItemCode(param)
console.log('resyStdcost',resyStdcost)
if(resyStdcost&&resyStdcost.length>0){
row['singlePrice'] = resyStdcost[0].price
row['amount'] = Number(Number(resyStdcost[0].price * row['qty']).toFixed(2))
}
} }
} else if(formField == 'workStationCode') { } else if(formField == 'workStationCode') {
// //

Loading…
Cancel
Save