Browse Source

入馆-入藏

shaogen1995 3 tháng trước cách đây
mục cha
commit
cc57b393ab
32 tập tin đã thay đổi với 1684 bổ sung82 xóa
  1. 1 1
      src/components/MyTable/index.tsx
  2. 1 1
      src/components/ZupTypes/index.tsx
  3. 1 1
      src/pages/A3_ledger/A32Routing/A32table/index.tsx
  4. 2 6
      src/pages/A3_ledger/A32Routing/data.ts
  5. 1 1
      src/pages/A3_ledger/C1ledger/index.tsx
  6. 4 0
      src/pages/A3_ledger/C1ledger/type.d.ts
  7. 1 1
      src/pages/A3_ledger/ComPage/C8recycleBin/index.tsx
  8. 3 1
      src/pages/B_enterTibet/B2identify/B2edit/B2MoAdd/index.tsx
  9. 129 0
      src/pages/B_enterTibet/B34typeIn/B34MoAdd/index.module.scss
  10. 303 0
      src/pages/B_enterTibet/B34typeIn/B34MoAdd/index.tsx
  11. 129 0
      src/pages/B_enterTibet/B34typeIn/B34edit/index.module.scss
  12. 600 0
      src/pages/B_enterTibet/B34typeIn/B34edit/index.tsx
  13. 30 0
      src/pages/B_enterTibet/B34typeIn/index.module.scss
  14. 338 0
      src/pages/B_enterTibet/B34typeIn/index.tsx
  15. 9 0
      src/pages/B_enterTibet/B3entering/B3edit.tsx
  16. 0 4
      src/pages/B_enterTibet/B3entering/index.module.scss
  17. 2 7
      src/pages/B_enterTibet/B3entering/index.tsx
  18. 9 0
      src/pages/B_enterTibet/B4enterTibet/B4edit.tsx
  19. 0 4
      src/pages/B_enterTibet/B4enterTibet/index.module.scss
  20. 2 7
      src/pages/B_enterTibet/B4enterTibet/index.tsx
  21. 49 21
      src/pages/C_goodsManage/C1register/AddGoods/index.tsx
  22. 1 1
      src/pages/C_goodsManage/C3focus/index.tsx
  23. 1 1
      src/pages/D_storeManage/D1storage/D1goods/index.tsx
  24. 1 1
      src/pages/D_storeManage/D4impStor/D4edit/index.tsx
  25. 1 1
      src/pages/D_storeManage/D6putsStor/D6edit/index.tsx
  26. 1 1
      src/pages/D_storeManage/D8cancel/D8edit/index.tsx
  27. 1 1
      src/pages/E_goodsStorage/E2damaged/E2edit/index.tsx
  28. 1 1
      src/pages/E_goodsStorage/E3actuality/E3edit/index.tsx
  29. 1 1
      src/pages/E_goodsStorage/E4repair/E4edit/index.tsx
  30. 12 0
      src/pages/Layout/data.ts
  31. 23 18
      src/pages/Y_goodsDetails/Y2look/index.tsx
  32. 27 1
      src/utils/tableData.ts

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

@@ -118,7 +118,7 @@ function MyTable({
             item[v[2]] || isNull
           ),
         // 多个字段拼接
-        ping: (item: any) => item[v[2]] + resJiLianFu(item[v[3]]) || isNull,
+        ping: (item: any) => (item[v[2]] || '') + (resJiLianFu(item[v[3]]) || '') || isNull,
         // 这个模块特有的级联控制
         txtC: (item: any) =>
           v[1] === '年代' && item[v[2]] === '其他' ? '其他' : resJiLianFu(item[v[2]]),

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

@@ -551,7 +551,7 @@ function ZupTypes(
                 />
               </div>
             ))}
-            {fileList.img.length === 0 && oneIsCover ? (
+            {fileList.img.length === 0 && oneIsCover && isLook ? (
               <span style={{ position: 'relative', top: -2 }}>(空)</span>
             ) : null}
           </div>

+ 1 - 1
src/pages/A3_ledger/A32Routing/A32table/index.tsx

@@ -37,7 +37,7 @@ function A32table({ pageNum, pageSize, pageChangeFu, advanced }: Props) {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

+ 2 - 6
src/pages/A3_ledger/A32Routing/data.ts

@@ -1,4 +1,5 @@
 import { cascaderObjFu } from '@/utils/history'
+import { selectObj } from '@/utils/select'
 
 export type A32treeDataType = {
   name: string
@@ -12,12 +13,7 @@ export const A32treeData: A32treeDataType[] = [
     name: '馆藏与非馆藏',
     show: true,
     key: 'accountType',
-    son: [
-      { id: '1', name: '藏品' },
-      { id: '2', name: '参考品' },
-      { id: '3', name: '资料' },
-      { id: '4', name: '标本' }
-    ]
+    son: selectObj['入藏去向']
   },
   {
     name: '类别分账',

+ 1 - 1
src/pages/A3_ledger/C1ledger/index.tsx

@@ -143,7 +143,7 @@ function C1ledger() {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

+ 4 - 0
src/pages/A3_ledger/C1ledger/type.d.ts

@@ -122,4 +122,8 @@ export type C1GoodType = {
   txt2: string
   txt3: string
   id2: number
+
+  // 入馆-入藏
+  relatedOrderId: number
+  subNum: string
 }

+ 1 - 1
src/pages/A3_ledger/ComPage/C8recycleBin/index.tsx

@@ -123,7 +123,7 @@ function C8recycleBin({ closeFu }: Props) {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

+ 3 - 1
src/pages/B_enterTibet/B2identify/B2edit/B2MoAdd/index.tsx

@@ -81,6 +81,8 @@ function B2MoAdd({ info, closeFu, succFu, look = false }: Props) {
         if (obj[k] === null || obj[k] === undefined) obj[k] = ''
       }
 
+      if (info.id2) obj.id2 = info.id2
+
       // 级联的数据转换成字符串
       cascaderChArr.forEach(v => {
         if (values[v]) obj[v] = values[v].join(',')
@@ -89,7 +91,7 @@ function B2MoAdd({ info, closeFu, succFu, look = false }: Props) {
       succFu(obj)
       closeFu()
     },
-    [closeFu, info.id, succFu]
+    [closeFu, info.id, info.id2, succFu]
   )
 
   // 上传图片的ref

+ 129 - 0
src/pages/B_enterTibet/B34typeIn/B34MoAdd/index.module.scss

@@ -0,0 +1,129 @@
+.B34MoAdd {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 1400px !important;
+      min-width: 1400px;
+      top: 40px !important;
+    }
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+    }
+
+    .B2Mmain {
+      padding-top: 15px;
+      width: 1200px;
+      height: 753px;
+      overflow-y: auto;
+      padding: 24px;
+
+      .B2MformBox {
+        display: flex;
+        justify-content: space-between;
+        flex-wrap: wrap;
+        .ant-form-item {
+          width: calc(50% - 20px);
+        }
+
+        .B2Mrow {
+          width: 100%;
+          display: flex;
+          margin-bottom: 20px;
+          .B2Mrowll {
+            width: 98px;
+            text-align: right;
+            position: relative;
+            top: 3px;
+            & > span {
+              color: #ff4b2f;
+            }
+          }
+          .B2Mrowrr {
+            width: calc(100% - 98px);
+            .ant-input-affix-wrapper {
+              width: 300px;
+            }
+            .ant-select {
+              width: 300px;
+            }
+          }
+        }
+        // 封面
+        .formRow {
+          width: 48%;
+          display: flex;
+          .formLeft {
+            width: 98px;
+            text-align: right;
+            & > span {
+              color: #ff4d4f;
+            }
+          }
+        }
+
+        // 备注 富文本
+        .formRow2 {
+          width: 100%;
+          .formLeft {
+            position: relative;
+            top: 5px;
+          }
+          .formRightSize {
+            .ant-form-item {
+              width: 265px;
+              margin-right: 15px;
+              &:last-of-type {
+                width: 212px;
+                margin-right: 0;
+              }
+            }
+            // 尺寸
+            display: flex;
+
+            .ant-form-item-label {
+              min-width: 60px;
+              width: 60px;
+            }
+
+            .ant-input-number {
+              width: 205px;
+            }
+          }
+        }
+        // 重量
+        .B3NrowDing {
+          position: relative;
+          width: calc(50% - 20px);
+          display: flex;
+          .ant-form-item {
+            width: auto;
+            .ant-input-number {
+              width: 225px;
+            }
+            .ant-select-selector {
+              width: 230px;
+            }
+          }
+        }
+      }
+
+      .ant-form-item-label {
+        max-width: 98px;
+        min-width: 98px;
+      }
+
+      .B2Mbtn {
+        position: absolute;
+        top: 50%;
+        transform: translateY(-50%);
+        right: 52px;
+        .ant-btn {
+          display: block;
+        }
+      }
+    }
+  }
+}

+ 303 - 0
src/pages/B_enterTibet/B34typeIn/B34MoAdd/index.tsx

@@ -0,0 +1,303 @@
+import React, { useCallback, useEffect, useRef } from 'react'
+import styles from './index.module.scss'
+import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
+import { Button, Cascader, Form, FormInstance, Input, InputNumber, Modal, Select } from 'antd'
+import { MessageFu } from '@/utils/message'
+import ZupTypes from '@/components/ZupTypes'
+import { selectObj } from '@/utils/select'
+import { cascaderObjFu } from '@/utils/history'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import TextArea from 'antd/es/input/TextArea'
+import { API_C2getListByIds } from '@/store/action/C2files'
+import { fileImgArr } from '@/store/action/layout'
+import { addZiSelectChArr, cascaderChArr } from '@/pages/C_goodsManage/C1register/AddGoods'
+import { GoodFileType } from '@/components/Z3upFiles'
+import { API_goodsAdd } from '@/store/action/C1ledger'
+
+type Props = {
+  info: C1GoodType
+  closeFu: () => void
+  succFu: (val: C1GoodType, newFlag?: boolean) => void
+  type: '入馆' | '入藏'
+  look?: boolean
+}
+
+function B34MoAdd({ info, closeFu, succFu, type, look = false }: Props) {
+  const getInfoFu = useCallback(async (info: C1GoodType) => {
+    const obj: any = { ...info }
+    cascaderChArr.forEach(v => {
+      if (obj[v]) obj[v] = obj[v].split(',')
+    })
+
+    addZiSelectChArr.forEach(v => {
+      if (!obj[v]) obj[v] = null
+    })
+
+    FormBoxRef.current?.setFieldsValue({
+      ...obj
+    })
+
+    if (info.fileIds) {
+      const res = await API_C2getListByIds(info.fileIds.split(','))
+      if (res.code === 0) {
+        const arr: GoodFileType[] = res.data || []
+
+        const imgArr = arr.filter(v => {
+          const txtArr = v.fileName.split('.')
+          const txt = txtArr[txtArr.length - 1]
+          return v.type === 'img' && fileImgArr.includes(txt)
+        })
+
+        // 设置图片
+        imgRef.current?.setFileComFileFu({
+          type: 'img',
+          fileList: imgArr
+        })
+      }
+    }
+  }, [])
+
+  // 设置表单初始数据(区分编辑和新增)
+  const FormBoxRef = useRef<FormInstance>(null)
+
+  // 没有通过校验
+  const onFinishFailed = useCallback(() => {
+    // return MessageFu.warning("有表单不符号规则!");
+  }, [])
+
+  // 通过校验点击确定
+  const onFinish = useCallback(
+    async (values: any) => {
+      // 上传图片
+      const { sonFileIds, coverUrl, coverPcUrl } = imgRef.current?.fileComFileResFu()
+
+      const obj = {
+        ...values,
+        id: info.id > 0 ? info.id : null,
+        fileIds: sonFileIds.join(','),
+        thumb: coverUrl,
+        thumbPc: coverPcUrl
+      }
+
+      // if (1 + 1 === 2) {
+      //   console.log('---', obj)
+      //   return
+      // }
+
+      for (const k in obj) {
+        if (obj[k] === null || obj[k] === undefined) obj[k] = ''
+      }
+
+      // 级联的数据转换成字符串
+      cascaderChArr.forEach(v => {
+        if (values[v]) obj[v] = values[v].join(',')
+      })
+
+      if (info.id > 0) {
+        succFu(obj)
+        if (info.id2) obj.id2 = info.id2
+
+        MessageFu.success('编辑成功')
+        closeFu()
+      } else {
+        for (const k in obj) {
+          if (obj[k] === null || obj[k] === undefined) obj[k] = ''
+        }
+        const res = await API_goodsAdd(obj, '新增')
+        if (res.code === 0) {
+          succFu(res.data, true)
+          MessageFu.success('新增成功')
+          closeFu()
+        }
+      }
+    },
+    [closeFu, info.id, info.id2, succFu]
+  )
+
+  // 上传图片的ref
+  const imgRef = useRef<any>(null)
+
+  useEffect(() => {
+    if (info.id > 0) getInfoFu(info)
+  }, [getInfoFu, info])
+
+  return (
+    <Modal
+      wrapClassName={styles.B34MoAdd}
+      destroyOnClose
+      open={true}
+      title={look ? '查看' : info.id > 0 ? '编辑' : '新增'}
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='B2Mmain'>
+        <Form
+          scrollToFirstError={true}
+          ref={FormBoxRef}
+          name='basic'
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete='off'
+        >
+          <div className='B2MformBox'>
+            <Form.Item label='名称' name='name' rules={[{ required: true, message: '请输入名称' }]}>
+              <Input
+                readOnly={look}
+                maxLength={30}
+                showCount
+                placeholder={look ? '(空)' : '请输入内容'}
+              />
+            </Form.Item>
+
+            <div className='B3NrowDing'>
+              <Form.Item
+                label='登记号'
+                name='numName'
+                rules={[{ required: type === '入藏', message: '请选择类型' }]}
+              >
+                <Select
+                  disabled={look}
+                  options={selectObj['藏品编号类型']}
+                  placeholder={look ? '(空)' : '请选择类型'}
+                  allowClear={!(type === '入藏')}
+                />
+              </Form.Item>
+
+              <Form.Item name='num' rules={[{ required: type === '入藏', message: '请输入内容' }]}>
+                <Input
+                  readOnly={look}
+                  maxLength={30}
+                  showCount
+                  placeholder={look ? '(空)' : '请输入内容'}
+                />
+              </Form.Item>
+            </div>
+
+            <div className='B3NrowDing'>
+              <Form.Item label='数量' name='pcs'>
+                <InputNumber
+                  readOnly={look}
+                  min={1}
+                  max={99999999}
+                  precision={0}
+                  placeholder={look ? '(空)' : '请输入正整数'}
+                />
+              </Form.Item>
+
+              <Form.Item name='pcsUnit'>
+                <Cascader
+                  disabled={look}
+                  options={cascaderObjFu()['数量单位']}
+                  placeholder={look ? '(空)' : '请选择'}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  allowClear={true}
+                />
+              </Form.Item>
+            </div>
+
+            <Form.Item label='时代' name='dictAge'>
+              <Cascader
+                disabled={look}
+                options={cascaderObjFu()['年代']}
+                placeholder={look ? '(空)' : '请选择'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+              />
+            </Form.Item>
+
+            <Form.Item label='质地' name='dictTexture3'>
+              <Cascader
+                disabled={look}
+                options={cascaderObjFu()['单一质地']}
+                placeholder={look ? '(空)' : '请选择'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                allowClear={true}
+              />
+            </Form.Item>
+            <Form.Item label='完残程度' name='dictTorn'>
+              <Cascader
+                disabled={look}
+                options={cascaderObjFu()['完残程度']}
+                placeholder={look ? '(空)' : '请选择'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                allowClear={true}
+              />
+            </Form.Item>
+
+            <Form.Item label='来源' name='source'>
+              <Cascader
+                disabled={look}
+                options={cascaderObjFu()['来源']}
+                placeholder={look ? '(空)' : '请选择'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                allowClear={true}
+              />
+            </Form.Item>
+
+            <Form.Item
+              label='处理情况'
+              name='accountType'
+              rules={[{ required: type === '入藏', message: '请选择' }]}
+            >
+              <Select
+                disabled={look}
+                options={selectObj['入藏去向']}
+                placeholder={look ? '(空)' : '请选择'}
+                allowClear={!(type === '入藏')}
+              />
+            </Form.Item>
+
+            <Form.Item label='备注' name='intro'>
+              <TextArea
+                readOnly={look}
+                maxLength={200}
+                showCount
+                placeholder={look ? '(空)' : '请输入内容'}
+              />
+            </Form.Item>
+
+            <div className='B2Mrow' style={{ marginTop: -20 }}>
+              <div className='B2Mrowll' style={{ top: 20 }}>
+                图片:
+              </div>
+              <div className='B2Mrowrr'>
+                <ZupTypes
+                  isEdit={false}
+                  ref={imgRef}
+                  selecFlag='图片'
+                  fileCheck={false}
+                  isLook={look}
+                  imgLength={30}
+                  isTypeShow={true}
+                  oneIsCover={true}
+                  isOneType={true}
+                  dirCode='B34typeIn'
+                  myUrl='cms/goods/upload'
+                />
+              </div>
+            </div>
+          </div>
+
+          {/* 确定和取消按钮 */}
+          <Form.Item className='B2Mbtn'>
+            {look ? (
+              <Button onClick={closeFu}>关闭</Button>
+            ) : (
+              <>
+                <Button type='primary' htmlType='submit'>
+                  提交
+                </Button>
+                &emsp;
+                <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+              </>
+            )}
+          </Form.Item>
+        </Form>
+      </div>
+    </Modal>
+  )
+}
+
+const MemoB34MoAdd = React.memo(B34MoAdd)
+
+export default MemoB34MoAdd

+ 129 - 0
src/pages/B_enterTibet/B34typeIn/B34edit/index.module.scss

@@ -0,0 +1,129 @@
+.B34edit {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 24px 0px;
+  :global {
+    .B34Tit {
+      font-size: 18px;
+      font-weight: 700;
+      padding-bottom: 10px;
+      padding-left: 18px;
+      border-bottom: 1px solid #ccc;
+      margin-bottom: 17px;
+      color: var(--themeColor);
+      .ant-btn {
+        margin-left: 15px;
+        pointer-events: none;
+      }
+    }
+    .B34Tit2 {
+      margin-top: 24px;
+      display: flex;
+      justify-content: space-between;
+      border-bottom: 1px solid #ccc;
+      margin-bottom: 20px;
+      .B34Tit2ll {
+        font-size: 18px;
+        font-weight: 700;
+        padding-left: 18px;
+        margin-bottom: 17px;
+        color: var(--themeColor);
+      }
+      .B34Tit2rr {
+        position: relative;
+        z-index: 2;
+        .ant-btn {
+          margin-left: 15px;
+        }
+      }
+    }
+
+    .B34main {
+      width: 100%;
+      height: calc(100% - 70px);
+      overflow-y: auto;
+      padding-bottom: 40px;
+
+      .B34rowAll {
+        display: flex;
+        justify-content: space-between;
+        align-items: self-start;
+        font-size: 16px;
+        flex-wrap: wrap;
+        .B34row {
+          width: 48%;
+          display: flex;
+          align-items: center;
+          margin-bottom: 20px;
+          .B34rowll {
+            width: 110px;
+            text-align: right;
+            font-weight: 700;
+            & > span {
+              color: #ff4b2f;
+            }
+          }
+          .B34rowrr {
+            width: calc(100% - 110px);
+            .ant-input-affix-wrapper {
+              width: 300px;
+            }
+            .ant-select {
+              width: 300px;
+            }
+          }
+        }
+        .B34row2 {
+          align-items: self-start;
+          .B34rowll {
+            position: relative;
+            top: 3px;
+          }
+          .B34rowrr {
+            .ant-input-affix-wrapper {
+              width: 90%;
+            }
+          }
+        }
+        .B34row3 {
+          position: relative;
+          top: 4px;
+        }
+
+        .B34rowFull {
+          width: 100%;
+          margin-top: -20px;
+          align-items: self-start;
+          margin-bottom: 0;
+          .B34rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+      }
+      // 征集线索
+      .B34googsBox {
+        padding-right: 20px;
+        margin-top: 24px;
+
+        .B34tab34Tit {
+          font-weight: 700;
+          color: var(--themeColor);
+        }
+      }
+    }
+
+    .B34btn {
+      position: absolute;
+      bottom: 20px;
+      left: 134px;
+      .ant-btn {
+        margin-right: 20px;
+      }
+    }
+
+    .ant-table-cell {
+      padding: 8px !important;
+    }
+  }
+}

+ 600 - 0
src/pages/B_enterTibet/B34typeIn/B34edit/index.tsx

@@ -0,0 +1,600 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { useParams } from 'react-router-dom'
+import { FourTableType } from '../../B1collect/type'
+import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
+import classNames from 'classnames'
+import { Button, DatePicker, Input } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import {
+  FourAPI_audit,
+  FourAPI_create,
+  FourAPI_del,
+  FourAPI_getInfo,
+  FourAPI_revocation,
+  FourAPI_saveApply,
+  FourAPI_saveCreate,
+  FourAPI_saveDraft
+} from '@/store/action/FourAll'
+import { MessageFu } from '@/utils/message'
+import history, { btnFlagFu2 } from '@/utils/history'
+import { EXbtnFu } from '@/utils/EXBtn'
+import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
+import { B34TableC2, statusObj } from '@/utils/tableData'
+import dayjs from 'dayjs'
+import MyTable from '@/components/MyTable'
+import ZflowTable from '@/components/ZflowTable'
+import ZupFileTable from '@/components/ZupFileTable'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+import ZGaddNow from '@/components/ZGaddNow'
+import B34MoAdd from '../B34MoAdd'
+
+type Props = {
+  type: '入馆' | '入藏'
+}
+
+function B34edit({ type }: Props) {
+  const { key, id } = useParams<any>()
+  // key:1 新增 2编辑 3审批 4查看
+
+  // 滚到顶部
+  const sollrDom = useRef<HTMLDivElement>(null)
+
+  // 顶部数据
+  const [topInfo, setTopInfo] = useState({} as FourTableType)
+
+  // 藏品清单快照数据
+  const [snaps, setSnaps] = useState<C1GoodType[]>([])
+  const delSnapIdsRef = useRef<number[]>([])
+
+  const snapsID2ref = useRef<{ goodsId: number; id: number }[]>([])
+
+  // -------新增藏品-新字段-------------
+  const [openInfo, setOpenInfo] = useState({} as C1GoodType)
+
+  // 打开侧边栏
+  const [cathet, setCathet] = useState(0)
+
+  const startBtn = useMemo(() => {
+    return [
+      {
+        title: '藏品编号',
+        render: (item: C1GoodType) => {
+          return (
+            <span
+              onClick={() => setCathet(item.id)}
+              className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
+            >
+              {item.num || '(空)'}
+            </span>
+          )
+        }
+      }
+    ]
+  }, [cathet])
+
+  const tableLastBtn = useMemo(() => {
+    let arr: any = []
+
+    if (topInfo.status === 4) {
+      arr.push({
+        title: '关联藏品登记',
+        render: (item: C1GoodType) => {
+          return item.subNum && item.relatedOrderId ? (
+            <span
+              onClick={() => window.open(`/#/register_edit/4/${item.relatedOrderId}`, '_blank')}
+              className='D1GtNum'
+            >
+              {item.subNum}
+            </span>
+          ) : (
+            '(空)'
+          )
+        }
+      })
+    }
+
+    arr.push({
+      title: '操作',
+      render: (item: any) => {
+        return (
+          <>
+            <Button size='small' type='text' onClick={() => setOpenInfo(item)}>
+              {['3', '4'].includes(key) ? '查看' : '编辑'}
+            </Button>
+            {['3', '4'].includes(key) ? null : (
+              <MyPopconfirm
+                txtK='删除'
+                onConfirm={() => {
+                  if (item.id2 && !delSnapIdsRef.current.includes(item.id2))
+                    delSnapIdsRef.current.push(item.id2)
+                  setSnaps(snaps.filter(v => v.id !== item.id))
+                }}
+              />
+            )}
+          </>
+        )
+      }
+    })
+
+    return arr
+  }, [topInfo.status, key, snaps])
+  // -------新增藏品-新字段-------------
+
+  // 创建订单
+  const creatFu = useCallback(async () => {
+    const res = await FourAPI_create(type === '入馆' ? '1' : '2')
+    if (res.code === 0) {
+      setTopInfo(res.data)
+    }
+  }, [type])
+
+  // 获取详情
+  const getInfoFu = useCallback(async () => {
+    const res = await FourAPI_getInfo(type === '入馆' ? '1' : '2', id)
+    if (res.code === 0) {
+      const data = res.data
+      setTopInfo(data)
+      // 藏品清单快照信息id对比
+      const arrTemp: any = []
+      const snapsTemp = data.snaps || []
+
+      snapsTemp.forEach((v: any) => {
+        snapsID2ref.current.push({ goodsId: v.goodsId, id: v.id })
+
+        const obj = JSON.parse(v.snap || '{}')
+        if (obj.id) obj.id2 = v.id
+
+        arrTemp.push({
+          ...obj,
+          subNum: v.subNum ? v.subNum : '',
+          relatedOrderId: v.relatedOrderId ? v.relatedOrderId : ''
+        })
+      })
+
+      setSnaps(arrTemp)
+    }
+  }, [id, type])
+
+  useEffect(() => {
+    if (key === '1') creatFu()
+    else getInfoFu()
+
+    if (sollrDom.current) sollrDom.current.scrollTop = 0
+  }, [creatFu, getInfoFu, key])
+
+  // 审批意见的ref
+  const ZAuditRef = useRef<any>(null)
+
+  // 审批的sta
+  const [auditSta, setAuDitSta] = useState('')
+
+  const timeChange = useCallback(
+    (e: any) => {
+      setTopInfo({ ...topInfo, date: dayjs(e).format('YYYY-MM-DD') })
+    },
+    [topInfo]
+  )
+
+  // 新增的底部按钮点击
+  const btnClickFu = useCallback(
+    async (val: '草稿' | '创建' | '保存' | '审批') => {
+      if (!topInfo.num) return MessageFu.warning('请输入入馆凭证号')
+
+      if (val !== '草稿') {
+        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+      }
+
+      if (val === '审批') {
+        // console.log('审批信息富文本', rtf2)
+        if (!auditSta) {
+          if (sollrDom.current) sollrDom.current.scrollTop = 0
+          return MessageFu.warning('请选择审批结果')
+        }
+        const rtf2 = ZAuditRef.current?.resData()
+
+        const res = await FourAPI_audit(type === '入馆' ? '1' : '2', {
+          orderId: topInfo.id,
+          rtfOpinion: rtf2,
+          status: auditSta === '同意' ? 1 : 2
+        })
+
+        if (res.code === 0) {
+          MessageFu.success('审批成功')
+          // 跳详情页
+          history.push(`/${type === '入馆' ? 'entering' : 'enterTibet'}_edit/4/${topInfo.id}`)
+        }
+      } else {
+        const obj = {
+          ...topInfo,
+          goodsIds: snaps.map(v => v.id).join(','),
+          delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
+          snaps: snaps.map(v => ({
+            goodsId: v.id,
+            id: v.id2 ? v.id2 : null,
+            orderId: topInfo.id,
+            snap: JSON.stringify(v)
+          }))
+        }
+        // console.log(123, obj.snaps)
+
+        // if (1 + 1 === 2) return
+
+        if (val === '草稿') {
+          // 存草稿 当前页保存 不跳转
+          const res = await FourAPI_saveDraft(type === '入馆' ? '1' : '2', obj)
+          if (res.code === 0) {
+            MessageFu.success('草稿保存成功')
+          }
+        } else {
+          const res =
+            val === '创建'
+              ? await FourAPI_saveCreate(type === '入馆' ? '1' : '2', obj)
+              : await FourAPI_saveApply(type === '入馆' ? '1' : '2', obj)
+          if (res.code === 0) {
+            MessageFu.success(`${val}成功`)
+            // 跳到详情页
+            history.push(`/${type === '入馆' ? 'entering' : 'enterTibet'}_edit/4/${topInfo.id}`)
+          }
+        }
+      }
+    },
+    [auditSta, snaps, topInfo, type]
+  )
+  // 查看的按钮创建-提交-撤回
+  const lookBtnFu = useCallback(
+    async (val: '创建' | '提交' | '撤回') => {
+      if (!topInfo.num) return MessageFu.warning('请输入入馆凭证号')
+
+      if (val !== '撤回') {
+        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+      }
+
+      const obj = {
+        ...topInfo,
+        goodsIds: snaps.map(v => v.id).join(','),
+        delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
+        snaps: snaps.map(v => ({
+          goodsId: v.id,
+          id: v.id2 ? v.id2 : null,
+          orderId: topInfo.id,
+          snap: JSON.stringify(v)
+        }))
+      }
+
+      // console.log(123, obj.snaps)
+
+      // if (1 + 1 === 2) return
+
+      const res =
+        val === '创建'
+          ? await FourAPI_saveCreate(type === '入馆' ? '1' : '2', obj)
+          : val === '提交'
+          ? await FourAPI_saveApply(type === '入馆' ? '1' : '2', obj)
+          : await FourAPI_revocation(type === '入馆' ? '1' : '2', id)
+
+      if (res.code === 0) {
+        if (sollrDom.current) sollrDom.current.scrollTop = 0
+        MessageFu.success(val + '成功')
+        getInfoFu()
+      }
+    },
+    [topInfo, snaps, type, id, getInfoFu]
+  )
+  // 查看模式点击删除
+  const delFu = useCallback(async () => {
+    const res = await FourAPI_del(type === '入馆' ? '1' : '2', id)
+    if (res.code === 0) {
+      MessageFu.success('删除成功')
+      history.push(`/${type === '入馆' ? 'entering' : 'enterTibet'}`)
+    }
+  }, [id, type])
+
+  // 查看模式点击审批 编辑
+  const lookJumpFu = useCallback(
+    (val: '审批' | '编辑') => {
+      history.push(
+        `/${type === '入馆' ? 'entering' : 'enterTibet'}_edit/${val === '审批' ? 3 : 2}/${id}`
+      )
+      MessageFu.success(`已跳转至${val}页面`)
+    },
+    [id, type]
+  )
+
+  // 查看模式下的按钮
+  const lookBtn = useMemo(() => {
+    return (
+      <>
+        {btnFlagFu2(topInfo)['创建'] ? (
+          <Button type='primary' onClick={() => lookBtnFu('创建')}>
+            创建
+          </Button>
+        ) : null}
+        {btnFlagFu2(topInfo)['提交'] ? (
+          <Button type='primary' onClick={() => lookBtnFu('提交')}>
+            提交
+          </Button>
+        ) : null}
+
+        {btnFlagFu2(topInfo)['撤回'] ? (
+          <MyPopconfirm
+            txtK='撤回'
+            onConfirm={() => lookBtnFu('撤回')}
+            Dom={
+              <Button type='primary' danger>
+                撤回
+              </Button>
+            }
+          />
+        ) : null}
+
+        {btnFlagFu2(topInfo)['审批'] ? (
+          <Button type='primary' onClick={() => lookJumpFu('审批')}>
+            审批
+          </Button>
+        ) : null}
+        {btnFlagFu2(topInfo)['编辑'] ? (
+          <Button type='primary' onClick={() => lookJumpFu('编辑')}>
+            编辑
+          </Button>
+        ) : null}
+
+        {btnFlagFu2(topInfo)['重新提交'] ? (
+          <Button type='primary' onClick={() => lookBtnFu('提交')}>
+            重新提交
+          </Button>
+        ) : null}
+
+        {EXbtnFu(topInfo)}
+
+        {btnFlagFu2(topInfo)['删除'] ? (
+          <MyPopconfirm
+            txtK='删除'
+            onConfirm={() => delFu()}
+            Dom={
+              <Button type='primary' danger>
+                删除
+              </Button>
+            }
+          />
+        ) : null}
+
+        <Button onClick={() => history.push(`/${type === '入馆' ? 'entering' : 'enterTibet'}`)}>
+          返回
+        </Button>
+      </>
+    )
+  }, [delFu, lookBtnFu, lookJumpFu, topInfo, type])
+
+  // 申请记录
+  const [auditsShow, setAuditsShow] = useState(false)
+
+  // 点击从入馆的藏品中添加
+  const [nowSta, setNowSta] = useState({ key: '', id: '' })
+
+  return (
+    <div className={styles.B34edit}>
+      <div className='pageTitle'>
+        藏品{type}-{Reflect.get(pageTitTxtObj, key)}
+      </div>
+
+      <div className='B34main'>
+        {['3'].includes(key) ? (
+          <X3auditInfo
+            dirCode='B34typeIn'
+            myUrl='cms/goodsFile/upload'
+            auditSta={auditSta}
+            auditStaFu={val => setAuDitSta(val)}
+            ref={ZAuditRef}
+          />
+        ) : null}
+
+        {/* 表单字段、附件等 */}
+        <div className='B34Tit'>
+          申请信息
+          {key === '1' ? null : (
+            <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
+          )}
+        </div>
+
+        {topInfo.id ? (
+          <div className='B34rowAll'>
+            <div className='B34row'>
+              <div className='B34rowll'>
+                <span> * </span>
+                {type}凭证号:
+              </div>
+              <div className='B34rowrr'>
+                <Input
+                  value={topInfo.num}
+                  onChange={e => setTopInfo({ ...topInfo, num: e.target.value.trim() })}
+                  readOnly={['3', '4'].includes(key)}
+                  placeholder='请输入内容'
+                  maxLength={30}
+                  showCount
+                />
+              </div>
+            </div>
+
+            <div className='B34row'>
+              <div className='B34rowll'>业务名称:</div>
+              <div className='B34rowrr'>{topInfo.name}</div>
+            </div>
+
+            <div className='B34row'>
+              <div className='B34rowll'>发起人:</div>
+              <div className='B34rowrr'>
+                {topInfo.creatorName}
+                {['3', '4'].includes(key) ? ' - ' + topInfo.createTime || '' : ''}
+              </div>
+            </div>
+
+            <div className='B34row'>
+              <div className='B34rowll'>发起部门:</div>
+              <div className='B34rowrr'>{topInfo.deptName}</div>
+            </div>
+            <div className='B34row'>
+              <div className='B34rowll'>
+                <span> * </span>
+                {type}日期:
+              </div>
+              <div className='B34rowrr'>
+                <DatePicker
+                  disabled={['3', '4'].includes(key)}
+                  allowClear={false}
+                  value={dayjs(topInfo.date)}
+                  onChange={timeChange}
+                />
+              </div>
+            </div>
+          </div>
+        ) : null}
+
+        {/* 藏品清单 */}
+        <div className='B34goodsBox'>
+          <div className='B34Tit2'>
+            <div className='B34Tit2ll'>藏品清单</div>
+            <div className='B34Tit2rr'>
+              {['3', '4'].includes(key) ? null : (
+                <>
+                  {type === '入馆' ? null : (
+                    <Button
+                      type='primary'
+                      onClick={() =>
+                        setNowSta({
+                          key: '入藏',
+                          id: `cms/orderHide/goods/getList`
+                        })
+                      }
+                    >
+                      从已入馆的藏品中添加
+                    </Button>
+                  )}
+
+                  <Button type='primary' onClick={() => setOpenInfo({ id: -1 } as C1GoodType)}>
+                    新增
+                  </Button>
+                </>
+              )}
+            </div>
+          </div>
+
+          {/* 表格 */}
+          <MyTable
+            list={snaps}
+            columnsTemp={B34TableC2}
+            startBtn={startBtn}
+            lastBtn={tableLastBtn}
+            pagingInfo={false}
+          />
+        </div>
+
+        {/* 申请流程 */}
+        {auditsShow ? (
+          <ZflowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
+        ) : null}
+
+        {/* 附件归档 */}
+        {topInfo.status === 4 ? (
+          <ZupFileTable
+            listTemp={topInfo.filing || []}
+            dirCode='B34typeIn'
+            myUrl={`cms/${type === '入馆' ? 'orderHouse' : 'orderHide'}/upload`}
+            fromData={{ moduleId: topInfo.id }}
+          />
+        ) : null}
+      </div>
+      {/* 底部按钮 */}
+      <div className='B34btn'>
+        {['3', '4'].includes(key) && topInfo.audits && topInfo.audits.length ? (
+          <Button type='primary' onClick={() => setAuditsShow(true)}>
+            申请记录
+          </Button>
+        ) : null}
+
+        {key === '4' ? (
+          lookBtn
+        ) : (
+          <>
+            {key === '3' ? (
+              <Button type='primary' onClick={() => btnClickFu('审批')}>
+                审批
+              </Button>
+            ) : (
+              <Button type='primary' onClick={() => btnClickFu(key === '1' ? '创建' : '保存')}>
+                {key === '1' ? '创建' : '保存'}
+              </Button>
+            )}
+
+            {key === '1' ? (
+              <Button type='primary' onClick={() => btnClickFu('草稿')}>
+                存草稿
+              </Button>
+            ) : null}
+
+            <MyPopconfirm
+              txtK='取消'
+              onConfirm={() => history.push(`/${type === '入馆' ? 'entering' : 'enterTibet'}`)}
+            />
+          </>
+        )}
+      </div>
+
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+
+      {/* 选中藏品弹窗 */}
+      {nowSta.id ? (
+        <ZGaddNow
+          nowSta={nowSta}
+          closeFu={() => setNowSta({ key: '', id: '' })}
+          dataResFu={data => {
+            //需要过滤掉已经有id的-不替换数据,没有id的替换数据 因为数据可能已经在另外一个弹窗更新了
+            const nowIds = snaps.map(v => v.id)
+            let dataRes = data.map((v, i) => {
+              if (nowIds.includes(v.id)) return snaps[i]
+              else return v
+            })
+
+            dataRes.forEach(v => {
+              // id2表示的是自己这条数据的id id才是goodsId
+              const obj = snapsID2ref.current.find(c => c.goodsId === v.id)
+
+              if (obj) v.id2 = obj.id
+            })
+
+            setSnaps(dataRes)
+          }}
+          oldCheckArr={snaps}
+        />
+      ) : null}
+
+      {openInfo.id ? (
+        <B34MoAdd
+          info={openInfo}
+          closeFu={() => setOpenInfo({} as C1GoodType)}
+          type={type}
+          succFu={(obj, newFlag) => {
+            if (newFlag) {
+              // 是新增
+              setSnaps([obj, ...snaps])
+            } else {
+              setSnaps(
+                snaps.map(v => {
+                  if (v.id === obj.id) return obj
+                  else return v
+                })
+              )
+            }
+          }}
+          look={['3', '4'].includes(key)}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoB34edit = React.memo(B34edit)
+
+export default MemoB34edit

+ 30 - 0
src/pages/B_enterTibet/B34typeIn/index.module.scss

@@ -0,0 +1,30 @@
+.B34typeIn {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 24px 0;
+  :global {
+    .B34top {
+      display: flex;
+      justify-content: space-between;
+      margin-bottom: 15px;
+      .B34topll {
+        display: flex;
+        & > div {
+          position: relative;
+          margin-right: 15px;
+          display: flex;
+          align-items: center;
+          .ant-input {
+            width: 160px;
+          }
+        }
+      }
+      .ant-select-selection-placeholder {
+        color: black;
+      }
+    }
+    .ant-table-cell {
+      padding: 8px !important;
+    }
+  }
+}

+ 338 - 0
src/pages/B_enterTibet/B34typeIn/index.tsx

@@ -0,0 +1,338 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { useDispatch, useSelector } from 'react-redux'
+import { B1baseFormData } from '../B1collect/data'
+import { FourAPI_del, FourAPI_getList } from '@/store/action/FourAll'
+import { MessageFu } from '@/utils/message'
+import history, { btnFlagFu } from '@/utils/history'
+import { FourTableType } from '../B1collect/type'
+import { Button, DatePicker, Input, Select } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { RootState } from '@/store'
+import dayjs from 'dayjs'
+import ExportJsonExcel from 'js-export-excel'
+import { B34TableC, statusObj } from '@/utils/tableData'
+import { selectObj } from '@/utils/select'
+import MyTable from '@/components/MyTable'
+const { RangePicker } = DatePicker
+
+type Props = {
+  type: '入馆' | '入藏'
+}
+
+function B34typeIn({ type }: Props) {
+  const dispatch = useDispatch()
+
+  const [formData, setFormData] = useState(B1baseFormData)
+  const formDataRef = useRef(B1baseFormData)
+  const formDataOldRef = useRef(B1baseFormData)
+
+  useEffect(() => {
+    formDataRef.current = formData
+  }, [formData])
+
+  // 点击搜索的 时间戳
+  const [timeKey, setTimeKey] = useState(0)
+
+  // 点击搜索
+  const clickSearch = useCallback(() => {
+    setFormData({ ...formData, pageNum: 1 })
+    setTimeout(() => {
+      setTimeKey(Date.now())
+    }, 50)
+  }, [formData])
+
+  // 时间选择器改变
+
+  const timeChange = useCallback(
+    (date: any, dateString: any) => {
+      let businessTimeStart = ''
+      let businessTimeEnd = ''
+      if (dateString[0] && dateString[1]) {
+        businessTimeStart = dateString[0] + ' 00:00:00'
+        businessTimeEnd = dateString[1] + ' 23:59:59'
+      }
+      setFormData({ ...formData, businessTimeStart, businessTimeEnd })
+    },
+    [formData]
+  )
+
+  const timeChange2 = useCallback(
+    (date: any, dateString: any) => {
+      let startTime = ''
+      let endTime = ''
+      if (dateString[0] && dateString[1]) {
+        startTime = dateString[0] + ' 00:00:00'
+        endTime = dateString[1] + ' 23:59:59'
+      }
+      setFormData({ ...formData, startTime, endTime })
+    },
+    [formData]
+  )
+
+  // 封装发送请求的函数
+  const getListFu = useCallback(() => {
+    formDataOldRef.current = { ...formDataRef.current }
+    dispatch(FourAPI_getList(formDataRef.current, type === '入馆' ? '1' : '2'))
+  }, [dispatch, type])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu, timeKey])
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setFormData(B1baseFormData)
+    setTimeout(() => {
+      setTimeKey(Date.now())
+    }, 50)
+  }, [])
+
+  // 页码变化
+  const paginationChange = useCallback(
+    (pageNum: number, pageSize: number) => {
+      setFormData({ ...formData, pageNum, pageSize })
+      setTimeout(() => {
+        setTimeKey(Date.now())
+      }, 50)
+    },
+    [formData]
+  )
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await FourAPI_del(type === '入馆' ? '1' : '2', id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功')
+        getListFu()
+      }
+    },
+    [getListFu, type]
+  )
+
+  // 点击各种操作按钮
+  const tableBtnFu = useCallback(
+    (id: number, key: string) => {
+      let url = type === '入馆' ? '/entering' : '/enterTibet'
+      history.push(`${url}_edit/${key}/${id}`)
+    },
+    [type]
+  )
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: FourTableType) => {
+          let obj = btnFlagFu(item)
+          return !Object.values(obj).some(Boolean) ? (
+            '-'
+          ) : (
+            <>
+              {obj['编辑'] ? (
+                <Button size='small' type='text' onClick={() => tableBtnFu(item.id, '2')}>
+                  编辑
+                </Button>
+              ) : null}
+
+              {obj['审批'] ? (
+                <Button size='small' type='text' onClick={() => tableBtnFu(item.id, '3')}>
+                  审批
+                </Button>
+              ) : null}
+              {obj['查看'] ? (
+                <Button size='small' type='text' onClick={() => tableBtnFu(item.id, '4')}>
+                  查看
+                </Button>
+              ) : null}
+
+              {obj['删除'] ? (
+                <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+              ) : null}
+            </>
+          )
+        }
+      }
+    ]
+  }, [delTableFu, tableBtnFu])
+
+  // 从仓库拿数据
+  const tableInfo = useSelector(
+    (state: RootState) => state.FourAll.listObj[type === '入馆' ? '1' : '2']
+  )
+
+  // 点击导出
+  const deriveFu = useCallback(async () => {
+    const name = `藏品${type}` + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
+
+    const res = await FourAPI_getList(
+      {
+        ...formDataOldRef.current,
+        pageNum: 1,
+        pageSize: 99999
+      },
+      type === '入馆' ? '1' : '2',
+      true
+    )
+
+    if (res.code === 0) {
+      if (res.data.records.length <= 0) return MessageFu.warning('当前搜索条件没有数据!')
+
+      const option = {
+        fileName: name,
+        datas: [
+          {
+            sheetData: res.data.records.map((v: FourTableType) => ({
+              ...v,
+              status: statusObj[v.status as 1]
+            })),
+            sheetName: name,
+            sheetFilter: ['date', 'num', 'deptName', 'creatorName', 'createTime', 'status'],
+            sheetHeader: [
+              `${type}日期`,
+              `${type}凭证号`,
+              '发起部门',
+              '发送人',
+              '发起日期',
+              '申请状态'
+            ],
+            columnWidths: [10, 10, 10, 10, 10, 10]
+          }
+        ]
+      }
+
+      const toExcel = new ExportJsonExcel(option) //new
+      toExcel.saveExcel() //保存
+    }
+  }, [type])
+
+  function txtChangeFu(value: string, arg1: string): void {
+    throw new Error('Function not implemented.')
+  }
+
+  return (
+    <div className={styles.B34typeIn}>
+      <div className='pageTitle'>藏品{type}</div>
+
+      <div className='B34top'>
+        <div className='B34topll'>
+          <div>
+            <span>{type}日期范围:</span>
+            <RangePicker
+              value={
+                formData.businessTimeStart
+                  ? [dayjs(formData.businessTimeStart), dayjs(formData.businessTimeEnd)]
+                  : null
+              }
+              onChange={timeChange}
+            />
+          </div>
+
+          <div>
+            <span>{type}凭证号:</span>
+            <Input
+              placeholder={`请输入${type}凭证号`}
+              maxLength={30}
+              value={formData.num}
+              onChange={e => txtChangeFu(e.target.value, 'num')}
+            />
+          </div>
+
+          <div>
+            <span>发起部门:</span>
+            <Input
+              placeholder='请输入发起部门'
+              maxLength={30}
+              value={formData.deptName}
+              onChange={e => txtChangeFu(e.target.value, 'deptName')}
+            />
+          </div>
+          <div>
+            <span>发起人:</span>
+            <Input
+              placeholder='请输入发起人'
+              maxLength={30}
+              value={formData.userName}
+              onChange={e => txtChangeFu(e.target.value, 'userName')}
+            />
+          </div>
+        </div>
+        <div className='B34toprr'>
+          <Button type='primary' onClick={deriveFu}>
+            批量导出
+          </Button>
+          &emsp;
+          <Button
+            type='primary'
+            onClick={() =>
+              history.push(`/${type === '入馆' ? 'entering' : 'enterTibet'}_edit/1/null`)
+            }
+          >
+            新增
+          </Button>
+        </div>
+      </div>
+
+      <div className='B34top'>
+        <div className='B34topll'>
+          <div>
+            <span>发起日期范围:</span>
+            <RangePicker
+              value={
+                formData.startTime ? [dayjs(formData.startTime), dayjs(formData.endTime)] : null
+              }
+              onChange={timeChange2}
+            />
+          </div>
+          <div>
+            <span>申请状态:</span>
+            <Select
+              allowClear={true}
+              placeholder='全部'
+              style={{ width: 198 }}
+              value={formData.status ? formData.status : null}
+              onChange={e => setFormData({ ...formData, status: e })}
+              options={selectObj['申请状态'].filter(v => v.label !== '待盘点')}
+            />
+          </div>
+
+          <div>
+            <span>选择角色:</span>
+            <Select
+              allowClear={true}
+              style={{ width: 198 }}
+              placeholder='全部'
+              options={selectObj['角色']}
+              // fieldNames={{ value: 'id', label: 'roleName' }}
+              value={formData.userType ? formData.userType : null}
+              onChange={e => setFormData({ ...formData, userType: e })}
+            />
+          </div>
+        </div>
+        <div className='B34toprr'>
+          <Button type='primary' onClick={clickSearch}>
+            查询
+          </Button>
+          &emsp;<Button onClick={resetSelectFu}>重置</Button>
+        </div>
+      </div>
+
+      {/* 表格 */}
+      <MyTable
+        yHeight={610}
+        list={tableInfo.list}
+        columnsTemp={B34TableC(type)}
+        lastBtn={tableLastBtn}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={tableInfo.total}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+      />
+    </div>
+  )
+}
+
+const MemoB34typeIn = React.memo(B34typeIn)
+
+export default MemoB34typeIn

+ 9 - 0
src/pages/B_enterTibet/B3entering/B3edit.tsx

@@ -0,0 +1,9 @@
+import React from 'react'
+import B34edit from '../B34typeIn/B34edit'
+function B3edit() {
+  return <B34edit type='入馆' />
+}
+
+const MemoB3edit = React.memo(B3edit)
+
+export default MemoB3edit

+ 0 - 4
src/pages/B_enterTibet/B3entering/index.module.scss

@@ -1,4 +0,0 @@
-.B3entering {
-  :global {
-  }
-}

+ 2 - 7
src/pages/B_enterTibet/B3entering/index.tsx

@@ -1,12 +1,7 @@
 import React from 'react'
-import styles from './index.module.scss'
+import B34typeIn from '../B34typeIn'
 function B3entering() {
-  return (
-    <div className={styles.B3entering}>
-      <div className='pageTitle'>藏品入馆</div>
-      <h1>开发中</h1>
-    </div>
-  )
+  return <B34typeIn type='入馆' />
 }
 
 const MemoB3entering = React.memo(B3entering)

+ 9 - 0
src/pages/B_enterTibet/B4enterTibet/B4edit.tsx

@@ -0,0 +1,9 @@
+import React from 'react'
+import B34edit from '../B34typeIn/B34edit'
+function B4edit() {
+  return <B34edit type='入藏' />
+}
+
+const MemoB4edit = React.memo(B4edit)
+
+export default MemoB4edit

+ 0 - 4
src/pages/B_enterTibet/B4enterTibet/index.module.scss

@@ -1,4 +0,0 @@
-.B4enterTibet {
-  :global {
-  }
-}

+ 2 - 7
src/pages/B_enterTibet/B4enterTibet/index.tsx

@@ -1,12 +1,7 @@
 import React from 'react'
-import styles from './index.module.scss'
+import B34typeIn from '../B34typeIn'
 function B4enterTibet() {
-  return (
-    <div className={styles.B4enterTibet}>
-      <div className='pageTitle'>藏品入藏</div>
-      <h1>开发中</h1>
-    </div>
-  )
+  return <B34typeIn type='入藏' />
 }
 
 const MemoB4enterTibet = React.memo(B4enterTibet)

+ 49 - 21
src/pages/C_goodsManage/C1register/AddGoods/index.tsx

@@ -42,6 +42,9 @@ export const cascaderChArr = [
   'dictAgeFirst'
 ]
 
+// 下拉框为空的时候转变成null
+export const addZiSelectChArr = ['numName', 'dictLevel', 'accountType']
+
 type Props = {
   closeFu: () => void
   nowSta: { key: string; id: string }
@@ -75,13 +78,17 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
         // dateMaking inGoodsDate 2个日期需要格式处理一下
         const obj = editSnap && editSnap.id ? { ...editSnap } : { ...res.data }
         if (obj.dateMaking) obj.dateMaking = dayjs(obj.dateMaking)
-        if (obj.inGoodsDate) obj.inGoodsDate = dayjs(obj.inGoodsDate)
+        // 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(',')
         })
+
+        addZiSelectChArr.forEach(v => {
+          if (!obj[v]) obj[v] = null
+        })
         FormBoxRef.current?.setFieldsValue(obj)
 
         // 设置封面图
@@ -234,11 +241,18 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
 
   // 没有通过校验
   const onFinishFailed = useCallback((info: any) => {
-    MessageFu.warning('请完善必填字段')
-
     const values = info.values || {}
-    if (!values.qualityDictScope || !values.source) setTabTxt('附属信息')
-    else setTabTxt('基本信息')
+    const errArr = info.errorFields
+    if (errArr.some((v: any) => v.name.includes('inGoodsDate'))) {
+      setTabTxt('附属信息')
+      MessageFu.warning('请输入正确的入藏日期格式')
+    } else if (!values.qualityDictScope || !values.source) {
+      setTabTxt('附属信息')
+      MessageFu.warning('请完善附属信息必填字段')
+    } else {
+      setTabTxt('基本信息')
+      MessageFu.warning('请完善基本信息必填字段')
+    }
   }, [])
 
   // 通过校验点击确定
@@ -265,8 +279,8 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
       }
 
       // 2个日期的格式处理
-      let inGoodsDate = ''
-      if (values.inGoodsDate) inGoodsDate = dayjs(values.inGoodsDate).format('YYYY-MM-DD')
+      // 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')
 
@@ -285,6 +299,10 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
         thumbPc = imgArr[0].filePath
       }
 
+      let idRes = nowSta.id === 'null' ? null : Number(nowSta.id)
+
+      if (selectArr.current.length && selectArr.current[0].id) idRes = selectArr.current[0].id
+
       const obj = {
         ...values,
         thumb,
@@ -292,14 +310,9 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
         rtf: JSON.stringify(rtf.val || ''),
         fileIds,
         fileSet,
-        inGoodsDate,
+        // inGoodsDate,
         dateMaking,
-        id:
-          nowSta.id === 'null'
-            ? selectArr.current.length
-              ? selectArr.current[0].id
-              : null
-            : Number(nowSta.id)
+        id: idRes
       }
 
       for (const k in obj) {
@@ -311,7 +324,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
         if (values[v]) obj[v] = values[v].join(',')
       })
       // if (1 + 1 === 2) {
-      //   console.log(123, obj, staTxt.current)
+      //   console.log(123, obj)
       //   return
       // }
 
@@ -355,7 +368,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
           await API_C2dels(fileDelIdArr.current)
         }
 
-        const res = await API_goodsAdd(obj, nowSta.id === 'null' ? '新增' : '编辑')
+        const res = await API_goodsAdd(obj, idRes ? '编辑' : '新增')
         if (res.code === 0) {
           MessageFu.success(nowSta.id === 'null' ? `${staTxt.current}成功` : '编辑成功')
           succFu(res.data, nowSta.id === 'null' ? '新增' : '编辑', staTxt.current as '提交')
@@ -376,7 +389,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
 
   const [tabTxt, setTabTxt] = useState('基本信息')
 
-  // 从入馆藏品中登记
+  // 从入馆入藏藏品中登记
   const [selectOne, setSelectOne] = useState(false)
   const selectArr = useRef<C1GoodType[]>([])
 
@@ -399,7 +412,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
         <div className='AddGtitRR'>
           {nowSta.id === 'null' ? (
             <>
-              <Button onClick={() => setSelectOne(true)}>从入馆藏中登记</Button>&emsp;
+              <Button onClick={() => setSelectOne(true)}>从入馆藏中登记</Button>&emsp;
               <Button onClick={() => history.push('/goodEdit')}>查看历史记录</Button>
             </>
           ) : null}
@@ -819,8 +832,23 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
               </div>
 
               <div className='B3Nrow'>
-                <Form.Item label='入藏日期' name='inGoodsDate'>
-                  <DatePicker placeholder='请选择日期' />
+                <Form.Item
+                  label='入藏日期'
+                  name='inGoodsDate'
+                  rules={[
+                    {
+                      pattern: /^(?:\d{4}(?:-(0[1-9]|1[0-2])(?:-(0[1-9]|[12]\d|3[01]))?)?)?$/,
+                      message: '格式应为YYYY、YYYY-MM或YYYY-MM-DD(如2000、2000-01、2000-01-01)'
+                    }
+                  ]}
+                  getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
+                >
+                  <Input
+                    maxLength={10}
+                    showCount
+                    placeholder='请输入日期'
+                    onKeyPress={e => /[^0-9-]/.test(e.key) && e.preventDefault()}
+                  />
                 </Form.Item>
               </div>
 
@@ -956,7 +984,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
         </Form>
       </div>
 
-      {/* 从入馆藏品中选择一个 */}
+      {/* 从入馆入藏藏品中选择一个 */}
       {selectOne ? (
         <ZGaddNow
           register={true}

+ 1 - 1
src/pages/C_goodsManage/C3focus/index.tsx

@@ -131,7 +131,7 @@ function C3focus() {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

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

@@ -120,7 +120,7 @@ function D1goods({ lookData, TreeDom, tableId }: Props) {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

+ 1 - 1
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -255,7 +255,7 @@ function D4edit() {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

+ 1 - 1
src/pages/D_storeManage/D6putsStor/D6edit/index.tsx

@@ -210,7 +210,7 @@ function D6edit() {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

+ 1 - 1
src/pages/D_storeManage/D8cancel/D8edit/index.tsx

@@ -182,7 +182,7 @@ function D8edit() {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

+ 1 - 1
src/pages/E_goodsStorage/E2damaged/E2edit/index.tsx

@@ -168,7 +168,7 @@ function E2edit() {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

+ 1 - 1
src/pages/E_goodsStorage/E3actuality/E3edit/index.tsx

@@ -170,7 +170,7 @@ function E3edit() {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

+ 1 - 1
src/pages/E_goodsStorage/E4repair/E4edit/index.tsx

@@ -215,7 +215,7 @@ function E4edit() {
               onClick={() => setCathet(item.id)}
               className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
             >
-              {item.num}
+              {item.num || '(空)'}
             </span>
           )
         }

+ 12 - 0
src/pages/Layout/data.ts

@@ -393,5 +393,17 @@ export const routerSon: RouterTypeRow[] = [
     name: '藏品注销-新增、编辑、审批/查看',
     path: '/cancel_edit/:key/:id',
     Com: React.lazy(() => import('../D_storeManage/D8cancel/D8edit'))
+  },
+  {
+    id: 19,
+    name: '藏品入馆-新增、编辑、审批/查看',
+    path: '/entering_edit/:key/:id',
+    Com: React.lazy(() => import('../B_enterTibet/B3entering/B3edit'))
+  },
+  {
+    id: 20,
+    name: '藏品入藏-新增、编辑、审批/查看',
+    path: '/enterTibet_edit/:key/:id',
+    Com: React.lazy(() => import('../B_enterTibet/B4enterTibet/B4edit'))
   }
 ]

+ 23 - 18
src/pages/Y_goodsDetails/Y2look/index.tsx

@@ -5,7 +5,6 @@ import { Y1tabArr, Y1TabArrType } from '../Y1cathet/Y1main'
 import classNames from 'classnames'
 import { Button, Dropdown, MenuProps } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
-import history from '@/utils/history'
 import Y11com from '../Y1cathet/Y11com'
 import Y22com from '../Y1cathet/Y22com'
 import Y33com from '../Y1cathet/Y33com'
@@ -162,23 +161,29 @@ function Y2look() {
               &emsp;
             </>
           ) : null}
-          <Button type='primary' onClick={handleExport}>
-            藏品卡片
-          </Button>
-          &emsp;
-          <Dropdown menu={{ items: items1 }} placement='bottom' arrow>
-            <Button type='primary'>档案管理</Button>
-          </Dropdown>
-          &emsp;
-          <Dropdown menu={{ items: items2 }} placement='bottom' arrow>
-            <Button type='primary'>分库管理</Button>
-          </Dropdown>
-          &emsp;
-          <Dropdown menu={{ items: items3 }} placement='bottom' arrow>
-            <Button type='primary'>保管管理</Button>
-          </Dropdown>
-          &emsp;
-          <Button onClick={() => history.go(-1)}>返回</Button>
+
+          {info.display === 1 ? (
+            <>
+              <Button type='primary' onClick={handleExport}>
+                藏品卡片
+              </Button>
+              &emsp;
+              <Dropdown menu={{ items: items1 }} placement='bottom' arrow>
+                <Button type='primary'>档案管理</Button>
+              </Dropdown>
+              &emsp;
+              <Dropdown menu={{ items: items2 }} placement='bottom' arrow>
+                <Button type='primary'>分库管理</Button>
+              </Dropdown>
+              &emsp;
+              <Dropdown menu={{ items: items3 }} placement='bottom' arrow>
+                <Button type='primary'>保管管理</Button>
+              </Dropdown>
+              &emsp;
+            </>
+          ) : null}
+
+          {/* <Button onClick={() => history.go(-1)}>返回</Button> */}
         </div>
       </div>
 

+ 27 - 1
src/utils/tableData.ts

@@ -78,8 +78,8 @@ export const B1TableC2 = [
 
 // 藏品鉴定里面的藏品清单
 export const B2TableC2 = [
-  ['img', '封面图', 'thumb'],
   ['txt', '登记号类型', 'numName'],
+  ['img', '封面图', 'thumb'],
   ['txt', '分类号', 'numType'],
   ['txt', '文物名称', 'name'],
   ['ping', '数量', 'pcs', 'pcsUnit'],
@@ -92,6 +92,32 @@ export const B2TableC2 = [
   ['text', '备注', 'intro', 50]
 ]
 
+// 藏品入馆、入藏
+export const B34TableC = (type: '入馆' | '入藏') => {
+  return [
+    ['txt', `${type}日期`, 'date'],
+    ['txt', `${type}凭证号`, 'num'],
+    ['txt', '发起部门', 'deptName'],
+    ['txt', '发起人', 'creatorName'],
+    ['txt', '发起日期', 'createTime'],
+    ['txtChange', '申请状态', 'status', statusObj]
+  ]
+}
+
+// 藏品入馆、入藏里面的表单
+export const B34TableC2 = [
+  ['txt', '登记号类型', 'numName'],
+  ['img', '封面图', 'thumb'],
+  ['txt', '名称', 'name'],
+  ['ping', '数量/单位', 'pcs', 'pcsUnit'],
+  ['txtC', '时代', 'dictAge'],
+  ['txtC', '质地', 'dictTexture3'],
+  ['txtC', '完残情况', 'dictTorn'],
+  ['txtC', '来源', 'source'],
+  ['txt', '处理情况', 'accountType'],
+  ['text', '备注', 'intro', 50]
+]
+
 export const B3eTableC = [
   ['img', '封面图', 'thumb'],
   ['txt', '编号类型', 'numName'],