Jelajahi Sumber

藏品注销-up

shaogen1995 3 bulan lalu
induk
melakukan
04f226f79b

+ 1 - 1
src/pages/B_enterTibet/B1collect/B1edit/index.tsx

@@ -278,7 +278,7 @@ function B1edit() {
         {['3'].includes(key) ? (
           <X3auditInfo
             dirCode='B1collect'
-            myUrl='cms/orderCollect/upload'
+            myUrl='cms/goodsFile/upload'
             auditSta={auditSta}
             auditStaFu={val => setAuDitSta(val)}
             ref={ZAuditRef}

+ 1 - 1
src/pages/B_enterTibet/B2identify/B2edit/index.tsx

@@ -330,7 +330,7 @@ function B2edit() {
         {['3'].includes(key) ? (
           <X3auditInfo
             dirCode='B2identify'
-            myUrl='cms/orderAuth/upload'
+            myUrl='cms/goodsFile/upload'
             auditSta={auditSta}
             auditStaFu={val => setAuDitSta(val)}
             ref={ZAuditRef}

+ 1 - 1
src/pages/C_goodsManage/C1register/AddGoods/index.tsx

@@ -708,7 +708,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
                   <ZRichTexts
                     check={false}
                     dirCode='goodsAdd'
-                    myUrl='cms/goods/upload'
+                    myUrl='cms/goodsFile/upload'
                     isLook={false}
                     ref={ZRichTextRef}
                     isOne={true}

+ 2 - 2
src/pages/C_goodsManage/C1register/C1look/index.tsx

@@ -86,7 +86,7 @@ function C1look() {
     const res = await FourAPI_del('3', id)
     if (res.code === 0) {
       MessageFu.success('删除成功')
-      history.push('/cancel')
+      history.push('/goodEdit')
     }
   }, [id])
 
@@ -164,7 +164,7 @@ function C1look() {
             <X3auditInfo
               titHide={true}
               dirCode='C1register'
-              myUrl='cms/register/upload'
+              myUrl='cms/goodsFile/upload'
               auditSta={auditSta}
               auditStaFu={val => setAuDitSta(val)}
               ref={ZAuditRef}

+ 1 - 1
src/pages/C_goodsManage/C22goodEdit/C22look/index.tsx

@@ -226,7 +226,7 @@ function C22look() {
             <X3auditInfo
               titHide={true}
               dirCode='C22orderEdit'
-              myUrl='cms/orderEdit/upload'
+              myUrl='cms/goodsFile/upload'
               auditSta={auditSta}
               auditStaFu={val => setAuDitSta(val)}
               ref={ZAuditRef}

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

@@ -499,7 +499,7 @@ function D4edit() {
         {['3'].includes(key) ? (
           <X3auditInfo
             dirCode='D4impStor'
-            myUrl='cms/orderIn/upload'
+            myUrl='cms/goodsFile/upload'
             auditSta={auditSta}
             auditStaFu={val => setAuDitSta(val)}
             ref={ZAuditRef}
@@ -627,7 +627,7 @@ function D4edit() {
               <ZRichTexts
                 check={false}
                 dirCode='impStor'
-                myUrl='cms/orderIn/upload'
+                myUrl='cms/goodsFile/upload'
                 isLook={['3', '4'].includes(key)}
                 ref={ZRichTextRef}
                 isOne={true}

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

@@ -385,7 +385,7 @@ function D6edit() {
         {['3'].includes(key) ? (
           <X3auditInfo
             dirCode='putsStor'
-            myUrl='cms/orderOut/upload'
+            myUrl='cms/goodsFile/upload'
             auditSta={auditSta}
             auditStaFu={val => setAuDitSta(val)}
             ref={ZAuditRef}
@@ -535,7 +535,7 @@ function D6edit() {
               <ZRichTexts
                 check={false}
                 dirCode='putsStor'
-                myUrl='cms/orderOut/upload'
+                myUrl='cms/goodsFile/upload'
                 isLook={['3', '4'].includes(key)}
                 ref={ZRichTextRef}
                 isOne={true}

+ 119 - 0
src/pages/D_storeManage/D8cancel/D8edit/index.module.scss

@@ -0,0 +1,119 @@
+.D8edit {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 24px 0px;
+  :global {
+    .D8Tit {
+      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;
+      }
+    }
+
+    .D8Tit2 {
+      margin-top: 24px;
+      display: flex;
+      justify-content: space-between;
+      border-bottom: 1px solid #ccc;
+      margin-bottom: 20px;
+      .D8Tit2ll {
+        font-size: 18px;
+        font-weight: 700;
+        padding-left: 18px;
+        margin-bottom: 17px;
+        color: var(--themeColor);
+      }
+      .D8Tit2rr {
+        position: relative;
+        z-index: 2;
+        .ant-btn {
+          margin-left: 15px;
+        }
+      }
+    }
+
+    .D8main {
+      width: 100%;
+      height: calc(100% - 70px);
+      overflow-y: auto;
+      padding-bottom: 40px;
+
+      .D8rowAll {
+        display: flex;
+        justify-content: space-between;
+        align-items: self-start;
+        font-size: 16px;
+        flex-wrap: wrap;
+        .D8row {
+          width: 48%;
+          display: flex;
+          align-items: center;
+          margin-bottom: 20px;
+          min-height: 32px;
+          .D8rowll {
+            width: 110px;
+            text-align: right;
+            font-weight: 700;
+            & > span {
+              color: #ff4d8f;
+            }
+          }
+          .D8rowrr {
+            width: calc(100% - 110px);
+            .ant-input-affix-wrapper {
+              width: 300px;
+            }
+            .ant-select {
+              width: 300px;
+            }
+          }
+        }
+        .D8row2 {
+          align-items: self-start;
+          .D8rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+        .D8row3 {
+          position: relative;
+          top: 4px;
+        }
+
+        .D8rowFull {
+          width: 100%;
+          align-items: self-start;
+          margin-bottom: 0;
+          .D8rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+      }
+
+      // 藏品清单
+      .D8googsBox {
+        padding-right: 20px;
+      }
+    }
+
+    .D8btn {
+      position: absolute;
+      bottom: 20px;
+      left: 134px;
+      .ant-btn {
+        margin-right: 20px;
+      }
+    }
+    .ant-table-cell {
+      padding: 8px !important;
+    }
+  }
+}

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

@@ -0,0 +1,559 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { useParams } from 'react-router-dom'
+import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
+import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
+import {
+  D8_APIcreate,
+  D8_APIdel,
+  D8_APIgetInfo,
+  D8_APIrevocation,
+  D8_APIsaveApply,
+  D8_APIsaveAudit,
+  D8_APIsaveCreate,
+  D8_APIsaveDraft
+} from '@/store/action/D8cancel'
+import { pageTitTxtObj } from '../../D4impStor/D4edit'
+import { MessageFu } from '@/utils/message'
+import history, { btnFlagFu2, openGoodsInfoFu } from '@/utils/history'
+import TextArea from 'antd/es/input/TextArea'
+import { Button } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { EXbtnFu } from '@/utils/EXBtn'
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
+import { D8tableCgoods, statusObj } from '@/utils/tableData'
+import ZRichTexts from '@/components/ZRichTexts'
+import MyTable from '@/components/MyTable'
+import ZflowTable from '@/components/ZflowTable'
+import ZupFileTable from '@/components/ZupFileTable'
+import ZGaddNow from '@/components/ZGaddNow'
+import classNames from 'classnames'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+
+const tableArrTemp = [
+  { name: '注销后去向', key: 'txt1' },
+  { name: '注销原因', key: 'txt2' },
+  { name: '备注', key: 'txt3' }
+]
+
+function D8edit() {
+  const { key, id } = useParams<any>()
+  // key:1 新增 2编辑 3审批 4查看
+  // 滚到顶部
+  const sollrDom = useRef<HTMLDivElement>(null)
+  // 顶部数据
+  const [topInfo, setTopInfo] = useState({} as FourTableType)
+
+  // 藏品清单快照数据
+  const [snaps, setSnaps] = useState<C1GoodType[]>([])
+  const delSnapIdsRef = useRef<number[]>([])
+
+  const snapsID2ref = useRef<{ goodsId: number; id: number }[]>([])
+
+  // 创建订单
+  const creatFu = useCallback(async () => {
+    const res = await D8_APIcreate()
+    if (res.code === 0) {
+      setTopInfo(res.data)
+    }
+  }, [])
+
+  // 获取详情
+  const getInfoFu = useCallback(async () => {
+    const res = await D8_APIgetInfo(id)
+    if (res.code === 0) {
+      const data = res.data
+
+      setTopInfo(data)
+      // 设置富文本
+      ZRichTextRef.current?.ritxtShowFu(JSON.parse(data.rtf || '{}'))
+
+      // 藏品清单快照信息id对比
+      const arrTemp: any = []
+      const snapsTemp = data.snaps || []
+
+      snapsTemp.forEach((v: any) => {
+        snapsID2ref.current.push({ goodsId: v.goodsId, id: v.id })
+
+        const obj = JSON.parse(v.snap || '{}')
+        if (obj.id) obj.id2 = v.id
+
+        arrTemp.push(obj)
+      })
+      setSnaps(arrTemp)
+    }
+  }, [id])
+
+  useEffect(() => {
+    if (key === '1') creatFu()
+    else getInfoFu()
+
+    if (sollrDom.current) sollrDom.current.scrollTop = 0
+  }, [creatFu, getInfoFu, key])
+
+  const pageTitTxt = useMemo(() => {
+    return Reflect.get(pageTitTxtObj, key)
+  }, [key])
+
+  // 备注的ref
+  const ZRichTextRef = useRef<any>(null)
+
+  // 审批意见的ref
+  const ZAuditRef = useRef<any>(null)
+
+  // 审批的sta
+  const [auditSta, setAuDitSta] = useState('')
+
+  // 新增的底部按钮点击
+  const btnClickFu = useCallback(
+    async (val: '草稿' | '创建' | '保存' | '审批') => {
+      if (val !== '草稿') {
+        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+      }
+
+      if (val === '审批') {
+        // console.log('审批信息富文本', rtf2)
+        if (!auditSta) {
+          if (sollrDom.current) sollrDom.current.scrollTop = 0
+          return MessageFu.warning('请选择审批结果')
+        }
+        const rtf2 = ZAuditRef.current?.resData()
+
+        const res = await D8_APIsaveAudit({
+          orderId: topInfo.id,
+          rtfOpinion: rtf2,
+          status: auditSta === '同意' ? 1 : 2
+        })
+
+        if (res.code === 0) {
+          MessageFu.success('审批成功')
+          // 跳详情页
+          history.push(`/cancel_edit/4/${topInfo.id}`)
+        }
+      } else {
+        // 多个富文本
+        const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+
+        const obj = {
+          ...topInfo,
+          rtf: JSON.stringify(rtf1.val || ''),
+          goodsIds: snaps.map(v => v.id).join(','),
+          delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
+          snaps: snaps.map(v => ({
+            goodsId: v.id,
+            id: v.id2 ? v.id2 : null,
+            orderId: topInfo.id,
+            snap: JSON.stringify(v)
+          }))
+        }
+        // console.log(123, obj.snaps)
+
+        // if (1 + 1 === 2) return
+
+        if (val === '草稿') {
+          // 存草稿 当前页保存 不跳转
+          const res = await D8_APIsaveDraft(obj)
+          if (res.code === 0) {
+            MessageFu.success('草稿保存成功')
+          }
+        } else {
+          const res = val === '创建' ? await D8_APIsaveCreate(obj) : await D8_APIsaveApply(obj)
+          if (res.code === 0) {
+            MessageFu.success(`${val}成功`)
+            // 跳到详情页
+            history.push(`/cancel_edit/4/${topInfo.id}`)
+          }
+        }
+      }
+    },
+    [auditSta, snaps, topInfo]
+  )
+
+  // 打开侧边栏
+  const [cathet, setCathet] = useState(0)
+
+  const startBtn = useMemo(() => {
+    return [
+      {
+        title: '藏品编号',
+        render: (item: C1GoodType) => {
+          return (
+            <span
+              onClick={() => setCathet(item.id)}
+              className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
+            >
+              {item.num}
+            </span>
+          )
+        }
+      }
+    ]
+  }, [cathet])
+
+  // 表格的输入框改变
+  const tableInputChange = useCallback(
+    (id: number, val: string, key: 'txt1') => {
+      setSnaps(
+        snaps.map(v => ({
+          ...v,
+          [key]: v.id === id ? val : v[key]
+        }))
+      )
+    },
+    [snaps]
+  )
+
+  const tableLastBtn = useMemo(() => {
+    const arr: any = []
+
+    tableArrTemp.forEach(v => {
+      arr.push({
+        title: v.name,
+        width: 150,
+        render: (item: C1GoodType) => {
+          return (
+            <TextArea
+              readOnly={['3', '4'].includes(key)}
+              placeholder={
+                ['3', '4'].includes(key) && !item[v.key as 'txt1']
+                  ? '(空)'
+                  : '请输入内容,不超过200字'
+              }
+              maxLength={200}
+              value={item[v.key as 'txt1']}
+              onChange={e => tableInputChange(item.id, e.target.value, v.key as 'txt1')}
+            />
+          )
+        }
+      })
+    })
+
+    arr.push({
+      title: '操作',
+      render: (item: C1GoodType) => {
+        return (
+          <>
+            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+              查看
+            </Button>
+            {['3', '4'].includes(key) ? null : (
+              <MyPopconfirm
+                txtK='删除'
+                onConfirm={() => {
+                  if (item.id2 && !delSnapIdsRef.current.includes(item.id2))
+                    delSnapIdsRef.current.push(item.id2)
+                  setSnaps(snaps.filter(v => v.id !== item.id))
+                }}
+              />
+            )}
+          </>
+        )
+      }
+    })
+
+    return arr
+  }, [key, snaps, tableInputChange])
+
+  // 点击添加按钮
+  const [nowSta, setNowSta] = useState({ key: '', id: '' })
+
+  // 查看的按钮创建-提交-撤回
+  const lookBtnFu = useCallback(
+    async (val: '创建' | '提交' | '撤回') => {
+      if (val !== '撤回') {
+        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+      }
+
+      // 富文本
+      const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+
+      const obj = {
+        ...topInfo,
+        rtf: JSON.stringify(rtf1.val || ''),
+        goodsIds: snaps.map(v => v.id).join(','),
+        delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
+        snaps: snaps.map(v => ({
+          goodsId: v.id,
+          id: v.id2 ? v.id2 : null,
+          orderId: topInfo.id,
+          snap: JSON.stringify(v)
+        }))
+      }
+
+      // console.log(123, obj.snaps)
+
+      // if (1 + 1 === 2) return
+
+      const res =
+        val === '创建'
+          ? await D8_APIsaveCreate(obj)
+          : val === '提交'
+          ? await D8_APIsaveApply(obj)
+          : await D8_APIrevocation(id)
+
+      if (res.code === 0) {
+        if (sollrDom.current) sollrDom.current.scrollTop = 0
+        MessageFu.success(val + '成功')
+        getInfoFu()
+      }
+    },
+    [getInfoFu, id, snaps, topInfo]
+  )
+
+  // 查看模式点击删除
+  const delFu = useCallback(async () => {
+    const res = await D8_APIdel(id)
+    if (res.code === 0) {
+      MessageFu.success('删除成功')
+      history.push('/cancel')
+    }
+  }, [id])
+
+  // 查看模式点击审批 编辑
+  const lookJumpFu = useCallback(
+    (val: '审批' | '编辑') => {
+      history.push(`/cancel_edit/${val === '审批' ? 3 : 2}/${id}`)
+      MessageFu.success(`已跳转至${val}页面`)
+    },
+    [id]
+  )
+
+  // 查看模式下的按钮
+  const lookBtn = useMemo(() => {
+    return (
+      <>
+        {btnFlagFu2(topInfo)['创建'] ? (
+          <Button type='primary' onClick={() => lookBtnFu('创建')}>
+            创建
+          </Button>
+        ) : null}
+        {btnFlagFu2(topInfo)['提交'] ? (
+          <Button type='primary' onClick={() => lookBtnFu('提交')}>
+            提交
+          </Button>
+        ) : null}
+
+        {btnFlagFu2(topInfo)['撤回'] ? (
+          <MyPopconfirm
+            txtK='撤回'
+            onConfirm={() => lookBtnFu('撤回')}
+            Dom={
+              <Button type='primary' danger>
+                撤回
+              </Button>
+            }
+          />
+        ) : null}
+
+        {btnFlagFu2(topInfo)['审批'] ? (
+          <Button type='primary' onClick={() => lookJumpFu('审批')}>
+            审批
+          </Button>
+        ) : null}
+        {btnFlagFu2(topInfo)['编辑'] ? (
+          <Button type='primary' onClick={() => lookJumpFu('编辑')}>
+            编辑
+          </Button>
+        ) : null}
+
+        {btnFlagFu2(topInfo)['重新提交'] ? (
+          <Button type='primary' onClick={() => lookBtnFu('提交')}>
+            重新提交
+          </Button>
+        ) : null}
+
+        {EXbtnFu(topInfo)}
+
+        {btnFlagFu2(topInfo)['删除'] ? (
+          <MyPopconfirm
+            txtK='删除'
+            onConfirm={() => delFu()}
+            Dom={
+              <Button type='primary' danger>
+                删除
+              </Button>
+            }
+          />
+        ) : null}
+
+        <Button onClick={() => history.push('/cancel')}>返回</Button>
+      </>
+    )
+  }, [delFu, lookBtnFu, lookJumpFu, topInfo])
+
+  // 申请记录
+  const [auditsShow, setAuditsShow] = useState(false)
+
+  return (
+    <div className={styles.D8edit}>
+      <div className='pageTitle'>藏品注销-{pageTitTxt}</div>
+
+      <div className='D8main'>
+        {['3'].includes(key) ? (
+          <X3auditInfo
+            dirCode='D8cancel'
+            myUrl='cms/goodsFile/upload'
+            auditSta={auditSta}
+            auditStaFu={val => setAuDitSta(val)}
+            ref={ZAuditRef}
+          />
+        ) : null}
+
+        {/* 表单字段、附件等 */}
+        <div className='D8Tit'>
+          申请信息
+          {key === '1' ? null : (
+            <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
+          )}
+        </div>
+
+        <div className='D8rowAll'>
+          {topInfo.id ? (
+            <>
+              <div className='D8row'>
+                <div className='D8rowll'>业务单号:</div>
+                <div className='D8rowrr'>{topInfo.num}</div>
+              </div>
+
+              <div className='D8row'>
+                <div className='D8rowll'>业务名称:</div>
+                <div className='D8rowrr'>{topInfo.name}</div>
+              </div>
+
+              <div className='D8row'>
+                <div className='D8rowll'>发起人:</div>
+                <div className='D8rowrr'>
+                  {topInfo.creatorName} - {topInfo.createTime}
+                </div>
+              </div>
+
+              <div className='D8row'>
+                <div className='D8rowll'>发起部门:</div>
+                <div className='D8rowrr'>{topInfo.deptName}</div>
+              </div>
+            </>
+          ) : null}
+
+          <div className='D8row D8rowFull'>
+            <div className='D8rowll'>备注:</div>
+            <div className='D8rowrr'>
+              <ZRichTexts
+                check={false}
+                dirCode='D8cancel'
+                myUrl='cms/goodsFile/upload'
+                isLook={['3', '4'].includes(key)}
+                ref={ZRichTextRef}
+                isOne={true}
+                upAudioBtnNone={true}
+              />
+            </div>
+          </div>
+        </div>
+
+        {/* 藏品清单 */}
+        <div className='D8googsBox'>
+          <div className='D8Tit2'>
+            <div className='D8Tit2ll'>藏品清单</div>
+            <div className='D8Tit2rr'>
+              {['3', '4'].includes(key) ? null : (
+                <Button
+                  type='primary'
+                  onClick={() =>
+                    setNowSta({
+                      key: 'D8',
+                      id: 'cms/orderLogout/goods/getList'
+                    })
+                  }
+                >
+                  添加
+                </Button>
+              )}
+            </div>
+          </div>
+
+          {/* 表格 */}
+          <MyTable
+            list={snaps}
+            columnsTemp={D8tableCgoods}
+            startBtn={startBtn}
+            lastBtn={tableLastBtn}
+            pagingInfo={false}
+          />
+        </div>
+
+        {/* 申请流程 */}
+        {auditsShow ? (
+          <ZflowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
+        ) : null}
+
+        {/* 底部按钮 */}
+        <div className='D8btn'>
+          {['3', '4'].includes(key) && topInfo.audits && topInfo.audits.length ? (
+            <Button type='primary' onClick={() => setAuditsShow(true)}>
+              申请记录
+            </Button>
+          ) : null}
+
+          {key === '4' ? (
+            lookBtn
+          ) : (
+            <>
+              {key === '3' ? (
+                <Button type='primary' onClick={() => btnClickFu('审批')}>
+                  审批
+                </Button>
+              ) : (
+                <Button type='primary' onClick={() => btnClickFu(key === '1' ? '创建' : '保存')}>
+                  {key === '1' ? '创建' : '保存'}
+                </Button>
+              )}
+
+              {key === '1' ? (
+                <Button type='primary' onClick={() => btnClickFu('草稿')}>
+                  存草稿
+                </Button>
+              ) : null}
+
+              <MyPopconfirm txtK='取消' onConfirm={() => history.push('/cancel')} />
+            </>
+          )}
+        </div>
+
+        {/* 附件归档 */}
+        {topInfo.status === 4 ? (
+          <ZupFileTable
+            listTemp={topInfo.filing || []}
+            dirCode='D8repair'
+            myUrl='cms/orderLogout/upload'
+            fromData={{ moduleId: topInfo.id }}
+          />
+        ) : null}
+      </div>
+
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+
+      {nowSta.id ? (
+        <ZGaddNow
+          nowSta={nowSta}
+          closeFu={() => setNowSta({ key: '', id: '' })}
+          dataResFu={data => {
+            const dataTemp = [...data]
+            dataTemp.forEach(v => {
+              // id2表示的是自己这条数据的id id才是goodsId
+              const obj = snapsID2ref.current.find(c => c.goodsId === v.id)
+
+              if (obj) v.id2 = obj.id
+            })
+            setSnaps(dataTemp)
+          }}
+          oldCheckArr={snaps}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoD8edit = React.memo(D8edit)
+
+export default MemoD8edit

+ 38 - 0
src/pages/D_storeManage/D8cancel/index.module.scss

@@ -1,4 +1,42 @@
 .D8cancel {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 24px 24px 0;
   :global {
+    .D8top {
+      display: flex;
+      justify-content: space-between;
+      .D8topLL {
+        display: flex;
+        width: calc(100% - 340px);
+        & > div {
+          margin-right: 15px;
+          position: relative;
+          &:last-of-type {
+            margin-right: 0;
+          }
+          .ant-select {
+            width: 150px;
+          }
+          & > span {
+            position: absolute;
+            top: -20px;
+            left: 0;
+          }
+        }
+      }
+      .D8topRR {
+        display: flex;
+        justify-content: space-between;
+        width: 320px;
+      }
+      .ant-select-selection-placeholder {
+        color: black;
+      }
+      margin-bottom: 20px;
+    }
+    .ant-table-cell {
+      padding: 8px !important;
+    }
   }
 }

+ 273 - 2
src/pages/D_storeManage/D8cancel/index.tsx

@@ -1,10 +1,281 @@
-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 { useDispatch, useSelector } from 'react-redux'
+import { C22baseFormData, C22InputKeyType } from '@/pages/C_goodsManage/C22goodEdit/data'
+import { D8_APIdel, D8_APIgetList } from '@/store/action/D8cancel'
+import { RootState } from '@/store'
+import { MessageFu } from '@/utils/message'
+import history, { btnFlagFu } from '@/utils/history'
+import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import dayjs from 'dayjs'
+import { D8tableC, statusObj } from '@/utils/tableData'
+import ExportJsonExcel from 'js-export-excel'
+import { selectObj } from '@/utils/select'
+import MyTable from '@/components/MyTable'
+const { RangePicker } = DatePicker
+
 function D8cancel() {
+  const dispatch = useDispatch()
+
+  const [formData, setFormData] = useState(C22baseFormData)
+  const formDataRef = useRef(C22baseFormData)
+  const formDataOldRef = useRef(C22baseFormData)
+
+  useEffect(() => {
+    formDataRef.current = formData
+  }, [formData])
+
+  // 点击搜索的 时间戳
+  const [timeKey, setTimeKey] = useState(0)
+
+  // 点击搜索
+  const clickSearch = useCallback(() => {
+    setFormData({ ...formData, pageNum: 1 })
+    setTimeout(() => {
+      setTimeKey(Date.now())
+    }, 50)
+  }, [formData])
+
+  // 时间选择器改变
+  const timeChange = useCallback(
+    (date: any, dateString: any) => {
+      let startTime = ''
+      let endTime = ''
+      if (dateString[0] && dateString[1]) {
+        startTime = dateString[0] + ' 00:00:00'
+        endTime = dateString[1] + ' 23:59:59'
+      }
+      setFormData({ ...formData, startTime, endTime })
+    },
+    [formData]
+  )
+
+  // 封装发送请求的函数
+  const getListFu = useCallback(() => {
+    formDataOldRef.current = { ...formDataRef.current }
+    dispatch(D8_APIgetList(formDataRef.current))
+  }, [dispatch])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu, timeKey])
+
+  // 输入框的改变
+  const txtChangeFu = useCallback(
+    (txt: string, key: C22InputKeyType) => {
+      setFormData({
+        ...formData,
+        [key]: txt
+      })
+    },
+    [formData]
+  )
+
+  // 从仓库中获取数据
+  const tableInfo = useSelector((state: RootState) => state.D8cancel.tableInfo)
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setFormData(C22baseFormData)
+    setTimeout(() => {
+      setTimeKey(Date.now())
+    }, 50)
+  }, [])
+
+  // 页码变化
+  const paginationChange = useCallback(
+    (pageNum: number, pageSize: number) => {
+      setFormData({ ...formData, pageNum, pageSize })
+      setTimeout(() => {
+        setTimeKey(Date.now())
+      }, 50)
+    },
+    [formData]
+  )
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await D8_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
+  // 点击操作按钮
+  const tableBtnFu = useCallback((id: number, key: string) => {
+    history.push(`/cancel_edit/${key}/${id}`)
+  }, [])
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: FourTableType) => {
+          let obj = btnFlagFu(item)
+          return !Object.values(obj).some(Boolean) ? (
+            '-'
+          ) : (
+            <>
+              {obj['编辑'] ? (
+                <Button size='small' type='text' onClick={() => tableBtnFu(item.id, '2')}>
+                  编辑
+                </Button>
+              ) : null}
+
+              {obj['审批'] ? (
+                <Button size='small' type='text' onClick={() => tableBtnFu(item.id, '3')}>
+                  审批
+                </Button>
+              ) : null}
+              {obj['查看'] ? (
+                <Button size='small' type='text' onClick={() => tableBtnFu(item.id, '4')}>
+                  查看
+                </Button>
+              ) : null}
+
+              {obj['删除'] ? (
+                <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+              ) : null}
+            </>
+          )
+        }
+      }
+    ]
+  }, [delTableFu, tableBtnFu])
+
+  // 点击导出
+  const deriveFu = useCallback(async () => {
+    const name = '藏品注销' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
+
+    const res = await D8_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', 'deptName', 'creatorName', 'createTime', 'status'],
+
+            sheetHeader: ['业务单号', '发起部门', '发送人', '发起日期', '申请状态'],
+            columnWidths: [10, 10, 10, 10, 10, 10, 10, 10]
+          }
+        ]
+      }
+
+      const toExcel = new ExportJsonExcel(option) //new
+      toExcel.saveExcel() //保存
+    }
+  }, [])
+
   return (
     <div className={styles.D8cancel}>
       <div className='pageTitle'>藏品注销</div>
-      <p>待开发</p>
+      <div className='D8top'>
+        <div className='D8topLL'>
+          <div>
+            <span>业务单号:</span>
+            <Input
+              placeholder='请输入业务单号'
+              maxLength={30}
+              value={formData.num}
+              onChange={e => txtChangeFu(e.target.value, 'num')}
+            />
+          </div>
+          <div>
+            <span>发起部门:</span>
+            <Input
+              placeholder='请输入发起部门'
+              maxLength={30}
+              value={formData.deptName}
+              onChange={e => txtChangeFu(e.target.value, 'deptName')}
+            />
+          </div>
+          <div>
+            <span>发起人:</span>
+            <Input
+              placeholder='请输入发起人'
+              maxLength={30}
+              value={formData.userName}
+              onChange={e => txtChangeFu(e.target.value, 'userName')}
+            />
+          </div>
+          <div>
+            <span>发起日期范围:</span>
+            <RangePicker
+              value={
+                formData.startTime ? [dayjs(formData.startTime), dayjs(formData.endTime)] : null
+              }
+              onChange={timeChange}
+            />
+          </div>
+          <div>
+            <span>申请状态:</span>
+            <Select
+              allowClear={true}
+              placeholder='全部'
+              value={formData.status ? formData.status : null}
+              onChange={e => setFormData({ ...formData, status: e })}
+              options={selectObj['申请状态'].filter(v => v.label !== '待盘点')}
+            />
+          </div>
+
+          <div>
+            <span>选择角色:</span>
+            <Select
+              allowClear={true}
+              placeholder='全部'
+              options={selectObj['角色']}
+              // fieldNames={{ value: 'id', label: 'roleName' }}
+              value={formData.userType ? formData.userType : null}
+              onChange={e => setFormData({ ...formData, userType: e })}
+            />
+          </div>
+        </div>
+        <div className='D8topRR'>
+          <Button type='primary' onClick={deriveFu}>
+            批量导出
+          </Button>
+          <Button type='primary' onClick={() => history.push('/cancel_edit/1/null')}>
+            新增
+          </Button>
+          <Button type='primary' onClick={clickSearch}>
+            查询
+          </Button>
+          <Button onClick={resetSelectFu}>重置</Button>
+        </div>
+      </div>
+
+      {/* 表格 */}
+      <MyTable
+        yHeight={646}
+        list={tableInfo.list}
+        columnsTemp={D8tableC}
+        lastBtn={tableLastBtn}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={tableInfo.total}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+      />
     </div>
   )
 }

+ 5 - 5
src/pages/E_goodsStorage/E1accident/E1edit/index.tsx

@@ -334,7 +334,7 @@ function E1edit() {
         {['3'].includes(key) ? (
           <X3auditInfo
             dirCode='E1accident'
-            myUrl='cms/orderPreserveAccident/upload'
+            myUrl='cms/goodsFile/upload'
             auditSta={auditSta}
             auditStaFu={val => setAuDitSta(val)}
             ref={ZAuditRef}
@@ -429,7 +429,7 @@ function E1edit() {
               <ZRichTexts
                 check={false}
                 dirCode='E1accident'
-                myUrl='cms/orderPreserveAccident/upload'
+                myUrl='cms/goodsFile/upload'
                 isLook={['3', '4'].includes(key)}
                 ref={ZRichTextRefQian}
                 isOne={true}
@@ -448,7 +448,7 @@ function E1edit() {
               <ZRichTexts
                 check={false}
                 dirCode='E1accident'
-                myUrl='cms/orderPreserveAccident/upload'
+                myUrl='cms/goodsFile/upload'
                 isLook={['3', '4'].includes(key)}
                 ref={ZRichTextRefHou}
                 isOne={true}
@@ -467,7 +467,7 @@ function E1edit() {
               <ZRichTexts
                 check={false}
                 dirCode='E1accident'
-                myUrl='cms/orderPreserveAccident/upload'
+                myUrl='cms/goodsFile/upload'
                 isLook={['3', '4'].includes(key)}
                 ref={ZRichTextRefYuan}
                 isOne={true}
@@ -513,7 +513,7 @@ function E1edit() {
               <ZRichTexts
                 check={false}
                 dirCode='E1accident'
-                myUrl='cms/orderPreserveAccident/upload'
+                myUrl='cms/goodsFile/upload'
                 isLook={['3', '4'].includes(key)}
                 ref={ZRichTextRef}
                 isOne={true}

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

@@ -347,7 +347,7 @@ function E2edit() {
         {['3'].includes(key) ? (
           <X3auditInfo
             dirCode='E2damaged'
-            myUrl='cms/orderPreserveDamaged/upload'
+            myUrl='cms/goodsFile/upload'
             auditSta={auditSta}
             auditStaFu={val => setAuDitSta(val)}
             ref={ZAuditRef}
@@ -457,7 +457,7 @@ function E2edit() {
               <ZRichTexts
                 check={false}
                 dirCode='E2damaged'
-                myUrl='cms/orderPreserveDamaged/upload'
+                myUrl='cms/goodsFile/upload'
                 isLook={['3', '4'].includes(key)}
                 ref={ZRichTextRef}
                 isOne={true}

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

@@ -348,7 +348,7 @@ function E3edit() {
         {['3'].includes(key) ? (
           <X3auditInfo
             dirCode='E3actuality'
-            myUrl='cms/orderPreserveCurrent/upload'
+            myUrl='cms/goodsFile/upload'
             auditSta={auditSta}
             auditStaFu={val => setAuDitSta(val)}
             ref={ZAuditRef}
@@ -458,7 +458,7 @@ function E3edit() {
               <ZRichTexts
                 check={false}
                 dirCode='E3actuality'
-                myUrl='cms/orderPreserveCurrent/upload'
+                myUrl='cms/goodsFile/upload'
                 isLook={['3', '4'].includes(key)}
                 ref={ZRichTextRef}
                 isOne={true}

+ 9 - 9
src/pages/E_goodsStorage/E4repair/E4edit/index.tsx

@@ -32,6 +32,12 @@ import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
 import ZGaddNow from '@/components/ZGaddNow'
 import ZupFileTable from '@/components/ZupFileTable'
 
+const tableArrTemp = [
+  { name: '损坏情况', key: 'txt1' },
+  { name: '修复意见', key: 'txt2' },
+  { name: '批准文号', key: 'txt3' }
+]
+
 function E4edit() {
   const { key, id } = useParams<any>()
   // key:1 新增 2编辑 3审批 4查看
@@ -231,15 +237,9 @@ function E4edit() {
   )
 
   const tableLastBtn = useMemo(() => {
-    const arrTemp = [
-      { name: '损坏情况', key: 'txt1' },
-      { name: '修复意见', key: 'txt2' },
-      { name: '批准文号', key: 'txt3' }
-    ]
-
     const arr: any = []
 
-    arrTemp.forEach(v => {
+    tableArrTemp.forEach(v => {
       arr.push({
         title: v.name,
         width: 200,
@@ -428,7 +428,7 @@ function E4edit() {
         {['3'].includes(key) ? (
           <X3auditInfo
             dirCode='E4repair'
-            myUrl='cms/orderPreserveFix/upload'
+            myUrl='cms/goodsFile/upload'
             auditSta={auditSta}
             auditStaFu={val => setAuDitSta(val)}
             ref={ZAuditRef}
@@ -515,7 +515,7 @@ function E4edit() {
               <ZRichTexts
                 check={false}
                 dirCode='E4repair'
-                myUrl='cms/orderPreserveFix/upload'
+                myUrl='cms/goodsFile/upload'
                 isLook={['3', '4'].includes(key)}
                 ref={ZRichTextRef}
                 isOne={true}

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

@@ -387,5 +387,11 @@ export const routerSon: RouterTypeRow[] = [
     name: '藏品编辑-审批/查看',
     path: '/goodEdit_edit/:key/:id',
     Com: React.lazy(() => import('../C_goodsManage/C22goodEdit/C22look'))
+  },
+  {
+    id: 18,
+    name: '藏品注销-新增、编辑、审批/查看',
+    path: '/cancel_edit/:key/:id',
+    Com: React.lazy(() => import('../D_storeManage/D8cancel/D8edit'))
   }
 ]

+ 12 - 8
src/pages/Y_goodsDetails/Y2look/index.tsx

@@ -150,14 +150,18 @@ function Y2look() {
           ))}
         </div>
         <div className='Y2toprr'>
-          <Button
-            type='primary'
-            danger={info.isFocus === 1}
-            onClick={() => focusFu(info.isFocus === 1 ? '取消关注' : '关注')}
-          >
-            {info.isFocus === 1 ? '取消' : ''}关注
-          </Button>
-          &emsp;
+          {info.display === 1 ? (
+            <>
+              <Button
+                type='primary'
+                danger={info.isFocus === 1}
+                onClick={() => focusFu(info.isFocus === 1 ? '取消关注' : '关注')}
+              >
+                {info.isFocus === 1 ? '取消' : ''}关注
+              </Button>
+              &emsp;
+            </>
+          ) : null}
           <Button type='primary' onClick={handleExport}>
             藏品卡片
           </Button>

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

@@ -0,0 +1,77 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+/**
+ * 藏品注销 - 获取分页列表
+ */
+export const D8_APIgetList = (data: any, exportFlag?: boolean): any => {
+  if (exportFlag) return http.post('cms/orderLogout/page', data)
+  else {
+    return async (dispatch: AppDispatch) => {
+      const res = await http.post('cms/orderLogout/page', data)
+      if (res.code === 0) {
+        const obj = {
+          list: res.data.records,
+          total: res.data.total
+        }
+
+        dispatch({ type: 'D8/getList', payload: obj })
+      }
+    }
+  }
+}
+
+/**
+ * 藏品注销-删除
+ */
+export const D8_APIdel = (id: number) => {
+  return http.get(`cms/orderLogout/remove/${id}`)
+}
+
+/**
+ * 藏品注销-创建订单
+ */
+export const D8_APIcreate = () => {
+  return http.get('cms/orderLogout/create')
+}
+
+/**
+ * 藏品注销-获取详情
+ */
+export const D8_APIgetInfo = (id: number) => {
+  return http.get(`cms/orderLogout/detail/${id}`)
+}
+
+/**
+ * 藏品注销-存草稿
+ */
+export const D8_APIsaveDraft = (data: any) => {
+  return http.post('cms/orderLogout/saveDraft', data)
+}
+
+/**
+ * 藏品注销-创建
+ */
+export const D8_APIsaveCreate = (data: any) => {
+  return http.post('cms/orderLogout/saveCreate', data)
+}
+
+/**
+ * 藏品注销-编辑保存
+ */
+export const D8_APIsaveApply = (data: any) => {
+  return http.post('cms/orderLogout/saveApply', data)
+}
+
+/**
+ * 藏品注销-审批
+ */
+export const D8_APIsaveAudit = (data: any) => {
+  return http.post('cms/orderLogout/audit', data)
+}
+
+/**
+ * 藏品注销-撤回订单
+ */
+export const D8_APIrevocation = (id: number) => {
+  return http.get(`cms/orderLogout/revocation/${id}`)
+}

+ 28 - 0
src/store/reducer/D8cancel.ts

@@ -0,0 +1,28 @@
+import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as FourTableType[],
+    total: 0
+  }
+}
+
+// 定义 action 类型
+type Props = {
+  type: 'D8/getList'
+  payload: { list: FourTableType[]; total: number }
+}
+
+// reducer
+export default function userReducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case 'D8/getList':
+      return { ...state, tableInfo: action.payload }
+
+    default:
+      return state
+  }
+}

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

@@ -15,6 +15,7 @@ import C8recycleBin from './C8recycleBin'
 import D2storSet from './D2storSet'
 import D4impStor from './D4impStor'
 import D6putsStor from './D6putsStor'
+import D8cancel from './D8cancel'
 import E1accident from './E1accident'
 import E2damaged from './E2damaged'
 import E3actuality from './E3actuality'
@@ -43,6 +44,7 @@ const rootReducer = combineReducers({
   D2storSet,
   D4impStor,
   D6putsStor,
+  D8cancel,
   E1accident,
   E2damaged,
   E3actuality,

+ 19 - 0
src/utils/tableData.ts

@@ -231,6 +231,25 @@ export const D4goodsTableC = [
   ['txtChange', '库存状态', 'statusStorage', statusStorageObj]
 ]
 
+export const D8tableC = [
+  ['txt', '业务单号', 'num'],
+  ['txt', '发起部门', 'deptName'],
+  ['txt', '发送人', 'creatorName'],
+  ['txt', '发起日期', 'createTime'],
+  ['txtChange', '申请状态', 'status', statusObj]
+]
+
+export const D8tableCgoods = [
+  ['txt', '编号类型', 'numName'],
+  ['txt', '藏品分类号', 'numType'],
+  ['txt', '藏品名称', 'name'],
+  ['txtC', '年代', 'dictAge'],
+  ['ping', '数量', 'pcs', 'pcsUnit'],
+  ['size', '尺寸', 'sizeUnit'],
+  ['ping', '重量', 'quality', 'qualityUnit'],
+  ['txtC', '完残情况', 'dictTorn']
+]
+
 export const E1tableC = [
   ['txt', '编号类型', 'numName'],
   ['txt', '申请编号', 'num'],