|
|
@ -70,6 +70,23 @@ const openForm =async (type: string, row?: any) => { |
|
|
|
formRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
|
const openFormTable =async (type: string, row?: any, list?:any) => { |
|
|
|
row['customerStatementNumber'] = row['number'] // 客户对账单 |
|
|
|
CustomerSaleInvoiceMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if(item.field == 'customerStatementNumber'){ |
|
|
|
item.componentProps.disabled = true |
|
|
|
item.componentProps.isSearchList = false |
|
|
|
item.componentProps.enterSearch = false |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
tableData.value = list // 重置明细数据 |
|
|
|
formRef.value.open(type, row) |
|
|
|
nextTick(()=>{ |
|
|
|
initTableDataPrice() |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const onChange = (field, cur, formRef)=>{ |
|
|
|
|
|
|
|
console.log('onChange',field, cur, formRef) |
|
|
@ -205,28 +222,32 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
}).then((res) => { |
|
|
|
console.log(55,res) |
|
|
|
tableData.value = res.list && res.list.length > 0 ?res.list : [] |
|
|
|
initTableDataPrice() |
|
|
|
|
|
|
|
}) |
|
|
|
// tableData.value = [] |
|
|
|
|
|
|
|
} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 初始化计算子表 |
|
|
|
const initTableDataPrice = ()=>{ |
|
|
|
tableData.value.forEach(item=>{ |
|
|
|
item['sumPrice'] = item['price'] + item['allocationPrice'] |
|
|
|
// 未税金额 默认等于数量*合计单价,可修改,必填,最多可输入2位小数 |
|
|
|
item['beforeTaxAmount'] = item['sumPrice']*item['qty'] |
|
|
|
|
|
|
|
// 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 |
|
|
|
item['taxAmount'] = (item['beforeTaxAmount'] * formRef.formModel['taxRate'])/100 //含税金额 |
|
|
|
item['taxAmount'] = (item['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 //含税金额 |
|
|
|
|
|
|
|
// 含税金额 未税价格+税额,四舍五入保留2位小数 |
|
|
|
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //含税金额 |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
// tableData.value = [] |
|
|
|
|
|
|
|
} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -250,6 +271,6 @@ const tableSelectionDelete = (selection) => { |
|
|
|
tableData.value = tableData.value.filter(item => !selection.includes(item)) |
|
|
|
} |
|
|
|
|
|
|
|
defineExpose({openForm}) |
|
|
|
defineExpose({openForm,openFormTable}) |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped></style> |