|  | @@ -4,7 +4,7 @@ import RuleModal from '@/components/RuleModal'
 | 
												
													
														
															|  |  import SvgIcon from '@/components/SvgIcon'
 |  |  import SvgIcon from '@/components/SvgIcon'
 | 
												
													
														
															|  |  import { apiSaveRule } from '@/pages/Safe/Content/List/api'
 |  |  import { apiSaveRule } from '@/pages/Safe/Content/List/api'
 | 
												
													
														
															|  |  import { contractReturnStore, tenderStore } from '@/store/mobx'
 |  |  import { contractReturnStore, tenderStore } from '@/store/mobx'
 | 
												
													
														
															|  | -import { iIncomeTree, iModalBooleanProps } from '@/types/contract'
 |  | 
 | 
												
													
														
															|  | 
 |  | +import { iIncomeTree, iModalProps } from '@/types/contract'
 | 
												
													
														
															|  |  import { contractTreeBaseId } from '@/utils/common/constStatus'
 |  |  import { contractTreeBaseId } from '@/utils/common/constStatus'
 | 
												
													
														
															|  |  import consts from '@/utils/consts'
 |  |  import consts from '@/utils/consts'
 | 
												
													
														
															|  |  import { Button, message, Tooltip } from 'antd'
 |  |  import { Button, message, Tooltip } from 'antd'
 | 
												
											
												
													
														
															|  | @@ -23,10 +23,11 @@ interface iModal {
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  const Income: React.FC<RouteComponentProps> = ({ history }) => {
 |  |  const Income: React.FC<RouteComponentProps> = ({ history }) => {
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -  const [ modalObj, setModalObj ] = useState<iModalBooleanProps>({
 |  | 
 | 
												
													
														
															|  | 
 |  | +  const [ modalObj, setModalObj ] = useState<iModalProps>({
 | 
												
													
														
															|  |      type: '',
 |  |      type: '',
 | 
												
													
														
															|  |      visible: false,
 |  |      visible: false,
 | 
												
													
														
															|  | -    confirmLoading: false
 |  | 
 | 
												
													
														
															|  | 
 |  | +    confirmLoading: false,
 | 
												
													
														
															|  | 
 |  | +    contractType: 'income'
 | 
												
													
														
															|  |    })
 |  |    })
 | 
												
													
														
															|  |    const [ row, setRow ] = useState<iIncomeTree>({
 |  |    const [ row, setRow ] = useState<iIncomeTree>({
 | 
												
													
														
															|  |      elderBrother: false,
 |  |      elderBrother: false,
 | 
												
											
												
													
														
															|  | @@ -64,6 +65,8 @@ const Income: React.FC<RouteComponentProps> = ({ history }) => {
 | 
												
													
														
															|  |      })
 |  |      })
 | 
												
													
														
															|  |      const { code = -1, contract = {} } = await apiResfulContract(type, values)
 |  |      const { code = -1, contract = {} } = await apiResfulContract(type, values)
 | 
												
													
														
															|  |      if (code === consts.RET_CODE.SUCCESS) {
 |  |      if (code === consts.RET_CODE.SUCCESS) {
 | 
												
													
														
															|  | 
 |  | +      console.log(contract)
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |        contractReturnStore.updateContract(contract)
 |  |        contractReturnStore.updateContract(contract)
 | 
												
													
														
															|  |        contractReturnStore.resetTree(tenderStore.bid)
 |  |        contractReturnStore.resetTree(tenderStore.bid)
 | 
												
													
														
															|  |        if (type === 'return') {
 |  |        if (type === 'return') {
 | 
												
											
												
													
														
															|  | @@ -89,7 +92,7 @@ const Income: React.FC<RouteComponentProps> = ({ history }) => {
 | 
												
													
														
															|  |        return contractReturnStore.addRowTree(payload.id)
 |  |        return contractReturnStore.addRowTree(payload.id)
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |      const { code = -1, section = {} } = await apiResfulContractTree(type, payload)
 |  |      const { code = -1, section = {} } = await apiResfulContractTree(type, payload)
 | 
												
													
														
															|  | -    if ( code === consts.RET_CODE.SUCCESS) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +    if (code === consts.RET_CODE.SUCCESS) {
 | 
												
													
														
															|  |        contractReturnStore.resetTree(tenderStore.bid)
 |  |        contractReturnStore.resetTree(tenderStore.bid)
 | 
												
													
														
															|  |        if (type !== 'add' && type !== 'del') {
 |  |        if (type !== 'add' && type !== 'del') {
 | 
												
													
														
															|  |          setRow({ ...row, ...section })
 |  |          setRow({ ...row, ...section })
 | 
												
											
												
													
														
															|  | @@ -124,51 +127,51 @@ const Income: React.FC<RouteComponentProps> = ({ history }) => {
 | 
												
													
														
															|  |            <div className="pi-flex-row">
 |  |            <div className="pi-flex-row">
 | 
												
													
														
															|  |              {
 |  |              {
 | 
												
													
														
															|  |                row.id ?
 |  |                row.id ?
 | 
												
													
														
															|  | -              <>
 |  | 
 | 
												
													
														
															|  | -                <Tooltip title="添加子项">
 |  | 
 | 
												
													
														
															|  | -                  <Button type="text" icon={<SvgIcon type="xxh-plus" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('add', { id: row.id, bidsectionId: row.bidsectionId })} />
 |  | 
 | 
												
													
														
															|  | -                </Tooltip>
 |  | 
 | 
												
													
														
															|  | -                {
 |  | 
 | 
												
													
														
															|  | -                  !row.children?.length ?
 |  | 
 | 
												
													
														
															|  | -                  <Tooltip title="删除">
 |  | 
 | 
												
													
														
															|  | -                    <Button type="text" icon={<SvgIcon type="xxh-times" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('del', { id: row.id, bidsectionId: row.bidsectionId })} />
 |  | 
 | 
												
													
														
															|  | -                  </Tooltip>
 |  | 
 | 
												
													
														
															|  | -                  : <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-times" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
 |  | 
 | 
												
													
														
															|  | -                }
 |  | 
 | 
												
													
														
															|  | -                {
 |  | 
 | 
												
													
														
															|  | -                  row.parentId && row.parentId !== contractTreeBaseId ?
 |  | 
 | 
												
													
														
															|  | -                  <Tooltip title="升级">
 |  | 
 | 
												
													
														
															|  | -                    <Button type="text" icon={<SvgIcon type="xxh-arrow-left" style={{ color: '#007bff', fontSize: 12 }} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsectionId: row.bidsectionId, operation: 'upDepth' })} />} />
 |  | 
 | 
												
													
														
															|  | -                  </Tooltip>
 |  | 
 | 
												
													
														
															|  | -                  :
 |  | 
 | 
												
													
														
															|  | -                  <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-left" style={{ color: '#9a9a9a', fontSize: 12 }}/></span>
 |  | 
 | 
												
													
														
															|  | -                }
 |  | 
 | 
												
													
														
															|  | -                {
 |  | 
 | 
												
													
														
															|  | -                  row.elderBrother ?
 |  | 
 | 
												
													
														
															|  | -                  <Tooltip title="降级">
 |  | 
 | 
												
													
														
															|  | -                    <Button type="text" icon={<SvgIcon type="xxh-arrow-right" style={{ color: '#007bff', fontSize: 12 }}/>} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsectionId: row.bidsectionId, operation: 'downDepth' })}  />
 |  | 
 | 
												
													
														
															|  | -                  </Tooltip>
 |  | 
 | 
												
													
														
															|  | -                  :
 |  | 
 | 
												
													
														
															|  | -                  <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-right" style={{ color: '#9a9a9a', fontSize: 12 }}/></span>
 |  | 
 | 
												
													
														
															|  | -                }
 |  | 
 | 
												
													
														
															|  | -                {
 |  | 
 | 
												
													
														
															|  | -                  row.elderBrother ?
 |  | 
 | 
												
													
														
															|  | -                  <Tooltip title="上移">
 |  | 
 | 
												
													
														
															|  | -                    <Button type="text" icon={<SvgIcon type="xxh-arrow-up" style={{ color: '#007bff', fontSize: 12 }}/>} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsectionId: row.bidsectionId, operation: 'upSerial' })}  disabled={!row.elderBrother} />
 |  | 
 | 
												
													
														
															|  | -                  </Tooltip>
 |  | 
 | 
												
													
														
															|  | -                  :
 |  | 
 | 
												
													
														
															|  | -                  <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-up" style={{ color: '#9a9a9a', fontSize: 12 }}/></span>
 |  | 
 | 
												
													
														
															|  | -                }
 |  | 
 | 
												
													
														
															|  | -                {
 |  | 
 | 
												
													
														
															|  | -                  !row.isEnd ?
 |  | 
 | 
												
													
														
															|  | -                  <Tooltip title="下移">
 |  | 
 | 
												
													
														
															|  | -                    <Button type="text" icon={<SvgIcon type="xxh-arrow-down" style={{ color: '#007bff', fontSize: 12 }}/>} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsectionId: row.bidsectionId, operation: 'downSerial' })} disabled={row.isEnd} />
 |  | 
 | 
												
													
														
															|  | 
 |  | +                <>
 | 
												
													
														
															|  | 
 |  | +                  <Tooltip title="添加子项">
 | 
												
													
														
															|  | 
 |  | +                    <Button type="text" icon={<SvgIcon type="xxh-plus" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('add', { id: row.id, bidsectionId: row.bidsectionId })} />
 | 
												
													
														
															|  |                    </Tooltip>
 |  |                    </Tooltip>
 | 
												
													
														
															|  | -                  :
 |  | 
 | 
												
													
														
															|  | -                  <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-down" style={{ color: '#9a9a9a', fontSize: 12 }}/></span>
 |  | 
 | 
												
													
														
															|  | -                }
 |  | 
 | 
												
													
														
															|  | -              </>
 |  | 
 | 
												
													
														
															|  | -              : ''
 |  | 
 | 
												
													
														
															|  | 
 |  | +                  {
 | 
												
													
														
															|  | 
 |  | +                    !row.children?.length ?
 | 
												
													
														
															|  | 
 |  | +                      <Tooltip title="删除">
 | 
												
													
														
															|  | 
 |  | +                        <Button type="text" icon={<SvgIcon type="xxh-times" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('del', { id: row.id, bidsectionId: row.bidsectionId })} />
 | 
												
													
														
															|  | 
 |  | +                      </Tooltip>
 | 
												
													
														
															|  | 
 |  | +                      : <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-times" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
 | 
												
													
														
															|  | 
 |  | +                  }
 | 
												
													
														
															|  | 
 |  | +                  {
 | 
												
													
														
															|  | 
 |  | +                    row.parentId && row.parentId !== contractTreeBaseId ?
 | 
												
													
														
															|  | 
 |  | +                      <Tooltip title="升级">
 | 
												
													
														
															|  | 
 |  | +                        <Button type="text" icon={<SvgIcon type="xxh-arrow-left" style={{ color: '#007bff', fontSize: 12 }} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsectionId: row.bidsectionId, operation: 'upDepth' })} />} />
 | 
												
													
														
															|  | 
 |  | +                      </Tooltip>
 | 
												
													
														
															|  | 
 |  | +                      :
 | 
												
													
														
															|  | 
 |  | +                      <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-left" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
 | 
												
													
														
															|  | 
 |  | +                  }
 | 
												
													
														
															|  | 
 |  | +                  {
 | 
												
													
														
															|  | 
 |  | +                    row.elderBrother ?
 | 
												
													
														
															|  | 
 |  | +                      <Tooltip title="降级">
 | 
												
													
														
															|  | 
 |  | +                        <Button type="text" icon={<SvgIcon type="xxh-arrow-right" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsectionId: row.bidsectionId, operation: 'downDepth' })} />
 | 
												
													
														
															|  | 
 |  | +                      </Tooltip>
 | 
												
													
														
															|  | 
 |  | +                      :
 | 
												
													
														
															|  | 
 |  | +                      <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-right" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
 | 
												
													
														
															|  | 
 |  | +                  }
 | 
												
													
														
															|  | 
 |  | +                  {
 | 
												
													
														
															|  | 
 |  | +                    row.elderBrother ?
 | 
												
													
														
															|  | 
 |  | +                      <Tooltip title="上移">
 | 
												
													
														
															|  | 
 |  | +                        <Button type="text" icon={<SvgIcon type="xxh-arrow-up" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsectionId: row.bidsectionId, operation: 'upSerial' })} disabled={!row.elderBrother} />
 | 
												
													
														
															|  | 
 |  | +                      </Tooltip>
 | 
												
													
														
															|  | 
 |  | +                      :
 | 
												
													
														
															|  | 
 |  | +                      <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-up" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
 | 
												
													
														
															|  | 
 |  | +                  }
 | 
												
													
														
															|  | 
 |  | +                  {
 | 
												
													
														
															|  | 
 |  | +                    !row.isEnd ?
 | 
												
													
														
															|  | 
 |  | +                      <Tooltip title="下移">
 | 
												
													
														
															|  | 
 |  | +                        <Button type="text" icon={<SvgIcon type="xxh-arrow-down" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsectionId: row.bidsectionId, operation: 'downSerial' })} disabled={row.isEnd} />
 | 
												
													
														
															|  | 
 |  | +                      </Tooltip>
 | 
												
													
														
															|  | 
 |  | +                      :
 | 
												
													
														
															|  | 
 |  | +                      <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-down" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
 | 
												
													
														
															|  | 
 |  | +                  }
 | 
												
													
														
															|  | 
 |  | +                </>
 | 
												
													
														
															|  | 
 |  | +                : ''
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  |            </div>
 |  |            </div>
 | 
												
													
														
															|  |          </Slot>
 |  |          </Slot>
 | 
												
											
												
													
														
															|  | @@ -176,14 +179,14 @@ const Income: React.FC<RouteComponentProps> = ({ history }) => {
 | 
												
													
														
															|  |            <Button type="ghost" size="small" icon={<SvgIcon type="xxh-cog" />} className="pi-mg-right-3" style={{ color: '#007bff' }} onClick={() => setRuleModal({ ...ruleModal, visible: true })}>设置</Button>
 |  |            <Button type="ghost" size="small" icon={<SvgIcon type="xxh-cog" />} className="pi-mg-right-3" style={{ color: '#007bff' }} onClick={() => setRuleModal({ ...ruleModal, visible: true })}>设置</Button>
 | 
												
													
														
															|  |            {
 |  |            {
 | 
												
													
														
															|  |              showCBtn ?
 |  |              showCBtn ?
 | 
												
													
														
															|  | -            <Authorization type="contract" auth="add">
 |  | 
 | 
												
													
														
															|  | -              <Button type="primary" size="small" onClick={() => setModalObj({ ...modalObj, type: 'create', visible: true })}>新建收入合同</Button>
 |  | 
 | 
												
													
														
															|  | -            </Authorization>
 |  | 
 | 
												
													
														
															|  | -            : ""
 |  | 
 | 
												
													
														
															|  | 
 |  | +              <Authorization type="contract" auth="add">
 | 
												
													
														
															|  | 
 |  | +                <Button type="primary" size="small" onClick={() => setModalObj({ ...modalObj, type: 'create', visible: true })}>新建收入合同</Button>
 | 
												
													
														
															|  | 
 |  | +              </Authorization>
 | 
												
													
														
															|  | 
 |  | +              : ""
 | 
												
													
														
															|  |            }
 |  |            }
 | 
												
													
														
															|  |          </Slot>
 |  |          </Slot>
 | 
												
													
														
															|  |        </Header>
 |  |        </Header>
 | 
												
													
														
															|  | -      <TableContent changeModalType={changeModalType} row={row} setRow={(record: iIncomeTree) => setRow({ ...row, ...record })} history={history}/>
 |  | 
 | 
												
													
														
															|  | 
 |  | +      <TableContent changeModalType={changeModalType} row={row} setRow={(record: iIncomeTree) => setRow({ ...row, ...record })} history={history} />
 | 
												
													
														
															|  |        <RuleModal
 |  |        <RuleModal
 | 
												
													
														
															|  |          type={consts.RULE.CONTRACT_RETURN}
 |  |          type={consts.RULE.CONTRACT_RETURN}
 | 
												
													
														
															|  |          title="合同管理编号设置"
 |  |          title="合同管理编号设置"
 | 
												
											
												
													
														
															|  | @@ -191,8 +194,8 @@ const Income: React.FC<RouteComponentProps> = ({ history }) => {
 | 
												
													
														
															|  |          onCreate={onRuleCreate}
 |  |          onCreate={onRuleCreate}
 | 
												
													
														
															|  |          loading={ruleModal.loading}
 |  |          loading={ruleModal.loading}
 | 
												
													
														
															|  |          onCancel={() => setRuleModal({ ...ruleModal, visible: false })}
 |  |          onCancel={() => setRuleModal({ ...ruleModal, visible: false })}
 | 
												
													
														
															|  | -       />
 |  | 
 | 
												
													
														
															|  | -      <ContractModal row={row} modalObj={modalObj} onConfirm={onCreate} onCancel={ () => setModalObj({ ...modalObj, visible: false })} reload={(type) => handleReload(type)} />
 |  | 
 | 
												
													
														
															|  | 
 |  | +      />
 | 
												
													
														
															|  | 
 |  | +      <ContractModal row={row} modalObj={modalObj} onConfirm={onCreate} onCancel={() => setModalObj({ ...modalObj, visible: false })} reload={(type) => handleReload(type)} />
 | 
												
													
														
															|  |      </div>
 |  |      </div>
 | 
												
													
														
															|  |    )
 |  |    )
 | 
												
													
														
															|  |  }
 |  |  }
 |