shaogen1995 3 tygodni temu
rodzic
commit
ca7ab389d3

+ 1 - 1
src/assets/styles/base.css

@@ -91,7 +91,7 @@ textarea {
   border-radius: 50%;
 }
 #root .ant-btn-text {
-  color: var(--themeColor);
+  color: #ab925b;
 }
 #root .ant-btn-text:disabled {
   cursor: not-allowed;

+ 1 - 1
src/assets/styles/base.less

@@ -119,7 +119,7 @@ textarea {
 
   /* 普通文字按钮的颜色 */
   .ant-btn-text {
-    color: var(--themeColor);
+    color: #ab925b;
   }
 
   .ant-btn-text:disabled {

+ 11 - 23
src/components/MyTable/index.tsx

@@ -3,6 +3,7 @@ import styles from './index.module.scss'
 import { Table } from 'antd'
 import ImageLazy from '../ImageLazy'
 import dayjs from 'dayjs'
+import { myTableTransferSize, resJiLianFu } from '@/utils/dataChange'
 
 type Props = {
   yHeight?: number //设置表格的高度
@@ -99,38 +100,25 @@ function MyTable({
           let res = item[v[2]] ? dayjs(item[v[2]]).format('YYYY-MM-DD') : isNull
           return res
         },
+        // 多个字段拼接
+        ping: (item: any) => (item[v[2]] || '') + (resJiLianFu(item[v[3]]) || '') || isNull,
+        // 这个模块特有的级联控制
+        txtC: (item: any) => resJiLianFu(item[v[2]]),
+        txtCTag: (item: any) => resJiLianFu(item[v[2]], 'tag'),
+
+        // 尺寸
+        size: myTableTransferSize,
         img: (item: any) => (
           <div className='tableImgAuto'>
             <ImageLazy
               width={60}
               height={60}
-              src={item[v[2]] || item.thumb}
-              srcBig={item.thumbPc}
+              src={item[v[2]] || item.thumb || item.thumbPc}
+              srcBig={item.thumbPc || item.thumb}
             />
           </div>
         ),
 
-        time: (item: any) => {
-          let txt = isNull
-          if (item[v[2]]) {
-            txt = dayjs(item[v[2]]).format('YYYY-MM-DD')
-          }
-          return txt
-        },
-        // 多个字段拼接
-        ping: (item: any) => {
-          let txt = isNull
-          if (item[v[2]]) {
-            txt = item[v[2]]
-            if (item[v[3]]) {
-              const data = v[4]
-              const id = item[v[3]]
-              const obj = data.find((v: any) => v.value === id)
-              if (obj) txt = txt += obj.label
-            }
-          }
-          return txt
-        },
         select: (item: any) => {
           let txt = isNull
           const data = v[3]

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

@@ -16,7 +16,7 @@
         .ZTbox1ImgRowDragHandle {
           width: 100px;
           height: 100px;
-          cursor: grab;
+          cursor: default;
 
           &:active {
             cursor: grabbing;

+ 6 - 1
src/components/Z3upFiles/index.tsx

@@ -67,7 +67,12 @@ const SortableFileItem = React.memo(
           className={classNames('ZTbox1ImgRow', isDragging ? 'dragging' : '')}
         >
           {/* 修复按钮点击无效问题:将拖拽手柄单独放置,不覆盖操作按钮 */}
-          <div className='ZTbox1ImgRowDragHandle' {...attributes} {...listeners}>
+          <div
+            className='ZTbox1ImgRowDragHandle'
+            {...attributes}
+            {...listeners}
+            style={{ cursor: isLook ? 'default' : 'grab' }}
+          >
             {file.thumb || file.filePath ? (
               <ImageLazy noLook={true} width={100} height={100} src={file.thumb || file.filePath} />
             ) : null}

+ 6 - 1
src/components/Z3upFilesRef/index.tsx

@@ -66,7 +66,12 @@ const SortableFileItem = React.memo(
           className={classNames('ZTbox1ImgRow', isDragging ? 'dragging' : '')}
         >
           {/* 修复按钮点击无效问题:将拖拽手柄单独放置,不覆盖操作按钮 */}
-          <div className='ZTbox1ImgRowDragHandle' {...attributes} {...listeners}>
+          <div
+            className='ZTbox1ImgRowDragHandle'
+            {...attributes}
+            {...listeners}
+            style={{ cursor: isLook ? 'default' : 'grab' }}
+          >
             {file.thumb || file.filePath ? (
               <ImageLazy noLook={true} width={100} height={100} src={file.thumb || file.filePath} />
             ) : null}

+ 11 - 3
src/components/ZRichTextOne/index.tsx

@@ -23,10 +23,15 @@ type Props = {
   isLook: boolean //是否是查看进来
   ref: any //当前自己的ref,给父组件调用
   myUrl: string //上传的api地址
+  dirCode: string
+  moduleId: number
   titTxt?: string
 }
 
-function ZRichTextOne({ check, isLook, myUrl, titTxt = '请输入内容' }: Props, ref: any) {
+function ZRichTextOne(
+  { check, isLook, myUrl, titTxt = '请输入内容', dirCode, moduleId }: Props,
+  ref: any
+) {
   const [section, setSection] = useState(BraftEditor.createEditorState(''))
 
   // 判断 富文本是否为空
@@ -72,6 +77,9 @@ function ZRichTextOne({ check, isLook, myUrl, titTxt = '请输入内容' }: Prop
         const fd = new FormData()
         // 把files添加进FormData对象(‘photo’为后端需要的字段)
         fd.append('type', 'img')
+        fd.append('dirCode', dirCode)
+        fd.append('isCompress', 'true')
+        fd.append('moduleId', moduleId + '')
         fd.append('file', filesInfo)
 
         e.target.value = ''
@@ -84,7 +92,7 @@ function ZRichTextOne({ check, isLook, myUrl, titTxt = '请输入内容' }: Prop
             const newTxt = ContentUtils.insertMedias(section, [
               {
                 type: 'IMAGE',
-                url: baseURL + (res.data.compressedUrl || res.data.originalUrl)
+                url: baseURL + (res.data.thumb || res.data.thumbPc)
               }
             ])
 
@@ -96,7 +104,7 @@ function ZRichTextOne({ check, isLook, myUrl, titTxt = '请输入内容' }: Prop
         }
       }
     },
-    [myUrl, section]
+    [dirCode, moduleId, myUrl, section]
   )
 
   // 让父组件调用的 回显 富文本

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

@@ -299,15 +299,15 @@ const tabLeftArr: RouterType = [
         name: '系统日志',
         path: '/log',
         Com: React.lazy(() => import('../Isystem/I8log'))
-      }
+      },
       // 不需要 高亮的 详情页
-      // {
-      //   id: 9901,
-      //   name: '藏品详情',
-      //   path: '/goodsLook/:id',
-      //   pathLast: '/goodsLook',
-      //   Com: React.lazy(() => import('../A0goodsInfo'))
-      // }
+      {
+        id: 9901,
+        name: '藏品详情',
+        path: '/goodsLook/:id',
+        pathLast: '/goodsLook',
+        Com: React.lazy(() => import('../ZgoodsInfo'))
+      }
     ]
   }
 ]

+ 3 - 1
src/pages/Layout/index.tsx

@@ -21,11 +21,12 @@ import { I6_APIgetInfo } from '@/store/action/Isystem/I6role'
 import { TypeI6Role } from '../Isystem/I6role/data'
 import { useDispatch } from 'react-redux'
 import { I2_APIgetDict } from '@/store/action/Isystem/I2dict'
+import { E1_APIgetTree } from '@/store/action/Eculture/E1tag'
 
 function Layout() {
   const [loding, setLoding] = useState(false)
 
-  // 获取字典值
+  // 获取字典值  // 获取标签
   const dispatch = useDispatch()
 
   const getListFu = useCallback(() => {
@@ -34,6 +35,7 @@ function Layout() {
         setLoding(true)
       })
     )
+    dispatch(E1_APIgetTree())
   }, [dispatch])
 
   useEffect(() => {

+ 4 - 0
src/pages/ZgoodsInfo/index.module.scss

@@ -0,0 +1,4 @@
+.ZgoodsInfo {
+  :global {
+  }
+}

+ 13 - 0
src/pages/ZgoodsInfo/index.tsx

@@ -0,0 +1,13 @@
+import React from 'react'
+import styles from './index.module.scss'
+function ZgoodsInfo() {
+  return (
+    <div className={styles.ZgoodsInfo}>
+      <h1>ZgoodsInfo</h1>
+    </div>
+  )
+}
+
+const MemoZgoodsInfo = React.memo(ZgoodsInfo)
+
+export default MemoZgoodsInfo

+ 32 - 25
src/pages/Zother/AddGoods/index.tsx

@@ -2,9 +2,8 @@ import React, { useCallback, useEffect, useRef } from 'react'
 import styles from './index.module.scss'
 import { GoodsType } from '../SonGoodsList/data'
 import { Button, Cascader, DatePicker, Form, FormInstance, Input, InputNumber, Select } from 'antd'
-import { useDispatch, useSelector } from 'react-redux'
+import { useSelector } from 'react-redux'
 import { RootState } from '@/store'
-import { E1_APIgetTree } from '@/store/action/Eculture/E1tag'
 import dayjs from 'dayjs'
 import { getTokenInfo } from '@/utils/storage'
 import { getDictFu, selectObj } from '@/utils/dataChange'
@@ -13,6 +12,8 @@ import Z3upFilesRef from '@/components/Z3upFilesRef'
 import GuShi from '../GuShi'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { API_getGoodsInfo } from '@/store/action/Cledger/C1ledger'
+import { MessageFu } from '@/utils/message'
+import { API_getFileListByIds } from '@/store/action/Cledger/C4file'
 
 // 级联的数据转换成字符串
 export const cascaderChArr = [
@@ -40,20 +41,14 @@ type Props = {
   closeFu: () => void
   isEdit: boolean //藏品编辑-模块
   editSnap?: GoodsType //藏品编辑-属于新增还是编辑
-  succFu: (val: GoodsType, newFlag?: boolean) => void
+  succFu: (val: '新增' | '编辑', info: GoodsType) => void
   moduleId: number
+  APIsave: any
 }
 
-function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info }: Props) {
-  // 获取标签
-  const dispatch = useDispatch()
-
+function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info, APIsave }: Props) {
   const E1tree = useSelector((state: RootState) => state.E1tag.treeData)
 
-  useEffect(() => {
-    dispatch(E1_APIgetTree())
-  }, [dispatch])
-
   // 设置表单ref
   const FormBoxRef = useRef<FormInstance>(null)
 
@@ -81,7 +76,9 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info }: Props)
 
         cascaderChArr.forEach(v => {
           if (obj[v] === '0') obj[v] = null
-          else if (obj[v]) obj[v] = obj[v].split(',')
+          else if (obj[v]) {
+            obj[v] = obj[v].split(',')
+          }
         })
 
         addZiSelectChArr.forEach(v => {
@@ -91,10 +88,12 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info }: Props)
         FormBoxRef.current?.setFieldsValue(obj)
 
         // 设置附件
-        // fileRef.current?.sonSetListFu(fileList)
-
-        // 待完善sg-设置故事
-        // guShiRef.current?.setGuShiListBySon(list)
+        if (obj.fileIds) {
+          const fileRes = await API_getFileListByIds(obj.fileIds.split(','))
+          if (fileRes.code === 0) {
+            fileRef.current?.sonSetListFu(fileRes.data || [])
+          }
+        }
       }
     },
     [editSnap]
@@ -112,8 +111,8 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info }: Props)
     async (values: any) => {
       // 获取附件
       const { list: flieList, thumb, thumbPc } = fileRef.current?.sonResListFu()
-      // 待完善sg-设置故事
-      // const guShiList= guShiRef.current?.getGuShiListBySon()
+      // 获取故事
+      const { guShiList, delIds } = guShiRef.current?.getGuShiListBySon()
       // 2个日期的格式处理
       let makeDate = ''
       if (values.makeDate) makeDate = dayjs(values.makeDate).format('YYYY-MM-DD')
@@ -125,9 +124,11 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info }: Props)
         id: info.id > 0 ? info.id : null,
         makeDate,
         inGoodYear,
-        fileIds: flieList.join(','),
+        fileIds: flieList.map((v: any) => v.id).join(','),
         thumb,
-        thumbPc
+        thumbPc,
+        delStoryIds: delIds.length ? delIds : null,
+        storyIds: guShiList.map((v: any) => v.id).join(',')
       }
       for (const k in obj) {
         if (obj[k] === null || obj[k] === undefined) obj[k] = ''
@@ -137,12 +138,18 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info }: Props)
       cascaderChArr.forEach(v => {
         if (values[v]) obj[v] = values[v].join(',')
       })
-      if (1 + 1 === 2) {
-        console.log(123, obj)
-        return
+      // if (1 + 1 === 2) {
+      //   console.log(123, obj)
+      //   return
+      // }
+      const res = await APIsave(obj)
+      if (res.code === 0) {
+        MessageFu.warning(info.id > 0 ? '编辑成功' : '新增成功')
+        succFu(info.id > 0 ? '编辑' : '新增', res.data)
+        closeFu()
       }
     },
-    [info.id]
+    [APIsave, closeFu, info.id, succFu]
   )
 
   return (
@@ -403,7 +410,7 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info }: Props)
             <div className='AGfull'>
               <div className='AGfullll'>故事:</div>
               <div className='AGfullrr'>
-                <GuShi moduleId={moduleId} ref={guShiRef} />
+                <GuShi moduleId={moduleId} ref={guShiRef} goodsId={info.id} />
               </div>
             </div>
 

+ 3 - 1
src/pages/Zother/EditBtn/index.module.scss

@@ -6,7 +6,9 @@
   height: 60px;
   display: flex;
   align-items: center;
-  padding-left: 40px;
+  padding: 0 40px;
+  display: flex;
+  justify-content: space-between;
   :global {
     .ant-btn {
       margin-right: 15px;

+ 100 - 58
src/pages/Zother/EditBtn/index.tsx

@@ -1,4 +1,4 @@
-import React, { useCallback, useEffect, useState } from 'react'
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
 import styles from './index.module.scss'
 import { Button } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
@@ -9,6 +9,7 @@ import { useInfo } from '../InfoContext'
 import { MessageFu } from '@/utils/message'
 import { fileIdsResFu } from '@/utils'
 import { API_objType } from '@/store/action/Dmanage/D1register'
+import { TypetableAuditList } from '../data'
 
 type Props = {
   path: string
@@ -17,7 +18,7 @@ type Props = {
 }
 
 function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
-  const { info, snaps, delSnapIdsRef, setTimeKeyFu } = useInfo()
+  const { info, snaps, delSnapIdsRef, setTimeKeyFu, auditInfo } = useInfo()
 
   const [btnCan, setBtnCan] = useState({ status: 0, creatorId: 0 })
 
@@ -26,7 +27,11 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
   }, [info.status, info.creatorId])
 
   // key:1 新增 2编辑 3审批 4查看
-  const { key, id } = useParams<any>()
+  const { key } = useParams<any>()
+
+  const isLook = useMemo(() => {
+    return ['3', '4'].includes(key)
+  }, [key])
 
   const [btnPowArr, setBtnPowArr] = useState<string[]>([])
 
@@ -42,12 +47,12 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
     async (val: string, flag?: string) => {
       // console.log('点击按钮', val, flag)
       // 新增、编辑、审批、查看互相跳转
-      if (flag) pageSkitFu(path, val, id, flag)
+      if (flag) pageSkitFu(path, val, info.id, flag)
       else {
         const obj = {
           ...info,
           fileIds: fileIdsResFu(info.files),
-          goodsIds: snaps.map(v => v.id).join(','),
+          goodIds: snaps.map(v => v.id).join(','),
           delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
           snaps: snaps.map(v => ({
             goodsId: v.id,
@@ -56,14 +61,18 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
             snap: JSON.stringify(v)
           }))
         }
-        console.log('xxxxxxxxx', obj)
+
+        // if (1 + 1 === 2) {
+        //   console.log('xxxxxxxxx', obj)
+        //   return
+        // }
 
         // 草稿、发起、审批、撤回、删除
 
         if (val === '草稿') {
           const res = await APIobj['草稿'](obj)
           if (res.code === 0) {
-            pageSkitFu(path, '4', id, '详情', '保存草稿成功')
+            pageSkitFu(path, '4', info.id, '详情', '保存草稿成功')
           }
         } else if (val === '撤回') {
           const res = await APIobj['撤回'](obj.id)
@@ -85,77 +94,110 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
             return MessageFu.warning('请输入申请编号')
           }
           if (snaps.length === 0) {
-            editPageToTopFu()
+            // editPageToTopFu()
             return MessageFu.warning(`请至少添加一个${checkListTxt}`)
           }
           const res = await APIobj['发起'](obj)
           if (res.code === 0) {
-            MessageFu.success('操作成功')
+            if (['1', '2'].includes(key)) {
+              pageSkitFu(path, '4', info.id, '详情', '提交成功')
+            } else {
+              MessageFu.success('发起成功')
+              // 重新调用获取详情接口-当前页刷新状态
+              setTimeKeyFu()
+            }
+          }
+        } else if (val === '重新发起') {
+          const res = await APIobj['重新发起'](obj.id)
+          if (res.code === 0) {
+            MessageFu.success('重新发起成功')
             // 重新调用获取详情接口-当前页刷新状态
             setTimeKeyFu()
           }
         } else if (val === '审批') {
-          // 待完善sg
+          if (!auditInfo.status) {
+            editPageToTopFu()
+            return MessageFu.warning('请选择审批结果')
+          } else {
+            const auditObj = {
+              ...auditInfo,
+              orderId: info.id
+            }
+            const res = await APIobj['审批'](auditObj)
+            if (res.code === 0) {
+              pageSkitFu(path, '4', info.id, '详情', '审批成功')
+            }
+          }
         }
       }
     },
-    [APIobj, checkListTxt, delSnapIdsRef, id, info, path, setTimeKeyFu, snaps]
+    [APIobj, auditInfo, checkListTxt, delSnapIdsRef, info, key, path, setTimeKeyFu, snaps]
   )
 
+  // 申请记录的显示
+  const [auditListShow, setAuditListShow] = useState<TypetableAuditList[]>([])
+
   return (
     <div className={styles.EditBtn}>
-      {['1', '2'].includes(key) ? (
-        <>
-          <Button type='primary' onClick={() => sonClick('草稿')}>
-            存草稿
-          </Button>
-          <Button type='primary' onClick={() => sonClick('发起')}>
-            提交
-          </Button>
-          <MyPopconfirm txtK='取消' onConfirm={() => backPageFu(path)} />
-        </>
-      ) : key === '3' ? (
-        <>
-          <Button type='primary' onClick={() => sonClick('审批')}>
-            审批
-          </Button>
-          <Button onClick={() => backPageFu(path)}>返回</Button>
-        </>
-      ) : key === '4' ? (
-        <>
-          {btnPowArr.includes('重新发起') ? (
-            <Button type='primary' onClick={() => sonClick('发起')}>
-              重新发起
-            </Button>
-          ) : null}
-          {btnPowArr.includes('撤回') ? (
-            <MyPopconfirm
-              txtK='撤回'
-              onConfirm={() => sonClick('撤回')}
-              Dom={<Button danger>撤回</Button>}
-            />
-          ) : null}
-          {btnPowArr.includes('编辑') ? (
-            <Button type='primary' onClick={() => sonClick('2', '编辑')}>
-              编辑
+      <div>
+        {['1', '2'].includes(key) ? (
+          <>
+            <Button type='primary' onClick={() => sonClick('草稿')}>
+              存草稿
             </Button>
-          ) : null}
-          {btnPowArr.includes('发起') ? (
             <Button type='primary' onClick={() => sonClick('发起')}>
-              发起
+              提交
             </Button>
-          ) : null}
-          {btnPowArr.includes('删除') ? (
-            <MyPopconfirm
-              txtK='删除2'
-              onConfirm={() => sonClick('删除')}
-              Dom={<Button danger>删除</Button>}
-            />
-          ) : null}
+            <MyPopconfirm txtK='取消' onConfirm={() => backPageFu(path)} />
+          </>
+        ) : key === '3' ? (
+          <Button type='primary' onClick={() => sonClick('审批')}>
+            审批
+          </Button>
+        ) : key === '4' ? (
+          <>
+            {btnPowArr.includes('重新发起') ? (
+              <Button type='primary' onClick={() => sonClick('重新发起')}>
+                重新发起
+              </Button>
+            ) : null}
+            {btnPowArr.includes('撤回') ? (
+              <MyPopconfirm
+                txtK='撤回'
+                onConfirm={() => sonClick('撤回')}
+                Dom={<Button danger>撤回</Button>}
+              />
+            ) : null}
+            {btnPowArr.includes('编辑') ? (
+              <Button type='primary' onClick={() => sonClick('2', '编辑')}>
+                编辑
+              </Button>
+            ) : null}
+            {btnPowArr.includes('发起') ? (
+              <Button type='primary' onClick={() => sonClick('发起')}>
+                发起
+              </Button>
+            ) : null}
+            {btnPowArr.includes('删除') ? (
+              <MyPopconfirm
+                txtK='删除2'
+                onConfirm={() => sonClick('删除')}
+                Dom={<Button danger>删除</Button>}
+              />
+            ) : null}
+          </>
+        ) : null}
 
+        {isLook && info.audits && info.audits.length ? (
           <Button onClick={() => backPageFu(path)}>返回</Button>
-        </>
-      ) : null}
+        ) : null}
+      </div>
+
+      <div>
+        {isLook ? <Button onClick={() => setAuditListShow(info.audits)}>申请记录</Button> : null}
+      </div>
+
+      {/* {auditListShow.length ? <AuditList /> : null} */}
     </div>
   )
 }

+ 3 - 0
src/pages/Zother/EditTop/index.module.scss

@@ -40,6 +40,9 @@
           & > div {
             width: 100%;
           }
+          .ant-btn {
+            margin-right: 15px;
+          }
         }
       }
       .Edtop1rowFull {

+ 58 - 13
src/pages/Zother/EditTop/index.tsx

@@ -18,6 +18,11 @@ const pageKeyTxtObj = {
   4: '查看'
 }
 
+export const auditBtnArr = [
+  { value: 1, label: '同意' },
+  { value: 2, label: '不同意' }
+]
+
 type Props = {
   // 顶部信息录入
   rowArr: any[]
@@ -28,11 +33,15 @@ type Props = {
 }
 
 function EditTop({ rowArr, pageTxt, APIobj }: Props) {
-  const { info, setInfoFu, setSnapsFu, snapsID2ref, timeKey } = useInfo()
+  const { info, setInfoFu, setSnapsFu, snapsID2ref, timeKey, auditInfo, setAuditInfoFu } = useInfo()
 
   const { key, id } = useParams<any>()
   // key:1 新增 2编辑 3审批 4查看
 
+  const isLook = useMemo(() => {
+    return ['3', '4'].includes(key)
+  }, [key])
+
   // 创建订单
   const createFu = useCallback(async () => {
     const res = await APIobj['创建订单']()
@@ -63,9 +72,7 @@ function EditTop({ rowArr, pageTxt, APIobj }: Props) {
 
           if (obj.id) obj.id2 = v.id
 
-          arrTemp.push({
-            ...obj
-          })
+          arrTemp.push(obj)
         })
 
         setSnapsFu(arrTemp)
@@ -123,6 +130,45 @@ function EditTop({ rowArr, pageTxt, APIobj }: Props) {
 
       {info.id ? (
         <>
+          {key === '3' ? (
+            <>
+              <div className='EdTit'>
+                <div>审批信息</div>
+              </div>
+              <div className='Edtop1'>
+                <div className='Edtop1row Edtop1rowFull'>
+                  <div className='Edtop1ll'>
+                    <span>* </span>审批结果:
+                  </div>
+                  <div className='Edtop1rr'>
+                    {auditBtnArr.map(btn => (
+                      <Button
+                        key={btn.value}
+                        type={btn.value === auditInfo.status ? 'primary' : 'default'}
+                        onClick={() => setAuditInfoFu('status', btn.value)}
+                      >
+                        {btn.label}
+                      </Button>
+                    ))}
+                  </div>
+                </div>
+
+                <div className='Edtop1row Edtop1rowFull'>
+                  <div className='Edtop1ll'>审批意见:</div>
+                  <div className='Edtop1rr'>
+                    <TextArea
+                      placeholder='请输入'
+                      value={auditInfo.rtfOpinion}
+                      onChange={e => setAuditInfoFu('rtfOpinion', e.target.value)}
+                      maxLength={500}
+                      showCount
+                    />
+                  </div>
+                </div>
+              </div>
+            </>
+          ) : null}
+
           <div className='EdTit'>
             <div>
               申请信息
@@ -151,7 +197,7 @@ function EditTop({ rowArr, pageTxt, APIobj }: Props) {
                     </>
                   ) : item.type === 'DatePicker' ? (
                     <DatePicker
-                      disabled={['3', '4'].includes(key)}
+                      disabled={isLook}
                       allowClear={!item.must}
                       value={dayjs(info[item.key as 'date'])}
                       onChange={e => dataChangeFu(e, item)}
@@ -159,7 +205,8 @@ function EditTop({ rowArr, pageTxt, APIobj }: Props) {
                     />
                   ) : item.type === 'Input' ? (
                     <Input
-                      placeholder='请输入内容'
+                      readOnly={isLook}
+                      placeholder='请输入'
                       value={info[item.key as 'date']}
                       onChange={e => dataChangeFu(e.target.value, item)}
                       maxLength={item.maxLength || 30}
@@ -167,9 +214,10 @@ function EditTop({ rowArr, pageTxt, APIobj }: Props) {
                     />
                   ) : item.type === 'Cascader' ? (
                     <Cascader
+                      disabled={isLook}
                       changeOnSelect
                       options={item.options}
-                      placeholder='请选择'
+                      placeholder={isLook ? '(空)' : '请选择'}
                       fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                       allowClear={!item.must}
                       value={
@@ -181,7 +229,8 @@ function EditTop({ rowArr, pageTxt, APIobj }: Props) {
                     />
                   ) : item.type === 'TextArea' ? (
                     <TextArea
-                      placeholder='请输入内容'
+                      readOnly={isLook}
+                      placeholder={isLook ? '(空)' : '请输入'}
                       value={info[item.key as 'date']}
                       onChange={e => dataChangeFu(e.target.value, item)}
                       maxLength={item.maxLength || 500}
@@ -196,11 +245,7 @@ function EditTop({ rowArr, pageTxt, APIobj }: Props) {
             <div className='Edtop1row Edtop1rowFull'>
               <div className='Edtop1ll'>附件:</div>
               <div className='Edtop1rr'>
-                <Z3upFiles
-                  isLook={['3', '4'].includes(key)}
-                  dirCode='register'
-                  myUrl='cms/order/register/upload'
-                />
+                <Z3upFiles isLook={isLook} dirCode='register' myUrl='cms/order/register/upload' />
               </div>
             </div>
           </div>

+ 53 - 0
src/pages/Zother/GuShi/GuShiMo/index.module.scss

@@ -1,4 +1,57 @@
 .GuShiMo {
   :global {
+    .ant-modal-close {
+      display: none;
+    }
+    .ant-modal {
+      width: 1287px !important;
+      top: 30px !important;
+    }
+
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+      padding-top: 15px !important;
+      position: relative;
+
+      .GSMmain {
+        width: 100%;
+        padding-right: 120px;
+        height: 760px;
+        overflow: auto;
+
+        .GSMrow {
+          display: flex;
+          margin-bottom: 20px;
+          .GSMrowll {
+            width: 100px;
+            text-align: right;
+            font-weight: 700;
+            line-height: 32px;
+            & > span {
+              color: #ff4d4f;
+            }
+          }
+          .GSMrowrr {
+            width: calc(100% - 100px);
+            .zztxtRow {
+              margin-bottom: 0;
+            }
+            .noUpThumb {
+              display: none;
+            }
+          }
+        }
+        .GSMbtn {
+          position: absolute;
+          top: 50%;
+          right: 35px;
+          transform: translateY(-50%);
+          .ant-btn {
+            display: block;
+            margin: 24px 0;
+          }
+        }
+      }
+    }
   }
 }

+ 129 - 17
src/pages/Zother/GuShi/GuShiMo/index.tsx

@@ -1,41 +1,153 @@
-import React, { useRef } from 'react'
+import React, { useCallback, useEffect, useRef, useState } from 'react'
 import styles from './index.module.scss'
-import { Modal } from 'antd'
+import { Button, Input, Modal } from 'antd'
 import { GuShiType } from '../data'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import ZRichTextOne from '@/components/ZRichTextOne'
+import TextArea from 'antd/es/input/TextArea'
+import Z3upFilesRef from '@/components/Z3upFilesRef'
+import { MessageFu } from '@/utils/message'
+import { guShiAPI_add } from '@/store/action/Cledger/C1ledger'
+import { API_getFileListByIds } from '@/store/action/Cledger/C4file'
 
 type Props = {
   guShiInfo: GuShiType
   closeFu: () => void
-  succFu: (val: '新增' | '编辑') => void
+  succFu: (val: '新增' | '编辑', info: GuShiType) => void
+  moduleId: number
 }
-// 待完善sg
-function GuShiMo({ guShiInfo, closeFu, succFu }: Props) {
+function GuShiMo({ guShiInfo, closeFu, succFu, moduleId }: Props) {
+  const [info, setInfo] = useState<GuShiType>({
+    id: -1,
+    name: '',
+    remark: '',
+    rtf: ''
+  })
+
+  const getFileListByIdsFu = useCallback(async (ids: string[]) => {
+    const res = await API_getFileListByIds(ids)
+    if (res.code === 0) {
+      // 设置附件
+      fileRef.current?.sonSetListFu(res.data)
+    }
+  }, [])
+
+  useEffect(() => {
+    if (guShiInfo.id > 0) {
+      setInfo(guShiInfo)
+      if (guShiInfo.fileIds) {
+        getFileListByIdsFu(guShiInfo.fileIds.split(','))
+      }
+      // 设置富文本
+      ZRichTextRef.current?.ritxtShowFu(guShiInfo.rtf)
+    }
+  }, [getFileListByIdsFu, guShiInfo])
+
+  // 附件模块的ref
+  const fileRef = useRef<any>(null)
+
   // 富文本的ref
   const ZRichTextRef = useRef<any>(null)
 
-  // 设置富文本
-  // ZRichTextRef.current?.ritxtShowFu(description)
+  // 点击提交
+  const btnOk = useCallback(async () => {
+    if (!info.name) return MessageFu.warning('请输入故事标题')
+
+    // 获取附件
+    const { list: flieList } = fileRef.current?.sonResListFu()
+
+    // 获取富文本
+    const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
 
-  // 获取富文本
-  //  const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
-  // rtf.val
+    const obj: any = {
+      name: info.name,
+      remark: info.remark,
+      id: info.id > 0 ? info.id : null,
+      fileIds: flieList.map((v: any) => v.id).join(','),
+      rtf: rtf.val
+    }
+
+    const res = await guShiAPI_add(obj)
+
+    if (res.code === 0) {
+      MessageFu.success(info.id > 0 ? '编辑成功' : '新增成功')
+      succFu(info.id > 0 ? '编辑' : '新增', res.data)
+      closeFu()
+    }
+  }, [closeFu, info.id, info.name, info.remark, succFu])
 
   return (
     <Modal
       wrapClassName={styles.GuShiMo}
       destroyOnClose
       open={true}
-      title={guShiInfo.id > 0 ? '编辑' : '新增'}
+      title={guShiInfo.id > 0 ? '编辑故事' : '新增故事'}
       footer={
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }
     >
-      {/* <ZRichTextOne
-          check={false}
-          myUrl='file/upload?upPath=A1intro'
-          isLook={false}
-          ref={ZRichTextRef}
-        /> */}
+      <div className='GSMmain'>
+        <div className='GSMrow'>
+          <div className='GSMrowll'>
+            <span>* </span>故事标题:
+          </div>
+          <div className='GSMrowrr'>
+            <Input
+              placeholder='请输入'
+              maxLength={30}
+              showCount
+              value={info.name}
+              onChange={e => setInfo({ ...info, name: e.target.value.trim() })}
+            />
+          </div>
+        </div>
+
+        <div className='GSMrow'>
+          <div className='GSMrowll'>故事正文:</div>
+          <div className='GSMrowrr'>
+            <ZRichTextOne
+              moduleId={moduleId}
+              dirCode='guShiText'
+              check={false}
+              myUrl='cms/story/upload'
+              isLook={false}
+              ref={ZRichTextRef}
+            />
+          </div>
+        </div>
+
+        <div className='GSMrow'>
+          <div className='GSMrowll'>备注:</div>
+          <div className='GSMrowrr'>
+            <TextArea
+              placeholder='请输入'
+              maxLength={500}
+              showCount
+              value={info.remark}
+              onChange={e => setInfo({ ...info, remark: e.target.value.trim() })}
+            />
+          </div>
+        </div>
+
+        <div className='GSMrow'>
+          <div className='GSMrowll'>附件:</div>
+          <div className='GSMrowrr'>
+            <Z3upFilesRef
+              ref={fileRef}
+              moduleId={moduleId}
+              dirCode='guShiTextFile'
+              myUrl='cms/story/upload'
+            />
+          </div>
+        </div>
+
+        <div className='GSMbtn'>
+          <Button type='primary' onClick={btnOk}>
+            提交
+          </Button>
+          <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+        </div>
+      </div>
     </Modal>
   )
 }

+ 67 - 8
src/pages/Zother/GuShi/index.tsx

@@ -1,27 +1,65 @@
 import styles from './index.module.scss'
 import { Button } from 'antd'
-import { forwardRef, useCallback, useImperativeHandle, useMemo, useState } from 'react'
+import {
+  forwardRef,
+  useCallback,
+  useEffect,
+  useImperativeHandle,
+  useMemo,
+  useRef,
+  useState
+} from 'react'
 import { GuShiType } from './data'
 import MyTable from '@/components/MyTable'
 import MyPopconfirm from '@/components/MyPopconfirm'
+import { MessageFu } from '@/utils/message'
+import { guShiAPI_dels, guShiAPI_getList } from '@/store/action/Cledger/C1ledger'
+import GuShiMo from './GuShiMo'
 
 type Props = {
   moduleId: number
+  // 外层藏品id
+  goodsId: number
   ref: any
 }
 
-function GuShi({ moduleId }: Props, ref: any) {
+function GuShi({ moduleId, goodsId }: Props, ref: any) {
   // 故事数据
   const [guShiList, setGuShiList] = useState<GuShiType[]>([])
 
-  // 点击删除-待完善sg
+  const getListFu = useCallback(async (goodsId: number) => {
+    const res = await guShiAPI_getList(goodsId)
+    if (res.code === 0) {
+      setGuShiList(res.data.records || [])
+    }
+  }, [])
+
+  useEffect(() => {
+    if (goodsId > 0) {
+      getListFu(goodsId)
+    }
+  }, [getListFu, goodsId])
+
+  // 把删除的id存起来
+  const delIds = useRef<number[]>([])
+
+  // 点击删除
   const delTableFu = useCallback(
-    (id: number) => {
+    async (id: number) => {
       setGuShiList(guShiList.filter(v => v.id !== id))
+      if (goodsId > 0) delIds.current.push(id)
+      else {
+        // 外层藏品是新增的时候-真的删除数据
+        await guShiAPI_dels([id])
+      }
+      MessageFu.success('删除成功')
     },
-    [guShiList]
+    [goodsId, guShiList]
   )
 
+  // 打开弹窗
+  const [addInfo, setAddInfo] = useState({} as GuShiType)
+
   const tableLastBtn = useMemo(() => {
     return [
       {
@@ -29,7 +67,7 @@ function GuShi({ moduleId }: Props, ref: any) {
         render: (item: GuShiType) => {
           return (
             <>
-              <Button size='small' type='text'>
+              <Button size='small' type='text' onClick={() => setAddInfo(item)}>
                 编辑
               </Button>
               <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
@@ -46,7 +84,10 @@ function GuShi({ moduleId }: Props, ref: any) {
   }, [])
 
   const getGuShiListBySon = useCallback(() => {
-    return guShiList
+    return {
+      guShiList: guShiList || [],
+      delIds: delIds.current || []
+    }
   }, [guShiList])
   useImperativeHandle(ref, () => ({
     setGuShiListBySon,
@@ -55,7 +96,7 @@ function GuShi({ moduleId }: Props, ref: any) {
 
   return (
     <div className={styles.GuShi}>
-      <Button>新增</Button>
+      <Button onClick={() => setAddInfo({ id: -1 } as GuShiType)}>新增</Button>
       <MyTable
         classKey='GuShiTable'
         list={guShiList}
@@ -63,6 +104,24 @@ function GuShi({ moduleId }: Props, ref: any) {
         lastBtn={tableLastBtn}
         pagingInfo={false}
       />
+      {addInfo.id ? (
+        <GuShiMo
+          moduleId={moduleId}
+          guShiInfo={addInfo}
+          closeFu={() => setAddInfo({} as GuShiType)}
+          succFu={(val, info) => {
+            if (val === '新增') setGuShiList([info, ...guShiList])
+            else {
+              setGuShiList(
+                guShiList.map(v => {
+                  if (v.id === info.id) return info
+                  else return v
+                })
+              )
+            }
+          }}
+        />
+      ) : null}
     </div>
   )
 }

+ 17 - 2
src/pages/Zother/InfoContext.tsx

@@ -13,6 +13,8 @@ type InfoContextValue = {
   snapsID2ref: React.MutableRefObject<SnapsID2refType[]>
   timeKey: number
   setTimeKeyFu: () => void
+  auditInfo: { status: number; rtfOpinion: string }
+  setAuditInfoFu: (key: 'status' | 'rtfOpinion', val: string | number) => void
 }
 
 type Props = {
@@ -29,6 +31,16 @@ export function InfoProvider({ children }: Props) {
     setTimeKey(Date.now())
   }, [])
 
+  // 审批信息
+  const [auditInfo, setAuditInfo] = useState({ status: 0, rtfOpinion: '' })
+
+  const setAuditInfoFu = useCallback(
+    (key: 'status' | 'rtfOpinion', val: number | string) => {
+      setAuditInfo({ ...auditInfo, [key]: val })
+    },
+    [auditInfo]
+  )
+
   // 顶部信息
   const [info, setInfo] = useState({} as Typetable)
 
@@ -45,6 +57,7 @@ export function InfoProvider({ children }: Props) {
 
   // 藏品信息
   const [snaps, setSnaps] = useState<GoodsType[]>([])
+
   const setSnapsFu = useCallback((snaps: GoodsType[]) => {
     setSnaps(snaps)
   }, [])
@@ -62,9 +75,11 @@ export function InfoProvider({ children }: Props) {
       delSnapIdsRef,
       snapsID2ref,
       timeKey,
-      setTimeKeyFu
+      setTimeKeyFu,
+      auditInfo,
+      setAuditInfoFu
     }),
-    [info, setInfoFu, setSnapsFu, setTimeKeyFu, snaps, timeKey]
+    [auditInfo, info, setAuditInfoFu, setInfoFu, setSnapsFu, setTimeKeyFu, snaps, timeKey]
   )
 
   return <InfoContext.Provider value={value}>{children}</InfoContext.Provider>

+ 53 - 1
src/pages/Zother/SonGoodsList/data.ts

@@ -1,5 +1,57 @@
-// 待完善sg-藏品类型
+// 藏品类型
 export type GoodsType = {
+  ageDictId: string
+  ageInfo: string
+  born: string
+  createTime: string
+  creatorId: number
+  creatorName?: any
+  file: any[]
+  fileIds: string
   id: number
   id2: number
+  inGoodYear: string
+  inGoodYearScope: string
+  intro: string
+  isEdit?: any
+  keep: string
+  keepInfo: string
+  level: string
+  makeDate: string
+  makeUser: string
+  name: string
+  num: string
+  oldName: string
+  orderId?: any
+  orderSnapId?: any
+  pcs: number
+  pcsUnitDictId: string
+  pressAuthor: string
+  pressFile: string
+  pressVersion: string
+  quality: string
+  qualityLevelDictId: string
+  qualityScope: string
+  qualityUnitDictId: string
+  remark: string
+  siteDateIn?: any
+  siteDateOut?: any
+  siteId?: any
+  siteLoc?: any
+  siteStatus?: any
+  sizeH: number
+  sizeInfo: string
+  sizeL: number
+  sizeW: number
+  source: string
+  status: number
+  storyIds: string
+  tagDictId: string
+  textureDictId: string
+  thumb: string
+  thumbPc: string
+  tornInfo: string
+  tornLevel: string
+  typeDictId: string
+  updateTime: string
 }

+ 53 - 26
src/pages/Zother/SonGoodsList/index.tsx

@@ -6,8 +6,19 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import AddGoods from '../AddGoods'
 import { useInfo } from '../InfoContext'
 import { GoodsType } from './data'
+import { D1_APIgoodsSave } from '@/store/action/Dmanage/D1register'
+import { goodsSonTableC } from '@/utils/tableData'
+import { useParams } from 'react-router-dom'
+import { openLink } from '@/utils/history'
 function SonGoodsList() {
-  const { info, snaps, setSnapsFu, delSnapIdsRef } = useInfo()
+  const { info, snaps, setSnapsFu, delSnapIdsRef, snapsID2ref } = useInfo()
+
+  const { key } = useParams<any>()
+  // key:1 新增 2编辑 3审批 4查看
+
+  const isLook = useMemo(() => {
+    return ['3', '4'].includes(key)
+  }, [key])
 
   const [openInfo, setOpenInfo] = useState({} as GoodsType)
 
@@ -17,59 +28,75 @@ function SonGoodsList() {
         title: '操作',
         render: (item: GoodsType) => (
           <>
-            <Button size='small' type='text' onClick={() => setOpenInfo(item)}>
-              编辑
-            </Button>
-            <MyPopconfirm
-              txtK='删除'
-              onConfirm={() => {
-                if (item.id2 && !delSnapIdsRef.current.includes(item.id2)) {
-                  delSnapIdsRef.current.push(item.id2)
-                  setSnapsFu(snaps.filter(v => v.id !== item.id))
-                }
-              }}
-            />
+            {isLook ? (
+              <Button size='small' type='text' onClick={() => openLink(`/goodsLook/${item.id}`)}>
+                查看
+              </Button>
+            ) : (
+              <>
+                <Button size='small' type='text' onClick={() => setOpenInfo(item)}>
+                  编辑
+                </Button>
+                <MyPopconfirm
+                  txtK='删除'
+                  onConfirm={() => {
+                    if (item.id2 && !delSnapIdsRef.current.includes(item.id2)) {
+                      delSnapIdsRef.current.push(item.id2)
+                    }
+                    setSnapsFu(snaps.filter(v => v.id !== item.id))
+                  }}
+                />
+              </>
+            )}
           </>
         )
       }
     ]
-  }, [delSnapIdsRef, setSnapsFu, snaps])
+  }, [delSnapIdsRef, isLook, setSnapsFu, snaps])
 
   return (
     <div className={styles.SonGoodsList}>
       <div className='EdTit'>
         <div>藏品清单</div>
-        <div>
-          {/* 待完善sg-等蓝鑫写完征集 */}
-          <Button type='primary'>从征集线索中添加</Button>
-          <Button type='primary' onClick={() => setOpenInfo({ id: -1 } as GoodsType)}>
-            新增
-          </Button>
-        </div>
+        {isLook ? (
+          <div></div>
+        ) : (
+          <div>
+            {/* 待完善sg-等蓝鑫写完征集 */}
+            <Button type='primary'>从征集线索中添加</Button>
+            <Button type='primary' onClick={() => setOpenInfo({ id: -1 } as GoodsType)}>
+              新增
+            </Button>
+          </div>
+        )}
       </div>
       <div className='SonGoodsListTable'>
         <MyTable
           classKey='SonGoodsList'
           list={snaps}
-          columnsTemp={[]}
+          columnsTemp={goodsSonTableC}
           lastBtn={tableLastBtn}
           pagingInfo={false}
         />
       </div>
       {openInfo.id ? (
         <AddGoods
+          APIsave={D1_APIgoodsSave}
           info={openInfo}
           isEdit={false}
           closeFu={() => setOpenInfo({} as GoodsType)}
           moduleId={info.id}
-          succFu={(obj, newFlag) => {
-            if (newFlag) {
+          succFu={(val: '新增' | '编辑', info: GoodsType) => {
+            let objTemp = { ...info }
+            const id2Obj = snapsID2ref.current.find(c => c.goodsId === objTemp.id)
+            if (id2Obj) objTemp.id2 = id2Obj.id
+            if (val === '新增') {
               // 是新增
-              setSnapsFu([obj, ...snaps])
+              setSnapsFu([objTemp, ...snaps])
             } else {
               setSnapsFu(
                 snaps.map(v => {
-                  if (v.id === obj.id) return obj
+                  if (v.id === objTemp.id) return objTemp
                   else return v
                 })
               )

+ 23 - 1
src/pages/Zother/data.ts

@@ -124,10 +124,32 @@ export const rowArrTemp = (txt: string, can?: { [x: number]: string }) => {
   ]
 }
 
+export type TypetableAuditList = {
+  auditTime?: any
+  auditorId?: any
+  auditorName?: any
+  createTime: string
+  creatorId: number
+  creatorName: string
+  flowId: number
+  handler?: any
+  id: number
+  isAuto: number
+  isUse: number
+  moduleIds?: any
+  name: string
+  orderId: number
+  processId: number
+  rtfOpinion?: any
+  sort: number
+  status: number
+  type?: any
+  updateTime: string
+}
 // 列表type
 export type Typetable = {
   auditUserIds: string
-  audits: any[]
+  audits: TypetableAuditList[]
   createTime: string
   creatorId: number
   creatorName: string

+ 31 - 0
src/store/action/Cledger/C1ledger.ts

@@ -6,3 +6,34 @@ import http from '@/utils/http'
 export const API_getGoodsInfo = (id: number) => {
   return http.get(`cms/good/ledger/detail/${id}`)
 }
+
+// ----------------故事模块-----------
+/**
+ * 故事-新增
+ */
+export const guShiAPI_add = (data: any) => {
+  return http.post('cms/story/save', data)
+}
+/**
+ * 故事-获取列表
+ */
+export const guShiAPI_getList = (goodId: number) => {
+  const data: any = {
+    goodId,
+    pageSize: 99999
+  }
+  return http.post('cms/good/ledger/story', data)
+}
+/**
+ * 故事-详情
+ */
+export const guShiAPI_getInfo = (id: number) => {
+  return http.get(`cms/story/detail/${id}`)
+}
+
+/**
+ * 故事-删除
+ */
+export const guShiAPI_dels = (ids: number[]) => {
+  return http.post(`cms/story/removes`, ids)
+}

+ 8 - 0
src/store/action/Cledger/C4file.ts

@@ -0,0 +1,8 @@
+import http from '@/utils/http'
+
+/**
+ * 藏品附件 -根据附件id拿列表
+ */
+export const API_getFileListByIds = (ids: string[]) => {
+  return http.post('cms/file/getList', ids)
+}

+ 17 - 1
src/store/action/Dmanage/D1register.ts

@@ -19,7 +19,22 @@ export const D1_APIgetList = (data: any): any => {
   }
 }
 
-export type APItxtType = '创建订单' | '获取详情' | '草稿' | '发起' | '审批' | '撤回' | '删除'
+/**
+ * 藏品登记-藏品新增|编辑
+ */
+export const D1_APIgoodsSave = (data: any) => {
+  return http.post('cms/order/register/add', data)
+}
+
+export type APItxtType =
+  | '创建订单'
+  | '获取详情'
+  | '草稿'
+  | '发起'
+  | '重新发起'
+  | '审批'
+  | '撤回'
+  | '删除'
 
 export type API_objType = { [x in APItxtType]: any }
 
@@ -28,6 +43,7 @@ export const D1API_obj = {
   获取详情: (id: number) => APIbase('get', `cms/order/register/detail/${id}`),
   草稿: (data: any) => APIbase('post', `cms/order/register/saveDraft`, data),
   发起: (data: any) => APIbase('post', `cms/order/register/saveApply`, data),
+  重新发起: (id: number) => APIbase('get', `cms/order/register/reissue/${id}`),
   审批: (data: any) => APIbase('post', `cms/order/register/audit`, data),
   撤回: (id: number) => APIbase('get', `cms/order/register/revocation/${id}`),
   删除: (id: number) => APIbase('get', `cms/order/register/remove/${id}`)

+ 7 - 6
src/utils/authority.ts

@@ -38,14 +38,15 @@ export const editBtnShowFu = (status: number, creatorId: number) => {
     if (status === 3) arr.push('重新发起')
     // - 撤回:待审批,且当前用户为申请创建人
     if (status === 2) arr.push('撤回')
-    // - 编辑:草稿,且当前用户为申请创建人
     // - 发起:草稿,且当前用户为申请创建人
-    if (status === 1) {
+    if (status === 1) arr.push('发起')
+
+    // - 编辑:草稿/未通过,且当前用户为申请创建人
+    // - 删除:草稿/未通过,且当前用户为申请创建人
+    if ([1, 3].includes(status)) {
+      arr.push('删除')
       arr.push('编辑')
-      arr.push('发起')
     }
-    // - 删除:草稿/未通过,且当前用户为申请创建人
-    if ([1, 3].includes(status)) arr.push('删除')
   }
   return arr
 }
@@ -63,5 +64,5 @@ export const editPageToTopFu = () => {
 export const pageSkitFu = (path: string, key: string, id: number, txt?: string, txt2?: string) => {
   history.replace(`${path}_edit/${key}/${id}`)
   editPageToTopFu()
-  if (txt) MessageFu.success(`${txt2 || ''}已调转至${txt}页面`)
+  if (txt) MessageFu.success(`${txt2 ? txt2 + ',' : ''}已跳转至${txt}页面`)
 }

+ 39 - 2
src/utils/dataChange.ts

@@ -113,8 +113,45 @@ export const selectObj = {
 
 // 详情页申请类型-获取字典数据
 export const getDictFu = (key: string) => {
-  const ditcAll = store.getState().I2dict.dictAll
-  const list = ditcAll.filter(v => v.name === key)
+  const dictAll = store.getState().I2dict.dictAll
+  const list = dictAll.filter(v => v.name === key)
 
   return list[0].children
 }
+
+// -------------------级联回显-------------------
+export const resJiLianFu = (idTemp: string, type?: 'tag', isNull?: string) => {
+  if (idTemp) {
+    const dictAll = type ? store.getState().E1tag.treeData : store.getState().I2dict.dictAll
+
+    const idArr = idTemp.split(',')
+    const id = idArr[idArr.length - 1]
+    let arr = treeLastIdFindFatherFu(dictAll, id, 'name')
+
+    if (!type) {
+      if (arr.length >= 2) arr = arr.slice(1)
+    }
+
+    if (arr && arr.length) return arr.join(' / ')
+    else return isNull || '(空)'
+  } else return isNull || '(空)'
+}
+
+// size字段拼接
+export const myTableTransferSize = (item: any) => {
+  let danWei = 'cm'
+
+  let txt1 = item.sizeL ? `通长${item.sizeL}` : ''
+  let txt2 = item.sizeW ? `通宽${item.sizeW}` : ''
+  let txt3 = item.sizeH ? `通高${item.sizeH}` : ''
+
+  txt1 = txt1 ? txt1 + danWei : ''
+  txt2 = txt2 ? txt2 + danWei : ''
+  txt3 = txt3 ? txt3 + danWei : ''
+
+  let arr = [txt1, txt2, txt3]
+  arr = arr.filter(v => v)
+
+  if (!txt1 && !txt2 && !txt3) return '(空)'
+  else return arr.join(' - ')
+}

+ 1 - 1
src/utils/index.ts

@@ -33,6 +33,6 @@ export const fileIdsResFu = (listTemp: FileListType[]) => {
   const files = listTemp || []
   const fileImgArr = files.filter(v => v.type === 'img')
   const fileOtherArr = files.filter(v => v.type !== 'img')
-  const fileIds = [...fileImgArr, ...fileOtherArr].join(',')
+  const fileIds = [...fileImgArr, ...fileOtherArr].map(v => v.id).join(',')
   return fileIds
 }

+ 18 - 5
src/utils/tableData.ts

@@ -16,10 +16,10 @@
 
 import { selectObj } from './dataChange'
 
-const statusObj: any = {}
-selectObj['订单审批状态'].forEach(v => {
-  statusObj[v.value] = v.label
-})
+// const statusObj: any = {}
+// selectObj['订单审批状态'].forEach(v => {
+//   statusObj[v.value] = v.label
+// })
 
 export const D1tableC = [
   ['dateRes', '登记日期', 'date'],
@@ -27,7 +27,20 @@ export const D1tableC = [
   ['txt', '发起部门', 'deptName'],
   ['txt', '发起人', 'creatorName'],
   ['txt', '发起日期', 'createTime'],
-  ['txtChange', '申请状态', 'status', statusObj]
+  ['select', '申请状态', 'status', selectObj['订单审批状态']]
+]
+
+export const goodsSonTableC = [
+  ['txt', '藏品登记号', 'num'],
+  ['img', '封面', 'thumb'],
+  ['txtCTag', '藏品标签', 'tagDictId'],
+  ['txt', '藏品名称', 'name'],
+  ['select', '级别', 'level', selectObj['藏品级别']],
+  ['txtC', '类别', 'typeDictId'],
+  ['txtC', '年代', 'ageDictId'],
+  ['txtC', '质地', 'textureDictId'],
+  ['select', '完残程度', 'tornLevel', selectObj['完残程度']],
+  ['ping', '数量', 'pcs', 'pcsUnitDictId']
 ]
 
 export const I3tableC = [