|
|
@ -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() |
|
|
|