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