shaogen1995 2 dagar sedan
förälder
incheckning
2b419e7c5f

+ 2 - 2
src/pages/ZgoodsInfo/data.ts

@@ -10,7 +10,7 @@ export const GIrowArr = [
   {
     key: 'makeDate',
     name: '制档日期',
-    resFu: (info: GoodsType) => dayjs(info.makeDate).format('YYYY-MM-DD') || isNull
+    resFu: (info: GoodsType) => (info.makeDate ? dayjs(info.makeDate).format('YYYY-MM-DD') : isNull)
   },
   { key: 'makeUser', name: '制档人' },
   { key: 'level', name: '藏品级别' },
@@ -52,7 +52,7 @@ export const GIrowArr = [
   {
     key: 'inGoodYear',
     name: '入藏年度',
-    resFu: (info: GoodsType) => dayjs(info.inGoodYear).format('YYYY') || isNull
+    resFu: (info: GoodsType) => (info.inGoodYear ? dayjs(info.inGoodYear).format('YYYY') : isNull)
   },
   { key: 'inGoodYearScope', name: '入藏时间范围' },
   { key: 'source', name: '文物来源' },

+ 117 - 106
src/pages/ZgoodsInfo/index.tsx

@@ -83,118 +83,129 @@ function ZgoodsInfo() {
 
   // 点击的时候校验前置状态和页面权限
   const tabArr2Temp = useMemo(() => {
-    return [
-      {
-        id: 336,
-        name: '档案管理',
-        done: true,
-        show: true,
-        son: [
-          {
-            key: '1',
-            label: '修改',
-            onClick: () => {
-              if (info.isEdit === 1) return MessageFu.warning(`当前藏品为 修改中 状态,不可 修改`)
-              authorityFu(420, '藏品修改', () => setGoodInfo(info))
-            }
-          },
-          {
-            key: '2',
-            label: '注销',
-            onClick: () => {
-              if ([3, 6].includes(info.status)) {
-                authorityFu(430, '藏品注销', () => history.push(`/writeOff_edit/1/null?gId=${id}`))
-              } else {
-                const txtObj = selectObj['藏品入藏状态'].find(v => v.value === info.status)
-                MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '草稿'} 状态,不可 注销`)
+    let arr: any[] = []
+    if ([3, 4, 6, 7].includes(info.status)) {
+      arr = [
+        {
+          id: 336,
+          name: '档案管理',
+          done: true,
+          show: true,
+          son: [
+            {
+              key: '1',
+              label: '修改',
+              onClick: () => {
+                if (info.isEdit === 1) return MessageFu.warning(`当前藏品为 修改中 状态,不可 修改`)
+                authorityFu(420, '藏品修改', () => setGoodInfo(info))
               }
-            }
-          }
-        ]
-      },
-      {
-        id: 337,
-        name: '库房管理',
-        done: true,
-        show: true,
-        son: [
-          {
-            key: '1',
-            label: '入库',
-            onClick: () => {
-              if (!info.siteStatus || info.siteStatus === 1) {
-                authorityFu(1010, '藏品入库', () =>
-                  history.push(`/inStorage_edit/1/null?gId=${id}`)
-                )
-              } else {
-                const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
-                MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '草稿'} 状态,不可 入库`)
+            },
+            {
+              key: '2',
+              label: '注销',
+              onClick: () => {
+                if ([3, 6].includes(info.status)) {
+                  authorityFu(430, '藏品注销', () =>
+                    history.push(`/writeOff_edit/1/null?gId=${id}`)
+                  )
+                } else {
+                  const txtObj = selectObj['藏品入藏状态'].find(v => v.value === info.status)
+                  MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '草稿'} 状态,不可 注销`)
+                }
               }
             }
-          },
-          {
-            key: '2',
-            label: '移库',
-            onClick: () => {
-              if (info.siteStatus === 3) {
-                authorityFu(1020, '藏品移库', () =>
-                  history.push(`/moveStorage_edit/1/null?gId=${id}`)
-                )
-              } else {
-                const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
-                MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '未入库'} 状态,不可 移库`)
+          ]
+        },
+        {
+          id: 337,
+          name: '库房管理',
+          done: true,
+          show: true,
+          son: [
+            {
+              key: '1',
+              label: '入库',
+              onClick: () => {
+                if (!info.siteStatus || info.siteStatus === 1) {
+                  authorityFu(1010, '藏品入库', () =>
+                    history.push(`/inStorage_edit/1/null?gId=${id}`)
+                  )
+                } else {
+                  const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
+                  MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '草稿'} 状态,不可 入库`)
+                }
               }
-            }
-          },
-          {
-            key: '3',
-            label: '出库',
-            onClick: () => {
-              if (info.siteStatus === 3) {
-                authorityFu(1030, '藏品出库', () =>
-                  history.push(`/outStorage_edit/1/null?gId=${id}`)
-                )
-              } else {
-                const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
-                MessageFu.warning(`当前藏品为 ${txtObj ? txtObj.label : '未入库'} 状态,不可 出库`)
+            },
+            {
+              key: '2',
+              label: '移库',
+              onClick: () => {
+                if (info.siteStatus === 3) {
+                  authorityFu(1020, '藏品移库', () =>
+                    history.push(`/moveStorage_edit/1/null?gId=${id}`)
+                  )
+                } else {
+                  const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
+                  MessageFu.warning(
+                    `当前藏品为 ${txtObj ? txtObj.label : '未入库'} 状态,不可 移库`
+                  )
+                }
+              }
+            },
+            {
+              key: '3',
+              label: '出库',
+              onClick: () => {
+                if (info.siteStatus === 3) {
+                  authorityFu(1030, '藏品出库', () =>
+                    history.push(`/outStorage_edit/1/null?gId=${id}`)
+                  )
+                } else {
+                  const txtObj = selectObj['藏品库存状态'].find(v => v.value === info.siteStatus)
+                  MessageFu.warning(
+                    `当前藏品为 ${txtObj ? txtObj.label : '未入库'} 状态,不可 出库`
+                  )
+                }
               }
             }
-          }
-        ]
-      },
-      {
-        id: 338,
-        name: '藏品维护',
-        done: true,
-        show: true,
-        son: [
-          {
-            key: '1',
-            label: '鉴定登记',
-            onClick: () =>
-              authorityFu(230, '藏品鉴定', () => history.push(`/auth_edit/1/null?gId=${id}`))
-          },
-          {
-            key: '2',
-            label: '事故登记',
-            onClick: () =>
-              authorityFu(510, '事故登记', () => history.push(`/accident_edit/1/null?gId=${id}`))
-          },
-          {
-            key: '3',
-            label: '现状登记',
-            onClick: () =>
-              authorityFu(540, '现状登记', () => history.push(`/actuality_edit/1/null?gId=${id}`))
-          },
-          {
-            key: '4',
-            label: '修复登记',
-            onClick: () =>
-              authorityFu(550, '修复登记', () => history.push(`/repair_edit/1/null?gId=${id}`))
-          }
-        ]
-      }
-    ]
+          ]
+        },
+        {
+          id: 338,
+          name: '藏品维护',
+          done: true,
+          show: true,
+          son: [
+            {
+              key: '1',
+              label: '鉴定登记',
+              onClick: () =>
+                authorityFu(230, '藏品鉴定', () => history.push(`/auth_edit/1/null?gId=${id}`))
+            },
+            {
+              key: '2',
+              label: '事故登记',
+              onClick: () =>
+                authorityFu(510, '事故登记', () => history.push(`/accident_edit/1/null?gId=${id}`))
+            },
+            {
+              key: '3',
+              label: '现状登记',
+              onClick: () =>
+                authorityFu(540, '现状登记', () => history.push(`/actuality_edit/1/null?gId=${id}`))
+            },
+            {
+              key: '4',
+              label: '修复登记',
+              onClick: () =>
+                authorityFu(550, '修复登记', () => history.push(`/repair_edit/1/null?gId=${id}`))
+            }
+          ]
+        }
+      ]
+    }
+
+    return arr
   }, [id, info])
 
   const [tabArr1, setTabArr1] = useState<tabArr1Type[]>([])

+ 7 - 1
src/pages/Zother/AddClues/index.tsx

@@ -207,7 +207,13 @@ function AddClues({ closeFu, succFu, moduleId, info, fileUpInfo, isLook }: Props
             <div className='ACfull'>
               <div className='ACfullll'>附件:</div>
               <div className='ACfullrr'>
-                <Z3upFilesRef ref={fileRef} isLook={isLook} moduleId={moduleId} {...fileUpInfo} />
+                <Z3upFilesRef
+                  oneIsCover={true}
+                  ref={fileRef}
+                  isLook={isLook}
+                  moduleId={moduleId}
+                  {...fileUpInfo}
+                />
               </div>
             </div>
 

+ 1 - 0
src/pages/Zother/FileArchive/index.module.scss

@@ -1,6 +1,7 @@
 .FileArchive {
   margin-top: 20px;
   border-top: 1px solid #ccc;
+  padding: 0 15px 15px;
   :global {
     .FAtop {
       padding: 15px;

+ 17 - 11
src/pages/Zother/FileArchive/index.tsx

@@ -15,13 +15,11 @@ import { fileDomInitialFu } from '@/utils/domShow'
 const userInfo = getTokenInfo().user || {}
 
 type Props = {
-  dirCode?: string //文件的code码
-  myUrl?: string //请求地址
   fromData?: any
 }
 
-// 附件归档-待完善sg
-function FileArchive({ dirCode = '', myUrl = '', fromData }: Props) {
+// 附件归档
+function FileArchive({ fromData }: Props) {
   const { info } = useInfo()
 
   const [list, setList] = useState<FileListType[]>([])
@@ -48,10 +46,12 @@ function FileArchive({ dirCode = '', myUrl = '', fromData }: Props) {
         // 创建FormData对象
         const fd = new FormData()
         // 把files添加进FormData对象(‘photo’为后端需要的字段)
-        fd.append('dirCode', dirCode)
-        fd.append('isDb', 'true')
+        fd.append('dirCode', `FileArchive_${info.type}`)
+        fd.append('moduleId', info.id + '')
+        fd.append('moduleName', info.type)
         fd.append('type', 'doc')
-        fd.append('binding', '1')
+        fd.append('isDb', 'true')
+
         fd.append('file', filesInfo)
 
         if (fromData) {
@@ -61,11 +61,11 @@ function FileArchive({ dirCode = '', myUrl = '', fromData }: Props) {
         }
 
         // 开启压缩图片
-        fd.append('isCompress', 'true')
+        // fd.append('isCompress', 'true')
 
         e.target.value = ''
 
-        const res = await API_upFile(fd, myUrl)
+        const res = await API_upFile(fd, 'cms/workVoucher/uploadFiling')
 
         try {
           if (res.code === 0) {
@@ -78,7 +78,7 @@ function FileArchive({ dirCode = '', myUrl = '', fromData }: Props) {
         }
       }
     },
-    [dirCode, fromData, list, myUrl]
+    [info.type, info.id, fromData, list]
   )
 
   // 点击删除
@@ -119,7 +119,13 @@ function FileArchive({ dirCode = '', myUrl = '', fromData }: Props) {
       <div className='FAtop'>
         <div>归档附件</div>
         {userInfo.id === info.creatorId ? (
-          <Button type='primary' onClick={() => myInput.current?.click()}>
+          <Button
+            type='primary'
+            onClick={() => {
+              // MessageFu.warning('开发中')
+              myInput.current?.click()
+            }}
+          >
             上传归档
           </Button>
         ) : (

+ 1 - 0
src/utils/tableData.ts

@@ -30,6 +30,7 @@ export const baseTableC = (val: string) => {
 
 // 藏品征集-订单页面的线索清单
 export const SonClueListTableC = [
+  ['img', '封面', 'thumb'],
   ['txt', '线索名称', 'name'],
   ['txt', '线索编号', 'num'],
   ['text', '线索简介', 'intro', 50],