shaogen1995 преди 4 месеца
родител
ревизия
899c5d4e9c

+ 14 - 1
src/components/ZRichTexts/index.module.scss

@@ -57,9 +57,15 @@
       }
 
       .bf-content {
-        height: 300px;
+        height: auto;
+        max-height: 300px;
         padding-bottom: 0px;
       }
+      .fullscreen {
+        .bf-content {
+          max-height: 3000px;
+        }
+      }
 
       .bf-controlbar {
         position: relative;
@@ -191,5 +197,12 @@
     }
 
     // .bf-video-wrap
+    // 折叠菜单 高度问题
+    .bf-dropdown .dropdown-content {
+      display: none;
+    }
+    .bf-dropdown.active .dropdown-content {
+      display: block;
+    }
   }
 }

+ 0 - 18
src/pages/B_enterTibet/B3_4page/B3add/B3aTop/index.module.scss

@@ -3,23 +3,6 @@
   height: calc(100% - 70px);
   overflow-y: auto;
   :global {
-    // 审批和查看才有的
-    .B3aAudit {
-      .B3aRow0 {
-        margin-top: 24px;
-        .ant-btn {
-          margin-right: 30px;
-        }
-        .B3aTit {
-          // border-bottom: none;
-          margin: 0;
-        }
-        .B3aFull {
-          margin-top: 15px !important;
-        }
-      }
-    }
-
     .B3aTit {
       font-size: 18px;
       font-weight: 700;
@@ -39,7 +22,6 @@
       align-items: self-start;
       font-size: 16px;
       flex-wrap: wrap;
-      overflow: hidden;
       .B3aR1 {
         width: 48%;
         display: flex;

+ 11 - 42
src/pages/B_enterTibet/B3_4page/B3add/B3aTop/index.tsx

@@ -7,6 +7,7 @@ import Z3upFiles from '@/components/Z3upFiles'
 import ZRichTexts from '@/components/ZRichTexts'
 import { forwardRef, useImperativeHandle } from 'react'
 import { TypeB3PageSta } from '../../type'
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
 
 type Props = {
   info: any
@@ -27,17 +28,22 @@ function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
   // 富文本的ref
   const ZRichTextRef = useRef<any>(null)
 
-  // 审批意见的ref
-  const ZRiAuditRef = useRef<any>(null)
-
   // 设置富文本
   //  ZRichTextRef.current?.ritxtShowFu(JSON.parse(data.rtf))
   // const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
   // rtf: JSON.stringify(rtf.val || ''),
 
-  // 可以让父组件调用子组件的方法
+  // 审批意见的ref
+  const ZAuditRef = useRef<any>(null)
 
+  // 可以让父组件调用子组件的方法
   const resData = useCallback(() => {
+    const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+    console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
+
+    const rtf2 = ZAuditRef.current?.resData()
+    console.log('审批信息富文本', rtf2)
+
     return { xxx: 'xxxx' }
   }, [])
 
@@ -51,44 +57,7 @@ function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
   return (
     <div className={styles.B3aTop} id='B3aTop'>
       {['审批'].includes(pageSta) ? (
-        <div className='B3aAudit'>
-          <div className='B3aTit'>
-            审批信息<Button type='dashed'>待审批</Button>
-          </div>
-
-          <div className='B3aRow B3aRow0'>
-            <div className='B3aR1'>
-              <div className='B3aRll'>
-                <span> * </span> 审批结果:
-              </div>
-              <div className='B3aRrr'>
-                {['同意', '不同意'].map(v => (
-                  <Button
-                    key={v}
-                    type={v === auditSta ? 'primary' : 'default'}
-                    onClick={() => setAuDitSta(v)}
-                  >
-                    {v}
-                  </Button>
-                ))}
-              </div>
-            </div>
-            <div className='B3aR1 B3aFull'>
-              <div className='B3aRll'>审批意见:</div>
-              <div className='B3aRrr'>
-                <ZRichTexts
-                  check={false}
-                  dirCode={'xxxxxxxx'}
-                  isLook={false}
-                  ref={ZRiAuditRef}
-                  myUrl='xxxxxxxxxx'
-                  isOne={true}
-                  upAudioBtnNone={true}
-                />
-              </div>
-            </div>
-          </div>
-        </div>
+        <X3auditInfo auditSta={auditSta} auditStaFu={val => setAuDitSta(val)} ref={ZAuditRef} />
       ) : null}
 
       <div className='B3aTit'>

+ 3 - 3
src/pages/B_enterTibet/B3_4page/index.tsx

@@ -9,7 +9,7 @@ import { B3tableC } from '@/utils/tableData'
 import history from '@/utils/history'
 const { RangePicker } = DatePicker
 
-type InputKeyType = 'aaaa' | 'bbbb' | 'cccc' | 'dddd'
+export type D3InputKeyType = 'aaaa' | 'bbbb' | 'cccc' | 'dddd'
 
 const objUrl = {
   入馆: '/entering',
@@ -27,7 +27,7 @@ const objKey = {
 
 export const B3_4inputKeyArr: {
   name: string
-  key: InputKeyType
+  key: D3InputKeyType
 }[] = [
   { name: '申请编号', key: 'aaaa' },
   { name: '业务名称', key: 'bbbb' },
@@ -100,7 +100,7 @@ function B34page({ pageSta }: Props) {
 
   // 输入框的改变
   const txtChangeFu = useCallback(
-    (txt: string, key: InputKeyType) => {
+    (txt: string, key: D3InputKeyType) => {
       setFormData({
         ...formData,
         [key]: txt

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

@@ -4,7 +4,7 @@ import { useParams } from 'react-router-dom'
 import MyTable from '@/components/MyTable'
 import { Button } from 'antd'
 import { B3FtableC } from '@/utils/tableData'
-import YtableLookText from '@/components/YtableLookText'
+import X2lookText from '@/pages/X_stock/X2lookText'
 
 function B3flowTable() {
   const { key, id } = useParams<any>()
@@ -41,7 +41,7 @@ function B3flowTable() {
       />
 
       {/* 查看富文本 */}
-      {look ? <YtableLookText closeFu={() => setLook('')} /> : null}
+      {look ? <X2lookText closeFu={() => setLook('')} /> : null}
     </div>
   )
 }

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

@@ -9,6 +9,7 @@ import { openGoodsInfoFu } from '@/utils/history'
 type Props = {
   closeFu: () => void
   nowSta: { key: string; id: string }
+  // key:1=入馆 2=入藏 3-登记 4-删除 5-入库
 }
 
 function B3GaddNow({ nowSta, closeFu }: Props) {

+ 2 - 1
src/pages/D_storeManage/D2storSet/D2edit.tsx

@@ -53,7 +53,8 @@ function D2edit({ sId, succToLookFu, closeFu }: Props) {
     async (values: any) => {
       const res = await D2_APIedit({
         ...values,
-        id: sId > 0 ? sId : null
+        id: sId > 0 ? sId : null,
+        level: 1
       })
       if (res.code === 0) {
         MessageFu.success(sId > 0 ? '编辑成功' : '新增成功')

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

@@ -0,0 +1,126 @@
+.D4edit {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 24px 0px;
+  :global {
+    .D4Tit {
+      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;
+      }
+    }
+    .D4Tit2 {
+      margin-top: 24px;
+      display: flex;
+      justify-content: space-between;
+      padding-bottom: 10px;
+      border-bottom: 1px solid #ccc;
+      margin-bottom: 20px;
+      .D4Tit2ll {
+        font-size: 18px;
+        font-weight: 700;
+        padding-left: 18px;
+        margin-bottom: 17px;
+        color: var(--themeColor);
+      }
+      .D4Tit2rr {
+        position: relative;
+        z-index: 2;
+        .ant-btn {
+          margin-left: 15px;
+        }
+      }
+    }
+
+    .D4main {
+      width: 100%;
+      height: calc(100% - 70px);
+      overflow-y: auto;
+      padding-bottom: 40px;
+
+      .D4rowAll {
+        display: flex;
+        justify-content: space-between;
+        align-items: self-start;
+        font-size: 16px;
+        flex-wrap: wrap;
+        .D4row {
+          width: 48%;
+          display: flex;
+          align-items: center;
+          margin-bottom: 20px;
+          .D4rowll {
+            width: 110px;
+            text-align: right;
+            font-weight: 700;
+            & > span {
+              color: #ff4d4f;
+            }
+          }
+          .D4rowrr {
+            width: calc(100% - 110px);
+            .ant-input-affix-wrapper {
+              width: 300px;
+            }
+            .ant-select {
+              width: 300px;
+            }
+          }
+        }
+        .D4row2 {
+          align-items: self-start;
+          .D4rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+
+        .D4rowFull {
+          width: 100%;
+          margin-top: -20px;
+          align-items: self-start;
+          margin-bottom: 0;
+          .D4rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+      }
+      // 藏品清单
+      .D4googsBox {
+        padding-right: 20px;
+        .D1GtNum {
+          cursor: pointer;
+          text-decoration: underline;
+          // &:hover {
+          //   color: var(--themeColor);
+          // }
+        }
+
+        .D1GtNumAc {
+          color: var(--themeColor);
+        }
+
+        .ant-table-cell {
+          padding: 8px !important;
+        }
+      }
+    }
+
+    .D4btn {
+      position: absolute;
+      bottom: 20px;
+      left: 134px;
+      .ant-btn {
+        margin-right: 20px;
+      }
+    }
+  }
+}

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

@@ -0,0 +1,397 @@
+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 { B3aForm1 } from '@/pages/B_enterTibet/B3_4page/B3add/data'
+import dayjs from 'dayjs'
+import Z3upFiles from '@/components/Z3upFiles'
+import ZRichTexts from '@/components/ZRichTexts'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import history, { openGoodsInfoFu } 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 } from '@/utils/tableData'
+import B3GaddNow from '@/pages/B_enterTibet/B3goodsTable/B3GaddNow'
+import X1setStoreLocS from '@/pages/X_stock/X1setStoreLocS'
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
+import B3flowTable from '@/pages/B_enterTibet/B3flowTable'
+
+const pageTitTxtObj = {
+  1: '新增',
+  2: '编辑',
+  3: '审批',
+  4: '查看'
+}
+
+function D4edit() {
+  const { key, id } = useParams<any>()
+  // key:1 新增 2编辑 3审批 4查看
+
+  // 滚到顶部
+  const sollrDom = useRef<HTMLDivElement>(null)
+
+  useEffect(() => {
+    console.log('key:', key)
+
+    if (sollrDom.current) sollrDom.current.scrollTop = 0
+  }, [key])
+
+  // 上传附件的ref
+  const filesRef = useRef<any>(null)
+  // const filesRes = filesRef.current.filesIdRes();
+
+  // 富文本的ref
+  const ZRichTextRef = useRef<any>(null)
+
+  // 审批意见的ref
+  const ZAuditRef = useRef<any>(null)
+
+  // 设置富文本
+  //  ZRichTextRef.current?.ritxtShowFu(JSON.parse(data.rtf))
+
+  const pageTitTxt = useMemo(() => {
+    return Reflect.get(pageTitTxtObj, key)
+  }, [key])
+
+  const timeChange = useCallback((e: any) => {
+    console.log(123, e)
+  }, [])
+
+  // 新增的底部按钮点击
+  const btnClickFu = useCallback((val: number) => {
+    const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+    console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
+
+    const rtf2 = ZAuditRef.current?.resData()
+    console.log('审批信息富文本', rtf2)
+
+    if (1 + 1 === 2) return
+
+    if (val === 2) {
+      // 存草稿 当前页保存 不跳转
+      MessageFu.success('草稿保存成功')
+    } else {
+      // 跳到详情页
+      history.push(`/impStor_edit/4/999`)
+    }
+  }, [])
+
+  // 打开侧边栏
+  const [cathet, setCathet] = useState(0)
+
+  // 点击删除
+  const delTableFu = useCallback(async (id: number) => {}, [])
+
+  const startBtn = useMemo(() => {
+    return [
+      {
+        title: '编号类型',
+        render: (item: any) => {
+          return (
+            <span
+              onClick={() => setCathet(item.id)}
+              className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
+            >
+              {item.num}
+            </span>
+          )
+        }
+      }
+    ]
+  }, [cathet])
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '存放位置',
+        render: (item: any) => (
+          <Cascader
+            disabled={['3', '4'].includes(key)}
+            options={[
+              { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
+              { value: '其他', label: '其他' }
+            ]}
+            placeholder='请选择'
+            // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+            allowClear={false}
+          />
+        )
+      },
+      {
+        title: '操作',
+        render: (item: any) => {
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+                查看
+              </Button>
+              {['3', '4'].includes(key) ? null : (
+                <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+              )}
+            </>
+          )
+        }
+      }
+    ]
+  }, [delTableFu, key])
+
+  // 点击新增
+  const [nowSta, setNowSta] = useState({ key: '', id: '' })
+
+  // 点击批量设置存放位置
+  const [setLoc, setSetLoc] = useState(false)
+
+  // 审批的sta
+  const [auditSta, setAuDitSta] = useState('')
+
+  // 查看模式下的按钮 待完善
+  const lookBtn = useMemo(() => {
+    return (
+      <>
+        <Button type='primary'>创建</Button>
+        <Button type='primary'>提交</Button>
+        <MyPopconfirm
+          txtK='撤回'
+          onConfirm={() => {}}
+          Dom={
+            <Button type='primary' danger>
+              撤回
+            </Button>
+          }
+        />
+
+        <Button type='primary'>审批</Button>
+        <Button type='primary'>编辑</Button>
+        <Button type='primary'>重新提交</Button>
+        <Button type='primary'>导出</Button>
+        <MyPopconfirm
+          txtK='删除'
+          onConfirm={() => {}}
+          Dom={
+            <Button type='primary' danger>
+              删除
+            </Button>
+          }
+        />
+        <Button onClick={() => history.push('/impStor')}>返回</Button>
+      </>
+    )
+  }, [])
+
+  return (
+    <div className={styles.D4edit}>
+      <div className='pageTitle'>入库-{pageTitTxt}</div>
+
+      <div className='D4main' ref={sollrDom}>
+        {['3'].includes(key) ? (
+          <X3auditInfo auditSta={auditSta} auditStaFu={val => setAuDitSta(val)} ref={ZAuditRef} />
+        ) : null}
+
+        {/* 表单字段、附件等 */}
+        <div className='D4Tit'>
+          {/* 待完善 */}
+          申请信息
+          <Button type='dashed'>草稿</Button>
+        </div>
+        <div className='D4rowAll'>
+          <div className='D4row'>
+            <div className='D4rowll'>
+              <span> * </span>申请名称:
+            </div>
+            <div className='D4rowrr'>
+              <Input
+                readOnly={['3', '4'].includes(key)}
+                placeholder='请输入内容'
+                maxLength={30}
+                showCount
+              />
+            </div>
+          </div>
+
+          <div className='D4row'>
+            <div className='D4rowll'>
+              <span> * </span>业务类型:
+            </div>
+            <div className='D4rowrr'>
+              <Cascader
+                disabled={['3', '4'].includes(key)}
+                options={[
+                  { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
+                  { value: '其他', label: '其他' }
+                ]}
+                changeOnSelect
+                placeholder='请选择'
+                // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                allowClear={false}
+              />
+            </div>
+          </div>
+
+          {B3aForm1.map(v => (
+            <div className='D4row' key={v.name}>
+              <div className='D4rowll'>{v.name}:</div>
+              <div className='D4rowrr'>
+                这是一段文本
+                {['3', '4'].includes(key) && v.name === '发起人'
+                  ? ' - 查看和审批后面显示创建时间'
+                  : ''}
+              </div>
+            </div>
+          ))}
+
+          <div className='D4row'>
+            <div className='D4rowll'>
+              <span> * </span>相关出库单:
+            </div>
+            <div className='D4rowrr'>
+              <Select disabled={['3', '4'].includes(key)} placeholder='请搜索出库单编码' />
+            </div>
+          </div>
+
+          <div className='D4row'>
+            <div className='D4rowll'>
+              <span> * </span>业务日期:
+            </div>
+            <div className='D4rowrr'>
+              <DatePicker
+                disabled={['3', '4'].includes(key)}
+                allowClear={false}
+                value={dayjs()}
+                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={'xxxxxxx'}
+                myUrl='xxxxxxxxxxxx'
+                lookData={[]}
+                size={500}
+              />
+            </div>
+          </div>
+
+          <div className='D4row'>
+            <div className='D4rowll'>原因事由:</div>
+            <div className='D4rowrr'>
+              <Input
+                readOnly={['3', '4'].includes(key)}
+                placeholder='请输入内容'
+                maxLength={30}
+                showCount
+              />
+            </div>
+          </div>
+
+          <div className='D4row D4rowFull'>
+            <div className='D4rowll'>备注:</div>
+            <div className='D4rowrr'>
+              <ZRichTexts
+                check={false}
+                dirCode={'xxxxxxxx'}
+                isLook={['3', '4'].includes(key)}
+                ref={ZRichTextRef}
+                myUrl='xxxxxxxxxx'
+                isOne={true}
+                upAudioBtnNone={true}
+              />
+            </div>
+          </div>
+        </div>
+
+        <div className='D4Tit'>库房信息</div>
+        <div className='D4rowAll'>
+          <div className='D4row'>
+            <div className='D4rowll'>
+              <span> * </span>入库库房:
+            </div>
+            <div className='D4rowrr'>
+              {/* 待完善 从库房设置列表里面选择 --默认第一个*/}
+              <Select disabled={['3', '4'].includes(key)} placeholder='请选择' />
+            </div>
+          </div>
+          <div className='D4row'>
+            <div className='D4rowll'>库房负责人:</div>
+            <div className='D4rowrr'>这是一段文本</div>
+          </div>
+        </div>
+
+        {/* 藏品清单 */}
+        <div className='D4googsBox'>
+          <div className='D4Tit2'>
+            <div className='D4Tit2ll'>藏品清单</div>
+            <div className='D4Tit2rr'>
+              {['3', '4'].includes(key) ? null : (
+                <>
+                  <Button type='primary' onClick={() => setNowSta({ key: '5', id })}>
+                    新增
+                  </Button>
+                  <Button type='primary' onClick={() => setSetLoc(true)}>
+                    批量设置存放位置
+                  </Button>
+                  <Button type='primary'>自动分配空置库位</Button>
+                </>
+              )}
+            </div>
+          </div>
+
+          {/* 表格 */}
+          <MyTable
+            list={[{ id: 99, thumb: '', num: '一段编号_可点击' }]}
+            columnsTemp={D4goodsTableC}
+            startBtn={startBtn}
+            lastBtn={tableLastBtn}
+            pagingInfo={false}
+          />
+        </div>
+
+        {/* 申请流程 */}
+        {['3', '4'].includes(key) ? <B3flowTable /> : null}
+      </div>
+
+      {/* 底部按钮 */}
+      <div className='D4btn'>
+        {key === '4' ? (
+          lookBtn
+        ) : (
+          <>
+            <Button type='primary' onClick={() => btnClickFu(1)}>
+              {key === '1' ? '创建' : '保存'}
+            </Button>
+
+            {key === '1' ? (
+              <Button type='primary' onClick={() => btnClickFu(2)}>
+                存草稿
+              </Button>
+            ) : null}
+
+            <MyPopconfirm txtK='取消' onConfirm={() => history.push('/impStor')} />
+          </>
+        )}
+      </div>
+
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      {/* 新增弹窗 */}
+      {nowSta.id ? (
+        <B3GaddNow nowSta={nowSta} closeFu={() => setNowSta({ key: '', id: '' })} />
+      ) : null}
+
+      {/* 批量设置存放位置 */}
+      {setLoc ? <X1setStoreLocS closeFu={() => setSetLoc(false)} /> : null}
+    </div>
+  )
+}
+
+const MemoD4edit = React.memo(D4edit)
+
+export default MemoD4edit

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

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

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

@@ -1,10 +1,232 @@
-import React from 'react'
+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 { B3_4inputKeyArr, D3InputKeyType } from '@/pages/B_enterTibet/B3_4page'
+import dayjs from 'dayjs'
+import MyTable from '@/components/MyTable'
+import { D4tableC } from '@/utils/tableData'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import history from '@/utils/history'
+const { RangePicker } = DatePicker
+
+const baseFormData: TypeD4Form = {
+  pageSize: 10,
+  pageNum: 1,
+  aaaa: '',
+  bbbb: '',
+  cccc: '',
+  dddd: '',
+  startTime: '',
+  endTime: '',
+  eeee: '',
+  ffff: '',
+  gggg: ''
+}
+
+// 没有接入后端 待完善
+
 function D4impStor() {
+  const [formData, setFormData] = useState(baseFormData)
+  const formDataRef = useRef(baseFormData)
+
+  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(() => {
+    console.log('发送请求', formDataRef.current)
+  }, [])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu, timeKey])
+
+  // 输入框的改变
+  const txtChangeFu = useCallback(
+    (txt: string, key: D3InputKeyType) => {
+      setFormData({
+        ...formData,
+        [key]: txt
+      })
+    },
+    [formData]
+  )
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setFormData(baseFormData)
+    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) => {
+      getListFu()
+    },
+    [getListFu]
+  )
+
+  // 点击操作按钮
+  const tableBtnFu = useCallback((key: string, id: number) => {
+    history.push(`/impStor_edit/${key}/${id}`)
+  }, [])
+
+  const tableLastBtn = useMemo(() => {
+    //   看状态和账号角色显示按钮 待完善
+    return [
+      {
+        title: '操作',
+        render: (item: any) => {
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => tableBtnFu('2', item.id)}>
+                编辑
+              </Button>
+              <Button size='small' type='text' onClick={() => tableBtnFu('3', item.id)}>
+                审批
+              </Button>
+              <Button size='small' type='text' onClick={() => tableBtnFu('4', item.id)}>
+                查看
+              </Button>
+              <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+            </>
+          )
+        }
+      }
+    ]
+  }, [delTableFu, tableBtnFu])
+
   return (
     <div className={styles.D4impStor}>
       <div className='pageTitle'>入库</div>
-      <p>待开发</p>
+
+      <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'>批量导出</Button>&emsp;
+          <Button type='primary' onClick={() => history.push('/impStor_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
+              placeholder='请选择'
+              style={{ width: 150 }}
+              value={formData.eeee}
+              onChange={e => setFormData({ ...formData, eeee: e })}
+              options={[{ value: '', label: '全部' }]}
+            />
+          </div>
+
+          <div>
+            <span>选择角色:</span>
+            <Select
+              style={{ width: 150 }}
+              placeholder='请选择'
+              options={[]}
+              fieldNames={{ value: 'id', label: 'roleName' }}
+              value={formData.ffff}
+              onChange={e => setFormData({ ...formData, ffff: e })}
+            />
+          </div>
+
+          <div>
+            <span>入库库房:</span>
+            {/* 拿库房设置的列表 */}
+            <Select
+              placeholder='请选择'
+              style={{ width: 150 }}
+              value={formData.gggg}
+              onChange={e => setFormData({ ...formData, gggg: e })}
+              options={[{ value: '', label: '全部' }]}
+            />
+          </div>
+        </div>
+        <div className='D4toprr'>
+          <Button type='primary' onClick={clickSearch}>
+            查询
+          </Button>
+          &emsp;<Button onClick={resetSelectFu}>重置</Button>
+        </div>
+      </div>
+
+      {/* 表格 */}
+      <MyTable
+        yHeight={610}
+        list={[{ id: 66 }]}
+        columnsTemp={D4tableC}
+        lastBtn={tableLastBtn}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={0}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+      />
     </div>
   )
 }

+ 13 - 0
src/pages/D_storeManage/D4impStor/type.d.ts

@@ -0,0 +1,13 @@
+export type TypeD4Form = {
+  pageSize: number
+  pageNum: number
+  aaaa: string
+  bbbb: string
+  cccc: string
+  dddd: string
+  startTime: string
+  endTime: string
+  eeee: string
+  ffff: string
+  gggg: string
+}

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

@@ -125,19 +125,19 @@ const tabLeftArr: RouterType = [
         name: '库房设置',
         path: '/storSet',
         Com: React.lazy(() => import('../D_storeManage/D2storSet'))
-      }
+      },
       // {
       //   id: 430,
       //   name: '人员出入库',
       //   path: '/staff',
       //   Com: React.lazy(() => import('../D_storeManage/D3staff'))
       // },
-      // {
-      //   id: 440,
-      //   name: '入库',
-      //   path: '/impStor',
-      //   Com: React.lazy(() => import('../D_storeManage/D4impStor'))
-      // },
+      {
+        id: 440,
+        name: '入库',
+        path: '/impStor',
+        Com: React.lazy(() => import('../D_storeManage/D4impStor'))
+      }
       // {
       //   id: 450,
       //   name: '移库',
@@ -149,7 +149,7 @@ const tabLeftArr: RouterType = [
       //   name: '出库',
       //   path: '/putsStor',
       //   Com: React.lazy(() => import('../D_storeManage/D6putsStor'))
-      // },
+      // }
       // {
       //   id: 470,
       //   name: '盘点',
@@ -376,5 +376,12 @@ export const routerSon: RouterTypeRow = [
     name: '藏品删除-查看',
     path: '/delete_look/:key/:id',
     Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit/look'))
+  },
+  // -------------入库-----------------
+  {
+    id: 103,
+    name: '入库-新增/编辑/审批/查看',
+    path: '/impStor_edit/:key/:id',
+    Com: React.lazy(() => import('../D_storeManage/D4impStor/D4edit'))
   }
 ]

+ 23 - 0
src/pages/X_stock/X1setStoreLocS/index.module.scss

@@ -0,0 +1,23 @@
+.X1setStoreLocS {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    // .ant-modal {
+    //   width: 800px !important;
+    // }
+
+    .X1Main {
+      border-top: 1px solid #999999;
+      width: 100%;
+      overflow-y: auto;
+      text-align: center;
+      padding: 30px 0;
+    }
+    .X1Btn {
+      margin-top: 20px;
+      text-align: center;
+    }
+  }
+}

+ 43 - 0
src/pages/X_stock/X1setStoreLocS/index.tsx

@@ -0,0 +1,43 @@
+import React from 'react'
+import styles from './index.module.scss'
+import { Button, Cascader, Modal } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+
+type Props = {
+  closeFu: () => void
+}
+
+function X1setStoreLocS({ closeFu }: Props) {
+  return (
+    <Modal
+      wrapClassName={styles.X1setStoreLocS}
+      destroyOnClose
+      open={true}
+      title='批量设置存放位置'
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='X1Main'>
+        <Cascader
+          style={{ width: 300 }}
+          options={[
+            { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
+            { value: '其他', label: '其他' }
+          ]}
+          placeholder='请选择'
+          // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+          allowClear={false}
+        />
+      </div>
+      <div className='X1Btn'>
+        <Button type='primary'>提交</Button>&emsp;
+        <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+      </div>
+    </Modal>
+  )
+}
+
+const MemoX1setStoreLocS = React.memo(X1setStoreLocS)
+
+export default MemoX1setStoreLocS

+ 1 - 1
src/components/YtableLookText/index.module.scss

@@ -1,4 +1,4 @@
-.YtableLookText {
+.X2lookText {
   :global {
     .ant-modal-close {
       display: none;

+ 4 - 4
src/components/YtableLookText/index.tsx

@@ -6,10 +6,10 @@ type Props = {
   closeFu: () => void
 }
 
-function YtableLookText({ closeFu }: Props) {
+function X2lookText({ closeFu }: Props) {
   return (
     <Modal
-      wrapClassName={styles.YtableLookText}
+      wrapClassName={styles.X2lookText}
       destroyOnClose
       open={true}
       title='详情'
@@ -48,6 +48,6 @@ function YtableLookText({ closeFu }: Props) {
   )
 }
 
-const MemoYtableLookText = React.memo(YtableLookText)
+const MemoX2lookText = React.memo(X2lookText)
 
-export default MemoYtableLookText
+export default MemoX2lookText

+ 54 - 0
src/pages/X_stock/X3auditInfo/index.module.scss

@@ -0,0 +1,54 @@
+.X3auditInfo {
+  :global {
+    .x3Top {
+      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;
+      }
+    }
+    .X3Main {
+      margin-top: 24px;
+      display: flex;
+      justify-content: space-between;
+      align-items: self-start;
+      font-size: 16px;
+      flex-wrap: wrap;
+      .x3Row {
+        width: 48%;
+        display: flex;
+        align-items: center;
+        margin-bottom: 20px;
+        .x3Rowll {
+          width: 100px;
+          text-align: right;
+          font-weight: 700;
+          & > span {
+            color: #ff4d4f;
+          }
+        }
+        .x3Rowrr {
+          width: calc(100% - 100px);
+          .ant-btn {
+            margin-right: 15px;
+          }
+        }
+      }
+      .x3RowFull {
+        width: 100%;
+        align-items: self-start;
+        margin-bottom: 0;
+        .x3Rowll {
+          position: relative;
+          top: 3px;
+        }
+      }
+    }
+  }
+}

+ 71 - 0
src/pages/X_stock/X3auditInfo/index.tsx

@@ -0,0 +1,71 @@
+import { useCallback, useRef } from 'react'
+import styles from './index.module.scss'
+import { Button } from 'antd'
+import ZRichTexts from '@/components/ZRichTexts'
+import { forwardRef, useImperativeHandle } from 'react'
+
+type Props = {
+  auditSta: string
+  auditStaFu: (val: string) => void
+  ref: any
+}
+
+function X3auditInfo({ auditSta, auditStaFu }: Props, ref: any) {
+  // 富文本的ref
+  const TextRef = useRef<any>(null)
+
+  const resData = useCallback(() => {
+    const rtf = TextRef.current?.fatherBtnOkFu() || { flag: true }
+    return JSON.stringify(rtf.val || '')
+  }, [])
+
+  useImperativeHandle(ref, () => ({
+    resData
+  }))
+
+  // 设置富文本
+  //  ZRichTextRef.current?.ritxtShowFu(JSON.parse(data.rtf))
+
+  return (
+    <div className={styles.X3auditInfo}>
+      <div className='x3Top'>
+        审批信息<Button type='dashed'>待审批</Button>
+      </div>
+
+      <div className='X3Main'>
+        <div className='x3Row'>
+          <div className='x3Rowll'>
+            <span> * </span> 审批结果:
+          </div>
+          <div className='x3Rowrr'>
+            {['同意', '不同意'].map(v => (
+              <Button
+                key={v}
+                type={v === auditSta ? 'primary' : 'default'}
+                onClick={() => auditStaFu(v)}
+              >
+                {v}
+              </Button>
+            ))}
+          </div>
+        </div>
+        <div className='x3Row x3RowFull'>
+          <div className='x3Rowll'>审批意见:</div>
+          <div className='x3Rowrr'>
+            <ZRichTexts
+              check={false}
+              dirCode={'xxxxxxxx'}
+              isLook={false}
+              ref={TextRef}
+              myUrl='xxxxxxxxxx'
+              isOne={true}
+              upAudioBtnNone={true}
+            />
+          </div>
+        </div>
+      </div>
+    </div>
+  )
+}
+
+export default forwardRef(X3auditInfo)

+ 20 - 0
src/utils/tableData.ts

@@ -87,6 +87,26 @@ export const D2tableCSon = [
 ]
 
 // 待完善
+export const D4tableC = [
+  ['txt', '申请编号', 'regionName'],
+  ['txt', '业务名称', 'layer1'],
+  ['txt', '入库库房', 'layer2'],
+  ['txt', '发起部门', 'layer3'],
+  ['txt', '发起人', 'layer3'],
+  ['txt', '发起日期', 'layer3'],
+  ['txt', '申请状态', 'layer3']
+]
+
+// 待完善
+export const D4goodsTableC = [
+  ['img', '封面图', 'thumb'],
+  ['txt', '藏品编号', 'userName'],
+  ['txt', '藏品名称', 'userName'],
+  ['txt', '数量', 'userName'],
+  ['txt', '库存状态', 'userName']
+]
+
+// 待完善
 export const Y22tableC = [
   ['txt', '库存信息', 'xxxx'],
   ['txt', '库存详情', 'description']