Browse Source

入库瞎几把写

shaogen1995 4 months ago
parent
commit
1a1bfda149
42 changed files with 1304 additions and 494 deletions
  1. 28 1
      src/pages/A_workbench/A2business/index.module.scss
  2. 12 7
      src/pages/A_workbench/A2business/index.tsx
  3. 4 4
      src/pages/B_enterTibet/B1collect/index.tsx
  4. 2 2
      src/pages/B_enterTibet/B3_4page/B3edit/B3aTop/index.tsx
  5. 17 20
      src/pages/B_enterTibet/B3_4page/B3edit/main.tsx
  6. 15 16
      src/pages/B_enterTibet/B3_4page/index.tsx
  7. 15 8
      src/pages/B_enterTibet/B3_4page/type.d.ts
  8. 1 1
      src/pages/B_enterTibet/B3goodsTable/B3GaddNew/index.tsx
  9. 1 1
      src/pages/B_enterTibet/B3goodsTable/index.tsx
  10. 2 0
      src/pages/C_goodsManage/C1ledger/type.d.ts
  11. 4 4
      src/pages/C_goodsManage/C6edit/index.tsx
  12. 2 0
      src/pages/D_storeManage/D1storage/D1goods/index.tsx
  13. 5 2
      src/pages/D_storeManage/D2storSet/D2site/D2Sarea.tsx
  14. 3 1
      src/pages/D_storeManage/D2storSet/D2site/index.module.scss
  15. 16 11
      src/pages/D_storeManage/D2storSet/D2site/index.tsx
  16. 1 1
      src/pages/D_storeManage/D2storSet/index.tsx
  17. 382 113
      src/pages/D_storeManage/D4impStor/D4edit/index.tsx
  18. 77 18
      src/pages/D_storeManage/D4impStor/index.tsx
  19. 14 9
      src/pages/D_storeManage/D4impStor/type.d.ts
  20. 13 13
      src/pages/D_storeManage/D6putsStor/index.tsx
  21. 1 1
      src/pages/Layout/data.ts
  22. 28 7
      src/pages/X_stock/X1setStoreLocS/index.tsx
  23. 12 11
      src/pages/Y_goodsDetails/Y1cathet/Y44com.tsx
  24. 6 6
      src/pages/Y_goodsDetails/Y1cathet/type.d.ts
  25. 8 64
      src/pages/Z_system/Z3flowSet/Z3edit/index.module.scss
  26. 64 90
      src/pages/Z_system/Z3flowSet/Z3edit/index.tsx
  27. 32 10
      src/pages/Z_system/Z3flowSet/Z3edit/Z3addPro.tsx
  28. 48 0
      src/pages/Z_system/Z3flowSet/Z3linkSet/Z3lookPro.tsx
  29. 91 0
      src/pages/Z_system/Z3flowSet/Z3linkSet/index.module.scss
  30. 122 0
      src/pages/Z_system/Z3flowSet/Z3linkSet/index.tsx
  31. 0 23
      src/pages/Z_system/Z3flowSet/data.ts
  32. 48 6
      src/pages/Z_system/Z3flowSet/index.tsx
  33. 38 0
      src/pages/Z_system/Z3flowSet/type.d.ts
  34. 4 1
      src/store/action/D2storSet.ts
  35. 47 9
      src/store/action/D4impStor.ts
  36. 9 9
      src/store/action/FourAll.ts
  37. 28 0
      src/store/action/Z3flowSet.ts
  38. 3 3
      src/store/reducer/D4impStor.ts
  39. 1 1
      src/store/reducer/Z3flowSet.ts
  40. 63 0
      src/utils/history.ts
  41. 4 4
      src/utils/select.ts
  42. 33 17
      src/utils/tableData.ts

+ 28 - 1
src/pages/A_workbench/A2business/index.module.scss

@@ -59,7 +59,7 @@
         margin-top: 15px;
         display: flex;
         justify-content: space-between;
-        min-height: 27.3%;
+        min-height: 27.38%;
 
         .A2ll2_1 {
           width: calc(100% - 520px);
@@ -115,10 +115,12 @@
       background-color: #fff;
       border-radius: 10px;
       padding: 20px;
+      height: calc(100% - 3px);
       & > h1 {
         font-size: 18px;
       }
       .A2rrRow {
+        position: relative;
         margin-top: 36%;
         width: 100%;
         height: 12%;
@@ -135,6 +137,31 @@
             width: 40%;
           }
         }
+        .A2rrRowShow {
+          transition: all 0.2s;
+          opacity: 0;
+          pointer-events: none;
+          position: absolute;
+          top: 0;
+          left: -130px;
+          width: 130px;
+          background-color: #fff;
+          border-radius: 6px;
+          box-shadow: 0px 0px 4px 4px #ccc;
+          & > div {
+            cursor: pointer;
+            padding: 5px 0;
+            &:hover {
+              background-color: #ccc;
+            }
+          }
+        }
+        &:hover {
+          .A2rrRowShow {
+            opacity: 1;
+            pointer-events: auto;
+          }
+        }
       }
     }
   }

+ 12 - 7
src/pages/A_workbench/A2business/index.tsx

@@ -2,7 +2,7 @@ import React, { useCallback, useEffect } from 'react'
 import styles from './index.module.scss'
 import { useDispatch, useSelector } from 'react-redux'
 import store, { RootState } from '@/store'
-import { Button, Dropdown } from 'antd'
+import { Button } from 'antd'
 import { baseURL } from '@/utils/http'
 import baseTouXiangImg from '@/assets/img/user.png'
 import { getUserInfoByIdAPI } from '@/store/action/Z6user'
@@ -18,7 +18,9 @@ const rrArr = [
     num: 6,
     key: [
       { key: 1, label: '藏品入馆 4' },
-      { key: 2, label: '藏品入藏 2' }
+      { key: 2, label: '藏品入藏 2' },
+      { key: 3, label: '藏品入馆 4' },
+      { key: 4, label: '藏品入藏 2' }
     ]
   },
   {
@@ -200,12 +202,15 @@ function A2business() {
         <h1>我的申请</h1>
 
         {rrArr.map(item => (
-          <Dropdown key={item.name} menu={{ items: item.key }} placement='bottom' arrow>
-            <div className='A2rrRow'>
-              <div>{item.name}</div>
-              <div>{item.num}</div>
+          <div className='A2rrRow'>
+            <div>{item.name}</div>
+            <div>{item.num}</div>
+            <div className='A2rrRowShow'>
+              {item.key.map(v => (
+                <div key={v.key}>{v.label}</div>
+              ))}
             </div>
-          </Dropdown>
+          </div>
         ))}
       </div>
     </div>

+ 4 - 4
src/pages/B_enterTibet/B1collect/index.tsx

@@ -162,8 +162,8 @@ function B1collect() {
             <Select
               placeholder='请选择'
               style={{ width: 200 }}
-              value={formData.eeee}
-              onChange={e => setFormData({ ...formData, eeee: e })}
+              value={formData.status}
+              onChange={e => setFormData({ ...formData, status: e })}
               options={[{ value: '', label: '全部' }]}
             />
           </div>
@@ -175,8 +175,8 @@ function B1collect() {
               placeholder='请选择'
               options={[]}
               fieldNames={{ value: 'id', label: 'roleName' }}
-              value={formData.ffff}
-              onChange={e => setFormData({ ...formData, ffff: e })}
+              value={formData.userType}
+              onChange={e => setFormData({ ...formData, userType: e })}
             />
           </div>
         </div>

+ 2 - 2
src/pages/B_enterTibet/B3_4page/B3edit/B3aTop/index.tsx

@@ -73,7 +73,7 @@ function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
       1: 'cms/orderHouse/upload',
       2: 'cms/orderHide/upload',
       3: 'cms/register/upload',
-      4: 'cms/待完善删除/upload'
+      4: 'cms/orderDel/upload'
     }[pageKey as '1']
   }, [pageKey])
 
@@ -132,7 +132,7 @@ function B3aTop({ info, pageSta, Dom }: Props, ref: any) {
             <div className='B3aRrr'>
               {formData[v.key as 'name']}
               {['查看', '审批'].includes(pageSta) && v.name === '发起人'
-                ? ' - ' + info.createTime || ''
+                ? ' - ' + formData.createTime || ''
                 : ''}
             </div>
           </div>

+ 17 - 20
src/pages/B_enterTibet/B3_4page/B3edit/main.tsx

@@ -41,26 +41,23 @@ function B3editMain({ pageSta }: Props) {
   }, [pageKey])
 
   // 获取详情
-  const getInfoFu = useCallback(
-    async (id: number) => {
-      const res = await FourAPI_getInfo(pageKey, id)
-      if (res.code === 0) {
-        setTopInfo(res.data)
+  const getInfoFu = useCallback(async () => {
+    const res = await FourAPI_getInfo(pageKey, id)
+    if (res.code === 0) {
+      setTopInfo(res.data)
 
-        // 设置藏品清单数据
+      // 设置藏品清单数据
 
-        goodsTableRef.current?.setData(res.data.goods || [])
-      }
-    },
-    [pageKey]
-  )
+      goodsTableRef.current?.setData(res.data.goods || [])
+    }
+  }, [id, pageKey])
 
   useEffect(() => {
     if (key === '1') creatFu()
-    else getInfoFu(Number(id))
+    else getInfoFu()
     // key 1 2 3 4 新增 编辑 审批 查看
     // pageKey 1 2 3 4 入馆 入藏 登记 删除
-  }, [creatFu, getInfoFu, id, key])
+  }, [creatFu, getInfoFu, key])
 
   // key改变的时候,滚动到顶部
   const scrollTopFu = useCallback(() => {
@@ -203,17 +200,17 @@ function B3editMain({ pageSta }: Props) {
         rtf: resData.rtf1
       }
 
-      const obkFu = {
-        创建: await FourAPI_saveCreate(pageKey, obj),
-        提交: await FourAPI_saveApply(pageKey, obj),
-        撤回: await FourAPI_revocation(pageKey, id)
-      }
+      const res =
+        val === '创建'
+          ? await FourAPI_saveCreate(pageKey, obj)
+          : val === '提交'
+          ? await FourAPI_saveApply(pageKey, obj)
+          : await FourAPI_revocation(pageKey, id)
 
-      const res = obkFu[val]
       if (res.code === 0) {
         scrollTopFu()
         MessageFu.success(val + '成功')
-        getInfoFu(Number(id))
+        getInfoFu()
       }
     },
     [getInfoFu, id, pageKey, scrollTopFu]

+ 15 - 16
src/pages/B_enterTibet/B3_4page/index.tsx

@@ -15,8 +15,7 @@ import { MessageFu } from '@/utils/message'
 import ExportJsonExcel from 'js-export-excel'
 const { RangePicker } = DatePicker
 
-// 待完善 字段参数名字
-export type D3InputKeyType = 'aaaa' | 'bbbb' | 'cccc' | 'dddd'
+export type D3InputKeyType = 'num' | 'name' | 'deptName' | 'userName'
 
 const objUrl = {
   入馆: '/entering',
@@ -36,23 +35,23 @@ export const B3_4inputKeyArr: {
   name: string
   key: D3InputKeyType
 }[] = [
-  { name: '业务单号', key: 'aaaa' },
-  { name: '申请名称', key: 'bbbb' },
-  { name: '发起部门', key: 'cccc' },
-  { name: '发起人', key: 'dddd' }
+  { name: '业务单号', key: 'num' },
+  { name: '申请名称', key: 'name' },
+  { name: '发起部门', key: 'deptName' },
+  { name: '发起人', key: 'userName' }
 ]
 
 export const B3baseFormData: TypeB3Form = {
   pageSize: 10,
   pageNum: 1,
-  aaaa: '',
-  bbbb: '',
-  cccc: '',
-  dddd: '',
+  num: '',
+  name: '',
+  deptName: '',
+  userName: '',
   startTime: '',
   endTime: '',
-  eeee: null,
-  ffff: null
+  status: null,
+  userType: null
 }
 
 type Props = {
@@ -285,8 +284,8 @@ function B34page({ pageSta }: Props) {
               allowClear={true}
               placeholder='全部'
               style={{ width: 200 }}
-              value={formData.eeee}
-              onChange={e => setFormData({ ...formData, eeee: e })}
+              value={formData.status}
+              onChange={e => setFormData({ ...formData, status: e })}
               options={selectObj['申请状态'].filter(v => v.label !== '待盘点')}
             />
           </div>
@@ -299,8 +298,8 @@ function B34page({ pageSta }: Props) {
               placeholder='全部'
               options={selectObj['角色']}
               // fieldNames={{ value: 'id', label: 'roleName' }}
-              value={formData.ffff}
-              onChange={e => setFormData({ ...formData, ffff: e })}
+              value={formData.userType}
+              onChange={e => setFormData({ ...formData, userType: e })}
             />
           </div>
         </div>

+ 15 - 8
src/pages/B_enterTibet/B3_4page/type.d.ts

@@ -1,14 +1,14 @@
 export type TypeB3Form = {
   pageSize: number
   pageNum: number
-  aaaa: string
-  bbbb: string
-  cccc: string
-  dddd: string
+  num: string
+  name: string
+  deptName: string
+  userName: string
   startTime: string
   endTime: string
-  eeee: null | string
-  ffff: null | string
+  status: null | string
+  userType: null | string
 }
 
 export type TypeB3PageSta = '新增' | '编辑' | '查看' | '审批'
@@ -32,7 +32,7 @@ export type FourTableType = {
   deptName: string
   fileIds: string
   files: FileImgListType[]
-  // goods?: any
+  goods: C1GoodType[]
   goodsIds: string
   id: number
   name: string
@@ -42,7 +42,6 @@ export type FourTableType = {
   rtf: string
   sonTypeName: string
   status: number
-  // storageId?: any
   // storageRelatedId?: any
   type: string
   typeName: string
@@ -55,4 +54,12 @@ export type FourTableType = {
   creatorId: number
   // 当前节点审批人
   currentAuditUserIds: string
+
+  // ------------------入库有的------------------
+  // 业务类型
+  sonTypeName: string
+  // 相关出库单
+  relatedOrderNum: string
+  // 入库库房
+  storageId: number | null
 }

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

@@ -89,7 +89,7 @@ function B3GaddNew({ nowSta, closeFu, succFu }: Props) {
       // 设置富文本
       if (obj.rtf) ZRichTextRef.current?.ritxtShowFu(JSON.parse(obj.rtf))
 
-      // 设置附件 待完善 附件类型 和用途
+      // 设置附件
       setTable(obj.file || [])
     }
   }, [])

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

@@ -18,7 +18,7 @@ const sonUrlObj = {
   1: 'cms/orderHouse/goods/getList',
   2: 'cms/orderHide/goods/getList',
   3: 'cms/register/goods/getList',
-  4: 'cms/待完善删除/goods/getList'
+  4: 'cms/orderDel/goods/getList'
 }
 
 type Props = {

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

@@ -98,4 +98,6 @@ export type C1GoodType = {
   torn: string
   updateTime: string
   uses: string
+  // 存放位置数组
+  siteId: string
 }

+ 4 - 4
src/pages/C_goodsManage/C6edit/index.tsx

@@ -162,8 +162,8 @@ function C6edit() {
             <Select
               placeholder='请选择'
               style={{ width: 200 }}
-              value={formData.eeee}
-              onChange={e => setFormData({ ...formData, eeee: e })}
+              value={formData.status}
+              onChange={e => setFormData({ ...formData, status: e })}
               options={[{ value: '', label: '全部' }]}
             />
           </div>
@@ -175,8 +175,8 @@ function C6edit() {
               placeholder='请选择'
               options={[]}
               fieldNames={{ value: 'id', label: 'roleName' }}
-              value={formData.ffff}
-              onChange={e => setFormData({ ...formData, ffff: e })}
+              value={formData.userType}
+              onChange={e => setFormData({ ...formData, userType: e })}
             />
           </div>
         </div>

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

@@ -145,6 +145,7 @@ function D1goods({ lookData, TreeDom, tableId }: Props) {
         <div className='D1GtRow'>
           <span className='D1GtRowTxt'>编号类型:</span>
           <Select
+            allowClear={true}
             options={selectObj['藏品编号类型']}
             style={{ width: 160 }}
             value={formData.numName}
@@ -176,6 +177,7 @@ function D1goods({ lookData, TreeDom, tableId }: Props) {
         <div className='D1GtRow'>
           <span className='D1GtRowTxt'>库存状态:</span>
           <Select
+            allowClear={true}
             options={selectObj['库存状态']}
             style={{ width: 160 }}
             value={formData.statusStorage}

+ 5 - 2
src/pages/D_storeManage/D2storSet/D2site/D2Sarea.tsx

@@ -14,6 +14,7 @@ import { D2checkDuplicate } from './data'
 type Props = {
   sId: number
   closeFu: () => void
+  succFu: () => void
 }
 
 export type D2SlistType = {
@@ -23,7 +24,7 @@ export type D2SlistType = {
   parentId: number
 }
 
-function D2Sarea({ sId, closeFu }: Props) {
+function D2Sarea({ sId, closeFu, succFu }: Props) {
   const [list, setList] = useState<D2SlistType[]>([])
 
   const getListFu = useCallback(async () => {
@@ -144,15 +145,17 @@ function D2Sarea({ sId, closeFu }: Props) {
           const res2 = await D2_APIareaDels(delIds.current)
           if (res2.code === 0) {
             MessageFu.success('提交成功')
+            succFu()
             closeFu()
           }
         } else {
           MessageFu.success('提交成功')
+          succFu()
           closeFu()
         }
       }
     }
-  }, [closeFu, idFlagFu, list])
+  }, [closeFu, idFlagFu, list, succFu])
 
   return (
     <Modal

+ 3 - 1
src/pages/D_storeManage/D2storSet/D2site/index.module.scss

@@ -4,7 +4,9 @@
   background-color: #fff;
   :global {
     .D2Stop {
-      text-align: right;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
     }
     .D2Stable {
       margin-top: 15px;

+ 16 - 11
src/pages/D_storeManage/D2storSet/D2site/index.tsx

@@ -12,7 +12,7 @@ import D2Sadd from './D2Sadd'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { MessageFu } from '@/utils/message'
 function D2site() {
-  const { id: sId } = useParams<any>()
+  const { id: sId, title } = useParams<any>()
 
   const getListFu = useCallback(async () => {
     const res = await D2_APIgetSiteList(sId)
@@ -68,15 +68,18 @@ function D2site() {
       <div className='pageTitle'>库房设置-库位设置</div>
 
       <div className='D2Stop'>
-        <Button type='primary' onClick={() => setAreaShow(true)}>
-          区域设置
-        </Button>
-        &emsp;
-        <Button type='primary' onClick={() => setAddObj({ id: -1 } as TypeD2listSite)}>
-          新增库位
-        </Button>
-        &emsp;
-        <Button onClick={() => history.go(-1)}>返回</Button>
+        <h2>{title}</h2>
+        <div>
+          <Button type='primary' onClick={() => setAreaShow(true)}>
+            区域设置
+          </Button>
+          &emsp;
+          <Button type='primary' onClick={() => setAddObj({ id: -1 } as TypeD2listSite)}>
+            新增库位
+          </Button>
+          &emsp;
+          <Button onClick={() => history.go(-1)}>返回</Button>
+        </div>
       </div>
 
       <div className='D2Stable'>
@@ -91,7 +94,9 @@ function D2site() {
       </div>
 
       {/* 区域设置弹窗 */}
-      {areaShow ? <D2Sarea sId={sId} closeFu={() => setAreaShow(false)} /> : null}
+      {areaShow ? (
+        <D2Sarea succFu={getListFu} sId={sId} closeFu={() => setAreaShow(false)} />
+      ) : null}
 
       {/* 新增库位弹窗 */}
       {addObj.id ? (

+ 1 - 1
src/pages/D_storeManage/D2storSet/index.tsx

@@ -111,7 +111,7 @@ function D2storSet() {
               <Button
                 size='small'
                 type='text'
-                onClick={() => history.push(`/storSet_site/${item.id}`)}
+                onClick={() => history.push(`/storSet_site/${item.id}/${item.name}`)}
               >
                 库位设置
               </Button>

+ 382 - 113
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -7,7 +7,7 @@ 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 history, { btnFlagFu2, kuIsTreeChangeFu, openGoodsInfoFu } from '@/utils/history'
 import { MessageFu } from '@/utils/message'
 import MyTable from '@/components/MyTable'
 import classNames from 'classnames'
@@ -17,8 +17,26 @@ 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'
-import { D4_APIcreate, D4_APIgetInfo } from '@/store/action/D4impStor'
+import {
+  D4_APIcreate,
+  D4_APIdel,
+  D4_APIgetInfo,
+  D4_APIrevocation,
+  D4_APIsaveApply,
+  D4_APIsaveAudit,
+  D4_APIsaveCreate,
+  D4_APIsaveDraft
+} from '@/store/action/D4impStor'
 import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
+import { useDispatch, useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import { cascaderArr } from '@/pages/B_enterTibet/B3goodsTable/B3GaddNew/data'
+import { D2_APIgetList } from '@/store/action/D2storSet'
+import { D1_APIgetSiteList } from '@/store/action/D1storage'
+import { C1GoodType } from '@/pages/C_goodsManage/C1ledger/type'
+import { TypeD2list } from '../../D2storSet/type'
+import { KuIsTreeType } from '../type'
+import { EXbtnFu } from '@/utils/EXBtn'
 
 export const pageTitTxtObj = {
   1: '新增',
@@ -37,6 +55,25 @@ function D4edit() {
   // 顶部数据
   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 D4_APIcreate()
@@ -45,24 +82,37 @@ function D4edit() {
     }
   }, [])
 
+  // 入库的排架 层数 层格变成树
+  const [kuIsTree, setKuIsTreeFu] = useState<KuIsTreeType[]>([])
+
+  const kuIsTreeFu = useCallback(async (id: number) => {
+    const res = await D1_APIgetSiteList(id)
+    if (res.code === 0) {
+      const arrTemp: KuIsTreeType[] = kuIsTreeChangeFu(res.data)
+      setKuIsTreeFu(arrTemp)
+    }
+  }, [])
+
   // 获取详情
-  const getInfoFu = useCallback(async (id: number) => {
+  const getInfoFu = useCallback(async () => {
     const res = await D4_APIgetInfo(id)
     if (res.code === 0) {
       setTopInfo(res.data)
 
-      // 设置藏品清单数据
+      // 设置富文本
+      ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf))
 
-      // goodsTableRef.current?.setData(res.data.goods || [])
+      // 入库库房筛选存放位置数据
+      kuIsTreeFu(res.data.storageId)
     }
-  }, [])
+  }, [id, kuIsTreeFu])
 
   useEffect(() => {
     if (key === '1') creatFu()
-    else getInfoFu(id)
+    else getInfoFu()
 
     if (sollrDom.current) sollrDom.current.scrollTop = 0
-  }, [creatFu, getInfoFu, id, key])
+  }, [creatFu, getInfoFu, key])
 
   // 上传附件的ref
   const filesRef = useRef<any>(null)
@@ -74,42 +124,114 @@ function D4edit() {
   // 审批意见的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 timeChange = useCallback(
+    (e: any) => {
+      setTopInfo({ ...topInfo, date: dayjs(e).format('YYYY-MM-DD') })
+    },
+    [topInfo]
+  )
 
-  // 新增的底部按钮点击
-  const btnClickFu = useCallback((val: number) => {
-    const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
-    console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
+  const checkDataFu = useCallback(() => {
+    if (!topInfo.name) {
+      MessageFu.warning('申请名称不能为空')
+      return true
+    }
+    if (!topInfo.sonTypeName) {
+      MessageFu.warning('请选择业务类型')
+      return true
+    }
+    if (!topInfo.storageId) {
+      MessageFu.warning('请选择入库库房')
+      return true
+    }
+    if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
+      MessageFu.warning('请添加藏品')
+      return true
+    } else {
+      if (topInfo.goods.some(v => !v.siteStr)) {
+        MessageFu.warning('请选择存放位置')
+        return true
+      }
+    }
 
-    const rtf2 = ZAuditRef.current?.resData()
-    console.log('审批信息富文本', rtf2)
+    return false
+  }, [topInfo])
 
-    // if (1 + 1 === 2) return
+  // 审批的sta
+  const [auditSta, setAuDitSta] = useState('')
 
-    if (val === 2) {
-      // 存草稿 当前页保存 不跳转
-      MessageFu.success('草稿保存成功')
-    } else {
-      // 跳到详情页
-      history.push(`/impStor_edit/4/999`)
-    }
-  }, [])
+  // 新增的底部按钮点击
+  const btnClickFu = useCallback(
+    async (val: '草稿' | '创建' | '保存' | '审批') => {
+      if (checkDataFu()) return
+
+      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 D4_APIsaveAudit({
+          orderId: topInfo.id,
+          rtfOpinion: rtf2,
+          status: auditSta === '同意' ? 1 : 2
+        })
+
+        if (res.code === 0) {
+          MessageFu.success('审批成功')
+          // 跳详情页
+          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 => ({
+            goodsId: v.id,
+            siteStr: v.siteStr,
+            siteId: v.siteId
+          }))
+        }
+        // console.log(123, obj)
+
+        // if (1 + 1 === 2) return
+
+        if (val === '草稿') {
+          // 存草稿 当前页保存 不跳转
+          const res = await D4_APIsaveDraft(obj)
+          if (res.code === 0) {
+            MessageFu.success('草稿保存成功')
+          }
+        } else {
+          const res = val === '创建' ? await D4_APIsaveCreate(obj) : await D4_APIsaveApply(obj)
+          if (res.code === 0) {
+            MessageFu.success(`${val}成功`)
+            // 跳到详情页
+            history.push(`/impStor_edit/4/${topInfo.id}`)
+          }
+        }
+      }
+    },
+    [auditSta, checkDataFu, topInfo]
+  )
 
   // 打开侧边栏
   const [cathet, setCathet] = useState(0)
 
-  // 点击删除
-  const delTableFu = useCallback(async (id: number) => {}, [])
-
   const startBtn = useMemo(() => {
     return [
       {
@@ -132,36 +254,58 @@ function D4edit() {
     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}
-          />
-        )
+        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={item.siteStr ? item.siteStr.split(',').map(v => Number(v)) : undefined}
+              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: '操作',
-        render: (item: any) => {
+        render: (item: C1GoodType) => {
           return (
             <>
               <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
                 查看
               </Button>
               {['3', '4'].includes(key) ? null : (
-                <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+                <MyPopconfirm
+                  txtK='删除'
+                  onConfirm={() =>
+                    setTopInfo({
+                      ...topInfo,
+                      goods: topInfo.goods.filter(v => v.id !== item.id)
+                    })
+                  }
+                />
               )}
             </>
           )
         }
       }
     ]
-  }, [delTableFu, key])
+  }, [key, kuIsTree, topInfo])
 
   // 点击新增
   const [nowSta, setNowSta] = useState({ key: '', id: '' })
@@ -169,42 +313,132 @@ function D4edit() {
   // 点击批量设置存放位置
   const [setLoc, setSetLoc] = useState(false)
 
-  // 审批的sta
-  const [auditSta, setAuDitSta] = useState('')
+  // 查看的按钮创建-提交-撤回
+  const lookBtnFu = useCallback(
+    async (val: '创建' | '提交' | '撤回') => {
+      const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+      // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
+
+      // 上传附件
+      const filesRes = filesRef.current.filesIdRes()
+      const obj = {
+        ...topInfo,
+        fileIds: filesRes.join(','),
+        rtf: JSON.stringify(rtf1.val || ''),
+        goodsIds: topInfo.goods.map(v => v.id).join(','),
+        goods: topInfo.goods.map(v => ({
+          goodsId: v.id,
+          siteStr: v.siteStr,
+          siteId: v.siteId
+        }))
+      }
+
+      const res =
+        val === '创建'
+          ? await D4_APIsaveCreate(obj)
+          : val === '提交'
+          ? await D4_APIsaveApply(obj)
+          : await D4_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 D4_APIdel(id)
+    if (res.code === 0) {
+      MessageFu.success('删除成功')
+      history.push('/impStor')
+    }
+  }, [id])
+
+  // 查看模式点击审批 编辑
+  const lookJumpFu = useCallback(
+    (val: '审批' | '编辑') => {
+      history.push(`/impStor_edit/${val === '审批' ? 3 : 2}/${id}`)
+      MessageFu.success(`已跳转至${val}页面`)
+    },
+    [id]
+  )
 
-  // 查看模式下的按钮 待完善
+  // 查看模式下的按钮
   const lookBtn = useMemo(() => {
     return (
       <>
-        <Button type='primary'>创建</Button>
-        <Button type='primary'>提交</Button>
-        <MyPopconfirm
-          txtK='撤回'
-          onConfirm={() => {}}
-          Dom={
-            <Button type='primary' danger>
-              撤回
-            </Button>
-          }
-        />
+        {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}
+
+        {btnFlagFu2(topInfo)['导出'] ? EXbtnFu() : null}
+
+        {btnFlagFu2(topInfo)['删除'] ? (
+          <MyPopconfirm
+            txtK='删除'
+            onConfirm={() => delFu()}
+            Dom={
+              <Button type='primary' danger>
+                删除
+              </Button>
+            }
+          />
+        ) : null}
 
-        <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>
       </>
     )
-  }, [])
+  }, [delFu, lookBtnFu, lookJumpFu, topInfo])
+
+  // 所有级联的数据平铺
+  const { dictAll } = useSelector((state: RootState) => state.Z1dict)
+  const cascaderObj = useMemo(() => {
+    let obj: any = {}
+    if (dictAll && dictAll.length) {
+      obj = cascaderArr(dictAll)
+    }
+    return obj
+  }, [dictAll])
 
   return (
     <div className={styles.D4edit}>
@@ -248,18 +482,16 @@ function D4edit() {
           <div className='D4row'>
             <div className='D4rowll'>
               <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={[
-                  { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-                  { value: '其他', label: '其他' }
-                ]}
+                options={cascaderObj['藏品入库']}
                 changeOnSelect
                 placeholder='请选择'
-                // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                 allowClear={false}
               />
             </div>
@@ -269,15 +501,16 @@ function D4edit() {
             <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='D4rowrr'>
               <Select disabled={['3', '4'].includes(key)} placeholder='请搜索出库单编码' />
@@ -292,7 +525,7 @@ function D4edit() {
               <DatePicker
                 disabled={['3', '4'].includes(key)}
                 allowClear={false}
-                value={dayjs()}
+                value={dayjs(topInfo.date)}
                 onChange={timeChange}
               />
             </div>
@@ -306,9 +539,9 @@ function D4edit() {
                 isLook={['3', '4'].includes(key)}
                 ref={filesRef}
                 fileCheck={false}
-                dirCode={'xxxxxxx'}
-                myUrl='xxxxxxxxxxxx'
-                lookData={[]}
+                dirCode='impStor'
+                myUrl='cms/orderIn/upload'
+                lookData={topInfo.files || []}
                 size={500}
               />
             </div>
@@ -318,6 +551,8 @@ function D4edit() {
             <div className='D4rowll'>原因事由:</div>
             <div className='D4rowrr'>
               <Input
+                value={topInfo.reason}
+                onChange={e => setTopInfo({ ...topInfo, reason: e.target.value })}
                 readOnly={['3', '4'].includes(key)}
                 placeholder='请输入内容'
                 maxLength={30}
@@ -331,10 +566,10 @@ function D4edit() {
             <div className='D4rowrr'>
               <ZRichTexts
                 check={false}
-                dirCode={'xxxxxxxx'}
+                dirCode='impStor'
+                myUrl='cms/orderIn/upload'
                 isLook={['3', '4'].includes(key)}
                 ref={ZRichTextRef}
-                myUrl='xxxxxxxxxx'
                 isOne={true}
                 upAudioBtnNone={true}
               />
@@ -349,13 +584,22 @@ function D4edit() {
               <span> * </span>入库库房:
             </div>
             <div className='D4rowrr'>
-              {/* 待完善 从库房设置列表里面选择 --默认第一个*/}
-              <Select disabled={['3', '4'].includes(key)} placeholder='请选择' />
+              <Select
+                options={storSetList}
+                value={topInfo.storageId}
+                onChange={(storageId, arr) => {
+                  setTopInfo({ ...topInfo, storageId, goods: [] })
+                  kuIsTreeFu((arr as TypeD2list).id)
+                }}
+                disabled={['3', '4'].includes(key)}
+                fieldNames={{ value: 'id', label: 'name' }}
+                placeholder='请选择'
+              />
             </div>
           </div>
           <div className='D4row D4row3'>
             <div className='D4rowll'>库房负责人:</div>
-            <div className='D4rowrr'>这是一段文本</div>
+            <div className='D4rowrr'>{managerUser || '(空)'}</div>
           </div>
         </div>
 
@@ -366,13 +610,26 @@ function D4edit() {
             <div className='D4Tit2rr'>
               {['3', '4'].includes(key) ? null : (
                 <>
-                  <Button type='primary' onClick={() => setNowSta({ key: '5', id })}>
+                  <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)}>
+                  <Button
+                    type='primary'
+                    onClick={() => setSetLoc(true)}
+                    disabled={!(topInfo.goods && topInfo.goods.length)}
+                  >
                     批量设置存放位置
                   </Button>
-                  <Button type='primary'>自动分配空置库位</Button>
+                  {/* 待完善 */}
+                  <Button type='primary' disabled={!(topInfo.goods && topInfo.goods.length)}>
+                    自动分配空置库位
+                  </Button>
                 </>
               )}
             </div>
@@ -380,7 +637,7 @@ function D4edit() {
 
           {/* 表格 */}
           <MyTable
-            list={[{ id: 99, thumb: '', num: '一段编号_可点击' }]}
+            list={topInfo.goods || []}
             columnsTemp={D4goodsTableC}
             startBtn={startBtn}
             lastBtn={tableLastBtn}
@@ -389,15 +646,7 @@ function D4edit() {
         </div>
 
         {/* 申请流程 */}
-        {['3', '4'].includes(key) ? (
-          <B3flowTable
-            tableArr={
-              [
-                //  待完善
-              ]
-            }
-          />
-        ) : null}
+        {['3', '4'].includes(key) ? <B3flowTable tableArr={topInfo.audits || []} /> : null}
       </div>
 
       {/* 底部按钮 */}
@@ -406,12 +655,18 @@ function D4edit() {
           lookBtn
         ) : (
           <>
-            <Button type='primary' onClick={() => btnClickFu(1)}>
-              {key === '1' ? '创建' : '保存'}
-            </Button>
+            {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(2)}>
+              <Button type='primary' onClick={() => btnClickFu('草稿')}>
                 存草稿
               </Button>
             ) : null}
@@ -428,14 +683,28 @@ function D4edit() {
         <B3GaddNow
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}
-          dataResFu={data => {}}
-          // 待完善
-          oldCheckArr={[]}
+          dataResFu={data => setTopInfo({ ...topInfo, goods: data })}
+          oldCheckArr={topInfo.goods || []}
         />
       ) : null}
 
       {/* 批量设置存放位置 */}
-      {setLoc ? <X1setStoreLocS closeFu={() => setSetLoc(false)} /> : null}
+      {setLoc ? (
+        <X1setStoreLocS
+          succFu={(val, siteId) =>
+            setTopInfo({
+              ...topInfo,
+              goods: topInfo.goods.map(v => ({
+                ...v,
+                siteStr: val,
+                siteId
+              }))
+            })
+          }
+          kuIsTree={kuIsTree}
+          closeFu={() => setSetLoc(false)}
+        />
+      ) : null}
     </div>
   )
 }

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

@@ -1,11 +1,11 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, DatePicker, Input, Select } from 'antd'
-import { TypeD4Form, TypeD4list } from './type'
+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 { D4tableC, statusObj } from '@/utils/tableData'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import history, { btnFlagFu } from '@/utils/history'
 import { selectObj } from '@/utils/select'
@@ -14,21 +14,22 @@ import { D2_APIgetList } from '@/store/action/D2storSet'
 import { RootState } from '@/store'
 import { D4_APIdel, D4_APIgetList } from '@/store/action/D4impStor'
 import { MessageFu } from '@/utils/message'
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
+import ExportJsonExcel from 'js-export-excel'
 const { RangePicker } = DatePicker
 
-// 后端筛选字段 待完善
 const baseFormData: TypeD4Form = {
   pageSize: 10,
   pageNum: 1,
-  aaaa: '',
-  bbbb: '',
-  cccc: '',
-  dddd: '',
+  num: '',
+  name: '',
+  deptName: '',
+  userName: '',
   startTime: '',
   endTime: '',
-  eeee: null,
-  ffff: null,
-  gggg: null
+  status: null,
+  userType: null,
+  storageInId: null
 }
 
 function D4impStor() {
@@ -43,6 +44,7 @@ function D4impStor() {
 
   const [formData, setFormData] = useState(baseFormData)
   const formDataRef = useRef(baseFormData)
+  const formDataOldRef = useRef(baseFormData)
 
   useEffect(() => {
     formDataRef.current = formData
@@ -75,6 +77,7 @@ function D4impStor() {
 
   // 封装发送请求的函数
   const getListFu = useCallback(() => {
+    formDataOldRef.current = { ...formDataRef.current }
     dispatch(D4_APIgetList(formDataRef.current))
   }, [dispatch])
 
@@ -133,7 +136,7 @@ function D4impStor() {
     return [
       {
         title: '操作',
-        render: (item: TypeD4list) => {
+        render: (item: FourTableType) => {
           let obj = btnFlagFu(item)
           return !Object.values(obj).some(Boolean) ? (
             '-'
@@ -169,6 +172,59 @@ function D4impStor() {
   // 从仓库拿数据
   const tableInfo = useSelector((state: RootState) => state.D4impStor.tableInfo)
 
+  // 点击导出
+  const deriveFu = useCallback(async () => {
+    const name = '藏品入库' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
+
+    const res = await D4_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'
+            ],
+            sheetHeader: [
+              '业务单号',
+              '申请名称',
+              '入库库房',
+              '发起部门',
+              '发送人',
+              '发起日期',
+              '申请状态'
+            ],
+            columnWidths: [10, 10, 10, 10, 10, 10, 10]
+          }
+        ]
+      }
+
+      const toExcel = new ExportJsonExcel(option) //new
+      toExcel.saveExcel() //保存
+    }
+  }, [])
+
   return (
     <div className={styles.D4impStor}>
       <div className='pageTitle'>入库</div>
@@ -188,7 +244,10 @@ function D4impStor() {
           ))}
         </div>
         <div className='D4toprr'>
-          <Button type='primary'>批量导出</Button>&emsp;
+          <Button type='primary' onClick={deriveFu}>
+            批量导出
+          </Button>
+          &emsp;
           <Button type='primary' onClick={() => history.push('/impStor_edit/1/null')}>
             新增
           </Button>
@@ -212,8 +271,8 @@ function D4impStor() {
               allowClear={true}
               placeholder='全部'
               style={{ width: 150 }}
-              value={formData.eeee}
-              onChange={e => setFormData({ ...formData, eeee: e })}
+              value={formData.status}
+              onChange={e => setFormData({ ...formData, status: e })}
               options={selectObj['申请状态'].filter(v => v.label !== '待盘点')}
             />
           </div>
@@ -226,8 +285,8 @@ function D4impStor() {
               placeholder='全部'
               options={selectObj['角色']}
               // fieldNames={{ value: 'id', label: 'roleName' }}
-              value={formData.ffff}
-              onChange={e => setFormData({ ...formData, ffff: e })}
+              value={formData.userType}
+              onChange={e => setFormData({ ...formData, userType: e })}
             />
           </div>
 
@@ -238,8 +297,8 @@ function D4impStor() {
               allowClear={true}
               placeholder='全部'
               style={{ width: 150 }}
-              value={formData.gggg}
-              onChange={e => setFormData({ ...formData, gggg: e })}
+              value={formData.storageInId}
+              onChange={e => setFormData({ ...formData, storageInId: e })}
               fieldNames={{ value: 'id', label: 'name' }}
               options={list}
             />

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

@@ -1,16 +1,21 @@
 export type TypeD4Form = {
   pageSize: number
   pageNum: number
-  aaaa: string
-  bbbb: string
-  cccc: string
-  dddd: string
+  num: string
+  name: string
+  deptName: string
+  userName: string
   startTime: string
   endTime: string
-  eeee: null | number
-  ffff: null | string
-  gggg: null | number
+  status: null | number
+  userType: null | string
+  storageInId: null | number
 }
 
-// 待完善
-export type TypeD4list = any
+// 排架 层数 层格变成树的树结构
+export type KuIsTreeType = {
+  value: number
+  label: string
+  lastId?: number
+  children?: KuIsTreeType[]
+}

+ 13 - 13
src/pages/D_storeManage/D6putsStor/index.tsx

@@ -13,15 +13,15 @@ const { RangePicker } = DatePicker
 const baseFormData: TypeD4Form = {
   pageSize: 10,
   pageNum: 1,
-  aaaa: '',
-  bbbb: '',
-  cccc: '',
-  dddd: '',
+  num: '',
+  name: '',
+  deptName: '',
+  userName: '',
   startTime: '',
   endTime: '',
-  eeee: null,
-  ffff: null,
-  gggg: null
+  status: null,
+  userType: null,
+  storageInId: null
 }
 
 // 没有接入后端 待完善
@@ -178,8 +178,8 @@ function D6putsStor() {
             <Select
               placeholder='请选择'
               style={{ width: 150 }}
-              value={formData.eeee}
-              onChange={e => setFormData({ ...formData, eeee: e })}
+              value={formData.status}
+              onChange={e => setFormData({ ...formData, status: e })}
               options={[{ value: '', label: '全部' }]}
             />
           </div>
@@ -191,8 +191,8 @@ function D6putsStor() {
               placeholder='请选择'
               options={[]}
               fieldNames={{ value: 'id', label: 'roleName' }}
-              value={formData.ffff}
-              onChange={e => setFormData({ ...formData, ffff: e })}
+              value={formData.userType}
+              onChange={e => setFormData({ ...formData, userType: e })}
             />
           </div>
 
@@ -202,8 +202,8 @@ function D6putsStor() {
             <Select
               placeholder='请选择'
               style={{ width: 150 }}
-              value={formData.gggg}
-              onChange={e => setFormData({ ...formData, gggg: e })}
+              value={formData.storageInId}
+              onChange={e => setFormData({ ...formData, storageInId: e })}
               options={[{ value: '', label: '全部' }]}
             />
           </div>

+ 1 - 1
src/pages/Layout/data.ts

@@ -268,7 +268,7 @@ export const routerSon: RouterTypeRow[] = [
   {
     id: 2,
     name: '库房设置-库位设置',
-    path: '/storSet_site/:id',
+    path: '/storSet_site/:id/:title',
     Com: React.lazy(() => import('../D_storeManage/D2storSet/D2site'))
   },
 

+ 28 - 7
src/pages/X_stock/X1setStoreLocS/index.tsx

@@ -1,13 +1,20 @@
-import React from 'react'
+import React, { useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, Cascader, Modal } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
+import { KuIsTreeType } from '@/pages/D_storeManage/D4impStor/type'
+import { MessageFu } from '@/utils/message'
 
 type Props = {
   closeFu: () => void
+  kuIsTree: KuIsTreeType[]
+  succFu: (val: string, lastId: number) => void
 }
 
-function X1setStoreLocS({ closeFu }: Props) {
+function X1setStoreLocS({ closeFu, kuIsTree, succFu }: Props) {
+  const [value, setValue] = useState('')
+  const lastId = useRef<any>('')
+
   return (
     <Modal
       wrapClassName={styles.X1setStoreLocS}
@@ -21,17 +28,31 @@ function X1setStoreLocS({ closeFu }: Props) {
       <div className='X1Main'>
         <Cascader
           style={{ width: 300 }}
-          options={[
-            { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
-            { value: '其他', label: '其他' }
-          ]}
+          options={kuIsTree}
           placeholder='请选择'
           // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
           allowClear={false}
+          value={value ? value.split(',').map(v => Number(v)) : []}
+          onChange={(e, e2) => {
+            if (e2 && e2.length === 4) lastId.current = e2[3].lastId
+
+            setValue(e ? e.join(',') : '')
+          }}
         />
       </div>
       <div className='X1Btn'>
-        <Button type='primary'>提交</Button>&emsp;
+        <Button
+          type='primary'
+          disabled={!value}
+          onClick={() => {
+            succFu(value, lastId.current)
+            MessageFu.success('设置成功')
+            closeFu()
+          }}
+        >
+          提交
+        </Button>
+        &emsp;
         <MyPopconfirm txtK='取消' onConfirm={closeFu} />
       </div>
     </Modal>

+ 12 - 11
src/pages/Y_goodsDetails/Y1cathet/Y44com.tsx

@@ -7,19 +7,20 @@ import { B3_4inputKeyArr } from '@/pages/B_enterTibet/B3_4page'
 import dayjs from 'dayjs'
 const { RangePicker } = DatePicker
 
-type InputKeyType = 'aaaa' | 'bbbb' | 'cccc' | 'dddd'
+type InputKeyType = 'num' | 'name' | 'deptName' | 'userName'
 
 const baseFormData: TypeY44form = {
   pageSize: 10,
   pageNum: 1,
-  aaaa: '',
-  bbbb: '',
-  cccc: '',
-  dddd: '',
+  num: '',
+  name: '',
+  deptName: '',
+  userName: '',
   startTime: '',
   endTime: '',
-  eeee: '',
-  ffff: ''
+  status: '',
+  // 待完善 type字段
+  type: ''
 }
 // 待完善 没有接入后端
 
@@ -158,8 +159,8 @@ function Y44com({ isLook, sId }: Props) {
                 <Select
                   placeholder='请选择'
                   style={{ width: 200 }}
-                  value={formData.ffff}
-                  onChange={e => setFormData({ ...formData, ffff: e })}
+                  value={formData.type}
+                  onChange={e => setFormData({ ...formData, type: e })}
                   options={[{ value: '', label: '全部' }]}
                 />
               </div>
@@ -169,8 +170,8 @@ function Y44com({ isLook, sId }: Props) {
                 <Select
                   placeholder='请选择'
                   style={{ width: 200 }}
-                  value={formData.eeee}
-                  onChange={e => setFormData({ ...formData, eeee: e })}
+                  value={formData.status}
+                  onChange={e => setFormData({ ...formData, status: e })}
                   options={[{ value: '', label: '全部' }]}
                 />
               </div>

+ 6 - 6
src/pages/Y_goodsDetails/Y1cathet/type.d.ts

@@ -1,12 +1,12 @@
 export type TypeY44form = {
   pageSize: number
   pageNum: number
-  aaaa: string
-  bbbb: string
-  cccc: string
-  dddd: string
+  num: string
+  name: string
+  deptName: string
+  userName: string
   startTime: string
   endTime: string
-  eeee: string
-  ffff: string
+  status: string
+  type: string
 }

+ 8 - 64
src/pages/Z_system/Z3flowSet/Z3edit/index.module.scss

@@ -14,11 +14,9 @@
       overflow-y: auto;
       padding: 24px;
       .Z3RowBox {
-        display: flex;
-        flex-wrap: wrap;
         font-size: 16px;
         .Z3row {
-          width: 43.8%;
+          width: 50%;
           margin-bottom: 20px;
           display: flex;
           .Z3row1 {
@@ -46,69 +44,15 @@
           }
         }
       }
-
-      // 审批
-      .Z3audBox {
-        margin-top: 20px;
-        padding-left: 20px;
-        width: 87.8%;
-        .Z3aTit {
-          font-size: 16px;
-          font-weight: 700;
-          margin-bottom: 15px;
-        }
-      }
     }
     .Z3btn {
-      position: absolute;
-      top: 50%;
-      right: 5%;
-      transform: translateY(-50%);
-      z-index: 10;
-    }
-  }
-}
-
-// 环节的新增/编辑弹窗
-.Z3addPro {
-  :global {
-    .ant-modal-close {
-      display: none;
-    }
-
-    .ant-modal {
-      width: 800px !important;
-    }
-    .ant-modal-body {
-      border-top: 1px solid #ccc;
-      .Z3aRow {
-        margin-top: 20px;
-        display: flex;
-        align-items: center;
-        .Z3aRowll {
-          width: 90px;
-          text-align: right;
-          font-weight: 700;
-          & > span {
-            color: #ff4d4f;
-          }
-        }
-        .Z3aRowrr {
-          width: calc(100% - 90px);
-          position: relative;
-          .fromRowTit {
-            position: absolute;
-            left: 100px;
-            top: 5px;
-            color: #999;
-            font-size: 12px;
-          }
-        }
-      }
-      .Z3aBtn {
-        margin-top: 30px;
-        text-align: center;
-      }
+      margin-top: 30px;
+      padding-left: 20px;
+      // position: absolute;
+      // top: 50%;
+      // right: 5%;
+      // transform: translateY(-50%);
+      // z-index: 10;
     }
   }
 }

+ 64 - 90
src/pages/Z_system/Z3flowSet/Z3edit/index.tsx

@@ -1,46 +1,37 @@
 import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
-import { Z3_APIgetInfo } from '@/store/action/Z3flowSet'
-import { Z3tableType } from '../data'
+import { Z3_APIgetInfo, Z3_APIsave } from '@/store/action/Z3flowSet'
 import { Button, Radio, Select } from 'antd'
 import TextArea from 'antd/es/input/TextArea'
 import MyPopconfirm from '@/components/MyPopconfirm'
-import { useDispatch, useSelector } from 'react-redux'
-import { getUserListAPI } from '@/store/action/Z6user'
-import { RootState } from '@/store'
 import { MessageFu } from '@/utils/message'
-import MyTable from '@/components/MyTable'
-import Z3addPro from './Z3addPro'
+import { UserTableListType } from '@/types'
+import { Z3tableType } from '../type'
 
 type Props = {
   sId: number
   closeFu: () => void
   succFu: () => void
+  userList: UserTableListType[]
 }
 
-function Z3edit({ sId, closeFu, succFu }: Props) {
-  // 获取用户列表
-  const dispatch = useDispatch()
-
-  useEffect(() => {
-    dispatch(getUserListAPI({ pageNum: 1, pageSize: 99999 }))
-  }, [dispatch])
-
-  const { list: userList } = useSelector((state: RootState) => state.Z6user.tableInfo)
-
+function Z3edit({ sId, closeFu, succFu, userList }: Props) {
   const [info, setInfo] = useState({} as Z3tableType)
 
   const getInfoFu = useCallback(async (id: number) => {
     const res = await Z3_APIgetInfo(id)
     if (res.code === 0) {
-      setInfo(res.data)
-    }
+      const data: Z3tableType = res.data
 
-    // 待完善
-    // const res2 = await Z3_APIgetProList(id)
-    // if (res2.code === 0) {
-    //   console.log(123, res2)
-    // }
+      const copyUserIds = (
+        data.copyUserIds ? data.copyUserIds.split(',').map(v => Number(v)) : ''
+      ) as string
+
+      setInfo({
+        ...data,
+        copyUserIds
+      })
+    }
   }, [])
 
   useEffect(() => {
@@ -71,11 +62,13 @@ function Z3edit({ sId, closeFu, succFu }: Props) {
       if (!copyUserIds) return MessageFu.warning('请选择抄送对象')
     } else obj.copyUserIds = ''
 
-    console.log('pppp', obj)
-  }, [info])
-
-  // 环节的新增和编辑
-  const [proId, setProId] = useState(0)
+    const res = await Z3_APIsave(obj)
+    if (res.code === 0) {
+      MessageFu.success('编辑成功')
+      succFu()
+      closeFu()
+    }
+  }, [closeFu, info, succFu])
 
   return (
     <div className={styles.Z3edit}>
@@ -90,52 +83,37 @@ function Z3edit({ sId, closeFu, succFu }: Props) {
             <div className='Z3row2'>{info.name}</div>
           </div>
 
-          <div className='Z3row Z3row2'>
-            <div className='Z3rowhh'>
-              <div className='Z3row1'>
-                <span> * </span> 流程状态:
-              </div>
-              <div className='Z3row2'>
-                <Radio checked={info.enabled === 1} onClick={() => formChange('enabled', 1)}>
-                  启用
-                </Radio>
-                &emsp;
-                <Radio checked={info.enabled === 0} onClick={() => formChange('enabled', 0)}>
-                  禁用
-                </Radio>
-              </div>
+          <div className='Z3row'>
+            <div className='Z3row1'>
+              <span> * </span> 流程状态:
             </div>
-
-            <div className='Z3rowhh'>
-              <div className='Z3row1'>
-                <span> * </span> 抄送规则:
-              </div>
-              <div className='Z3row2'>
-                <Radio checked={info.isCopy === 0} onClick={() => formChange('isCopy', 0)}>
-                  无需抄送
-                </Radio>
-                &emsp;
-                <Radio checked={info.isCopy === 1} onClick={() => formChange('isCopy', 1)}>
-                  完成时抄送
-                </Radio>
-              </div>
+            <div className='Z3row2'>
+              <Radio checked={info.enabled === 1} onClick={() => formChange('enabled', 1)}>
+                启用
+              </Radio>
+              &emsp;
+              <Radio checked={info.enabled === 0} onClick={() => formChange('enabled', 0)}>
+                禁用
+              </Radio>
             </div>
           </div>
 
           <div className='Z3row'>
-            <div className='Z3row1'>流程说明:</div>
+            <div className='Z3row1'>
+              <span> * </span> 抄送规则:
+            </div>
             <div className='Z3row2'>
-              <TextArea
-                maxLength={500}
-                showCount
-                placeholder='请输入内容'
-                value={info.remark}
-                onChange={e => formChange('remark', e.target.value)}
-              />
+              <Radio checked={info.isCopy === 0} onClick={() => formChange('isCopy', 0)}>
+                无需抄送
+              </Radio>
+              &emsp;
+              <Radio checked={info.isCopy === 1} onClick={() => formChange('isCopy', 1)}>
+                完成时抄送
+              </Radio>
             </div>
           </div>
 
-          <div className='Z3row' hidden={info.isCopy === 0}>
+          <div className='Z3row' hidden={info.isCopy !== 1}>
             <div className='Z3row1 Z3row1_2'>
               <span> * </span> 抄送对象:
             </div>
@@ -146,41 +124,37 @@ function Z3edit({ sId, closeFu, succFu }: Props) {
                 allowClear
                 style={{ width: '100%' }}
                 placeholder='请选择'
-                value={info.copyUserIds ? info.copyUserIds.split(',') : []}
+                value={info.copyUserIds ? info.copyUserIds : []}
                 onChange={value => formChange('copyUserIds', value)}
                 options={userList}
                 fieldNames={{ value: 'id', label: 'realName' }}
               />
             </div>
           </div>
-        </div>
 
-        {/* 审批环节 */}
-        <div className='Z3audBox'>
-          <div className='Z3aTit'>
-            审批环节:&emsp;
-            <Button type='primary' onClick={() => setProId(-1)}>
-              新增
-            </Button>
+          <div className='Z3row'>
+            <div className='Z3row1'>流程说明:</div>
+            <div className='Z3row2'>
+              <TextArea
+                maxLength={500}
+                showCount
+                placeholder='请输入内容'
+                value={info.remark}
+                onChange={e => formChange('remark', e.target.value)}
+              />
+            </div>
           </div>
-
-          {/* 表格 */}
-          <MyTable list={[]} columnsTemp={[]} lastBtn={[]} pagingInfo={false} />
         </div>
-      </div>
 
-      {/* 右侧按钮 */}
-      <div className='Z3btn'>
-        <Button type='primary' onClick={btnOk}>
-          保存
-        </Button>
-        <br />
-        <br />
-        <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+        {/* 右侧按钮 */}
+        <div className='Z3btn'>
+          <Button type='primary' onClick={btnOk}>
+            保存
+          </Button>{' '}
+          &emsp;
+          <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+        </div>
       </div>
-      {proId ? (
-        <Z3addPro sId={proId} closeFu={() => setProId(0)} succFu={() => {}} userList={userList} />
-      ) : null}
     </div>
   )
 }

+ 32 - 10
src/pages/Z_system/Z3flowSet/Z3edit/Z3addPro.tsx

@@ -2,29 +2,31 @@ import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, Input, InputNumber, Modal, Radio, Select, TreeSelect } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
-import { Z3_APIgetProInfo } from '@/store/action/Z3flowSet'
+import { Z3_APIgetProInfo, Z3_APIgetProSave } from '@/store/action/Z3flowSet'
 import { UserTableListType } from '@/types'
 import { useDispatch, useSelector } from 'react-redux'
 import { Z5_APIgetList } from '@/store/action/Z5role'
 import { RootState } from '@/store'
 import { D4_APIgetTree } from '@/store/action/Z4organization'
 import { MessageFu } from '@/utils/message'
+import { Z3proListType } from '../type'
 
 const baseFormData = {
   id: -1,
   name: '',
   type: '',
   sort: 999
-}
+} as Z3proListType
 
 type Props = {
   sId: number
   closeFu: () => void
   succFu: () => void
   userList: UserTableListType[]
+  flowId: number
 }
 
-function Z3addPro({ sId, closeFu, succFu, userList }: Props) {
+function Z3addPro({ sId, closeFu, succFu, userList, flowId }: Props) {
   const dispatch = useDispatch()
   // 获取角色列表
   const { list: roleList } = useSelector((state: RootState) => state.Z5role.tableInfo)
@@ -37,8 +39,17 @@ function Z3addPro({ sId, closeFu, succFu, userList }: Props) {
   const getInfoFu = useCallback(async (id: number) => {
     const res = await Z3_APIgetProInfo(id)
     if (res.code === 0) {
-      console.log(123, res)
-      // 待完善回显 多元数组
+      const data: Z3proListType = res.data
+
+      let moduleIds: any = data.moduleIds.split(',')
+
+      data.type === 'user'
+        ? setIdsArr1(moduleIds.map((v: any) => Number(v)))
+        : data.type === 'role'
+        ? setIdsArr2(moduleIds.map((v: any) => Number(v)))
+        : setIdsArr3(moduleIds)
+
+      setForm(data)
     }
   }, [])
 
@@ -88,12 +99,19 @@ function Z3addPro({ sId, closeFu, succFu, userList }: Props) {
 
     const obj = {
       ...form,
-      xxxxx: form.type === 'user' ? id1 : form.type === 'role' ? id2 : id3,
-      id: sId > 0 ? sId : null
+      moduleIds: form.type === 'user' ? id1 : form.type === 'role' ? id2 : id3,
+      id: sId > 0 ? sId : null,
+      flowId
     }
 
-    console.log(123, obj)
-  }, [form, idsArr1, idsArr2, idsArr3, sId])
+    const res = await Z3_APIgetProSave(obj)
+
+    if (res.code === 0) {
+      MessageFu.success(sId > 0 ? '编辑成功' : '新增成功')
+      succFu()
+      closeFu()
+    }
+  }, [closeFu, flowId, form, idsArr1, idsArr2, idsArr3, sId, succFu])
 
   return (
     <Modal
@@ -178,7 +196,11 @@ function Z3addPro({ sId, closeFu, succFu, userList }: Props) {
             multiple
             treeDefaultExpandAll
             value={idsArr3}
-            onChange={value => setIdsArr3(value)}
+            onChange={value => {
+              // console.log(123, value)
+
+              setIdsArr3(value)
+            }}
             treeData={treeData}
             fieldNames={{ value: 'id', label: 'name', children: 'children' }}
           />

+ 48 - 0
src/pages/Z_system/Z3flowSet/Z3linkSet/Z3lookPro.tsx

@@ -0,0 +1,48 @@
+import React, { useCallback, useEffect, useState } from 'react'
+import styles from './index.module.scss'
+import { Button, Modal } from 'antd'
+import { Z3_APIgetProGetUser } from '@/store/action/Z3flowSet'
+
+type Props = {
+  sId: number
+  closeFu: () => void
+}
+
+function Z3lookPro({ sId, closeFu }: Props) {
+  const [list, setList] = useState<string[]>([])
+
+  const getInfoFu = useCallback(async () => {
+    const res = await Z3_APIgetProGetUser(sId)
+    if (res.code === 0) {
+      setList((res.data || []).map((v: any) => v.realName))
+    }
+  }, [sId])
+
+  useEffect(() => {
+    getInfoFu()
+  }, [getInfoFu])
+
+  return (
+    <Modal
+      wrapClassName={styles.Z3lookPro}
+      destroyOnClose
+      open={true}
+      title='查看办理人'
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='Z3lMain'>
+        {list.length ? list.map(v => <span key={v}>{v}</span>) : <span>暂无</span>}
+      </div>
+
+      <div className='Z3lBtn'>
+        <Button onClick={closeFu}>关闭</Button>
+      </div>
+    </Modal>
+  )
+}
+
+const MemoZ3lookPro = React.memo(Z3lookPro)
+
+export default MemoZ3lookPro

+ 91 - 0
src/pages/Z_system/Z3flowSet/Z3linkSet/index.module.scss

@@ -0,0 +1,91 @@
+.Z3linkSet {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  border-radius: 10px;
+  background-color: #fff;
+  padding: 24px;
+  :global {
+    .Z3aTit {
+      display: flex;
+      align-items: center;
+      // text-align: right;
+      margin-bottom: 15px;
+    }
+    .ant-table-cell {
+      padding: 8px !important;
+    }
+  }
+}
+
+// 环节的新增/编辑弹窗
+.Z3addPro {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 800px !important;
+    }
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+      .Z3aRow {
+        margin-top: 20px;
+        display: flex;
+        align-items: center;
+        .Z3aRowll {
+          width: 90px;
+          text-align: right;
+          font-weight: 700;
+          & > span {
+            color: #ff4d4f;
+          }
+        }
+        .Z3aRowrr {
+          width: calc(100% - 90px);
+          position: relative;
+          .fromRowTit {
+            position: absolute;
+            left: 100px;
+            top: 5px;
+            color: #999;
+            font-size: 12px;
+          }
+        }
+      }
+      .Z3aBtn {
+        margin-top: 30px;
+        text-align: center;
+      }
+    }
+  }
+}
+
+// 查看办理人
+.Z3lookPro {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+
+      .Z3lMain {
+        margin-top: 15px;
+        & > span {
+          display: inline-block;
+          margin: 0 15px 15px;
+          font-size: 16px;
+        }
+      }
+      .Z3lBtn {
+        margin-top: 15px;
+        text-align: center;
+      }
+    }
+  }
+}

+ 122 - 0
src/pages/Z_system/Z3flowSet/Z3linkSet/index.tsx

@@ -0,0 +1,122 @@
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
+import styles from './index.module.scss'
+import { Button } from 'antd'
+import MyTable from '@/components/MyTable'
+import { UserTableListType } from '@/types'
+import { Z3_APIgetProDel, Z3_APIgetProList } from '@/store/action/Z3flowSet'
+import Z3addPro from './Z3addPro'
+import { Z3proListType } from '../type'
+import { Z3tableC2 } from '@/utils/tableData'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { MessageFu } from '@/utils/message'
+import Z3lookPro from './Z3lookPro'
+
+type Props = {
+  sId: number
+  closeFu: () => void
+  userList: UserTableListType[]
+  title: string
+}
+
+function Z3linkSet({ sId, closeFu, userList, title }: Props) {
+  const [table, setTable] = useState<Z3proListType[]>([])
+
+  const getListFu = useCallback(async () => {
+    const res = await Z3_APIgetProList(sId)
+    if (res.code === 0) {
+      const data: Z3proListType[] = res.data
+
+      setTable(
+        data.map((v, i) => ({
+          ...v,
+          sort: v.isUse === 0 ? '/' : v.sort,
+          type: v.isUse === 0 ? '/' : v.type
+        }))
+      )
+    }
+  }, [sId])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu])
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res: any = await Z3_APIgetProDel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功!')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: Z3proListType, _: any, index: number) => {
+          return item.isUse === 0 ? (
+            '/'
+          ) : (
+            <>
+              <Button size='small' type='text' onClick={() => setLookId(item.id)}>
+                查看办理人
+              </Button>
+              <Button size='small' type='text' onClick={() => setProId(item.id)}>
+                编辑
+              </Button>
+              <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+            </>
+          )
+        }
+      }
+    ]
+  }, [delTableFu])
+
+  // 环节的新增和编辑
+  const [proId, setProId] = useState(0)
+
+  // 查看办理人
+  const [lookId, setLookId] = useState(0)
+
+  return (
+    <div className={styles.Z3linkSet}>
+      <div className='Z3aTit'>
+        <h2>{title}</h2>&emsp;
+        <Button type='primary' onClick={() => setProId(-1)}>
+          新增
+        </Button>
+        &emsp;
+        <Button onClick={closeFu}>返回</Button>
+      </div>
+
+      {/* 表格 */}
+      <MyTable
+        classKey='Z3linkSet'
+        yHeight={700}
+        list={table}
+        columnsTemp={Z3tableC2}
+        lastBtn={tableLastBtn}
+        pagingInfo={false}
+      />
+
+      {proId ? (
+        <Z3addPro
+          flowId={sId}
+          sId={proId}
+          closeFu={() => setProId(0)}
+          succFu={getListFu}
+          userList={userList}
+        />
+      ) : null}
+
+      {lookId ? <Z3lookPro sId={lookId} closeFu={() => setLookId(0)} /> : null}
+    </div>
+  )
+}
+
+const MemoZ3linkSet = React.memo(Z3linkSet)
+
+export default MemoZ3linkSet

+ 0 - 23
src/pages/Z_system/Z3flowSet/data.ts

@@ -1,23 +0,0 @@
-// export type Z3formTypeType = '' | '入藏管理' | ' 藏品管理' | ' 库存管理' | ' 藏品保管' | ' 展览管理'
-
-export type Z3formType = {
-  enabled: null | 0 | 1
-  name: string
-  type: string | null
-}
-
-export type Z3tableType = {
-  copyUserIds: string
-  createTime: string
-  creatorId?: any
-  creatorName: string
-  enabled: number
-  id: number
-  isCopy: number
-  name: string
-  process?: any
-  remark: string
-  type: string
-  typeKey: string
-  updateTime: string
-}

+ 48 - 6
src/pages/Z_system/Z3flowSet/index.tsx

@@ -1,6 +1,5 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
-import { Z3formType, Z3tableType } from './data'
 import { useDispatch, useSelector } from 'react-redux'
 import { Z3_APIgetList } from '@/store/action/Z3flowSet'
 import { RootState } from '@/store'
@@ -9,6 +8,9 @@ import { selectObj } from '@/utils/select'
 import MyTable from '@/components/MyTable'
 import { Z3tableC } from '@/utils/tableData'
 import Z3edit from './Z3edit'
+import { getUserListAPI } from '@/store/action/Z6user'
+import Z3linkSet from './Z3linkSet'
+import { Z3formType, Z3tableType } from './type'
 
 const Z3baseFormData: Z3formType = {
   enabled: null,
@@ -19,6 +21,14 @@ const Z3baseFormData: Z3formType = {
 function Z3flowSet() {
   const dispatch = useDispatch()
 
+  // 获取用户列表
+
+  useEffect(() => {
+    dispatch(getUserListAPI({ pageNum: 1, pageSize: 99999 }))
+  }, [dispatch])
+
+  const { list: userList } = useSelector((state: RootState) => state.Z6user.tableInfo)
+
   const [formData, setFormData] = useState(Z3baseFormData)
   const formDataRef = useRef(Z3baseFormData)
 
@@ -68,15 +78,31 @@ function Z3flowSet() {
     }, 50)
   }, [])
 
+  // 环节配置 打开 关闭
+  const [proId, setProId] = useState(0)
+  const titleRef = useRef('')
+
   const tableLastBtn = useMemo(() => {
     return [
       {
         title: '操作',
         render: (item: Z3tableType) => {
           return (
-            <Button size='small' type='text' onClick={() => setEditId(item.id)}>
-              编辑
-            </Button>
+            <>
+              <Button
+                size='small'
+                type='text'
+                onClick={() => {
+                  titleRef.current = item.name
+                  setProId(item.id)
+                }}
+              >
+                环节配置
+              </Button>
+              <Button size='small' type='text' onClick={() => setEditId(item.id)}>
+                编辑
+              </Button>
+            </>
           )
         }
       }
@@ -88,7 +114,10 @@ function Z3flowSet() {
 
   return (
     <div className={styles.Z3flowSet}>
-      <div className='pageTitle'>流程设置{editId ? '-编辑' : ''}</div>
+      <div className='pageTitle'>
+        流程设置{editId ? '-编辑' : ''}
+        {proId ? '-环节配置' : ''}
+      </div>
       <div className='Z3top'>
         <div className='Z3topll'>
           流程设置:
@@ -136,7 +165,20 @@ function Z3flowSet() {
         widthSet={{ remark: 700 }}
       />
 
-      {editId ? <Z3edit sId={editId} closeFu={() => setEditId(0)} succFu={getListFu} /> : null}
+      {/* 编辑 */}
+      {editId ? (
+        <Z3edit userList={userList} sId={editId} closeFu={() => setEditId(0)} succFu={getListFu} />
+      ) : null}
+
+      {/* 环节配置 */}
+      {proId ? (
+        <Z3linkSet
+          title={titleRef.current}
+          sId={proId}
+          closeFu={() => setProId(0)}
+          userList={userList}
+        />
+      ) : null}
     </div>
   )
 }

+ 38 - 0
src/pages/Z_system/Z3flowSet/type.d.ts

@@ -0,0 +1,38 @@
+// 外层列表发送请求
+export type Z3formType = {
+  enabled: null | 0 | 1
+  name: string
+  type: string | null
+}
+
+// 外层列表
+export type Z3tableType = {
+  copyUserIds: string
+  createTime: string
+  creatorId?: any
+  creatorName: string
+  enabled: number
+  id: number
+  isCopy: number
+  name: string
+  process?: any
+  remark: string
+  type: string
+  typeKey: string
+  updateTime: string
+}
+
+// 环节配置列表
+export type Z3proListType = {
+  createTime: string
+  creatorId?: any
+  creatorName: string
+  flowId: number
+  id: number
+  isUse: number
+  moduleIds: string
+  name: string
+  sort: number | string
+  type: string
+  updateTime: string
+}

+ 4 - 1
src/store/action/D2storSet.ts

@@ -1,9 +1,10 @@
 import http from '@/utils/http'
 import { AppDispatch } from '..'
+import { TypeD2list } from '@/pages/D_storeManage/D2storSet/type'
 /**
  * 库房设置 - 获取分页列表
  */
-export const D2_APIgetList = (data: any): any => {
+export const D2_APIgetList = (data: any, backFu?: (arr: TypeD2list[]) => void): any => {
   return async (dispatch: AppDispatch) => {
     const res = await http.post('cms/storage/st/pageList', data)
     if (res.code === 0) {
@@ -12,6 +13,8 @@ export const D2_APIgetList = (data: any): any => {
         total: res.data.total
       }
       dispatch({ type: 'D2/getList', payload: obj })
+
+      if (backFu) backFu(obj.list)
     }
   }
 }

+ 47 - 9
src/store/action/D4impStor.ts

@@ -3,16 +3,19 @@ import { AppDispatch } from '..'
 /**
  * 入库 - 获取分页列表
  */
-export const D4_APIgetList = (data: any): any => {
-  return async (dispatch: AppDispatch) => {
-    const res = await http.post('cms/orderIn/page', data)
-    if (res.code === 0) {
-      const obj = {
-        list: res.data.records,
-        total: res.data.total
-      }
+export const D4_APIgetList = (data: any, exportFlag?: boolean): any => {
+  if (exportFlag) return http.post('cms/orderIn/page', data)
+  else {
+    return async (dispatch: AppDispatch) => {
+      const res = await http.post('cms/orderIn/page', data)
+      if (res.code === 0) {
+        const obj = {
+          list: res.data.records,
+          total: res.data.total
+        }
 
-      dispatch({ type: 'D4/getList', payload: obj })
+        dispatch({ type: 'D4/getList', payload: obj })
+      }
     }
   }
 }
@@ -37,3 +40,38 @@ export const D4_APIcreate = () => {
 export const D4_APIgetInfo = (id: number) => {
   return http.get(`cms/orderIn/detail/${id}`)
 }
+
+/**
+ * 入库-存草稿
+ */
+export const D4_APIsaveDraft = (data: any) => {
+  return http.post('cms/orderIn/saveDraft', data)
+}
+
+/**
+ * 入库-创建
+ */
+export const D4_APIsaveCreate = (data: any) => {
+  return http.post('cms/orderIn/saveCreate', data)
+}
+
+/**
+ * 入库-编辑保存
+ */
+export const D4_APIsaveApply = (data: any) => {
+  return http.post('cms/orderIn/saveApply', data)
+}
+
+/**
+ * 入库-审批
+ */
+export const D4_APIsaveAudit = (data: any) => {
+  return http.post('cms/orderIn/audit', data)
+}
+
+/**
+ * 入库-撤回订单
+ */
+export const D4_APIrevocation = (id: number) => {
+  return http.get(`cms/orderIn/revocation/${id}`)
+}

+ 9 - 9
src/store/action/FourAll.ts

@@ -12,7 +12,7 @@ export const FourAPI_getList = (data: any, key: FourKeyType, exportFlag?: boolea
     1: 'cms/orderHouse/page',
     2: 'cms/orderHide/page',
     3: 'cms/register/page',
-    4: 'cms/待完善删除/page'
+    4: 'cms/orderDel/page'
   }
   const url = urlObj[key]
 
@@ -40,7 +40,7 @@ export const FourAPI_create = (key: FourKeyType) => {
     1: 'cms/orderHouse/create',
     2: 'cms/orderHide/create',
     3: 'cms/register/create',
-    4: 'cms/待完善删除/create'
+    4: 'cms/orderDel/create'
   }
   const url = urlObj[key]
   return http.get(url)
@@ -54,7 +54,7 @@ export const FourAPI_getInfo = (key: FourKeyType, id: number) => {
     1: `cms/orderHouse/detail/${id}`,
     2: `cms/orderHide/detail/${id}`,
     3: `cms/register/detail/${id}`,
-    4: `cms/待完善删除/detail/${id}`
+    4: `cms/orderDel/detail/${id}`
   }
   const url = urlObj[key]
   return http.get(url)
@@ -68,7 +68,7 @@ export const FourAPI_saveDraft = (key: FourKeyType, data: any) => {
     1: 'cms/orderHouse/saveDraft',
     2: 'cms/orderHide/saveDraft',
     3: 'cms/register/saveDraft',
-    4: 'cms/待完善删除/saveDraft'
+    4: 'cms/orderDel/saveDraft'
   }
   const url = urlObj[key]
   return http.post(url, data)
@@ -82,7 +82,7 @@ export const FourAPI_saveCreate = (key: FourKeyType, data: any) => {
     1: 'cms/orderHouse/saveCreate',
     2: 'cms/orderHide/saveCreate',
     3: 'cms/register/saveCreate',
-    4: 'cms/待完善删除/saveCreate'
+    4: 'cms/orderDel/saveCreate'
   }
   const url = urlObj[key]
   return http.post(url, data)
@@ -96,7 +96,7 @@ export const FourAPI_del = (key: FourKeyType, id: number) => {
     1: `cms/orderHouse/remove/${id}`,
     2: `cms/orderHide/remove/${id}`,
     3: `cms/register/remove/${id}`,
-    4: `cms/待完善删除/remove/${id}`
+    4: `cms/orderDel/remove/${id}`
   }
   const url = urlObj[key]
   return http.get(url)
@@ -110,7 +110,7 @@ export const FourAPI_revocation = (key: FourKeyType, id: number) => {
     1: `cms/orderHouse/revocation/${id}`,
     2: `cms/orderHide/revocation/${id}`,
     3: `cms/register/revocation/${id}`,
-    4: `cms/待完善删除/revocation/${id}`
+    4: `cms/orderDel/revocation/${id}`
   }
   const url = urlObj[key]
   return http.get(url)
@@ -124,7 +124,7 @@ export const FourAPI_saveApply = (key: FourKeyType, data: any) => {
     1: 'cms/orderHouse/saveApply',
     2: 'cms/orderHide/saveApply',
     3: 'cms/register/saveApply',
-    4: 'cms/待完善删除/saveApply'
+    4: 'cms/orderDel/saveApply'
   }
   const url = urlObj[key]
   return http.post(url, data)
@@ -138,7 +138,7 @@ export const FourAPI_audit = (key: FourKeyType, data: any) => {
     1: 'cms/orderHouse/audit',
     2: 'cms/orderHide/audit',
     3: 'cms/register/audit',
-    4: 'cms/待完善删除/audit'
+    4: 'cms/orderDel/audit'
   }
   const url = urlObj[key]
   return http.post(url, data)

+ 28 - 0
src/store/action/Z3flowSet.ts

@@ -13,6 +13,13 @@ export const Z3_APIgetList = (data: any): any => {
 }
 
 /**
+ * 流程设置-编辑
+ */
+export const Z3_APIsave = (data: any) => {
+  return http.post('cms/flow/edit', data)
+}
+
+/**
  * 流程设置-获取详情
  */
 export const Z3_APIgetInfo = (id: number) => {
@@ -32,3 +39,24 @@ export const Z3_APIgetProList = (id: number) => {
 export const Z3_APIgetProInfo = (id: number) => {
   return http.get(`cms/flow/process/${id}`)
 }
+
+/**
+ * 流程设置- 环节-删除
+ */
+export const Z3_APIgetProDel = (id: number) => {
+  return http.get(`cms/flow/process/remove/${id}`)
+}
+
+/**
+ * 流程设置- 环节-新增/编辑
+ */
+export const Z3_APIgetProSave = (data: any) => {
+  return http.post('cms/flow/process/save', data)
+}
+
+/**
+ * 流程设置- 环节 - 列表
+ */
+export const Z3_APIgetProGetUser = (id: number) => {
+  return http.get(`cms/flow/process/getUser/${id}`)
+}

+ 3 - 3
src/store/reducer/D4impStor.ts

@@ -1,10 +1,10 @@
-import { TypeD4list } from '@/pages/D_storeManage/D4impStor/type'
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
 
 // 初始化状态
 const initState = {
   // 列表数据
   tableInfo: {
-    list: [] as TypeD4list[],
+    list: [] as FourTableType[],
     total: 0
   }
 }
@@ -12,7 +12,7 @@ const initState = {
 // 定义 action 类型
 type Props = {
   type: 'D4/getList'
-  payload: { list: TypeD4list[]; total: number }
+  payload: { list: FourTableType[]; total: number }
 }
 
 // reducer

+ 1 - 1
src/store/reducer/Z3flowSet.ts

@@ -1,4 +1,4 @@
-import { Z3tableType } from '@/pages/Z_system/Z3flowSet/data'
+import { Z3tableType } from '@/pages/Z_system/Z3flowSet/type'
 
 // 初始化状态
 const initState = {

+ 63 - 0
src/utils/history.ts

@@ -5,6 +5,7 @@ import { createHashHistory } from 'history'
 import { getTokenInfo } from './storage'
 import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
 import { TypeZ4Tree } from '@/pages/Z_system/Z4organization/type'
+import { KuIsTreeType } from '@/pages/D_storeManage/D4impStor/type'
 const history = createHashHistory()
 export default history
 
@@ -256,3 +257,65 @@ export const btnFlagFu2 = (item: FourTableType) => {
     盘点: true
   }
 }
+
+// -------------------排架层数库位平铺转树结构-------------------
+
+export function kuIsTreeChangeFu(arr: any[]): KuIsTreeType[] {
+  // 第一层缓存:region维度(value用id,label用regionName)
+  const regionMap = new Map<number, KuIsTreeType>()
+
+  // 第二层缓存:layer1维度(value用layer1数值)
+  const layer1Map = new Map<string, KuIsTreeType>()
+
+  // 第三层缓存:layer2维度(value用layer2数值)
+  const layer2Map = new Map<string, KuIsTreeType>()
+
+  arr.forEach(item => {
+    // 创建/获取区域节点
+    let regionNode = regionMap.get(item.regionId)
+    if (!regionNode) {
+      regionNode = {
+        value: item.id, // 注意:此处使用元素id作为value
+        label: item.regionName,
+        children: []
+      }
+      regionMap.set(item.regionId, regionNode)
+    }
+
+    // 创建/获取layer1节点
+    const layer1Key = `${item.regionId}-${item.layer1}`
+    let layer1Node = layer1Map.get(layer1Key)
+    if (!layer1Node) {
+      layer1Node = {
+        value: item.layer1,
+        label: String(item.layer1),
+        children: []
+      }
+      regionNode.children!.push(layer1Node)
+      layer1Map.set(layer1Key, layer1Node)
+    }
+
+    // 创建/获取layer2节点
+    const layer2Key = `${layer1Key}-${item.layer2}`
+    let layer2Node = layer2Map.get(layer2Key)
+    if (!layer2Node) {
+      layer2Node = {
+        value: item.layer2,
+        label: String(item.layer2),
+        children: []
+      }
+      layer1Node.children!.push(layer2Node)
+      layer2Map.set(layer2Key, layer2Node)
+    }
+
+    // 创建layer3节点
+    const layer3Node: KuIsTreeType = {
+      value: item.layer3,
+      label: String(item.layer3),
+      lastId: item.id
+    }
+    layer2Node.children!.push(layer3Node)
+  })
+
+  return Array.from(regionMap.values())
+}

+ 4 - 4
src/utils/select.ts

@@ -24,10 +24,10 @@ export const selectObj = {
   ],
   // 待完善
   库存状态: [
-    { value: 1, label: '待入库' },
-    { value: 2, label: '已入库' },
-    { value: 3, label: '待出库' },
-    { value: 4, label: '已出库' },
+    { value: 3, label: '待入库' },
+    { value: 1, label: '已入库' },
+    { value: 4, label: '待出库' },
+    { value: 2, label: '已出库' },
     { value: 5, label: '盘点中' },
     { value: 6, label: '注销中' }
   ],

+ 33 - 17
src/utils/tableData.ts

@@ -14,6 +14,8 @@
 //     ["text", "创建日期",'description', 50,A],
 //   ];
 
+import { selectObj } from './select'
+
 // 待完善
 export const B1TableC = [
   ['txt', '线索名称', 'description'],
@@ -106,7 +108,6 @@ export const C4tableC = [
   ['txt', '异常数据行数', 'hang3']
 ]
 
-// 待完善
 export const D1tableC = [
   ['txt', '区域名称', 'regionName'],
   ['txt', '排架', 'layer1'],
@@ -133,15 +134,14 @@ export const D2tableCSon = [
   ['text', '库位说明', 'description', 50]
 ]
 
-// 待完善
 export const D4tableC = [
-  ['txt', '申请编号', 'regionName'],
-  ['txt', '业务名称', 'layer1'],
-  ['txt', '入库库房', 'layer2'],
-  ['txt', '发起部门', 'layer3'],
-  ['txt', '发起人', 'layer3'],
-  ['txt', '发起日期', 'layer3'],
-  ['txt', '申请状态', 'layer3']
+  ['txt', '业务单号', 'num'],
+  ['txt', '申请名称', 'name'],
+  ['txt', '入库库房', 'storageName'],
+  ['txt', '发起部门', 'deptName'],
+  ['txt', '发送人', 'creatorName'],
+  ['txt', '发起日期', 'createTime'],
+  ['txtChange', '申请状态', 'status', statusObj]
 ]
 
 // 待完善
@@ -157,21 +157,26 @@ export const D6tableC = [
   ['txt', '申请状态', 'layer3']
 ]
 
-// 待完善
+// 库存状态obj
+const statusStorageObj: any = {}
+selectObj['库存状态'].forEach(v => {
+  statusStorageObj[v.value] = v.label
+})
+
 export const D4goodsTableC = [
   ['img', '封面图', 'thumb'],
-  ['txt', '编号类型', 'userName'],
-  ['txt', '藏品名称', 'userName'],
-  ['txt', '数量', 'userName'],
-  ['txt', '库存状态', 'userName']
+  ['txt', '编号类型', 'numName'],
+  ['txt', '藏品名称', 'name'],
+  ['ping', '数量', 'pcs', 'pcsUnit'],
+  ['txtChange', '库存状态', 'statusStorage', statusStorageObj]
 ]
 
 // 待完善
 export const D6goodsTableC = [
   ['img', '封面图', 'thumb'],
-  ['txt', '编号类型', 'userName'],
-  ['txt', '藏品名称', 'userName'],
-  ['txt', '数量', 'userName'],
+  ['txt', '编号类型', 'numName'],
+  ['txt', '藏品名称', 'name'],
+  ['ping', '数量', 'pcs', 'pcsUnit'],
   ['txt', '库存状态', 'userName']
 ]
 
@@ -212,6 +217,17 @@ export const Z3tableC = [
   ['text', '流程说明', 'remark', 50],
   ['txtChange', '状态', 'enabled', { 0: '禁用', 1: '启用' }]
 ]
+export const Z3tableC2 = [
+  ['index', '序号'],
+  ['txt', '节点名称', 'name'],
+  ['txt', '排序值', 'sort'],
+  [
+    'txtChange',
+    '办理人',
+    'type',
+    { user: '指定用户', role: '按角色', dept: '按部门主管', '/': '/' }
+  ]
+]
 
 export const Z5tableC = [
   ['txt', '角色名称', 'roleName'],