shaogen1995 4 mesiacov pred
rodič
commit
2dd487d216

+ 3 - 1
src/components/MyPopconfirm.tsx

@@ -11,6 +11,7 @@ type Props = {
     | '撤回'
     | '恢复'
     | '导入当前合格数据'
+    | '取消关注'
   onConfirm: () => void
   Dom?: React.ReactNode
   loc?: 'bottom'
@@ -26,7 +27,8 @@ function MyPopconfirm({ txtK, onConfirm, Dom, loc }: Props) {
       清空数据: ['确定清空吗?', '确定'],
       撤回: ['确定撤回吗?', '确定'],
       恢复: ['确定恢复吗?', '确定'],
-      导入当前合格数据: ['确定导入吗?如数据太大可能需要等待', '确定']
+      导入当前合格数据: ['确定导入吗?如数据太大可能需要等待', '确定'],
+      取消关注: ['确定取消关注吗?', '确定']
     }
     return Reflect.get(obj, txtK) || ['', '']
   }, [txtK])

+ 1 - 1
src/pages/B_enterTibet/B3goodsTable/B3GaddNow/data.ts

@@ -28,5 +28,5 @@ export const B3baseFormData: B3nowFormType = {
   source: '',
   statusCollect: null,
   statusStorage: null,
-  isFocus: 0
+  isFocus: null
 }

+ 1 - 1
src/pages/B_enterTibet/B3goodsTable/B3GaddNow/index.tsx

@@ -221,7 +221,7 @@ function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu, oldCheckArr, can
           <div>
             <Checkbox
               checked={formData.isFocus === 1}
-              onChange={e => setFormData({ ...formData, isFocus: e.target.checked ? 1 : 0 })}
+              onChange={e => setFormData({ ...formData, isFocus: e.target.checked ? 1 : null })}
             >
               我关注的
             </Checkbox>

+ 1 - 1
src/pages/B_enterTibet/B3goodsTable/B3GaddNow/type.d.ts

@@ -10,7 +10,7 @@ export type B3nowFormType = {
   source: string
   statusCollect: number | null
   statusStorage: number | null
-  isFocus: 0 | 1
+  isFocus: 0 | 1 | null
 }
 
 export type B3nowFormKeyType = keyof B3nowFormType

+ 2 - 0
src/pages/C_goodsManage/C1ledger/type.d.ts

@@ -109,4 +109,6 @@ export type C1GoodType = {
   siteId: number
   // 库存状态
   statusStorage: number
+  // 藏品关注
+  isFocus: 1 | 0
 }

+ 52 - 0
src/pages/C_goodsManage/C3focus/index.module.scss

@@ -1,4 +1,56 @@
 .C3focus {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 0px 24px 0;
   :global {
+    .C3top {
+      display: flex;
+      justify-content: space-between;
+      margin-bottom: 15px;
+      .C3topll {
+        display: flex;
+        flex-wrap: wrap;
+        width: 1160px;
+        & > div {
+          width: 15%;
+          .ant-input {
+            width: 100%;
+          }
+          .ant-select {
+            width: 100%;
+          }
+        }
+        & > div {
+          position: relative;
+          margin-right: 15px;
+          display: flex;
+          align-items: center;
+          position: relative;
+          margin-top: 24px;
+          & > span {
+            position: absolute;
+            top: -18px;
+            left: 0;
+            pointer-events: none;
+          }
+        }
+      }
+      .C3toprr {
+        width: 140px;
+        display: flex;
+        flex-direction: column;
+        justify-content: space-around;
+        & > div {
+          display: flex;
+          justify-content: space-between;
+        }
+      }
+    }
+    .ant-select-selection-placeholder {
+      color: black !important;
+    }
+    .ant-table-cell {
+      padding: 8px !important;
+    }
   }
 }

+ 282 - 2
src/pages/C_goodsManage/C3focus/index.tsx

@@ -1,10 +1,290 @@
-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 { C1baseFormData, C1InputKeyArr1 } from '../C1ledger/data'
+import ExportJsonExcel from 'js-export-excel'
+import { C3_APIfocusNo, C3_APIgetList } from '@/store/action/C3focus'
+import { C1InputKeyType } from '../C1ledger/type'
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
+import { Button, Cascader, Input, Select } from 'antd'
+import { openGoodsInfoFu, resJiLianFu } from '@/utils/history'
+import { MessageFu } from '@/utils/message'
+import { RootState } from '@/store'
+import classNames from 'classnames'
+import dayjs from 'dayjs'
+import { C1tableC, statusCollectObj, statusStorageObj } from '@/utils/tableData'
+import MyTable from '@/components/MyTable'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+import MyPopconfirm from '@/components/MyPopconfirm'
+
 function C3focus() {
+  const dispatch = useDispatch()
+
+  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 getListFu = useCallback(() => {
+    formDataOldRef.current = { ...formDataRef.current }
+    dispatch(C3_APIgetList(formDataRef.current))
+  }, [dispatch])
+  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 focusNoFu = useCallback(
+    async (id: number) => {
+      const res = await C3_APIfocusNo(id)
+      if (res.code === 0) {
+        MessageFu.success('取消关注成功')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: FourTableType) => {
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+                查看
+              </Button>
+              <MyPopconfirm
+                txtK='取消关注'
+                onConfirm={() => focusNoFu(item.id)}
+                Dom={
+                  <Button size='small' type='text'>
+                    取消关注
+                  </Button>
+                }
+              />
+            </>
+          )
+        }
+      }
+    ]
+  }, [focusNoFu])
+
+  // 从仓库拿数据
+  const tableInfo = useSelector((state: RootState) => state.C3focus.tableInfo)
+
+  // 打开侧边栏
+  const [cathet, setCathet] = useState(0)
+
+  const startBtn = useMemo(() => {
+    return [
+      {
+        title: '藏品编号',
+        render: (item: FourTableType) => {
+          return (
+            <span
+              onClick={() => setCathet(item.id)}
+              className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
+            >
+              {item.num}
+            </span>
+          )
+        }
+      }
+    ]
+  }, [cathet])
+
+  // 顶部筛选
+  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 res = await C3_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,
+              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) || '(空)'
+            })),
+            sheetName: name,
+            sheetFilter: [
+              'num',
+              'thumbPc',
+              'numName',
+              'name',
+              'dictLevel',
+              'dictType',
+              'dictAge',
+              'dictTexture3',
+              'dictTorn',
+              'source',
+
+              'statusCollect',
+              'statusStorage'
+            ],
+            sheetHeader: [
+              '藏品编号',
+              '封面图地址',
+              '编号类型',
+              '藏品名称',
+              '文物级别',
+              '文物类别',
+              '年代',
+              '质地',
+              '完残程度',
+              '来源',
+              '入藏状态',
+              '库存状态'
+            ],
+            columnWidths: [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
+          }
+        ]
+      }
+
+      const toExcel = new ExportJsonExcel(option) //new
+      toExcel.saveExcel() //保存
+    }
+  }, [])
+
   return (
     <div className={styles.C3focus}>
       <div className='pageTitle'>藏品关注</div>
-      <p>待开发</p>
+      <div className='C3top'>
+        <div className='C3topll'>{searchDom(C1InputKeyArr1)}</div>
+        <div className='C3toprr'>
+          <Button type='primary' onClick={deriveFu}>
+            批量导出
+          </Button>
+          <div>
+            <Button type='primary' onClick={clickSearch}>
+              查询
+            </Button>
+            <Button onClick={resetSelectFu}>重置</Button>
+          </div>
+        </div>
+      </div>
+      {/* 表格 */}
+      <MyTable
+        yHeight={596}
+        list={tableInfo.list}
+        columnsTemp={C1tableC}
+        lastBtn={tableLastBtn}
+        startBtn={startBtn}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={tableInfo.total}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+      />
+
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
     </div>
   )
 }

+ 2 - 2
src/pages/D_storeManage/D2storSet/D2look/index.tsx

@@ -15,8 +15,8 @@ const topArr = [
   { name: '仓库名称', key: 'name' },
   { name: '仓库编码', key: 'num' },
   { name: '仓库负责人', key: 'managerUser' },
-  { name: '仓库说明', key: 'description' }
-  // { name: '仓库状态', key: 'enable' }
+  { name: '仓库说明', key: 'description' },
+  { name: '库保员', key: 'memberUser' }
 ]
 
 function D2look() {

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

@@ -171,6 +171,8 @@ function D4edit() {
   // 新增的底部按钮点击
   const btnClickFu = useCallback(
     async (val: '草稿' | '创建' | '保存' | '审批') => {
+      if (checkDataFu()) return
+
       if (val !== '草稿') {
         if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
           return MessageFu.warning('请添加藏品')
@@ -181,8 +183,6 @@ function D4edit() {
         }
       }
 
-      if (checkDataFu()) return
-
       if (val === '审批') {
         // console.log('审批信息富文本', rtf2)
         if (!auditSta) {

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

@@ -156,6 +156,8 @@ function D6edit() {
   // 新增的底部按钮点击
   const btnClickFu = useCallback(
     async (val: '草稿' | '创建' | '保存' | '审批') => {
+      if (checkDataFu()) return
+
       if (val !== '草稿') {
         if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
           return MessageFu.warning('请添加藏品')
@@ -166,8 +168,6 @@ function D6edit() {
         }
       }
 
-      if (checkDataFu()) return
-
       if (val === '审批') {
         // console.log('审批信息富文本', rtf2)
         if (!auditSta) {

+ 26 - 0
src/pages/E_goodsStorage/E1accident/index.module.scss

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

+ 130 - 0
src/pages/E_goodsStorage/E2damaged/E2edit/index.module.scss

@@ -0,0 +1,130 @@
+.E2edit {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 24px 0px;
+  :global {
+    .E2Tit {
+      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;
+      }
+    }
+    .E2Tit2 {
+      margin-top: 24px;
+      display: flex;
+      justify-content: space-between;
+      padding-bottom: 10px;
+      border-bottom: 1px solid #ccc;
+      margin-bottom: 20px;
+      .E2Tit2ll {
+        font-size: 18px;
+        font-weight: 700;
+        padding-left: 18px;
+        margin-bottom: 17px;
+        color: var(--themeColor);
+      }
+      .E2Tit2rr {
+        position: relative;
+        z-index: 2;
+        .ant-btn {
+          margin-left: 15px;
+        }
+      }
+    }
+
+    .E2main {
+      width: 100%;
+      height: calc(100% - 70px);
+      overflow-y: auto;
+      padding-bottom: 40px;
+
+      .E2rowAll {
+        display: flex;
+        justify-content: space-between;
+        align-items: self-start;
+        font-size: 16px;
+        flex-wrap: wrap;
+        .E2row {
+          width: 48%;
+          display: flex;
+          align-items: center;
+          margin-bottom: 20px;
+          .E2rowll {
+            width: 110px;
+            text-align: right;
+            font-weight: 700;
+            & > span {
+              color: #ff4e2f;
+            }
+          }
+          .E2rowrr {
+            width: calc(100% - 110px);
+            .ant-input-affix-wrapper {
+              width: 300px;
+            }
+            .ant-select {
+              width: 300px;
+            }
+          }
+        }
+        .E2row2 {
+          align-items: self-start;
+          .E2rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+        .E2row3 {
+          position: relative;
+          top: 4px;
+        }
+
+        .E2rowFull {
+          width: 100%;
+          margin-top: -20px;
+          align-items: self-start;
+          margin-bottom: 0;
+          .E2rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+      }
+      // 藏品清单
+      .E2googsBox {
+        padding-right: 20px;
+        .D1GtNum {
+          cursor: pointer;
+          text-decoration: underline;
+          // &:hover {
+          //   color: var(--themeColor);
+          // }
+        }
+
+        .D1GtNumAc {
+          color: var(--themeColor);
+        }
+      }
+    }
+
+    .E2btn {
+      position: absolute;
+      bottom: 20px;
+      left: 134px;
+      .ant-btn {
+        margin-right: 20px;
+      }
+    }
+
+    .ant-table-cell {
+      padding: 8px !important;
+    }
+  }
+}

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

@@ -0,0 +1,567 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { useParams } from 'react-router-dom'
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
+import {
+  E2_APIcreate,
+  E2_APIdel,
+  E2_APIgetInfo,
+  E2_APIrevocation,
+  E2_APIsaveApply,
+  E2_APIsaveAudit,
+  E2_APIsaveCreate,
+  E2_APIsaveDraft
+} from '@/store/action/E2damaged'
+import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
+import { MessageFu } from '@/utils/message'
+import history, { btnFlagFu2, kuIsTreeChangeFu, openGoodsInfoFu } from '@/utils/history'
+import { C1GoodType } from '@/pages/C_goodsManage/C1ledger/type'
+import classNames from 'classnames'
+import dayjs from 'dayjs'
+import { Button, Cascader, DatePicker, Input, Select } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { KuIsTreeType } from '@/pages/D_storeManage/D4impStor/type'
+import { D1_APIgetSiteList } from '@/store/action/D1storage'
+import B3GaddNow from '@/pages/B_enterTibet/B3goodsTable/B3GaddNow'
+import { EXbtnFu } from '@/utils/EXBtn'
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
+import { D4goodsTableC, statusObj } from '@/utils/tableData'
+import { B3aForm1 } from '@/pages/B_enterTibet/B3_4page/B3edit/data'
+import Z3upFiles from '@/components/Z3upFiles'
+import ZRichTexts from '@/components/ZRichTexts'
+import MyTable from '@/components/MyTable'
+import B3flowTable from '@/pages/B_enterTibet/B3flowTable'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+
+function E2edit() {
+  const { key, id } = useParams<any>()
+  // key:1 新增 2编辑 3审批 4查看
+
+  // 滚到顶部
+  const sollrDom = useRef<HTMLDivElement>(null)
+
+  // 顶部数据
+  const [topInfo, setTopInfo] = useState({} as FourTableType)
+
+  // 创建订单
+  const creatFu = useCallback(async () => {
+    const res = await E2_APIcreate()
+    if (res.code === 0) {
+      setTopInfo(res.data)
+    }
+  }, [])
+
+  // 入库的排架 层数 层格变成树
+  const [kuIsTree, setKuIsTreeFu] = useState<KuIsTreeType[]>([])
+
+  const kuIsTreeFu = useCallback(async (id: number) => {
+    const res = await D1_APIgetSiteList(id, false)
+    if (res.code === 0) {
+      const arrTemp: KuIsTreeType[] = kuIsTreeChangeFu(res.data)
+      setKuIsTreeFu(arrTemp)
+    }
+  }, [])
+
+  // 获取详情
+  const getInfoFu = useCallback(async () => {
+    const res = await E2_APIgetInfo(id)
+    if (res.code === 0) {
+      setTopInfo(res.data)
+
+      // 设置富文本
+      ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf || '{}'))
+
+      // 入库库房筛选存放位置数据
+      if (res.data.storageId) kuIsTreeFu(res.data.storageId)
+    }
+  }, [id, kuIsTreeFu])
+
+  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 pageTitTxt = useMemo(() => {
+    return Reflect.get(pageTitTxtObj, key)
+  }, [key])
+
+  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 !== '草稿') {
+        if (!topInfo.goods || (topInfo.goods && topInfo.goods.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 E2_APIsaveAudit({
+          orderId: topInfo.id,
+          rtfOpinion: rtf2,
+          status: auditSta === '同意' ? 1 : 2
+        })
+
+        if (res.code === 0) {
+          MessageFu.success('审批成功')
+          // 跳详情页
+          history.push(`/damaged_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 || ''),
+          goodsIds: (topInfo.goods || []).map(v => v.id).join(',')
+        }
+        // console.log(123, obj)
+
+        // if (1 + 1 === 2) return
+
+        if (val === '草稿') {
+          // 存草稿 当前页保存 不跳转
+          const res = await E2_APIsaveDraft(obj)
+          if (res.code === 0) {
+            MessageFu.success('草稿保存成功')
+          }
+        } else {
+          const res = val === '创建' ? await E2_APIsaveCreate(obj) : await E2_APIsaveApply(obj)
+          if (res.code === 0) {
+            MessageFu.success(`${val}成功`)
+            // 跳到详情页
+            history.push(`/damaged_edit/4/${topInfo.id}`)
+          }
+        }
+      }
+    },
+    [auditSta, topInfo]
+  )
+  // 打开侧边栏
+  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: '存放位置',
+        width: 200,
+        render: (item: C1GoodType) => {
+          return (
+            <Cascader
+              disabled
+              options={kuIsTree}
+              placeholder='空'
+              // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+              allowClear={false}
+              value={item.siteStr ? item.siteStr.split(',').map(v => Number(v)) : undefined}
+              onChange={() => {}}
+            />
+          )
+        }
+      },
+      {
+        title: '操作',
+        render: (item: C1GoodType) => {
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+                查看
+              </Button>
+              {['3', '4'].includes(key) ? null : (
+                <MyPopconfirm
+                  txtK='删除'
+                  onConfirm={() =>
+                    setTopInfo({
+                      ...topInfo,
+                      goods: topInfo.goods.filter(v => v.id !== item.id)
+                    })
+                  }
+                />
+              )}
+            </>
+          )
+        }
+      }
+    ]
+  }, [key, kuIsTree, topInfo])
+
+  // 新增和从已关注的藏品中添加
+  const [nowSta, setNowSta] = useState({ key: '', id: '' })
+
+  // 查看的按钮创建-提交-撤回
+  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 || ''),
+        goodsIds: (topInfo.goods || []).map(v => v.id).join(','),
+        goods: topInfo.goods.map(v => ({
+          goodsId: v.id,
+          siteStr: v.siteStr,
+          siteId: v.siteId
+        }))
+      }
+
+      const res =
+        val === '创建'
+          ? await E2_APIsaveCreate(obj)
+          : val === '提交'
+          ? await E2_APIsaveApply(obj)
+          : await E2_APIrevocation(id)
+
+      if (res.code === 0) {
+        if (sollrDom.current) sollrDom.current.scrollTop = 0
+        MessageFu.success(val + '成功')
+        getInfoFu()
+      }
+    },
+    [getInfoFu, id, topInfo]
+  )
+
+  // 查看模式点击删除
+  const delFu = useCallback(async () => {
+    const res = await E2_APIdel(id)
+    if (res.code === 0) {
+      MessageFu.success('删除成功')
+      history.push('/damaged')
+    }
+  }, [id])
+
+  // 查看模式点击审批 编辑
+  const lookJumpFu = useCallback(
+    (val: '审批' | '编辑') => {
+      history.push(`/damaged_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('/damaged')}>返回</Button>
+      </>
+    )
+  }, [delFu, lookBtnFu, lookJumpFu, topInfo])
+
+  return (
+    <div className={styles.E2edit}>
+      <div className='pageTitle'>残损登记-{pageTitTxt}</div>
+
+      <div className='E2main' ref={sollrDom}>
+        {['3'].includes(key) ? (
+          <X3auditInfo
+            dirCode='E2damaged'
+            myUrl='cms/orderPreserveDamaged/upload'
+            auditSta={auditSta}
+            auditStaFu={val => setAuDitSta(val)}
+            ref={ZAuditRef}
+          />
+        ) : null}
+
+        {/* 表单字段、附件等 */}
+        <div className='E2Tit'>
+          申请信息
+          {key === '1' ? null : (
+            <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
+          )}
+        </div>
+        <div className='E2rowAll'>
+          <div className='E2row'>
+            <div className='E2rowll'>
+              <span> * </span>申请名称:
+            </div>
+            <div className='E2rowrr'>
+              <Input
+                value={topInfo.name}
+                onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
+                readOnly={['3', '4'].includes(key)}
+                placeholder='请输入内容'
+                maxLength={30}
+                showCount
+              />
+            </div>
+          </div>
+
+          {B3aForm1.map(v => (
+            <div className='E2row' key={v.name}>
+              <div className='E2rowll'>{v.name}:</div>
+              <div className='E2rowrr'>
+                {topInfo[v.key as 'name']}
+                {['3', '4'].includes(key) && v.name === '发起人'
+                  ? ' - ' + topInfo.createTime || ''
+                  : ''}
+              </div>
+            </div>
+          ))}
+
+          <div className='E2row'>
+            <div className='E2rowll'>
+              <span> * </span>业务日期:
+            </div>
+            <div className='E2rowrr'>
+              <DatePicker
+                disabled={['3', '4'].includes(key)}
+                allowClear={false}
+                value={dayjs(topInfo.date)}
+                onChange={timeChange}
+              />
+            </div>
+          </div>
+
+          <div className='E2row'>
+            <div className='E2rowll'>相关盘点:</div>
+            {/* 待完善 */}
+            <div className='E2rowrr'>
+              <Select
+                disabled={['3', '4'].includes(key)}
+                placeholder={['3', '4'].includes(key) ? '(空)' : '请搜索编码'}
+                showSearch
+                options={[]}
+                fieldNames={{ label: 'num', value: 'num' }}
+                allowClear={true}
+                // value={topInfo.relatedOrderNum || null}
+                // onChange={e => setTopInfo({ ...topInfo, relatedOrderNum: e ? e : '' })}
+              />
+            </div>
+          </div>
+          <div className='E2row'>
+            <div className='E2rowll'>原因事由:</div>
+            <div className='E2rowrr'>
+              <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='E2row E2row2'>
+            <div className='E2rowll'>附件:</div>
+            <div className='E2rowrr'>
+              <Z3upFiles
+                max={10}
+                isLook={['3', '4'].includes(key)}
+                ref={filesRef}
+                fileCheck={false}
+                dirCode='E2damaged'
+                myUrl='cms/orderPreserveDamaged/upload'
+                lookData={topInfo.files || []}
+                size={500}
+              />
+            </div>
+          </div>
+
+          <div className='E2row E2rowFull'>
+            <div className='E2rowll'>备注:</div>
+            <div className='E2rowrr'>
+              <ZRichTexts
+                check={false}
+                dirCode='E2damaged'
+                myUrl='cms/orderPreserveDamaged/upload'
+                isLook={['3', '4'].includes(key)}
+                ref={ZRichTextRef}
+                isOne={true}
+                upAudioBtnNone={true}
+              />
+            </div>
+          </div>
+        </div>
+
+        {/* 藏品清单 */}
+        <div className='E2googsBox'>
+          <div className='E2Tit2'>
+            <div className='E2Tit2ll'>藏品清单</div>
+            <div className='E2Tit2rr'>
+              {['3', '4'].includes(key) ? null : (
+                <Button
+                  type='primary'
+                  onClick={() =>
+                    setNowSta({
+                      key: 'E2',
+                      id: 'cms/orderPreserveDamaged/goods/getList'
+                    })
+                  }
+                >
+                  新增
+                </Button>
+              )}
+            </div>
+          </div>
+
+          {/* 表格 */}
+          <MyTable
+            list={topInfo.goods || []}
+            columnsTemp={D4goodsTableC}
+            startBtn={startBtn}
+            lastBtn={tableLastBtn}
+            pagingInfo={false}
+          />
+        </div>
+
+        {/* 申请流程 */}
+        {['3', '4'].includes(key) ? <B3flowTable tableArr={topInfo.audits || []} /> : null}
+      </div>
+
+      {/* 底部按钮 */}
+      <div className='E2btn'>
+        {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('/damaged')} />
+          </>
+        )}
+      </div>
+
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+
+      {nowSta.id ? (
+        <B3GaddNow
+          nowSta={nowSta}
+          closeFu={() => setNowSta({ key: '', id: '' })}
+          dataResFu={data => setTopInfo({ ...topInfo, goods: data })}
+          oldCheckArr={topInfo.goods || []}
+          // 待完善
+          // canObj={{ storageId: topInfo.storageId }}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoE2edit = React.memo(E2edit)
+
+export default MemoE2edit

+ 31 - 0
src/pages/E_goodsStorage/E2damaged/index.module.scss

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

+ 319 - 2
src/pages/E_goodsStorage/E2damaged/index.tsx

@@ -1,10 +1,327 @@
-import React from 'react'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
+import { E2InputKeyType, TypeE2Form } from './type'
+import { useDispatch, useSelector } from 'react-redux'
+import { E2_APIdel, E2_APIgetList } from '@/store/action/E2damaged'
+import { MessageFu } from '@/utils/message'
+import history, { btnFlagFu } from '@/utils/history'
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
+import { Button, DatePicker, Input, Select } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { RootState } from '@/store'
+import dayjs from 'dayjs'
+import { E2tableC, statusObj } from '@/utils/tableData'
+import ExportJsonExcel from 'js-export-excel'
+import { B3_4inputKeyArr } from '@/pages/B_enterTibet/B3_4page'
+import { selectObj } from '@/utils/select'
+import MyTable from '@/components/MyTable'
+const { RangePicker } = DatePicker
+
+const E2baseFormData: TypeE2Form = {
+  pageSize: 10,
+  pageNum: 1,
+  num: '',
+  name: '',
+  deptName: '',
+  userName: '',
+  startTime: '',
+  endTime: '',
+  status: null,
+  userType: null,
+  storageName: '',
+  checkNum: ''
+}
+
 function E2damaged() {
+  const dispatch = useDispatch()
+
+  const [formData, setFormData] = useState(E2baseFormData)
+  const formDataRef = useRef(E2baseFormData)
+  const formDataOldRef = useRef(E2baseFormData)
+
+  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(E2_APIgetList(formDataRef.current))
+  }, [dispatch])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu, timeKey])
+
+  // 输入框的改变
+  const txtChangeFu = useCallback(
+    (txt: string, key: E2InputKeyType) => {
+      setFormData({
+        ...formData,
+        [key]: txt
+      })
+    },
+    [formData]
+  )
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setFormData(E2baseFormData)
+    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 E2_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
+  // 点击操作按钮
+  const tableBtnFu = useCallback((id: number, key: string) => {
+    history.push(`/damaged_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.E2damaged.tableInfo)
+
+  // 点击导出
+  const deriveFu = useCallback(async () => {
+    const name = '残损登记' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
+
+    const res = await E2_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',
+              'storageName',
+              'deptName',
+              'creatorName',
+              'createTime',
+              'status',
+              // 待完善
+              'xxxxx'
+            ],
+            sheetHeader: [
+              '业务单号',
+              '申请名称',
+              '关联库房',
+              '发起部门',
+              '发送人',
+              '发起日期',
+              '申请状态',
+              '相关盘点'
+            ],
+            columnWidths: [10, 10, 10, 10, 10, 10, 10]
+          }
+        ]
+      }
+
+      const toExcel = new ExportJsonExcel(option) //new
+      toExcel.saveExcel() //保存
+    }
+  }, [])
+
   return (
     <div className={styles.E2damaged}>
       <div className='pageTitle'>残损登记</div>
-      <p>待开发</p>
+      <div className='D4top D4top0'>
+        <div className='D4topll'>
+          {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}
+              value={formData.storageName}
+              onChange={e => txtChangeFu(e.target.value, 'storageName')}
+            />
+          </div>
+        </div>
+        <div className='D4toprr'>
+          <Button type='primary' onClick={deriveFu}>
+            批量导出
+          </Button>
+          &emsp;
+          <Button type='primary' onClick={() => history.push('/damaged_edit/1/null')}>
+            新增
+          </Button>
+        </div>
+      </div>
+      <div className='D4top'>
+        <div className='D4topll'>
+          <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: 150 }}
+              value={formData.status}
+              onChange={e => setFormData({ ...formData, status: e })}
+              options={selectObj['申请状态'].filter(v => v.label !== '待盘点')}
+            />
+          </div>
+
+          <div>
+            <span>选择角色:</span>
+            <Select
+              allowClear={true}
+              style={{ width: 150 }}
+              placeholder='全部'
+              options={selectObj['角色']}
+              // fieldNames={{ value: 'id', label: 'roleName' }}
+              value={formData.userType}
+              onChange={e => setFormData({ ...formData, userType: e })}
+            />
+          </div>
+
+          <div>
+            <span>盘点编码:</span>
+            <Input
+              placeholder={`请输入盘点编码`}
+              maxLength={30}
+              value={formData.checkNum}
+              onChange={e => txtChangeFu(e.target.value, 'checkNum')}
+            />
+          </div>
+        </div>
+        <div className='D4toprr'>
+          <Button type='primary' onClick={clickSearch}>
+            查询
+          </Button>
+          &emsp;<Button onClick={resetSelectFu}>重置</Button>
+        </div>
+      </div>
+
+      {/* 表格 */}
+      <MyTable
+        yHeight={610}
+        list={tableInfo.list}
+        columnsTemp={E2tableC}
+        lastBtn={tableLastBtn}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={tableInfo.total}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+      />
     </div>
   )
 }

+ 6 - 0
src/pages/E_goodsStorage/E2damaged/type.d.ts

@@ -0,0 +1,6 @@
+export type TypeE2Form = Omit<OriginalTypeD4Form, 'storageInId'> & {
+  storageName: string
+  checkNum: string
+}
+
+export type E2InputKeyType = D3InputKeyType & ('storageName' | 'checkNum')

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

@@ -373,5 +373,13 @@ export const routerSon: RouterTypeRow[] = [
     name: '藏品征集-新增/编辑/审批/查看',
     path: '/collect_edit/:key/:id',
     Com: React.lazy(() => import('../B_enterTibet/B1collect/B1edit'))
+  },
+
+  // ------------残损登记------------------
+  {
+    id: 11,
+    name: '残损登记-新增/编辑/审批/查看',
+    path: '/damaged_edit/:key/:id',
+    Com: React.lazy(() => import('../E_goodsStorage/E2damaged/E2edit'))
   }
 ]

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

@@ -14,6 +14,8 @@ import { C1GoodType } from '@/pages/C_goodsManage/C1ledger/type'
 import { API_goodsInfo } from '@/store/action/C1ledger'
 import { EXPORT_WORD_ENUM, exportWordHandler } from '@/utils/exportWordTemplates'
 import { API_goodFileList } from '@/store/action/C2files'
+import { C3_APIfocus, C3_APIfocusNo } from '@/store/action/C3focus'
+import { MessageFu } from '@/utils/message'
 
 function Y2look() {
   const { id: sId } = useParams<any>()
@@ -111,6 +113,19 @@ function Y2look() {
     return arr
   }, [])
 
+  // 点击关注
+  const focusFu = useCallback(
+    async (val: '关注' | '取消关注') => {
+      const res = val === '关注' ? await C3_APIfocus(sId) : await C3_APIfocusNo(sId)
+
+      if (res.code === 0) {
+        MessageFu.success(val + '成功!')
+        getInfoFu(sId)
+      }
+    },
+    [getInfoFu, sId]
+  )
+
   return (
     <div className={styles.Y2look}>
       <div className='pageTitle'>藏品详情</div>
@@ -127,7 +142,14 @@ function Y2look() {
           ))}
         </div>
         <div className='Y2toprr'>
-          <Button type='primary'>关注</Button>&emsp;
+          <Button
+            type='primary'
+            danger={info.isFocus === 1}
+            onClick={() => focusFu(info.isFocus === 1 ? '取消关注' : '关注')}
+          >
+            {info.isFocus === 1 ? '取消' : ''}关注
+          </Button>
+          &emsp;
           <Button type='primary' onClick={handleExport}>
             藏品卡片
           </Button>

+ 3 - 0
src/store/action/C1ledger.ts

@@ -17,6 +17,9 @@ export const API_goodsInfo = (id: number) => {
   return http.get(`cms/goods/detail/${id}`)
 }
 
+/**
+ * 藏品-弹窗-选择藏品
+ */
 export const API_goodsNowAdd = (url: string, data: any) => {
   return http.post(url, data)
 }

+ 36 - 0
src/store/action/C3focus.ts

@@ -0,0 +1,36 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+
+/**
+ * 藏品关注-关注
+ */
+export const C3_APIfocus = (id: number) => {
+  return http.get(`cms/goods/focus/${id}`)
+}
+
+/**
+ * 藏品关注-取消关注
+ */
+export const C3_APIfocusNo = (id: number) => {
+  return http.get(`cms/goodsFocus/focusDel/${id}`)
+}
+
+/**
+ * 藏品关注-获取分页列表
+ */
+export const C3_APIgetList = (data: any, exportFlag?: boolean): any => {
+  if (exportFlag) return http.post('cms/goodsFocus/page', data)
+  else {
+    return async (dispatch: AppDispatch) => {
+      const res = await http.post('cms/goodsFocus/page', data)
+      if (res.code === 0) {
+        const obj = {
+          list: res.data.records,
+          total: res.data.total
+        }
+
+        dispatch({ type: 'C3/getList', payload: obj })
+      }
+    }
+  }
+}

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

@@ -4,7 +4,7 @@ import http from '@/utils/http'
  * 分库管理-获取树列表
  */
 export const D1_APIgetTree = () => {
-  return http.get('cms/site/getTree')
+  return http.get('cms/storage/perm/getTree')
 }
 
 /**

+ 77 - 0
src/store/action/E2damaged.ts

@@ -0,0 +1,77 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+/**
+ * 残损登记 - 获取分页列表
+ */
+export const E2_APIgetList = (data: any, exportFlag?: boolean): any => {
+  if (exportFlag) return http.post('cms/orderPreserveDamaged/page', data)
+  else {
+    return async (dispatch: AppDispatch) => {
+      const res = await http.post('cms/orderPreserveDamaged/page', data)
+      if (res.code === 0) {
+        const obj = {
+          list: res.data.records,
+          total: res.data.total
+        }
+
+        dispatch({ type: 'E2/getList', payload: obj })
+      }
+    }
+  }
+}
+
+/**
+ * 残损登记-删除
+ */
+export const E2_APIdel = (id: number) => {
+  return http.get(`cms/orderPreserveDamaged/remove/${id}`)
+}
+
+/**
+ * 残损登记-创建订单
+ */
+export const E2_APIcreate = () => {
+  return http.get('cms/orderPreserveDamaged/create')
+}
+
+/**
+ * 残损登记-获取详情
+ */
+export const E2_APIgetInfo = (id: number) => {
+  return http.get(`cms/orderPreserveDamaged/detail/${id}`)
+}
+
+/**
+ * 残损登记-存草稿
+ */
+export const E2_APIsaveDraft = (data: any) => {
+  return http.post('cms/orderPreserveDamaged/saveDraft', data)
+}
+
+/**
+ * 残损登记-创建
+ */
+export const E2_APIsaveCreate = (data: any) => {
+  return http.post('cms/orderPreserveDamaged/saveCreate', data)
+}
+
+/**
+ * 残损登记-编辑保存
+ */
+export const E2_APIsaveApply = (data: any) => {
+  return http.post('cms/orderPreserveDamaged/saveApply', data)
+}
+
+/**
+ * 残损登记-审批
+ */
+export const E2_APIsaveAudit = (data: any) => {
+  return http.post('cms/orderPreserveDamaged/audit', data)
+}
+
+/**
+ * 残损登记-撤回订单
+ */
+export const E2_APIrevocation = (id: number) => {
+  return http.get(`cms/orderPreserveDamaged/revocation/${id}`)
+}

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

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

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

@@ -7,11 +7,13 @@ import B1collect from './B1collect'
 import FourAll from './FourAll'
 import C1ledger from './C1ledger'
 import C2files from './C2files'
+import C3focus from './C3focus'
 import C6edit from './C6edit'
 import C8recycleBin from './C8recycleBin'
 import D2storSet from './D2storSet'
 import D4impStor from './D4impStor'
 import D6putsStor from './D6putsStor'
+import E2damaged from './E2damaged'
 import Z1dict from './Z1dict'
 import Z2numRule from './Z2numRule'
 import Z3flowSet from './Z3flowSet'
@@ -27,11 +29,13 @@ const rootReducer = combineReducers({
   FourAll,
   C1ledger,
   C2files,
+  C3focus,
   C6edit,
   C8recycleBin,
   D2storSet,
   D4impStor,
   D6putsStor,
+  E2damaged,
   Z1dict,
   Z2numRule,
   Z3flowSet,

+ 11 - 0
src/utils/tableData.ts

@@ -170,6 +170,17 @@ export const D4goodsTableC = [
   ['txtChange', '库存状态', 'statusStorage', statusStorageObj]
 ]
 
+export const E2tableC = [
+  ['txt', '业务单号', 'num'],
+  ['txt', '申请名称', 'name'],
+  ['txt', '关联库房', 'storageName'], //待完善
+  ['txt', '发起部门', 'deptName'],
+  ['txt', '发送人', 'creatorName'],
+  ['txt', '发起日期', 'createTime'],
+  ['txtChange', '申请状态', 'status', statusObj],
+  ['txt', '相关盘点', '待完善']
+]
+
 export const Y33tableC = [
   ['text', '附件名称', 'fileName', 50],
   ['txt', '附件大小', 'fileSize'],