瀏覽代碼

藏品登记接口对接了一半

shaogen1995 4 月之前
父節點
當前提交
56a3df50c7
共有 52 個文件被更改,包括 1744 次插入524 次删除
  1. 2 2
      README.md
  2. 25 1
      src/components/MyTable/index.tsx
  3. 5 4
      src/components/YtableVideo/index.tsx
  4. 70 50
      src/components/Z3upFiles/index.tsx
  5. 1 1
      src/components/ZupOne/index.tsx
  6. 3 3
      src/pages/A_workbench/A1dataSta/index.tsx
  7. 16 0
      src/pages/B_enterTibet/B1collect/B1appraisal/index.module.scss
  8. 45 0
      src/pages/B_enterTibet/B1collect/B1appraisal/index.tsx
  9. 44 3
      src/pages/B_enterTibet/B1collect/B1edit/B1MoAdd/index.module.scss
  10. 76 16
      src/pages/B_enterTibet/B1collect/B1edit/B1MoAdd/index.tsx
  11. 51 3
      src/pages/B_enterTibet/B1collect/B1edit/index.tsx
  12. 64 28
      src/pages/B_enterTibet/B3_4page/B3edit/B3aTop/index.tsx
  13. 4 4
      src/pages/B_enterTibet/B3_4page/B3edit/data.ts
  14. 120 22
      src/pages/B_enterTibet/B3_4page/B3edit/main.tsx
  15. 3 0
      src/pages/B_enterTibet/B3_4page/index.module.scss
  16. 35 19
      src/pages/B_enterTibet/B3_4page/index.tsx
  17. 38 2
      src/pages/B_enterTibet/B3_4page/type.d.ts
  18. 50 25
      src/pages/B_enterTibet/B3flowTable/index.tsx
  19. 12 6
      src/pages/B_enterTibet/B3goodsTable/B3GaddNew/data.ts
  20. 10 0
      src/pages/B_enterTibet/B3goodsTable/B3GaddNew/index.module.scss
  21. 326 181
      src/pages/B_enterTibet/B3goodsTable/B3GaddNew/index.tsx
  22. 21 0
      src/pages/B_enterTibet/B3goodsTable/B3GaddNew/type.d.ts
  23. 53 20
      src/pages/B_enterTibet/B3goodsTable/B3GaddNow/index.tsx
  24. 147 15
      src/pages/B_enterTibet/B3goodsTable/index.tsx
  25. 67 0
      src/pages/C_goodsManage/C1ledger/type.d.ts
  26. 17 10
      src/pages/C_goodsManage/C2files/index.tsx
  27. 25 4
      src/pages/C_goodsManage/C6edit/C6add/index.tsx
  28. 0 23
      src/pages/D_storeManage/D1storage/D1goods/data.ts
  29. 3 3
      src/pages/D_storeManage/D1storage/D1goods/index.tsx
  30. 1 1
      src/pages/D_storeManage/D2storSet/data.ts
  31. 3 0
      src/pages/D_storeManage/D2storSet/index.module.scss
  32. 3 2
      src/pages/D_storeManage/D2storSet/index.tsx
  33. 1 1
      src/pages/D_storeManage/D2storSet/type.d.ts
  34. 18 2
      src/pages/D_storeManage/D4impStor/D4edit/index.tsx
  35. 18 2
      src/pages/D_storeManage/D6putsStor/D6edit/index.tsx
  36. 2 2
      src/pages/Layout/data.ts
  37. 10 0
      src/pages/Layout/index.tsx
  38. 3 14
      src/pages/X_stock/X2lookText/index.tsx
  39. 7 4
      src/pages/X_stock/X3auditInfo/index.tsx
  40. 15 9
      src/pages/Y_goodsDetails/Y1cathet/Y33com.tsx
  41. 0 10
      src/pages/Y_goodsDetails/Y1cathet/data.ts
  42. 2 2
      src/pages/Y_goodsDetails/Y2look/Y33setType.tsx
  43. 1 1
      src/pages/Z_system/Z6user/index.tsx
  44. 24 0
      src/store/action/C1ledger.ts
  45. 8 0
      src/store/action/C2files.ts
  46. 131 0
      src/store/action/FourAll.ts
  47. 28 0
      src/store/action/layout.ts
  48. 49 0
      src/store/reducer/FourAll.ts
  49. 2 0
      src/store/reducer/index.ts
  50. 2 2
      src/utils/history.ts
  51. 49 0
      src/utils/select.ts
  52. 34 27
      src/utils/tableData.ts

+ 2 - 2
README.md

@@ -1,10 +1,10 @@
 1.npm 有问题的话试试用 yarn
 
 2.测试堡垒机存放目录
-227/data/data/museum_yiwu_cms_data
+227/data/data/zhejiang_yiwu_storage_data
 
 3.蓝湖地址
-https://lanhuapp.com/web/#/item/project/product?tid=de3e5e3e-a489-4b19-862a-7c87ce113467&pid=a2168b1b-1ece-477c-a597-db484cea40c4&image_id=13b4ac78-2989-488d-b27e-382ef8edb596&docId=13b4ac78-2989-488d-b27e-382ef8edb596&docType=axure&versionId=57474e72-6d0c-4e34-96a0-ba3b390ee4c7&pageId=17aeaf597f6d461e8d02a23cb341f035&parentId=6c25bfdb-a8f7-4462-981a-e8dd72b9a86f
+https://lanhuapp.com/web/#/item/project/product?tid=de3e5e3e-a489-4b19-862a-7c87ce113467&pid=a2168b1b-1ece-477c-a597-db484cea40c4&image_id=13b4ac78-2989-488d-b27e-382ef8edb596&docId=13b4ac78-2989-488d-b27e-382ef8edb596&docType=axure&versionId=5bec0647-4335-4d5e-aa54-b2abfe24edd0&pageId=a1309a44e6e54f1196a6f86919735903&parentId=a20be28114ca4c1590d1711b667adee4
 
 4.测试域名
 https://sit-yiwubwg.4dage.com

+ 25 - 1
src/components/MyTable/index.tsx

@@ -3,6 +3,9 @@ import styles from './index.module.scss'
 import { Table } from 'antd'
 import ImageLazy from '../ImageLazy'
 import classNames from 'classnames'
+import { treeLastIdFindFatherFu } from '@/pages/Z_system/Z6user/data'
+import { useSelector } from 'react-redux'
+import { RootState } from '@/store'
 
 type Props = {
   yHeight?: number //设置表格的高度
@@ -96,6 +99,24 @@ function MyTable({
     [onChange]
   )
 
+  const { dictAll } = useSelector((state: RootState) => state.Z1dict)
+  // 级联回显
+  const resJiLian = useCallback(
+    (idTemp: string) => {
+      if (idTemp) {
+        const idArr = idTemp.split(',')
+        const id = idArr[idArr.length - 1]
+        let arr = treeLastIdFindFatherFu(dictAll, id, 'name')
+
+        if (arr.length >= 3) arr = [arr[2]]
+
+        if (arr && arr.length) return arr.join(' / ')
+        else return isNull
+      } else return isNull
+    },
+    [dictAll, isNull]
+  )
+
   const dataChangeFu = useCallback(
     (v: any) => {
       /**
@@ -114,6 +135,9 @@ function MyTable({
           ) : (
             item[v[2]] || isNull
           ),
+        // 这个模块特有的级联控制
+        txtC: (item: any) =>
+          v[1] === '年代' && item[v[2]] === '其他' ? '其他' : resJiLian(item[v[2]]),
         img: (item: any) =>
           v[3] && !item[v[2]] ? (
             <div dangerouslySetInnerHTML={{ __html: v[3] }}></div>
@@ -152,7 +176,7 @@ function MyTable({
 
       return Reflect.get(obj, v[0])
     },
-    [isNull, pageNum, pageSize, tableComObj]
+    [isNull, pageNum, pageSize, resJiLian, tableComObj]
   )
 
   const columns = useMemo(() => {

+ 5 - 4
src/components/YtableVideo/index.tsx

@@ -2,12 +2,13 @@ import React from 'react'
 import styles from './index.module.scss'
 import store from '@/store'
 import { EyeOutlined } from '@ant-design/icons'
+import { baseURL } from '@/utils/http'
 
 type Props = {
-  item: any
+  src: string
 }
 
-function YtableVideo({ item }: Props) {
+function YtableVideo({ src }: Props) {
   return (
     <div className={styles.YtableVideo}>
       <div className='TvideoBox'>
@@ -16,7 +17,7 @@ function YtableVideo({ item }: Props) {
           onClick={() =>
             store.dispatch({
               type: 'layout/lookDom',
-              payload: { src: item.src, type: 'video', flag: true }
+              payload: { src: baseURL + src, type: 'video', flag: true }
             })
           }
         >
@@ -24,7 +25,7 @@ function YtableVideo({ item }: Props) {
           &nbsp;
           <div>预览</div>
         </div>
-        <video src={item.src}></video>
+        <video src={baseURL + src}></video>
       </div>
     </div>
   )

+ 70 - 50
src/components/Z3upFiles/index.tsx

@@ -1,7 +1,7 @@
 import React, { useCallback, useEffect, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { FileImgListType } from '@/types'
-import { API_upFile } from '@/store/action/layout'
+import { API_upFile, fileTypeRes } from '@/store/action/layout'
 import { MessageFu } from '@/utils/message'
 import { fileDomInitialFu } from '@/utils/domShow'
 import { forwardRef, useImperativeHandle } from 'react'
@@ -10,6 +10,7 @@ import { EyeOutlined, UploadOutlined, CloseOutlined, DownloadOutlined } from '@a
 import classNames from 'classnames'
 import { baseURL } from '@/utils/http'
 import { authFilesLookFu } from './data'
+import { GoodFileType } from '@/pages/B_enterTibet/B3goodsTable/B3GaddNew/type'
 
 type Props = {
   max: number //最多传多少个文件
@@ -22,17 +23,17 @@ type Props = {
   lookData: FileImgListType[] //编辑或者 查看 回显
   accept?: string
   // result:成果 | list:清单
-  type?: string
   tips?: string
   // 文件大小
   size?: number
+  noShowList?: boolean //不回显列表
+  fileRes?: (obj: GoodFileType) => void
 }
 
 function Z3upFiles(
   {
     max,
     isLook,
-    type = 'doc',
     fileCheck,
     dirCode,
     myUrl,
@@ -40,7 +41,9 @@ function Z3upFiles(
     lookData,
     accept = '*',
     tips = '最多支持10个附件;单个附件不得超过500M',
-    size
+    size,
+    noShowList = false,
+    fileRes
   }: Props,
   ref: any
 ) {
@@ -74,9 +77,16 @@ function Z3upFiles(
         // 创建FormData对象
         const fd = new FormData()
         // 把files添加进FormData对象(‘photo’为后端需要的字段)
-        fd.append('type', type)
-        fd.append('dirCode', dirCode)
+
+        const typeRes = fileTypeRes(filesInfo.name)
+
         fd.append('file', filesInfo)
+        fd.append('type', typeRes)
+        fd.append('dirCode', dirCode)
+        fd.append('isDb', 'true')
+
+        // 开启压缩图片
+        fd.append('isCompress', 'true')
 
         if (fromData) {
           for (const k in fromData) {
@@ -91,6 +101,10 @@ function Z3upFiles(
           if (res.code === 0) {
             MessageFu.success('上传成功!')
             setFileList([...fileList, res.data])
+
+            if (fileRes) {
+              fileRes(res.data)
+            }
           }
           fileDomInitialFu()
         } catch (error) {
@@ -98,13 +112,16 @@ function Z3upFiles(
         }
       }
     },
-    [accept, dirCode, fileList, fromData, myUrl, size, type]
+    [accept, dirCode, fileList, fileRes, fromData, myUrl, size]
   )
 
   // 列表删除某一个文件
-  const delImgListFu = useCallback(async (id: number) => {
-    //  待完善 删除
-  }, [])
+  const delImgListFu = useCallback(
+    async (id: number) => {
+      setFileList(fileList.filter(v => v.id !== id))
+    },
+    [fileList]
+  )
 
   // 让父组件调用,拿到 附件信息
   const filesIdRes = useCallback(() => {
@@ -130,53 +147,56 @@ function Z3upFiles(
           <Button
             onClick={() => myInput.current?.click()}
             icon={<UploadOutlined rev={undefined} />}
+            type={noShowList ? 'primary' : 'default'}
           >
             上传
           </Button>
         ) : null}
 
-        <div className='Z3files'>
-          {fileList.map(v => (
-            <div className='Z3filesRow' key={v.id}>
-              <div className='Z3files1' title={v.fileName}>
-                {v.fileName}
-              </div>
-              <div className='Z3files2'>
-                {authFilesLookFu(v.fileName, '') ? (
-                  <>
-                    <EyeOutlined
-                      rev={undefined}
-                      title='查看'
-                      onClick={() => authFilesLookFu(v.fileName, v.filePath)}
-                    />
-                    &emsp;
-                  </>
-                ) : null}
-                <a
-                  title='下载'
-                  href={baseURL + v.filePath}
-                  download={v.fileName}
-                  target='_blank'
-                  rel='noreferrer'
-                >
-                  <DownloadOutlined rev={undefined} />
-                </a>
-                &emsp;
-                <Popconfirm
-                  title='删除后无法恢复,是否删除?'
-                  okText='删除'
-                  cancelText='取消'
-                  onConfirm={() => delImgListFu(v.id)}
-                  okButtonProps={{ loading: false }}
-                >
-                  <CloseOutlined rev={undefined} title='删除' hidden={isLook} />
-                </Popconfirm>
+        {noShowList ? null : (
+          <div className='Z3files'>
+            {fileList.map(v => (
+              <div className='Z3filesRow' key={v.id}>
+                <div className='Z3files1' title={v.fileName}>
+                  {v.fileName}
+                </div>
+                <div className='Z3files2'>
+                  {authFilesLookFu(v.fileName, '') ? (
+                    <>
+                      <EyeOutlined
+                        rev={undefined}
+                        title='查看'
+                        onClick={() => authFilesLookFu(v.fileName, v.filePath)}
+                      />
+                      &emsp;
+                    </>
+                  ) : null}
+                  <a
+                    title='下载'
+                    href={baseURL + v.filePath}
+                    download={v.fileName}
+                    target='_blank'
+                    rel='noreferrer'
+                  >
+                    <DownloadOutlined rev={undefined} />
+                  </a>
+                  &emsp;
+                  <Popconfirm
+                    title='删除后无法恢复,是否删除?'
+                    okText='删除'
+                    cancelText='取消'
+                    onConfirm={() => delImgListFu(v.id)}
+                    okButtonProps={{ loading: false }}
+                  >
+                    <CloseOutlined rev={undefined} title='删除' hidden={isLook} />
+                  </Popconfirm>
+                </div>
               </div>
-            </div>
-          ))}
-        </div>
+            ))}
+          </div>
+        )}
 
-        <div className='fileTit' hidden={isLook}>
+        <div className='fileTit' hidden={isLook || noShowList}>
           {tips}
           <br />
           <div

+ 1 - 1
src/components/ZupOne/index.tsx

@@ -99,7 +99,7 @@ function ZupOne(
         // 把files添加进FormData对象(‘photo’为后端需要的字段)
         let myTypeRes: string = myType
         if (['pdf', 'epub'].includes(myTypeRes)) myTypeRes = 'doc'
-        fd.append('type', myTypeRes)
+        fd.append('type', myTypeRes === 'thumb' ? 'img' : myTypeRes)
         fd.append('dirCode', dirCode)
         fd.append('file', filesInfo)
 

+ 3 - 3
src/pages/A_workbench/A1dataSta/index.tsx

@@ -64,11 +64,11 @@ function A1dataSta() {
     getInfo3()
   }, [getInfo3])
 
-  // 藏品保管 下拉框
+  // 藏品维护 下拉框
   const [value2, setValue2] = useState('30')
 
   const getInfo4 = useCallback(async () => {
-    console.log('藏品保管', value2)
+    console.log('藏品维护', value2)
   }, [value2])
 
   useEffect(() => {
@@ -180,7 +180,7 @@ function A1dataSta() {
         </div>
         <div className='A1box1ll A1box3rr'>
           <div className='A1box1ll1'>
-            <div className='A1tit'>藏品保管</div>
+            <div className='A1tit'>藏品维护</div>
             <A1selectDate value={value2} setValue={val => setValue2(val)} />
           </div>
           <div className='A1box1ll2'>

+ 16 - 0
src/pages/B_enterTibet/B1collect/B1appraisal/index.module.scss

@@ -0,0 +1,16 @@
+.B1appraisal {
+  padding-right: 20px;
+  margin-top: 24px;
+  padding-bottom: 40px;
+  :global {
+    .B3Ftop {
+      color: var(--themeColor);
+      font-size: 18px;
+      font-weight: 700;
+      padding-left: 18px;
+      margin-bottom: 24px;
+      border-bottom: 1px solid #ccc;
+      padding-bottom: 15px;
+    }
+  }
+}

+ 45 - 0
src/pages/B_enterTibet/B1collect/B1appraisal/index.tsx

@@ -0,0 +1,45 @@
+import React, { useMemo } from 'react'
+import styles from './index.module.scss'
+import MyTable from '@/components/MyTable'
+import { B3tableC } from '@/utils/tableData'
+import { Button } from 'antd'
+import { openGoodsInfoFu } from '@/utils/history'
+function B1appraisal() {
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: any) => {
+          return (
+            <Button
+              size='small'
+              type='text'
+              // 待完善 鉴定页面
+              onClick={() => openGoodsInfoFu(0, `/#/identify_edit/4/${item.id}`)}
+            >
+              查看
+            </Button>
+          )
+        }
+      }
+    ]
+  }, [])
+
+  return (
+    <div className={styles.B1appraisal}>
+      <div className='B3Ftop'>相关鉴定</div>
+
+      {/* 表格 */}
+      <MyTable
+        list={[{ id: 99 }]}
+        columnsTemp={B3tableC}
+        lastBtn={tableLastBtn}
+        pagingInfo={false}
+      />
+    </div>
+  )
+}
+
+const MemoB1appraisal = React.memo(B1appraisal)
+
+export default MemoB1appraisal

+ 44 - 3
src/pages/B_enterTibet/B1collect/B1edit/B1MoAdd/index.module.scss

@@ -5,13 +5,20 @@
     }
 
     .ant-modal {
-      width: 1000px !important;
+      width: 1400px !important;
+      min-width: 1400px;
+      top: 40px !important;
+    }
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
     }
 
     .B1Mmain {
-      border-top: 1px solid #999999;
       padding-top: 15px;
-      width: 100%;
+      width: 1200px;
+      height: 753px;
+      overflow-y: auto;
+      padding: 24px;
 
       .B1MformBox {
         display: flex;
@@ -23,12 +30,46 @@
             margin-right: 0;
           }
         }
+
+        .B1Mrow {
+          width: 100%;
+          display: flex;
+          margin-bottom: 20px;
+          .B1Mrowll {
+            width: 98px;
+            text-align: right;
+            position: relative;
+            top: 3px;
+            & > span {
+              color: #ff4b1f;
+            }
+          }
+          .B1Mrowrr {
+            width: calc(100% - 98px);
+            .ant-input-affix-wrapper {
+              width: 300px;
+            }
+            .ant-select {
+              width: 300px;
+            }
+          }
+        }
       }
 
       .ant-form-item-label {
         max-width: 98px;
         min-width: 98px;
       }
+
+      .B1Mbtn {
+        position: absolute;
+        top: 50%;
+        transform: translateY(-50%);
+        right: 52px;
+        .ant-btn {
+          display: block;
+        }
+      }
     }
   }
 }

+ 76 - 16
src/pages/B_enterTibet/B1collect/B1edit/B1MoAdd/index.tsx

@@ -2,15 +2,19 @@ import React, { useCallback, useRef } from 'react'
 import styles from './index.module.scss'
 import { Button, Form, FormInstance, Input, Modal, Select } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
+import TextArea from 'antd/es/input/TextArea'
+import Z3upFiles from '@/components/Z3upFiles'
+import ZRichTexts from '@/components/ZRichTexts'
 
 type Props = {
   sId: number
   info: any
   closeFu: () => void
   succFu: () => void
+  look?: boolean
 }
 
-function B1MoAdd({ sId, info, closeFu, succFu }: Props) {
+function B1MoAdd({ sId, info, closeFu, succFu, look = false }: Props) {
   // 设置表单初始数据(区分编辑和新增)
   const FormBoxRef = useRef<FormInstance>(null)
 
@@ -20,14 +24,27 @@ function B1MoAdd({ sId, info, closeFu, succFu }: Props) {
   }, [])
 
   // 通过校验点击确定
-  const onFinish = useCallback(async (values: any) => {}, [])
+  const onFinish = useCallback(async (values: any) => {
+    // const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+    // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
+  }, [])
+
+  // 上传附件的ref
+  const filesRef = useRef<any>(null)
+  // const filesRes = filesRef.current.filesIdRes();
+
+  // 富文本的ref
+  const ZRichTextRef = useRef<any>(null)
+
+  // 设置富文本
+  //  ZRichTextRef.current?.ritxtShowFu(JSON.parse(data.rtf))
 
   return (
     <Modal
       wrapClassName={styles.B1MoAdd}
       destroyOnClose
       open={true}
-      title={`征集线索-${info.id > 0 ? '编辑' : '新增'}`}
+      title={`征集线索-${look ? '查看' : info.id > 0 ? '编辑' : '新增'}`}
       footer={
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }
@@ -47,25 +64,68 @@ function B1MoAdd({ sId, info, closeFu, succFu }: Props) {
               name='aaaa'
               rules={[{ required: true, message: '请输入线索名称' }]}
             >
-              <Input maxLength={30} showCount placeholder='请输入内容' />
+              <Input readOnly={look} maxLength={30} showCount placeholder='请输入内容' />
             </Form.Item>
 
-            <Form.Item
-              label='线索类别'
-              name='bbbb'
-              rules={[{ required: true, message: '请选择线索类别' }]}
-            >
-              <Select placeholder='请选择' />
+            <Form.Item label='线索类别' name='bbbb'>
+              <Select disabled={look} placeholder='请选择' />
             </Form.Item>
+
+            <Form.Item label='联系人' name='aaaa'>
+              <Input readOnly={look} maxLength={30} showCount placeholder='请输入内容' />
+            </Form.Item>
+            <Form.Item label='联系电话' name='aaaa'>
+              <Input readOnly={look} maxLength={30} showCount placeholder='请输入内容' />
+            </Form.Item>
+            <Form.Item label='联系地址' name='aaaa'>
+              <TextArea readOnly={look} maxLength={500} showCount placeholder='请输入内容' />
+            </Form.Item>
+
+            <div className='B1Mrow'>
+              <div className='B1Mrowll'>附件:</div>
+              <div className='B1Mrowrr'>
+                <Z3upFiles
+                  max={10}
+                  isLook={look}
+                  ref={filesRef}
+                  fileCheck={false}
+                  dirCode={'xxxxxxx'}
+                  myUrl='xxxxxxxxxxxx'
+                  lookData={[]}
+                  size={500}
+                />
+              </div>
+            </div>
+
+            <div className='B1Mrow'>
+              <div className='B1Mrowll'>备注:</div>
+              <div className='B1Mrowrr'>
+                <ZRichTexts
+                  check={false}
+                  dirCode={'xxxxxxxx'}
+                  isLook={look}
+                  ref={ZRichTextRef}
+                  myUrl='xxxxxxxxxx'
+                  isOne={true}
+                  upAudioBtnNone={true}
+                />
+              </div>
+            </div>
           </div>
 
           {/* 确定和取消按钮 */}
-          <Form.Item style={{ textAlign: 'center' }}>
-            <Button type='primary' htmlType='submit'>
-              提交
-            </Button>
-            &emsp;
-            <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+          <Form.Item className='B1Mbtn'>
+            {look ? (
+              <Button onClick={closeFu}>关闭</Button>
+            ) : (
+              <>
+                <Button type='primary' htmlType='submit'>
+                  提交
+                </Button>
+                &emsp;
+                <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+              </>
+            )}
           </Form.Item>
         </Form>
       </div>

+ 51 - 3
src/pages/B_enterTibet/B1collect/B1edit/index.tsx

@@ -14,6 +14,8 @@ import MyTable from '@/components/MyTable'
 import { B1TableC } from '@/utils/tableData'
 import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
 import B1MoAdd from './B1MoAdd'
+import B3flowTable from '../../B3flowTable'
+import B1appraisal from '../B1appraisal'
 function B1edit() {
   const { key, id } = useParams<any>()
 
@@ -73,7 +75,7 @@ function B1edit() {
           return (
             <>
               <Button size='small' type='text' onClick={() => setOpenInfo(item)}>
-                编辑
+                {['3', '4'].includes(key) ? '查看' : '编辑'}
               </Button>
               {['3', '4'].includes(key) ? null : (
                 <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
@@ -131,7 +133,13 @@ function B1edit() {
 
       <div className='B1main'>
         {['3'].includes(key) ? (
-          <X3auditInfo auditSta={auditSta} auditStaFu={val => setAuDitSta(val)} ref={ZAuditRef} />
+          <X3auditInfo
+            dirCode='待完善'
+            myUrl='待完善'
+            auditSta={auditSta}
+            auditStaFu={val => setAuDitSta(val)}
+            ref={ZAuditRef}
+          />
         ) : null}
 
         {/* 表单字段、附件等 */}
@@ -247,12 +255,52 @@ function B1edit() {
           />
         </div>
 
+        {/* 相关鉴定 */}
+        {['3', '4'].includes(key) ? <B1appraisal /> : null}
+
+        {/* 申请流程 */}
+        {['3', '4'].includes(key) ? (
+          <B3flowTable
+            tableArr={
+              [
+                //  待完善
+              ]
+            }
+          />
+        ) : null}
         {/* main-end */}
       </div>
 
+      {/* 底部按钮 */}
+      <div className='B1btn'>
+        {key === '4' ? (
+          lookBtn
+        ) : (
+          <>
+            <Button type='primary' onClick={() => btnClickFu(1)}>
+              {key === '1' ? '创建' : '保存'}
+            </Button>
+
+            {key === '1' ? (
+              <Button type='primary' onClick={() => btnClickFu(2)}>
+                存草稿
+              </Button>
+            ) : null}
+
+            <MyPopconfirm txtK='取消' onConfirm={() => history.push('/collect')} />
+          </>
+        )}
+      </div>
+
       {/* 征集线索 */}
       {openInfo.id ? (
-        <B1MoAdd sId={id} info={openInfo} closeFu={() => setOpenInfo({})} succFu={() => {}} />
+        <B1MoAdd
+          look={['3', '4'].includes(key)}
+          sId={id}
+          info={openInfo}
+          closeFu={() => setOpenInfo({})}
+          succFu={() => {}}
+        />
       ) : null}
     </div>
   )

+ 64 - 28
src/pages/B_enterTibet/B3_4page/B3edit/B3aTop/index.tsx

@@ -1,67 +1,99 @@
-import { useCallback, useRef, useState } from 'react'
+import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, DatePicker, Input } from 'antd'
 import dayjs from 'dayjs'
 import Z3upFiles from '@/components/Z3upFiles'
 import ZRichTexts from '@/components/ZRichTexts'
 import { forwardRef, useImperativeHandle } from 'react'
-import { TypeB3PageSta } from '../../type'
+import { FourTableType, TypeB3PageSta } from '../../type'
 import X3auditInfo from '@/pages/X_stock/X3auditInfo'
 import { B3aForm1 } from '../data'
+import { useParams } from 'react-router-dom'
+import { statusObj } from '@/utils/tableData'
 
 type Props = {
-  info: any
+  info: FourTableType
   pageSta: TypeB3PageSta
   ref: any //当前自己的ref,给父组件调用
   Dom?: React.ReactNode
 }
 
 function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
-  const timeChange = useCallback((e: any) => {
-    console.log(123, e)
-  }, [])
+  const { pageKey } = useParams<any>()
+
+  const [formData, setFormData] = useState({} as FourTableType)
+
+  useEffect(() => {
+    if (info.id) {
+      setFormData(info)
+      // 设置富文本
+      if (info.rtf) ZRichTextRef.current?.ritxtShowFu(JSON.parse(info.rtf))
+    }
+  }, [info])
+
+  const timeChange = useCallback(
+    (e: any) => {
+      setFormData({ ...formData, date: dayjs(e).format('YYYY-MM-DD') })
+    },
+    [formData]
+  )
 
   // 上传附件的ref
   const filesRef = useRef<any>(null)
-  // const filesRes = filesRef.current.filesIdRes();
 
   // 富文本的ref
   const ZRichTextRef = useRef<any>(null)
 
-  // 设置富文本
-  //  ZRichTextRef.current?.ritxtShowFu(JSON.parse(data.rtf))
-  // const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
-  // rtf: JSON.stringify(rtf.val || ''),
-
   // 审批意见的ref
   const ZAuditRef = useRef<any>(null)
 
+  // 审批的sta
+  const [auditSta, setAuDitSta] = useState('')
+
   // 可以让父组件调用子组件的方法
   const resData = useCallback(() => {
     const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
-    console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
+    // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
 
     const rtf2 = ZAuditRef.current?.resData()
-    console.log('审批信息富文本', rtf2)
+    // console.log('审批信息富文本', rtf2)
+
+    // 上传附件的
+    const filesRes = filesRef.current.filesIdRes()
 
-    return { xxx: 'xxxx' }
-  }, [])
+    return { formData, filesRes, rtf1: JSON.stringify(rtf1.val || ''), audit: { rtf2, auditSta } }
+  }, [auditSta, formData])
 
   useImperativeHandle(ref, () => ({
     resData
   }))
 
-  // 审批的sta
-  const [auditSta, setAuDitSta] = useState('')
+  const fileUrl = useMemo(() => {
+    return {
+      1: 'cms/orderHouse/upload',
+      2: 'cms/orderHide/upload',
+      3: 'cms/register/upload',
+      4: 'cms/待完善删除/upload'
+    }[pageKey as '1']
+  }, [pageKey])
 
   return (
     <div className={styles.B3aTop} id='B3aTop'>
       {['审批'].includes(pageSta) ? (
-        <X3auditInfo auditSta={auditSta} auditStaFu={val => setAuDitSta(val)} ref={ZAuditRef} />
+        <X3auditInfo
+          dirCode={`Four${pageKey}`}
+          myUrl={fileUrl}
+          auditSta={auditSta}
+          auditStaFu={val => setAuDitSta(val)}
+          ref={ZAuditRef}
+        />
       ) : null}
 
       <div className='B3aTit'>
-        申请信息{pageSta !== '新增' ? <Button type='dashed'>草稿</Button> : null}
+        申请信息
+        {pageSta !== '新增' ? (
+          <Button type='dashed'>{Reflect.get(statusObj, info.status)}</Button>
+        ) : null}
       </div>
 
       <div className='B3aRow'>
@@ -71,6 +103,8 @@ function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
           </div>
           <div className='B3aRrr'>
             <Input
+              value={formData.name}
+              onChange={e => setFormData({ ...formData, name: e.target.value.trim() })}
               readOnly={['查看', '审批'].includes(pageSta)}
               placeholder='请输入内容'
               maxLength={30}
@@ -86,7 +120,7 @@ function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
             <DatePicker
               disabled={['查看', '审批'].includes(pageSta)}
               allowClear={false}
-              value={dayjs()}
+              value={dayjs(formData.date)}
               onChange={timeChange}
             />
           </div>
@@ -96,9 +130,9 @@ function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
           <div className='B3aR1' key={v.name}>
             <div className='B3aRll'>{v.name}:</div>
             <div className='B3aRrr'>
-              这是一段文本
+              {formData[v.key as 'name']}
               {['查看', '审批'].includes(pageSta) && v.name === '发起人'
-                ? ' - 查看和审批后面显示创建时间'
+                ? ' - ' + info.createTime || ''
                 : ''}
             </div>
           </div>
@@ -112,9 +146,9 @@ function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
               isLook={['查看', '审批'].includes(pageSta)}
               ref={filesRef}
               fileCheck={false}
-              dirCode={'xxxxxxx'}
-              myUrl='xxxxxxxxxxxx'
-              lookData={[]}
+              dirCode={`Four${pageKey}`}
+              myUrl={fileUrl}
+              lookData={info.files || []}
               size={500}
             />
           </div>
@@ -124,6 +158,8 @@ function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
           <div className='B3aRll'>原因事由:</div>
           <div className='B3aRrr'>
             <Input
+              value={formData.reason}
+              onChange={e => setFormData({ ...formData, reason: e.target.value })}
               readOnly={['查看', '审批'].includes(pageSta)}
               placeholder='请输入内容'
               maxLength={30}
@@ -137,10 +173,10 @@ function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
           <div className='B3aRrr'>
             <ZRichTexts
               check={false}
-              dirCode={'xxxxxxxx'}
+              dirCode={`Four${pageKey}`}
+              myUrl={fileUrl}
               isLook={['查看', '审批'].includes(pageSta)}
               ref={ZRichTextRef}
-              myUrl='xxxxxxxxxx'
               isOne={true}
               upAudioBtnNone={true}
             />

+ 4 - 4
src/pages/B_enterTibet/B3_4page/B3edit/data.ts

@@ -1,8 +1,8 @@
 export const B3aForm1 = [
-  { name: '业务名称', key: '' },
-  { name: '发起人', key: '' },
-  { name: '发起部门', key: '' },
-  { name: '业务单号', key: '' }
+  { name: '业务名称', key: 'typeName' },
+  { name: '发起人', key: 'creatorName' },
+  { name: '发起部门', key: 'deptName' },
+  { name: '业务单号', key: 'num' }
 ]
 
 export const B3TiaoObjUrl = {

+ 120 - 22
src/pages/B_enterTibet/B3_4page/B3edit/main.tsx

@@ -1,7 +1,7 @@
-import React, { useCallback, useEffect, useMemo, useRef } from 'react'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { useParams } from 'react-router-dom'
-import { TypeB3PageSta } from '../type'
+import { FourTableType, TypeB3PageSta } from '../type'
 import { Button } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import history from '@/utils/history'
@@ -10,6 +10,14 @@ import B3flowTable from '../../B3flowTable'
 import { B3TiaoObjUrl, B3TitObjKey } from './data'
 import B3aTop from './B3aTop'
 import { MessageFu } from '@/utils/message'
+import {
+  FourAPI_audit,
+  FourAPI_create,
+  FourAPI_getInfo,
+  FourAPI_saveApply,
+  FourAPI_saveCreate,
+  FourAPI_saveDraft
+} from '@/store/action/FourAll'
 
 type Props = {
   pageSta: TypeB3PageSta
@@ -18,11 +26,38 @@ type Props = {
 function B3editMain({ pageSta }: Props) {
   const { key, id, pageKey } = useParams<any>()
 
+  // 顶部数据
+  const [topInfo, setTopInfo] = useState({} as FourTableType)
+
+  // 创建订单
+  const creatFu = useCallback(async () => {
+    const res = await FourAPI_create(pageKey)
+    if (res.code === 0) {
+      setTopInfo(res.data)
+    }
+  }, [pageKey])
+
+  // 获取详情
+  const getInfoFu = useCallback(
+    async (id: number) => {
+      const res = await FourAPI_getInfo(pageKey, id)
+      if (res.code === 0) {
+        setTopInfo(res.data)
+
+        // 设置藏品清单数据
+
+        goodsTableRef.current?.setData(res.data.goods || [])
+      }
+    },
+    [pageKey]
+  )
+
   useEffect(() => {
+    if (key === '1') creatFu()
+    else getInfoFu(Number(id))
     // key 1 2 3 4 新增 编辑 审批 查看
     // pageKey 1 2 3 4 入馆 入藏 登记 删除
-    console.log('待完善', key, id)
-  }, [id, key])
+  }, [creatFu, getInfoFu, id, key])
 
   useEffect(() => {
     // key改变的时候,滚动到顶部  并且更新数据
@@ -38,17 +73,51 @@ function B3editMain({ pageSta }: Props) {
 
   // 新增的按钮点击
   const btnClickFu = useCallback(
-    (val: number) => {
+    async (val: '草稿' | '创建', flag: '当前页' | '编辑页') => {
       // 从顶部组件中拿到数据
       const resData = topRef.current?.resData()
-      console.log('从子组件获取数据', resData)
+      // console.log('从子组件获取数据', resData)
+
+      const obj = {
+        ...resData.formData,
+        fileIds: resData.filesRes.join(','),
+        // goodsIds: null,
+        rtf: resData.rtf1
+      }
+      if (!resData.formData.name) return MessageFu.warning('申请名称不能为空')
 
-      if (val === 2) {
+      if (val === '草稿') {
         // 存草稿 当前页保存 不跳转
-        MessageFu.success('草稿保存成功')
+        const res = await FourAPI_saveDraft(pageKey, obj)
+        if (res.code === 0) {
+          MessageFu.success(flag === '当前页' ? '草稿保存成功' : '添加藏品成功')
+          if (flag === '编辑页') {
+            const url = Reflect.get(B3TiaoObjUrl, pageKey)
+            history.push(`${url}_edit/2/${resData.formData.id}/${pageKey}`)
+          }
+        }
       } else {
+        const res = await FourAPI_saveCreate(pageKey, obj)
+        if (res.code === 0) {
+          MessageFu.success('创建成功')
+          const url = Reflect.get(B3TiaoObjUrl, pageKey)
+          history.push(`${url}_edit/2/${resData.formData.id}/${pageKey}`)
+        }
+      }
+    },
+    [pageKey]
+  )
+
+  // 编辑点击提交
+  const editBtnOk = useCallback(
+    async (obj: any, id: number) => {
+      const res = await FourAPI_saveApply(pageKey, obj)
+
+      if (res.code === 0) {
+        MessageFu.success('操作成功')
+        // 跳详情页
         const url = Reflect.get(B3TiaoObjUrl, pageKey)
-        history.push(`${url}_edit/2/${99}/${pageKey}`)
+        history.push(`${url}_edit/4/${id}/${pageKey}`)
       }
     },
     [pageKey]
@@ -56,15 +125,44 @@ function B3editMain({ pageSta }: Props) {
 
   // 点击保存
   const btnOk = useCallback(async () => {
-    console.log(pageSta, '编辑、审批逻辑判断')
-
     // 从顶部组件中拿到数据
-    const resData1 = topRef.current?.resData()
-    console.log('--顶部数据', resData1)
+    const resData = topRef.current?.resData()
+    // console.log('从子组件获取数据', resData)
+
+    if (!resData.formData.name) return MessageFu.warning('申请名称不能为空')
 
     const resData2 = goodsTableRef.current?.resData()
-    console.log('--藏品清单数据', resData2)
-  }, [pageSta])
+
+    const obj = {
+      ...resData.formData,
+      fileIds: resData.filesRes.join(','),
+      goodsIds: resData2.tableIds,
+      rtf: resData.rtf1
+    }
+    if (pageSta === '审批') {
+      // 审批逻辑
+      // console.log('xxxxx', resData)
+      const auditObj = resData.audit || {}
+
+      if (!auditObj.auditSta) {
+        const dom = document.querySelector('#B3aTop') as HTMLDivElement
+        if (dom) dom.scrollTop = 0
+        return MessageFu.warning('请选择审批结果')
+      }
+
+      const res = await FourAPI_audit(pageKey, {
+        orderId: resData.formData.id,
+        rtfOpinion: auditObj.rtf2,
+        status: auditObj.auditSta === '同意' ? 1 : 2
+      })
+
+      if (res.code === 0) {
+        editBtnOk(obj, resData.formData.id)
+      }
+
+      // 编辑逻辑
+    } else editBtnOk(obj, resData.formData.id)
+  }, [editBtnOk, pageKey, pageSta])
 
   // 点击取消
   const btnX = useCallback(() => {
@@ -120,12 +218,11 @@ function B3editMain({ pageSta }: Props) {
   return (
     <div className={styles.B3editMain}>
       <div className='pageTitle'>
-        {/* 待完善id */}
         藏品{Reflect.get(B3TitObjKey, pageKey)}-{pageSta}
       </div>
 
       <B3aTop
-        info='xx'
+        info={topInfo}
         pageSta={pageSta}
         ref={topRef}
         Dom={
@@ -134,7 +231,9 @@ function B3editMain({ pageSta }: Props) {
             {pageSta === '新增' ? null : <B3goodsTable ref={goodsTableRef} pageSta={pageSta} />}
 
             {/* 申请流程 */}
-            {['查看', '审批'].includes(pageSta) ? <B3flowTable /> : null}
+            {['查看', '审批'].includes(pageSta) ? (
+              <B3flowTable tableArr={topInfo.audits || []} />
+            ) : null}
           </>
         }
       />
@@ -150,14 +249,13 @@ function B3editMain({ pageSta }: Props) {
 
         {pageSta === '新增' ? (
           <>
-            {' '}
-            <Button type='primary' onClick={() => btnClickFu(1)}>
+            <Button type='primary' onClick={() => btnClickFu('草稿', '编辑页')}>
               添加藏品
             </Button>
-            <Button type='primary' onClick={() => btnClickFu(1)}>
+            <Button type='primary' onClick={() => btnClickFu('创建', '编辑页')}>
               创建
             </Button>
-            <Button type='primary' onClick={() => btnClickFu(2)}>
+            <Button type='primary' onClick={() => btnClickFu('草稿', '当前页')}>
               存草稿
             </Button>
           </>

+ 3 - 0
src/pages/B_enterTibet/B3_4page/index.module.scss

@@ -19,6 +19,9 @@
           }
         }
       }
+      .ant-select-selection-placeholder {
+        color: black;
+      }
     }
     .ant-table-cell {
       padding: 8px !important;

+ 35 - 19
src/pages/B_enterTibet/B3_4page/index.tsx

@@ -7,8 +7,14 @@ import MyTable from '@/components/MyTable'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { B3tableC } from '@/utils/tableData'
 import history from '@/utils/history'
+import { useDispatch, useSelector } from 'react-redux'
+import { FourAPI_del, FourAPI_getList, FourKeyType } from '@/store/action/FourAll'
+import { selectObj } from '@/utils/select'
+import { RootState } from '@/store'
+import { MessageFu } from '@/utils/message'
 const { RangePicker } = DatePicker
 
+// 待完善 字段参数名字
 export type D3InputKeyType = 'aaaa' | 'bbbb' | 'cccc' | 'dddd'
 
 const objUrl = {
@@ -44,18 +50,20 @@ export const B3baseFormData: TypeB3Form = {
   dddd: '',
   startTime: '',
   endTime: '',
-  eeee: '',
-  ffff: ''
+  eeee: null,
+  ffff: null
 }
 
 type Props = {
   pageSta: '入馆' | '入藏' | '登记' | '删除'
 }
 
-// 没有接入后端 待完善
-
 function B34page({ pageSta }: Props) {
-  // 角色下拉框 待完善
+  const dispatch = useDispatch()
+
+  const pagekey = useMemo(() => {
+    return Reflect.get(objKey, pageSta) as FourKeyType
+  }, [pageSta])
 
   const [formData, setFormData] = useState(B3baseFormData)
   const formDataRef = useRef(B3baseFormData)
@@ -91,8 +99,11 @@ function B34page({ pageSta }: Props) {
 
   // 封装发送请求的函数
   const getListFu = useCallback(() => {
-    console.log('发送请求', formDataRef.current)
-  }, [])
+    dispatch(FourAPI_getList(formDataRef.current, pagekey))
+  }, [dispatch, pagekey])
+
+  // 从仓库中获取数据
+  const tableObj = useSelector((state: RootState) => state.FourAll.listObj[pagekey])
 
   useEffect(() => {
     getListFu()
@@ -131,9 +142,13 @@ function B34page({ pageSta }: Props) {
   // 点击删除
   const delTableFu = useCallback(
     async (id: number) => {
-      getListFu()
+      const res = await FourAPI_del(pagekey, id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功')
+        getListFu()
+      }
     },
-    [getListFu]
+    [getListFu, pagekey]
   )
 
   // 点击各种操作按钮
@@ -141,11 +156,9 @@ function B34page({ pageSta }: Props) {
     (id: number | string, key: string) => {
       const url = Reflect.get(objUrl, pageSta)
 
-      const pagekey = Reflect.get(objKey, pageSta)
-
       history.push(`${url}_edit/${key}/${id}/${pagekey}`)
     },
-    [pageSta]
+    [pageSta, pagekey]
   )
 
   const tableLastBtn = useMemo(() => {
@@ -192,6 +205,7 @@ function B34page({ pageSta }: Props) {
           ))}
         </div>
         <div className='B3toprr'>
+          {/* 待完善 */}
           <Button type='primary'>批量导出</Button>&emsp;
           <Button type='primary' onClick={() => btnFu('null', '1')}>
             新增
@@ -213,21 +227,23 @@ function B34page({ pageSta }: Props) {
           <div>
             <span>申请状态:</span>
             <Select
-              placeholder='请选择'
+              allowClear={true}
+              placeholder='全部'
               style={{ width: 200 }}
               value={formData.eeee}
               onChange={e => setFormData({ ...formData, eeee: e })}
-              options={[{ value: '', label: '全部' }]}
+              options={selectObj['申请状态'].filter(v => v.label !== '待盘点')}
             />
           </div>
 
           <div>
             <span>选择角色:</span>
             <Select
+              allowClear={true}
               style={{ width: 200 }}
-              placeholder='请选择'
-              options={[]}
-              fieldNames={{ value: 'id', label: 'roleName' }}
+              placeholder='全部'
+              options={selectObj['角色']}
+              // fieldNames={{ value: 'id', label: 'roleName' }}
               value={formData.ffff}
               onChange={e => setFormData({ ...formData, ffff: e })}
             />
@@ -244,12 +260,12 @@ function B34page({ pageSta }: Props) {
       {/* 表格 */}
       <MyTable
         yHeight={610}
-        list={[{ id: 1 }]}
+        list={tableObj.list}
         columnsTemp={B3tableC}
         lastBtn={tableLastBtn}
         pageNum={formData.pageNum}
         pageSize={formData.pageSize}
-        total={0}
+        total={tableObj.total}
         onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
       />
     </div>

+ 38 - 2
src/pages/B_enterTibet/B3_4page/type.d.ts

@@ -7,8 +7,44 @@ export type TypeB3Form = {
   dddd: string
   startTime: string
   endTime: string
-  eeee: string
-  ffff: string
+  eeee: null | string
+  ffff: null | string
 }
 
 export type TypeB3PageSta = '新增' | '编辑' | '查看' | '审批'
+
+// 待完善
+export type FourTableType = {
+  audits: B3flowTableType[]
+  authInfoRtf: string
+  authResultRtf: string
+  authUnit: string
+  authUser: string
+  collectIds: string
+  // collects?: any
+  createTime: string
+  creatorId: number
+  creatorName: string
+  // currentProcessId?: any
+  date: string
+  // dateEnd?: any
+  // dateStart?: any
+  deptName: string
+  fileIds: string
+  files: FileImgListType[]
+  // goods?: any
+  goodsIds: string
+  id: number
+  name: string
+  num: string
+  reason: string
+  relatedOrderNum: string
+  rtf: string
+  sonTypeName: string
+  status: number
+  // storageId?: any
+  // storageRelatedId?: any
+  type: string
+  typeName: string
+  updateTime: string
+}

+ 50 - 25
src/pages/B_enterTibet/B3flowTable/index.tsx

@@ -1,53 +1,78 @@
-import React, { useMemo, useState } from 'react'
+import React, { useCallback, useMemo, useState } from 'react'
 import styles from './index.module.scss'
-import { useParams } from 'react-router-dom'
+// import { useParams } from 'react-router-dom'
 import MyTable from '@/components/MyTable'
 import { Button } from 'antd'
 import { B3FtableC } from '@/utils/tableData'
 import X2lookText from '@/pages/X_stock/X2lookText'
 
-// type Props = {
-//   // 待完善 看看需不需要区分页面(在自己组件里面发请求 还是外面发了传进来)
-//   // pageSta: string
-//   // key:1=入馆 2=入藏 3-登记 4-删除 5-入库 6-出库
-// }
+export type B3flowTableType = {
+  createTime: string
+  creatorId: number
+  creatorName: string
+  id: number
+  isAuto?: any
+  name: string
+  orderId: number
+  rtfOpinion: string
+  status?: any
+  updateTime: string
+}
+type Props = {
+  tableArr: B3flowTableType[]
+}
+
+function B3flowTable({ tableArr }: Props) {
+  // const { key, id } = useParams<any>()
 
-function B3flowTable() {
-  const { key, id } = useParams<any>()
+  const text = useCallback((val: string) => {
+    let TxtRes = ''
+    try {
+      if (val) {
+        let txt = JSON.parse(val)
+
+        if (txt.txtArr && txt.txtArr.length) {
+          let txt2: string = txt.txtArr[0].txt
+          if (txt2) {
+            const txt3 = txt2.replaceAll('<p></p>', '')
+            if (txt3) TxtRes = txt2
+          }
+        }
+      }
+    } catch (error) {}
+
+    return TxtRes
+  }, [])
 
   const tableLastBtn = useMemo(() => {
     return [
       {
         title: '审批意见',
-        render: (item: any) => {
-          return (
-            <Button size='small' type='text' onClick={() => setLook('xxxx')}>
-              查看
-            </Button>
-          )
+        render: (item: B3flowTableType) => {
+          if (text(item.rtfOpinion)) {
+            return (
+              <Button size='small' type='text' onClick={() => setLook(text(item.rtfOpinion))}>
+                查看
+              </Button>
+            )
+          } else return '-'
         }
       }
     ]
-  }, [])
+  }, [text])
 
   //查看富文本信息
   const [look, setLook] = useState('')
 
   return (
     <div className={styles.B3flowTable}>
-      {/* 待完善 参数 */}
-      <div className='B3Ftop'>申请流程{key + id}</div>
+      <div className='B3Ftop'>申请流程</div>
 
       {/* 表格 */}
-      <MyTable
-        list={[{ id: 99 }]}
-        columnsTemp={B3FtableC}
-        lastBtn={tableLastBtn}
-        pagingInfo={false}
-      />
+      <MyTable list={tableArr} columnsTemp={B3FtableC} lastBtn={tableLastBtn} pagingInfo={false} />
 
       {/* 查看富文本 */}
-      {look ? <X2lookText closeFu={() => setLook('')} /> : null}
+      {look ? <X2lookText closeFu={() => setLook('')} text={look} /> : null}
     </div>
   )
 }

+ 12 - 6
src/pages/B_enterTibet/B3goodsTable/B3GaddNew/data.ts

@@ -1,6 +1,12 @@
-export const nweSelect1 = [
-  { value: '一级', label: '一级' },
-  { value: '二级', label: '二级' },
-  { value: '三级', label: '三级' },
-  { value: '未定级', label: '未定级' }
-]
+import { TypeZ1dict } from '@/pages/Z_system/Z1dict/type'
+
+// 级联的第二级数据平铺
+export const cascaderArr = (arr: TypeZ1dict[]) => {
+  let obj: any = {}
+  arr.forEach(v1 => {
+    v1.children?.forEach(v2 => {
+      obj[v2.name] = v2.children
+    })
+  })
+  return obj
+}

+ 10 - 0
src/pages/B_enterTibet/B3goodsTable/B3GaddNew/index.module.scss

@@ -186,6 +186,16 @@
         .B3Nbox1 {
           margin-top: -40px;
           // 相关附件
+          .B3Ntit {
+            width: 500px;
+            // height: 38px;
+            display: flex;
+            .B3Ntitll {
+              width: 100px;
+              position: relative;
+              top: 3px;
+            }
+          }
           .tableImgAuto {
             display: flex;
             justify-content: center;

+ 326 - 181
src/pages/B_enterTibet/B3goodsTable/B3GaddNew/index.tsx

@@ -12,8 +12,6 @@ import {
   Select
 } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
-import { D1GselectNum } from '@/pages/D_storeManage/D1storage/D1goods/data'
-import { nweSelect1 } from './data'
 import TextArea from 'antd/es/input/TextArea'
 import ZupOne from '@/components/ZupOne'
 import ZRichTexts from '@/components/ZRichTexts'
@@ -21,19 +19,100 @@ import MyTable from '@/components/MyTable'
 import { Y33tableC } from '@/utils/tableData'
 import ImageLazy from '@/components/ImageLazy'
 import YtableVideo from '@/components/YtableVideo'
+import { selectObj } from '@/utils/select'
+import dayjs from 'dayjs'
+import { getTokenInfo } from '@/utils/storage'
+import { useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import { cascaderArr } from './data'
+import Z3upFiles from '@/components/Z3upFiles'
+import { GoodFileType } from './type'
+import { baseURL } from '@/utils/http'
+import { fileImgArr, fileVideoArr } from '@/store/action/layout'
+import { API_C2dels } from '@/store/action/C2files'
+import { API_goodsAdd, API_goodsInfo } from '@/store/action/C1ledger'
+import { C1GoodType } from '@/pages/C_goodsManage/C1ledger/type'
+import { MessageFu } from '@/utils/message'
+
+// 级联的数据转换成字符串
+const cascaderChArr = [
+  'dictType',
+  'dictAge',
+  'pcsUnit',
+  'dictTexture1',
+  'dictTexture2',
+  'dictTexture3',
+  'dictTorn',
+  'sizeUnit',
+  'qualityDictScope',
+  'qualityUnit',
+  'inDictDateScope',
+  'source'
+]
 
 type Props = {
   closeFu: () => void
   nowSta: { key: string; id: string }
+  isEdit: boolean
+  succFu: (obj: C1GoodType, type: '新增' | '编辑') => void
 }
 
-function B3GaddNew({ nowSta, closeFu }: Props) {
-  useEffect(() => {
-    FormBoxRef.current?.setFieldsValue({
-      aaaa: '藏品总登记号'
-    })
+function B3GaddNew({ nowSta, closeFu, succFu }: Props) {
+  const { dictAll } = useSelector((state: RootState) => state.Z1dict)
+
+  // 制档日期 / 制档人
+  const [txtArr, setTxtArr] = useState([getTokenInfo().user.realName, dayjs().format('YYYY-MM-DD')])
+
+  // 编辑进来获取详情
+  const getInfo = useCallback(async (id: number) => {
+    const res = await API_goodsInfo(id)
+    if (res.code === 0) {
+      // dateMaking inGoodsDate 2个日期需要格式处理一下
+      const obj = res.data
+      if (obj.dateMaking) obj.dateMaking = dayjs(obj.dateMaking)
+      if (obj.inGoodsDate) obj.inGoodsDate = dayjs(obj.inGoodsDate)
+
+      setTxtArr([obj.creatorName, dayjs(obj.createTime).format('YYYY-MM-DD')])
+
+      cascaderChArr.forEach(v => {
+        if (obj[v]) obj[v] = obj[v].split(',')
+      })
+      FormBoxRef.current?.setFieldsValue(obj)
+
+      // 设置封面图
+      ZupThumbRef.current?.setFileComFileFu({
+        fileName: '',
+        filePath: obj.thumbPc,
+        thumb: obj.thumb
+      })
+
+      // 设置富文本
+      if (obj.rtf) ZRichTextRef.current?.ritxtShowFu(JSON.parse(obj.rtf))
+
+      // 设置附件 待完善 附件类型 和用途
+      setTable(obj.file || [])
+    }
   }, [])
 
+  useEffect(() => {
+    if (nowSta.id !== 'null') {
+      getInfo(Number(nowSta.id))
+    } else {
+      FormBoxRef.current?.setFieldsValue({
+        numName: '藏品总登记号'
+      })
+    }
+  }, [getInfo, nowSta.id])
+
+  // 所有级联的数据平铺
+  const cascaderObj = useMemo(() => {
+    let obj: any = {}
+    if (dictAll && dictAll.length) {
+      obj = cascaderArr(dictAll)
+    }
+    return obj
+  }, [dictAll])
+
   // 设置表单ref
   const FormBoxRef = useRef<FormInstance>(null)
 
@@ -43,24 +122,29 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
   // 封面图的ref
   const ZupThumbRef = useRef<any>(null)
 
-  // 设置封面图
-  //  ZupThumbRef.current?.setFileComFileFu({
-  //   fileName: '',
-  //   filePath: info.thumb
-  // })
-
-  // const coverUrl1 = ZupThumbRef.current?.fileComFileResFu()
-
-  // thumb: coverUrl1.filePath,
-
   // 富文本的ref
   const ZRichTextRef = useRef<any>(null)
 
-  // 设置富文本
-  //  ZRichTextRef.current?.ritxtShowFu(JSON.parse(data.rtf))
-
-  // const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
-  // rtf: JSON.stringify(rtf.val || ''),
+  // 上传附件的ref
+  const filesRef = useRef<any>(null)
+
+  // 附件表格
+  const [table, setTable] = useState<GoodFileType[]>([])
+
+  // 附件删除记录id
+  const fileDelIdArr = useRef<number[]>([])
+
+  const tableFu = useCallback(
+    (key: 'type' | 'effect', id: number, val: any) => {
+      setTable(
+        table.map(v => ({
+          ...v,
+          [key]: id === v.id ? val : v[key]
+        }))
+      )
+    },
+    [table]
+  )
 
   // 相关附件的操作
   const startBtn = useMemo(() => {
@@ -68,13 +152,16 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
       {
         width: 100,
         title: '缩略图/视频',
-        render: (item: any) => {
-          return item.type === '图像' ? (
+        render: (item: GoodFileType) => {
+          const fileNameArr = item.fileName.split('.')
+          const fileNameLast = fileNameArr[fileNameArr.length - 1]
+
+          return fileImgArr.includes(fileNameLast) ? (
             <div className='tableImgAuto'>
-              <ImageLazy width={60} height={60} srcBig={item.src} src={item.src} offline={true} />
+              <ImageLazy width={60} height={60} srcBig={item.filePath} src={item.thumb} />
             </div>
-          ) : item.type === '视频' ? (
-            <YtableVideo item={item} />
+          ) : fileVideoArr.includes(fileNameLast) ? (
+            <YtableVideo src={item.filePath} />
           ) : (
             ' - '
           )
@@ -82,45 +169,58 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
       },
       {
         title: '附件类型',
-        render: (item: any) => <Select style={{ width: 120 }} placeholder='请选择' />
+        render: (item: GoodFileType) => (
+          <Select
+            style={{ width: 120 }}
+            placeholder='请选择'
+            value={item.type}
+            onChange={e => tableFu('type', item.id, e)}
+            options={selectObj['附件类型']}
+            fieldNames={{ label: 'name', value: 'key' }}
+          />
+        )
       },
       {
         title: '附件用途',
-        render: (item: any) => (
+        render: (item: GoodFileType) => (
           <Cascader
-            options={[
-              { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-              { value: '其他', label: '其他' }
-            ]}
-            changeOnSelect
+            options={cascaderObj['附件用途']}
+            value={item.effect ? item.effect.split(',') : []}
+            onChange={e => tableFu('effect', item.id, e.join(','))}
             placeholder='请选择'
-            // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+            fieldNames={{ label: 'name', value: 'id', children: 'children' }}
           />
         )
       }
     ]
-  }, [])
+  }, [cascaderObj, tableFu])
 
   const tableLastBtn = useMemo(() => {
     return [
       {
         width: 120,
         title: '操作',
-        render: (item: any) => {
+        render: (item: GoodFileType) => {
           return (
             <>
               <Button size='small' type='text'>
-                <a href={item.src} download target='_blank' rel='noreferrer'>
+                <a href={baseURL + item.filePath} download target='_blank' rel='noreferrer'>
                   下载
                 </a>
               </Button>
-              <MyPopconfirm txtK='删除' onConfirm={() => {}} />
+              <MyPopconfirm
+                txtK='删除'
+                onConfirm={() => {
+                  setTable(table.filter(v => v.id !== item.id))
+                  fileDelIdArr.current.push(item.id)
+                }}
+              />
             </>
           )
         }
       }
     ]
-  }, [])
+  }, [table])
 
   // 没有通过校验
   const onFinishFailed = useCallback(() => {
@@ -128,13 +228,73 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
   }, [])
 
   // 通过校验点击确定
-  const onFinish = useCallback(async (values: any) => {}, [])
+  const onFinish = useCallback(
+    async (values: any) => {
+      // 删除附件
+      if (fileDelIdArr.current.length) {
+        await API_C2dels(fileDelIdArr.current)
+      }
+
+      // 封面图
+      const coverUrl1 = ZupThumbRef.current?.fileComFileResFu()
+
+      // 富文本
+      const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+
+      // 附件
+      let fileIds = ''
+      let fileSet: any = null
+
+      if (table.length) {
+        fileIds = table.map(v => v.id).join(',')
+
+        fileSet = table.map(v => ({
+          effect: v.effect,
+          id: v.id,
+          type: v.type
+        }))
+      }
+
+      // 2个日期的格式处理
+      let inGoodsDate = ''
+      if (values.inGoodsDate) inGoodsDate = dayjs(values.inGoodsDate).format('YYYY-MM-DD')
+      let dateMaking = ''
+      if (values.dateMaking) dateMaking = dayjs(values.dateMaking).format('YYYY-MM-DD')
+
+      const obj = {
+        ...values,
+        thumb: coverUrl1.thumb,
+        thumbPc: coverUrl1.filePath,
+        rtf: JSON.stringify(rtf.val || ''),
+        fileIds,
+        fileSet,
+        inGoodsDate,
+        dateMaking,
+        id: nowSta.id === 'null' ? null : Number(nowSta.id)
+      }
+
+      // 级联的数据转换成字符串
+      cascaderChArr.forEach(v => {
+        if (values[v]) {
+          obj[v] = values[v].join(',')
+        }
+      })
+
+      const res = await API_goodsAdd(obj, nowSta.id === 'null' ? '新增' : '编辑')
+      if (res.code === 0) {
+        MessageFu.success(nowSta.id === 'null' ? '新增成功' : '编辑成功')
+        succFu(res.data, nowSta.id === 'null' ? '新增' : '编辑')
+        closeFu()
+      }
+    },
+    [closeFu, nowSta.id, succFu, table]
+  )
 
   return (
     <Modal
       wrapClassName={styles.B3GaddNew}
       open={true}
-      title='新增藏品'
+      title={`${nowSta.id !== 'null' ? '编辑' : '新增'}藏品`}
       footer={
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }
@@ -152,32 +312,29 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
 
           <div className='B3Nbox'>
             <div className='B3Nrow B3Nrow0'>
-              <Form.Item label='藏品编号' name='aaaa' rules={[{ required: true, message: '' }]}>
-                <Select
-                  style={{ width: 140 }}
-                  options={D1GselectNum.filter(v => v.label !== '全部')}
-                />
+              <Form.Item label='藏品编号' name='numName' rules={[{ required: true, message: '' }]}>
+                <Select style={{ width: 140 }} options={selectObj['藏品编号类型']} />
               </Form.Item>
 
-              <Form.Item name='prefix' rules={[{ required: true, message: '请输入内容' }]}>
+              <Form.Item name='num' rules={[{ required: true, message: '请输入内容' }]}>
                 <Input maxLength={30} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='分类号' name='bbbb'>
+              <Form.Item label='分类号' name='numType'>
                 <Input maxLength={30} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
 
             <div className='B3Nrow'>
               <div className='B3Nrowll'>制档人:</div>
-              <div className='B3Nrowrr'>这是一段文本</div>
+              <div className='B3Nrowrr'>{txtArr[0]}</div>
             </div>
 
             <div className='B3Nrow'>
               <div className='B3Nrowll'>制档日期:</div>
-              <div className='B3Nrowrr'>2025年3月13日11:25:23</div>
+              <div className='B3Nrowrr'>{txtArr[1]}</div>
             </div>
           </div>
 
@@ -187,40 +344,36 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
             <div className='B3Nrow'>
               <Form.Item
                 label='藏品名称'
-                name='bbbb'
+                name='name'
                 rules={[{ required: true, message: '请输入藏品名称' }]}
               >
                 <Input maxLength={30} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
             <div className='B3Nrow'>
-              <Form.Item label='藏品原名' name='bbbb'>
+              <Form.Item label='藏品原名' name='namePrimitive'>
                 <Input maxLength={30} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
             <div className='B3Nrow'>
               <Form.Item
                 label='文物级别'
-                name='bbbb'
+                name='dictLevel'
                 rules={[{ required: true, message: '请选择文物级别' }]}
               >
-                <Select options={nweSelect1} placeholder='请选择' />
+                <Select options={selectObj['文物级别']} placeholder='请选择' />
               </Form.Item>
             </div>
             <div className='B3Nrow'>
               <Form.Item
                 label='文物类别'
-                name='wwww'
+                name='dictType'
                 rules={[{ required: true, message: '请选择文物类别' }]}
               >
                 <Cascader
-                  options={[
-                    { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-                    { value: '其他', label: '其他' }
-                  ]}
-                  changeOnSelect
+                  options={cascaderObj['文物类别']}
                   placeholder='请选择'
-                  // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                   allowClear={false}
                 />
               </Form.Item>
@@ -228,17 +381,14 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
             <div className='B3Nrow'>
               <Form.Item
                 label='年代'
-                name='age'
+                name='dictAge'
                 rules={[{ required: true, message: '请选择年代' }]}
               >
                 <Cascader
-                  options={[
-                    { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-                    { value: '其他', label: '其他' }
-                  ]}
+                  options={[...cascaderObj['年代'], { name: '其他', id: '其他' }]}
                   onChange={value => setAgeAc(value[0] === '其他')}
                   placeholder='请选择'
-                  // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                   allowClear={false}
                 />
               </Form.Item>
@@ -247,7 +397,7 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
             <div className='B3Nrow'>
               <Form.Item
                 label='具体年代'
-                name='ageTxt'
+                name='ageInfo'
                 rules={[{ required: ageAc, message: '请输入内容' }]}
               >
                 <Input maxLength={30} showCount placeholder='请输入内容' />
@@ -255,18 +405,18 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='制作时间' name='xxxx'>
+              <Form.Item label='制作时间' name='dateMaking'>
                 <DatePicker placeholder='请选择日期' />
               </Form.Item>
               <div className='B3NrowDing'>
-                <Form.Item label='作者' name='bbbb'>
+                <Form.Item label='作者' name='author'>
                   <Input maxLength={30} showCount placeholder='请输入内容' />
                 </Form.Item>
               </div>
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='作者介绍' name='bbbb'>
+              <Form.Item label='作者介绍' name='authorDesc'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
@@ -274,24 +424,23 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
             <div className='B3Nrow B3NrowNumOrCas'>
               <Form.Item
                 label='数量'
-                name='qqqq'
+                name='pcs'
                 rules={[{ required: true, message: '请输入正整数' }]}
               >
-                <InputNumber min={1} precision={0} placeholder='请输入正整数' />
+                <InputNumber min={1} max={99999999} precision={0} placeholder='请输入正整数' />
               </Form.Item>
 
-              <Form.Item name='prefix' rules={[{ required: true, message: '请选择单位' }]}>
+              <Form.Item name='pcsUnit' rules={[{ required: true, message: '请选择单位' }]}>
                 <Cascader
-                  options={[]}
-                  changeOnSelect
-                  placeholder='请选择单位'
-                  // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  options={cascaderObj['数量单位']}
+                  placeholder='请选择'
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                   allowClear={false}
                 />
               </Form.Item>
             </div>
             <div className='B3Nrow'>
-              <Form.Item label='实际数量' name='bbbb'>
+              <Form.Item label='实际数量' name='pcsActual'>
                 <Input maxLength={30} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
@@ -303,38 +452,26 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
                     <span className='B3Nred'> * </span>质地
                   </div>
                 }
-                name='ee0'
+                name='dictTexture1'
               >
                 <Cascader
-                  options={[
-                    { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-                    { value: '其他', label: '其他' }
-                  ]}
-                  changeOnSelect
+                  options={cascaderObj['质地']}
                   placeholder='请选择'
-                  // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                 />
               </Form.Item>
-              <Form.Item name='ee1'>
+              <Form.Item name='dictTexture2'>
                 <Cascader
-                  options={[
-                    { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-                    { value: '其他', label: '其他' }
-                  ]}
-                  changeOnSelect
+                  options={cascaderObj['复合或组合质地']}
                   placeholder='请选择'
-                  // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                 />
               </Form.Item>
-              <Form.Item name='ee2' rules={[{ required: true, message: '请选择质地3' }]}>
+              <Form.Item name='dictTexture3' rules={[{ required: true, message: '请选择质地3' }]}>
                 <Cascader
-                  options={[
-                    { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-                    { value: '其他', label: '其他' }
-                  ]}
-                  changeOnSelect
+                  options={cascaderObj['单一质地']}
                   placeholder='请选择'
-                  // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                   allowClear={false}
                 />
               </Form.Item>
@@ -342,17 +479,13 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
               <div className='B3NrowDing'>
                 <Form.Item
                   label='完残程度'
-                  name='ee3'
+                  name='dictTorn'
                   rules={[{ required: true, message: '请选择完残程度' }]}
                 >
                   <Cascader
-                    options={[
-                      { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-                      { value: '其他', label: '其他' }
-                    ]}
-                    changeOnSelect
+                    options={cascaderObj['完残程度']}
                     placeholder='请选择'
-                    // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                     allowClear={false}
                   />
                 </Form.Item>
@@ -368,8 +501,8 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
                   isLook={false}
                   fileCheck={false}
                   size={5}
-                  dirCode={'xxxxx'}
-                  myUrl='xxxxxxx'
+                  dirCode='goodsAdd'
+                  myUrl='cms/goods/upload'
                   format={['image/jpeg', 'image/png']}
                   formatTxt='png、jpg和jpeg'
                   checkTxt='请上传封面图!'
@@ -380,43 +513,43 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='完残情况' name='bbbb'>
+              <Form.Item label='完残情况' name='torn'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='保存状态' name='bbbb'>
+              <Form.Item label='保存状态' name='preserveState'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='色泽' name='bbbb'>
+              <Form.Item label='色泽' name='color'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='用途' name='bbbb'>
+              <Form.Item label='用途' name='uses'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='形状描述' name='bbbb'>
+              <Form.Item label='形状描述' name='shape'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
 
             <div className='B3Nrow B3Nrow2'>
-              <Form.Item label='著者' name='bbbb'>
+              <Form.Item label='著者' name='pressAuthor'>
                 <Input maxLength={30} showCount placeholder='请输入内容' />
               </Form.Item>
-              <Form.Item label='版本' name='bbbb'>
+              <Form.Item label='版本' name='pressVersion'>
                 <Input maxLength={30} showCount placeholder='请输入内容' />
               </Form.Item>
-              <Form.Item label='存卷' name='bbbb'>
+              <Form.Item label='存卷' name='pressFile'>
                 <Input maxLength={30} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
@@ -427,10 +560,10 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
               <div className='formRight'>
                 <ZRichTexts
                   check={false}
-                  dirCode={'xxxxxxxx'}
+                  dirCode='goodsAdd'
+                  myUrl='cms/goods/upload'
                   isLook={false}
                   ref={ZRichTextRef}
-                  myUrl='xxxxxxxxxx'
                   isOne={true}
                   upAudioBtnNone={true}
                 />
@@ -441,27 +574,24 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
           {/* =====上传附件==== */}
           <div className='B3Nbox B3Nbox1'>
             <div className='B3Ntit'>
-              相关附件 &emsp;<Button type='primary'>上传附件</Button>
+              <div className='B3Ntitll'>相关附件</div>
+              <Z3upFiles
+                max={1000}
+                isLook={false}
+                ref={filesRef}
+                fileCheck={false}
+                dirCode='goodsAdd'
+                myUrl='cms/goods/upload'
+                lookData={[]}
+                size={500}
+                noShowList={true}
+                fileRes={obj => setTable([obj, ...table])}
+              />
             </div>
 
             {/* 表格 */}
             <MyTable
-              list={[
-                {
-                  id: 1,
-                  type: '图像',
-                  src: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/touxiang.jpg'
-                },
-                {
-                  id: 2,
-                  type: '视频',
-                  src: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/loop.mp4'
-                },
-                {
-                  id: 3,
-                  type: '3D'
-                }
-              ]}
+              list={table}
               columnsTemp={Y33tableC('新增')}
               lastBtn={tableLastBtn}
               startBtn={startBtn}
@@ -475,26 +605,37 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
             <div className='formRow formRow2'>
               <div className='formLeft'>尺寸:</div>
               <div className='formRight formRightSize'>
-                <Form.Item label='通长' name='qqqq'>
-                  <InputNumber min={0} precision={2} placeholder='请输入数字,最多两位小数' />
+                <Form.Item label='通长' name='sizeL'>
+                  <InputNumber
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder='请输入数字,最多两位小数'
+                  />
                 </Form.Item>
 
-                <Form.Item label='通宽' name='qqqq'>
-                  <InputNumber min={0} precision={2} placeholder='请输入数字,最多两位小数' />
+                <Form.Item label='通宽' name='sizeW'>
+                  <InputNumber
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder='请输入数字,最多两位小数'
+                  />
                 </Form.Item>
-                <Form.Item label='通高' name='qqqq'>
-                  <InputNumber min={0} precision={2} placeholder='请输入数字,最多两位小数' />
+                <Form.Item label='通高' name='sizeH'>
+                  <InputNumber
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder='请输入数字,最多两位小数'
+                  />
                 </Form.Item>
 
-                <Form.Item name='eee9'>
+                <Form.Item name='sizeUnit'>
                   <Cascader
-                    options={[
-                      { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-                      { value: '其他', label: '其他' }
-                    ]}
-                    changeOnSelect
-                    placeholder='请选择单位'
-                    // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    options={cascaderObj['尺寸单位']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                   />
                 </Form.Item>
               </div>
@@ -503,33 +644,39 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
             <div className='B3Nrow'>
               <Form.Item
                 label='质量范围'
-                name='bbbb'
+                name='qualityDictScope'
                 rules={[{ required: true, message: '请选择质量范围' }]}
               >
-                <Select placeholder='请选择' />
+                <Cascader
+                  options={cascaderObj['质量范围']}
+                  placeholder='请选择'
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  allowClear={false}
+                />
               </Form.Item>
 
               <div className='B3NrowDing B3NrowDing2'>
-                <Form.Item label='具体质量' name='qqqq'>
-                  <InputNumber min={0} precision={2} placeholder='请输入数字,最多两位小数' />
+                <Form.Item label='具体质量' name='quality'>
+                  <InputNumber
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder='请输入数字,最多两位小数'
+                  />
                 </Form.Item>
 
-                <Form.Item name='prefix'>
+                <Form.Item name='qualityUnit'>
                   <Cascader
-                    options={[
-                      { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-                      { value: '其他', label: '其他' }
-                    ]}
-                    changeOnSelect
-                    placeholder='请选择单位'
-                    // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    options={cascaderObj['质量单位']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                   />
                 </Form.Item>
               </div>
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='具体尺寸' name='bbbb'>
+              <Form.Item label='具体尺寸' name='sizeInfo'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
@@ -539,18 +686,18 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
 
           <div className='B3Nbox'>
             <div className='B3Nrow'>
-              <Form.Item label='入馆凭证号' name='bbbb'>
+              <Form.Item label='入馆凭证号' name='inHouseNum'>
                 <Input maxLength={30} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
             <div className='B3Nrow'>
-              <Form.Item label='入藏凭证号' name='bbbb'>
+              <Form.Item label='入藏凭证号' name='inGoodsNum'>
                 <Input maxLength={30} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='入藏日期' name='bbbb'>
+              <Form.Item label='入藏日期' name='inGoodsDate'>
                 <DatePicker placeholder='请选择日期' />
               </Form.Item>
             </div>
@@ -559,14 +706,13 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
               <Form.Item
                 label='入藏日期范围'
                 className='B3NlongTxt'
-                name='bbbb'
+                name='inDictDateScope'
                 rules={[{ required: true, message: '请选择入藏日期范围' }]}
               >
                 <Cascader
-                  changeOnSelect
-                  options={[]}
+                  options={cascaderObj['入藏日期范围']}
                   placeholder='请选择'
-                  // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                   allowClear={false}
                 />
               </Form.Item>
@@ -575,37 +721,36 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
             <div className='B3Nrow formRow2'>
               <Form.Item
                 label='来源'
-                name='bbbb'
+                name='source'
                 rules={[{ required: true, message: '请选择来源' }]}
               >
                 <Cascader
-                  changeOnSelect
-                  options={[]}
+                  options={cascaderObj['来源']}
                   placeholder='请选择'
-                  // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                   allowClear={false}
                 />
               </Form.Item>
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='来源详情' name='bbbb'>
+              <Form.Item label='来源详情' name='sourceInfo'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
 
             <div className='B3Nrow'>
-              <Form.Item label='征集经过' name='bbbb'>
+              <Form.Item label='征集经过' name='sourcePass'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
             <div className='B3Nrow'>
-              <Form.Item label='铭记题跋' name='bbbb'>
+              <Form.Item label='铭记题跋' name='sourcePreface'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
             <div className='B3Nrow'>
-              <Form.Item label='鉴藏印记' name='bbbb'>
+              <Form.Item label='鉴藏印记' name='sourceStamp'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
@@ -615,12 +760,12 @@ function B3GaddNew({ nowSta, closeFu }: Props) {
 
           <div className='B3Nbox'>
             <div className='B3Nrow'>
-              <Form.Item label='著作及有关书目' className='B3NlongTxt2' name='bbbb'>
+              <Form.Item label='著作及有关书目' className='B3NlongTxt2' name='historyWork'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>
             <div className='B3Nrow'>
-              <Form.Item label='流传经历' name='yyyy'>
+              <Form.Item label='流传经历' name='historyUndergo'>
                 <TextArea maxLength={500} showCount placeholder='请输入内容' />
               </Form.Item>
             </div>

+ 21 - 0
src/pages/B_enterTibet/B3goodsTable/B3GaddNew/type.d.ts

@@ -0,0 +1,21 @@
+export type GoodFileType = {
+  createTime: string
+  creatorId: number
+  creatorName: string
+  description: string
+  display?: any
+  effect: string | null
+  fileName: string
+  filePath: string
+  fileSize: string
+  goodName: string
+  goodNum: string
+  goodNumName: string
+  id: number
+  moduleId?: any
+  moduleName: string
+  parentId?: any
+  thumb: string
+  type: string
+  updateTime: string
+}

+ 53 - 20
src/pages/B_enterTibet/B3goodsTable/B3GaddNow/index.tsx

@@ -1,4 +1,4 @@
-import React, { useCallback, useMemo, useState } from 'react'
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, Checkbox, Input, Modal, Select } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
@@ -6,29 +6,62 @@ import MyTable from '@/components/MyTable'
 import { B3eTableC } from '@/utils/tableData'
 import { openGoodsInfoFu } from '@/utils/history'
 import { MessageFu } from '@/utils/message'
+import { C1GoodType } from '@/pages/C_goodsManage/C1ledger/type'
+import { API_goodsNowAdd } from '@/store/action/C1ledger'
 
 type Props = {
   closeFu: () => void
   nowSta: { key: string; id: string }
   // key:1=入馆 2=入藏 3-登记 4-删除 5-入库 6-出库 7-藏品编辑
-  dataResFu: (data: any) => void //待完善类型type
+  dataResFu: (data: C1GoodType[]) => void
   isOne?: boolean //从藏品编辑进来 只能选择一个藏品
+  oldCheckArr: C1GoodType[]
 }
 
-function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu }: Props) {
-  // 待完善 根据key值不同 来设置不同的下拉框数据
+function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu, oldCheckArr }: Props) {
+  // 待完善 根据key值不同 来设置不同的下拉框数据,待完善筛选条件
+
+  const [tableList, setTableList] = useState<C1GoodType[]>([])
+
+  const getList = useCallback(async (url: string, data: any) => {
+    const res = await API_goodsNowAdd(url, data)
+    if (res.code === 0) {
+      setTableList(res.data)
+    }
+  }, [])
+
+  useEffect(() => {
+    getList(nowSta.id, {})
+  }, [getList, nowSta.id])
 
   // 多选
-  const [checkArr, setCheckArr] = useState<number[]>([])
+  const [checkArr, setCheckArr] = useState<C1GoodType[]>([])
+
+  // 显示条数的
+  // const [checkNum, setCheckNum] = useState<C1GoodType[]>([])
+
+  // 旧数组
+  useEffect(() => {
+    setCheckArr(oldCheckArr)
+  }, [oldCheckArr])
+
+  // 过滤掉 tableList 里面没有的id
+  const resNum = useMemo(() => {
+    const tableIds = tableList.map(v => v.id)
+    const arr = checkArr.filter(v => tableIds.includes(v.id))
+    return arr.length
+  }, [checkArr, tableList])
 
   const checkFu = useCallback(
-    (id: number) => {
+    (item: C1GoodType) => {
       // 藏品编辑只能单选
       if (isOne) {
-        setCheckArr([id])
+        // setCheckNum([item])
+        setCheckArr([item])
       } else {
-        if (checkArr.includes(id)) setCheckArr(checkArr.filter(v => v !== id))
-        else setCheckArr([...checkArr, id])
+        if (checkArr.map(v => v.id).includes(item.id))
+          setCheckArr(checkArr.filter(v => v.id !== item.id))
+        else setCheckArr([...checkArr, item])
       }
     },
     [checkArr, isOne]
@@ -39,13 +72,16 @@ function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu }: Props) {
       {
         title: isOne ? '单选' : '选择',
         width: 50,
-        render: (item: any) => (
-          <Checkbox checked={checkArr.includes(item.id)} onChange={() => checkFu(item.id)} />
+        render: (item: C1GoodType) => (
+          <Checkbox
+            checked={checkArr.map(v => v.id).includes(item.id)}
+            onChange={() => checkFu(item)}
+          />
         )
       },
       {
         title: '藏品编号',
-        render: (item: any) => item.num || '(空)'
+        render: (item: C1GoodType) => item.num || '(空)'
       }
     ]
   }, [checkArr, checkFu, isOne])
@@ -78,7 +114,7 @@ function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu }: Props) {
       open={true}
       title={
         <div className='B3Gtit'>
-          <div>选择藏品 key:{nowSta.key}</div> <div>已选中 {checkArr.length} 条</div>{' '}
+          <div>选择藏品</div> <div>已选中 {resNum} 条</div>
         </div>
       }
       footer={
@@ -152,14 +188,11 @@ function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu }: Props) {
         <MyTable
           yHeight={575}
           classKey='B3GaddNow'
-          list={[
-            { id: 99, thumb: '' },
-            { id: 98, thumb: '' }
-          ]}
+          list={tableList}
           columnsTemp={[
             ...B3eTableC,
-            ['txt', '入藏状态', 'description'],
-            ['txt', '库存状态', 'description']
+            ['txt', '入藏状态', 'statusCollect'],
+            ['txt', '库存状态', 'statusStorage']
           ]}
           startBtn={startBtn}
           lastBtn={tableLastBtn}
@@ -167,7 +200,7 @@ function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu }: Props) {
         />
 
         <div className='B3GaMainBtn'>
-          <Button type='primary' disabled={checkArr.length === 0} onClick={btnOk}>
+          <Button type='primary' disabled={resNum === 0 && isOne} onClick={btnOk}>
             提交
           </Button>
           &emsp;

File diff suppressed because it is too large
+ 147 - 15
src/pages/B_enterTibet/B3goodsTable/index.tsx


+ 67 - 0
src/pages/C_goodsManage/C1ledger/type.d.ts

@@ -31,3 +31,70 @@ export interface TYpeC1Form2 {
   tttt: string
   uuuu: string
 }
+
+export type C1GoodType = {
+  display: 0 | 1
+  ageInfo: string
+  author: string
+  authorDesc: string
+  color: string
+  createTime: string
+  creatorId: number
+  creatorName: string
+  dateMaking: string
+  dictAge: string
+  dictLevel: string
+  dictTexture1: string
+  dictTexture2: string
+  dictTexture3: string
+  dictTorn: string
+  dictType: string
+  // display?: any;
+  fileIds: string
+  historyUndergo: string
+  historyWork: string
+  id: number
+  inDictDateScope: string
+  inGoodsDate: string
+  inGoodsNum: string
+  inHouseNum: string
+  // isEdit?: any;
+  name: string
+  namePrimitive: string
+  num: string
+  numName: string
+  numType: string
+  pcs: number
+  pcsActual: string
+  pcsUnit: string
+  preserveState: string
+  pressAuthor: string
+  pressFile: string
+  pressVersion: string
+  quality: string
+  qualityDictScope: string
+  qualityUnit: string
+  // regionId?: any;
+  rtf: string
+  shape: string
+  siteStr: string
+  sizeH: string
+  sizeInfo: string
+  sizeL: string
+  sizeUnit: string
+  sizeW: string
+  source: string
+  sourceInfo: string
+  sourcePass: string
+  sourcePreface: string
+  sourceStamp: string
+  // statusCollect?: any;
+  // statusStorage?: any;
+  // tempRegionId?: any;
+  tempSiteStr: string
+  thumb: string
+  thumbPc: string
+  torn: string
+  updateTime: string
+  uses: string
+}

+ 17 - 10
src/pages/C_goodsManage/C2files/index.tsx

@@ -1,6 +1,5 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
-import { Y33BtnArr } from '@/pages/Y_goodsDetails/Y1cathet/data'
 import { Button, Cascader, Checkbox, DatePicker, Input, Select } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import Y33setType from '@/pages/Y_goodsDetails/Y2look/Y33setType'
@@ -11,6 +10,9 @@ import MyTable from '@/components/MyTable'
 import ImageLazy from '@/components/ImageLazy'
 import YtableVideo from '@/components/YtableVideo'
 import { C2tableC } from '@/utils/tableData'
+import { GoodFileType } from '@/pages/B_enterTibet/B3goodsTable/B3GaddNew/type'
+import { selectObj } from '@/utils/select'
+import { fileImgArr, fileVideoArr } from '@/store/action/layout'
 const { RangePicker } = DatePicker
 
 function C2files() {
@@ -114,14 +116,18 @@ function C2files() {
 
     if (['全部', '图像', '视频'].includes(btnAc))
       arr.push({
+        width: 100,
         title: '缩略图/视频',
-        render: (item: any) => {
-          return item.type === '图像' ? (
+        render: (item: GoodFileType) => {
+          const fileNameArr = item.fileName.split('.')
+          const fileNameLast = fileNameArr[fileNameArr.length - 1]
+
+          return fileImgArr.includes(fileNameLast) ? (
             <div className='tableImgAuto'>
-              <ImageLazy width={60} height={60} srcBig={item.src} src={item.src} offline={true} />
+              <ImageLazy width={60} height={60} srcBig={item.filePath} src={item.thumb} />
             </div>
-          ) : item.type === '视频' ? (
-            <YtableVideo item={item} />
+          ) : fileVideoArr.includes(fileNameLast) ? (
+            <YtableVideo src={item.filePath} />
           ) : (
             ' - '
           )
@@ -174,7 +180,7 @@ function C2files() {
       {/* 第一行 */}
       <div className='C2top'>
         <div className='C2topll'>
-          {Y33BtnArr.map(v => (
+          {[{ name: '全部', key: '' }, ...selectObj['附件类型']].map(v => (
             <Button
               key={v.name}
               onClick={() => setBtnAc(v.name)}
@@ -260,16 +266,17 @@ function C2files() {
           {
             id: 1,
             type: '图像',
-            src: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/touxiang.jpg'
+            fileName: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/touxiang.jpg'
           },
           {
             id: 2,
             type: '视频',
-            src: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/loop.mp4'
+            fileName: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/loop.mp4'
           },
           {
             id: 3,
-            type: '3D'
+            type: '3D',
+            fileName: 'xxxx'
           }
         ]}
         columnsTemp={C2tableC}

+ 25 - 4
src/pages/C_goodsManage/C6edit/C6add/index.tsx

@@ -236,7 +236,13 @@ function C6add() {
 
       <div className='C6main' ref={sollrDom}>
         {['3'].includes(key) ? (
-          <X3auditInfo auditSta={auditSta} auditStaFu={val => setAuDitSta(val)} ref={ZAuditRef} />
+          <X3auditInfo
+            dirCode='待完善'
+            myUrl='待完善'
+            auditSta={auditSta}
+            auditStaFu={val => setAuDitSta(val)}
+            ref={ZAuditRef}
+          />
         ) : null}
 
         {/* 表单字段、附件等 */}
@@ -405,7 +411,15 @@ function C6add() {
         </div>
 
         {/* 申请流程 */}
-        {['3', '4'].includes(key) ? <B3flowTable /> : null}
+        {['3', '4'].includes(key) ? (
+          <B3flowTable
+            tableArr={
+              [
+                //  待完善
+              ]
+            }
+          />
+        ) : null}
       </div>
 
       {/* 底部按钮 */}
@@ -446,14 +460,21 @@ function C6add() {
                 setNowSta({ key: '7', id: '77', type: 'new' })
               }, 20)
             }}
+            // 待完善
+            oldCheckArr={[]}
           />
         ) : (
-          <B3GaddNew nowSta={nowSta} closeFu={() => setNowSta({ key: '', id: '', type: '' })} />
+          <B3GaddNew
+            nowSta={nowSta}
+            closeFu={() => setNowSta({ key: '', id: '', type: '' })}
+            isEdit={true}
+            succFu={obj => {}}
+          />
         )
       ) : null}
 
       {/* 查看富文本 */}
-      {look ? <X2lookText closeFu={() => setLook('')} /> : null}
+      {look ? <X2lookText closeFu={() => setLook('')} text='待完善' /> : null}
     </div>
   )
 }

+ 0 - 23
src/pages/D_storeManage/D1storage/D1goods/data.ts

@@ -1,23 +0,0 @@
-// 编号类型
-export const D1GselectNum = [
-  { value: '', label: '全部' },
-  { value: '藏品总登记号', label: '藏品总登记号' },
-  { value: '辅助账号', label: '辅助账号' },
-  { value: '索书号', label: '索书号' },
-  { value: '档案编号', label: '档案编号' },
-  { value: '固定资产登记号', label: '固定资产登记号' },
-  { value: '财产登记号', label: '财产登记号' },
-  { value: '出土(水)登记号', label: '出土(水)登记号' },
-  { value: '其他编号', label: '其他编号' }
-]
-
-// 库存状态(待完善)
-export const D1GselectSta = [
-  { value: '', label: '全部' },
-  { value: 1, label: '待入库' },
-  { value: 2, label: '已入库' },
-  { value: 3, label: '待出库' },
-  { value: 4, label: '已出库' },
-  { value: 5, label: '盘点中' },
-  { value: 6, label: '注销中' }
-]

+ 3 - 3
src/pages/D_storeManage/D1storage/D1goods/index.tsx

@@ -1,13 +1,13 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, Input, Select } from 'antd'
-import { D1GselectNum, D1GselectSta } from './data'
 import { TypeD1Gform } from './type'
 import MyTable from '@/components/MyTable'
 import { D1GtableC } from '@/utils/tableData'
 import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
 import { openGoodsInfoFu } from '@/utils/history'
 import classNames from 'classnames'
+import { selectObj } from '@/utils/select'
 
 const baseFormData: TypeD1Gform = {
   pageSize: 10,
@@ -127,7 +127,7 @@ function D1goods({ lookData }: Props) {
         <div className='D1GtRow'>
           <span className='D1GtRowTxt'>编号类型:</span>
           <Select
-            options={D1GselectNum}
+            options={selectObj['藏品编号类型']}
             style={{ width: 160 }}
             value={formData.aaaa}
             onChange={e => setFormData({ ...formData, aaaa: e })}
@@ -157,7 +157,7 @@ function D1goods({ lookData }: Props) {
         <div className='D1GtRow'>
           <span className='D1GtRowTxt'>库存状态:</span>
           <Select
-            options={D1GselectSta}
+            options={selectObj['库存状态']}
             style={{ width: 160 }}
             value={formData.dddd}
             onChange={e => setFormData({ ...formData, dddd: e })}

+ 1 - 1
src/pages/D_storeManage/D2storSet/data.ts

@@ -1,5 +1,5 @@
 export const D2select = [
-  { value: '', label: '全部' },
+  // { value: '', label: '全部' },
   { value: 1, label: '启用' },
   { value: 0, label: '禁用' }
 ]

+ 3 - 0
src/pages/D_storeManage/D2storSet/index.module.scss

@@ -17,6 +17,9 @@
           width: 100px;
         }
       }
+      .ant-select-selection-placeholder {
+        color: black;
+      }
     }
     .D2tableBox {
       border-radius: 10px;

+ 3 - 2
src/pages/D_storeManage/D2storSet/index.tsx

@@ -20,7 +20,7 @@ const formDataTemp: TypeD2form = {
   num: '',
   managerUser: '',
   description: '',
-  enable: ''
+  enable: null
 }
 
 function D2storSet() {
@@ -164,7 +164,8 @@ function D2storSet() {
           />
           <span>仓库状态:</span>
           <Select
-            placeholder='仓库状态'
+            allowClear={true}
+            placeholder='全部'
             options={D2select}
             value={formData.enable}
             onChange={e => setFormData({ ...formData, pageNum: 1, enable: e })}

+ 1 - 1
src/pages/D_storeManage/D2storSet/type.d.ts

@@ -39,5 +39,5 @@ export type TypeD2form = {
   num: string
   managerUser: string
   description: string
-  enable: '' | 0 | 1
+  enable: null | 0 | 1
 }

+ 18 - 2
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -186,7 +186,13 @@ function D4edit() {
 
       <div className='D4main' ref={sollrDom}>
         {['3'].includes(key) ? (
-          <X3auditInfo auditSta={auditSta} auditStaFu={val => setAuDitSta(val)} ref={ZAuditRef} />
+          <X3auditInfo
+            dirCode='待完善'
+            myUrl='待完善'
+            auditSta={auditSta}
+            auditStaFu={val => setAuDitSta(val)}
+            ref={ZAuditRef}
+          />
         ) : null}
 
         {/* 表单字段、附件等 */}
@@ -353,7 +359,15 @@ function D4edit() {
         </div>
 
         {/* 申请流程 */}
-        {['3', '4'].includes(key) ? <B3flowTable /> : null}
+        {['3', '4'].includes(key) ? (
+          <B3flowTable
+            tableArr={
+              [
+                //  待完善
+              ]
+            }
+          />
+        ) : null}
       </div>
 
       {/* 底部按钮 */}
@@ -385,6 +399,8 @@ function D4edit() {
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}
           dataResFu={data => {}}
+          // 待完善
+          oldCheckArr={[]}
         />
       ) : null}
 

+ 18 - 2
src/pages/D_storeManage/D6putsStor/D6edit/index.tsx

@@ -208,7 +208,13 @@ function D6edit() {
 
       <div className='D6main' ref={sollrDom}>
         {['3'].includes(key) ? (
-          <X3auditInfo auditSta={auditSta} auditStaFu={val => setAuDitSta(val)} ref={ZAuditRef} />
+          <X3auditInfo
+            dirCode='待完善'
+            myUrl='待完善'
+            auditSta={auditSta}
+            auditStaFu={val => setAuDitSta(val)}
+            ref={ZAuditRef}
+          />
         ) : null}
 
         {/* 表单字段、附件等 */}
@@ -407,7 +413,15 @@ function D6edit() {
         ) : null}
 
         {/* 申请流程 */}
-        {['3', '4'].includes(key) ? <B3flowTable /> : null}
+        {['3', '4'].includes(key) ? (
+          <B3flowTable
+            tableArr={
+              [
+                //  待完善
+              ]
+            }
+          />
+        ) : null}
       </div>
 
       {/* 底部按钮 */}
@@ -439,6 +453,8 @@ function D6edit() {
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}
           dataResFu={data => {}}
+          // 待完善
+          oldCheckArr={[]}
         />
       ) : null}
     </div>

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

@@ -32,7 +32,7 @@ const tabLeftArr: RouterType = [
     son: [
       {
         id: 210,
-        name: '藏品征集111',
+        name: '藏品征集',
         path: '/collect',
         Com: React.lazy(() => import('../B_enterTibet/B1collect'))
       },
@@ -166,7 +166,7 @@ const tabLeftArr: RouterType = [
   },
   // {
   //   id: 5,
-  //   name: '藏品保管',
+  //   name: '藏品维护',
   //   son: [
   //     {
   //       id: 510,

+ 10 - 0
src/pages/Layout/index.tsx

@@ -19,8 +19,18 @@ import { RouterType, RouterTypeRow } from '@/types'
 import tabLeftArr, { routerSon } from './data'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { TypeZ5Role } from '../Z_system/Z5role/type'
+import { useDispatch } from 'react-redux'
+import { Z1_APIgetDict } from '@/store/action/Z1dict'
 
 function Layout() {
+  const dispatch = useDispatch()
+
+  // 很多地方会用到的下拉框 或者级联数据
+  useEffect(() => {
+    // 获取全部级联数据
+    dispatch(Z1_APIgetDict())
+  }, [dispatch])
+
   // 当前路径选中的左侧菜单
   const location = useLocation()
   const [path, setPath] = useState('')

+ 3 - 14
src/pages/X_stock/X2lookText/index.tsx

@@ -4,9 +4,10 @@ import { Button, Modal } from 'antd'
 
 type Props = {
   closeFu: () => void
+  text: string
 }
 
-function X2lookText({ closeFu }: Props) {
+function X2lookText({ closeFu, text }: Props) {
   return (
     <Modal
       wrapClassName={styles.X2lookText}
@@ -17,19 +18,7 @@ function X2lookText({ closeFu }: Props) {
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }
     >
-      <div className='YtMain'>
-        <h1>不同意</h1>
-        <h1>xxxxxx</h1>
-        <h1>xxxxxx</h1>
-        <h1>xxxxxx</h1>
-        <h1>xxxxxx</h1>
-        <h1>xxxxxx</h1>
-        <h1>xxxxxx</h1>
-        <h1>xxxxxx</h1>
-        <h1>xxxxxx</h1>
-        <h1>xxxxxx</h1>
-        <h1>xxxxxx</h1>
-      </div>
+      <div className='YtMain' dangerouslySetInnerHTML={{ __html: text }}></div>
 
       <div className='YtBtn'>
         <Button onClick={closeFu}>关闭</Button>

+ 7 - 4
src/pages/X_stock/X3auditInfo/index.tsx

@@ -8,9 +8,11 @@ type Props = {
   auditSta: string
   auditStaFu: (val: string) => void
   ref: any
+  dirCode: string
+  myUrl: string
 }
 
-function X3auditInfo({ auditSta, auditStaFu }: Props, ref: any) {
+function X3auditInfo({ auditSta, auditStaFu, dirCode, myUrl }: Props, ref: any) {
   // 富文本的ref
   const TextRef = useRef<any>(null)
 
@@ -29,7 +31,8 @@ function X3auditInfo({ auditSta, auditStaFu }: Props, ref: any) {
   return (
     <div className={styles.X3auditInfo}>
       <div className='x3Top'>
-        审批信息<Button type='dashed'>待审批</Button>
+        审批信息
+        {/* <Button type='dashed'>待审批</Button> */}
       </div>
 
       <div className='X3Main'>
@@ -54,10 +57,10 @@ function X3auditInfo({ auditSta, auditStaFu }: Props, ref: any) {
           <div className='x3Rowrr'>
             <ZRichTexts
               check={false}
-              dirCode={'xxxxxxxx'}
+              dirCode={dirCode}
               isLook={false}
               ref={TextRef}
-              myUrl='xxxxxxxxxx'
+              myUrl={myUrl}
               isOne={true}
               upAudioBtnNone={true}
             />

+ 15 - 9
src/pages/Y_goodsDetails/Y1cathet/Y33com.tsx

@@ -1,5 +1,4 @@
 import React, { useCallback, useMemo, useState } from 'react'
-import { Y33BtnArr } from './data'
 import { Button, Checkbox } from 'antd'
 import MyTable from '@/components/MyTable'
 import { Y33tableC } from '@/utils/tableData'
@@ -7,6 +6,9 @@ import ImageLazy from '@/components/ImageLazy'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import Y33setType from '../Y2look/Y33setType'
 import YtableVideo from '@/components/YtableVideo'
+import { GoodFileType } from '@/pages/B_enterTibet/B3goodsTable/B3GaddNew/type'
+import { selectObj } from '@/utils/select'
+import { fileImgArr, fileVideoArr } from '@/store/action/layout'
 
 type Props = {
   isLook?: boolean
@@ -40,14 +42,18 @@ function Y33com({ isLook }: Props) {
 
     if (['全部', '图像', '视频'].includes(btnAc))
       arr.push({
+        width: 100,
         title: '缩略图/视频',
-        render: (item: any) => {
-          return item.type === '图像' ? (
+        render: (item: GoodFileType) => {
+          const fileNameArr = item.fileName.split('.')
+          const fileNameLast = fileNameArr[fileNameArr.length - 1]
+
+          return fileImgArr.includes(fileNameLast) ? (
             <div className='tableImgAuto'>
-              <ImageLazy width={60} height={60} srcBig={item.src} src={item.src} offline={true} />
+              <ImageLazy width={60} height={60} srcBig={item.filePath} src={item.thumb} />
             </div>
-          ) : item.type === '视频' ? (
-            <YtableVideo item={item} />
+          ) : fileVideoArr.includes(fileNameLast) ? (
+            <YtableVideo src={item.filePath} />
           ) : (
             ' - '
           )
@@ -101,7 +107,7 @@ function Y33com({ isLook }: Props) {
     <div className='Y33com'>
       <div className='Y33top'>
         <div className='Y33topll'>
-          {Y33BtnArr.map(v => (
+          {[{ name: '全部', key: '' }, ...selectObj['附件类型']].map(v => (
             <Button
               key={v.name}
               onClick={() => setBtnAc(v.name)}
@@ -143,12 +149,12 @@ function Y33com({ isLook }: Props) {
           {
             id: 1,
             type: '图像',
-            src: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/touxiang.jpg'
+            fileName: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/touxiang.jpg'
           },
           {
             id: 2,
             type: '视频',
-            src: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/loop.mp4'
+            fileName: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/loop.mp4'
           },
           {
             id: 3,

+ 0 - 10
src/pages/Y_goodsDetails/Y1cathet/data.ts

@@ -53,13 +53,3 @@ export const Y11infoArr5 = [
   { name: '著作及有关书目', key: '' },
   { name: '流传经历', key: '' }
 ]
-
-export const Y33BtnArr = [
-  { name: '全部', key: '1' },
-  { name: '图像', key: '2' },
-  { name: '3D', key: '3' },
-  { name: '音频', key: '4' },
-  { name: '视频', key: '5' },
-  { name: '文档', key: '6' },
-  { name: '其他', key: '7' }
-]

+ 2 - 2
src/pages/Y_goodsDetails/Y2look/Y33setType.tsx

@@ -1,9 +1,9 @@
 import React, { useCallback, useEffect, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, Cascader, Form, FormInstance, Modal, Select } from 'antd'
-import { Y33BtnArr } from '../Y1cathet/data'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { TypeZ1dict } from '@/pages/Z_system/Z1dict/type'
+import { selectObj } from '@/utils/select'
 
 type Props = {
   info: any
@@ -61,7 +61,7 @@ function Y33setType({ info, closeFu }: Props) {
         >
           <Form.Item label='类型' name='aaaa' rules={[{ required: true, message: '请输入类型!' }]}>
             <Select
-              options={Y33BtnArr.filter(v => v.name !== '全部')}
+              options={selectObj['附件类型']}
               fieldNames={{ label: 'name', value: 'key' }}
               placeholder='请选择'
             />

+ 1 - 1
src/pages/Z_system/Z6user/index.tsx

@@ -195,7 +195,7 @@ function Z6user() {
             &emsp;&emsp;
             <span>选择部门:</span>
             <Cascader
-              allowClear={false}
+              // allowClear={false}
               changeOnSelect
               style={{ width: 240 }}
               options={treeData}

+ 24 - 0
src/store/action/C1ledger.ts

@@ -0,0 +1,24 @@
+import http from '@/utils/http'
+
+/**
+ * 藏品-新增 /编辑
+ */
+export const API_goodsAdd = (data: any, type: '新增' | '编辑') => {
+  const url = type === '新增' ? 'cms/goods/add' : 'cms/goods/edit'
+
+  return http.post(url, data)
+}
+
+/**
+ * 藏品-获取详情
+ */
+export const API_goodsInfo = (id: number) => {
+  return http.get(`cms/goods/detail/${id}`)
+}
+
+/**
+ * 从已存在的藏品中添加
+ */
+export const API_goodsNowAdd = (url: string, data: any) => {
+  return http.post(url, data)
+}

+ 8 - 0
src/store/action/C2files.ts

@@ -0,0 +1,8 @@
+import http from '@/utils/http'
+
+/**
+ * 删除附件
+ */
+export const API_C2dels = (ids: number[]) => {
+  return http.post('cms/goodsFile/removes', ids)
+}

+ 131 - 0
src/store/action/FourAll.ts

@@ -0,0 +1,131 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+
+// 入馆 入藏 登记 删除
+export type FourKeyType = '1' | '2' | '3' | '4'
+
+/**
+ * 获取分页列表
+ */
+export const FourAPI_getList = (data: any, key: FourKeyType, exportFlag?: boolean): any => {
+  const urlObj = {
+    1: 'cms/orderHouse/page',
+    2: 'cms/orderHide/page',
+    3: 'cms/register/page',
+    4: 'cms/待完善删除/page'
+  }
+  const url = urlObj[key]
+
+  if (exportFlag) return http.post(url, data)
+  else {
+    return async (dispatch: AppDispatch) => {
+      const res = await http.post(url, data)
+      if (res.code === 0) {
+        const obj = {
+          list: res.data.records,
+          total: res.data.total
+        }
+
+        dispatch({ type: 'Four/getList', payload: { key, value: obj } })
+      }
+    }
+  }
+}
+
+/**
+ * 创建订单
+ */
+export const FourAPI_create = (key: FourKeyType) => {
+  const urlObj = {
+    1: 'cms/orderHouse/create',
+    2: 'cms/orderHide/create',
+    3: 'cms/register/create',
+    4: 'cms/待完善删除/create'
+  }
+  const url = urlObj[key]
+  return http.get(url)
+}
+
+/**
+ * 详情
+ */
+export const FourAPI_getInfo = (key: FourKeyType, id: number) => {
+  const urlObj = {
+    1: `cms/orderHouse/detail/${id}`,
+    2: `cms/orderHide/detail/${id}`,
+    3: `cms/register/detail/${id}`,
+    4: `cms/待完善删除/detail/${id}`
+  }
+  const url = urlObj[key]
+  return http.get(url)
+}
+
+/**
+ * 保存草稿/添加藏品
+ */
+export const FourAPI_saveDraft = (key: FourKeyType, data: any) => {
+  const urlObj = {
+    1: 'cms/orderHouse/saveDraft',
+    2: 'cms/orderHide/saveDraft',
+    3: 'cms/register/saveDraft',
+    4: 'cms/待完善删除/saveDraft'
+  }
+  const url = urlObj[key]
+  return http.post(url, data)
+}
+
+/**
+ * 创建
+ */
+export const FourAPI_saveCreate = (key: FourKeyType, data: any) => {
+  const urlObj = {
+    1: 'cms/orderHouse/saveCreate',
+    2: 'cms/orderHide/saveCreate',
+    3: 'cms/register/saveCreate',
+    4: 'cms/待完善删除/saveCreate'
+  }
+  const url = urlObj[key]
+  return http.post(url, data)
+}
+
+/**
+ * 删除
+ */
+export const FourAPI_del = (key: FourKeyType, id: number) => {
+  const urlObj = {
+    1: `cms/orderHouse/remove/${id}`,
+    2: `cms/orderHide/remove/${id}`,
+    3: `cms/register/remove/${id}`,
+    4: `cms/待完善删除/remove/${id}`
+  }
+  const url = urlObj[key]
+  return http.get(url)
+}
+
+/**
+ * 点击保存(编辑) 提交(审批)
+ */
+export const FourAPI_saveApply = (key: FourKeyType, data: any) => {
+  const urlObj = {
+    1: 'cms/orderHouse/saveApply',
+    2: 'cms/orderHide/saveApply',
+    3: 'cms/register/saveApply',
+    4: 'cms/待完善删除/saveApply'
+  }
+  const url = urlObj[key]
+  return http.post(url, data)
+}
+
+/**
+ * 审批
+ */
+export const FourAPI_audit = (key: FourKeyType, data: any) => {
+  const urlObj = {
+    1: 'cms/orderHouse/audit',
+    2: 'cms/orderHide/audit',
+    3: 'cms/register/audit',
+    4: 'cms/待完善删除/audit'
+  }
+  const url = urlObj[key]
+  return http.post(url, data)
+}

+ 28 - 0
src/store/action/layout.ts

@@ -24,6 +24,34 @@ export const API_LoginGetCode = () => {
   return http.get('admin/getRandCode', { responseType: 'blob' })
 }
 
+// 上传文件自动归类
+type FileObjType = {
+  [key: string]: string[]
+}
+export const fileImgArr = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'webp', 'svg', 'psd', 'ai']
+export const fileVideoArr = ['mp4', 'mov', 'avi', 'mkv', 'flv', 'wmv', 'mpeg', 'webm']
+
+const fileObj: FileObjType = {
+  img: fileImgArr,
+  video: fileVideoArr,
+  model: ['4dage', 'obj', 'stl', 'fbx', 'gltf', '3ds', 'blend', 'dae', 'step'],
+  audio: ['mp3', 'wav', 'flac', 'aac', 'ogg', 'm4a'],
+  doc: ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'csv', 'md', 'html']
+  // 'other':[]
+}
+
+export const fileTypeRes = (fileName: string) => {
+  const txtArr = fileName.split('.')
+  const txt = txtArr[txtArr.length - 1]
+
+  let type = 'other'
+
+  for (const k in fileObj) {
+    if (fileObj[k].includes(txt)) type = k
+  }
+  return type
+}
+
 const CancelToken = axios.CancelToken
 /**
  * 上传封面图和附件

+ 49 - 0
src/store/reducer/FourAll.ts

@@ -0,0 +1,49 @@
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
+import { FourKeyType } from '../action/FourAll'
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  listObj: {
+    1: {
+      list: [] as FourTableType[],
+      total: 0
+    },
+    2: {
+      list: [] as FourTableType[],
+      total: 0
+    },
+    3: {
+      list: [] as FourTableType[],
+      total: 0
+    },
+    4: {
+      list: [] as FourTableType[],
+      total: 0
+    }
+  }
+}
+
+// 定义 action 类型
+type Props = {
+  type: 'Four/getList'
+  payload: { key: FourKeyType; value: { list: FourTableType[]; total: number } }
+}
+
+// reducer
+export default function userReducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case 'Four/getList':
+      return {
+        ...state,
+        listObj: {
+          ...state.listObj,
+          [action.payload.key]: action.payload.value
+        }
+      }
+
+    default:
+      return state
+  }
+}

+ 2 - 0
src/store/reducer/index.ts

@@ -3,6 +3,7 @@ import { combineReducers } from 'redux'
 
 // 导入 登录 模块的 reducer
 import A0Layout from './layout'
+import FourAll from './FourAll'
 import D2storSet from './D2storSet'
 import Z1dict from './Z1dict'
 import Z2numRule from './Z2numRule'
@@ -14,6 +15,7 @@ import Z7log from './Z7log'
 // 合并 reducer
 const rootReducer = combineReducers({
   A0Layout,
+  FourAll,
   D2storSet,
   Z1dict,
   Z2numRule,

+ 2 - 2
src/utils/history.ts

@@ -3,6 +3,6 @@ const history = createHashHistory()
 export default history
 
 // 所有藏品详情 全部新页面打开
-export const openGoodsInfoFu = (id: number) => {
-  window.open(`/#/goodsLook/${id}`, '_blank')
+export const openGoodsInfoFu = (id: number, src?: string) => {
+  window.open(src ? src : `/#/goodsLook/${id}`, '_blank')
 }

+ 49 - 0
src/utils/select.ts

@@ -0,0 +1,49 @@
+export const selectObj = {
+  申请状态: [
+    { value: 1, label: '草稿' },
+    { value: 6, label: '待提交' },
+    { value: 2, label: '待审批' },
+    { value: 3, label: '审批不通过' },
+    { value: 4, label: '已完成' },
+    { value: 5, label: '待盘点' }
+  ],
+  // 待完善
+  角色: [
+    { value: '我发起的', label: '我发起的' },
+    { value: '我审批的', label: '我审批的' },
+    { value: '抄送我的', label: '抄送我的' }
+  ],
+  藏品编号类型: [
+    { value: '藏品总登记号', label: '藏品总登记号' },
+    { value: '辅助账号', label: '辅助账号' },
+    { value: '索书号', label: '索书号' },
+    { value: '档案编号', label: '档案编号' },
+    { value: '固定资产登记号', label: '固定资产登记号' },
+    { value: '财产登记号', label: '财产登记号' },
+    { value: '出土(水)登记号', label: '出土(水)登记号' },
+    { value: '其他编号', label: '其他编号' }
+  ],
+  // 待完善
+  库存状态: [
+    { value: 1, label: '待入库' },
+    { value: 2, label: '已入库' },
+    { value: 3, label: '待出库' },
+    { value: 4, label: '已出库' },
+    { value: 5, label: '盘点中' },
+    { value: 6, label: '注销中' }
+  ],
+  文物级别: [
+    { value: '一级', label: '一级' },
+    { value: '二级', label: '二级' },
+    { value: '三级', label: '三级' },
+    { value: '未定级', label: '未定级' }
+  ],
+  附件类型: [
+    { name: '图像', key: 'img' },
+    { name: '3D', key: 'model' },
+    { name: '音频', key: 'audio' },
+    { name: '视频', key: 'video' },
+    { name: '文档', key: 'doc' },
+    { name: '其他', key: 'other' }
+  ]
+}

+ 34 - 27
src/utils/tableData.ts

@@ -14,6 +14,16 @@
 //     ["text", "创建日期",'description', 50,A],
 //   ];
 
+// 申请状态
+export const statusObj = {
+  1: '草稿',
+  6: '待提交',
+  2: '待审批',
+  3: '审批不通过',
+  4: '已完成',
+  5: '待盘点'
+}
+
 // 待完善
 export const B1TableC = [
   ['txt', '线索名称', 'description'],
@@ -22,26 +32,24 @@ export const B1TableC = [
   ['txt', '创建时间', 'description']
 ]
 
-// 待完善
 export const B3eTableC = [
   ['img', '封面图', 'thumb'],
-  ['txt', '编号类型', 'description'],
-  ['txt', '藏品名称', 'description'],
-  ['txt', '文物级别', 'description'],
-  ['txt', '文物类别', 'description'],
-  ['txt', '年代', 'description'],
-  ['txt', '数量', 'description'],
-  ['txt', '质地', 'description'],
-  ['txt', '完残程度', 'description'],
-  ['txt', '来源', 'description']
+  ['txt', '编号类型', 'numName'],
+  ['txt', '藏品名称', 'name'],
+  ['txt', '文物级别', 'dictLevel'],
+  ['txtC', '文物类别', 'dictType'],
+  ['txtC', '年代', 'dictAge'],
+  ['txt', '数量', 'pcs'],
+  ['txtC', '质地', 'dictTexture3'],
+  ['txtC', '完残程度', 'dictTorn'],
+  ['txtC', '来源', 'source']
 ]
 
-// 待完善
 export const B3FtableC = [
-  ['txt', '节点名称', 'description'],
-  ['txt', '提交日期', 'description'],
-  ['txt', '处理人', 'description'],
-  ['txt', '审批结果', 'description']
+  ['txt', '节点名称', 'name'],
+  ['txt', '提交日期', 'updateTime'],
+  ['txt', '处理人', 'creatorName'],
+  ['txtChange', '审批结果', 'status', { 1: '同意', 2: '不同意' }]
 ]
 
 // 待完善
@@ -60,12 +68,12 @@ export const D1GtableC = [
 
 // 待完善
 export const B3tableC = [
-  ['txt', '申请编号', 'userName'],
-  ['txt', '业务名称', 'userName'],
-  ['txt', '发起部门', 'userName'],
-  ['txt', '发送人', 'userName'],
-  ['txt', '发起日期', 'userName'],
-  ['txt', '申请状态', 'userName']
+  ['txt', '业务单号', 'num'],
+  ['txt', '申请名称', 'name'],
+  ['txt', '发起部门', 'deptName'],
+  ['txt', '发送人', 'creatorName'],
+  ['txt', '发起日期', 'createTime'],
+  ['txtChange', '申请状态', 'status', statusObj]
 ]
 
 // 待完善
@@ -176,18 +184,17 @@ export const Y22tableC = [
   ['txt', '库存详情', 'description']
 ]
 
-// 待完善
 export const Y33tableC = (type: '详情' | '新增') => {
   let arr1 = [
     ['txt', '附件类型', 'type'],
-    ['txt', '用途', 'description']
+    ['txt', '用途', 'effect']
   ]
 
   const arr2 = [
-    ['txt', '附件名称', 'description'],
-    ['txt', '附件大小', 'description'],
-    ['txt', '上传日期', 'description'],
-    ['txt', '上传人', 'description']
+    ['text', '附件名称', 'fileName', 50],
+    ['txt', '附件大小', 'fileSize'],
+    ['txt', '上传日期', 'updateTime'],
+    ['txt', '上传人', 'creatorName']
   ]
   return type === '详情' ? [...arr1, ...arr2] : arr2
 }