|
@ -71,20 +71,22 @@ |
|
|
</BasicForm> |
|
|
</BasicForm> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
|
|
|
<!-- :apiCreate="UnplannedreceiptRequestDetailApi.createUnplannedreceiptRequestDetail" --> |
|
|
|
|
|
<!-- :apiUpdate="UnplannedreceiptRequestDetailApi.updateUnplannedreceiptRequestDetail" --> |
|
|
<Detail |
|
|
<Detail |
|
|
ref="detailRef" |
|
|
ref="detailRef" |
|
|
:isBasic="false" |
|
|
:isBasic="false" |
|
|
:allSchemas="UnplannedreceiptRequestMain.allSchemas" |
|
|
:allSchemas="UnplannedreceiptRequestMain.allSchemas" |
|
|
:detailAllSchemas="UnplannedreceiptRequestDetail.allSchemas" |
|
|
:detailAllSchemas="UnplannedreceiptRequestDetail.allSchemas" |
|
|
:detailAllSchemasRules="UnplannedreceiptRequestDetailRules" |
|
|
:detailAllSchemasRules="UnplannedreceiptRequestDetailRules" |
|
|
:apiCreate="UnplannedreceiptRequestDetailApi.createUnplannedreceiptRequestDetail" |
|
|
@handleSubmitForm="handleDetailSubmitForm" |
|
|
:apiUpdate="UnplannedreceiptRequestDetailApi.updateUnplannedreceiptRequestDetail" |
|
|
|
|
|
:apiPage="UnplannedreceiptRequestDetailApi.getUnplannedreceiptRequestDetailPage" |
|
|
:apiPage="UnplannedreceiptRequestDetailApi.getUnplannedreceiptRequestDetailPage" |
|
|
:apiDelete="UnplannedreceiptRequestDetailApi.deleteUnplannedreceiptRequestDetail" |
|
|
:apiDelete="UnplannedreceiptRequestDetailApi.deleteUnplannedreceiptRequestDetail" |
|
|
:Echo="Echo" |
|
|
:Echo="Echo" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
:detailValidate="detailValidate" |
|
|
:detailValidate="detailValidate" |
|
|
@detailBasicFormOnChange="qtyOnChange" |
|
|
@detailBasicFormOnChange="qtyOnChange" |
|
|
|
|
|
@detailOpenForm="detailOpenForm" |
|
|
@onBlur="onBlur" |
|
|
@onBlur="onBlur" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
@ -244,6 +246,20 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
const handleDetailSubmitForm = async (formType, data) => { |
|
|
|
|
|
let mydata = {...data} |
|
|
|
|
|
mydata['expireDate'] = data['expireDate'].valueOf() |
|
|
|
|
|
if (formType === 'create') { |
|
|
|
|
|
await UnplannedreceiptRequestDetailApi.createUnplannedreceiptRequestDetail(data) |
|
|
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
await UnplannedreceiptRequestDetailApi.updateUnplannedreceiptRequestDetail(data) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
} |
|
|
|
|
|
detailRef.value.submitUpdateList() |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
// 查询页面返回——详情 |
|
|
// 查询页面返回——详情 |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -255,11 +271,12 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
if(formField == 'itemCode'){ |
|
|
if(formField == 'itemCode'){ |
|
|
setV['itemCode'] = val[0]['code'] |
|
|
setV['itemCode'] = val[0]['code'] |
|
|
setV['uom'] = val[0]['uom'] |
|
|
setV['uom'] = val[0]['uom'] |
|
|
setV['expireDate'] = val[0]['validityDays']?addDay(val[0]['produceDate'],val[0]['validityDays']):'' |
|
|
setV['validityDays'] = val[0]['validityDays'] |
|
|
setV.batch = formatTime(new Date(), 'yyyyMMdd') |
|
|
setV['expireDate'] = val[0]['validityDays']?addDay(val[0]['produceDate'],val[0]['validityDays']).valueOf():'' |
|
|
//生产日期 到货日期 默认当天 |
|
|
setV['batch'] = formatTime(new Date(), 'yyyyMMdd') //生产日期 到货日期 默认当天 |
|
|
setV['produceDate'] = dayjs().valueOf() |
|
|
setV['produceDate'] = dayjs().valueOf() |
|
|
setV['arriveDate'] = dayjs().valueOf() |
|
|
setV['arriveDate'] = dayjs().valueOf() |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
if(formField === 'costcentreCode'){ |
|
|
if(formField === 'costcentreCode'){ |
|
|
setV['costcentreCode'] = val[0]['costcentreCode'] |
|
|
setV['costcentreCode'] = val[0]['costcentreCode'] |
|
@ -723,7 +740,39 @@ const inputNumberChange = (field, index, row, val) => { |
|
|
row.amount = row.qty * row.singlePrice |
|
|
row.amount = row.qty * row.singlePrice |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let validityDays = 0 |
|
|
|
|
|
const detailOpenForm = (type, row)=>{ |
|
|
|
|
|
console.log('detailOpenForm',row) |
|
|
|
|
|
if(type=='update'){ |
|
|
|
|
|
//有效期 |
|
|
|
|
|
ItembasicApi.getItembasicPage({ |
|
|
|
|
|
code:row.itemCode |
|
|
|
|
|
}).then((res)=>{ |
|
|
|
|
|
res.list.forEach((item,index)=>{ |
|
|
|
|
|
const findItem = tableData.value.find(item1=>item1['itemCode']==row['code']) |
|
|
|
|
|
if(findItem){ |
|
|
|
|
|
validityDays = findItem['expireTime'] |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
detailRef.value.formRef.formRef.formModel.expireDate = addDay(detailRef.value.formRef.formRef.formModel.produceDate,validityDays).valueOf() |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
validityDays = 0 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
const qtyOnChange = (field,val) =>{ |
|
|
const qtyOnChange = (field,val) =>{ |
|
|
|
|
|
console.log('qtyOnChange',field,val) |
|
|
|
|
|
console.log(detailRef.value.formRef.formRef.formModel) |
|
|
|
|
|
if(field=='produceDate'){ |
|
|
|
|
|
if(detailRef.value.formRef.formRef.formModel.validityDays){ |
|
|
|
|
|
detailRef.value.formRef.formRef.formModel.expireDate = addDay(detailRef.value.formRef.formRef.formModel.produceDate,detailRef.value.formRef.formRef.formModel.validityDays).valueOf() |
|
|
|
|
|
}else{ |
|
|
|
|
|
detailRef.value.formRef.formRef.formModel.expireDate = addDay(detailRef.value.formRef.formRef.formModel.produceDate,validityDays).valueOf() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
if(field == 'qty' || field == 'singlePrice'){ |
|
|
if(field == 'qty' || field == 'singlePrice'){ |
|
|
detailRef.value.formRef.formRef.formModel.amount = detailRef.value.formRef.formRef.formModel.qty * detailRef.value.formRef.formRef.formModel.singlePrice |
|
|
detailRef.value.formRef.formRef.formModel.amount = detailRef.value.formRef.formRef.formModel.qty * detailRef.value.formRef.formRef.formModel.singlePrice |
|
|
} |
|
|
} |
|
|