|  | @@ -1,8 +1,7 @@
 | 
												
													
														
															|  |  import Authorization from '@/components/Authorization'
 |  |  import Authorization from '@/components/Authorization'
 | 
												
													
														
															|  |  import { ZhSubmitButton } from '@/components/Button'
 |  |  import { ZhSubmitButton } from '@/components/Button'
 | 
												
													
														
															|  |  import OssUploadModal from '@/components/OssUpload'
 |  |  import OssUploadModal from '@/components/OssUpload'
 | 
												
													
														
															|  | -import { contractPaidStore, contractReturnStore, tenderStore } from '@/store/mobx'
 |  | 
 | 
												
													
														
															|  | -import { ContractType } from '@/store/mobx/contractReturn'
 |  | 
 | 
												
													
														
															|  | 
 |  | +import {  contractReturnStore, tenderStore } from '@/store/mobx'
 | 
												
													
														
															|  |  import { ContractTree, iShowTemplateState, iTemplateState } from '@/types/contract'
 |  |  import { ContractTree, iShowTemplateState, iTemplateState } from '@/types/contract'
 | 
												
													
														
															|  |  import { iFile } from '@/types/file'
 |  |  import { iFile } from '@/types/file'
 | 
												
													
														
															|  |  import { apiSaveFileInfo } from '@/utils/common/api'
 |  |  import { apiSaveFileInfo } from '@/utils/common/api'
 | 
												
											
												
													
														
															|  | @@ -91,8 +90,7 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
 | 
												
													
														
															|  |            template2: data.sectionTemplate2
 |  |            template2: data.sectionTemplate2
 | 
												
													
														
															|  |          })
 |  |          })
 | 
												
													
														
															|  |        } else {
 |  |        } else {
 | 
												
													
														
															|  | -        type === 'income' && (contractReturnStore.updateTree(data.sectionTree.children))
 |  | 
 | 
												
													
														
															|  | -        type === 'expenditure' && (contractPaidStore.updateTree(data.sectionTree.children))
 |  | 
 | 
												
													
														
															|  | 
 |  | +        contractReturnStore.updateTree(data.sectionTree.children)
 | 
												
													
														
															|  |        }
 |  |        }
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |      // 初始化时如果id存在说明只是table更新了,那么要将store里面的合同数据也一起更新,防止合同详情不是最新的数据
 |  |      // 初始化时如果id存在说明只是table更新了,那么要将store里面的合同数据也一起更新,防止合同详情不是最新的数据
 | 
												
											
												
													
														
															|  | @@ -234,26 +232,24 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
 | 
												
													
														
															|  |      const { code = -1, section = {}, contract: newContract = {} } = await apiGetContractWithDetail(id, bid, type)
 |  |      const { code = -1, section = {}, contract: newContract = {} } = await apiGetContractWithDetail(id, bid, type)
 | 
												
													
														
															|  |      if (code === consts.RET_CODE.SUCCESS) {
 |  |      if (code === consts.RET_CODE.SUCCESS) {
 | 
												
													
														
															|  |        setRow(section)
 |  |        setRow(section)
 | 
												
													
														
															|  | -      type === 'income' && (contractReturnStore.updateContract(newContract))
 |  | 
 | 
												
													
														
															|  | -      type === 'expenditure' && (contractPaidStore.updateContract(newContract))
 |  | 
 | 
												
													
														
															|  | 
 |  | +      contractReturnStore.updateContract(newContract)
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |    }
 |  |    }
 | 
												
													
														
															|  |    const handleRowClass = (record: any) => {
 |  |    const handleRowClass = (record: any) => {
 | 
												
													
														
															|  |      return record.id === row.id ? 'ant-table-row-selected editable-row' : ''
 |  |      return record.id === row.id ? 'ant-table-row-selected editable-row' : ''
 | 
												
													
														
															|  |    }
 |  |    }
 | 
												
													
														
															|  |    const tabOnClick = (key: string) => {
 |  |    const tabOnClick = (key: string) => {
 | 
												
													
														
															|  | -    type === 'income' && (contractReturnStore.changeUpdate(key))
 |  | 
 | 
												
													
														
															|  | -    type === 'expenditure' && (contractPaidStore.changeUpdate(key))
 |  | 
 | 
												
													
														
															|  | 
 |  | +    contractReturnStore.changeUpdate(key)
 | 
												
													
														
															|  |    }
 |  |    }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |    // 阿里oss上传弹窗
 |  |    // 阿里oss上传弹窗
 | 
												
													
														
															|  |    const onShow = (show: boolean) => setVisible(show)
 |  |    const onShow = (show: boolean) => setVisible(show)
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |    const onCreate = async (fileList: iFile[]) => {
 |  |    const onCreate = async (fileList: iFile[]) => {
 | 
												
													
														
															|  | -    const { code = -1 } = await apiSaveFileInfo(fileList, type === 'income' ? 0 : 1, row.contractId)
 |  | 
 | 
												
													
														
															|  | 
 |  | +    const { code = -1 } = await apiSaveFileInfo(fileList, type === 'income' ? consts.DATA_TYPE.CONTRACT_RETURN : consts.DATA_TYPE.CONTRACT_PAID, row.contractId)
 | 
												
													
														
															|  |      if (code === consts.RET_CODE.SUCCESS) {
 |  |      if (code === consts.RET_CODE.SUCCESS) {
 | 
												
													
														
															|  |        setVisible(false)
 |  |        setVisible(false)
 | 
												
													
														
															|  | -      type === 'income' && (contractReturnStore.changeUpdate('3'))
 |  | 
 | 
												
													
														
															|  | -      type === 'expenditure' && (contractPaidStore.changeUpdate('3'))
 |  | 
 | 
												
													
														
															|  | 
 |  | +      contractReturnStore.changeUpdate('3')
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |    }
 |  |    }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -351,10 +347,10 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
 | 
												
													
														
															|  |      <div className={styles.spreadContent}>
 |  |      <div className={styles.spreadContent}>
 | 
												
													
														
															|  |        <div className={styles.spreadSheets}>
 |  |        <div className={styles.spreadSheets}>
 | 
												
													
														
															|  |          {
 |  |          {
 | 
												
													
														
															|  | -          (type === ContractType.INCOME && contractReturnStore.showTable || type === ContractType.EXPENDITURE && contractPaidStore.showTable) ?
 |  | 
 | 
												
													
														
															|  | 
 |  | +          contractReturnStore.showTable ?
 | 
												
													
														
															|  |              <Table
 |  |              <Table
 | 
												
													
														
															|  |                components={components}
 |  |                components={components}
 | 
												
													
														
															|  | -              dataSource={type === ContractType.INCOME ? contractReturnStore.tree : contractPaidStore.tree}
 |  | 
 | 
												
													
														
															|  | 
 |  | +              dataSource={contractReturnStore.tree}
 | 
												
													
														
															|  |                columns={_tableColumns as ColumnTypes}
 |  |                columns={_tableColumns as ColumnTypes}
 | 
												
													
														
															|  |                bordered
 |  |                bordered
 | 
												
													
														
															|  |                pagination={false}
 |  |                pagination={false}
 | 
												
											
												
													
														
															|  | @@ -409,10 +405,10 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
 | 
												
													
														
															|  |              <Detail {...contractReturnStore.contract} />
 |  |              <Detail {...contractReturnStore.contract} />
 | 
												
													
														
															|  |            </TabPane>
 |  |            </TabPane>
 | 
												
													
														
															|  |            <TabPane key="2" tab="合同回款">
 |  |            <TabPane key="2" tab="合同回款">
 | 
												
													
														
															|  | -            <Receivable updateTreeAndContract={initData}/>
 |  | 
 | 
												
													
														
															|  | 
 |  | +            <Receivable updateTreeAndContract={initData} type={type}/>
 | 
												
													
														
															|  |            </TabPane>
 |  |            </TabPane>
 | 
												
													
														
															|  | -          <TabPane key="3" tab="合同文件">
 |  | 
 | 
												
													
														
															|  | -            <File />
 |  | 
 | 
												
													
														
															|  | 
 |  | +          <TabPane key="3" tab="合同文件" >
 | 
												
													
														
															|  | 
 |  | +            <File type={type}/>
 | 
												
													
														
															|  |            </TabPane>
 |  |            </TabPane>
 | 
												
													
														
															|  |          </Tabs>
 |  |          </Tabs>
 | 
												
													
														
															|  |        </div>
 |  |        </div>
 |