浏览代码

藏品鉴定-真几把难写

shaogen1995 3 月之前
父节点
当前提交
05245850c9

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

@@ -122,6 +122,24 @@ function MyTable({
         // 这个模块特有的级联控制
         txtC: (item: any) =>
           v[1] === '年代' && item[v[2]] === '其他' ? '其他' : resJiLianFu(item[v[2]]),
+        // 尺寸
+        size: (item: any) => {
+          let danWei = resJiLianFu(item.sizeUnit, ' ')
+
+          let txt1 = item.sizeL ? `通长${item.sizeL}` : ''
+          let txt2 = item.sizeW ? `通宽${item.sizeW}` : ''
+          let txt3 = item.sizeH ? `通高${item.sizeH}` : ''
+
+          txt1 = txt1 ? txt1 + danWei : ''
+          txt2 = txt2 ? txt2 + danWei : ''
+          txt3 = txt3 ? txt3 + danWei : ''
+
+          let arr = [txt1, txt2, txt3]
+          arr = arr.filter(v => v)
+
+          if (!txt1 && !txt2 && !txt3) return '(空)'
+          else return arr.join(' - ')
+        },
         img: (item: any) =>
           v[3] && !item[v[2]] ? (
             <div dangerouslySetInnerHTML={{ __html: v[3] }}></div>
@@ -146,7 +164,7 @@ function MyTable({
 
           if (v[4]) {
             tempCom = tableComObj(v[4], [tempCom, item[v[2]]], item.id, v[5])
-          } else if (item[v[2]].length >= v[3]) {
+          } else if ((item[v[2]] || '').length >= v[3]) {
             tempCom = (
               <span style={{ cursor: 'pointer' }} title={item[v[2]]}>
                 {tempCom}

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

@@ -134,7 +134,7 @@ function Z3upFiles(
   }))
 
   return (
-    <div className={styles.Z3upFiles}>
+    <div className={styles.Z3upFiles} id='Z3upFiles'>
       <input
         id='upInput'
         type='file'

+ 29 - 4
src/components/ZupTypes/index.tsx

@@ -49,6 +49,7 @@ type Props = {
   lastImgTxt?: string //加载最后面的上传提示
   oneIsCover?: boolean //是否将第一张作为封面
   isOneType?: boolean //是否类型为单选
+  fromData?: any
 }
 
 function ZupTypes(
@@ -69,7 +70,8 @@ function ZupTypes(
     isUpName = false,
     lastImgTxt = '',
     oneIsCover = false,
-    isOneType = false
+    isOneType = false,
+    fromData
   }: Props,
   ref: any
 ) {
@@ -195,6 +197,12 @@ function ZupTypes(
           fd.append('isCompress', 'true')
         }
 
+        if (fromData) {
+          for (const k in fromData) {
+            if (fromData[k]) fd.append(k, fromData[k])
+          }
+        }
+
         e.target.value = ''
 
         const res = await API_upFile(fd, myUrl)
@@ -215,7 +223,18 @@ function ZupTypes(
         }
       }
     },
-    [audioSize, dirCode, fileList, fileOneType, imgSize, isUpName, modelSize, myUrl, videoSize]
+    [
+      audioSize,
+      dirCode,
+      fileList,
+      fileOneType,
+      fromData,
+      imgSize,
+      isUpName,
+      modelSize,
+      myUrl,
+      videoSize
+    ]
   )
 
   // 附件图片的拖动
@@ -341,6 +360,7 @@ function ZupTypes(
   // --------------让父组件调用的返回 附件 信息
   const fileComFileResFu = useCallback(() => {
     let coverUrl = ''
+    let coverPcUrl = ''
     const fileIds = []
     if (fileList.model.id && typeCheck.includes('model')) fileIds.push(fileList.model.id)
     if (fileList.audio.id && typeCheck.includes('audio')) fileIds.push(fileList.audio.id)
@@ -352,6 +372,7 @@ function ZupTypes(
           if (oneIsCover && i === 0) {
             // 返回 第一张图的url 作为封面
             coverUrl = v.thumb || v.filePath
+            coverPcUrl = v.filePath
           }
         }
       })
@@ -360,7 +381,8 @@ function ZupTypes(
       sonType: typeCheck,
       sonFileIds: fileIds,
       sonIsOk: fileCheckFu,
-      coverUrl
+      coverUrl,
+      coverPcUrl
     }
   }, [
     fileCheckFu,
@@ -437,7 +459,7 @@ function ZupTypes(
         ref={myInput}
         onChange={e => handeUpPhoto2(e)}
       />
-      <div>
+      <div hidden={isOneType}>
         {isOneType ? (
           <>
             {typeCheckArr.map(v => (
@@ -529,6 +551,9 @@ function ZupTypes(
                 />
               </div>
             ))}
+            {fileList.img.length === 0 && oneIsCover ? (
+              <span style={{ position: 'relative', top: -2 }}>(空)</span>
+            ) : null}
           </div>
         </div>
 

+ 137 - 0
src/pages/B_enterTibet/B1collect/B1edit/B1MoAdd/index.module.scss

@@ -0,0 +1,137 @@
+.B1MoAdd {
+  :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;
+    }
+
+    .B1Mmain {
+      padding-top: 15px;
+      width: 1200px;
+      height: 753px;
+      overflow-y: auto;
+      padding: 24px;
+
+      .B1MformBox {
+        display: flex;
+        justify-content: space-between;
+        flex-wrap: wrap;
+        .ant-form-item {
+          width: calc(50% - 20px);
+        }
+
+        .B1Mrow {
+          width: 100%;
+          display: flex;
+          margin-bottom: 20px;
+          .B1Mrowll {
+            width: 98px;
+            text-align: right;
+            position: relative;
+            top: 3px;
+            & > span {
+              color: #ff4b1f;
+            }
+          }
+          .B1Mrowrr {
+            width: calc(100% - 98px);
+            .ant-input-affix-wrapper {
+              width: 300px;
+            }
+            .ant-select {
+              width: 300px;
+            }
+          }
+        }
+        // 封面
+        .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: 200px;
+                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;
+            }
+          }
+          .B3NrowDing2 {
+            position: absolute;
+            top: 65px;
+            left: 0;
+            .ant-input-number {
+              width: 457px;
+            }
+          }
+        }
+      }
+
+      .ant-form-item-label {
+        max-width: 98px;
+        min-width: 98px;
+      }
+
+      .B1Mbtn {
+        position: absolute;
+        top: 50%;
+        transform: translateY(-50%);
+        right: 52px;
+        .ant-btn {
+          display: block;
+        }
+      }
+    }
+  }
+}

+ 310 - 0
src/pages/B_enterTibet/B1collect/B1edit/B1MoAdd/index.tsx

@@ -0,0 +1,310 @@
+import React, { useCallback, useEffect, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { Button, Cascader, Form, FormInstance, Input, InputNumber, Modal } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import TextArea from 'antd/es/input/TextArea'
+import Z3upFiles from '@/components/Z3upFiles'
+import { B1X_APIgetInfo, B1X_APIsave } from '@/store/action/B1collect'
+import { MessageFu } from '@/utils/message'
+import { cascaderObjFu } from '@/utils/history'
+import ZupTypes from '@/components/ZupTypes'
+import { B1Xtype } from '../../data'
+import { cascaderChArr } from '@/pages/B_enterTibet/B3goodsTable/B3GaddNew'
+
+type Props = {
+  sId: number
+  closeFu: () => void
+  succFu: (val: B1Xtype, txt: '新增' | '编辑') => void
+  look?: boolean
+}
+
+function B1MoAdd({ sId, closeFu, succFu, look = false }: Props) {
+  const [file, setFile] = useState([])
+
+  const getInfoFu = useCallback(async (id: number) => {
+    const res = await B1X_APIgetInfo(id)
+    if (res.code === 0) {
+      const obj: any = { ...res.data }
+      cascaderChArr.forEach(v => {
+        if (obj[v]) obj[v] = obj[v].split(',')
+      })
+      FormBoxRef.current?.setFieldsValue({
+        ...obj
+      })
+
+      // 设置附件
+      setFile(obj.file || [])
+
+      // 设置图片
+      imgRef.current?.setFileComFileFu({
+        type: 'img',
+        fileList: obj.img || []
+      })
+    }
+  }, [])
+
+  useEffect(() => {
+    if (sId > 0) getInfoFu(sId)
+  }, [getInfoFu, sId])
+
+  // 设置表单初始数据(区分编辑和新增)
+  const FormBoxRef = useRef<FormInstance>(null)
+
+  // 没有通过校验
+  const onFinishFailed = useCallback(() => {
+    // return MessageFu.warning("有表单不符号规则!");
+  }, [])
+
+  // 通过校验点击确定
+  const onFinish = useCallback(
+    async (values: any) => {
+      // 上传附件
+      const filesRes = filesRef.current.filesIdRes()
+
+      // 上传图片
+      const { sonFileIds, coverUrl, coverPcUrl } = imgRef.current?.fileComFileResFu()
+
+      const obj = {
+        ...values,
+        fileIds: filesRes.join(','),
+        id: sId > 0 ? sId : null,
+        imgIds: 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(',')
+      })
+
+      const res = await B1X_APIsave(obj)
+
+      if (res.code === 0) {
+        MessageFu.success(sId > 0 ? '编辑成功' : '新增成功')
+        succFu(res.data, sId > 0 ? '编辑' : '新增')
+        closeFu()
+      }
+    },
+    [closeFu, sId, succFu]
+  )
+
+  // 上传附件的ref
+  const filesRef = useRef<any>(null)
+
+  // 上传图片的ref
+  const imgRef = useRef<any>(null)
+
+  return (
+    <Modal
+      wrapClassName={styles.B1MoAdd}
+      destroyOnClose
+      open={true}
+      title={look ? '查看' : sId > 0 ? '编辑' : '新增'}
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='B1Mmain'>
+        <Form
+          scrollToFirstError={true}
+          ref={FormBoxRef}
+          name='basic'
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete='off'
+        >
+          <div className='B1MformBox'>
+            <Form.Item label='名称' name='name' rules={[{ required: true, message: '请输入名称' }]}>
+              <Input readOnly={look} maxLength={30} showCount placeholder='请输入内容' />
+            </Form.Item>
+
+            <Form.Item label='初定年代' name='dictAgeFirst'>
+              <Cascader
+                disabled={look}
+                options={cascaderObjFu()['年代']}
+                placeholder={look ? '(空)' : '请选择'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+              />
+            </Form.Item>
+
+            <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='dictType'>
+              <Cascader
+                disabled={look}
+                options={cascaderObjFu()['文物类别']}
+                placeholder={look ? '(空)' : '请选择'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+              />
+            </Form.Item>
+
+            <div className='formRow formRow2'>
+              <div className='formLeft'>尺寸:</div>
+              <div className='formRight formRightSize'>
+                <Form.Item label='通长' name='sizeL'>
+                  <InputNumber
+                    readOnly={look}
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder={look ? '(空)' : '请输入数字,最多两位小数'}
+                  />
+                </Form.Item>
+
+                <Form.Item label='通宽' name='sizeW'>
+                  <InputNumber
+                    readOnly={look}
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder={look ? '(空)' : '请输入数字,最多两位小数'}
+                  />
+                </Form.Item>
+                <Form.Item label='通高' name='sizeH'>
+                  <InputNumber
+                    readOnly={look}
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder={look ? '(空)' : '请输入数字,最多两位小数'}
+                  />
+                </Form.Item>
+
+                <Form.Item name='sizeUnit'>
+                  <Cascader
+                    disabled={look}
+                    options={cascaderObjFu()['尺寸单位']}
+                    placeholder={look ? '(空)' : '请选择单位'}
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  />
+                </Form.Item>
+              </div>
+            </div>
+
+            <div className='B3NrowDing'>
+              <Form.Item label='重量' name='quality'>
+                <InputNumber
+                  readOnly={look}
+                  min={0}
+                  max={99999999}
+                  precision={2}
+                  placeholder={look ? '(空)' : '请输入数字,最多两位小数'}
+                />
+              </Form.Item>
+
+              <Form.Item name='qualityUnit'>
+                <Cascader
+                  disabled={look}
+                  options={cascaderObjFu()['质量单位']}
+                  placeholder={look ? '(空)' : '请选择单位'}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                />
+              </Form.Item>
+
+              <div className='B3NrowDing2'>
+                <Form.Item label='报价(万元)' name='offer'>
+                  <InputNumber
+                    readOnly={look}
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder={look ? '(空)' : '请输入数字,最多两位小数'}
+                  />
+                </Form.Item>
+              </div>
+            </div>
+
+            <Form.Item label='介绍' name='intro'>
+              <TextArea readOnly={look} maxLength={200} showCount placeholder='请输入内容' />
+            </Form.Item>
+
+            <Form.Item label='原持有人' name='holder'>
+              <Input readOnly={look} maxLength={30} showCount placeholder='请输入内容' />
+            </Form.Item>
+
+            <Form.Item label='征集方式' name='source'>
+              <Cascader
+                disabled={look}
+                options={cascaderObjFu()['来源']}
+                placeholder={look ? '(空)' : '请选择'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+              />
+            </Form.Item>
+            <div className='B1Mrow' style={{ marginTop: -20 }}>
+              <div className='B1Mrowll' style={{ top: 20 }}>
+                图片:
+              </div>
+              <div className='B1Mrowrr'>
+                <ZupTypes
+                  isEdit={false}
+                  ref={imgRef}
+                  selecFlag='图片'
+                  fileCheck={false}
+                  isLook={look}
+                  imgLength={30}
+                  isTypeShow={true}
+                  oneIsCover={true}
+                  isOneType={true}
+                  dirCode='B1collectSon'
+                  myUrl='cms/goods/upload'
+                />
+              </div>
+            </div>
+
+            <div className='B1Mrow'>
+              <div className='B1Mrowll'>附件:</div>
+              <div className='B1Mrowrr'>
+                <Z3upFiles
+                  max={10}
+                  isLook={look}
+                  ref={filesRef}
+                  fileCheck={false}
+                  dirCode='B1collectSon'
+                  myUrl='cms/goods/upload'
+                  lookData={file}
+                  size={500}
+                />
+              </div>
+            </div>
+          </div>
+
+          {/* 确定和取消按钮 */}
+          <Form.Item className='B1Mbtn'>
+            {look ? (
+              <Button onClick={closeFu}>关闭</Button>
+            ) : (
+              <>
+                <Button type='primary' htmlType='submit'>
+                  提交
+                </Button>
+                &emsp;
+                <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+              </>
+            )}
+          </Form.Item>
+        </Form>
+      </div>
+    </Modal>
+  )
+}
+
+const MemoB1MoAdd = React.memo(B1MoAdd)
+
+export default MemoB1MoAdd

+ 297 - 27
src/pages/B_enterTibet/B1collect/B1edit/index.tsx

@@ -1,85 +1,320 @@
-import React, { useCallback, useMemo, useState } from 'react'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { useParams } from 'react-router-dom'
 import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
 import { Button, DatePicker } from 'antd'
 import { MessageFu } from '@/utils/message'
 import MyTable from '@/components/MyTable'
-import { B1TableC2 } from '@/utils/tableData'
+import { B1TableC2, statusObj } from '@/utils/tableData'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { FourTableType } from '../../B3_4page/type'
 import B3flowTable from '../../B3flowTable'
-import history from '@/utils/history'
+import history, { btnFlagFu2 } from '@/utils/history'
+import {
+  B1_APIcreate,
+  B1_APIdel,
+  B1_APIgetInfo,
+  B1_APIrevocation,
+  B1_APIsaveApply,
+  B1_APIsaveAudit,
+  B1_APIsaveCreate,
+  B1_APIsaveDraft
+} from '@/store/action/B1collect'
+import dayjs from 'dayjs'
+import { EXbtnFu } from '@/utils/EXBtn'
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
+import B1MoAdd from './B1MoAdd'
+import { B1Xtype } from '../data'
+import ZupFileTable from '@/components/ZupFileTable'
 
-// 待完善 静态页面
 function B1edit() {
   const { key, id } = useParams<any>()
   // key:1 新增 2编辑 3审批 4查看
 
-  // 顶部数据
-  const [topInfo, setTopInfo] = useState({} as FourTableType)
+  // 滚到顶部
+  const sollrDom = useRef<HTMLDivElement>(null)
+
+  // -------新增藏品-------------
+  const [openId, setOpenId] = useState(0)
+
+  const [clueArr, setClueArr] = useState<B1Xtype[]>([])
 
   const tableLastBtn = useMemo(() => {
     return [
       {
+        title: '附件数量',
+        render: (item: any) => (item.fileIds ? item.fileIds.split(',').length : 0)
+      },
+      {
         title: '操作',
         render: (item: any) => {
           return (
             <>
-              <Button size='small' type='text'>
+              <Button size='small' type='text' onClick={() => setOpenId(item.id)}>
                 {['3', '4'].includes(key) ? '查看' : '编辑'}
               </Button>
-              {['3', '4'].includes(key) ? null : <MyPopconfirm txtK='删除' onConfirm={() => {}} />}
+              {['3', '4'].includes(key) ? null : (
+                <MyPopconfirm
+                  txtK='删除'
+                  onConfirm={() => setClueArr(clueArr.filter(v => v.id !== item.id))}
+                />
+              )}
             </>
           )
         }
       }
     ]
-  }, [key])
-
-  // 申请记录
-  const [auditsShow, setAuditsShow] = useState(false)
+  }, [clueArr, key])
+  // -------新增藏品-------------
 
-  const btnClickFu = useCallback((val: string) => {
-    MessageFu.warning('开发中')
+  // 顶部数据
+  const [topInfo, setTopInfo] = useState({} as FourTableType)
+  // 创建订单
+  const creatFu = useCallback(async () => {
+    const res = await B1_APIcreate()
+    if (res.code === 0) {
+      setTopInfo(res.data)
+    }
   }, [])
 
+  // 获取详情
+  const getInfoFu = useCallback(async () => {
+    const res = await B1_APIgetInfo(id)
+    if (res.code === 0) {
+      setTopInfo(res.data)
+      setClueArr(res.data.collects || [])
+    }
+  }, [id])
+
+  useEffect(() => {
+    if (key === '1') creatFu()
+    else getInfoFu()
+
+    if (sollrDom.current) sollrDom.current.scrollTop = 0
+  }, [creatFu, getInfoFu, key])
+
+  // 审批意见的ref
+  const ZAuditRef = useRef<any>(null)
+
+  const timeChange = useCallback(
+    (e: any) => {
+      setTopInfo({ ...topInfo, date: dayjs(e).format('YYYY-MM-DD') })
+    },
+    [topInfo]
+  )
+  // 审批的sta
+  const [auditSta, setAuDitSta] = useState('')
+
+  // 新增的底部按钮点击
+  const btnClickFu = useCallback(
+    async (val: '草稿' | '创建' | '保存' | '审批') => {
+      if (val !== '草稿') {
+        if (clueArr.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 B1_APIsaveAudit({
+          orderId: topInfo.id,
+          rtfOpinion: rtf2,
+          status: auditSta === '同意' ? 1 : 2
+        })
+
+        if (res.code === 0) {
+          MessageFu.success('审批成功')
+          // 跳详情页
+          history.push(`/collect_edit/4/${topInfo.id}`)
+        }
+      } else {
+        const obj = {
+          ...topInfo,
+          collectIds: clueArr.map(v => v.id).join(',')
+        }
+        // console.log(123, obj)
+
+        // if (1 + 1 === 2) return
+
+        if (val === '草稿') {
+          // 存草稿 当前页保存 不跳转
+          const res = await B1_APIsaveDraft(obj)
+          if (res.code === 0) {
+            MessageFu.success('草稿保存成功')
+          }
+        } else {
+          const res = val === '创建' ? await B1_APIsaveCreate(obj) : await B1_APIsaveApply(obj)
+          if (res.code === 0) {
+            MessageFu.success(`${val}成功`)
+            // 跳到详情页
+            history.push(`/collect_edit/4/${topInfo.id}`)
+          }
+        }
+      }
+    },
+    [auditSta, clueArr, topInfo]
+  )
+
+  // 查看的按钮创建-提交-撤回
+  const lookBtnFu = useCallback(
+    async (val: '创建' | '提交' | '撤回') => {
+      if (val !== '撤回') {
+        if (clueArr.length === 0) return MessageFu.warning('请添加藏品')
+      }
+
+      const obj = {
+        ...topInfo,
+        collectIds: clueArr.map(v => v.id).join(',')
+      }
+
+      const res =
+        val === '创建'
+          ? await B1_APIsaveCreate(obj)
+          : val === '提交'
+          ? await B1_APIsaveApply(obj)
+          : await B1_APIrevocation(id)
+
+      if (res.code === 0) {
+        if (sollrDom.current) sollrDom.current.scrollTop = 0
+        MessageFu.success(val + '成功')
+        getInfoFu()
+      }
+    },
+    [clueArr, getInfoFu, id, topInfo]
+  )
+  // 查看模式点击删除
+  const delFu = useCallback(async () => {
+    const res = await B1_APIdel(id)
+    if (res.code === 0) {
+      MessageFu.success('删除成功')
+      history.push('/collect')
+    }
+  }, [id])
+
+  // 查看模式点击审批 编辑
+  const lookJumpFu = useCallback(
+    (val: '审批' | '编辑') => {
+      history.push(`/collect_edit/${val === '审批' ? 3 : 2}/${id}`)
+      MessageFu.success(`已跳转至${val}页面`)
+    },
+    [id]
+  )
+
+  // 查看模式下的按钮
   const lookBtn = useMemo(() => {
-    return ''
-  }, [])
+    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('/collect')}>返回</Button>
+      </>
+    )
+  }, [delFu, lookBtnFu, lookJumpFu, topInfo])
+
+  // 申请记录
+  const [auditsShow, setAuditsShow] = useState(false)
 
   return (
     <div className={styles.B1edit}>
       <div className='pageTitle'>藏品征集-{Reflect.get(pageTitTxtObj, key)}</div>
 
       <div className='B1main'>
+        {['3'].includes(key) ? (
+          <X3auditInfo
+            dirCode='B1collect'
+            myUrl='cms/orderCollect/upload'
+            auditSta={auditSta}
+            auditStaFu={val => setAuDitSta(val)}
+            ref={ZAuditRef}
+          />
+        ) : null}
+
         {/* 表单字段、附件等 */}
         <div className='B1Tit'>
           申请信息
-          {/* {key === '1' ? null : (
+          {key === '1' ? null : (
             <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
-          )} */}
+          )}
         </div>
 
         <div className='B1rowAll'>
           <div className='B1row'>
             <div className='B1rowll'>业务单号:</div>
-            <div className='B1rowrr'>这是一段文本</div>
+            <div className='B1rowrr'>{topInfo.num}</div>
           </div>
 
           <div className='B1row'>
             <div className='B1rowll'>业务名称:</div>
-            <div className='B1rowrr'>藏品征集</div>
+            <div className='B1rowrr'>{topInfo.name}</div>
           </div>
 
           <div className='B1row'>
             <div className='B1rowll'>发起人:</div>
-            <div className='B1rowrr'>超级管理员-2025-05-14</div>
+            <div className='B1rowrr'>
+              {topInfo.creatorName}
+              {['3', '4'].includes(key) ? ' - ' + topInfo.createTime || '' : ''}
+            </div>
           </div>
 
           <div className='B1row'>
             <div className='B1rowll'>发起部门:</div>
-            <div className='B1rowrr'>从组织架构拿</div>
+            <div className='B1rowrr'>{topInfo.deptName}</div>
           </div>
 
           <div className='B1row'>
@@ -90,8 +325,8 @@ function B1edit() {
               <DatePicker
                 disabled={['3', '4'].includes(key)}
                 allowClear={false}
-                // value={dayjs(topInfo.date)}
-                // onChange={timeChange}
+                value={dayjs(topInfo.date)}
+                onChange={timeChange}
               />
             </div>
           </div>
@@ -104,23 +339,40 @@ function B1edit() {
             <div className='B1Tit2rr'>
               {['3', '4'].includes(key) ? null : (
                 <>
-                  <Button type='primary' onClick={() => MessageFu.warning('开发中')}>
+                  <Button type='primary' onClick={() => MessageFu.warning('待完善')}>
                     批量导入
                   </Button>
-                  <Button type='primary'>新增</Button>
+                  <Button type='primary' onClick={() => setOpenId(-1)}>
+                    新增
+                  </Button>
                 </>
               )}
             </div>
           </div>
 
           {/* 表格 */}
-          <MyTable list={[]} columnsTemp={B1TableC2} lastBtn={tableLastBtn} pagingInfo={false} />
+          <MyTable
+            list={clueArr}
+            columnsTemp={B1TableC2}
+            lastBtn={tableLastBtn}
+            pagingInfo={false}
+          />
         </div>
 
         {/* 申请流程 */}
         {auditsShow ? (
           <B3flowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
         ) : null}
+
+        {/* 附件归档 */}
+        {topInfo.status === 4 ? (
+          <ZupFileTable
+            listTemp={topInfo.filing || []}
+            dirCode='B1collect'
+            myUrl='cms/orderCollect/upload'
+            fromData={{ moduleId: topInfo.id }}
+          />
+        ) : null}
       </div>
 
       {/* 底部按钮 */}
@@ -155,6 +407,24 @@ function B1edit() {
           </>
         )}
       </div>
+
+      {/* 新增弹窗 */}
+      {openId ? (
+        <B1MoAdd
+          look={['3', '4'].includes(key)}
+          sId={openId}
+          closeFu={() => setOpenId(0)}
+          succFu={(obj, txt) => {
+            if (txt === '新增') setClueArr([obj, ...clueArr])
+            else {
+              const index = clueArr.findIndex(v => v.id === obj.id)
+              const newArr = [...clueArr]
+              newArr[index] = obj
+              setClueArr(newArr)
+            }
+          }}
+        />
+      ) : null}
     </div>
   )
 }

+ 21 - 4
src/pages/B_enterTibet/B1collect/data.ts

@@ -2,8 +2,8 @@ export type B1formType = {
   pageSize: number
   pageNum: number
   num: string
-  xxxx1: string
-  xxxx2: string
+  businessTimeStart: string
+  businessTimeEnd: string
   deptName: string
   userName: string
   startTime: string
@@ -19,8 +19,8 @@ export const B1baseFormData: B1formType = {
   pageNum: 1,
 
   num: '',
-  xxxx1: '',
-  xxxx2: '',
+  businessTimeStart: '',
+  businessTimeEnd: '',
   deptName: '',
   userName: '',
   startTime: '',
@@ -28,3 +28,20 @@ export const B1baseFormData: B1formType = {
   status: '',
   userType: ''
 }
+
+export type B1Xtype = {
+  addr: string
+  createTime: string
+  creatorId: number
+  creatorName: string
+  file: []
+  fileIds: string
+  id: number
+  linkman: string
+  name: string
+  phone: string
+  rtf: string
+  type: string
+  updateTime: string
+  img: []
+}

+ 60 - 18
src/pages/B_enterTibet/B1collect/index.tsx

@@ -16,7 +16,6 @@ import dayjs from 'dayjs'
 import ExportJsonExcel from 'js-export-excel'
 const { RangePicker } = DatePicker
 
-// 待完善 静态页面
 function B1collect() {
   const dispatch = useDispatch()
   const [formData, setFormData] = useState(B1baseFormData)
@@ -39,6 +38,20 @@ function B1collect() {
   }, [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 = ''
@@ -194,19 +207,41 @@ function B1collect() {
         <div className='B1topll'>
           <div>
             <span>业务单号:</span>
-            <Input placeholder='请输入业务单号' maxLength={30} />
+            <Input
+              placeholder='请输入业务单号'
+              maxLength={30}
+              value={formData.num}
+              onChange={e => txtChangeFu(e.target.value, 'num')}
+            />
           </div>
           <div>
             <span>征集日期范围:</span>
-            <RangePicker />
+            <RangePicker
+              value={
+                formData.businessTimeStart
+                  ? [dayjs(formData.businessTimeStart), dayjs(formData.businessTimeEnd)]
+                  : null
+              }
+              onChange={timeChange}
+            />
           </div>
           <div>
             <span>发起部门:</span>
-            <Input placeholder='请输入发起部门' maxLength={30} />
+            <Input
+              placeholder='请输入发起部门'
+              maxLength={30}
+              value={formData.deptName}
+              onChange={e => txtChangeFu(e.target.value, 'deptName')}
+            />
           </div>
           <div>
             <span>发起人:</span>
-            <Input placeholder='请输入发起人' maxLength={30} />
+            <Input
+              placeholder='请输入发起人'
+              maxLength={30}
+              value={formData.userName}
+              onChange={e => txtChangeFu(e.target.value, 'userName')}
+            />
           </div>
         </div>
         <div className='B1toprr'>
@@ -224,7 +259,12 @@ function B1collect() {
         <div className='B1topll'>
           <div>
             <span>发起日期范围:</span>
-            <RangePicker />
+            <RangePicker
+              value={
+                formData.startTime ? [dayjs(formData.startTime), dayjs(formData.endTime)] : null
+              }
+              onChange={timeChange2}
+            />
           </div>
           <div>
             <span>申请状态:</span>
@@ -232,8 +272,8 @@ function B1collect() {
               allowClear={true}
               placeholder='全部'
               style={{ width: 198 }}
-              // value={formData.status}
-              // onChange={e => setFormData({ ...formData, status: e })}
+              value={formData.status ? formData.status : null}
+              onChange={e => setFormData({ ...formData, status: e })}
               options={selectObj['申请状态'].filter(v => v.label !== '待盘点')}
             />
           </div>
@@ -246,27 +286,29 @@ function B1collect() {
               placeholder='全部'
               options={selectObj['角色']}
               // fieldNames={{ value: 'id', label: 'roleName' }}
-              // value={formData.userType}
-              // onChange={e => setFormData({ ...formData, userType: e })}
+              value={formData.userType ? formData.userType : null}
+              onChange={e => setFormData({ ...formData, userType: e })}
             />
           </div>
         </div>
         <div className='B1toprr'>
-          <Button type='primary'>查询</Button>
-          &emsp;<Button>重置</Button>
+          <Button type='primary' onClick={clickSearch}>
+            查询
+          </Button>
+          &emsp;<Button onClick={resetSelectFu}>重置</Button>
         </div>
       </div>
 
       {/* 表格 */}
       <MyTable
         yHeight={610}
-        list={[]}
+        list={tableInfo.list}
         columnsTemp={B1TableC}
-        lastBtn={[]}
-        pageNum={1}
-        pageSize={10}
-        total={10}
-        // onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+        lastBtn={tableLastBtn}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={tableInfo.total}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
       />
     </div>
   )

+ 129 - 0
src/pages/B_enterTibet/B2identify/B2edit/B2MoAdd/index.module.scss

@@ -0,0 +1,129 @@
+.B2MoAdd {
+  :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;
+        }
+      }
+    }
+  }
+}

+ 337 - 0
src/pages/B_enterTibet/B2identify/B2edit/B2MoAdd/index.tsx

@@ -0,0 +1,337 @@
+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 { cascaderChArr } from '@/pages/B_enterTibet/B3goodsTable/B3GaddNew'
+import TextArea from 'antd/es/input/TextArea'
+import { API_C2getListByIds } from '@/store/action/C2files'
+import { GoodFileType } from '@/pages/B_enterTibet/B3goodsTable/B3GaddNew/type'
+import { fileImgArr } from '@/store/action/layout'
+
+type Props = {
+  info: C1GoodType
+  closeFu: () => void
+  succFu: (val: C1GoodType) => void
+  look?: boolean
+}
+
+function B2MoAdd({ info, closeFu, succFu, look = false }: Props) {
+  const getInfoFu = useCallback(async (info: C1GoodType) => {
+    const obj: any = { ...info }
+    cascaderChArr.forEach(v => {
+      if (obj[v]) obj[v] = obj[v].split(',')
+    })
+    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,
+        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(',')
+      })
+      MessageFu.success('编辑成功')
+      succFu(obj)
+      closeFu()
+    },
+    [closeFu, info.id, succFu]
+  )
+
+  // 上传图片的ref
+  const imgRef = useRef<any>(null)
+
+  useEffect(() => {
+    if (info.id) getInfoFu(info)
+  }, [getInfoFu, info])
+
+  return (
+    <Modal
+      wrapClassName={styles.B2MoAdd}
+      destroyOnClose
+      open={true}
+      title={look ? '查看' : '编辑'}
+      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'>
+                <Select
+                  disabled={look}
+                  options={selectObj['藏品编号类型']}
+                  placeholder={look ? '(空)' : '请选择类型'}
+                  allowClear={true}
+                />
+              </Form.Item>
+
+              <Form.Item name='num'>
+                <Input
+                  readOnly={look}
+                  maxLength={30}
+                  showCount
+                  placeholder={look ? '(空)' : '请输入内容'}
+                />
+              </Form.Item>
+            </div>
+
+            <Form.Item label='分类号' name='numType'>
+              <Input
+                readOnly={look}
+                maxLength={30}
+                showCount
+                placeholder={look ? '(空)' : '请输入内容'}
+              />
+            </Form.Item>
+
+            <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='dictTexture3'>
+              <Cascader
+                disabled={look}
+                options={cascaderObjFu()['单一质地']}
+                placeholder={look ? '(空)' : '请选择'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                allowClear={true}
+              />
+            </Form.Item>
+
+            <Form.Item label='年代' name='dictAge'>
+              <Cascader
+                disabled={look}
+                options={cascaderObjFu()['年代']}
+                placeholder={look ? '(空)' : '请选择'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+              />
+            </Form.Item>
+
+            <div className='formRow formRow2'>
+              <div className='formLeft'>尺寸:</div>
+              <div className='formRight formRightSize'>
+                <Form.Item label='通长' name='sizeL'>
+                  <InputNumber
+                    readOnly={look}
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder={look ? '(空)' : '请输入数字,最多两位小数'}
+                  />
+                </Form.Item>
+
+                <Form.Item label='通宽' name='sizeW'>
+                  <InputNumber
+                    readOnly={look}
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder={look ? '(空)' : '请输入数字,最多两位小数'}
+                  />
+                </Form.Item>
+                <Form.Item label='通高' name='sizeH'>
+                  <InputNumber
+                    readOnly={look}
+                    min={0}
+                    max={99999999}
+                    precision={2}
+                    placeholder={look ? '(空)' : '请输入数字,最多两位小数'}
+                  />
+                </Form.Item>
+
+                <Form.Item name='sizeUnit'>
+                  <Cascader
+                    disabled={look}
+                    options={cascaderObjFu()['尺寸单位']}
+                    placeholder={look ? '(空)' : '请选择单位'}
+                    fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  />
+                </Form.Item>
+              </div>
+            </div>
+
+            <div className='B3NrowDing'>
+              <Form.Item label='具体质量' name='quality'>
+                <InputNumber
+                  readOnly={look}
+                  min={0}
+                  max={99999999}
+                  precision={2}
+                  placeholder={look ? '(空)' : '请输入数字,最多两位小数'}
+                />
+              </Form.Item>
+
+              <Form.Item name='qualityUnit'>
+                <Cascader
+                  disabled={look}
+                  options={cascaderObjFu()['质量单位']}
+                  placeholder={look ? '(空)' : '请选择'}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                />
+              </Form.Item>
+            </div>
+
+            <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='dictLevel'>
+              <Select
+                disabled={look}
+                options={selectObj['文物级别']}
+                placeholder={look ? '(空)' : '请选择'}
+                allowClear={true}
+              />
+            </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='B2identifySon'
+                  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 MemoB2MoAdd = React.memo(B2MoAdd)
+
+export default MemoB2MoAdd

+ 129 - 0
src/pages/B_enterTibet/B2identify/B2edit/index.module.scss

@@ -0,0 +1,129 @@
+.B2edit {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 24px 0px;
+  :global {
+    .B2Tit {
+      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;
+      }
+    }
+    .B2Tit2 {
+      margin-top: 24px;
+      display: flex;
+      justify-content: space-between;
+      border-bottom: 1px solid #ccc;
+      margin-bottom: 20px;
+      .B2Tit2ll {
+        font-size: 18px;
+        font-weight: 700;
+        padding-left: 18px;
+        margin-bottom: 17px;
+        color: var(--themeColor);
+      }
+      .B2Tit2rr {
+        position: relative;
+        z-index: 2;
+        .ant-btn {
+          margin-left: 15px;
+        }
+      }
+    }
+
+    .B2main {
+      width: 100%;
+      height: calc(100% - 70px);
+      overflow-y: auto;
+      padding-bottom: 40px;
+
+      .B2rowAll {
+        display: flex;
+        justify-content: space-between;
+        align-items: self-start;
+        font-size: 16px;
+        flex-wrap: wrap;
+        .B2row {
+          width: 48%;
+          display: flex;
+          align-items: center;
+          margin-bottom: 20px;
+          .B2rowll {
+            width: 110px;
+            text-align: right;
+            font-weight: 700;
+            & > span {
+              color: #ff4b2f;
+            }
+          }
+          .B2rowrr {
+            width: calc(100% - 110px);
+            .ant-input-affix-wrapper {
+              width: 300px;
+            }
+            .ant-select {
+              width: 300px;
+            }
+          }
+        }
+        .B2row2 {
+          align-items: self-start;
+          .B2rowll {
+            position: relative;
+            top: 3px;
+          }
+          .B2rowrr {
+            .ant-input-affix-wrapper {
+              width: 90%;
+            }
+          }
+        }
+        .B2row3 {
+          position: relative;
+          top: 4px;
+        }
+
+        .B2rowFull {
+          width: 100%;
+          margin-top: -20px;
+          align-items: self-start;
+          margin-bottom: 0;
+          .B2rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+      }
+      // 征集线索
+      .B2googsBox {
+        padding-right: 20px;
+        margin-top: 24px;
+
+        .B2tab2Tit {
+          font-weight: 700;
+          color: var(--themeColor);
+        }
+      }
+    }
+
+    .B2btn {
+      position: absolute;
+      bottom: 20px;
+      left: 134px;
+      .ant-btn {
+        margin-right: 20px;
+      }
+    }
+
+    .ant-table-cell {
+      padding: 8px !important;
+    }
+  }
+}

+ 542 - 0
src/pages/B_enterTibet/B2identify/B2edit/index.tsx

@@ -0,0 +1,542 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { useParams } from 'react-router-dom'
+import { Button, Input } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { FourTableType } from '../../B3_4page/type'
+import {
+  B2_APIcreate,
+  B2_APIdel,
+  B2_APIgetInfo,
+  B2_APIrevocation,
+  B2_APIsaveApply,
+  B2_APIsaveAudit,
+  B2_APIsaveCreate,
+  B2_APIsaveDraft
+} from '@/store/action/B2identify'
+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 { B2TableC2, statusObj } from '@/utils/tableData'
+import TextArea from 'antd/es/input/TextArea'
+import MyTable from '@/components/MyTable'
+import B3flowTable from '../../B3flowTable'
+import ZupFileTable from '@/components/ZupFileTable'
+import B3GaddNow from '../../B3goodsTable/B3GaddNow'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
+import classNames from 'classnames'
+import B2MoAdd from './B2MoAdd'
+
+function B2edit() {
+  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 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(() => {
+    return [
+      {
+        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={() => setSnaps(snaps.filter(v => v.id !== item.id))}
+                />
+              )}
+            </>
+          )
+        }
+      }
+    ]
+  }, [snaps, key])
+  // -------新增藏品-新字段-------------
+
+  // 创建订单
+  const creatFu = useCallback(async () => {
+    const res = await B2_APIcreate()
+    if (res.code === 0) {
+      setTopInfo(res.data)
+    }
+  }, [])
+
+  // 获取详情
+  const getInfoFu = useCallback(async () => {
+    const res = await B2_APIgetInfo(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)
+    }
+  }, [id])
+
+  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 btnClickFu = useCallback(
+    async (val: '草稿' | '创建' | '保存' | '审批') => {
+      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 B2_APIsaveAudit({
+          orderId: topInfo.id,
+          rtfOpinion: rtf2,
+          status: auditSta === '同意' ? 1 : 2
+        })
+
+        if (res.code === 0) {
+          MessageFu.success('审批成功')
+          // 跳详情页
+          history.push(`/identify_edit/4/${topInfo.id}`)
+        }
+      } else {
+        const obj = {
+          ...topInfo,
+          goodsIds: snaps.map(v => v.id).join(','),
+          snaps: snaps.map(v => ({
+            goodsId: v.id,
+            id: v.id2 ? v.id2 : null,
+            orderId: topInfo.id,
+            snap: JSON.stringify(v)
+          }))
+        }
+        // console.log(123, obj)
+
+        // if (1 + 1 === 2) return
+
+        if (val === '草稿') {
+          // 存草稿 当前页保存 不跳转
+          const res = await B2_APIsaveDraft(obj)
+          if (res.code === 0) {
+            MessageFu.success('草稿保存成功')
+          }
+        } else {
+          const res = val === '创建' ? await B2_APIsaveCreate(obj) : await B2_APIsaveApply(obj)
+          if (res.code === 0) {
+            MessageFu.success(`${val}成功`)
+            // 跳到详情页
+            history.push(`/identify_edit/4/${topInfo.id}`)
+          }
+        }
+      }
+    },
+    [auditSta, snaps, topInfo]
+  )
+  // 查看的按钮创建-提交-撤回
+  const lookBtnFu = useCallback(
+    async (val: '创建' | '提交' | '撤回') => {
+      if (val !== '撤回') {
+        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+      }
+
+      const obj = {
+        ...topInfo,
+        goodsIds: snaps.map(v => v.id).join(','),
+        snaps: snaps.map(v => ({
+          goodsId: v.id,
+          id: v.id2 ? v.id2 : null,
+          orderId: topInfo.id,
+          snap: JSON.stringify(v)
+        }))
+      }
+
+      const res =
+        val === '创建'
+          ? await B2_APIsaveCreate(obj)
+          : val === '提交'
+          ? await B2_APIsaveApply(obj)
+          : await B2_APIrevocation(id)
+
+      if (res.code === 0) {
+        if (sollrDom.current) sollrDom.current.scrollTop = 0
+        MessageFu.success(val + '成功')
+        getInfoFu()
+      }
+    },
+    [snaps, getInfoFu, id, topInfo]
+  )
+  // 查看模式点击删除
+  const delFu = useCallback(async () => {
+    const res = await B2_APIdel(id)
+    if (res.code === 0) {
+      MessageFu.success('删除成功')
+      history.push('/identify')
+    }
+  }, [id])
+
+  // 查看模式点击审批 编辑
+  const lookJumpFu = useCallback(
+    (val: '审批' | '编辑') => {
+      history.push(`/identify_edit/${val === '审批' ? 3 : 2}/${id}`)
+      MessageFu.success(`已跳转至${val}页面`)
+    },
+    [id]
+  )
+
+  // 查看模式下的按钮
+  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('/identify')}>返回</Button>
+      </>
+    )
+  }, [delFu, lookBtnFu, lookJumpFu, topInfo])
+
+  // 申请记录
+  const [auditsShow, setAuditsShow] = useState(false)
+
+  // 点击新增
+  const [nowSta, setNowSta] = useState({ key: '', id: '' })
+
+  return (
+    <div className={styles.B2edit}>
+      <div className='pageTitle'>藏品鉴定-{Reflect.get(pageTitTxtObj, key)}</div>
+      <div className='B2main'>
+        {['3'].includes(key) ? (
+          <X3auditInfo
+            dirCode='B2identify'
+            myUrl='cms/orderAuth/upload'
+            auditSta={auditSta}
+            auditStaFu={val => setAuDitSta(val)}
+            ref={ZAuditRef}
+          />
+        ) : null}
+
+        {/* 表单字段、附件等 */}
+        <div className='B2Tit'>
+          申请信息
+          {key === '1' ? null : (
+            <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
+          )}
+        </div>
+
+        <div className='B2rowAll'>
+          <div className='B2row'>
+            <div className='B2rowll'>业务单号:</div>
+            <div className='B2rowrr'>{topInfo.num}</div>
+          </div>
+
+          <div className='B2row'>
+            <div className='B2rowll'>业务名称:</div>
+            <div className='B2rowrr'>{topInfo.name}</div>
+          </div>
+
+          <div className='B2row'>
+            <div className='B2rowll'>发起人:</div>
+            <div className='B2rowrr'>
+              {topInfo.creatorName}
+              {['3', '4'].includes(key) ? ' - ' + topInfo.createTime || '' : ''}
+            </div>
+          </div>
+
+          <div className='B2row'>
+            <div className='B2rowll'>发起部门:</div>
+            <div className='B2rowrr'>{topInfo.deptName}</div>
+          </div>
+
+          <div className='B2row'>
+            <div className='B2rowll'>鉴定单位:</div>
+            <div className='B2rowrr'>
+              <Input
+                maxLength={30}
+                showCount
+                value={topInfo.authUnit}
+                onChange={e => setTopInfo({ ...topInfo, authUnit: e.target.value })}
+                placeholder={['3', '4'].includes(key) ? '(空)' : '请填入内容'}
+              />
+            </div>
+          </div>
+
+          <div className='B2row'>
+            <div className='B2rowll'>核准单位:</div>
+            <div className='B2rowrr'>
+              <Input
+                maxLength={30}
+                showCount
+                value={topInfo.confirmUnit}
+                onChange={e => setTopInfo({ ...topInfo, confirmUnit: e.target.value })}
+                placeholder={['3', '4'].includes(key) ? '(空)' : '请填入内容'}
+              />
+            </div>
+          </div>
+
+          <div className='B2row B2row2'>
+            <div className='B2rowll'>鉴定人员:</div>
+            <div className='B2rowrr'>
+              <TextArea
+                maxLength={50}
+                showCount
+                value={topInfo.authUser}
+                onChange={e => setTopInfo({ ...topInfo, authUser: e.target.value })}
+                placeholder={['3', '4'].includes(key) ? '(空)' : '请填入人员姓名,以逗号分隔'}
+              />
+            </div>
+          </div>
+
+          <div className='B2row B2row2'>
+            <div className='B2rowll'>说明:</div>
+            <div className='B2rowrr'>
+              <TextArea
+                maxLength={200}
+                showCount
+                value={topInfo.reason}
+                onChange={e => setTopInfo({ ...topInfo, reason: e.target.value })}
+                placeholder={['3', '4'].includes(key) ? '(空)' : '请填入内容'}
+              />
+            </div>
+          </div>
+        </div>
+
+        {/* 藏品清单 */}
+        <div className='B2goodsBox'>
+          <div className='B2Tit2'>
+            <div className='B2Tit2ll'>藏品清单</div>
+            <div className='B2Tit2rr'>
+              {['3', '4'].includes(key) ? null : (
+                <Button
+                  type='primary'
+                  onClick={() => setNowSta({ key: '鉴定', id: 'cms/orderAuth/goods/getList' })}
+                >
+                  选择藏品
+                </Button>
+              )}
+            </div>
+          </div>
+
+          {/* 表格 */}
+          <MyTable
+            list={snaps}
+            columnsTemp={B2TableC2}
+            startBtn={startBtn}
+            lastBtn={tableLastBtn}
+            pagingInfo={false}
+          />
+        </div>
+
+        {/* 申请流程 */}
+        {auditsShow ? (
+          <B3flowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
+        ) : null}
+
+        {/* 附件归档 */}
+        {topInfo.status === 4 ? (
+          <ZupFileTable
+            listTemp={topInfo.filing || []}
+            dirCode='B2identify'
+            myUrl='cms/orderAuth/upload'
+            fromData={{ moduleId: topInfo.id }}
+          />
+        ) : null}
+      </div>
+
+      {/* 底部按钮 */}
+      <div className='B2btn'>
+        {['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('/identify')} />
+          </>
+        )}
+      </div>
+
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+
+      {/* 新增弹窗 */}
+      {nowSta.id ? (
+        <B3GaddNow
+          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 ? (
+        <B2MoAdd
+          info={openInfo}
+          closeFu={() => setOpenInfo({} as C1GoodType)}
+          succFu={obj =>
+            setSnaps(
+              snaps.map(v => {
+                if (v.id === obj.id) return obj
+                else return v
+              })
+            )
+          }
+          look={['3', '4'].includes(key)}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoB2edit = React.memo(B2edit)
+
+export default MemoB2edit

+ 26 - 0
src/pages/B_enterTibet/B2identify/index.module.scss

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

+ 280 - 2
src/pages/B_enterTibet/B2identify/index.tsx

@@ -1,10 +1,288 @@
-import React from 'react'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
+import { useDispatch, useSelector } from 'react-redux'
+import { B1baseFormData, B1InputKeyType } from '../B1collect/data'
+import ExportJsonExcel from 'js-export-excel'
+import { Button, DatePicker, Input, Select } from 'antd'
+import { B2_APIdel, B2_APIgetList } from '@/store/action/B2identify'
+import { MessageFu } from '@/utils/message'
+import history, { btnFlagFu } from '@/utils/history'
+import { FourTableType } from '../B3_4page/type'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { RootState } from '@/store'
+import dayjs from 'dayjs'
+import { B1TableC, statusObj } from '@/utils/tableData'
+import { selectObj } from '@/utils/select'
+import MyTable from '@/components/MyTable'
+const { RangePicker } = DatePicker
+
 function B2identify() {
+  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 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(B2_APIgetList(formDataRef.current))
+  }, [dispatch])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu, timeKey])
+
+  // 输入框的改变
+  const txtChangeFu = useCallback(
+    (txt: string, key: B1InputKeyType) => {
+      setFormData({
+        ...formData,
+        [key]: txt
+      })
+    },
+    [formData]
+  )
+  // 点击重置
+  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 B2_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
+  // 点击各种操作按钮
+  const tableBtnFu = useCallback((id: number, key: string) => {
+    history.push(`/identify_edit/${key}/${id}`)
+  }, [])
+
+  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.B2identify.tableInfo)
+
+  // 点击导出
+  const deriveFu = useCallback(async () => {
+    const name = '藏品鉴定' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
+
+    const res = await B2_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: ['num', 'deptName', 'creatorName', 'createTime', 'status'],
+            sheetHeader: ['业务单号', '发起部门', '发送人', '发起日期', '申请状态'],
+            columnWidths: [10, 10, 10, 10, 10]
+          }
+        ]
+      }
+
+      const toExcel = new ExportJsonExcel(option) //new
+      toExcel.saveExcel() //保存
+    }
+  }, [])
+
   return (
     <div className={styles.B2identify}>
       <div className='pageTitle'>藏品鉴定</div>
-      <p>待开发</p>
+      <div className='B2top'>
+        <div className='B2topll'>
+          <div>
+            <span>业务单号:</span>
+            <Input
+              placeholder='请输入业务单号'
+              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='B2toprr'>
+          <Button type='primary' onClick={deriveFu}>
+            批量导出
+          </Button>
+          &emsp;
+          <Button type='primary' onClick={() => history.push('/identify_edit/1/null')}>
+            新增
+          </Button>
+        </div>
+      </div>
+
+      <div className='B2top'>
+        <div className='B2topll'>
+          <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={B1TableC.filter((v, i) => i !== 1)}
+        lastBtn={tableLastBtn}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={tableInfo.total}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+      />
     </div>
   )
 }

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

@@ -88,4 +88,7 @@ export type FourTableType = {
   dateEnd: string
   // v1.1.1附件归档
   filing: FileImgListType[]
+
+  // v1.1.1藏品鉴定-核准单位
+  confirmUnit: string
 }

+ 1 - 1
src/pages/B_enterTibet/B3flowTable/index.tsx

@@ -56,7 +56,7 @@ function B3flowTable({ tableArr, closeFu }: Props) {
   const [look, setLook] = useState('')
 
   return (
-    <div className={styles.B3flowTable}>
+    <div className={styles.B3flowTable} hidden={tableArr.length === 0}>
       <div className='B3Fbox'>
         <div className='B3Ftop'>
           <div>申请记录</div>

+ 9 - 3
src/pages/B_enterTibet/B3goodsTable/B3GaddNew/index.module.scss

@@ -187,13 +187,19 @@
           margin-top: -40px;
           // 相关附件
           .B3Ntit {
-            width: 500px;
-            // height: 38px;
+            width: 600px;
             display: flex;
             .B3Ntitll {
-              width: 100px;
               position: relative;
               top: 3px;
+              & > span {
+                font-size: 12px;
+                color: #999;
+              }
+            }
+            #Z3upFiles {
+              margin-left: 20px;
+              width: auto;
             }
           }
           .tableImgAuto {

+ 44 - 19
src/pages/B_enterTibet/B3goodsTable/B3GaddNew/index.tsx

@@ -13,7 +13,6 @@ import {
 } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import TextArea from 'antd/es/input/TextArea'
-import ZupOne from '@/components/ZupOne'
 import ZRichTexts from '@/components/ZRichTexts'
 import MyTable from '@/components/MyTable'
 import { Y33tableC } from '@/utils/tableData'
@@ -33,7 +32,7 @@ import { MessageFu } from '@/utils/message'
 import { cascaderObjFu } from '@/utils/history'
 
 // 级联的数据转换成字符串
-const cascaderChArr = [
+export const cascaderChArr = [
   'dictType',
   'dictAge',
   'pcsUnit',
@@ -45,7 +44,9 @@ const cascaderChArr = [
   'qualityDictScope',
   'qualityUnit',
   'inDictDateScope',
-  'source'
+  'source',
+  // 其他模块有的级联字段
+  'dictAgeFirst'
 ]
 
 type Props = {
@@ -87,11 +88,11 @@ function B3GaddNew({ nowSta, closeFu, succFu, isEdit }: Props) {
       FormBoxRef.current?.setFieldsValue(obj)
 
       // 设置封面图
-      ZupThumbRef.current?.setFileComFileFu({
-        fileName: '',
-        filePath: obj.thumbPc,
-        thumb: obj.thumb
-      })
+      // ZupThumbRef.current?.setFileComFileFu({
+      //   fileName: '',
+      //   filePath: obj.thumbPc,
+      //   thumb: obj.thumb
+      // })
 
       // 设置富文本
       if (obj.rtf) ZRichTextRef.current?.ritxtShowFu(JSON.parse(obj.rtf))
@@ -114,7 +115,7 @@ function B3GaddNew({ nowSta, closeFu, succFu, isEdit }: Props) {
   const [ageAc, setAgeAc] = useState(false)
 
   // 封面图的ref
-  const ZupThumbRef = useRef<any>(null)
+  // const ZupThumbRef = useRef<any>(null)
 
   // 富文本的ref
   const ZRichTextRef = useRef<any>(null)
@@ -241,7 +242,7 @@ function B3GaddNew({ nowSta, closeFu, succFu, isEdit }: Props) {
   const onFinish = useCallback(
     async (values: any) => {
       // 封面图
-      const coverUrl1 = ZupThumbRef.current?.fileComFileResFu()
+      // const coverUrl1 = ZupThumbRef.current?.fileComFileResFu()
 
       // 富文本
       const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
@@ -266,10 +267,25 @@ function B3GaddNew({ nowSta, closeFu, succFu, isEdit }: Props) {
       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: coverUrl1.thumb,
-        thumbPc: coverUrl1.filePath,
+        thumb,
+        thumbPc,
         rtf: JSON.stringify(rtf.val || ''),
         fileIds,
         fileSet,
@@ -278,11 +294,13 @@ function B3GaddNew({ nowSta, closeFu, succFu, isEdit }: Props) {
         id: nowSta.id === 'null' ? 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 (values[v]) obj[v] = values[v].join(',')
       })
 
       if (isEdit) {
@@ -540,7 +558,7 @@ function B3GaddNew({ nowSta, closeFu, succFu, isEdit }: Props) {
             </div>
 
             {/* 封面 */}
-            <div className='formRow'>
+            {/* <div className='formRow'>
               <div className='formLeft'>封面图:</div>
               <div className='formRight'>
                 <ZupOne
@@ -557,7 +575,7 @@ function B3GaddNew({ nowSta, closeFu, succFu, isEdit }: Props) {
                   myType='thumb'
                 />
               </div>
-            </div>
+            </div> */}
 
             <div className='B3Nrow'>
               <Form.Item label='完残情况' name='torn'>
@@ -589,13 +607,18 @@ function B3GaddNew({ nowSta, closeFu, succFu, isEdit }: Props) {
               </Form.Item>
             </div>
 
-            <div className='B3Nrow B3Nrow2'>
+            <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>
@@ -621,7 +644,9 @@ function B3GaddNew({ nowSta, closeFu, succFu, isEdit }: Props) {
           {/* =====上传附件==== */}
           <div className='B3Nbox B3Nbox1'>
             <div className='B3Ntit'>
-              <div className='B3Ntitll'>相关附件</div>
+              <div className='B3Ntitll'>
+                相关附件<span>&emsp;附件类型为图像并且格式为图片的第一份数据为封面图</span>
+              </div>
               <Z3upFiles
                 max={1000}
                 isLook={false}

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

@@ -426,5 +426,11 @@ export const routerSon: RouterTypeRow[] = [
     name: '文物修复-新增/编辑/审批/查看',
     path: '/repair_edit/:key/:id',
     Com: React.lazy(() => import('../E_goodsStorage/E4repair/E4edit'))
+  },
+  {
+    id: 15,
+    name: '藏品鉴定-新增/编辑/审批/查看',
+    path: '/identify_edit/:key/:id',
+    Com: React.lazy(() => import('../B_enterTibet/B2identify/B2edit'))
   }
 ]

+ 11 - 7
src/pages/Y_goodsDetails/Y1cathet/data.tsx

@@ -99,15 +99,19 @@ export const Y11infoArr3: ArrKeyType = [
     backFu: info => {
       let danWei = resJiLianFu(info.sizeUnit, ' ')
 
-      let txt1 = `通长${info.sizeL || '(空)'}`
-      let txt2 = `通宽${info.sizeW || '(空)'}`
-      let txt3 = `通高${info.sizeH || '(空)'}`
+      let txt1 = info.sizeL ? `通长${info.sizeL}` : ''
+      let txt2 = info.sizeW ? `通宽${info.sizeW}` : ''
+      let txt3 = info.sizeH ? `通高${info.sizeH}` : ''
 
-      txt1 = txt1 ? `${txt1 + danWei} - ` : ''
-      txt2 = txt2 ? `${txt2 + danWei} - ` : ''
-      txt3 = txt3 ? `${txt3 + danWei}` : ''
+      txt1 = txt1 ? txt1 + danWei : ''
+      txt2 = txt2 ? txt2 + danWei : ''
+      txt3 = txt3 ? txt3 + danWei : ''
 
-      return txt1 + txt2 + txt3
+      let arr = [txt1, txt2, txt3]
+      arr = arr.filter(v => v)
+
+      if (!txt1 && !txt2 && !txt3) return '(空)'
+      else return arr.join(' - ')
     }
   },
   { name: '具体尺寸', key: 'sizeInfo' },

+ 92 - 0
src/store/action/B2identify.ts

@@ -0,0 +1,92 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+/**
+ * 藏品鉴定 - 获取分页列表
+ */
+export const B2_APIgetList = (data: any, exportFlag?: boolean): any => {
+  if (exportFlag) return http.post('cms/orderAuth/page', data)
+  else {
+    return async (dispatch: AppDispatch) => {
+      const res = await http.post('cms/orderAuth/page', data)
+      if (res.code === 0) {
+        const obj = {
+          list: res.data.records,
+          total: res.data.total
+        }
+        dispatch({ type: 'B2/getList', payload: obj })
+      }
+    }
+  }
+}
+
+/**
+ * 藏品鉴定-删除
+ */
+export const B2_APIdel = (id: number) => {
+  return http.get(`cms/orderAuth/remove/${id}`)
+}
+
+/**
+ * 藏品鉴定-创建订单
+ */
+export const B2_APIcreate = () => {
+  return http.get('cms/orderAuth/create')
+}
+
+/**
+ * 藏品鉴定-获取详情
+ */
+export const B2_APIgetInfo = (id: number) => {
+  return http.get(`cms/orderAuth/detail/${id}`)
+}
+
+/**
+ * 藏品鉴定-存草稿
+ */
+export const B2_APIsaveDraft = (data: any) => {
+  return http.post('cms/orderAuth/saveDraft', data)
+}
+
+/**
+ * 藏品鉴定-创建
+ */
+export const B2_APIsaveCreate = (data: any) => {
+  return http.post('cms/orderAuth/saveCreate', data)
+}
+
+/**
+ * 藏品鉴定-编辑保存
+ */
+export const B2_APIsaveApply = (data: any) => {
+  return http.post('cms/orderAuth/saveApply', data)
+}
+
+/**
+ * 藏品鉴定-审批
+ */
+export const B2_APIsaveAudit = (data: any) => {
+  return http.post('cms/orderAuth/audit', data)
+}
+
+/**
+ * 藏品鉴定-撤回订单
+ */
+export const B2_APIrevocation = (id: number) => {
+  return http.get(`cms/orderAuth/revocation/${id}`)
+}
+
+// --------------------------线索相关-----------------
+
+/**
+ * 藏品鉴定-线索-新增\编辑
+ */
+export const B2X_APIsave = (data: any) => {
+  return http.post('cms/orderAuth/collect/save', data)
+}
+
+/**
+ * 藏品鉴定-线索-详情
+ */
+export const B2X_APIgetInfo = (id: number) => {
+  return http.get(`cms/orderAuth/collect/detail/${id}`)
+}

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

@@ -45,3 +45,10 @@ export const API_C2downS = (data: number[], type: 1 | 2) => {
 export const API_C2setFile = (data: any) => {
   return http.post('cms/goodsFile/setting', data)
 }
+
+/**
+ * 藏品附件-根据ids数组拿列表
+ */
+export const API_C2getListByIds = (data: string[]) => {
+  return http.post('cms/goodsFile/getList', data)
+}

+ 1 - 2
src/store/action/E1accident.ts

@@ -80,6 +80,5 @@ export const E1_APIrevocation = (id: number) => {
  * 事故登记-通过事故藏品编号获取藏品列表-下拉框使用
  */
 export const E1_APIgetGoodsList = (typeName: string) => {
-  const data = { typeName }
-  return http.post('cms/orderPreserveAccident/goods/getList', data)
+  return http.post(`cms/orderPreserveAccident/goods/getList?typeName=${typeName}`)
 }

+ 28 - 0
src/store/reducer/B2identify.ts

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

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

@@ -5,6 +5,7 @@ import { combineReducers } from 'redux'
 import A0Layout from './layout'
 import A32Routing from './A32Routing'
 import B1collect from './B1collect'
+import B2identify from './B2identify'
 import FourAll from './FourAll'
 import C1ledger from './C1ledger'
 import C2files from './C2files'
@@ -32,6 +33,7 @@ const rootReducer = combineReducers({
   A0Layout,
   A32Routing,
   B1collect,
+  B2identify,
   FourAll,
   C1ledger,
   C2files,

+ 29 - 14
src/utils/tableData.ts

@@ -51,7 +51,7 @@ export const statusObj = {
   5: '待盘点'
 }
 
-// 藏品征集 待完善
+// 藏品征集
 export const B1TableC = [
   ['txt', '业务单号', 'num'],
   ['txt', '征集日期', 'date'],
@@ -61,20 +61,35 @@ export const B1TableC = [
   ['txtChange', '申请状态', 'status', statusObj]
 ]
 
-// 藏品征集里面的藏品清单 待完善
+// 藏品征集里面的藏品清单
 export const B1TableC2 = [
-  ['txt', '名称', 'num'],
-  ['txt', '初定年代', 'type'],
-  ['txt', '年代', 'creatorName'],
-  ['txt', '品种', 'createTime'],
-  ['txt', '尺寸', 'createTime'],
-  ['txt', '重量', 'createTime'],
-  ['txt', '介绍', 'createTime'],
-  ['txt', '图片', 'createTime'],
-  ['txt', '报价(万元)', 'createTime'],
-  ['txt', '原持有人', 'createTime'],
-  ['txt', '征集方式', 'createTime'],
-  ['txt', '附件数量', 'createTime']
+  ['img', '封面图', 'thumb'],
+  ['txt', '名称', 'name'],
+  ['txtC', '初定年代', 'dictAgeFirst'],
+  ['txtC', '年代', 'dictAge'],
+  ['txtC', '品种', 'dictType'],
+  ['size', '尺寸', 'sizeUnit'],
+  ['ping', '重量', 'quality', 'qualityUnit'],
+  ['text', '介绍', 'intro', 50],
+  ['txt', '报价(万元)', 'offer'],
+  ['txt', '原持有人', 'holder'],
+  ['txtC', '征集方式', 'source']
+]
+
+// 藏品鉴定里面的藏品清单
+export const B2TableC2 = [
+  ['img', '封面图', 'thumb'],
+  ['txt', '登记号类型', 'numName'],
+  ['txt', '分类号', 'numType'],
+  ['txt', '文物名称', 'name'],
+  ['ping', '数量', 'pcs', 'pcsUnit'],
+  ['txtC', '质地', 'dictTexture3'],
+  ['txtC', '年代', 'dictAge'],
+  ['size', '尺寸', 'sizeUnit'],
+  ['ping', '重量', 'quality', 'qualityUnit'],
+  ['txtC', '现状', 'dictTorn'],
+  ['txt', '文物级别', 'dictLevel'],
+  ['text', '备注', 'intro', 50]
 ]
 
 export const B3eTableC = [