Преглед изворни кода

藏品详情完善按钮功能

shaogen1995 пре 3 месеци
родитељ
комит
fb6b2992c0
37 измењених фајлова са 824 додато и 3795 уклоњено
  1. 1 1
      src/pages/A3_ledger/A32Routing/A32table/index.tsx
  2. 6 0
      src/pages/A3_ledger/C1ledger/type.d.ts
  3. 5 0
      src/pages/B_enterTibet/B1collect/type.d.ts
  4. 0 6
      src/pages/D_storeManage/D1storage/D1goods/index.tsx
  5. 1 0
      src/pages/D_storeManage/D1storage/index.module.scss
  6. 31 0
      src/pages/D_storeManage/D4impStor/D4edit/D4auto/index.module.scss
  7. 61 0
      src/pages/D_storeManage/D4impStor/D4edit/D4auto/index.tsx
  8. 26 0
      src/pages/D_storeManage/D4impStor/D4edit/D4check/index.module.scss
  9. 96 0
      src/pages/D_storeManage/D4impStor/D4edit/D4check/index.tsx
  10. 5 16
      src/pages/D_storeManage/D4impStor/D4edit/index.module.scss
  11. 311 372
      src/pages/D_storeManage/D4impStor/D4edit/index.tsx
  12. 32 0
      src/pages/D_storeManage/D4impStor/data.ts
  13. 2 2
      src/pages/D_storeManage/D4impStor/index.module.scss
  14. 91 77
      src/pages/D_storeManage/D4impStor/index.tsx
  15. 1 14
      src/pages/D_storeManage/D4impStor/type.d.ts
  16. 0 126
      src/pages/D_storeManage/D6putsStor/D6edit/index.module.scss
  17. 2 651
      src/pages/D_storeManage/D6putsStor/D6edit/index.tsx
  18. 0 21
      src/pages/D_storeManage/D6putsStor/D6impRelation/index.module.scss
  19. 0 44
      src/pages/D_storeManage/D6putsStor/D6impRelation/index.tsx
  20. 0 26
      src/pages/D_storeManage/D6putsStor/index.module.scss
  21. 2 312
      src/pages/D_storeManage/D6putsStor/index.tsx
  22. 11 0
      src/pages/D_storeManage/D8cancel/D8edit/index.tsx
  23. 17 2
      src/pages/E_goodsStorage/E1accident/E1edit/index.tsx
  24. 0 130
      src/pages/E_goodsStorage/E2damaged/E2edit/index.module.scss
  25. 0 569
      src/pages/E_goodsStorage/E2damaged/E2edit/index.tsx
  26. 0 35
      src/pages/E_goodsStorage/E2damaged/index.module.scss
  27. 0 331
      src/pages/E_goodsStorage/E2damaged/index.tsx
  28. 0 6
      src/pages/E_goodsStorage/E2damaged/type.d.ts
  29. 0 126
      src/pages/E_goodsStorage/E3actuality/E3edit/index.module.scss
  30. 2 559
      src/pages/E_goodsStorage/E3actuality/E3edit/index.tsx
  31. 0 31
      src/pages/E_goodsStorage/E3actuality/index.module.scss
  32. 2 307
      src/pages/E_goodsStorage/E3actuality/index.tsx
  33. 10 0
      src/pages/E_goodsStorage/E4repair/E4edit/index.tsx
  34. 91 25
      src/pages/Y_goodsDetails/Y2look/index.tsx
  35. 1 1
      src/store/action/C1ledger.ts
  36. 3 2
      src/utils/select.ts
  37. 14 3
      src/utils/tableData.ts

+ 1 - 1
src/pages/A3_ledger/A32Routing/A32table/index.tsx

@@ -90,7 +90,7 @@ function A32table({ pageNum, pageSize, pageChangeFu, advanced }: Props) {
         render: (item: FourTableType) => resJiLianFu(item.source)
       },
       {
-        title: '入藏状态',
+        title: '',
         render: (item: FourTableType) =>
           Reflect.get(statusCollectObj, item.statusCollect) || '(空)'
       },

+ 6 - 0
src/pages/A3_ledger/C1ledger/type.d.ts

@@ -130,4 +130,10 @@ export type C1GoodType = {
   // 新加的字段 馆内藏品分类
   dictHouse1: string
   dictHouse2: string
+
+  // 藏品入库
+  txt4: number | null
+
+  // 详情按钮的盘点
+  statusCollect: number
 }

+ 5 - 0
src/pages/B_enterTibet/B1collect/type.d.ts

@@ -93,4 +93,9 @@ export type FourTableType = {
   confirmUnit: string
   // 事故登记的藏品编号
   goodsNum: string
+
+  // 入库
+  // 发掘报告编号
+  sonNum2: string
+  sonSource: string
 }

+ 0 - 6
src/pages/D_storeManage/D1storage/D1goods/index.tsx

@@ -115,12 +115,6 @@ function D1goods({ lookData, TreeDom, tableId }: Props) {
   const startBtn = useMemo(() => {
     return [
       {
-        title: '库位号',
-        render: (item: any) => {
-          return '待完善'
-        }
-      },
-      {
         title: '藏品编号',
         render: (item: any) => {
           return (

+ 1 - 0
src/pages/D_storeManage/D1storage/index.module.scss

@@ -13,6 +13,7 @@
         position: relative;
         top: 2px;
         font-size: 18px;
+        font-weight: 700;
       }
       .ant-btn {
         margin-left: 15px;

+ 31 - 0
src/pages/D_storeManage/D4impStor/D4edit/D4auto/index.module.scss

@@ -0,0 +1,31 @@
+.D4auto {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+    .D4Amain {
+      border-top: 1px solid #999999;
+      padding-top: 15px;
+      width: 100%;
+
+      .D4Amain1 {
+        display: flex;
+        align-items: center;
+        margin-bottom: 15px;
+        & > span {
+          color: #ff4d4f;
+        }
+      }
+
+      .D4Amain2 {
+        font-size: 12px;
+        color: #999;
+      }
+
+      .D4AmainBtn {
+        margin-top: 20px;
+        text-align: center;
+      }
+    }
+  }
+}

+ 61 - 0
src/pages/D_storeManage/D4impStor/D4edit/D4auto/index.tsx

@@ -0,0 +1,61 @@
+import React, { useCallback, useState } from 'react'
+import styles from './index.module.scss'
+import { Button, InputNumber, Modal } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { MessageFu } from '@/utils/message'
+
+type Props = {
+  closeFu: () => void
+  succFu: (num: number) => void
+}
+
+function D4auto({ closeFu, succFu }: Props) {
+  const [value, setValue] = useState<number | null>(null)
+
+  // 点击提交
+  const btnOk = useCallback(() => {
+    if (!value) return MessageFu.warning('请输入正整数分库号最小值')
+    succFu(value)
+    closeFu()
+  }, [closeFu, succFu, value])
+
+  return (
+    <Modal
+      wrapClassName={styles.D4auto}
+      destroyOnClose
+      open={true}
+      title='批量填写分库号'
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='D4Amain'>
+        <div className='D4Amain1'>
+          <span> * </span>分库号最小值:
+          <InputNumber
+            style={{ width: 200 }}
+            min={1}
+            max={99999999}
+            precision={0}
+            value={value}
+            onChange={e => setValue(e)}
+          />
+        </div>
+
+        <div className='D4Amain2'>提交后,将为藏品自动从小到大分配分库号,并跳过被占用的分库号</div>
+
+        <div className='D4AmainBtn'>
+          <Button type='primary' disabled={!value} onClick={btnOk}>
+            提交
+          </Button>
+          &emsp;
+          <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+        </div>
+      </div>
+    </Modal>
+  )
+}
+
+const MemoD4auto = React.memo(D4auto)
+
+export default MemoD4auto

+ 26 - 0
src/pages/D_storeManage/D4impStor/D4edit/D4check/index.module.scss

@@ -0,0 +1,26 @@
+.D4check {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 1000px !important;
+    }
+    .D4Cmain {
+      border-top: 1px solid #999999;
+      padding-top: 15px;
+      width: 100%;
+      max-height: 500px;
+      overflow-y: auto;
+      .ant-table-cell {
+        padding: 8px !important;
+        text-align: center !important;
+      }
+    }
+    .D4Cbtn {
+      margin-top: 20px;
+      text-align: center;
+    }
+  }
+}

+ 96 - 0
src/pages/D_storeManage/D4impStor/D4edit/D4check/index.tsx

@@ -0,0 +1,96 @@
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
+import styles from './index.module.scss'
+import { Button, InputNumber, Modal } from 'antd'
+import MyTable from '@/components/MyTable'
+import MyPopconfirm from '@/components/MyPopconfirm'
+
+type Props = {
+  closeFu: () => void
+  listTemp: any[]
+}
+
+function D4check({ closeFu, listTemp }: Props) {
+  // 待完善类型
+  const [list, setList] = useState<any[]>([])
+
+  useEffect(() => {
+    setList(listTemp || [])
+  }, [listTemp])
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: (
+          <div>
+            <span style={{ color: '#ff4d4f' }}> * </span>藏品分库号
+          </div>
+        ),
+        render: (item: any) => (
+          <InputNumber
+            style={{ width: 200 }}
+            min={1}
+            max={99999999}
+            precision={0}
+            value={item.shuzi}
+            onChange={e =>
+              setList(
+                list.map(v => ({
+                  ...v,
+                  shuzi: v.id === item.id ? e : v.shuzi
+                }))
+              )
+            }
+            placeholder='请输入'
+          />
+        )
+      },
+      {
+        title: '名称',
+        render: (item: any) => item.name || '(空)'
+      }
+    ]
+  }, [list])
+
+  // 点击确定
+  const btnOk = useCallback(() => {
+    closeFu()
+  }, [closeFu])
+
+  return (
+    <Modal
+      wrapClassName={styles.D4check}
+      destroyOnClose
+      open={true}
+      title='以下分库号已存在,为保障分库号的唯一性,需重新填写:'
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='D4Cmain'>
+        {/* 表格 */}
+        <MyTable
+          classKey='D4check'
+          list={list}
+          columnsTemp={[
+            ['txt', '藏品编号', 'num'],
+            ['txt', '编号类型', 'numName']
+          ]}
+          lastBtn={tableLastBtn}
+          pagingInfo={false}
+        />
+      </div>
+
+      <div className='D4Cbtn'>
+        <Button type='primary' disabled={list.some(v => !v.shuzi)} onClick={btnOk}>
+          提交
+        </Button>
+        &emsp;
+        <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+      </div>
+    </Modal>
+  )
+}
+
+const MemoD4check = React.memo(D4check)
+
+export default MemoD4check

+ 5 - 16
src/pages/D_storeManage/D4impStor/D4edit/index.module.scss

@@ -16,11 +16,11 @@
         pointer-events: none;
       }
     }
+
     .D4Tit2 {
       margin-top: 24px;
       display: flex;
       justify-content: space-between;
-      padding-bottom: 10px;
       border-bottom: 1px solid #ccc;
       margin-bottom: 20px;
       .D4Tit2ll {
@@ -56,8 +56,9 @@
           display: flex;
           align-items: center;
           margin-bottom: 20px;
+          min-height: 32px;
           .D4rowll {
-            width: 110px;
+            width: 124px;
             text-align: right;
             font-weight: 700;
             & > span {
@@ -65,7 +66,7 @@
             }
           }
           .D4rowrr {
-            width: calc(100% - 110px);
+            width: calc(100% - 124px);
             .ant-input-affix-wrapper {
               width: 300px;
             }
@@ -88,7 +89,6 @@
 
         .D4rowFull {
           width: 100%;
-          margin-top: -20px;
           align-items: self-start;
           margin-bottom: 0;
           .D4rowll {
@@ -97,20 +97,10 @@
           }
         }
       }
+
       // 藏品清单
       .D4googsBox {
         padding-right: 20px;
-        .D1GtNum {
-          cursor: pointer;
-          text-decoration: underline;
-          // &:hover {
-          //   color: var(--themeColor);
-          // }
-        }
-
-        .D1GtNumAc {
-          color: var(--themeColor);
-        }
       }
     }
 
@@ -122,7 +112,6 @@
         margin-right: 20px;
       }
     }
-
     .ant-table-cell {
       padding: 8px !important;
     }

+ 311 - 372
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -1,27 +1,8 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { useParams } from 'react-router-dom'
-import { Button, Cascader, DatePicker, Input, Select } from 'antd'
-import dayjs from 'dayjs'
-import Z3upFiles from '@/components/Z3upFiles'
-import ZRichTexts from '@/components/ZRichTexts'
-import MyPopconfirm from '@/components/MyPopconfirm'
-import history, {
-  btnFlagFu2,
-  cascaderObjFu,
-  kuIsTreeChangeFu,
-  openGoodsInfoFu,
-  ruTransformDataFu
-} from '@/utils/history'
-import { MessageFu } from '@/utils/message'
-import MyTable from '@/components/MyTable'
-import classNames from 'classnames'
-import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
-import { D4goodsTableC, statusObj } from '@/utils/tableData'
-import ZGaddNow from '@/components/ZGaddNow'
-import X1setStoreLocS from '@/pages/X_stock/X1setStoreLocS'
-import X3auditInfo from '@/pages/X_stock/X3auditInfo'
-import ZflowTable from '@/components/ZflowTable'
+import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
+import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
 import {
   D4_APIcreate,
   D4_APIdel,
@@ -32,17 +13,28 @@ import {
   D4_APIsaveCreate,
   D4_APIsaveDraft
 } from '@/store/action/D4impStor'
+import dayjs from 'dayjs'
+import { MessageFu } from '@/utils/message'
+import history, { btnFlagFu2, cascaderObjFu, openGoodsInfoFu } from '@/utils/history'
+import classNames from 'classnames'
+import { Button, Cascader, DatePicker, Input, InputNumber, Select } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { EXbtnFu } from '@/utils/EXBtn'
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
+import { D4tableCgoods, statusObj } from '@/utils/tableData'
 import { useDispatch, useSelector } from 'react-redux'
-import { RootState } from '@/store'
 import { D2_APIgetList } from '@/store/action/D2storSet'
-import { D1_APIgetSiteList } from '@/store/action/D1storage'
-import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
-import { TypeD2list } from '../../D2storSet/type'
-import { KuIsTreeType } from '../type'
-import { EXbtnFu } from '@/utils/EXBtn'
-import { D6_APIgetList } from '@/store/action/D6putsStor'
-import { B3aForm1 } from '@/pages/B_enterTibet/B1collect/data'
-import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
+import { RootState } from '@/store'
+import { FourAPI_getList } from '@/store/action/FourAll'
+import MyTable from '@/components/MyTable'
+import ZflowTable from '@/components/ZflowTable'
+import ZupFileTable from '@/components/ZupFileTable'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+import ZGaddNow from '@/components/ZGaddNow'
+import TextArea from 'antd/es/input/TextArea'
+import D4auto from './D4auto'
+import D4check from './D4check'
+import { API_goodsInfo } from '@/store/action/C1ledger'
 
 export const pageTitTxtObj = {
   1: '新增',
@@ -52,57 +44,44 @@ export const pageTitTxtObj = {
 }
 
 function D4edit() {
-  const { key, id } = useParams<any>()
-  // key:1 新增 2编辑 3审批 4查看
-
-  // 滚到顶部
-  const sollrDom = useRef<HTMLDivElement>(null)
-
-  // 获取出库列表,下拉 - 相关出库单用
+  // 获取库房设置列表/入馆凭证号-用于分库缩写下拉
   const dispatch = useDispatch()
 
   useEffect(() => {
-    dispatch(D6_APIgetList({ pageNum: 1, pageSize: 99999 }))
+    dispatch(D2_APIgetList({ pageNum: 1, pageSize: 99999 }))
+    dispatch(FourAPI_getList({ pageNum: 1, pageSize: 99999 }, '1'))
   }, [dispatch])
 
-  const putsList = useSelector((state: RootState) => state.D6putsStor.tableInfo.list)
+  const { list: storageIdArr } = useSelector((state: RootState) => state.D2storSet.tableInfo)
+  const { list: relatedOrderNumArr } = useSelector((state: RootState) => state.FourAll.listObj['1'])
 
+  const { key, id } = useParams<any>()
+  // key:1 新增 2编辑 3审批 4查看
+  // 滚到顶部
+  const sollrDom = useRef<HTMLDivElement>(null)
   // 顶部数据
   const [topInfo, setTopInfo] = useState({} as FourTableType)
 
-  // 入库库房数组信息
-  useEffect(() => {
-    dispatch(D2_APIgetList({ pageNum: 1, pageSize: 99999 }))
-  }, [dispatch])
+  // 藏品清单快照数据
+  const [snaps, setSnaps] = useState<C1GoodType[]>([])
+  const delSnapIdsRef = useRef<number[]>([])
 
-  const { list: storSetList } = useSelector((state: RootState) => state.D2storSet.tableInfo)
-
-  // 库房负责人txt
-  const managerUser = useMemo(() => {
-    let txt = ''
-    if (topInfo.storageId && storSetList.length) {
-      let obj = storSetList.find(v => v.id === topInfo.storageId)
-      if (obj) txt = obj.managerUser
-    }
-    return txt
-  }, [storSetList, topInfo.storageId])
+  const snapsID2ref = useRef<{ goodsId: number; id: number }[]>([])
 
   // 创建订单
   const creatFu = useCallback(async () => {
     const res = await D4_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 urlAll = window.location.href
+      if (urlAll.includes('?id=')) {
+        const urlId = urlAll.split('?id=')[1]
+        const res2 = await API_goodsInfo(Number(urlId))
+        if (res2.code === 0) {
+          setSnaps([res2.data])
+        }
+      }
     }
   }, [])
 
@@ -110,15 +89,25 @@ function D4edit() {
   const getInfoFu = useCallback(async () => {
     const res = await D4_APIgetInfo(id)
     if (res.code === 0) {
-      setTopInfo(res.data)
+      const data = res.data
+
+      setTopInfo(data)
 
-      // 设置富文本
-      ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf || '{}'))
+      // 藏品清单快照信息id对比
+      const arrTemp: any = []
+      const snapsTemp = data.snaps || []
 
-      // 入库库房筛选存放位置数据
-      if (res.data.storageId) kuIsTreeFu(res.data.storageId)
+      snapsTemp.forEach((v: any) => {
+        snapsID2ref.current.push({ goodsId: v.goodsId, id: v.id })
+
+        const obj = JSON.parse(v.snap || '{}')
+        if (obj.id) obj.id2 = v.id
+
+        arrTemp.push(obj)
+      })
+      setSnaps(arrTemp)
     }
-  }, [id, kuIsTreeFu])
+  }, [id])
 
   useEffect(() => {
     if (key === '1') creatFu()
@@ -127,60 +116,50 @@ function D4edit() {
     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') })
+    (e: any, key: 'date') => {
+      setTopInfo({ ...topInfo, [key]: dayjs(e).format('YYYY-MM-DD') })
     },
     [topInfo]
   )
 
-  const checkDataFu = useCallback(() => {
-    if (!topInfo.name) {
-      MessageFu.warning('申请名称不能为空')
+  // 审批意见的ref
+  const ZAuditRef = useRef<any>(null)
+
+  // 审批的sta
+  const [auditSta, setAuDitSta] = useState('')
+
+  // 字段的校验
+  const checkFu = useCallback(() => {
+    if (!topInfo.date) {
+      MessageFu.warning('请选择入库日期')
       return true
     }
-    if (!topInfo.sonTypeName) {
-      MessageFu.warning('请选择业务类型')
+    if (!topInfo.num) {
+      MessageFu.warning('请输入入库单编号')
       return true
     }
     if (!topInfo.storageId) {
-      MessageFu.warning('请选择入库库房')
+      MessageFu.warning('请选择分库缩写')
       return true
     }
-
-    return false
   }, [topInfo])
 
-  // 审批的sta
-  const [auditSta, setAuDitSta] = useState('')
-
   // 新增的底部按钮点击
   const btnClickFu = useCallback(
     async (val: '草稿' | '创建' | '保存' | '审批') => {
-      if (checkDataFu()) return
+      if (checkFu()) {
+        if (sollrDom.current) sollrDom.current.scrollTop = 0
+        return
+      }
 
       if (val !== '草稿') {
-        if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
-          return MessageFu.warning('请添加藏品')
-        } else {
-          if (topInfo.goods.some(v => !v.siteStr || !v.siteId)) {
-            return MessageFu.warning('请选择存放位置')
-          }
-        }
+        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+        if (snaps.some(v => !v.txt4)) return MessageFu.warning('请输入藏品分库号')
       }
 
       if (val === '审批') {
@@ -203,23 +182,18 @@ function D4edit() {
           history.push(`/impStor_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(','),
-          goods: topInfo.goods.map(v => ({
+          goodsIds: snaps.map(v => v.id).join(','),
+          delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
+          snaps: snaps.map(v => ({
             goodsId: v.id,
-            siteId: v.siteId
+            id: v.id2 ? v.id2 : null,
+            orderId: topInfo.id,
+            snap: JSON.stringify(v)
           }))
         }
-        // console.log(123, obj)
+        // console.log(123, obj.snaps)
 
         // if (1 + 1 === 2) return
 
@@ -239,12 +213,25 @@ function D4edit() {
         }
       }
     },
-    [auditSta, checkDataFu, topInfo]
+    [auditSta, checkFu, snaps, topInfo]
   )
 
   // 打开侧边栏
   const [cathet, setCathet] = useState(0)
 
+  // 表格的输入框改变
+  const tableInputChange = useCallback(
+    (id: number, val: number | null, key: 'txt4') => {
+      setSnaps(
+        snaps.map(v => ({
+          ...v,
+          [key]: v.id === id ? val : v[key]
+        }))
+      )
+    },
+    [snaps]
+  )
+
   const startBtn = useMemo(() => {
     return [
       {
@@ -259,51 +246,55 @@ function D4edit() {
             </span>
           )
         }
+      },
+      {
+        title: '编号类型',
+        render: (item: C1GoodType) => item.numName || '(空)'
+      },
+      {
+        title: (
+          <div>
+            <span style={{ color: '#ff4d4f' }}> * </span>藏品分库号
+          </div>
+        ),
+        render: (item: C1GoodType) => (
+          <InputNumber
+            readOnly={['3', '4'].includes(key)}
+            min={1}
+            max={99999999}
+            precision={0}
+            value={item.txt4}
+            onChange={e => tableInputChange(item.id, e, 'txt4')}
+            placeholder='请输入'
+          />
+        )
       }
     ]
-  }, [cathet])
-
-  const siteStrRes = useCallback((siteStr: string) => {
-    let res: any = undefined
-
-    if (siteStr) {
-      let arr = siteStr.split(',')
-      if (arr.length >= 5) arr = arr.slice(1)
-      res = arr
-    }
-    return res
-  }, [])
+  }, [cathet, key, tableInputChange])
 
   const tableLastBtn = useMemo(() => {
     return [
       {
-        title: '存放位置',
-        width: 200,
-        render: (item: C1GoodType) => {
-          return (
-            <Cascader
-              disabled={['3', '4'].includes(key)}
-              options={kuIsTree}
-              placeholder='请选择'
-              // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
-              allowClear={false}
-              value={siteStrRes(item.siteStr)}
-              onChange={(e, e2) => {
-                let lastId: any = ''
-                if (e2 && e2.length === 4) lastId = e2[3].lastId
-
-                setTopInfo({
-                  ...topInfo,
-                  goods: topInfo.goods.map(v => ({
-                    ...v,
-                    siteStr: v.id === item.id ? (e ? e.join(',') : []) : v.siteStr,
-                    siteId: v.id === item.id ? lastId : v.siteId
-                  }))
-                })
-              }}
-            />
-          )
-        }
+        title: '备注',
+        width: 240,
+        render: (item: C1GoodType) => (
+          <TextArea
+            readOnly={['3', '4'].includes(key)}
+            placeholder={
+              ['3', '4'].includes(key) && !item.txt1 ? '(空)' : '请输入内容,不超过200字'
+            }
+            maxLength={200}
+            value={item.txt1}
+            onChange={e =>
+              setSnaps(
+                snaps.map(v => ({
+                  ...v,
+                  txt1: v.id === item.id ? e.target.value : v.txt1
+                }))
+              )
+            }
+          />
+        )
       },
       {
         title: '操作',
@@ -316,12 +307,11 @@ function D4edit() {
               {['3', '4'].includes(key) ? null : (
                 <MyPopconfirm
                   txtK='删除'
-                  onConfirm={() =>
-                    setTopInfo({
-                      ...topInfo,
-                      goods: topInfo.goods.filter(v => v.id !== item.id)
-                    })
-                  }
+                  onConfirm={() => {
+                    if (item.id2 && !delSnapIdsRef.current.includes(item.id2))
+                      delSnapIdsRef.current.push(item.id2)
+                    setSnaps(snaps.filter(v => v.id !== item.id))
+                  }}
                 />
               )}
             </>
@@ -329,43 +319,35 @@ function D4edit() {
         }
       }
     ]
-  }, [key, kuIsTree, topInfo, siteStrRes])
+  }, [key, snaps])
 
-  // 点击新增
+  // 点击添加按钮
   const [nowSta, setNowSta] = useState({ key: '', id: '' })
 
-  // 点击批量设置存放位置
-  const [setLoc, setSetLoc] = useState(false)
-
   // 查看的按钮创建-提交-撤回
   const lookBtnFu = useCallback(
     async (val: '创建' | '提交' | '撤回') => {
       if (val !== '撤回') {
-        if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
-          return MessageFu.warning('请添加藏品')
-        } else {
-          if (topInfo.goods.some(v => !v.siteStr || !v.siteId)) {
-            return MessageFu.warning('请选择存放位置')
-          }
-        }
+        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+        if (snaps.some(v => !v.txt4)) return MessageFu.warning('请输入藏品分库号')
       }
 
-      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 => ({
+        goodsIds: snaps.map(v => v.id).join(','),
+        delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
+        snaps: snaps.map(v => ({
           goodsId: v.id,
-          siteId: v.siteId
+          id: v.id2 ? v.id2 : null,
+          orderId: topInfo.id,
+          snap: JSON.stringify(v)
         }))
       }
 
+      // console.log(123, obj.snaps)
+
+      // if (1 + 1 === 2) return
+
       const res =
         val === '创建'
           ? await D4_APIsaveCreate(obj)
@@ -379,7 +361,7 @@ function D4edit() {
         getInfoFu()
       }
     },
-    [getInfoFu, id, topInfo]
+    [getInfoFu, id, snaps, topInfo]
   )
 
   // 查看模式点击删除
@@ -463,39 +445,21 @@ function D4edit() {
     )
   }, [delFu, lookBtnFu, lookJumpFu, topInfo])
 
-  // 自动分配空置库位
-  const autoNullFu = useCallback(async () => {
-    const res = await D1_APIgetSiteList(topInfo.storageId!, true)
-    if (res.code === 0) {
-      const arrRes: any = ruTransformDataFu(res.data || [])
-
-      // arrRes.sort(() => Math.random() - 0.5)
-
-      const oldGoods = [...topInfo.goods]
-
-      oldGoods.forEach((v, i) => {
-        if (i <= arrRes.length - 1) {
-          v.siteId = arrRes[i].siteId
-          v.siteStr = arrRes[i].siteStr
-        }
-      })
-
-      setTopInfo({
-        ...topInfo,
-        goods: oldGoods
-      })
-      MessageFu.success('自动分配空置库位成功')
-    }
-  }, [topInfo])
-
   // 申请记录
   const [auditsShow, setAuditsShow] = useState(false)
 
+  // 点击自动分配空置分库号
+  const [auto, setAuto] = useState(false)
+
+  // 二次校验分库号
+  // 待完善类型
+  const [numCheck, setNumCheck] = useState<any[]>([])
+
   return (
     <div className={styles.D4edit}>
       <div className='pageTitle'>藏品入库-{pageTitTxt}</div>
 
-      <div className='D4main' ref={sollrDom}>
+      <div className='D4main'>
         {['3'].includes(key) ? (
           <X3auditInfo
             dirCode='D4impStor'
@@ -513,154 +477,114 @@ function D4edit() {
             <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
           )}
         </div>
+
         <div className='D4rowAll'>
           <div className='D4row'>
             <div className='D4rowll'>
-              <span> * </span>申请名称
+              <span> * </span>入库日期
             </div>
             <div className='D4rowrr'>
-              <Input
-                value={topInfo.name}
-                onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
-                readOnly={['3', '4'].includes(key)}
-                placeholder='请输入内容'
-                maxLength={30}
-                showCount
+              <DatePicker
+                disabled={['3', '4'].includes(key)}
+                allowClear={false}
+                value={topInfo.date ? dayjs(topInfo.date) : null}
+                onChange={e => timeChange(e, 'date')}
               />
             </div>
           </div>
 
           <div className='D4row'>
             <div className='D4rowll'>
-              <span> * </span>业务类型
+              <span> * </span>入库单编号
             </div>
             <div className='D4rowrr'>
-              <Cascader
-                value={topInfo.sonTypeName ? topInfo.sonTypeName.split(',') : []}
-                onChange={e => setTopInfo({ ...topInfo, sonTypeName: e ? e.join(',') : '' })}
-                disabled={['3', '4'].includes(key)}
-                options={cascaderObjFu()['藏品入库']}
-                changeOnSelect
-                placeholder='请选择'
-                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
-                allowClear={false}
+              <Input
+                value={topInfo.num}
+                onChange={e => setTopInfo({ ...topInfo, num: e.target.value.trim() })}
+                readOnly={['3', '4'].includes(key)}
+                placeholder='请输入内容'
+                maxLength={30}
+                showCount
               />
             </div>
           </div>
 
-          {B3aForm1.map(v => (
-            <div className='D4row' key={v.name}>
-              <div className='D4rowll'>{v.name}:</div>
-              <div className='D4rowrr'>
-                {topInfo[v.key as 'name']}
-                {['3', '4'].includes(key) && v.name === '发起人'
-                  ? ' - ' + topInfo.createTime || ''
-                  : ''}
-              </div>
-            </div>
-          ))}
-
           <div className='D4row'>
-            <div className='D4rowll'>相关出库单:</div>
+            <div className='D4rowll'>
+              <span> * </span>分库缩写:
+            </div>
             <div className='D4rowrr'>
               <Select
                 disabled={['3', '4'].includes(key)}
-                placeholder={['3', '4'].includes(key) ? '(空)' : '请搜索出库单编码'}
+                placeholder='请搜索选择'
                 showSearch
-                options={putsList}
-                fieldNames={{ label: 'num', value: 'num' }}
-                allowClear={true}
-                value={topInfo.relatedOrderNum || null}
-                onChange={e => setTopInfo({ ...topInfo, relatedOrderNum: e ? e : '' })}
-              />
-            </div>
-          </div>
+                filterOption={(input, option) => {
+                  const txt = option!.label
 
-          <div className='D4row'>
-            <div className='D4rowll'>
-              <span> * </span>业务日期:
-            </div>
-            <div className='D4rowrr'>
-              <DatePicker
-                disabled={['3', '4'].includes(key)}
+                  return txt.toLowerCase().includes(input.toLowerCase())
+                }}
+                options={storageIdArr.map(v => ({ label: v.num + ' - ' + v.name, value: v.id }))}
+                // fieldNames={{ label: 'num', value: 'num' }}
                 allowClear={false}
-                value={dayjs(topInfo.date)}
-                onChange={timeChange}
-              />
-            </div>
-          </div>
-
-          <div className='D4row D4row2'>
-            <div className='D4rowll'>附件:</div>
-            <div className='D4rowrr'>
-              <Z3upFiles
-                max={10}
-                isLook={['3', '4'].includes(key)}
-                ref={filesRef}
-                fileCheck={false}
-                dirCode='impStor'
-                myUrl='cms/orderIn/upload'
-                lookData={topInfo.files || []}
-                size={500}
-                fromData={{ moduleId: topInfo.id }}
+                value={topInfo.storageId || null}
+                onChange={e => {
+                  setSnaps([])
+                  setTopInfo({ ...topInfo, storageId: e ? e : null })
+                }}
               />
             </div>
           </div>
 
           <div className='D4row'>
-            <div className='D4rowll'>原因事由:</div>
+            <div className='D4rowll'>发掘报告编号:</div>
             <div className='D4rowrr'>
               <Input
-                value={topInfo.reason}
-                onChange={e => setTopInfo({ ...topInfo, reason: e.target.value })}
+                value={topInfo.sonNum2}
+                onChange={e => setTopInfo({ ...topInfo, sonNum2: e.target.value.trim() })}
                 readOnly={['3', '4'].includes(key)}
-                placeholder='请输入内容'
+                placeholder={['3', '4'].includes(key) ? '(空)' : '请输入内容'}
                 maxLength={30}
                 showCount
               />
             </div>
           </div>
 
-          <div className='D4row D4rowFull'>
-            <div className='D4rowll'>备注:</div>
+          <div className='D4row'>
+            <div className='D4rowll'>入馆凭证号:</div>
             <div className='D4rowrr'>
-              <ZRichTexts
-                check={false}
-                dirCode='impStor'
-                myUrl='cms/goodsFile/upload'
-                isLook={['3', '4'].includes(key)}
-                ref={ZRichTextRef}
-                isOne={true}
-                upAudioBtnNone={true}
+              <Select
+                disabled={['3', '4'].includes(key)}
+                placeholder={['3', '4'].includes(key) ? '(空)' : '请搜索选择'}
+                showSearch
+                filterOption={(input, option) => {
+                  const txt = option!.label
+
+                  return txt.toLowerCase().includes(input.toLowerCase())
+                }}
+                options={relatedOrderNumArr.map(v => ({ label: v.num, value: v.id }))}
+                // fieldNames={{ label: 'num', value: 'num' }}
+                allowClear={true}
+                value={topInfo.relatedOrderNum || null}
+                onChange={e => setTopInfo({ ...topInfo, relatedOrderNum: e ? e : '' })}
               />
             </div>
           </div>
-        </div>
 
-        <div className='D4Tit'>库房信息</div>
-        <div className='D4rowAll'>
           <div className='D4row'>
-            <div className='D4rowll'>
-              <span> * </span>入库库房:
-            </div>
+            <div className='D4rowll'>来源:</div>
             <div className='D4rowrr'>
-              <Select
-                options={storSetList}
-                value={topInfo.storageId}
-                onChange={(storageId, arr) => {
-                  setTopInfo({ ...topInfo, storageId, goods: [] })
-                  kuIsTreeFu((arr as TypeD2list).id)
-                }}
+              <Cascader
+                value={topInfo.sonSource ? topInfo.sonSource.split(',') : []}
+                onChange={e => setTopInfo({ ...topInfo, sonSource: e ? e.join(',') : '' })}
                 disabled={['3', '4'].includes(key)}
-                fieldNames={{ value: 'id', label: 'name' }}
+                options={cascaderObjFu()['藏品入库']}
+                changeOnSelect
                 placeholder='请选择'
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                allowClear={true}
               />
             </div>
           </div>
-          <div className='D4row D4row3'>
-            <div className='D4rowll'>库房负责人:</div>
-            <div className='D4rowrr'>{managerUser || '(空)'}</div>
-          </div>
         </div>
 
         {/* 藏品清单 */}
@@ -672,26 +596,23 @@ function D4edit() {
                 <>
                   <Button
                     type='primary'
-                    onClick={() => {
-                      if (!topInfo.storageId) return MessageFu.warning('请先选择入库库房')
-                      setNowSta({ key: '5', id: 'cms/orderIn/goods/getList' })
-                    }}
-                  >
-                    新增
-                  </Button>
-                  <Button
-                    type='primary'
-                    onClick={() => setSetLoc(true)}
-                    disabled={!(topInfo.goods && topInfo.goods.length)}
+                    onClick={() => setAuto(true)}
+                    disabled={snaps.length === 0}
                   >
-                    批量设置存放位置
+                    自动分配空置分库号
                   </Button>
+                  &emsp;
                   <Button
                     type='primary'
-                    onClick={autoNullFu}
-                    disabled={!(topInfo.goods && topInfo.goods.length)}
+                    onClick={() => {
+                      if (!topInfo.storageId) return MessageFu.warning('请先选择分库缩写')
+                      setNowSta({
+                        key: '藏品入库',
+                        id: 'cms/orderIn/goods/getList'
+                      })
+                    }}
                   >
-                    自动分配空置库位
+                    新增
                   </Button>
                 </>
               )}
@@ -700,8 +621,8 @@ function D4edit() {
 
           {/* 表格 */}
           <MyTable
-            list={topInfo.goods || []}
-            columnsTemp={D4goodsTableC}
+            list={snaps}
+            columnsTemp={D4tableCgoods}
             startBtn={startBtn}
             lastBtn={tableLastBtn}
             pagingInfo={false}
@@ -712,71 +633,89 @@ function D4edit() {
         {auditsShow ? (
           <ZflowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
         ) : null}
-      </div>
 
-      {/* 底部按钮 */}
-      <div className='D4btn'>
-        {['3', '4'].includes(key) && topInfo.audits && topInfo.audits.length ? (
-          <Button type='primary' onClick={() => setAuditsShow(true)}>
-            申请记录
-          </Button>
-        ) : null}
+        {/* 底部按钮 */}
+        <div className='D4btn'>
+          {['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 === '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}
 
-            {key === '1' ? (
-              <Button type='primary' onClick={() => btnClickFu('草稿')}>
-                存草稿
-              </Button>
-            ) : null}
+              <MyPopconfirm txtK='取消' onConfirm={() => history.push('/repair')} />
+            </>
+          )}
+        </div>
 
-            <MyPopconfirm txtK='取消' onConfirm={() => history.push('/impStor')} />
-          </>
-        )}
+        {/* 附件归档 */}
+        {topInfo.status === 4 ? (
+          <ZupFileTable
+            listTemp={topInfo.filing || []}
+            dirCode='D4impStor'
+            myUrl='cms/orderIn/upload'
+            fromData={{ moduleId: topInfo.id }}
+          />
+        ) : null}
       </div>
 
       {/* 打开侧边栏 */}
       <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
-      {/* 新增弹窗 */}
+
       {nowSta.id ? (
         <ZGaddNow
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}
-          dataResFu={data => setTopInfo({ ...topInfo, goods: data })}
-          oldCheckArr={topInfo.goods || []}
-          canObj={{ storageId: topInfo.storageId }}
+          dataResFu={data => {
+            const dataTemp = [...data]
+            dataTemp.forEach(v => {
+              // id2表示的是自己这条数据的id id才是goodsId
+              const obj = snapsID2ref.current.find(c => c.goodsId === v.id)
+
+              if (obj) v.id2 = obj.id
+            })
+            setSnaps(dataTemp)
+          }}
+          oldCheckArr={snaps}
         />
       ) : null}
 
-      {/* 批量设置存放位置 */}
-      {setLoc ? (
-        <X1setStoreLocS
-          succFu={(val, siteId) =>
-            setTopInfo({
-              ...topInfo,
-              goods: topInfo.goods.map(v => ({
-                ...v,
-                siteStr: val,
-                siteId
-              }))
-            })
-          }
-          kuIsTree={kuIsTree}
-          closeFu={() => setSetLoc(false)}
+      {/* 点击自动分配 */}
+      {auto ? (
+        <D4auto
+          closeFu={() => setAuto(false)}
+          succFu={num => {
+            // 待完善
+            console.log('ppp', num)
+            setNumCheck([
+              { id: 1, num: 'xxx', shuzi: 3, name: '666' },
+              { id: 2, num: 'x2xx', shuzi: 7, name: '999' }
+            ])
+          }}
         />
       ) : null}
+
+      {/* 二次校验分库号 */}
+      {numCheck.length ? <D4check closeFu={() => setNumCheck([])} listTemp={numCheck} /> : null}
     </div>
   )
 }

+ 32 - 0
src/pages/D_storeManage/D4impStor/data.ts

@@ -0,0 +1,32 @@
+export type D4formType = {
+  pageSize: number
+  pageNum: number
+  businessTimeStart: string
+  businessTimeEnd: string
+  num: string
+  sonNum: string
+  deptName: string
+  userName: string
+  startTime: string
+  endTime: string
+  status: string
+  userType: string
+}
+
+export type D4InputKeyType = keyof D4formType
+
+export const D4baseFormData: D4formType = {
+  pageSize: 10,
+  pageNum: 1,
+
+  businessTimeStart: '',
+  businessTimeEnd: '',
+  num: '',
+  sonNum: '',
+  deptName: '',
+  userName: '',
+  startTime: '',
+  endTime: '',
+  status: '',
+  userType: ''
+}

+ 2 - 2
src/pages/D_storeManage/D4impStor/index.module.scss

@@ -1,7 +1,7 @@
 .D4impStor {
   background-color: #fff;
   border-radius: 10px;
-  padding: 15px 24px 0;
+  padding: 24px 24px 0;
   :global {
     .D4top {
       display: flex;
@@ -15,7 +15,7 @@
           display: flex;
           align-items: center;
           .ant-input {
-            width: 194px;
+            width: 160px;
           }
         }
       }

+ 91 - 77
src/pages/D_storeManage/D4impStor/index.tsx

@@ -1,50 +1,26 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
-import { Button, DatePicker, Input, Select } from 'antd'
-import { TypeD4Form } from './type'
 import dayjs from 'dayjs'
-import MyTable from '@/components/MyTable'
-import { D4tableC, statusObj } from '@/utils/tableData'
-import MyPopconfirm from '@/components/MyPopconfirm'
-import history, { btnFlagFu } from '@/utils/history'
-import { selectObj } from '@/utils/select'
+import ExportJsonExcel from 'js-export-excel'
+import { Button, DatePicker, Input, Select } from 'antd'
 import { useDispatch, useSelector } from 'react-redux'
-import { D2_APIgetList } from '@/store/action/D2storSet'
-import { RootState } from '@/store'
+import { D4baseFormData, D4InputKeyType } from './data'
 import { D4_APIdel, D4_APIgetList } from '@/store/action/D4impStor'
 import { MessageFu } from '@/utils/message'
+import history, { btnFlagFu } from '@/utils/history'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { RootState } from '@/store'
+import { D4tableC, statusObj } from '@/utils/tableData'
 import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
-import ExportJsonExcel from 'js-export-excel'
-import { B3_4inputKeyArr, D3InputKeyType } from '@/pages/B_enterTibet/B1collect/data'
+import { selectObj } from '@/utils/select'
+import MyTable from '@/components/MyTable'
 const { RangePicker } = DatePicker
 
-export const D3baseFormData: TypeD4Form = {
-  pageSize: 10,
-  pageNum: 1,
-  num: '',
-  name: '',
-  deptName: '',
-  userName: '',
-  startTime: '',
-  endTime: '',
-  status: null,
-  userType: null,
-  storageInId: null
-}
-
 function D4impStor() {
   const dispatch = useDispatch()
-
-  // 获取入库库房下拉框 - 库房设置列表
-  useEffect(() => {
-    dispatch(D2_APIgetList({ pageNum: 1, pageSize: 99999 }))
-  }, [dispatch])
-
-  const { list } = useSelector((state: RootState) => state.D2storSet.tableInfo)
-
-  const [formData, setFormData] = useState(D3baseFormData)
-  const formDataRef = useRef(D3baseFormData)
-  const formDataOldRef = useRef(D3baseFormData)
+  const [formData, setFormData] = useState(D4baseFormData)
+  const formDataRef = useRef(D4baseFormData)
+  const formDataOldRef = useRef(D4baseFormData)
 
   useEffect(() => {
     formDataRef.current = formData
@@ -62,8 +38,22 @@ function D4impStor() {
   }, [formData])
 
   // 时间选择器改变
+
   const timeChange = useCallback(
     (date: any, dateString: any) => {
+      let businessTimeStart = ''
+      let businessTimeEnd = ''
+      if (dateString[0] && dateString[1]) {
+        businessTimeStart = dateString[0] + ' 00:00:00'
+        businessTimeEnd = dateString[1] + ' 23:59:59'
+      }
+      setFormData({ ...formData, businessTimeStart, businessTimeEnd })
+    },
+    [formData]
+  )
+
+  const timeChange2 = useCallback(
+    (date: any, dateString: any) => {
       let startTime = ''
       let endTime = ''
       if (dateString[0] && dateString[1]) {
@@ -87,7 +77,7 @@ function D4impStor() {
 
   // 输入框的改变
   const txtChangeFu = useCallback(
-    (txt: string, key: D3InputKeyType) => {
+    (txt: string, key: D4InputKeyType) => {
       setFormData({
         ...formData,
         [key]: txt
@@ -98,7 +88,7 @@ function D4impStor() {
 
   // 点击重置
   const resetSelectFu = useCallback(() => {
-    setFormData(D3baseFormData)
+    setFormData(D4baseFormData)
     setTimeout(() => {
       setTimeKey(Date.now())
     }, 50)
@@ -114,7 +104,6 @@ function D4impStor() {
     },
     [formData]
   )
-
   // 点击删除
   const delTableFu = useCallback(
     async (id: number) => {
@@ -127,7 +116,7 @@ function D4impStor() {
     [getListFu]
   )
 
-  // 点击操作按钮
+  // 点击各种操作按钮
   const tableBtnFu = useCallback((id: number, key: string) => {
     history.push(`/impStor_edit/${key}/${id}`)
   }, [])
@@ -198,18 +187,18 @@ function D4impStor() {
             })),
             sheetName: name,
             sheetFilter: [
+              'date',
               'num',
-              'name',
-              'storageName',
+              'sonNum',
               'deptName',
               'creatorName',
               'createTime',
               'status'
             ],
             sheetHeader: [
-              '业务单号',
-              '申请名称',
-              '入库库房',
+              '入库日期',
+              '入库单编号',
+              '分库缩写',
               '发起部门',
               '发送人',
               '发起日期',
@@ -228,20 +217,49 @@ function D4impStor() {
   return (
     <div className={styles.D4impStor}>
       <div className='pageTitle'>藏品入库</div>
-
       <div className='D4top'>
         <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>
+            <RangePicker
+              value={
+                formData.businessTimeStart
+                  ? [dayjs(formData.businessTimeStart), dayjs(formData.businessTimeEnd)]
+                  : null
+              }
+              onChange={timeChange}
+            />
+          </div>
+
+          <div>
+            <span>入库单编号:</span>
+            <Input
+              placeholder='请输入入库单编号'
+              maxLength={30}
+              value={formData.num}
+              onChange={e => txtChangeFu(e.target.value, 'num')}
+            />
+          </div>
+
+          <div>
+            <span>分库缩写:</span>
+            <Input
+              placeholder='请输入分库缩写'
+              maxLength={30}
+              value={formData.num}
+              onChange={e => txtChangeFu(e.target.value, 'num')}
+            />
+          </div>
+
+          <div>
+            <span>发起部门:</span>
+            <Input
+              placeholder='请输入发起部门'
+              maxLength={30}
+              value={formData.deptName}
+              onChange={e => txtChangeFu(e.target.value, 'deptName')}
+            />
+          </div>
         </div>
         <div className='D4toprr'>
           <Button type='primary' onClick={deriveFu}>
@@ -253,25 +271,35 @@ function D4impStor() {
           </Button>
         </div>
       </div>
+
       <div className='D4top'>
         <div className='D4topll'>
           <div>
+            <span>发起人:</span>
+            <Input
+              placeholder='请输入发起人'
+              maxLength={30}
+              value={formData.userName}
+              onChange={e => txtChangeFu(e.target.value, 'userName')}
+            />
+          </div>
+
+          <div>
             <span>发起日期范围:</span>
             <RangePicker
               value={
                 formData.startTime ? [dayjs(formData.startTime), dayjs(formData.endTime)] : null
               }
-              onChange={timeChange}
+              onChange={timeChange2}
             />
           </div>
-
           <div>
             <span>申请状态:</span>
             <Select
               allowClear={true}
               placeholder='全部'
-              style={{ width: 150 }}
-              value={formData.status}
+              style={{ width: 174 }}
+              value={formData.status ? formData.status : null}
               onChange={e => setFormData({ ...formData, status: e })}
               options={selectObj['申请状态'].filter(v => v.label !== '待盘点')}
             />
@@ -281,28 +309,14 @@ function D4impStor() {
             <span>选择角色:</span>
             <Select
               allowClear={true}
-              style={{ width: 150 }}
+              style={{ width: 174 }}
               placeholder='全部'
               options={selectObj['角色']}
               // fieldNames={{ value: 'id', label: 'roleName' }}
-              value={formData.userType}
+              value={formData.userType ? formData.userType : null}
               onChange={e => setFormData({ ...formData, userType: e })}
             />
           </div>
-
-          <div>
-            <span>入库库房:</span>
-            {/* 拿库房设置的列表 */}
-            <Select
-              allowClear={true}
-              placeholder='全部'
-              style={{ width: 150 }}
-              value={formData.storageInId}
-              onChange={e => setFormData({ ...formData, storageInId: e })}
-              fieldNames={{ value: 'id', label: 'name' }}
-              options={list}
-            />
-          </div>
         </div>
         <div className='D4toprr'>
           <Button type='primary' onClick={clickSearch}>

+ 1 - 14
src/pages/D_storeManage/D4impStor/type.d.ts

@@ -1,18 +1,5 @@
-export type TypeD4Form = {
-  pageSize: number
-  pageNum: number
-  num: string
-  name: string
-  deptName: string
-  userName: string
-  startTime: string
-  endTime: string
-  status: null | number
-  userType: null | string
-  storageInId: null | number
-}
-
 // 排架 层数 层格变成树的树结构
+// 旧版数据,暂时不删
 export type KuIsTreeType = {
   value: string
   label: string

+ 0 - 126
src/pages/D_storeManage/D6putsStor/D6edit/index.module.scss

@@ -1,130 +1,4 @@
 .D6edit {
-  background-color: #fff;
-  border-radius: 10px;
-  padding: 15px 24px 0px;
   :global {
-    .D6Tit {
-      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;
-      }
-    }
-    .D6Tit2 {
-      margin-top: 24px;
-      display: flex;
-      justify-content: space-between;
-      border-bottom: 1px solid #ccc;
-      margin-bottom: 20px;
-      .D6Tit2ll {
-        font-size: 18px;
-        font-weight: 700;
-        padding-left: 18px;
-        margin-bottom: 17px;
-        color: var(--themeColor);
-      }
-      .D6Tit2rr {
-        position: relative;
-        z-index: 2;
-        .ant-btn {
-          margin-left: 15px;
-        }
-      }
-    }
-
-    .D6main {
-      width: 100%;
-      height: calc(100% - 70px);
-      overflow-y: auto;
-      padding-bottom: 40px;
-
-      .D6rowAll {
-        display: flex;
-        justify-content: space-between;
-        align-items: self-start;
-        font-size: 16px;
-        flex-wrap: wrap;
-        .D6row {
-          width: 48%;
-          display: flex;
-          align-items: center;
-          margin-bottom: 20px;
-          .D6rowll {
-            width: 124px;
-            text-align: right;
-            font-weight: 700;
-            & > span {
-              color: #ff4d4f;
-            }
-          }
-          .D6rowrr {
-            width: calc(100% - 124px);
-            .ant-input-affix-wrapper {
-              width: 300px;
-            }
-            .ant-select {
-              width: 300px;
-            }
-          }
-        }
-        .D6row2 {
-          align-items: self-start;
-          .D6rowll {
-            position: relative;
-            top: 3px;
-          }
-        }
-        .D6row3 {
-          position: relative;
-          top: 4px;
-        }
-
-        .D6rowFull {
-          width: 100%;
-          margin-top: -20px;
-          align-items: self-start;
-          margin-bottom: 0;
-          .D6rowll {
-            position: relative;
-            top: 3px;
-          }
-        }
-      }
-
-      // 藏品清单
-      .D6googsBox {
-        padding-right: 20px;
-        .D1GtNum {
-          cursor: pointer;
-          text-decoration: underline;
-          // &:hover {
-          //   color: var(--themeColor);
-          // }
-        }
-
-        .D1GtNumAc {
-          color: var(--themeColor);
-        }
-      }
-    }
-
-    .D6btn {
-      position: absolute;
-      bottom: 20px;
-      left: 134px;
-      .ant-btn {
-        margin-right: 20px;
-      }
-    }
-
-    .ant-table-cell {
-      padding: 8px !important;
-    }
   }
 }

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

@@ -1,658 +1,9 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import React from 'react'
 import styles from './index.module.scss'
-import { pageTitTxtObj } from '../../D4impStor/D4edit'
-import { useParams } from 'react-router-dom'
-import { Button, Cascader, DatePicker, Input, Radio, Select } from 'antd'
-import dayjs from 'dayjs'
-import Z3upFiles from '@/components/Z3upFiles'
-import ZRichTexts from '@/components/ZRichTexts'
-import { MessageFu } from '@/utils/message'
-import history, { btnFlagFu2, cascaderObjFu, openGoodsInfoFu } from '@/utils/history'
-import ZGaddNow from '@/components/ZGaddNow'
-import MyTable from '@/components/MyTable'
-import classNames from 'classnames'
-import MyPopconfirm from '@/components/MyPopconfirm'
-import { D4goodsTableC, statusObj } from '@/utils/tableData'
-import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
-import X3auditInfo from '@/pages/X_stock/X3auditInfo'
-import ZflowTable from '@/components/ZflowTable'
-import { useDispatch, useSelector } from 'react-redux'
-import { D2_APIgetList } from '@/store/action/D2storSet'
-import { RootState } from '@/store'
-import {
-  D6_APIcreate,
-  D6_APIdel,
-  D6_APIgetInfo,
-  D6_APIrevocation,
-  D6_APIsaveApply,
-  D6_APIsaveAudit,
-  D6_APIsaveCreate,
-  D6_APIsaveDraft
-} from '@/store/action/D6putsStor'
-import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
-import { EXbtnFu } from '@/utils/EXBtn'
-import D6impRelation from '../D6impRelation'
-import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
-import { B3aForm1 } from '@/pages/B_enterTibet/B1collect/data'
-
 function D6edit() {
-  const { key, id } = useParams<any>()
-  // key:1 新增 2编辑 3审批 4查看
-
-  // 滚到顶部
-  const sollrDom = useRef<HTMLDivElement>(null)
-
-  // 顶部数据
-  const [topInfo, setTopInfo] = useState({} as FourTableType)
-
-  // 出库库房数组信息
-  const dispatch = useDispatch()
-
-  useEffect(() => {
-    dispatch(D2_APIgetList({ pageNum: 1, pageSize: 99999 }))
-  }, [dispatch])
-
-  const { list: storSetList } = useSelector((state: RootState) => state.D2storSet.tableInfo)
-
-  // 库房负责人txt
-  const managerUser = useMemo(() => {
-    let txt = ''
-    if (topInfo.storageId && storSetList.length) {
-      let obj = storSetList.find(v => v.id === topInfo.storageId)
-      if (obj) txt = obj.managerUser
-    }
-    return txt
-  }, [storSetList, topInfo.storageId])
-
-  // 创建订单
-  const creatFu = useCallback(async () => {
-    const res = await D6_APIcreate()
-    if (res.code === 0) {
-      setTopInfo({ ...res.data, isReturn: 0 })
-    }
-  }, [])
-
-  // 获取详情
-  const getInfoFu = useCallback(async () => {
-    const res = await D6_APIgetInfo(id)
-    if (res.code === 0) {
-      setTopInfo(res.data)
-
-      // 设置富文本
-      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 pageTitTxt = useMemo(() => {
-    return Reflect.get(pageTitTxtObj, key)
-  }, [key])
-
-  const timeChange = useCallback(
-    (e: any) => {
-      setTopInfo({ ...topInfo, date: dayjs(e).format('YYYY-MM-DD') })
-    },
-    [topInfo]
-  )
-
-  const checkDataFu = useCallback(() => {
-    if (!topInfo.name) {
-      MessageFu.warning('申请名称不能为空')
-      return true
-    }
-    if (!topInfo.sonTypeName) {
-      MessageFu.warning('请选择业务类型')
-      return true
-    }
-    if (!topInfo.storageId) {
-      MessageFu.warning('请选择出库库房')
-      return true
-    }
-
-    return false
-  }, [topInfo])
-
-  // 审批的sta
-  const [auditSta, setAuDitSta] = useState('')
-
-  // 新增的底部按钮点击
-  const btnClickFu = useCallback(
-    async (val: '草稿' | '创建' | '保存' | '审批') => {
-      if (checkDataFu()) return
-
-      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 D6_APIsaveAudit({
-          orderId: topInfo.id,
-          rtfOpinion: rtf2,
-          status: auditSta === '同意' ? 1 : 2
-        })
-
-        if (res.code === 0) {
-          MessageFu.success('审批成功')
-          // 跳详情页
-          history.push(`/putsStor_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 D6_APIsaveDraft(obj)
-          if (res.code === 0) {
-            MessageFu.success('草稿保存成功')
-          }
-        } else {
-          const res = val === '创建' ? await D6_APIsaveCreate(obj) : await D6_APIsaveApply(obj)
-          if (res.code === 0) {
-            MessageFu.success(`${val}成功`)
-            // 跳到详情页
-            history.push(`/putsStor_edit/4/${topInfo.id}`)
-          }
-        }
-      }
-    },
-    [auditSta, checkDataFu, 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 item.siteStr ? item.siteStr.replaceAll(',', ' / ') : '(空)'
-        }
-      },
-      {
-        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, topInfo])
-
-  // 点击新增
-  const [nowSta, setNowSta] = useState({ key: '', id: '' })
-
-  // 查看的按钮创建-提交-撤回
-  const lookBtnFu = useCallback(
-    async (val: '创建' | '提交' | '撤回') => {
-      if (val !== '撤回') {
-        if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
-          return MessageFu.warning('请添加藏品')
-        }
-      }
-
-      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(',')
-      }
-
-      const res =
-        val === '创建'
-          ? await D6_APIsaveCreate(obj)
-          : val === '提交'
-          ? await D6_APIsaveApply(obj)
-          : await D6_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 D6_APIdel(id)
-    if (res.code === 0) {
-      MessageFu.success('删除成功')
-      history.push('/putsStor')
-    }
-  }, [id])
-
-  // 查看模式点击审批 编辑
-  const lookJumpFu = useCallback(
-    (val: '审批' | '编辑') => {
-      history.push(`/putsStor_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('/putsStor')}>返回</Button>
-      </>
-    )
-  }, [delFu, lookBtnFu, lookJumpFu, topInfo])
-
-  // 申请记录
-  const [auditsShow, setAuditsShow] = useState(false)
-
   return (
     <div className={styles.D6edit}>
-      <div className='pageTitle'>藏品出库-{pageTitTxt}</div>
-
-      <div className='D6main' ref={sollrDom}>
-        {['3'].includes(key) ? (
-          <X3auditInfo
-            dirCode='putsStor'
-            myUrl='cms/goodsFile/upload'
-            auditSta={auditSta}
-            auditStaFu={val => setAuDitSta(val)}
-            ref={ZAuditRef}
-          />
-        ) : null}
-
-        {/* 表单字段、附件等 */}
-        <div className='D6Tit'>
-          申请信息
-          {key === '1' ? null : (
-            <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
-          )}
-        </div>
-
-        <div className='D6rowAll'>
-          <div className='D6row'>
-            <div className='D6rowll'>
-              <span> * </span>申请名称:
-            </div>
-            <div className='D6rowrr'>
-              <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='D6row'>
-            <div className='D6rowll'>
-              <span> * </span>业务类型:
-            </div>
-            <div className='D6rowrr'>
-              <Cascader
-                value={topInfo.sonTypeName ? topInfo.sonTypeName.split(',') : []}
-                onChange={e => setTopInfo({ ...topInfo, sonTypeName: e ? e.join(',') : '' })}
-                disabled={['3', '4'].includes(key)}
-                options={cascaderObjFu()['藏品出库']}
-                changeOnSelect
-                placeholder='请选择'
-                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
-                allowClear={false}
-              />
-            </div>
-          </div>
-
-          {B3aForm1.map(v => (
-            <div className='D6row' key={v.name}>
-              <div className='D6rowll'>{v.name}:</div>
-              <div className='D6rowrr'>
-                {topInfo[v.key as 'name']}
-                {['3', '4'].includes(key) && v.name === '发起人'
-                  ? ' - ' + topInfo.createTime || ''
-                  : ''}
-              </div>
-            </div>
-          ))}
-
-          <div className='D6row'>
-            <div className='D6rowll'>
-              <span> * </span>是否归还:
-            </div>
-            <div className='D6rowrr'>
-              <Radio.Group
-                disabled={['3', '4'].includes(key)}
-                value={topInfo.isReturn}
-                onChange={e =>
-                  setTopInfo({
-                    ...topInfo,
-                    isReturn: e.target.value,
-                    returnDate: e.target.value === 0 ? '' : topInfo.returnDate
-                  })
-                }
-                options={[
-                  { value: 1, label: '是' },
-                  { value: 0, label: '否' }
-                ]}
-              />
-            </div>
-          </div>
-
-          <div className='D6row'>
-            <div className='D6rowll'> 预计归还日期:</div>
-            <div className='D6rowrr'>
-              <DatePicker
-                placeholder={topInfo.isReturn !== 1 ? '(空)' : '请选择日期'}
-                disabled={['3', '4'].includes(key) || topInfo.isReturn !== 1}
-                allowClear={true}
-                value={topInfo.returnDate ? dayjs(topInfo.returnDate) : null}
-                onChange={e =>
-                  setTopInfo({ ...topInfo, returnDate: e ? dayjs(e).format('YYYY-MM-DD') : '' })
-                }
-              />
-            </div>
-          </div>
-
-          <div className='D6row'>
-            <div className='D6rowll'>
-              <span> * </span>业务日期:
-            </div>
-            <div className='D6rowrr'>
-              <DatePicker
-                disabled={['3', '4'].includes(key)}
-                allowClear={false}
-                value={dayjs(topInfo.date)}
-                onChange={timeChange}
-              />
-            </div>
-          </div>
-          <div className='D6row'>
-            <div className='D6rowll'>原因事由:</div>
-            <div className='D6rowrr'>
-              <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='D6row D6row2'>
-            <div className='D6rowll'>附件:</div>
-            <div className='D6rowrr'>
-              <Z3upFiles
-                max={10}
-                isLook={['3', '4'].includes(key)}
-                ref={filesRef}
-                fileCheck={false}
-                dirCode='putsStor'
-                myUrl='cms/orderOut/upload'
-                lookData={topInfo.files || []}
-                size={500}
-                fromData={{ moduleId: topInfo.id }}
-              />
-            </div>
-          </div>
-
-          <div className='D6row D6rowFull'>
-            <div className='D6rowll'>备注:</div>
-            <div className='D6rowrr'>
-              <ZRichTexts
-                check={false}
-                dirCode='putsStor'
-                myUrl='cms/goodsFile/upload'
-                isLook={['3', '4'].includes(key)}
-                ref={ZRichTextRef}
-                isOne={true}
-                upAudioBtnNone={true}
-              />
-            </div>
-          </div>
-        </div>
-
-        <div className='D6Tit'>库房信息</div>
-        <div className='D6rowAll'>
-          <div className='D6row'>
-            <div className='D6rowll'>
-              <span> * </span>出库库房:
-            </div>
-            <div className='D6rowrr'>
-              <Select
-                options={storSetList}
-                value={topInfo.storageId}
-                onChange={(storageId, arr) => {
-                  setTopInfo({ ...topInfo, storageId, goods: [] })
-                }}
-                disabled={['3', '4'].includes(key)}
-                fieldNames={{ value: 'id', label: 'name' }}
-                placeholder='请选择'
-              />
-            </div>
-          </div>
-          <div className='D6row D6row3'>
-            <div className='D6rowll'>库房负责人:</div>
-            <div className='D6rowrr'>{managerUser || '(空)'}</div>
-          </div>
-        </div>
-
-        {/* 藏品清单 */}
-        <div className='D6googsBox'>
-          <div className='D6Tit2'>
-            <div className='D6Tit2ll'>藏品清单</div>
-            <div className='D6Tit2rr'>
-              {['3', '4'].includes(key) ? null : (
-                <Button
-                  type='primary'
-                  onClick={() => {
-                    if (!topInfo.storageId) return MessageFu.warning('请先选择出库库房')
-                    setNowSta({ key: '5', id: 'cms/orderOut/goods/getList' })
-                  }}
-                >
-                  新增
-                </Button>
-              )}
-            </div>
-          </div>
-
-          {/* 表格 */}
-          <MyTable
-            list={topInfo.goods || []}
-            columnsTemp={D4goodsTableC}
-            startBtn={startBtn}
-            lastBtn={tableLastBtn}
-            pagingInfo={false}
-          />
-        </div>
-
-        {/* 相关入库单 */}
-        {key === '4' ? <D6impRelation list={topInfo.relatedOrder || []} /> : null}
-
-        {/* 申请流程 */}
-        {auditsShow ? (
-          <ZflowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
-        ) : null}
-      </div>
-
-      {/* 底部按钮 */}
-      <div className='D6btn'>
-        {['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('/putsStor')} />
-          </>
-        )}
-      </div>
-
-      {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
-      {/* 新增弹窗 */}
-      {nowSta.id ? (
-        <ZGaddNow
-          nowSta={nowSta}
-          closeFu={() => setNowSta({ key: '', id: '' })}
-          dataResFu={data => setTopInfo({ ...topInfo, goods: data })}
-          oldCheckArr={topInfo.goods || []}
-          canObj={{ storageId: topInfo.storageId }}
-        />
-      ) : null}
+      <h1>D6edit</h1>
     </div>
   )
 }

+ 0 - 21
src/pages/D_storeManage/D6putsStor/D6impRelation/index.module.scss

@@ -1,21 +0,0 @@
-.D6impRelation {
-  margin-top: 24px;
-  :global {
-    .D6RTit {
-      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;
-      }
-    }
-    .ant-table-cell {
-      padding: 8px !important;
-    }
-  }
-}

+ 0 - 44
src/pages/D_storeManage/D6putsStor/D6impRelation/index.tsx

@@ -1,44 +0,0 @@
-import React, { useMemo } from 'react'
-import styles from './index.module.scss'
-import MyTable from '@/components/MyTable'
-import { D4tableC } from '@/utils/tableData'
-import { Button } from 'antd'
-import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
-
-type Props = {
-  list: FourTableType[]
-}
-
-function D6impRelation({ list }: Props) {
-  const tableLastBtn2 = useMemo(() => {
-    return [
-      {
-        title: '操作',
-        render: (item: any) => {
-          return (
-            <Button
-              size='small'
-              type='text'
-              onClick={() => {
-                window.open(`/#/impStor_edit/4/${item.id}`, '_blank')
-              }}
-            >
-              查看
-            </Button>
-          )
-        }
-      }
-    ]
-  }, [])
-
-  return (
-    <div className={styles.D6impRelation} hidden={list.length === 0}>
-      <div className='D6RTit'>相关入库单</div>
-      <MyTable list={list} columnsTemp={D4tableC} lastBtn={tableLastBtn2} pagingInfo={false} />
-    </div>
-  )
-}
-
-const MemoD6impRelation = React.memo(D6impRelation)
-
-export default MemoD6impRelation

+ 0 - 26
src/pages/D_storeManage/D6putsStor/index.module.scss

@@ -1,30 +1,4 @@
 .D6putsStor {
-  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;
-      }
-    }
-    .ant-table-cell {
-      padding: 8px !important;
-    }
   }
 }

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

@@ -1,320 +1,10 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import React from 'react'
 import styles from './index.module.scss'
-import { Button, DatePicker, Input, Select } from 'antd'
-import dayjs from 'dayjs'
-import MyTable from '@/components/MyTable'
-import { D6tableC, statusObj } from '@/utils/tableData'
-import MyPopconfirm from '@/components/MyPopconfirm'
-import history, { btnFlagFu } from '@/utils/history'
-import { selectObj } from '@/utils/select'
-import { D3baseFormData } from '../D4impStor'
-import { useDispatch, useSelector } from 'react-redux'
-import { D2_APIgetList } from '@/store/action/D2storSet'
-import { RootState } from '@/store'
-import { MessageFu } from '@/utils/message'
-import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
-import ExportJsonExcel from 'js-export-excel'
-import { D6_APIdel, D6_APIgetList } from '@/store/action/D6putsStor'
-import { B3_4inputKeyArr, D3InputKeyType } from '@/pages/B_enterTibet/B1collect/data'
-const { RangePicker } = DatePicker
-
 function D6putsStor() {
-  const dispatch = useDispatch()
-
-  // 获取出库库房下拉框 - 库房设置列表
-  useEffect(() => {
-    dispatch(D2_APIgetList({ pageNum: 1, pageSize: 99999 }))
-  }, [dispatch])
-
-  const { list } = useSelector((state: RootState) => state.D2storSet.tableInfo)
-
-  const [formData, setFormData] = useState(D3baseFormData)
-  const formDataRef = useRef(D3baseFormData)
-  const formDataOldRef = useRef(D3baseFormData)
-
-  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(D6_APIgetList(formDataRef.current))
-  }, [dispatch])
-
-  useEffect(() => {
-    getListFu()
-  }, [getListFu, timeKey])
-
-  // 输入框的改变
-  const txtChangeFu = useCallback(
-    (txt: string, key: D3InputKeyType) => {
-      setFormData({
-        ...formData,
-        [key]: txt
-      })
-    },
-    [formData]
-  )
-
-  // 点击重置
-  const resetSelectFu = useCallback(() => {
-    setFormData(D3baseFormData)
-    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 D6_APIdel(id)
-      if (res.code === 0) {
-        MessageFu.success('删除成功')
-        getListFu()
-      }
-    },
-    [getListFu]
-  )
-
-  // 点击操作按钮
-  const tableBtnFu = useCallback((id: number, key: string) => {
-    history.push(`/putsStor_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.D6putsStor.tableInfo)
-
-  // 点击导出
-  const deriveFu = useCallback(async () => {
-    const name = '藏品出库' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
-
-    const res = await D6_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],
-              isReturn: v.isReturn === 1 ? '是' : '否',
-              returnDate: v.returnDate || '(空)'
-            })),
-            sheetName: name,
-            sheetFilter: [
-              'num',
-              'name',
-              'storageName',
-              'isReturn',
-              'returnDate',
-              'deptName',
-              'creatorName',
-              'createTime',
-              'status'
-            ],
-            sheetHeader: [
-              '业务单号',
-              '申请名称',
-              '入库库房',
-              '是否需要归还',
-              '预计归还日期',
-              '发起部门',
-              '发送人',
-              '发起日期',
-              '申请状态'
-            ],
-            columnWidths: [10, 10, 10, 10, 10, 10, 10, 10, 10]
-          }
-        ]
-      }
-
-      const toExcel = new ExportJsonExcel(option) //new
-      toExcel.saveExcel() //保存
-    }
-  }, [])
-
   return (
     <div className={styles.D6putsStor}>
       <div className='pageTitle'>藏品出库</div>
-
-      <div className='D4top'>
-        <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>
-        <div className='D4toprr'>
-          <Button type='primary' onClick={deriveFu}>
-            批量导出
-          </Button>
-          &emsp;
-          <Button type='primary' onClick={() => history.push('/putsStor_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>
-            {/* 拿库房设置的列表 */}
-            <Select
-              allowClear={true}
-              placeholder='全部'
-              style={{ width: 150 }}
-              value={formData.storageInId}
-              onChange={e => setFormData({ ...formData, storageInId: e })}
-              fieldNames={{ value: 'id', label: 'name' }}
-              options={list}
-            />
-          </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={D6tableC}
-        lastBtn={tableLastBtn}
-        pageNum={formData.pageNum}
-        pageSize={formData.pageSize}
-        total={tableInfo.total}
-        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
-      />
+      <p>待开发</p>
     </div>
   )
 }

+ 11 - 0
src/pages/D_storeManage/D8cancel/D8edit/index.tsx

@@ -29,6 +29,7 @@ import ZupFileTable from '@/components/ZupFileTable'
 import ZGaddNow from '@/components/ZGaddNow'
 import classNames from 'classnames'
 import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+import { API_goodsInfo } from '@/store/action/C1ledger'
 
 const tableArrTemp = [
   { name: '注销后去向', key: 'txt1' },
@@ -55,6 +56,16 @@ function D8edit() {
     const res = await D8_APIcreate()
     if (res.code === 0) {
       setTopInfo(res.data)
+
+      // 从藏品详情点击按钮进来
+      const urlAll = window.location.href
+      if (urlAll.includes('?id=')) {
+        const urlId = urlAll.split('?id=')[1]
+        const res2 = await API_goodsInfo(Number(urlId))
+        if (res2.code === 0) {
+          setSnaps([res2.data])
+        }
+      }
     }
   }, [])
 

+ 17 - 2
src/pages/E_goodsStorage/E1accident/E1edit/index.tsx

@@ -27,6 +27,7 @@ import {
 import { EXbtnFu } from '@/utils/EXBtn'
 import ZflowTable from '@/components/ZflowTable'
 import ZupFileTable from '@/components/ZupFileTable'
+import { API_goodsInfo } from '@/store/action/C1ledger'
 function E1edit() {
   const { key, id } = useParams<any>()
   // key:1 新增 2编辑 3审批 4查看
@@ -60,9 +61,23 @@ function E1edit() {
   const creatFu = useCallback(async () => {
     const res = await E1_APIcreate()
     if (res.code === 0) {
-      setTopInfo(res.data)
+      const obj = res.data
+
+      // 从藏品详情点击按钮进来
+      const urlAll = window.location.href
+      if (urlAll.includes('?id=')) {
+        const urlId = urlAll.split('?id=')[1]
+        const res2 = await API_goodsInfo(Number(urlId))
+        if (res2.code === 0) {
+          obj.numName = res2.data.numName
+          numNameChangeFu(res2.data.numName)
+
+          obj.goodsIds = urlId
+          setTopInfo(obj)
+        }
+      } else setTopInfo(obj)
     }
-  }, [])
+  }, [numNameChangeFu])
 
   // 获取详情
   const getInfoFu = useCallback(async () => {

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

@@ -1,130 +0,0 @@
-.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;
-    }
-  }
-}

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

@@ -1,569 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
-import styles from './index.module.scss'
-import { useParams } from 'react-router-dom'
-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, openGoodsInfoFu } from '@/utils/history'
-import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
-import classNames from 'classnames'
-import dayjs from 'dayjs'
-import { Button, DatePicker, Input, Select } from 'antd'
-import MyPopconfirm from '@/components/MyPopconfirm'
-import ZGaddNow from '@/components/ZGaddNow'
-import { EXbtnFu } from '@/utils/EXBtn'
-import X3auditInfo from '@/pages/X_stock/X3auditInfo'
-import { D4goodsTableC, statusObj } from '@/utils/tableData'
-import Z3upFiles from '@/components/Z3upFiles'
-import ZRichTexts from '@/components/ZRichTexts'
-import MyTable from '@/components/MyTable'
-import ZflowTable from '@/components/ZflowTable'
-import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
-import ZupFileTable from '@/components/ZupFileTable'
-import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
-import { B3aForm1 } from '@/pages/B_enterTibet/B1collect/data'
-
-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 getInfoFu = useCallback(async () => {
-    const res = await E2_APIgetInfo(id)
-    if (res.code === 0) {
-      setTopInfo(res.data)
-
-      // 设置富文本
-      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 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 item.siteStr ? item.siteStr.replaceAll(',', ' / ') : '(空)'
-        }
-      },
-      {
-        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, topInfo])
-
-  // 新增和从已关注的藏品中添加
-  const [nowSta, setNowSta] = useState({ key: '', id: '' })
-
-  // 查看的按钮创建-提交-撤回
-  const lookBtnFu = useCallback(
-    async (val: '创建' | '提交' | '撤回') => {
-      if (val !== '撤回') {
-        if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
-          return MessageFu.warning('请添加藏品')
-        }
-      }
-
-      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,
-          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])
-
-  // 申请记录
-  const [auditsShow, setAuditsShow] = useState(false)
-
-  return (
-    <div className={styles.E2edit}>
-      <div className='pageTitle'>残损登记-{pageTitTxt}</div>
-
-      <div className='E2main' ref={sollrDom}>
-        {['3'].includes(key) ? (
-          <X3auditInfo
-            dirCode='E2damaged'
-            myUrl='cms/goodsFile/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}
-                fromData={{ moduleId: topInfo.id }}
-              />
-            </div>
-          </div>
-
-          <div className='E2row E2rowFull'>
-            <div className='E2rowll'>备注:</div>
-            <div className='E2rowrr'>
-              <ZRichTexts
-                check={false}
-                dirCode='E2damaged'
-                myUrl='cms/goodsFile/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>
-
-        {/* 申请流程 */}
-        {auditsShow ? (
-          <ZflowTable 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>
-
-      {/* 底部按钮 */}
-      <div className='E2btn'>
-        {['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('/damaged')} />
-          </>
-        )}
-      </div>
-
-      {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
-
-      {nowSta.id ? (
-        <ZGaddNow
-          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

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

@@ -1,35 +0,0 @@
-.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;
-    }
-  }
-}

+ 0 - 331
src/pages/E_goodsStorage/E2damaged/index.tsx

@@ -1,331 +0,0 @@
-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/B1collect/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/B1collect/data'
-import { selectObj } from '@/utils/select'
-import MyTable from '@/components/MyTable'
-const { RangePicker } = DatePicker
-
-export 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>
-      <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>
-  )
-}
-
-const MemoE2damaged = React.memo(E2damaged)
-
-export default MemoE2damaged

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

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

+ 0 - 126
src/pages/E_goodsStorage/E3actuality/E3edit/index.module.scss

@@ -1,130 +1,4 @@
 .E3edit {
-  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;
-    }
   }
 }

+ 2 - 559
src/pages/E_goodsStorage/E3actuality/E3edit/index.tsx

@@ -1,566 +1,9 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import React from 'react'
 import styles from './index.module.scss'
-import { useParams } from 'react-router-dom'
-import {
-  E3_APIcreate,
-  E3_APIdel,
-  E3_APIgetInfo,
-  E3_APIrevocation,
-  E3_APIsaveApply,
-  E3_APIsaveAudit,
-  E3_APIsaveCreate,
-  E3_APIsaveDraft
-} from '@/store/action/E3actuality'
-import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
-import dayjs from 'dayjs'
-import { MessageFu } from '@/utils/message'
-import history, { btnFlagFu2, openGoodsInfoFu } from '@/utils/history'
-import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
-import classNames from 'classnames'
-import { Button, DatePicker, Input, Select } from 'antd'
-import MyPopconfirm from '@/components/MyPopconfirm'
-import { EXbtnFu } from '@/utils/EXBtn'
-import X3auditInfo from '@/pages/X_stock/X3auditInfo'
-import { D4goodsTableC, statusObj } from '@/utils/tableData'
-import Z3upFiles from '@/components/Z3upFiles'
-import ZRichTexts from '@/components/ZRichTexts'
-import MyTable from '@/components/MyTable'
-import ZflowTable from '@/components/ZflowTable'
-import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
-import ZGaddNow from '@/components/ZGaddNow'
-import ZupFileTable from '@/components/ZupFileTable'
-import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
-import { B3aForm1 } from '@/pages/B_enterTibet/B1collect/data'
-
 function E3edit() {
-  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 E3_APIcreate()
-    if (res.code === 0) {
-      setTopInfo(res.data)
-    }
-  }, [])
-
-  // 获取详情
-  const getInfoFu = useCallback(async () => {
-    const res = await E3_APIgetInfo(id)
-    if (res.code === 0) {
-      setTopInfo(res.data)
-
-      // 设置富文本
-      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 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 E3_APIsaveAudit({
-          orderId: topInfo.id,
-          rtfOpinion: rtf2,
-          status: auditSta === '同意' ? 1 : 2
-        })
-
-        if (res.code === 0) {
-          MessageFu.success('审批成功')
-          // 跳详情页
-          history.push(`/actuality_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 E3_APIsaveDraft(obj)
-          if (res.code === 0) {
-            MessageFu.success('草稿保存成功')
-          }
-        } else {
-          const res = val === '创建' ? await E3_APIsaveCreate(obj) : await E3_APIsaveApply(obj)
-          if (res.code === 0) {
-            MessageFu.success(`${val}成功`)
-            // 跳到详情页
-            history.push(`/actuality_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 item.siteStr ? item.siteStr.replaceAll(',', ' / ') : '(空)'
-        }
-      },
-      {
-        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, topInfo])
-
-  // 新增和从已关注的藏品中添加
-  const [nowSta, setNowSta] = useState({ key: '', id: '' })
-
-  // 查看的按钮创建-提交-撤回
-  const lookBtnFu = useCallback(
-    async (val: '创建' | '提交' | '撤回') => {
-      if (val !== '撤回') {
-        if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
-          return MessageFu.warning('请添加藏品')
-        }
-      }
-
-      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,
-          siteId: v.siteId
-        }))
-      }
-
-      const res =
-        val === '创建'
-          ? await E3_APIsaveCreate(obj)
-          : val === '提交'
-          ? await E3_APIsaveApply(obj)
-          : await E3_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 E3_APIdel(id)
-    if (res.code === 0) {
-      MessageFu.success('删除成功')
-      history.push('/actuality')
-    }
-  }, [id])
-
-  // 查看模式点击审批 编辑
-  const lookJumpFu = useCallback(
-    (val: '审批' | '编辑') => {
-      history.push(`/actuality_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('/actuality')}>返回</Button>
-      </>
-    )
-  }, [delFu, lookBtnFu, lookJumpFu, topInfo])
-
-  // 申请记录
-  const [auditsShow, setAuditsShow] = useState(false)
-
   return (
     <div className={styles.E3edit}>
-      <div className='pageTitle'>现状登记-{pageTitTxt}</div>
-      <div className='E2main' ref={sollrDom}>
-        {['3'].includes(key) ? (
-          <X3auditInfo
-            dirCode='E3actuality'
-            myUrl='cms/goodsFile/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='E3actuality'
-                myUrl='cms/orderPreserveCurrent/upload'
-                lookData={topInfo.files || []}
-                size={500}
-                fromData={{ moduleId: topInfo.id }}
-              />
-            </div>
-          </div>
-
-          <div className='E2row E2rowFull'>
-            <div className='E2rowll'>备注:</div>
-            <div className='E2rowrr'>
-              <ZRichTexts
-                check={false}
-                dirCode='E3actuality'
-                myUrl='cms/goodsFile/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/orderPreserveCurrent/goods/getList'
-                    })
-                  }
-                >
-                  新增
-                </Button>
-              )}
-            </div>
-          </div>
-
-          {/* 表格 */}
-          <MyTable
-            list={topInfo.goods || []}
-            columnsTemp={D4goodsTableC}
-            startBtn={startBtn}
-            lastBtn={tableLastBtn}
-            pagingInfo={false}
-          />
-        </div>
-
-        {/* 申请流程 */}
-        {auditsShow ? (
-          <ZflowTable 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>
-
-      {/* 底部按钮 */}
-      <div className='E2btn'>
-        {['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('/actuality')} />
-          </>
-        )}
-      </div>
-
-      {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
-
-      {nowSta.id ? (
-        <ZGaddNow
-          nowSta={nowSta}
-          closeFu={() => setNowSta({ key: '', id: '' })}
-          dataResFu={data => setTopInfo({ ...topInfo, goods: data })}
-          oldCheckArr={topInfo.goods || []}
-          // 待完善
-          // canObj={{ storageId: topInfo.storageId }}
-        />
-      ) : null}
+      <h1>E3edit</h1>
     </div>
   )
 }

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

@@ -1,35 +1,4 @@
 .E3actuality {
-  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;
-    }
   }
 }

+ 2 - 307
src/pages/E_goodsStorage/E3actuality/index.tsx

@@ -1,314 +1,9 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import React from 'react'
 import styles from './index.module.scss'
-import { Button, DatePicker, Input, Select } from 'antd'
-import { useDispatch, useSelector } from 'react-redux'
-import { E2baseFormData } from '../E2damaged'
-import { E3_APIdel, E3_APIgetList } from '@/store/action/E3actuality'
-import { E2InputKeyType } from '../E2damaged/type'
-import { MessageFu } from '@/utils/message'
-import history, { btnFlagFu } from '@/utils/history'
-import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
-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/B1collect/data'
-import { selectObj } from '@/utils/select'
-import MyTable from '@/components/MyTable'
-const { RangePicker } = DatePicker
-
 function E3actuality() {
-  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(E3_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 E3_APIdel(id)
-      if (res.code === 0) {
-        MessageFu.success('删除成功')
-        getListFu()
-      }
-    },
-    [getListFu]
-  )
-
-  // 点击操作按钮
-  const tableBtnFu = useCallback((id: number, key: string) => {
-    history.push(`/actuality_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.E3actuality.tableInfo)
-
-  // 点击导出
-  const deriveFu = useCallback(async () => {
-    const name = '现状登记' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
-
-    const res = await E3_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.E3actuality}>
-      <div className='pageTitle'>现状登记</div>
-      <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('/actuality_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)}
-      />
+      <h1>E3actuality</h1>
     </div>
   )
 }

+ 10 - 0
src/pages/E_goodsStorage/E4repair/E4edit/index.tsx

@@ -31,6 +31,7 @@ import ZflowTable from '@/components/ZflowTable'
 import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
 import ZGaddNow from '@/components/ZGaddNow'
 import ZupFileTable from '@/components/ZupFileTable'
+import { API_goodsInfo } from '@/store/action/C1ledger'
 
 const tableArrTemp = [
   { name: '损坏情况', key: 'txt1' },
@@ -57,6 +58,15 @@ function E4edit() {
     const res = await E4_APIcreate()
     if (res.code === 0) {
       setTopInfo(res.data)
+      // 从藏品详情点击按钮进来
+      const urlAll = window.location.href
+      if (urlAll.includes('?id=')) {
+        const urlId = urlAll.split('?id=')[1]
+        const res2 = await API_goodsInfo(Number(urlId))
+        if (res2.code === 0) {
+          setSnaps([res2.data])
+        }
+      }
     }
   }, [])
 

+ 91 - 25
src/pages/Y_goodsDetails/Y2look/index.tsx

@@ -4,7 +4,6 @@ import { useParams } from 'react-router-dom'
 import { Y1tabArr, Y1TabArrType } from '../Y1cathet/Y1main'
 import classNames from 'classnames'
 import { Button, Dropdown, MenuProps } from 'antd'
-import MyPopconfirm from '@/components/MyPopconfirm'
 import Y11com from '../Y1cathet/Y11com'
 import Y22com from '../Y1cathet/Y22com'
 import Y33com from '../Y1cathet/Y33com'
@@ -16,6 +15,7 @@ import { API_goodFileList } from '@/store/action/C2files'
 import { C3_APIfocus, C3_APIfocusNo } from '@/store/action/C3focus'
 import { MessageFu } from '@/utils/message'
 import C22revamp from '@/pages/C_goodsManage/C22goodEdit/C22revamp'
+import history from '@/utils/history'
 
 function Y2look() {
   const { id: sId } = useParams<any>()
@@ -48,12 +48,12 @@ function Y2look() {
 
   const [tabAc, setTabAc] = useState<Y1TabArrType>('藏品信息')
 
-  // 待完善 各种按钮跳转等等
   const items1 = useMemo(() => {
     let arr: MenuProps['items'] = [
       {
         key: '1',
         label: (
+          // 待完善 过滤
           <span className='Y2xia' onClick={() => setIsEdit(true)}>
             编辑
           </span>
@@ -62,60 +62,126 @@ function Y2look() {
       {
         key: '2',
         label: (
-          <MyPopconfirm
-            txtK='删除'
-            onConfirm={() => {}}
-            Dom={<span className='Y2xia'>删除</span>}
-          />
+          <span
+            style={{ color: '#ff4d4d' }}
+            className='Y2xia'
+            onClick={() => {
+              if ([2, 3, 4].includes(info.statusCollect)) {
+                history.push(`/cancel_edit/1/null?id=${sId}`)
+              } else MessageFu.warning('待完善')
+            }}
+          >
+            注销
+          </span>
         )
       }
     ]
+
     return arr
-  }, [])
+  }, [info.statusCollect, sId])
 
   const items2 = useMemo(() => {
     let arr: MenuProps['items'] = [
       {
         key: '1',
-        label: <span className='Y2xia'>入库</span>
+        label: (
+          <span
+            className='Y2xia'
+            onClick={() => {
+              if (1 + 1 === 2) {
+                history.push(`/impStor_edit/1/null?id=${sId}`)
+              } else MessageFu.warning('待完善')
+            }}
+          >
+            入库
+          </span>
+        )
       },
       {
         key: '2',
-        label: <span className='Y2xia'>移库</span>
+        label: (
+          <span
+            className='Y2xia'
+            onClick={() => {
+              if (1 + 1 === 2) {
+                history.push(`/moveStor_edit/1/null?id=${sId}`)
+              } else MessageFu.warning('待完善')
+            }}
+          >
+            移库
+          </span>
+        )
       },
       {
         key: '3',
-        label: <span className='Y2xia'>出库</span>
-      },
-      {
-        key: '4',
-        label: <span className='Y2xia'>注销</span>
+        label: (
+          <span
+            className='Y2xia'
+            onClick={() => {
+              if (1 + 1 === 2) {
+                history.push(`/putsStor_edit/1/null?id=${sId}`)
+              } else MessageFu.warning('待完善')
+            }}
+          >
+            出库
+          </span>
+        )
       }
     ]
     return arr
-  }, [])
+  }, [sId])
 
   const items3 = useMemo(() => {
     let arr: MenuProps['items'] = [
       {
         key: '1',
-        label: <span className='Y2xia'>事故登记</span>
-      },
-      {
-        key: '2',
-        label: <span className='Y2xia'>残损登记</span>
+        label: (
+          <span
+            className='Y2xia'
+            onClick={() => {
+              if (1 + 1 === 2) {
+                history.push(`/accident_edit/1/null?id=${sId}`)
+              } else MessageFu.warning('待完善')
+            }}
+          >
+            事故登记
+          </span>
+        )
       },
+
       {
         key: '3',
-        label: <span className='Y2xia'>现状登记</span>
+        label: (
+          <span
+            className='Y2xia'
+            onClick={() => {
+              if (1 + 1 === 2) {
+                history.push(`/actuality_edit/1/null?id=${sId}`)
+              } else MessageFu.warning('待完善')
+            }}
+          >
+            现状登记
+          </span>
+        )
       },
       {
         key: '4',
-        label: <span className='Y2xia'>文物修复</span>
+        label: (
+          <span
+            className='Y2xia'
+            onClick={() => {
+              if (1 + 1 === 2) {
+                history.push(`/repair_edit/1/null?id=${sId}`)
+              } else MessageFu.warning('待完善')
+            }}
+          >
+            文物修复
+          </span>
+        )
       }
     ]
     return arr
-  }, [])
+  }, [sId])
 
   // 点击关注
   const focusFu = useCallback(
@@ -165,7 +231,7 @@ function Y2look() {
           {info.display === 1 ? (
             <>
               <Button type='primary' onClick={handleExport}>
-                藏品卡片
+                导出藏品档案
               </Button>
               &emsp;
               <Dropdown menu={{ items: items1 }} placement='bottom' arrow>

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

@@ -21,7 +21,7 @@ export const API_goodsInfo = (id: number) => {
  * 藏品-弹窗-选择藏品
  */
 export const API_goodsNowAdd = (url: string, data: any) => {
-  return http.get(url, data)
+  return http.post(url, data)
 }
 
 /**

+ 3 - 2
src/utils/select.ts

@@ -59,9 +59,10 @@ export const selectObj = {
     { value: 0, label: '禁用' }
   ],
   入藏状态: [
-    { value: 1, label: '已鉴定' },
+    // { value: 1, label: '已鉴定' },
     { value: 2, label: '已入馆' },
-    { value: 3, label: '已入藏' }
+    { value: 3, label: '已入藏' },
+    { value: 4, label: '已登记' }
   ],
   线索类别: [
     { value: '民间征集', label: '民间征集' },

+ 14 - 3
src/utils/tableData.ts

@@ -139,6 +139,7 @@ export const B3FtableC = [
 
 export const D1GtableC = [
   ['txt', '编号类型', 'numName'],
+  ['txt', '库位号', 'siteNum'],
   // ['img', '封面图', 'thumb'],
   ['txt', '藏品名称', 'name'],
   ['ping', '数量', 'pcs', 'pcsUnit'],
@@ -228,9 +229,9 @@ export const D2tableCSon = [
 ]
 
 export const D4tableC = [
-  ['txt', '业务单号', 'num'],
-  ['txt', '申请名称', 'name'],
-  ['txt', '入库库房', 'storageName'],
+  ['txt', '入库日期', 'date'],
+  ['txt', '入库单编号', 'num'],
+  ['txt', '分库缩写', 'sonNum'],
   ['txt', '发起部门', 'deptName'],
   ['txt', '发送人', 'creatorName'],
   ['txt', '发起日期', 'createTime'],
@@ -249,6 +250,7 @@ export const D6tableC = [
   ['txtChange', '申请状态', 'status', statusObj]
 ]
 
+// 旧版的入库里面的表单 -太多地方用了 不改了
 export const D4goodsTableC = [
   ['img', '封面图', 'thumb'],
   ['txt', '编号类型', 'numName'],
@@ -256,6 +258,15 @@ export const D4goodsTableC = [
   ['ping', '数量', 'pcs', 'pcsUnit'],
   ['txtChange', '库存状态', 'statusStorage', statusStorageObj]
 ]
+// 新版的入库里面的表单
+export const D4tableCgoods = [
+  ['txt', '名称', 'name'],
+  ['txtC', '年代', 'dictAge'],
+  ['ping', '数量', 'pcs', 'pcsUnit'],
+  ['size', '尺寸', 'sizeUnit'],
+  ['ping', '重量', 'quality', 'qualityUnit'],
+  ['txtC', '完残情况', 'dictTorn']
+]
 
 export const D8tableC = [
   ['txt', '业务单号', 'num'],