Browse Source

refactor: 调整合同附件上传类型

lanjianrong 4 years ago
parent
commit
41dad38233

+ 1 - 1
src/pages/Contract/Content/Income/components/TableContent/index.tsx

@@ -267,7 +267,7 @@ const GCsheet: React.FC<iTableContentPorps> = ({ modalHandler, row, setRow }) =>
   // 阿里oss上传弹窗
   const onShow = (show: boolean) => setVisible(show)
   const onCreate = async (fileList: iFile[]) => {
-    const { code = -1 } = await apiSaveFileInfo(fileList, consts.DATA_TYPE.CONTRACT, row.contractId)
+    const { code = -1 } = await apiSaveFileInfo(fileList, consts.DATA_TYPE.CONTRACT_RETURN, row.contractId)
     if (code === consts.RET_CODE.SUCCESS) {
       setVisible(false)
       contractReturnStore.changeUpdate('3')

+ 1 - 1
src/pages/Contract/Content/Income/components/Tabs/File/index.tsx

@@ -30,7 +30,7 @@ const File:React.FC<{}> = () => {
     }
   }, [ contractReturnStore.contract.id, contractReturnStore.shouldUpdate ])
   const initData = async(pageNo: number = 1, pageSize: number = 7) => {
-    const { code = -1, data = [], total = 0 } = await apiGetFileList(consts.DATA_TYPE.CONTRACT, contractReturnStore.contract.id, pageNo, pageSize)
+    const { code = -1, data = [], total = 0 } = await apiGetFileList(consts.DATA_TYPE.CONTRACT_RETURN, contractReturnStore.contract.id, pageNo, pageSize)
     if (code === consts.RET_CODE.SUCCESS) {
       setData(data)
       setTotal(total)

+ 1 - 1
src/pages/Contract/Content/Spending/components/TableContent/index.tsx

@@ -268,7 +268,7 @@ const GCsheet: React.FC<iTableContentPorps> = ({ modalHandler, row, setRow }) =>
   // 阿里oss上传弹窗
   const onShow = (show: boolean) => setVisible(show)
   const onCreate = async (fileList: iFile[]) => {
-    const { code = -1 } = await apiSaveFileInfo(fileList, consts.DATA_TYPE.CONTRACT, row.contractId)
+    const { code = -1 } = await apiSaveFileInfo(fileList, consts.DATA_TYPE.CONTRACT_PAID, row.contractId)
     if (code === consts.RET_CODE.SUCCESS) {
       setVisible(false)
       contractPaidStore.changeUpdate('3')

+ 1 - 1
src/pages/Contract/Content/Spending/components/Tabs/File/index.tsx

@@ -30,7 +30,7 @@ const File:React.FC<{}> = () => {
     }
   }, [ contractPaidStore.contract.id, contractPaidStore.shouldUpdate ])
   const initData = async(pageNo: number = 1, pageSize: number = 7) => {
-    const { code = -1, data = [], total = 0 } = await apiGetFileList(consts.DATA_TYPE.CONTRACT, contractPaidStore.contract.id, pageNo, pageSize)
+    const { code = -1, data = [], total = 0 } = await apiGetFileList(consts.DATA_TYPE.CONTRACT_PAID, contractPaidStore.contract.id, pageNo, pageSize)
     if (code === consts.RET_CODE.SUCCESS) {
       setData(data)
       setTotal(total)

+ 1 - 1
src/utils/consts.ts

@@ -13,7 +13,7 @@ export default {
   RULE: { SAFE: 'safeRule', QUALITY: 'qualityRule', CONTRACT: 'contractRule' }, // 编号规则弹窗常量
   UPLOAD_WHITE: "(.json|.txt|.xls|.xlsx|.doc|.docx|.pdf|.ppt|.pptx|.png|.jpg|.jpeg|.gif|.bmp|.cad|.dwg|.zip|.rar|.7z)$"  , // 上传类型-白名单
   UPLOAD_LIMIT: 30, // 上传限制30MB
-  DATA_TYPE: { RETURN: 1, QUALITY: 2, SAFE: 3, CONTRACT: 4, PAID: 5 }, // 附件类型
+  DATA_TYPE: { RETURN: 1, QUALITY: 2, SAFE: 3, CONTRACT_RETURN: 4, PAID: 5, CONTRACT_PAID: 6 }, // 附件类型
   PAGE_SIZE: 10, // 默认页数
   OSS_PATH: {
     REVIEW: 'https://file-upload.6jlzf.cn/',