Przeglądaj źródła

藏品征集重写

shaogen1995 3 miesięcy temu
rodzic
commit
5a460204e2

+ 3 - 0
src/components/ZupFileTable/index.module.scss

@@ -15,5 +15,8 @@
         color: var(--themeColor);
       }
     }
+    .ant-table-cell {
+      padding: 8px !important;
+    }
   }
 }

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

@@ -20,7 +20,6 @@
       margin-top: 24px;
       display: flex;
       justify-content: space-between;
-      padding-bottom: 10px;
       border-bottom: 1px solid #ccc;
       margin-bottom: 20px;
       .B1Tit2ll {

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

@@ -1,45 +1,23 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import React, { useCallback, useMemo, useState } from 'react'
 import styles from './index.module.scss'
 import { useParams } from 'react-router-dom'
-import X3auditInfo from '@/pages/X_stock/X3auditInfo'
+import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
+import { Button, DatePicker } from 'antd'
 import { MessageFu } from '@/utils/message'
-import history, { btnFlagFu2 } from '@/utils/history'
-import { Button, DatePicker, Input } from 'antd'
-import MyPopconfirm from '@/components/MyPopconfirm'
-import dayjs from 'dayjs'
-import { B3aForm1 } from '../../B3_4page/B3edit/data'
-import Z3upFiles from '@/components/Z3upFiles'
-import ZRichTexts from '@/components/ZRichTexts'
 import MyTable from '@/components/MyTable'
-import { B1TableC, statusObj } from '@/utils/tableData'
-import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
-import B1MoAdd from './B1MoAdd'
-import B3flowTable from '../../B3flowTable'
-import B1appraisal from '../B1appraisal'
+import { B1TableC2 } from '@/utils/tableData'
+import MyPopconfirm from '@/components/MyPopconfirm'
 import { FourTableType } from '../../B3_4page/type'
-import {
-  B1_APIcreate,
-  B1_APIdel,
-  B1_APIgetInfo,
-  B1_APIrevocation,
-  B1_APIsaveApply,
-  B1_APIsaveAudit,
-  B1_APIsaveCreate,
-  B1_APIsaveDraft
-} from '@/store/action/B1collect'
-import { EXbtnFu } from '@/utils/EXBtn'
-import { B1Xtype } from '../type'
+import B3flowTable from '../../B3flowTable'
+import history from '@/utils/history'
+
+// 待完善 静态页面
 function B1edit() {
   const { key, id } = useParams<any>()
   // key:1 新增 2编辑 3审批 4查看
 
-  // 滚到顶部
-  const sollrDom = useRef<HTMLDivElement>(null)
-
-  // -------征集线索-------------
-  const [openId, setOpenId] = useState(0)
-
-  const [clueArr, setClueArr] = useState<B1Xtype[]>([])
+  // 顶部数据
+  const [topInfo, setTopInfo] = useState({} as FourTableType)
 
   const tableLastBtn = useMemo(() => {
     return [
@@ -48,386 +26,97 @@ function B1edit() {
         render: (item: any) => {
           return (
             <>
-              <Button size='small' type='text' onClick={() => setOpenId(item.id)}>
+              <Button size='small' type='text'>
                 {['3', '4'].includes(key) ? '查看' : '编辑'}
               </Button>
-              {['3', '4'].includes(key) ? null : (
-                <MyPopconfirm
-                  txtK='删除'
-                  onConfirm={() => setClueArr(clueArr.filter(v => v.id !== item.id))}
-                />
-              )}
+              {['3', '4'].includes(key) ? null : <MyPopconfirm txtK='删除' onConfirm={() => {}} />}
             </>
           )
         }
       }
     ]
-  }, [clueArr, key])
-  // -------征集线索-------------
+  }, [key])
 
-  // 顶部数据
-  const [topInfo, setTopInfo] = useState({} as FourTableType)
+  // 申请记录
+  const [auditsShow, setAuditsShow] = useState(false)
 
-  // 创建订单
-  const creatFu = useCallback(async () => {
-    const res = await B1_APIcreate()
-    if (res.code === 0) {
-      setTopInfo(res.data)
-    }
+  const btnClickFu = useCallback((val: string) => {
+    MessageFu.warning('开发中')
   }, [])
 
-  // 获取详情
-  const getInfoFu = useCallback(async () => {
-    const res = await B1_APIgetInfo(id)
-    if (res.code === 0) {
-      setTopInfo(res.data)
-      setClueArr(res.data.collects || [])
-
-      // 设置富文本
-      ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf || '{}'))
-    }
-  }, [id])
-
-  useEffect(() => {
-    if (key === '1') creatFu()
-    else getInfoFu()
-
-    if (sollrDom.current) sollrDom.current.scrollTop = 0
-  }, [creatFu, getInfoFu, key])
-
-  // 上传附件的ref
-  const filesRef = useRef<any>(null)
-  // const filesRes = filesRef.current.filesIdRes();
-
-  // 富文本的ref
-  const ZRichTextRef = useRef<any>(null)
-
-  // 审批意见的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 (!topInfo.name) 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 rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
-        // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
-
-        // 上传附件
-        const filesRes = filesRef.current.filesIdRes()
-
-        const obj = {
-          ...topInfo,
-          fileIds: filesRes.join(','),
-          rtf: JSON.stringify(rtf1.val || ''),
-
-          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: '创建' | '提交' | '撤回') => {
-      const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
-      // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
-
-      // 上传附件
-      const filesRes = filesRef.current.filesIdRes()
-      const obj = {
-        ...topInfo,
-        fileIds: filesRes.join(','),
-        rtf: JSON.stringify(rtf1.val || ''),
-        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 (
-      <>
-        {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 ''
+  }, [])
 
   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'>
-              <span> * </span>计划名称:
-            </div>
-            <div className='B1rowrr'>
-              <Input
-                value={topInfo.name}
-                onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
-                readOnly={['3', '4'].includes(key)}
-                placeholder='请输入内容'
-                maxLength={30}
-                showCount
-              />
-            </div>
+            <div className='B1rowll'>业务单号:</div>
+            <div className='B1rowrr'>这是一段文本</div>
           </div>
 
           <div className='B1row'>
-            <div className='B1rowll'>
-              <span> * </span>业务日期:
-            </div>
-            <div className='B1rowrr'>
-              <DatePicker
-                disabled={['3', '4'].includes(key)}
-                allowClear={false}
-                value={dayjs(topInfo.date)}
-                onChange={timeChange}
-              />
-            </div>
+            <div className='B1rowll'>业务名称:</div>
+            <div className='B1rowrr'>藏品征集</div>
           </div>
 
-          {B3aForm1.map(v => (
-            <div className='B1row' key={v.name}>
-              <div className='B1rowll'>{v.name}:</div>
-              <div className='B1rowrr'>
-                {topInfo[v.key as 'name']}
-                {['3', '4'].includes(key) && v.name === '发起人'
-                  ? ' - ' + topInfo.createTime || ''
-                  : ''}
-              </div>
-            </div>
-          ))}
-
-          <div className='B1row B1row2'>
-            <div className='B1rowll'>附件:</div>
-            <div className='B1rowrr'>
-              <Z3upFiles
-                max={10}
-                isLook={['3', '4'].includes(key)}
-                ref={filesRef}
-                fileCheck={false}
-                dirCode='B1collect'
-                myUrl='cms/orderCollect/upload'
-                lookData={topInfo.files || []}
-                size={500}
-                fromData={{ moduleId: topInfo.id }}
-              />
-            </div>
+          <div className='B1row'>
+            <div className='B1rowll'>发起人:</div>
+            <div className='B1rowrr'>超级管理员-2025-05-14</div>
           </div>
 
           <div className='B1row'>
-            <div className='B1rowll'>原因事由:</div>
-            <div className='B1rowrr'>
-              <Input
-                value={topInfo.reason}
-                onChange={e => setTopInfo({ ...topInfo, reason: e.target.value })}
-                readOnly={['3', '4'].includes(key)}
-                placeholder='请输入内容'
-                maxLength={30}
-                showCount
-              />
-            </div>
+            <div className='B1rowll'>发起部门:</div>
+            <div className='B1rowrr'>从组织架构拿</div>
           </div>
 
-          <div className='B1row B1rowFull'>
-            <div className='B1rowll'>备注:</div>
+          <div className='B1row'>
+            <div className='B1rowll'>
+              <span> * </span>征集日期:
+            </div>
             <div className='B1rowrr'>
-              <ZRichTexts
-                check={false}
-                dirCode='B1collect'
-                myUrl='cms/orderCollect/upload'
-                isLook={['3', '4'].includes(key)}
-                ref={ZRichTextRef}
-                isOne={true}
-                upAudioBtnNone={true}
+              <DatePicker
+                disabled={['3', '4'].includes(key)}
+                allowClear={false}
+                // value={dayjs(topInfo.date)}
+                // onChange={timeChange}
               />
             </div>
           </div>
         </div>
 
-        {/* 征集线索 */}
-        <div className='B1googsBox'>
+        {/* 藏品清单 */}
+        <div className='B1goodsBox'>
           <div className='B1Tit2'>
-            <div className='B1Tit2ll'>征集线索</div>
+            <div className='B1Tit2ll'>藏品清单</div>
             <div className='B1Tit2rr'>
               {['3', '4'].includes(key) ? null : (
-                <Button type='primary' onClick={() => setOpenId(-1)}>
-                  新增
-                </Button>
+                <>
+                  <Button type='primary' onClick={() => MessageFu.warning('开发中')}>
+                    批量导入
+                  </Button>
+                  <Button type='primary'>新增</Button>
+                </>
               )}
             </div>
           </div>
 
           {/* 表格 */}
-          <MyTable
-            list={clueArr}
-            columnsTemp={B1TableC}
-            lastBtn={tableLastBtn}
-            pagingInfo={false}
-          />
+          <MyTable list={[]} columnsTemp={B1TableC2} lastBtn={tableLastBtn} pagingInfo={false} />
         </div>
 
-        {/* 相关鉴定 待完善*/}
-        {['3', '4'].includes(key) ? <B1appraisal /> : null}
-
         {/* 申请流程 */}
         {auditsShow ? (
           <B3flowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
@@ -466,24 +155,6 @@ 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>
   )
 }

+ 39 - 210
src/pages/B_enterTibet/B1collect/index.tsx

@@ -1,205 +1,41 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import React, { useCallback } from 'react'
 import styles from './index.module.scss'
-import { B3_4inputKeyArr, B3baseFormData, D3InputKeyType } from '../B3_4page'
-import history, { btnFlagFu } from '@/utils/history'
 import { Button, DatePicker, Input, Select } from 'antd'
-import MyPopconfirm from '@/components/MyPopconfirm'
-import dayjs from 'dayjs'
-import MyTable from '@/components/MyTable'
-import { B3tableC, statusObj } from '@/utils/tableData'
-import { useDispatch, useSelector } from 'react-redux'
-import { B1_APIdel, B1_APIgetList } from '@/store/action/B1collect'
 import { MessageFu } from '@/utils/message'
-import { FourTableType } from '../B3_4page/type'
-import { RootState } from '@/store'
-import ExportJsonExcel from 'js-export-excel'
+import history from '@/utils/history'
 import { selectObj } from '@/utils/select'
+import MyTable from '@/components/MyTable'
+import { B1TableC } from '@/utils/tableData'
 const { RangePicker } = DatePicker
 
+// 待完善 静态页面
 function B1collect() {
-  const dispatch = useDispatch()
-  const [formData, setFormData] = useState(B3baseFormData)
-  const formDataRef = useRef(B3baseFormData)
-  const formDataOldRef = useRef(B3baseFormData)
-
-  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(B1_APIgetList(formDataRef.current))
-  }, [dispatch])
-
-  useEffect(() => {
-    getListFu()
-  }, [getListFu, timeKey])
-
-  // 输入框的改变
-  const txtChangeFu = useCallback(
-    (txt: string, key: D3InputKeyType) => {
-      setFormData({
-        ...formData,
-        [key]: txt
-      })
-    },
-    [formData]
-  )
-
-  // 点击重置
-  const resetSelectFu = useCallback(() => {
-    setFormData(B3baseFormData)
-    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 B1_APIdel(id)
-      if (res.code === 0) {
-        MessageFu.success('删除成功')
-        getListFu()
-      }
-    },
-    [getListFu]
-  )
-  // 点击各种操作按钮
-  const tableBtnFu = useCallback((id: number, key: string) => {
-    history.push(`/collect_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.B1collect.tableInfo)
-
-  // 点击导出
-  const deriveFu = useCallback(async () => {
-    const name = '藏品征集' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
-
-    const res = await B1_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', 'name', 'deptName', 'creatorName', 'createTime', 'status'],
-            sheetHeader: ['业务单号', '申请名称', '发起部门', '发送人', '发起日期', '申请状态'],
-            columnWidths: [10, 10, 10, 10, 10, 10]
-          }
-        ]
-      }
-
-      const toExcel = new ExportJsonExcel(option) //new
-      toExcel.saveExcel() //保存
-    }
+  const deriveFu = useCallback(() => {
+    MessageFu.warning('开发中')
   }, [])
 
   return (
     <div className={styles.B1collect}>
       <div className='pageTitle'>藏品征集</div>
+
       <div className='B1top'>
         <div className='B1topll'>
-          {B3_4inputKeyArr.map(item => (
-            <div key={item.name}>
-              <span>{item.name}:</span>
-              <Input
-                placeholder={`请输入${item.name}`}
-                maxLength={30}
-                value={formData[item.key]}
-                onChange={e => txtChangeFu(e.target.value, item.key)}
-              />
-            </div>
-          ))}
+          <div>
+            <span>业务单号:</span>
+            <Input placeholder='请输入业务单号' maxLength={30} />
+          </div>
+          <div>
+            <span>征集日期范围:</span>
+            <RangePicker />
+          </div>
+          <div>
+            <span>发起部门:</span>
+            <Input placeholder='请输入发起部门' maxLength={30} />
+          </div>
+          <div>
+            <span>发起人:</span>
+            <Input placeholder='请输入发起人' maxLength={30} />
+          </div>
         </div>
         <div className='B1toprr'>
           <Button type='primary' onClick={deriveFu}>
@@ -211,26 +47,21 @@ function B1collect() {
           </Button>
         </div>
       </div>
+
       <div className='B1top'>
         <div className='B1topll'>
           <div>
             <span>发起日期范围:</span>
-            <RangePicker
-              value={
-                formData.startTime ? [dayjs(formData.startTime), dayjs(formData.endTime)] : null
-              }
-              onChange={timeChange}
-            />
+            <RangePicker />
           </div>
-
           <div>
             <span>申请状态:</span>
             <Select
               allowClear={true}
               placeholder='全部'
               style={{ width: 198 }}
-              value={formData.status}
-              onChange={e => setFormData({ ...formData, status: e })}
+              // value={formData.status}
+              // onChange={e => setFormData({ ...formData, status: e })}
               options={selectObj['申请状态'].filter(v => v.label !== '待盘点')}
             />
           </div>
@@ -243,29 +74,27 @@ function B1collect() {
               placeholder='全部'
               options={selectObj['角色']}
               // fieldNames={{ value: 'id', label: 'roleName' }}
-              value={formData.userType}
-              onChange={e => setFormData({ ...formData, userType: e })}
+              // value={formData.userType}
+              // onChange={e => setFormData({ ...formData, userType: e })}
             />
           </div>
         </div>
         <div className='B1toprr'>
-          <Button type='primary' onClick={clickSearch}>
-            查询
-          </Button>
-          &emsp;<Button onClick={resetSelectFu}>重置</Button>
+          <Button type='primary'>查询</Button>
+          &emsp;<Button>重置</Button>
         </div>
       </div>
 
       {/* 表格 */}
       <MyTable
         yHeight={610}
-        list={tableInfo.list}
-        columnsTemp={B3tableC}
-        lastBtn={tableLastBtn}
-        pageNum={formData.pageNum}
-        pageSize={formData.pageSize}
-        total={tableInfo.total}
-        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+        list={[]}
+        columnsTemp={B1TableC}
+        lastBtn={[]}
+        pageNum={1}
+        pageSize={10}
+        total={10}
+        // onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
       />
     </div>
   )

src/pages/B_enterTibet/B1collect/B1appraisal/index.module.scss → src/pages/B_enterTibet/B1collectOld/B1appraisal/index.module.scss


src/pages/B_enterTibet/B1collect/B1appraisal/index.tsx → src/pages/B_enterTibet/B1collectOld/B1appraisal/index.tsx


src/pages/B_enterTibet/B1collect/B1edit/B1MoAdd/index.module.scss → src/pages/B_enterTibet/B1collectOld/B1edit/B1MoAdd/index.module.scss


src/pages/B_enterTibet/B1collect/B1edit/B1MoAdd/index.tsx → src/pages/B_enterTibet/B1collectOld/B1edit/B1MoAdd/index.tsx


+ 125 - 0
src/pages/B_enterTibet/B1collectOld/B1edit/index.module.scss

@@ -0,0 +1,125 @@
+.B1edit {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 24px 0px;
+  :global {
+    .B1Tit {
+      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;
+      }
+    }
+    .B1Tit2 {
+      margin-top: 24px;
+      display: flex;
+      justify-content: space-between;
+      padding-bottom: 10px;
+      border-bottom: 1px solid #ccc;
+      margin-bottom: 20px;
+      .B1Tit2ll {
+        font-size: 18px;
+        font-weight: 700;
+        padding-left: 18px;
+        margin-bottom: 17px;
+        color: var(--themeColor);
+      }
+      .B1Tit2rr {
+        position: relative;
+        z-index: 2;
+        .ant-btn {
+          margin-left: 15px;
+        }
+      }
+    }
+
+    .B1main {
+      width: 100%;
+      height: calc(100% - 70px);
+      overflow-y: auto;
+      padding-bottom: 40px;
+
+      .B1rowAll {
+        display: flex;
+        justify-content: space-between;
+        align-items: self-start;
+        font-size: 16px;
+        flex-wrap: wrap;
+        .B1row {
+          width: 48%;
+          display: flex;
+          align-items: center;
+          margin-bottom: 20px;
+          .B1rowll {
+            width: 110px;
+            text-align: right;
+            font-weight: 700;
+            & > span {
+              color: #ff4b1f;
+            }
+          }
+          .B1rowrr {
+            width: calc(100% - 110px);
+            .ant-input-affix-wrapper {
+              width: 300px;
+            }
+            .ant-select {
+              width: 300px;
+            }
+          }
+        }
+        .B1row2 {
+          align-items: self-start;
+          .B1rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+        .B1row3 {
+          position: relative;
+          top: 4px;
+        }
+
+        .B1rowFull {
+          width: 100%;
+          margin-top: -20px;
+          align-items: self-start;
+          margin-bottom: 0;
+          .B1rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+      }
+      // 征集线索
+      .B1googsBox {
+        padding-right: 20px;
+        margin-top: 24px;
+
+        .B1tab2Tit {
+          font-weight: 700;
+          color: var(--themeColor);
+        }
+      }
+    }
+
+    .B1btn {
+      position: absolute;
+      bottom: 20px;
+      left: 134px;
+      .ant-btn {
+        margin-right: 20px;
+      }
+    }
+
+    .ant-table-cell {
+      padding: 8px !important;
+    }
+  }
+}

+ 493 - 0
src/pages/B_enterTibet/B1collectOld/B1edit/index.tsx

@@ -0,0 +1,493 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { useParams } from 'react-router-dom'
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
+import { MessageFu } from '@/utils/message'
+import history, { btnFlagFu2 } from '@/utils/history'
+import { Button, DatePicker, Input } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import dayjs from 'dayjs'
+import { B3aForm1 } from '../../B3_4page/B3edit/data'
+import Z3upFiles from '@/components/Z3upFiles'
+import ZRichTexts from '@/components/ZRichTexts'
+import MyTable from '@/components/MyTable'
+import { B1TableC, statusObj } from '@/utils/tableData'
+import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
+import B1MoAdd from './B1MoAdd'
+import B3flowTable from '../../B3flowTable'
+import B1appraisal from '../B1appraisal'
+import { FourTableType } from '../../B3_4page/type'
+import {
+  B1_APIcreate,
+  B1_APIdel,
+  B1_APIgetInfo,
+  B1_APIrevocation,
+  B1_APIsaveApply,
+  B1_APIsaveAudit,
+  B1_APIsaveCreate,
+  B1_APIsaveDraft
+} from '@/store/action/B1collect'
+import { EXbtnFu } from '@/utils/EXBtn'
+import { B1Xtype } from '../type'
+function B1edit() {
+  const { key, id } = useParams<any>()
+  // key:1 新增 2编辑 3审批 4查看
+
+  // 滚到顶部
+  const sollrDom = useRef<HTMLDivElement>(null)
+
+  // -------征集线索-------------
+  const [openId, setOpenId] = useState(0)
+
+  const [clueArr, setClueArr] = useState<B1Xtype[]>([])
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: any) => {
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => setOpenId(item.id)}>
+                {['3', '4'].includes(key) ? '查看' : '编辑'}
+              </Button>
+              {['3', '4'].includes(key) ? null : (
+                <MyPopconfirm
+                  txtK='删除'
+                  onConfirm={() => setClueArr(clueArr.filter(v => v.id !== item.id))}
+                />
+              )}
+            </>
+          )
+        }
+      }
+    ]
+  }, [clueArr, key])
+  // -------征集线索-------------
+
+  // 顶部数据
+  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 || [])
+
+      // 设置富文本
+      ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf || '{}'))
+    }
+  }, [id])
+
+  useEffect(() => {
+    if (key === '1') creatFu()
+    else getInfoFu()
+
+    if (sollrDom.current) sollrDom.current.scrollTop = 0
+  }, [creatFu, getInfoFu, key])
+
+  // 上传附件的ref
+  const filesRef = useRef<any>(null)
+  // const filesRes = filesRef.current.filesIdRes();
+
+  // 富文本的ref
+  const ZRichTextRef = useRef<any>(null)
+
+  // 审批意见的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 (!topInfo.name) 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 rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+        // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
+
+        // 上传附件
+        const filesRes = filesRef.current.filesIdRes()
+
+        const obj = {
+          ...topInfo,
+          fileIds: filesRes.join(','),
+          rtf: JSON.stringify(rtf1.val || ''),
+
+          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: '创建' | '提交' | '撤回') => {
+      const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+      // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
+
+      // 上传附件
+      const filesRes = filesRef.current.filesIdRes()
+      const obj = {
+        ...topInfo,
+        fileIds: filesRes.join(','),
+        rtf: JSON.stringify(rtf1.val || ''),
+        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 (
+      <>
+        {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 : (
+            <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
+          )}
+        </div>
+        <div className='B1rowAll'>
+          <div className='B1row'>
+            <div className='B1rowll'>
+              <span> * </span>计划名称:
+            </div>
+            <div className='B1rowrr'>
+              <Input
+                value={topInfo.name}
+                onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
+                readOnly={['3', '4'].includes(key)}
+                placeholder='请输入内容'
+                maxLength={30}
+                showCount
+              />
+            </div>
+          </div>
+
+          <div className='B1row'>
+            <div className='B1rowll'>
+              <span> * </span>业务日期:
+            </div>
+            <div className='B1rowrr'>
+              <DatePicker
+                disabled={['3', '4'].includes(key)}
+                allowClear={false}
+                value={dayjs(topInfo.date)}
+                onChange={timeChange}
+              />
+            </div>
+          </div>
+
+          {B3aForm1.map(v => (
+            <div className='B1row' key={v.name}>
+              <div className='B1rowll'>{v.name}:</div>
+              <div className='B1rowrr'>
+                {topInfo[v.key as 'name']}
+                {['3', '4'].includes(key) && v.name === '发起人'
+                  ? ' - ' + topInfo.createTime || ''
+                  : ''}
+              </div>
+            </div>
+          ))}
+
+          <div className='B1row B1row2'>
+            <div className='B1rowll'>附件:</div>
+            <div className='B1rowrr'>
+              <Z3upFiles
+                max={10}
+                isLook={['3', '4'].includes(key)}
+                ref={filesRef}
+                fileCheck={false}
+                dirCode='B1collect'
+                myUrl='cms/orderCollect/upload'
+                lookData={topInfo.files || []}
+                size={500}
+                fromData={{ moduleId: topInfo.id }}
+              />
+            </div>
+          </div>
+
+          <div className='B1row'>
+            <div className='B1rowll'>原因事由:</div>
+            <div className='B1rowrr'>
+              <Input
+                value={topInfo.reason}
+                onChange={e => setTopInfo({ ...topInfo, reason: e.target.value })}
+                readOnly={['3', '4'].includes(key)}
+                placeholder='请输入内容'
+                maxLength={30}
+                showCount
+              />
+            </div>
+          </div>
+
+          <div className='B1row B1rowFull'>
+            <div className='B1rowll'>备注:</div>
+            <div className='B1rowrr'>
+              <ZRichTexts
+                check={false}
+                dirCode='B1collect'
+                myUrl='cms/orderCollect/upload'
+                isLook={['3', '4'].includes(key)}
+                ref={ZRichTextRef}
+                isOne={true}
+                upAudioBtnNone={true}
+              />
+            </div>
+          </div>
+        </div>
+
+        {/* 征集线索 */}
+        <div className='B1googsBox'>
+          <div className='B1Tit2'>
+            <div className='B1Tit2ll'>征集线索</div>
+            <div className='B1Tit2rr'>
+              {['3', '4'].includes(key) ? null : (
+                <Button type='primary' onClick={() => setOpenId(-1)}>
+                  新增
+                </Button>
+              )}
+            </div>
+          </div>
+
+          {/* 表格 */}
+          <MyTable
+            list={clueArr}
+            columnsTemp={B1TableC}
+            lastBtn={tableLastBtn}
+            pagingInfo={false}
+          />
+        </div>
+
+        {/* 相关鉴定 待完善*/}
+        {['3', '4'].includes(key) ? <B1appraisal /> : null}
+
+        {/* 申请流程 */}
+        {auditsShow ? (
+          <B3flowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
+        ) : null}
+      </div>
+
+      {/* 底部按钮 */}
+      <div className='B1btn'>
+        {['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('/collect')} />
+          </>
+        )}
+      </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>
+  )
+}
+
+const MemoB1edit = React.memo(B1edit)
+
+export default MemoB1edit

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

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

+ 276 - 0
src/pages/B_enterTibet/B1collectOld/index.tsx

@@ -0,0 +1,276 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { B3_4inputKeyArr, B3baseFormData, D3InputKeyType } from '../B3_4page'
+import history, { btnFlagFu } from '@/utils/history'
+import { Button, DatePicker, Input, Select } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import dayjs from 'dayjs'
+import MyTable from '@/components/MyTable'
+import { B3tableC, statusObj } from '@/utils/tableData'
+import { useDispatch, useSelector } from 'react-redux'
+import { B1_APIdel, B1_APIgetList } from '@/store/action/B1collect'
+import { MessageFu } from '@/utils/message'
+import { FourTableType } from '../B3_4page/type'
+import { RootState } from '@/store'
+import ExportJsonExcel from 'js-export-excel'
+import { selectObj } from '@/utils/select'
+const { RangePicker } = DatePicker
+
+function B1collect() {
+  const dispatch = useDispatch()
+  const [formData, setFormData] = useState(B3baseFormData)
+  const formDataRef = useRef(B3baseFormData)
+  const formDataOldRef = useRef(B3baseFormData)
+
+  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(B1_APIgetList(formDataRef.current))
+  }, [dispatch])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu, timeKey])
+
+  // 输入框的改变
+  const txtChangeFu = useCallback(
+    (txt: string, key: D3InputKeyType) => {
+      setFormData({
+        ...formData,
+        [key]: txt
+      })
+    },
+    [formData]
+  )
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setFormData(B3baseFormData)
+    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 B1_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+  // 点击各种操作按钮
+  const tableBtnFu = useCallback((id: number, key: string) => {
+    history.push(`/collect_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.B1collect.tableInfo)
+
+  // 点击导出
+  const deriveFu = useCallback(async () => {
+    const name = '藏品征集' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
+
+    const res = await B1_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', 'name', 'deptName', 'creatorName', 'createTime', 'status'],
+            sheetHeader: ['业务单号', '申请名称', '发起部门', '发送人', '发起日期', '申请状态'],
+            columnWidths: [10, 10, 10, 10, 10, 10]
+          }
+        ]
+      }
+
+      const toExcel = new ExportJsonExcel(option) //new
+      toExcel.saveExcel() //保存
+    }
+  }, [])
+
+  return (
+    <div className={styles.B1collect}>
+      <div className='pageTitle'>藏品征集</div>
+      <div className='B1top'>
+        <div className='B1topll'>
+          {B3_4inputKeyArr.map(item => (
+            <div key={item.name}>
+              <span>{item.name}:</span>
+              <Input
+                placeholder={`请输入${item.name}`}
+                maxLength={30}
+                value={formData[item.key]}
+                onChange={e => txtChangeFu(e.target.value, item.key)}
+              />
+            </div>
+          ))}
+        </div>
+        <div className='B1toprr'>
+          <Button type='primary' onClick={deriveFu}>
+            批量导出
+          </Button>
+          &emsp;
+          <Button type='primary' onClick={() => history.push('/collect_edit/1/null')}>
+            新增
+          </Button>
+        </div>
+      </div>
+      <div className='B1top'>
+        <div className='B1topll'>
+          <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}
+              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}
+              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={B3tableC}
+        lastBtn={tableLastBtn}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={tableInfo.total}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+      />
+    </div>
+  )
+}
+
+const MemoB1collect = React.memo(B1collect)
+
+export default MemoB1collect

src/pages/B_enterTibet/B1collect/type.d.ts → src/pages/B_enterTibet/B1collectOld/type.d.ts


+ 11 - 0
src/pages/E_goodsStorage/E1accident/E1edit/index.tsx

@@ -26,6 +26,7 @@ import {
 } from '@/store/action/E1accident'
 import { EXbtnFu } from '@/utils/EXBtn'
 import B3flowTable from '@/pages/B_enterTibet/B3flowTable'
+import ZupFileTable from '@/components/ZupFileTable'
 function E1edit() {
   const { key, id } = useParams<any>()
   // key:1 新增 2编辑 3审批 4查看
@@ -526,6 +527,16 @@ function E1edit() {
         {auditsShow ? (
           <B3flowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
         ) : null}
+
+        {/* 附件归档 */}
+        {topInfo.status === 4 ? (
+          <ZupFileTable
+            listTemp={topInfo.filing || []}
+            dirCode='E1accident'
+            myUrl='cms/orderPreserveAccident/upload'
+            fromData={{ moduleId: topInfo.id }}
+          />
+        ) : null}
       </div>
 
       {/* 底部按钮 */}

+ 11 - 0
src/pages/E_goodsStorage/E2damaged/E2edit/index.tsx

@@ -30,6 +30,7 @@ import ZRichTexts from '@/components/ZRichTexts'
 import MyTable from '@/components/MyTable'
 import B3flowTable from '@/pages/B_enterTibet/B3flowTable'
 import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+import ZupFileTable from '@/components/ZupFileTable'
 
 function E2edit() {
   const { key, id } = useParams<any>()
@@ -501,6 +502,16 @@ function E2edit() {
         {auditsShow ? (
           <B3flowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
         ) : null}
+
+        {/* 附件归档 */}
+        {topInfo.status === 4 ? (
+          <ZupFileTable
+            listTemp={topInfo.filing || []}
+            dirCode='E4repair'
+            myUrl='cms/orderPreserveFix/upload'
+            fromData={{ moduleId: topInfo.id }}
+          />
+        ) : null}
       </div>
 
       {/* 底部按钮 */}

+ 11 - 0
src/pages/E_goodsStorage/E3actuality/E3edit/index.tsx

@@ -30,6 +30,7 @@ import MyTable from '@/components/MyTable'
 import B3flowTable from '@/pages/B_enterTibet/B3flowTable'
 import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
 import B3GaddNow from '@/pages/B_enterTibet/B3goodsTable/B3GaddNow'
+import ZupFileTable from '@/components/ZupFileTable'
 
 function E3edit() {
   const { key, id } = useParams<any>()
@@ -502,6 +503,16 @@ function E3edit() {
         {auditsShow ? (
           <B3flowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
         ) : null}
+
+        {/* 附件归档 */}
+        {topInfo.status === 4 ? (
+          <ZupFileTable
+            listTemp={topInfo.filing || []}
+            dirCode='E4repair'
+            myUrl='cms/orderPreserveFix/upload'
+            fromData={{ moduleId: topInfo.id }}
+          />
+        ) : null}
       </div>
 
       {/* 底部按钮 */}

+ 23 - 4
src/utils/tableData.ts

@@ -35,11 +35,30 @@ selectObj['入藏状态'].forEach(v => {
   statusCollectObj[v.value] = v.label
 })
 
+// 藏品征集 待完善
 export const B1TableC = [
-  ['txt', '线索名称', 'name'],
-  ['txt', '线索类别', 'type'],
-  ['txt', '创建人', 'creatorName'],
-  ['txt', '创建时间', 'createTime']
+  ['txt', '业务单号', 'num'],
+  ['txt', '征集日期', 'type'],
+  ['txt', '发起部门', 'creatorName'],
+  ['txt', '发起人', 'createTime'],
+  ['txt', '发起日期', 'createTime'],
+  ['txt', '申请状态', 'createTime']
+]
+
+// 藏品征集里面的藏品清单 待完善
+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']
 ]
 
 export const B3eTableC = [