Karlis 进行的变更

main
yang.yongquan 2022-12-28 14:38:09 +08:00
parent 958e925a44
commit d13b3f45d4
1 changed files with 25 additions and 18 deletions

View File

@ -98,15 +98,19 @@ class InvoiceUploadView extends React.Component<any, any>{
let result = new InvoiceCommit()
result.invoiceNo = response.data.invoiceNo
result.invoiceDate = dayjs(response.data.invoiceDate)
result.invoiceAmountWithoutTax = response.data.invoiceAmountWithoutTax
result.invoiceAmount = response.data.invoiceAmount
result.invoiceCode = response.data.invoiceCode
result.invoiceCheckCode = response.data.invoiceCheckCode
result.invoiceKind = response.data.invoiceKind
result.invoiceFileName = response.data.invoiceFileName
result.invoiceExtraInfo = ""
for(let i=0;i<response.data.invoiceExtraInfo.length;i++){
result.invoiceExtraInfo+=(response.data.invoiceExtraInfo[i].name+": "+response.data.invoiceExtraInfo[i].value+"\n")
}
Object.keys(response.data.invoiceExtraInfo).forEach( key => {
result.invoiceExtraInfo+=(key+": "+response.data.invoiceExtraInfo[key]+"\n")
});
// for(let i=0;i<response.data.invoiceExtraInfo.length;i++){
// result.invoiceExtraInfo+=(response.data.invoiceExtraInfo[i].name+": "+response.data.invoiceExtraInfo[i].value+"\n")
// }
this.setState({invoiceCommit:result})
this.formRef.current!.setFieldsValue(result);
}).catch(function (error) {
@ -137,15 +141,18 @@ class InvoiceUploadView extends React.Component<any, any>{
submit=()=>{
let result=this.formRef.current!.getFieldsValue()
result.invoiceDate=result.invoiceDate.format("YYYY-MM-DD")
let extraInfo=[]
let line = result.invoiceExtraInfo.split('\n')
for(let i=0;i<line.length;i++){
let tmp = line[i].split(": ")
if(tmp.length===2){
extraInfo.push({name:tmp[0],value:tmp[1]})
}
}
result.invoiceExtraInfo=extraInfo
result.invoiceExtraInfo=new Map(result.invoiceExtraInfo.split("\n").map((entry: string) => entry.split(": ")))
console.log(result.invoiceExtraInfo.split("\n").map((entry: string) => entry.split(": ")))
// let extraInfo=[]
// let line = result.invoiceExtraInfo.split('\n')
// for(let i=0;i<line.length;i++){
// let tmp = line[i].split(": ")
// if(tmp.length===2){
// extraInfo.push({name:tmp[0],value:tmp[1]})
// }
// }
// result.invoiceExtraInfo=extraInfo
console.log(result.invoiceExtraInfo)
axiosInstance({
url: 'common/invoice/submit',
method: 'POST',
@ -228,12 +235,12 @@ class InvoiceUploadView extends React.Component<any, any>{
>
<Input />
</Form.Item>
{/*<Form.Item*/}
{/* name={`invoiceAmountWithoutTax`}*/}
{/* label={`非税金额`}*/}
{/*>*/}
{/* <Input/>*/}
{/*</Form.Item>*/}
<Form.Item
name={`invoiceAmountWithoutTax`}
label={`非税金额`}
>
<Input/>
</Form.Item>
<Form.Item
name={`invoiceDate`}
label={`开票日期`}