|
|
@@ -1,7 +1,7 @@
|
|
|
import Authorization from '@/components/Authorization'
|
|
|
import { ZhSubmitButton } from '@/components/Button'
|
|
|
import OssUploadModal from '@/components/OssUpload'
|
|
|
-import { contractReturnStore, tenderStore } from '@/store/mobx'
|
|
|
+import { contractStore, tenderStore } from '@/store/mobx'
|
|
|
import { ContractTree, iShowTemplateState, iTemplateState } from '@/types/contract'
|
|
|
import { iFile } from '@/types/file'
|
|
|
import { apiSaveFileInfo } from '@/utils/common/api'
|
|
|
@@ -90,7 +90,7 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
|
|
|
template2: data.sectionTemplate2
|
|
|
})
|
|
|
} else {
|
|
|
- contractReturnStore.updateTree(data.sectionTree.children)
|
|
|
+ contractStore.updateTree(data.sectionTree.children)
|
|
|
}
|
|
|
}
|
|
|
// 初始化时如果id存在说明只是table更新了,那么要将store里面的合同数据也一起更新,防止合同详情不是最新的数据
|
|
|
@@ -103,7 +103,7 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
|
|
|
const handleUpdateContractName = async (payload: object) => {
|
|
|
const { code = -1 } = await apiUpdateContractName(payload)
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
- contractReturnStore.resetTree(type, tenderStore.tender.bidsectionId)
|
|
|
+ contractStore.resetTree(type, tenderStore.tender.bidsectionId)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -232,14 +232,14 @@ 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)
|
|
|
- contractReturnStore.updateContract(newContract)
|
|
|
+ contractStore.updateContract(newContract)
|
|
|
}
|
|
|
}
|
|
|
const handleRowClass = (record: any) => {
|
|
|
return record.id === row.id ? 'ant-table-row-selected editable-row' : ''
|
|
|
}
|
|
|
const tabOnClick = (key: string) => {
|
|
|
- contractReturnStore.changeUpdate(key)
|
|
|
+ contractStore.changeUpdate(key)
|
|
|
}
|
|
|
|
|
|
// 阿里oss上传弹窗
|
|
|
@@ -249,7 +249,7 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
|
|
|
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)
|
|
|
- contractReturnStore.changeUpdate('3')
|
|
|
+ contractStore.changeUpdate('3')
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -347,10 +347,10 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
|
|
|
<div className={styles.spreadContent}>
|
|
|
<div className={styles.spreadSheets}>
|
|
|
{
|
|
|
- contractReturnStore.showTable ?
|
|
|
+ contractStore.showTable ?
|
|
|
<Table
|
|
|
components={components}
|
|
|
- dataSource={contractReturnStore.tree}
|
|
|
+ dataSource={contractStore.tree}
|
|
|
columns={_tableColumns as ColumnTypes}
|
|
|
bordered
|
|
|
pagination={false}
|
|
|
@@ -373,14 +373,14 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
|
|
|
right:
|
|
|
<div className="pi-mg-right-5 pi-flex-row">
|
|
|
{
|
|
|
- contractReturnStore.contract.id && contractReturnStore.contract.status === contractConsts.status.checking ?
|
|
|
+ contractStore.contract.id && contractStore.contract.status === contractConsts.status.checking ?
|
|
|
<>
|
|
|
<Button type="primary" size="small" onClick={() => changeModalType('return')} >添加回款</Button>
|
|
|
</>
|
|
|
: null
|
|
|
}
|
|
|
{
|
|
|
- contractReturnStore.contract.id && contractReturnStore.contract.status !== contractConsts.status.closed ?
|
|
|
+ contractStore.contract.id && contractStore.contract.status !== contractConsts.status.closed ?
|
|
|
<>
|
|
|
<Authorization type="contract" auth="add">
|
|
|
<Button type="primary" size="small" onClick={() => changeModalType('update')} className="pi-mg-left-5">编辑合同</Button>
|
|
|
@@ -390,19 +390,19 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
|
|
|
: null
|
|
|
}
|
|
|
{
|
|
|
- contractReturnStore.contract.id && contractReturnStore.contract.status === contractConsts.status.willClose ?
|
|
|
+ contractStore.contract.id && contractStore.contract.status === contractConsts.status.willClose ?
|
|
|
<Button type="primary" size="small" danger className="pi-mg-left-5" onClick={() => changeModalType('close')}>关闭合同</Button>
|
|
|
: null
|
|
|
}
|
|
|
{
|
|
|
- contractReturnStore.contract.id && contractReturnStore.contract.status === contractConsts.status.closed ?
|
|
|
+ contractStore.contract.id && contractStore.contract.status === contractConsts.status.closed ?
|
|
|
<ZhSubmitButton type="primary" size="small" danger className="pi-mg-left-5" onClick={() => changeModalType('unlock')}>解锁合同</ZhSubmitButton>
|
|
|
: null
|
|
|
}
|
|
|
</div>
|
|
|
}}>
|
|
|
<TabPane key="1" tab="合同详情">
|
|
|
- <Detail {...contractReturnStore.contract} />
|
|
|
+ <Detail {...contractStore.contract} />
|
|
|
</TabPane>
|
|
|
<TabPane key="2" tab="合同回款">
|
|
|
<Receivable updateTreeAndContract={initData} type={type}/>
|