shaogen1995 3 mesiacov pred
rodič
commit
e043188e6c

+ 2 - 2
src/pages/A3_ledger/A32Routing/index.tsx

@@ -352,10 +352,10 @@ function A32Routing() {
           设置分账
         </Button>
         <div>
-          <Button type='primary' onClick={() => setRecycleBin(true)}>
+          {/* <Button type='primary' onClick={() => setRecycleBin(true)}>
             回收站
           </Button>
-          &emsp;
+          &emsp; */}
           <Button type='primary' onClick={() => setImportPage(true)}>
             数据导入
           </Button>

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

@@ -306,10 +306,10 @@ function C1ledger() {
         )}
 
         <div className={classNames(advanced ? 'C1toprrKai' : 'C1toprrSuo')}>
-          <Button type='primary' onClick={() => setRecycleBin(true)} hidden={antiqueSearch}>
+          {/* <Button type='primary' onClick={() => setRecycleBin(true)} hidden={antiqueSearch}>
             回收站
           </Button>
-          &emsp;
+          &emsp; */}
           <Button type='primary' onClick={() => setImportPage(true)} hidden={antiqueSearch}>
             数据导入
           </Button>

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

@@ -91,4 +91,6 @@ export type FourTableType = {
 
   // v1.1.1藏品鉴定-核准单位
   confirmUnit: string
+  // 事故登记的藏品编号
+  goodsNum: string
 }

+ 19 - 6
src/pages/B_enterTibet/B3goodsTable/B3GaddNow/index.tsx

@@ -20,9 +20,19 @@ type Props = {
   isOne?: boolean //从藏品编辑进来 只能选择一个藏品
   oldCheckArr: C1GoodType[]
   canObj?: any //其他页面带过来的参数
+  // 藏品登记-只选择一个
+  register?: boolean
 }
 
-function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu, oldCheckArr, canObj }: Props) {
+function B3GaddNow({
+  nowSta,
+  closeFu,
+  isOne = false,
+  dataResFu,
+  oldCheckArr,
+  canObj,
+  register
+}: Props) {
   // 入藏状态特别过滤
   const RuChangSelect = useMemo(() => {
     let arr = selectObj['入藏状态']
@@ -106,8 +116,9 @@ function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu, oldCheckArr, can
     (item: C1GoodType) => {
       // 藏品编辑只能单选
       if (isOne) {
-        if (checkArr && checkArr.length && item.id === checkArr[0].id) setCheckArr([])
-        else setCheckArr([item])
+        if (checkArr && checkArr.length && item.id === checkArr[0].id) {
+          setCheckArr([])
+        } else setCheckArr([item])
       } else {
         if (checkArr.map(v => v.id).includes(item.id))
           setCheckArr(checkArr.filter(v => v.id !== item.id))
@@ -155,8 +166,9 @@ function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu, oldCheckArr, can
   const btnOk = useCallback(() => {
     dataResFu(checkArr)
     if (!isOne) MessageFu.success('提交成功')
+    if (register) MessageFu.success(checkArr.length ? '信息带入成功' : '信息清空成功')
     closeFu()
-  }, [checkArr, closeFu, dataResFu, isOne])
+  }, [checkArr, closeFu, dataResFu, isOne, register])
 
   // 顶部筛选
   const searchDom = useCallback(
@@ -208,7 +220,8 @@ function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu, oldCheckArr, can
       open={true}
       title={
         <div className='B3Gtit'>
-          <div>选择藏品</div> <div>已选中 {resNum} 条</div>
+          <div>选择藏品</div>{' '}
+          {register ? <div>不选中则清空外层表单数据</div> : <div>已选中 {resNum} 条</div>}
         </div>
       }
       footer={
@@ -255,7 +268,7 @@ function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu, oldCheckArr, can
         />
 
         <div className='B3GaMainBtn'>
-          <Button type='primary' disabled={resNum === 0 && isOne} onClick={btnOk}>
+          <Button type='primary' disabled={resNum === 0 && isOne && !register} onClick={btnOk}>
             提交
           </Button>
           &emsp;

+ 12 - 0
src/pages/C_goodsManage/C1register/AddGoods/data.ts

@@ -0,0 +1,12 @@
+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
+}

+ 234 - 0
src/pages/C_goodsManage/C1register/AddGoods/index.module.scss

@@ -0,0 +1,234 @@
+.AddGoods {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 0px 24px;
+  width: 100%;
+  height: 100%;
+
+  :global {
+    .AddGtit {
+      display: flex;
+      justify-content: space-between;
+      margin-bottom: 20px;
+      padding: 0 24px;
+      padding-bottom: 10px;
+      border-bottom: 1px solid #ccc;
+      .AddGtitLL {
+        .ant-btn {
+          margin-right: 20px;
+        }
+      }
+    }
+
+    .B3Nred {
+      color: #ff4d4f;
+    }
+
+    .B3Nmain {
+      padding: 0 24px;
+      height: calc(100% - 42px);
+      overflow-y: auto;
+      width: calc(100% - 150px);
+      .B3Ntit {
+        font-size: 16px;
+        font-weight: 700;
+        padding-left: 15px;
+        position: relative;
+        margin-bottom: 15px;
+        &::before {
+          position: absolute;
+          left: 0px;
+          top: 50%;
+          transform: translateY(-50%);
+          content: '';
+          width: 6px;
+          height: 16px;
+          background-color: var(--themeColor);
+        }
+      }
+      .ant-form-item-label {
+        width: 100px;
+      }
+
+      .B3Nbox {
+        width: 100%;
+        display: flex;
+        justify-content: space-between;
+        flex-wrap: wrap;
+        align-items: self-start;
+        margin-bottom: 24px;
+        .B3Nrow {
+          width: 48%;
+          display: flex;
+          position: relative;
+          .ant-input {
+            width: 400px;
+          }
+          .ant-picker {
+            width: 462px;
+          }
+          textarea {
+            width: 462px !important;
+          }
+          .ant-select-selector {
+            width: 464px;
+          }
+
+          .B3Nrowll {
+            width: 100px;
+            text-align: right;
+          }
+          .B3Nrowrr {
+            width: calc(100% - 100px);
+            word-wrap: break-word;
+          }
+
+          // 一些定位的盒子
+          .B3NrowDing {
+            position: absolute;
+            top: 60px;
+            left: 0;
+            .ant-select-selector {
+              width: 464px;
+            }
+          }
+          // 具体质量
+          .B3NrowDing2 {
+            display: flex;
+            .ant-input-number {
+              width: 205px;
+            }
+            .ant-select-selector {
+              width: 260px;
+            }
+          }
+        }
+        .B3Nrow0 {
+          .ant-input {
+            width: 260px;
+          }
+          .ant-input-number {
+            width: 325px;
+          }
+          .ant-select-selector {
+            width: 140px;
+          }
+        }
+
+        // 质地
+        .B3Nrow1 {
+          .ant-select-selector {
+            width: 156px;
+          }
+        }
+
+        // 左边数字填写 右边级联
+        .B3NrowNumOrCas {
+          .ant-input-number {
+            width: 140px;
+          }
+          .ant-select-selector {
+            width: 325px;
+          }
+        }
+
+        // 封面
+        .formRow {
+          width: 48%;
+          display: flex;
+          .formLeft {
+            width: 100px;
+            text-align: right;
+            & > span {
+              color: #ff4d4f;
+            }
+          }
+        }
+
+        // 备注 富文本
+        .formRow2 {
+          width: 100%;
+          .formLeft {
+            position: relative;
+            top: 5px;
+          }
+          .formRightSize {
+            // 尺寸
+            display: flex;
+
+            .ant-form-item-label {
+              width: 60px;
+            }
+
+            .ant-input-number {
+              width: 205px;
+            }
+            .ant-select-selector {
+              width: 205px;
+            }
+          }
+        }
+
+        // 著者 版本 存卷
+        .B3Nrow2 {
+          flex-direction: column;
+          .ant-form-item {
+            width: 565px;
+          }
+        }
+
+        // 一些比较长的label字段
+        .B3NlongTxt {
+          .ant-form-item-label {
+            position: relative;
+            left: -7px;
+          }
+        }
+        .B3NlongTxt2 {
+          .ant-form-item-label label {
+            font-size: 13px;
+          }
+        }
+      }
+
+      .B3Nbox1 {
+        // 相关附件
+        .B3Ntit {
+          width: 600px;
+          display: flex;
+          .B3Ntitll {
+            position: relative;
+            top: 3px;
+            & > span {
+              font-size: 12px;
+              color: #999;
+            }
+          }
+          #Z3upFiles {
+            margin-left: 20px;
+            width: auto;
+          }
+        }
+        .tableImgAuto {
+          display: flex;
+          justify-content: center;
+        }
+        .ant-table-cell {
+          text-align: center;
+          padding: 8px !important;
+        }
+      }
+
+      .B3Nbtn {
+        position: absolute;
+        top: 50%;
+        transform: translateY(-50%);
+        right: 36px;
+        .ant-btn {
+          width: 74px;
+          display: block;
+        }
+      }
+    }
+  }
+}

+ 956 - 0
src/pages/C_goodsManage/C1register/AddGoods/index.tsx

@@ -0,0 +1,956 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { Button, Cascader, DatePicker, Form, FormInstance, Input, InputNumber, Select } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import TextArea from 'antd/es/input/TextArea'
+import ZRichTexts from '@/components/ZRichTexts'
+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 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/A3_ledger/C1ledger/type'
+import { MessageFu } from '@/utils/message'
+import history, { cascaderObjFu } from '@/utils/history'
+import B3GaddNow from '@/pages/B_enterTibet/B3goodsTable/B3GaddNow'
+
+// 级联的数据转换成字符串
+export const cascaderChArr = [
+  'dictType',
+  'dictAge',
+  'pcsUnit',
+  'dictTexture1',
+  'dictTexture2',
+  'dictTexture3',
+  'dictTorn',
+  'sizeUnit',
+  'qualityDictScope',
+  'qualityUnit',
+  'inDictDateScope',
+  'source',
+  'dictHouse1',
+  'dictHouse2',
+  // 其他模块有的级联字段
+  'dictAgeFirst'
+]
+
+type Props = {
+  closeFu: () => void
+  nowSta: { key: string; id: string }
+  isEdit: boolean //藏品编辑模块
+  succFu: (
+    obj: C1GoodType,
+    type: '新增' | '编辑',
+    sta: '存草稿' | '提交',
+    flieNew?: GoodFileType[],
+    fileOld?: GoodFileType[]
+  ) => void
+}
+
+function AddGoods({ nowSta, closeFu, succFu, isEdit }: Props) {
+  // 制档日期 / 制档人
+  const [txtArr, setTxtArr] = useState([getTokenInfo().user.realName, dayjs().format('YYYY-MM-DD')])
+
+  // 藏品编辑模块用来对比
+  const objOld = useRef<any>({})
+
+  // 编辑进来获取详情
+  const getInfo = useCallback(async (id: number) => {
+    const res = await API_goodsInfo(id)
+    if (res.code === 0) {
+      // 藏品编辑信息保存
+      objOld.current = { ...res.data }
+
+      // 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))
+    }
+  }, [getInfo, nowSta.id])
+
+  // 设置表单ref
+  const FormBoxRef = useRef<FormInstance>(null)
+
+  // 年代是否选择了其他
+  const [ageAc, setAgeAc] = useState(false)
+
+  // 封面图的ref
+  // const ZupThumbRef = useRef<any>(null)
+
+  // 富文本的ref
+  const ZRichTextRef = useRef<any>(null)
+
+  // 上传附件的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 disabledSelect = useCallback(
+    (id: number) => {
+      let flag = false
+      if (isEdit) {
+        if (objOld.current && objOld.current.file && objOld.current.file.length) {
+          const oldFileIds: number[] = objOld.current.file.map((v: any) => v.id)
+          if (oldFileIds.includes(id)) flag = true
+        }
+      }
+      return flag
+    },
+    [isEdit]
+  )
+
+  // 相关附件的操作
+  const startBtn = useMemo(() => {
+    return [
+      {
+        width: 100,
+        title: '缩略图/视频',
+        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.filePath} src={item.thumb} />
+            </div>
+          ) : fileVideoArr.includes(fileNameLast) ? (
+            <YtableVideo src={item.filePath} />
+          ) : (
+            ' - '
+          )
+        }
+      },
+      {
+        title: '附件类型',
+        render: (item: GoodFileType) => (
+          <Select
+            disabled={disabledSelect(item.id)}
+            style={{ width: 120 }}
+            placeholder='请选择'
+            value={item.type}
+            onChange={e => tableFu('type', item.id, e)}
+            options={selectObj['附件类型']}
+          />
+        )
+      },
+      {
+        title: '附件用途',
+        render: (item: GoodFileType) => (
+          <Cascader
+            disabled={disabledSelect(item.id)}
+            options={cascaderObjFu()['附件用途']}
+            value={item.effect ? item.effect.split(',') : []}
+            onChange={e => tableFu('effect', item.id, e ? e.join(',') : '')}
+            placeholder='请选择'
+            fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+          />
+        )
+      }
+    ]
+  }, [disabledSelect, tableFu])
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        width: 120,
+        title: '操作',
+        render: (item: GoodFileType) => {
+          return (
+            <>
+              <Button size='small' type='text'>
+                <a href={baseURL + item.filePath} download target='_blank' rel='noreferrer'>
+                  下载
+                </a>
+              </Button>
+              <MyPopconfirm
+                txtK='删除'
+                onConfirm={() => {
+                  setTable(table.filter(v => v.id !== item.id))
+                  fileDelIdArr.current.push(item.id)
+                }}
+              />
+            </>
+          )
+        }
+      }
+    ]
+  }, [table])
+
+  // 没有通过校验
+  const onFinishFailed = useCallback((info: any) => {
+    const values = info.values || {}
+    if (!values.qualityDictScope || !values.source) MessageFu.warning('请完善附属信息必填字段')
+    else MessageFu.warning('请完善基本信息必填字段')
+  }, [])
+
+  // 通过校验点击确定
+  const onFinish = useCallback(
+    async (values: any) => {
+      // 封面图
+      // 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')
+
+      // 默认以第一个附件为img的作为封面图
+      const imgArr = table.filter(v => {
+        const txtArr = v.fileName.split('.')
+        const txt = txtArr[txtArr.length - 1]
+        return v.type === 'img' && fileImgArr.includes(txt)
+      })
+
+      let thumb = ''
+      let thumbPc = ''
+
+      if (imgArr && imgArr.length) {
+        thumb = imgArr[0].thumb
+        thumbPc = imgArr[0].filePath
+      }
+
+      const obj = {
+        ...values,
+        thumb,
+        thumbPc,
+        rtf: JSON.stringify(rtf.val || ''),
+        fileIds,
+        fileSet,
+        inGoodsDate,
+        dateMaking,
+        id:
+          nowSta.id === 'null'
+            ? selectArr.current.length
+              ? selectArr.current[0].id
+              : null
+            : Number(nowSta.id)
+      }
+
+      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 (1 + 1 === 2) {
+      //   console.log(123, obj, staTxt.current)
+      //   return
+      // }
+
+      if (isEdit) {
+        // 藏品编辑模块
+        let flag = true
+
+        // fileIds 要特别处理
+        const fileNew = table.map(v => v.id).join(',')
+        const fileOld = (objOld.current.file || []).map((v: any) => v.id).join(',')
+
+        if (fileNew !== fileOld) flag = false
+
+        // console.log(fileNew, fileOld)
+
+        for (const k in obj) {
+          if (!['fileIds', 'fileSet'].includes(k)) {
+            if (objOld.current[k] !== obj[k]) {
+              flag = false
+            }
+          }
+        }
+
+        if (flag) return MessageFu.warning('未修改藏品信息')
+
+        // -----------藏品编辑模块进来---------------
+        MessageFu.success('编辑成功')
+        succFu(obj, '编辑', staTxt.current as '提交', table || [], objOld.current.file || [])
+        closeFu()
+      } else {
+        // 藏品登记模块
+        // 删除附件
+        if (fileDelIdArr.current.length) {
+          await API_C2dels(fileDelIdArr.current)
+        }
+
+        const res = await API_goodsAdd(obj, nowSta.id === 'null' ? '新增' : '编辑')
+        if (res.code === 0) {
+          MessageFu.success(nowSta.id === 'null' ? '新增成功' : '编辑成功')
+          succFu(res.data, nowSta.id === 'null' ? '新增' : '编辑', staTxt.current as '提交')
+          closeFu()
+        }
+      }
+    },
+    [closeFu, isEdit, nowSta.id, succFu, table]
+  )
+
+  // 点击提交 和存草稿
+  const staTxt = useRef('')
+  const btnOk = useCallback((val: '提交' | '存草稿') => {
+    staTxt.current = val
+    const btnDom = document.querySelector('#AddGoodsBtn') as HTMLDivElement
+    if (btnDom) btnDom.click()
+  }, [])
+
+  const [tabTxt, setTabTxt] = useState('基本信息')
+
+  // 从入馆藏品中登记
+  const [selectOne, setSelectOne] = useState(false)
+  const selectArr = useRef<C1GoodType[]>([])
+
+  return (
+    <div className={styles.AddGoods}>
+      <div className='AddGtit'>
+        <div className='AddGtitLL'>
+          {['基本信息', '附属信息', '附件信息'].map(v => (
+            <Button
+              onClick={() => setTabTxt(v)}
+              key={v}
+              type={tabTxt === v ? 'primary' : 'default'}
+            >
+              {v}
+            </Button>
+          ))}
+        </div>
+        <div className='AddGtitRR'>
+          <Button onClick={() => setSelectOne(true)}>从入馆藏品中登记</Button>&emsp;
+          <Button onClick={() => history.push('/goodEdit')}>查看历史记录</Button>
+        </div>
+      </div>
+
+      <div className='B3Nmain'>
+        <Form
+          scrollToFirstError={true}
+          ref={FormBoxRef}
+          name='basic'
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete='off'
+        >
+          {/* 基本信息 */}
+          <div hidden={tabTxt !== '基本信息'}>
+            <div className='B3Ntit'>档案信息</div>
+
+            <div className='B3Nbox'>
+              <div className='B3Nrow B3Nrow0'>
+                <Form.Item
+                  label='藏品编号'
+                  name='numName'
+                  rules={[{ required: true, message: '请选择编号类型' }]}
+                >
+                  <Select
+                    style={{ width: 140 }}
+                    options={selectObj['藏品编号类型']}
+                    placeholder='请选择'
+                  />
+                </Form.Item>
+
+                <Form.Item name='num' rules={[{ required: true, message: '请输入藏品编号' }]}>
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='分类号' name='numType'>
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <div className='B3Nrowll'>制档人:</div>
+                <div className='B3Nrowrr'>{txtArr[0]}</div>
+              </div>
+
+              <div className='B3Nrow'>
+                <div className='B3Nrowll'>制档日期:</div>
+                <div className='B3Nrowrr'>{txtArr[1]}</div>
+              </div>
+            </div>
+
+            <div className='B3Ntit'>藏品基本信息</div>
+
+            <div className='B3Nbox'>
+              <div className='B3Nrow'>
+                <Form.Item
+                  label='藏品名称'
+                  name='name'
+                  rules={[{ required: true, message: '请输入藏品名称' }]}
+                >
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+              <div className='B3Nrow'>
+                <Form.Item label='藏品原名' name='namePrimitive'>
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+              <div className='B3Nrow'>
+                <Form.Item
+                  label='文物级别'
+                  name='dictLevel'
+                  rules={[{ required: true, message: '请选择文物级别' }]}
+                >
+                  <Select options={selectObj['文物级别']} placeholder='请选择' />
+                </Form.Item>
+              </div>
+              <div className='B3Nrow'>
+                <Form.Item
+                  label='文物类别'
+                  name='dictType'
+                  rules={[{ required: true, message: '请选择文物类别' }]}
+                >
+                  <Cascader
+                    options={cascaderObjFu()['文物类别']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    allowClear={false}
+                  />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='馆内藏品分类1' name='dictHouse1'>
+                  <Cascader
+                    options={cascaderObjFu()['馆内分类1']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    allowClear={true}
+                    changeOnSelect
+                  />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='馆内藏品分类2' name='dictHouse2'>
+                  <Cascader
+                    options={cascaderObjFu()['馆内分类2']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    allowClear={true}
+                    changeOnSelect
+                  />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item
+                  label='年代'
+                  name='dictAge'
+                  rules={[{ required: true, message: '请选择年代' }]}
+                >
+                  <Cascader
+                    options={[...cascaderObjFu()['年代'], { name: '其他', id: '其他' }]}
+                    onChange={value => setAgeAc(value[0] === '其他')}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    allowClear={false}
+                  />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item
+                  label='具体年代'
+                  name='ageInfo'
+                  rules={[{ required: ageAc, message: '请输入内容' }]}
+                >
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='制作时间' name='dateMaking'>
+                  <DatePicker placeholder='请选择日期' />
+                </Form.Item>
+                <div className='B3NrowDing'>
+                  <Form.Item label='作者' name='author'>
+                    <Input maxLength={30} showCount placeholder='请输入内容' />
+                  </Form.Item>
+                </div>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='作者介绍' name='authorDesc'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow B3NrowNumOrCas'>
+                <Form.Item
+                  label='数量'
+                  name='pcs'
+                  rules={[{ required: true, message: '请输入正整数' }]}
+                >
+                  <InputNumber min={1} max={99999999} precision={0} placeholder='请输入正整数' />
+                </Form.Item>
+
+                <Form.Item name='pcsUnit' rules={[{ required: true, message: '请选择单位' }]}>
+                  <Cascader
+                    options={cascaderObjFu()['数量单位']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    allowClear={false}
+                  />
+                </Form.Item>
+              </div>
+              <div className='B3Nrow'>
+                <Form.Item label='实际数量' name='pcsActual'>
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow B3Nrow1'>
+                <Form.Item
+                  label={
+                    <div>
+                      <span className='B3Nred'> * </span>质地
+                    </div>
+                  }
+                  name='dictTexture1'
+                >
+                  <Cascader
+                    options={cascaderObjFu()['质地']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  />
+                </Form.Item>
+                <Form.Item name='dictTexture2'>
+                  <Cascader
+                    options={cascaderObjFu()['复合或组合质地']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  />
+                </Form.Item>
+                <Form.Item name='dictTexture3' rules={[{ required: true, message: '请选择质地3' }]}>
+                  <Cascader
+                    options={cascaderObjFu()['单一质地']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    allowClear={false}
+                  />
+                </Form.Item>
+
+                <div className='B3NrowDing'>
+                  <Form.Item
+                    label='完残程度'
+                    name='dictTorn'
+                    rules={[{ required: true, message: '请选择完残程度' }]}
+                  >
+                    <Cascader
+                      options={cascaderObjFu()['完残程度']}
+                      placeholder='请选择'
+                      fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                      allowClear={false}
+                    />
+                  </Form.Item>
+                </div>
+              </div>
+
+              {/* 封面 */}
+              {/* <div className='formRow'>
+              <div className='formLeft'>封面图:</div>
+              <div className='formRight'>
+                <ZupOne
+                  ref={ZupThumbRef}
+                  isLook={false}
+                  fileCheck={false}
+                  size={5}
+                  dirCode='goodsAdd'
+                  myUrl='cms/goods/upload'
+                  format={['image/jpeg', 'image/png']}
+                  formatTxt='png、jpg和jpeg'
+                  checkTxt='请上传封面图!'
+                  upTxt='最多1张'
+                  myType='thumb'
+                />
+              </div>
+            </div> */}
+
+              <div className='B3Nrow'>
+                <Form.Item label='完残情况' name='torn'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='保存状态' name='preserveState'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='色泽' name='color'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='用途' name='uses'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='形状描述' name='shape'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='著者' name='pressAuthor'>
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='版本' name='pressVersion'>
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+              <div className='B3Nrow'>
+                <Form.Item label='存卷' name='pressFile'>
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              {/* 备注 */}
+              <div className='formRow formRow2'>
+                <div className='formLeft'>备注:</div>
+                <div className='formRight'>
+                  <ZRichTexts
+                    check={false}
+                    dirCode='goodsAdd'
+                    myUrl='cms/goods/upload'
+                    isLook={false}
+                    ref={ZRichTextRef}
+                    isOne={true}
+                    upAudioBtnNone={true}
+                  />
+                </div>
+              </div>
+            </div>
+          </div>
+
+          {/* 附属信息 */}
+          <div hidden={tabTxt !== '附属信息'}>
+            <div className='B3Ntit'>尺寸和质量</div>
+
+            <div className='B3Nbox'>
+              <div className='formRow formRow2'>
+                <div className='formLeft'>尺寸:</div>
+                <div className='formRight formRightSize'>
+                  <Form.Item label='通长' name='sizeL'>
+                    <InputNumber
+                      min={0}
+                      max={99999999}
+                      precision={2}
+                      placeholder='请输入数字,最多两位小数'
+                    />
+                  </Form.Item>
+
+                  <Form.Item label='通宽' name='sizeW'>
+                    <InputNumber
+                      min={0}
+                      max={99999999}
+                      precision={2}
+                      placeholder='请输入数字,最多两位小数'
+                    />
+                  </Form.Item>
+                  <Form.Item label='通高' name='sizeH'>
+                    <InputNumber
+                      min={0}
+                      max={99999999}
+                      precision={2}
+                      placeholder='请输入数字,最多两位小数'
+                    />
+                  </Form.Item>
+
+                  <Form.Item name='sizeUnit'>
+                    <Cascader
+                      options={cascaderObjFu()['尺寸单位']}
+                      placeholder='请选择'
+                      fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    />
+                  </Form.Item>
+                </div>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item
+                  label='质量范围'
+                  name='qualityDictScope'
+                  rules={[{ required: true, message: '请选择质量范围' }]}
+                >
+                  <Cascader
+                    options={cascaderObjFu()['质量范围']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    allowClear={false}
+                  />
+                </Form.Item>
+
+                <div className='B3NrowDing B3NrowDing2'>
+                  <Form.Item label='具体质量' name='quality'>
+                    <InputNumber
+                      min={0}
+                      max={99999999}
+                      precision={2}
+                      placeholder='请输入数字,最多两位小数'
+                    />
+                  </Form.Item>
+
+                  <Form.Item name='qualityUnit'>
+                    <Cascader
+                      options={cascaderObjFu()['质量单位']}
+                      placeholder='请选择'
+                      fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    />
+                  </Form.Item>
+                </div>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='具体尺寸' name='sizeInfo'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+            </div>
+
+            <div className='B3Ntit'>入藏及来源</div>
+
+            <div className='B3Nbox'>
+              <div className='B3Nrow'>
+                <Form.Item label='入馆凭证号' name='inHouseNum'>
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+              <div className='B3Nrow'>
+                <Form.Item label='入藏凭证号' name='inGoodsNum'>
+                  <Input maxLength={30} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='入藏日期' name='inGoodsDate'>
+                  <DatePicker placeholder='请选择日期' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item
+                  label='入藏日期范围'
+                  className='B3NlongTxt'
+                  name='inDictDateScope'
+                  // rules={[{ required: true, message: '请选择入藏日期范围' }]}
+                >
+                  <Cascader
+                    options={cascaderObjFu()['入藏日期范围']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    allowClear={true}
+                  />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='入藏去向' name='accountType'>
+                  <Select options={selectObj['入藏去向']} placeholder='请选择' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item
+                  label='来源'
+                  name='source'
+                  rules={[{ required: true, message: '请选择来源' }]}
+                >
+                  <Cascader
+                    options={cascaderObjFu()['来源']}
+                    placeholder='请选择'
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                    allowClear={false}
+                  />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='来源详情' name='sourceInfo'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='B3Nrow'>
+                <Form.Item label='征集经过' name='sourcePass'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+              <div className='B3Nrow'>
+                <Form.Item label='铭记题跋' name='sourcePreface'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+              <div className='B3Nrow'>
+                <Form.Item label='鉴藏印记' name='sourceStamp'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+            </div>
+
+            <div className='B3Ntit'>藏品历史及流传</div>
+
+            <div className='B3Nbox'>
+              <div className='B3Nrow'>
+                <Form.Item label='著作及有关书目' className='B3NlongTxt2' name='historyWork'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+              <div className='B3Nrow'>
+                <Form.Item label='流传经历' name='historyUndergo'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+            </div>
+          </div>
+
+          {/* 附件信息 */}
+          <div className='B3Nbox B3Nbox1' hidden={tabTxt !== '附件信息'}>
+            <div className='B3Ntit'>
+              <div className='B3Ntitll'>
+                <span>附件类型为图像并且格式为图片的第一份数据为封面图</span>
+              </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={table}
+              columnsTemp={Y33tableC}
+              lastBtn={tableLastBtn}
+              startBtn={startBtn}
+              pagingInfo={false}
+            />
+          </div>
+
+          {/* 确定和取消按钮 */}
+          <Form.Item className='B3Nbtn'>
+            <Button type='primary' htmlType='submit' id='AddGoodsBtn' hidden>
+              提交
+            </Button>
+            <Button type='primary' onClick={() => btnOk('提交')}>
+              提交
+            </Button>
+            &emsp;
+            <Button type='primary' onClick={() => btnOk('存草稿')}>
+              存草稿
+            </Button>
+            &emsp;
+            {nowSta.key === '藏品登记' ? null : <MyPopconfirm txtK='取消' onConfirm={closeFu} />}
+          </Form.Item>
+        </Form>
+      </div>
+
+      {/* 从入馆藏品中选择一个 */}
+      {selectOne ? (
+        <B3GaddNow
+          register={true}
+          nowSta={{ key: '藏品登记', id: 'cms/register/goods/getList' }}
+          closeFu={() => setSelectOne(false)}
+          dataResFu={data => {
+            if (data.length && data[0].id) {
+              selectArr.current = data
+              getInfo(data[0].id)
+            } else {
+              selectArr.current = []
+              FormBoxRef.current?.setFieldsValue({})
+            }
+          }}
+          oldCheckArr={selectArr.current}
+          isOne={true}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoAddGoods = React.memo(AddGoods)
+
+export default MemoAddGoods

+ 21 - 0
src/pages/C_goodsManage/C1register/AddGoods/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
+}

+ 0 - 4
src/pages/C_goodsManage/C1register/index.module.scss

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

+ 94 - 7
src/pages/C_goodsManage/C1register/index.tsx

@@ -1,14 +1,101 @@
-import React from 'react'
-import styles from './index.module.scss'
-function C1register() {
+import React, { useCallback, useEffect, useRef, useState } from 'react'
+import AddGoods from './AddGoods'
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
+import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
+import {
+  FourAPI_create,
+  FourAPI_getInfo,
+  FourAPI_saveApply,
+  FourAPI_saveDraft
+} from '@/store/action/FourAll'
+import { MessageFu } from '@/utils/message'
+import history from '@/utils/history'
+function C21wealth() {
+  const [waiId, setWaiId] = useState('null')
+
+  useEffect(() => {
+    const url = window.location.href
+    if (url.includes('?id=')) {
+      const id = url.split('?id=')[1]
+      if (id) setWaiId(id)
+    }
+  }, [])
+
+  // 顶部数据
+  const [topInfo, setTopInfo] = useState({} as FourTableType)
+
+  // 藏品清单快照数据 待完善
+  const [snaps, setSnaps] = useState<C1GoodType[]>([])
+
+  // 藏品登记/藏品编辑、进来创建订单
+  const createFu = useCallback(async () => {
+    const res = await FourAPI_create('3')
+    if (res.code === 0) {
+      setTopInfo(res.data)
+    }
+  }, [])
+
+  // 获取详情
+  const getInfoFu = useCallback(async (id: string) => {
+    const res = await FourAPI_getInfo('3', 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)
+      // })
+      // setSnaps(arrTemp)
+    }
+  }, [])
+
+  useEffect(() => {
+    if (waiId === 'null') createFu()
+    else getInfoFu(waiId)
+  }, [createFu, getInfoFu, waiId])
+
   return (
-    <div className={styles.C1register}>
+    <div>
       <div className='pageTitle'>藏品登记</div>
-      <p>待开发</p>
+      <AddGoods
+        closeFu={() => {}}
+        nowSta={{ key: '藏品登记', id: 'null' }}
+        isEdit={false}
+        succFu={async (obj, type, sta) => {
+          const obj2 = {
+            ...topInfo,
+            goodsIds: obj.id + '',
+            snaps: [
+              {
+                goodsId: obj.id,
+                id: type === '新增' ? null : '待完善',
+                orderId: topInfo.id,
+                snap: JSON.stringify(obj)
+              }
+            ]
+          }
+          const res =
+            sta === '存草稿'
+              ? await FourAPI_saveDraft('3', obj2)
+              : await FourAPI_saveApply('3', obj2)
+
+          if (res.code === 0) {
+            history.push('/goodEdit')
+          }
+        }}
+      />
     </div>
   )
 }
 
-const MemoC1register = React.memo(C1register)
+const MemoC21wealth = React.memo(C21wealth)
 
-export default MemoC1register
+export default MemoC21wealth

+ 29 - 0
src/pages/C_goodsManage/C22goodEdit/data.ts

@@ -0,0 +1,29 @@
+type C22baseFormDataType = {
+  pageSize: number
+  pageNum: number
+  num: string
+  name: string
+  type: string
+  deptName: string
+  userName: string
+  startTime: string
+  endTime: string
+  status: string
+  userType: string
+}
+
+export type C22InputKeyType = keyof C22baseFormDataType
+
+export const C22baseFormData: C22baseFormDataType = {
+  pageSize: 10,
+  pageNum: 1,
+  num: '',
+  name: '',
+  type: '',
+  deptName: '',
+  userName: '',
+  startTime: '',
+  endTime: '',
+  status: '',
+  userType: ''
+}

+ 26 - 0
src/pages/C_goodsManage/C22goodEdit/index.module.scss

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

+ 294 - 2
src/pages/C_goodsManage/C22goodEdit/index.tsx

@@ -1,10 +1,302 @@
-import React from 'react'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
+import ExportJsonExcel from 'js-export-excel'
+import { selectObj } from '@/utils/select'
+import { Button, DatePicker, Input, Select } from 'antd'
+import { useDispatch, useSelector } from 'react-redux'
+import { C22baseFormData, C22InputKeyType } from './data'
+import { C6_APIdel, C6_APIgetList } from '@/store/action/C6edit'
+import { RootState } from '@/store'
+import { MessageFu } from '@/utils/message'
+import dayjs from 'dayjs'
+import { C6tableC, statusObj } from '@/utils/tableData'
+import MyTable from '@/components/MyTable'
+import classNames from 'classnames'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+const { RangePicker } = DatePicker
+
 function C22goodEdit() {
+  const dispatch = useDispatch()
+
+  const [formData, setFormData] = useState(C22baseFormData)
+  const formDataRef = useRef(C22baseFormData)
+  const formDataOldRef = useRef(C22baseFormData)
+
+  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 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(C6_APIgetList(formDataRef.current))
+  }, [dispatch])
+
+  // 输入框的改变
+  const txtChangeFu = useCallback(
+    (txt: string, key: C22InputKeyType) => {
+      setFormData({
+        ...formData,
+        [key]: txt
+      })
+    },
+    [formData]
+  )
+
+  // 从仓库中获取数据
+  const tableInfo = useSelector((state: RootState) => state.C6edit.tableInfo)
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setFormData(C22baseFormData)
+    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 C6_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu, timeKey])
+
+  // 打开侧边栏
+  const [cathet, setCathet] = useState(0)
+
+  const startBtn = useMemo(() => {
+    return [
+      {
+        title: '藏品编号',
+        render: (item: FourTableType) => {
+          return (
+            <span
+              onClick={() => setCathet(Number(item.goodsIds))}
+              className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
+            >
+              {item.goodsNum || '(空)'}
+            </span>
+          )
+        }
+      }
+    ]
+  }, [cathet])
+
+  // 点击导出
+  const deriveFu = useCallback(async () => {
+    const name = '藏品编辑' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
+
+    const res = await C6_APIgetList(
+      {
+        ...formDataOldRef.current,
+        pageNum: 1,
+        pageSize: 99999
+      },
+      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: [
+              'goodsNum',
+              'goodsName',
+              'num',
+              'typeName',
+              'deptName',
+              'creatorName',
+              'createTime',
+              'status'
+            ],
+
+            sheetHeader: [
+              '藏品编号',
+              '藏品名称',
+              '业务单号',
+              '编辑类型',
+              '发起部门',
+              '发送人',
+              '发起日期',
+              '申请状态'
+            ],
+            columnWidths: [10, 10, 10, 10, 10, 10, 10, 10]
+          }
+        ]
+      }
+
+      const toExcel = new ExportJsonExcel(option) //new
+      toExcel.saveExcel() //保存
+    }
+  }, [])
+
   return (
     <div className={styles.C22goodEdit}>
       <div className='pageTitle'>藏品编辑</div>
-      <p>待开发</p>
+      <div className='C22top'>
+        <div className='C22topll'>
+          <div>
+            <span>业务单号:</span>
+            <Input
+              placeholder='请输入业务单号'
+              maxLength={30}
+              value={formData.num}
+              onChange={e => txtChangeFu(e.target.value, 'num')}
+            />
+          </div>
+          <div>
+            <span>编辑类型:</span>
+            <Select
+              allowClear={true}
+              placeholder='全部'
+              style={{ width: 198 }}
+              value={formData.type ? formData.type : null}
+              onChange={e => setFormData({ ...formData, type: e })}
+              options={[
+                { value: 'DJ', label: '藏品登记' },
+                { value: 'BJ', label: '藏品编辑' }
+              ]}
+            />
+          </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='C22toprr'>
+          <Button type='primary' onClick={deriveFu}>
+            批量导出
+          </Button>
+        </div>
+      </div>
+
+      <div className='C22top'>
+        <div className='C22topll'>
+          <div>
+            <span>发起日期范围:</span>
+            <RangePicker
+              value={
+                formData.startTime ? [dayjs(formData.startTime), dayjs(formData.endTime)] : null
+              }
+              onChange={timeChange}
+            />
+          </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='B1toprr'>
+          <Button type='primary' onClick={clickSearch}>
+            查询
+          </Button>
+          &emsp;<Button onClick={resetSelectFu}>重置</Button>
+        </div>
+      </div>
+
+      {/* 表格 */}
+      <MyTable
+        yHeight={610}
+        list={tableInfo.list}
+        columnsTemp={C6tableC}
+        startBtn={startBtn}
+        lastBtn={[]}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={tableInfo.total}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+      />
+
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
     </div>
   )
 }

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

@@ -323,7 +323,7 @@ function C2files() {
                 <Select
                   allowClear={true}
                   placeholder='全部'
-                  value={formData[item.key]}
+                  value={formData[item.key] ? formData[item.key] : null}
                   onChange={e => txtChangeFu(e, item.key)}
                   options={item.data}
                 />

+ 30 - 4
src/pages/E_goodsStorage/E1accident/index.tsx

@@ -15,6 +15,8 @@ import { E1inputKeyArr } from './data'
 import { selectObj } from '@/utils/select'
 import MyTable from '@/components/MyTable'
 import { E1tableC, statusObj } from '@/utils/tableData'
+import classNames from 'classnames'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
 const { RangePicker } = DatePicker
 
 const E1baseFormData: E1FormType = {
@@ -123,6 +125,27 @@ function E1accident() {
     history.push(`/accident_edit/${key}/${id}`)
   }, [])
 
+  // 打开侧边栏
+  const [cathet, setCathet] = useState(0)
+
+  const startBtn = useMemo(() => {
+    return [
+      {
+        title: '藏品编号',
+        render: (item: FourTableType) => {
+          return (
+            <span
+              onClick={() => setCathet(Number(item.goodsIds))}
+              className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
+            >
+              {item.goodsNum}
+            </span>
+          )
+        }
+      }
+    ]
+  }, [cathet])
+
   const tableLastBtn = useMemo(() => {
     return [
       {
@@ -189,11 +212,11 @@ function E1accident() {
             })),
             sheetName: name,
             sheetFilter: [
+              'goodsNum',
+              'numName',
               'num',
               'date',
               'sonTypeName',
-              'numName',
-              'goodsNum',
               'goodsName',
               'authUser',
               'creatorName',
@@ -201,11 +224,11 @@ function E1accident() {
               'status'
             ],
             sheetHeader: [
+              '藏品编号',
+              '编号类型',
               '申请编号',
               '事故时间',
               '事故责任',
-              '编号类型',
-              '藏品编号',
               '藏品名称',
               '鉴定人',
               '发起人',
@@ -299,12 +322,15 @@ function E1accident() {
         yHeight={610}
         list={tableInfo.list}
         columnsTemp={E1tableC}
+        startBtn={startBtn}
         lastBtn={tableLastBtn}
         pageNum={formData.pageNum}
         pageSize={formData.pageSize}
         total={tableInfo.total}
         onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
       />
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
     </div>
   )
 }

+ 8 - 7
src/pages/Layout/data.ts

@@ -82,6 +82,13 @@ const tabLeftArr: RouterType = [
         path: '/register',
         Com: React.lazy(() => import('../C_goodsManage/C1register'))
       },
+
+      {
+        id: 480,
+        name: '藏品注销',
+        path: '/cancel',
+        Com: React.lazy(() => import('../D_storeManage/D8cancel'))
+      },
       {
         id: 320,
         name: '藏品附件',
@@ -107,7 +114,7 @@ const tabLeftArr: RouterType = [
         name: '藏品关注',
         path: '/focus',
         Com: React.lazy(() => import('../C_goodsManage/C3focus'))
-      },
+      }
       // 待完善v1.1.1去掉之前的模块
       // {
       //   id: 350,
@@ -124,12 +131,6 @@ const tabLeftArr: RouterType = [
       //   Com: React.lazy(() => import('../C_goodsManage/C6edit'))
       // },
 
-      {
-        id: 480,
-        name: '藏品注销',
-        path: '/cancel',
-        Com: React.lazy(() => import('../D_storeManage/D8cancel'))
-      }
       // 待完善v1.1.1去掉之前的模块
       // {
       //   id: 370,

+ 1 - 1
src/store/action/FourAll.ts

@@ -49,7 +49,7 @@ export const FourAPI_create = (key: FourKeyType) => {
 /**
  * 详情
  */
-export const FourAPI_getInfo = (key: FourKeyType, id: number) => {
+export const FourAPI_getInfo = (key: FourKeyType, id: string) => {
   const urlObj = {
     1: `cms/orderHouse/detail/${id}`,
     2: `cms/orderHide/detail/${id}`,

+ 13 - 2
src/utils/tableData.ts

@@ -147,6 +147,7 @@ export const C1tableC = [
   ['txtChange', '库存状态', 'statusStorage', statusStorageObj]
 ]
 
+// 藏品附件 的藏品编号可以不用点击
 export const C2tableC = [
   ['txt', '藏品名称', 'goodName'],
   ['txt', '编号类型', 'goodNumName'],
@@ -165,6 +166,17 @@ export const C4tableC = [
   ['txt', '异常数据行数', 'hang3']
 ]
 
+// V1.1.1藏品编辑
+export const C6tableC = [
+  ['txt', '藏品名称', 'goodsName'],
+  ['txt', '业务单号', 'num'],
+  ['txt', '编辑类型', 'typeName'],
+  ['txt', '发起部门', 'deptName'],
+  ['txt', '发送人', 'creatorName'],
+  ['txt', '发起日期', 'createTime'],
+  ['txtChange', '申请状态', 'status', statusObj]
+]
+
 export const D1tableC = [
   ['txt', '区域名称', 'regionName'],
   ['txt', '排架', 'layer1'],
@@ -220,11 +232,10 @@ export const D4goodsTableC = [
 ]
 
 export const E1tableC = [
+  ['txt', '编号类型', 'numName'],
   ['txt', '申请编号', 'num'],
   ['txt', '事故时间', 'date'],
   ['txt', '事故责任', 'sonTypeName'],
-  ['txt', '编号类型', 'numName'],
-  ['txt', '藏品编号', 'goodsNum'],
   ['txt', '藏品名称', 'goodsName'],
   ['txt', '鉴定人', 'authUser'],
   ['txt', '发起人', 'creatorName'],