|
@@ -1,8 +1,7 @@
|
|
|
import Authorization from '@/components/Authorization'
|
|
|
import { ZhSubmitButton } from '@/components/Button'
|
|
|
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 { iFile } from '@/types/file'
|
|
|
import { apiSaveFileInfo } from '@/utils/common/api'
|
|
@@ -91,8 +90,7 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
|
|
|
template2: data.sectionTemplate2
|
|
|
})
|
|
|
} else {
|
|
|
- type === 'income' && (contractReturnStore.updateTree(data.sectionTree.children))
|
|
|
- type === 'expenditure' && (contractPaidStore.updateTree(data.sectionTree.children))
|
|
|
+ contractReturnStore.updateTree(data.sectionTree.children)
|
|
|
}
|
|
|
}
|
|
|
// 初始化时如果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)
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
setRow(section)
|
|
|
- type === 'income' && (contractReturnStore.updateContract(newContract))
|
|
|
- type === 'expenditure' && (contractPaidStore.updateContract(newContract))
|
|
|
+ contractReturnStore.updateContract(newContract)
|
|
|
}
|
|
|
}
|
|
|
const handleRowClass = (record: any) => {
|
|
|
return record.id === row.id ? 'ant-table-row-selected editable-row' : ''
|
|
|
}
|
|
|
const tabOnClick = (key: string) => {
|
|
|
- type === 'income' && (contractReturnStore.changeUpdate(key))
|
|
|
- type === 'expenditure' && (contractPaidStore.changeUpdate(key))
|
|
|
+ contractReturnStore.changeUpdate(key)
|
|
|
}
|
|
|
|
|
|
// 阿里oss上传弹窗
|
|
|
const onShow = (show: boolean) => setVisible(show)
|
|
|
+
|
|
|
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) {
|
|
|
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.spreadSheets}>
|
|
|
{
|
|
|
- (type === ContractType.INCOME && contractReturnStore.showTable || type === ContractType.EXPENDITURE && contractPaidStore.showTable) ?
|
|
|
+ contractReturnStore.showTable ?
|
|
|
<Table
|
|
|
components={components}
|
|
|
- dataSource={type === ContractType.INCOME ? contractReturnStore.tree : contractPaidStore.tree}
|
|
|
+ dataSource={contractReturnStore.tree}
|
|
|
columns={_tableColumns as ColumnTypes}
|
|
|
bordered
|
|
|
pagination={false}
|
|
@@ -409,10 +405,10 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
|
|
|
<Detail {...contractReturnStore.contract} />
|
|
|
</TabPane>
|
|
|
<TabPane key="2" tab="合同回款">
|
|
|
- <Receivable updateTreeAndContract={initData}/>
|
|
|
+ <Receivable updateTreeAndContract={initData} type={type}/>
|
|
|
</TabPane>
|
|
|
- <TabPane key="3" tab="合同文件">
|
|
|
- <File />
|
|
|
+ <TabPane key="3" tab="合同文件" >
|
|
|
+ <File type={type}/>
|
|
|
</TabPane>
|
|
|
</Tabs>
|
|
|
</div>
|