Просмотр исходного кода

总账和分账-差导入模块

shaogen1995 4 месяцев назад
Родитель
Сommit
70cef25790

+ 50 - 0
src/pages/A3_ledger/A32Routing/A32set/index.module.scss

@@ -0,0 +1,50 @@
+.A32set {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 800px !important;
+    }
+    .A32Smain {
+      border-top: 1px solid #999999;
+      padding-top: 15px;
+      width: 100%;
+
+      .A32Sbox {
+        max-height: 500px;
+        overflow-y: auto;
+        .A32Srow {
+          margin-bottom: 20px;
+          .A32Srow1 {
+            position: relative;
+            font-size: 14px;
+            font-weight: 700;
+            padding-left: 20px;
+            margin-bottom: 20px;
+            &::before {
+              content: '';
+              position: absolute;
+              top: 0;
+              left: 0;
+              width: 5px;
+              height: 22px;
+              border-radius: 4px;
+              background-color: var(--themeColor);
+            }
+          }
+          .A32Srow2Check {
+            margin-right: 10px;
+            margin-bottom: 10px;
+          }
+        }
+      }
+
+      .A32Sbtn {
+        margin-top: 15px;
+        text-align: center;
+      }
+    }
+  }
+}

+ 94 - 0
src/pages/A3_ledger/A32Routing/A32set/index.tsx

@@ -0,0 +1,94 @@
+import React, { useCallback, useEffect, useState } from 'react'
+import styles from './index.module.scss'
+import { Button, Checkbox, Modal } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { A32treeData } from '../data'
+import { A32_APIset } from '@/store/action/A32Routing'
+import { MessageFu } from '@/utils/message'
+
+type Props = {
+  filterId: string[]
+  succFu: () => void
+  closeFu: () => void
+}
+
+function A32set({ filterId, succFu, closeFu }: Props) {
+  // 多选框变化
+  const [checkArr, setCheckArr] = useState<string[]>([])
+  useEffect(() => {
+    setCheckArr(filterId)
+  }, [filterId])
+
+  const checkFu = useCallback(
+    (id: string) => {
+      if (checkArr.includes(id)) setCheckArr(checkArr.filter(v => v !== id))
+      else setCheckArr([...checkArr, id])
+    },
+    [checkArr]
+  )
+
+  // 点击保存
+  const btnOk = useCallback(async () => {
+    const obj = {
+      id: '50000',
+      type: 'goodsAccount',
+      rtf: JSON.stringify(checkArr),
+      name: '分账设置',
+      ancestor: '0',
+      parentId: '0',
+      sort: 1
+    }
+    const res = await A32_APIset(obj)
+
+    if (res.code === 0) {
+      MessageFu.success('设置成功')
+      succFu()
+      closeFu()
+    }
+  }, [checkArr, closeFu, succFu])
+
+  return (
+    <Modal
+      wrapClassName={styles.A32set}
+      destroyOnClose
+      open={true}
+      title='分账设置'
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='A32Smain'>
+        <div className='A32Sbox'>
+          {A32treeData.map(item1 => (
+            <div className='A32Srow' key={item1.name}>
+              <div className='A32Srow1'>{item1.name}</div>
+              <div className='A32Srow2'></div>
+              {item1.son.map(item2 => (
+                <Checkbox
+                  className='A32Srow2Check'
+                  key={item2.id}
+                  checked={checkArr.includes(item2.id)}
+                  onChange={() => checkFu(item2.id)}
+                >
+                  {item2.name}
+                </Checkbox>
+              ))}
+            </div>
+          ))}
+        </div>
+
+        <div className='A32Sbtn'>
+          <Button type='primary' onClick={btnOk}>
+            保存
+          </Button>
+          &emsp;
+          <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+        </div>
+      </div>
+    </Modal>
+  )
+}
+
+const MemoA32set = React.memo(A32set)
+
+export default MemoA32set

+ 8 - 0
src/pages/A3_ledger/A32Routing/A32table/index.module.scss

@@ -0,0 +1,8 @@
+.A32table {
+  :global {
+    .ant-table-cell {
+      padding: 6px !important;
+      min-width: 100px;
+    }
+  }
+}

+ 162 - 0
src/pages/A3_ledger/A32Routing/A32table/index.tsx

@@ -0,0 +1,162 @@
+import React, { useEffect, useMemo, useState } from 'react'
+import styles from './index.module.scss'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
+import { selectObj } from '@/utils/select'
+import { Button, Table } from 'antd'
+import classNames from 'classnames'
+import { openGoodsInfoFu, resJiLianFu } from '@/utils/history'
+import { useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import ImageLazy from '@/components/ImageLazy'
+import { statusCollectObj, statusStorageObj } from '@/utils/tableData'
+
+type Props = {
+  pageNum: number
+  pageSize: number
+  pageChangeFu: (pageNum: number, pageSize: number) => void
+  advanced: boolean
+}
+
+function A32table({ pageNum, pageSize, pageChangeFu, advanced }: Props) {
+  // 打开侧边栏
+  const [cathet, setCathet] = useState(0)
+
+  // 从仓库拿数据
+  const tableInfo = useSelector((state: RootState) => state.A32Routing.tableInfo)
+
+  const columns = useMemo(() => {
+    const arr: any = [
+      {
+        title: '藏品编号',
+        width: 100,
+        fixed: 'left',
+        render: (item: FourTableType) => {
+          return (
+            <span
+              onClick={() => setCathet(item.id)}
+              className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
+            >
+              {item.num}
+            </span>
+          )
+        }
+      },
+      {
+        title: '封面图',
+        width: 60,
+        render: (item: FourTableType) => (
+          <div className='tableImgAuto'>
+            <ImageLazy
+              width={60}
+              height={60}
+              srcBig={item.thumbPc || item.filePath}
+              src={item.thumb}
+            />
+          </div>
+        )
+      },
+      {
+        title: '编号类型',
+        render: (item: FourTableType) => item.numName || '(空)'
+      },
+      {
+        title: '藏品名称',
+        render: (item: FourTableType) => item.name || '(空)'
+      },
+      {
+        title: '文物级别',
+        render: (item: FourTableType) => item.dictLevel || '(空)'
+      },
+      {
+        title: '文物类别',
+        render: (item: FourTableType) => resJiLianFu(item.dictType)
+      },
+      {
+        title: '年代',
+        render: (item: FourTableType) =>
+          item.dictAge === '其他' ? '其他' : resJiLianFu(item.dictAge)
+      },
+      {
+        title: '质地',
+        render: (item: FourTableType) => resJiLianFu(item.dictTexture3)
+      },
+      {
+        title: '完残程度',
+        render: (item: FourTableType) => resJiLianFu(item.dictTorn)
+      },
+      {
+        title: '来源',
+        render: (item: FourTableType) => resJiLianFu(item.source)
+      },
+      {
+        title: '入藏状态',
+        render: (item: FourTableType) =>
+          Reflect.get(statusCollectObj, item.statusCollect) || '(空)'
+      },
+      {
+        title: '库存状态',
+        render: (item: FourTableType) =>
+          Reflect.get(statusStorageObj, item.statusStorage) || '(空)'
+      },
+      {
+        title: '展览状态',
+        render: (item: FourTableType) =>
+          (selectObj['展览状态'].find(v => v.value === item.accountIndoor) || {}).label || '(空)'
+      },
+      {
+        title: '创建日期',
+        render: (item: FourTableType) => item.createTime
+      },
+
+      {
+        title: '操作',
+        width: 80,
+        fixed: 'right',
+        render: (item: FourTableType) => {
+          return (
+            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+              查看
+            </Button>
+          )
+        }
+      }
+    ]
+
+    return arr
+  }, [cathet])
+
+  useEffect(() => {
+    const dom = document.querySelector('.ant-table-body') as HTMLDivElement
+    if (dom) {
+      dom.style.height = (advanced ? 550 : 605) + 'px'
+    }
+  }, [advanced])
+
+  return (
+    <div className={styles.A32table}>
+      <Table
+        scroll={{ y: advanced ? 550 : 605, x: 'max-content' }}
+        dataSource={tableInfo.list}
+        columns={columns}
+        rowKey='id'
+        pagination={{
+          showQuickJumper: true,
+          position: ['bottomCenter'],
+          showSizeChanger: true,
+          current: pageNum,
+          pageSize: pageSize,
+          total: tableInfo.total,
+          onChange: (pageNum, pageSize) => pageChangeFu(pageNum, pageSize)
+        }}
+      />
+
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+    </div>
+  )
+}
+
+const MemoA32table = React.memo(A32table)
+
+export default MemoA32table

+ 37 - 0
src/pages/A3_ledger/A32Routing/data.ts

@@ -0,0 +1,37 @@
+import { cascaderObjFu } from '@/utils/history'
+
+export type A32treeDataType = {
+  name: string
+  show: boolean
+  key: string
+  son: { id: string; name: string }[]
+}
+
+export const A32treeData: A32treeDataType[] = [
+  {
+    name: '馆藏与非馆藏',
+    show: true,
+    key: 'accountType',
+    son: [
+      { id: '1', name: '藏品' },
+      { id: '2', name: '参考品' },
+      { id: '3', name: '资料' },
+      { id: '4', name: '标本' }
+    ]
+  },
+  {
+    name: '类别分账',
+    show: true,
+    key: 'dictType',
+    son: cascaderObjFu()['文物类别']
+  },
+  {
+    name: '展品分账',
+    show: true,
+    key: 'accountIndoor',
+    son: [
+      { id: '6', name: '馆外' },
+      { id: '5', name: '馆内' }
+    ]
+  }
+]

+ 102 - 0
src/pages/A3_ledger/A32Routing/index.module.scss

@@ -1,4 +1,106 @@
 .A32Routing {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 10px 24px 0;
+  position: relative;
   :global {
+    .C4tit {
+      color: #999;
+      margin-left: 10px;
+      font-size: 14px;
+      font-weight: 400;
+    }
+    .A32top {
+      display: flex;
+      justify-content: space-between;
+    }
+
+    .A32main {
+      margin-top: 15px;
+      height: calc(100% - 47px);
+      display: flex;
+      .A32left {
+        width: 200px;
+        margin-right: 15px;
+        user-select: none;
+
+        & > div {
+          margin-top: 10px;
+          height: calc(100% - 45px);
+          overflow-y: auto;
+          font-size: 14px;
+          padding-bottom: 20px;
+          .A32llRow {
+            .A32llRow1 {
+              font-weight: 700;
+              height: 38px;
+              line-height: 38px;
+              cursor: pointer;
+              & > span {
+                display: inline-block;
+                transition: all 0.3s;
+              }
+            }
+            .A32llRow2 {
+              padding-left: 30px;
+              height: 0;
+              overflow: hidden;
+              word-wrap: break-word;
+              .A32llRow2Row {
+                margin-bottom: 2px;
+                & > span {
+                  cursor: pointer;
+                  display: inline-block;
+                  padding: 3px 4px;
+                  border-radius: 4px;
+                  &:hover {
+                    background-color: #f5f5f5;
+                  }
+                }
+                .A32llRow2RowAc {
+                  background-color: #b4bfbc !important;
+                }
+              }
+            }
+            .A32llRow2Show {
+              height: auto;
+              overflow: visible;
+            }
+          }
+        }
+      }
+      .A32right {
+        width: calc(100% - 215px);
+        height: 100%;
+        padding-top: 10px;
+        .A32rrTop {
+          display: flex;
+          flex-wrap: wrap;
+          & > div {
+            margin-right: 15px;
+            display: flex;
+            align-items: center;
+            position: relative;
+            width: 8.7%;
+            margin-bottom: 22px;
+            .ant-input {
+              width: 100%;
+            }
+            .ant-select {
+              width: 100%;
+            }
+            & > span {
+              position: absolute;
+              top: -18px;
+              left: 0;
+              pointer-events: none;
+            }
+            &:nth-of-type(10n) {
+              margin-right: 0;
+            }
+          }
+        }
+      }
+    }
   }
 }

+ 471 - 3
src/pages/A3_ledger/A32Routing/index.tsx

@@ -1,10 +1,478 @@
-import React from 'react'
+import React, { useCallback, useEffect, useRef, useState } from 'react'
 import styles from './index.module.scss'
+import { Button, Cascader, Input, Select } from 'antd'
+import dayjs from 'dayjs'
+import { MessageFu } from '@/utils/message'
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
+import { resJiLianFu } from '@/utils/history'
+import { statusCollectObj, statusStorageObj } from '@/utils/tableData'
+import ExportJsonExcel from 'js-export-excel'
+import { useDispatch } from 'react-redux'
+import { C1baseFormData, C1baseFormData2, C1InputKeyArr1, C1InputKeyArr2 } from '../C1ledger/data'
+import { A32_APIgetList } from '@/store/action/A32Routing'
+import { C1InputKeyType } from '../C1ledger/type'
+import C8recycleBin from '../ComPage/C8recycleBin'
+import C4import from '../ComPage/C4import'
+import { A32treeData, A32treeDataType } from './data'
+import { CaretDownOutlined } from '@ant-design/icons'
+import classNames from 'classnames'
+import { Z1_APIgetInfo } from '@/store/action/Z1dict'
+import A32set from './A32set'
+import store from '@/store'
+import A32table from './A32table'
+import { selectObj } from '@/utils/select'
+
 function A32Routing() {
+  const dispatch = useDispatch()
+
+  // -------------左侧树-----------------------
+  const [value, setValue] = useState('')
+  const [value2, setValue2] = useState('')
+
+  const timeRef = useRef(-1)
+
+  useEffect(() => {
+    clearTimeout(timeRef.current)
+    window.setTimeout(() => {
+      setValue2(value)
+    }, 500)
+  }, [value])
+
+  // 过滤的id
+  const [filterId, setFilterId] = useState<string[]>([])
+
+  const getFilterFu = useCallback(async () => {
+    const res = await Z1_APIgetInfo('50000')
+    if (res.code === 0) {
+      const data = res.data
+      if (data.rtf) {
+        const val = JSON.parse(data.rtf)
+        setFilterId([...val])
+      }
+    }
+  }, [])
+
+  useEffect(() => {
+    getFilterFu()
+  }, [getFilterFu])
+
+  const treeKey = useRef('')
+  const [treeAc, setTreeAc] = useState<string | null>('')
+  const treeAcRef = useRef('')
+  useEffect(() => {
+    if (treeAc) treeAcRef.current = treeAc
+  }, [treeAc])
+
+  const [treeArr, setTreeArr] = useState<A32treeDataType[]>([])
+
+  useEffect(() => {
+    let arr = A32treeData
+    // 顶部过滤
+    arr = arr.map(v => ({
+      ...v,
+      show: true,
+      son: v.son.filter(c => c.name.includes(value2) && filterId.includes(c.id))
+    }))
+
+    const arrPu: { id: string; name: string; key: string }[] = []
+
+    arr.forEach(v => {
+      if (v.son && v.son.length) {
+        v.son.forEach(c => {
+          arrPu.push({ ...c, key: v.key })
+        })
+      }
+    })
+
+    if (flagRef.current) {
+      if (arrPu && arrPu.length) {
+        flagRef.current = false
+
+        // 是不是原来选中了 后面取消了
+        if (!filterId.includes(treeAcRef.current)) {
+          setTreeAc(arrPu[0].id)
+          treeKey.current = arrPu[0].key
+        }
+      } else {
+        setTreeAc(null)
+      }
+    }
+
+    setTreeArr(arr)
+  }, [filterId, value2])
+
+  const flagRef = useRef(true)
+
+  useEffect(() => {}, [treeArr])
+
+  // 点击展开的收起
+  const showTreeArrFu = useCallback(
+    (name: string) => {
+      setTreeArr(
+        treeArr.map(v => ({
+          ...v,
+          show: v.name === name ? !v.show : v.show
+        }))
+      )
+    },
+    [treeArr]
+  )
+  // -------------左侧树end-----------------------
+
+  const [formData, setFormData] = useState(C1baseFormData)
+  const formDataRef = useRef(C1baseFormData)
+  const formDataOldRef = useRef(C1baseFormData)
+
+  useEffect(() => {
+    formDataRef.current = formData
+  }, [formData])
+
+  // 点击搜索的 时间戳
+  const [timeKey, setTimeKey] = useState(0)
+
+  // 点击搜索
+  const clickSearch = useCallback(() => {
+    setFormData({ ...formData, pageNum: 1 })
+    setTimeout(() => {
+      setTimeKey(Date.now())
+    }, 50)
+  }, [formData])
+
+  // 封装发送请求的函数
+  const treeTimeRef = useRef(-1)
+
+  const getListFu = useCallback(() => {
+    clearTimeout(treeTimeRef.current)
+    treeTimeRef.current = window.setTimeout(() => {
+      if (treeAc) {
+        formDataOldRef.current = { ...formDataRef.current }
+
+        const obj = { ...formDataRef.current }
+        obj[treeKey.current as 'name'] = treeAc
+
+        dispatch(A32_APIgetList(obj))
+      } else if (treeAc === null) {
+        store.dispatch({ type: 'A32/getList', payload: { list: [], total: 0 } })
+      }
+    }, 100)
+  }, [dispatch, treeAc])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu, timeKey])
+
+  // 输入框的改变
+  const txtChangeFu = useCallback(
+    (txt: string, key: C1InputKeyType) => {
+      setFormData({
+        ...formData,
+        [key]: txt
+      })
+    },
+    [formData]
+  )
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setFormData(C1baseFormData)
+    setTimeout(() => {
+      setTimeKey(Date.now())
+    }, 50)
+  }, [])
+
+  // 页码变化
+  const paginationChange = useCallback(
+    (pageNum: number, pageSize: number) => {
+      setFormData({ ...formData, pageNum, pageSize })
+      setTimeout(() => {
+        setTimeKey(Date.now())
+      }, 50)
+    },
+    [formData]
+  )
+
+  // 顶部筛选
+  const searchDom = useCallback(
+    (arr: any[]) => {
+      return arr.map(item => {
+        return (
+          <div key={item.name}>
+            <span>{item.name}:</span>
+            {item.type === '输入框' ? (
+              <Input
+                placeholder='请输入'
+                maxLength={30}
+                value={formData[item.key as 'num']}
+                onChange={e => txtChangeFu(e.target.value, item.key)}
+              />
+            ) : item.type === '下拉框' ? (
+              <Select
+                options={item.data}
+                placeholder='全部'
+                allowClear={true}
+                value={formData[item.key as 'num'] ? formData[item.key as 'num'] : null}
+                onChange={e => setFormData({ ...formData, [item.key]: e })}
+              />
+            ) : (
+              <Cascader
+                options={item.data}
+                placeholder='全部'
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                allowClear={true}
+                value={
+                  formData[item.key as 'num']
+                    ? (formData[item.key as 'num'] as string).split(',')
+                    : []
+                }
+                onChange={e => setFormData({ ...formData, [item.key]: e ? e.join(',') : '' })}
+              />
+            )}
+          </div>
+        )
+      })
+    },
+    [formData, txtChangeFu]
+  )
+
+  // 点击导出
+  const deriveFu = useCallback(async () => {
+    const name = '藏品分账' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
+
+    const obj = {
+      ...formDataOldRef.current,
+      pageNum: 1,
+      pageSize: 99999
+    }
+    obj[treeKey.current as 'name'] = treeAc!
+
+    const res = await A32_APIgetList(obj, 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,
+              thumbPc: v.thumbPc ? window.location.origin + v.thumbPc : '(空)',
+              dictType: resJiLianFu(v.dictType),
+              dictAge: v.dictAge === '其他' ? '其他' : resJiLianFu(v.dictAge),
+              dictTexture3: resJiLianFu(v.dictTexture3),
+              dictTorn: resJiLianFu(v.dictTorn),
+              source: resJiLianFu(v.source),
+              statusCollect: Reflect.get(statusCollectObj, v.statusCollect) || '(空)',
+              statusStorage: Reflect.get(statusStorageObj, v.statusStorage) || '(空)',
+              accountIndoor:
+                (selectObj['展览状态'].find(c => c.value === v.accountIndoor) || {}).label ||
+                '(空)'
+            })),
+            sheetName: name,
+            sheetFilter: [
+              'num',
+              'thumbPc',
+              'numName',
+              'name',
+              'dictLevel',
+              'dictType',
+              'dictAge',
+              'dictTexture3',
+              'dictTorn',
+              'source',
+              'statusCollect',
+              'statusStorage',
+              'accountIndoor',
+              'createTime'
+            ],
+            sheetHeader: [
+              '藏品编号',
+              '封面图地址',
+              '编号类型',
+              '藏品名称',
+              '文物级别',
+              '文物类别',
+              '年代',
+              '质地',
+              '完残程度',
+              '来源',
+              '入藏状态',
+              '库存状态',
+              '展览状态',
+              '创建日期'
+            ],
+            columnWidths: [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
+          }
+        ]
+      }
+
+      const toExcel = new ExportJsonExcel(option) //new
+      toExcel.saveExcel() //保存
+    }
+  }, [treeAc])
+
+  // 高级搜索的切换
+  const [advanced, setAdvanced] = useState(false)
+
+  // 点击收起高级搜索
+  const advancedFu = useCallback(
+    (flag: boolean) => {
+      setAdvanced(flag)
+      if (!flag) {
+        setFormData({ ...formData, ...C1baseFormData2 })
+      }
+    },
+    [formData]
+  )
+
+  // 点击回收站
+  const [recycleBin, setRecycleBin] = useState(false)
+
+  // 点击数据导入
+  const [importPage, setImportPage] = useState(false)
+
+  // 点击分账设置
+  const [setPage, setSetPage] = useState(false)
+
   return (
     <div className={styles.A32Routing}>
-      <h1>开发中</h1>
-      <div className='pageTitle'>藏品分账</div>
+      <div className='pageTitle'>
+        藏品分账{recycleBin ? '-回收站' : ''}
+        {importPage ? (
+          <>
+            -数据导入<span className='C4tit'>最多支持单次导入1000条</span>
+          </>
+        ) : (
+          ''
+        )}
+      </div>
+
+      <div className='A32top'>
+        <Button type='primary' onClick={() => setSetPage(true)}>
+          设置分账
+        </Button>
+        <div>
+          <Button type='primary' onClick={() => setRecycleBin(true)}>
+            回收站
+          </Button>
+          &emsp;
+          <Button type='primary' onClick={() => setImportPage(true)}>
+            数据导入
+          </Button>
+          &emsp;
+          <Button type='primary' onClick={deriveFu} disabled={!treeAc}>
+            批量导出
+          </Button>
+          &emsp;
+          <Button danger={advanced} onClick={() => advancedFu(!advanced)}>
+            {advanced ? '收起' : ''}高级搜索
+          </Button>
+          &emsp;
+          <Button type='primary' onClick={clickSearch} disabled={!treeAc}>
+            查询
+          </Button>
+          &emsp;
+          <Button onClick={resetSelectFu} disabled={!treeAc}>
+            重置
+          </Button>
+        </div>
+      </div>
+
+      <div className='A32main'>
+        <div className='A32left'>
+          <Input
+            placeholder='请输入分账名称'
+            value={value}
+            onChange={e => setValue(e.target.value.trim())}
+            allowClear
+          />
+          <div>
+            {treeArr.map(item1 => (
+              <div className='A32llRow' key={item1.name}>
+                <div className='A32llRow1' onClick={() => showTreeArrFu(item1.name)}>
+                  <span
+                    style={{
+                      transform: `rotate(${item1.show ? 0 : -90}deg)`,
+                      opacity: item1.son && item1.son.length ? '1' : '0'
+                    }}
+                  >
+                    <CaretDownOutlined />
+                  </span>
+                  &nbsp;
+                  {item1.name}
+                </div>
+
+                {/* 二级 */}
+                <div className={classNames('A32llRow2', item1.show ? 'A32llRow2Show' : '')}>
+                  {item1.son.map(item2 => (
+                    <div className='A32llRow2Row' key={item2.id}>
+                      <span
+                        onClick={() => {
+                          treeKey.current = item1.key
+                          setTreeAc(item2.id)
+                        }}
+                        className={classNames(treeAc === item2.id ? 'A32llRow2RowAc' : '')}
+                      >
+                        {item2.name}
+                      </span>
+                    </div>
+                  ))}
+                </div>
+              </div>
+            ))}
+          </div>
+        </div>
+        <div className='A32right'>
+          <div className='A32rrTop'>
+            {searchDom(C1InputKeyArr1.filter(v => v.name !== '文物类别'))}
+
+            {advanced
+              ? searchDom(C1InputKeyArr2.filter(v => !['入藏去向', '展览状态'].includes(v.name)))
+              : null}
+          </div>
+
+          {/* 表格 */}
+          <A32table
+            advanced={advanced}
+            pageNum={formData.pageNum}
+            pageSize={formData.pageSize}
+            pageChangeFu={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+          />
+        </div>
+      </div>
+
+      {/* 回收站 */}
+      {recycleBin ? (
+        <C8recycleBin
+          closeFu={flag => {
+            if (flag) getListFu()
+
+            setRecycleBin(false)
+          }}
+        />
+      ) : null}
+
+      {/* 数据导入 */}
+      {importPage ? (
+        <C4import
+          colseFu={flag => {
+            if (flag) resetSelectFu()
+            setImportPage(false)
+          }}
+        />
+      ) : null}
+
+      {/* 设置分账 */}
+      {setPage ? (
+        <A32set
+          filterId={filterId}
+          succFu={() => {
+            flagRef.current = true
+            getFilterFu()
+          }}
+          closeFu={() => setSetPage(false)}
+        />
+      ) : null}
     </div>
   )
 }

+ 4 - 5
src/pages/A3_ledger/C1ledger/data.ts

@@ -14,8 +14,8 @@ export const C1baseFormData1: TYpeC1Form1 = {
   source: '',
   statusCollect: '',
   statusStorage: '',
-  aaaa: '',
-  bbbb: ''
+  accountType: '',
+  accountIndoor: ''
 }
 
 export const C1baseFormData2: TYpeC1Form2 = {
@@ -68,7 +68,6 @@ export const C1InputKeyArr2: C1DomArrType = [
   { name: '鉴藏印记', key: 'sourceStamp', type: '输入框' },
   { name: '著作书目', key: 'historyWork', type: '输入框' },
   { name: '流转经历', key: 'historyUndergo', type: '输入框' },
-  // 待完善
-  { name: '入藏去向', key: 'aaaa', type: '下拉框', data: selectObj['入藏去向'] },
-  { name: '展览状态', key: 'aaaa', type: '下拉框', data: selectObj['展览状态'] }
+  { name: '入藏去向', key: 'accountType', type: '下拉框', data: selectObj['入藏去向'] },
+  { name: '展览状态', key: 'accountIndoor', type: '下拉框', data: selectObj['展览状态'] }
 ]

+ 0 - 1
src/pages/A3_ledger/C1ledger/index.module.scss

@@ -16,7 +16,6 @@
       .C1topll {
         display: flex;
         & > div {
-          position: relative;
           margin-right: 15px;
           display: flex;
           align-items: center;

+ 16 - 8
src/pages/A3_ledger/C1ledger/index.tsx

@@ -17,6 +17,7 @@ import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
 import ExportJsonExcel from 'js-export-excel'
 import C8recycleBin from '../ComPage/C8recycleBin'
 import C4import from '../ComPage/C4import'
+import { selectObj } from '@/utils/select'
 
 function C1ledger() {
   const dispatch = useDispatch()
@@ -84,11 +85,12 @@ function C1ledger() {
     return [
       {
         title: '展览状态',
-        render: (item: FourTableType) => '待完善'
+        render: (item: FourTableType) =>
+          (selectObj['展览状态'].find(v => v.value === item.accountIndoor) || {}).label || '(空)'
       },
       {
         title: '创建日期',
-        render: (item: FourTableType) => '待完善'
+        render: (item: FourTableType) => item.createTime
       },
 
       {
@@ -207,14 +209,17 @@ function C1ledger() {
           {
             sheetData: res.data.records.map((v: FourTableType) => ({
               ...v,
-              thumbPc: window.location.origin + v.thumbPc,
+              thumbPc: v.thumbPc ? window.location.origin + v.thumbPc : '(空)',
               dictType: resJiLianFu(v.dictType),
               dictAge: v.dictAge === '其他' ? '其他' : resJiLianFu(v.dictAge),
               dictTexture3: resJiLianFu(v.dictTexture3),
               dictTorn: resJiLianFu(v.dictTorn),
               source: resJiLianFu(v.source),
               statusCollect: Reflect.get(statusCollectObj, v.statusCollect) || '(空)',
-              statusStorage: Reflect.get(statusStorageObj, v.statusStorage) || '(空)'
+              statusStorage: Reflect.get(statusStorageObj, v.statusStorage) || '(空)',
+              accountIndoor:
+                (selectObj['展览状态'].find(c => c.value === v.accountIndoor) || {}).label ||
+                '(空)'
             })),
             sheetName: name,
             sheetFilter: [
@@ -229,8 +234,9 @@ function C1ledger() {
               'dictTorn',
               'source',
               'statusCollect',
-              'statusStorage'
-              // 待完善 2个字段
+              'statusStorage',
+              'accountIndoor',
+              'createTime'
             ],
             sheetHeader: [
               '藏品编号',
@@ -244,9 +250,11 @@ function C1ledger() {
               '完残程度',
               '来源',
               '入藏状态',
-              '库存状态'
+              '库存状态',
+              '展览状态',
+              '创建日期'
             ],
-            columnWidths: [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
+            columnWidths: [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
           }
         ]
       }

+ 2 - 3
src/pages/A3_ledger/C1ledger/type.d.ts

@@ -17,9 +17,8 @@ export interface TYpeC1Form1 {
   source: string
   statusCollect: string
   statusStorage: string
-  // 待完善
-  aaaa: string
-  bbbb: string
+  accountType: string
+  accountIndoor: string
 }
 
 export interface TYpeC1Form2 {

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

@@ -40,7 +40,10 @@ export type FourTableType = {
   sonTypeName: string
   status: number
   thumb: string
+  numName: string
   thumbPc: string
+  filePath: string
+  dictLevel: string
   type: string
   typeName: string
   updateTime: string
@@ -75,4 +78,8 @@ export type FourTableType = {
   returnDate: string
   // 相关出库单
   relatedOrder: FourTableType[]
+
+  // v1.1.1总账和分账
+  accountIndoor: string
+  accountType: string
 }

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

@@ -204,7 +204,7 @@ function C3focus() {
           {
             sheetData: res.data.records.map((v: FourTableType) => ({
               ...v,
-              thumbPc: window.location.origin + v.thumbPc,
+              thumbPc: v.thumbPc ? window.location.origin + v.thumbPc : '(空)',
               dictType: resJiLianFu(v.dictType),
               dictAge: v.dictAge === '其他' ? '其他' : resJiLianFu(v.dictAge),
               dictTexture3: resJiLianFu(v.dictTexture3),

+ 27 - 0
src/store/action/A32Routing.ts

@@ -0,0 +1,27 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+/**
+ * 藏品分账 - 获取分页列表 待完善
+ */
+export const A32_APIgetList = (data: any, exportFlag?: boolean): any => {
+  if (exportFlag) return http.post('cms/goods/page', data)
+  else {
+    return async (dispatch: AppDispatch) => {
+      const res = await http.post('cms/goods/page', data)
+      if (res.code === 0) {
+        const obj = {
+          list: res.data.records,
+          total: res.data.total
+        }
+        dispatch({ type: 'A32/getList', payload: obj })
+      }
+    }
+  }
+}
+
+/**
+ * 藏品分账-设置分账
+ */
+export const A32_APIset = (data: any) => {
+  return http.post('cms/dict/save', data)
+}

+ 28 - 0
src/store/reducer/A32Routing.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: 'A32/getList'
+  payload: { list: FourTableType[]; total: number }
+}
+
+// reducer
+export default function userReducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case 'A32/getList':
+      return { ...state, tableInfo: action.payload }
+
+    default:
+      return state
+  }
+}

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

@@ -3,6 +3,7 @@ import { combineReducers } from 'redux'
 
 // 导入 登录 模块的 reducer
 import A0Layout from './layout'
+import A32Routing from './A32Routing'
 import B1collect from './B1collect'
 import FourAll from './FourAll'
 import C1ledger from './C1ledger'
@@ -25,6 +26,7 @@ import Z7log from './Z7log'
 // 合并 reducer
 const rootReducer = combineReducers({
   A0Layout,
+  A32Routing,
   B1collect,
   FourAll,
   C1ledger,

+ 6 - 6
src/utils/select.ts

@@ -70,13 +70,13 @@ export const selectObj = {
     { value: '其他', label: '其他' }
   ],
   入藏去向: [
-    { value: '藏品', label: '藏品' },
-    { value: '参考品', label: '参考品' },
-    { value: '资料', label: '资料' },
-    { value: '标本', label: '标本' }
+    { value: '1', label: '藏品' },
+    { value: '2', label: '参考品' },
+    { value: '3', label: '资料' },
+    { value: '4', label: '标本' }
   ],
   展览状态: [
-    { value: '外部借展', label: '外部借展' },
-    { value: '内部借展', label: '内部借展' }
+    { value: '6', label: '外部借展' },
+    { value: '5', label: '内部借展' }
   ]
 }