|
@@ -0,0 +1,610 @@
|
|
|
+import React, { useCallback, useMemo, useRef, useState } from 'react'
|
|
|
+import style from './index.module.scss'
|
|
|
+import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
|
|
|
+import { useParams } from 'react-router-dom'
|
|
|
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
|
|
|
+import { Button, Input, Radio, Select } from 'antd'
|
|
|
+import { statusObj } from '@/utils/tableData'
|
|
|
+import ZRichTexts from '@/components/ZRichTexts'
|
|
|
+import MyTable from '@/components/MyTable'
|
|
|
+import { F1_GOOD_COLUMNS } from '../constants'
|
|
|
+import ZGaddNow from '@/components/ZGaddNow'
|
|
|
+import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
+import history, { btnFlagFu2, openGoodsInfoFu } from '@/utils/history'
|
|
|
+import {
|
|
|
+ D4_APIdel,
|
|
|
+ D4_APIgetInfo,
|
|
|
+ D4_APIrevocation,
|
|
|
+ D4_APIsaveApply,
|
|
|
+ D4_APIsaveAudit,
|
|
|
+ D4_APIsaveCreate,
|
|
|
+ D4_APIsaveDraft
|
|
|
+} from '@/store/action/D4impStor'
|
|
|
+import { MessageFu } from '@/utils/message'
|
|
|
+import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
|
|
|
+import { EXbtnFu } from '@/utils/EXBtn'
|
|
|
+
|
|
|
+function F1edit() {
|
|
|
+ const { key, id } = useParams<any>()
|
|
|
+ // 滚到顶部
|
|
|
+ const sollrDom = useRef<HTMLDivElement>(null)
|
|
|
+ // 审批的sta
|
|
|
+ const [auditSta, setAuDitSta] = useState('')
|
|
|
+ // 审批意见的ref
|
|
|
+ const ZAuditRef = useRef<any>(null)
|
|
|
+ // 顶部数据
|
|
|
+ const [topInfo, setTopInfo] = useState({} as FourTableType)
|
|
|
+ // 富文本的ref
|
|
|
+ const ZRichTextRef = useRef<any>(null)
|
|
|
+ // 点击新增
|
|
|
+ const [nowSta, setNowSta] = useState({ key: '', id: '' })
|
|
|
+ // 申请记录
|
|
|
+ const [auditsShow, setAuditsShow] = useState(false)
|
|
|
+ // 上传附件的ref
|
|
|
+ const filesRef = useRef<any>(null)
|
|
|
+
|
|
|
+ const pageTitTxt = useMemo(() => {
|
|
|
+ return Reflect.get(pageTitTxtObj, key)
|
|
|
+ }, [key])
|
|
|
+
|
|
|
+ const tableLastBtn = useMemo(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ render: (item: any) => (
|
|
|
+ <>
|
|
|
+ <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
|
|
|
+ 查看
|
|
|
+ </Button>
|
|
|
+ {['3', '4'].includes(key) ? null : (
|
|
|
+ <MyPopconfirm
|
|
|
+ txtK='删除'
|
|
|
+ onConfirm={() =>
|
|
|
+ setTopInfo({
|
|
|
+ ...topInfo,
|
|
|
+ goods: topInfo.goods.filter(v => v.id !== item.id)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }, [])
|
|
|
+
|
|
|
+ // 获取详情
|
|
|
+ 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 || '{}'))
|
|
|
+ }
|
|
|
+ }, [id])
|
|
|
+
|
|
|
+ // 查看模式点击删除
|
|
|
+ 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 lookBtnFu = useCallback(
|
|
|
+ async (val: '创建' | '提交' | '撤回') => {
|
|
|
+ if (val !== '撤回') {
|
|
|
+ if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
|
|
|
+ return MessageFu.warning('请添加藏品')
|
|
|
+ } else {
|
|
|
+ if (topInfo.goods.some(v => !v.siteStr || !v.siteId)) {
|
|
|
+ return MessageFu.warning('请选择存放位置')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
|
|
|
+ // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
|
|
|
+
|
|
|
+ // 上传附件
|
|
|
+ const filesRes = filesRef.current.filesIdRes()
|
|
|
+ const obj = {
|
|
|
+ ...topInfo,
|
|
|
+ fileIds: filesRes.join(','),
|
|
|
+ rtf: JSON.stringify(rtf1.val || ''),
|
|
|
+ goodsIds: topInfo.goods.map(v => v.id).join(','),
|
|
|
+ goods: topInfo.goods.map(v => ({
|
|
|
+ goodsId: v.id,
|
|
|
+ siteId: v.siteId
|
|
|
+ }))
|
|
|
+ }
|
|
|
+
|
|
|
+ const res =
|
|
|
+ val === '创建'
|
|
|
+ ? await 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 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('/impStor')}>返回</Button>
|
|
|
+ </>
|
|
|
+ )
|
|
|
+ }, [delFu, lookBtnFu, lookJumpFu, topInfo])
|
|
|
+
|
|
|
+ const checkDataFu = useCallback(() => {
|
|
|
+ if (!topInfo.name) {
|
|
|
+ MessageFu.warning('申请名称不能为空')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (!topInfo.sonTypeName) {
|
|
|
+ MessageFu.warning('请选择业务类型')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (!topInfo.storageId) {
|
|
|
+ MessageFu.warning('请选择入库库房')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
+ return false
|
|
|
+ }, [topInfo])
|
|
|
+
|
|
|
+ // 新增的底部按钮点击
|
|
|
+ const btnClickFu = useCallback(
|
|
|
+ async (val: '草稿' | '创建' | '保存' | '审批') => {
|
|
|
+ if (checkDataFu()) return
|
|
|
+
|
|
|
+ if (val !== '草稿') {
|
|
|
+ if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
|
|
|
+ return MessageFu.warning('请添加藏品')
|
|
|
+ } else {
|
|
|
+ if (topInfo.goods.some(v => !v.siteStr || !v.siteId)) {
|
|
|
+ return MessageFu.warning('请选择存放位置')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (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,
|
|
|
+ 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]
|
|
|
+ )
|
|
|
+
|
|
|
+ return (
|
|
|
+ <div className={style.F1edit}>
|
|
|
+ <div className='pageTitle'>借展管理-{pageTitTxt}</div>
|
|
|
+
|
|
|
+ <div className='D4main' ref={sollrDom}>
|
|
|
+ {['3'].includes(key) ? (
|
|
|
+ <X3auditInfo
|
|
|
+ dirCode='D4impStor'
|
|
|
+ myUrl='cms/orderIn/upload'
|
|
|
+ auditSta={auditSta}
|
|
|
+ auditStaFu={val => setAuDitSta(val)}
|
|
|
+ ref={ZAuditRef}
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
+
|
|
|
+ {/* 表单字段、附件等 */}
|
|
|
+ <div className='D4Tit'>
|
|
|
+ 申请信息
|
|
|
+ {key === '1' ? null : (
|
|
|
+ <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ <div className='D4rowAll'>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>业务单号:</div>
|
|
|
+ <div className='D4rowrr'>这是一段文本</div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>业务名称:</div>
|
|
|
+ <div className='D4rowrr'>这是一段文本</div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>发起人:</div>
|
|
|
+ <div className='D4rowrr'>这是一段文本</div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>发起部门:</div>
|
|
|
+ <div className='D4rowrr'>这是一段文本</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className='D4Tit'>展览信息</div>
|
|
|
+ <div className='D4rowAll'>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>
|
|
|
+ <span> * </span>展览名称:
|
|
|
+ </div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
+ placeholder='请输入内容'
|
|
|
+ maxLength={30}
|
|
|
+ showCount
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>
|
|
|
+ <span> * </span>借展类型:
|
|
|
+ </div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Radio.Group>
|
|
|
+ <Radio>馆内展览</Radio>
|
|
|
+ <Radio>馆外展览</Radio>
|
|
|
+ </Radio.Group>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>
|
|
|
+ <span> * </span>展览类型:
|
|
|
+ </div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Select
|
|
|
+ options={[
|
|
|
+ {
|
|
|
+ value: 0,
|
|
|
+ label: '临时展览'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: '固定展览'
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>提用审批单号:</div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
+ placeholder='请输入内容'
|
|
|
+ maxLength={30}
|
|
|
+ showCount
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>
|
|
|
+ <span> * </span>借展部门:
|
|
|
+ </div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
+ placeholder='请输入内容'
|
|
|
+ maxLength={30}
|
|
|
+ showCount
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>提退凭证号:</div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
+ placeholder='请输入内容'
|
|
|
+ maxLength={30}
|
|
|
+ showCount
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>出借经手人:</div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll' style={{ width: 50 }}>
|
|
|
+ 甲方:
|
|
|
+ </div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
+ placeholder='请输入内容'
|
|
|
+ maxLength={30}
|
|
|
+ showCount
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row' style={{ marginBottom: 0 }}>
|
|
|
+ <div className='D4rowll' style={{ width: 50 }}>
|
|
|
+ 乙方:
|
|
|
+ </div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
+ placeholder='请输入内容'
|
|
|
+ maxLength={30}
|
|
|
+ showCount
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>归还经手人:</div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll' style={{ width: 50 }}>
|
|
|
+ 甲方:
|
|
|
+ </div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
+ placeholder='请输入内容'
|
|
|
+ maxLength={30}
|
|
|
+ showCount
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row' style={{ marginBottom: 0 }}>
|
|
|
+ <div className='D4rowll' style={{ width: 50 }}>
|
|
|
+ 乙方:
|
|
|
+ </div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
+ placeholder='请输入内容'
|
|
|
+ maxLength={30}
|
|
|
+ showCount
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row'>
|
|
|
+ <div className='D4rowll'>记录人:</div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
+ placeholder='请输入内容'
|
|
|
+ maxLength={30}
|
|
|
+ showCount
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className='D4row D4rowFull' style={{ margin: 0 }}>
|
|
|
+ <div className='D4rowll'>备注:</div>
|
|
|
+ <div className='D4rowrr'>
|
|
|
+ <ZRichTexts
|
|
|
+ check={false}
|
|
|
+ dirCode='impStor'
|
|
|
+ myUrl='cms/orderIn/upload'
|
|
|
+ isLook={['3', '4'].includes(key)}
|
|
|
+ ref={ZRichTextRef}
|
|
|
+ isOne={true}
|
|
|
+ upAudioBtnNone={true}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className='D4googsBox'>
|
|
|
+ <div className='D4Tit2'>
|
|
|
+ <div className='D4Tit2ll'>参展藏品</div>
|
|
|
+ <div className='D4Tit2rr'>
|
|
|
+ {['3', '4'].includes(key) ? null : (
|
|
|
+ <>
|
|
|
+ <Button
|
|
|
+ type='primary'
|
|
|
+ onClick={() => {
|
|
|
+ setNowSta({ key: '5', id: 'cms/orderIn/goods/getList' })
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 新增
|
|
|
+ </Button>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* 表格 */}
|
|
|
+ <MyTable
|
|
|
+ list={topInfo.goods || []}
|
|
|
+ columnsTemp={F1_GOOD_COLUMNS}
|
|
|
+ pagingInfo={false}
|
|
|
+ lastBtn={tableLastBtn}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* 底部按钮 */}
|
|
|
+ <div className='D4btn'>
|
|
|
+ {['3', '4'].includes(key) && topInfo.audits && topInfo.audits.length ? (
|
|
|
+ <Button type='primary' onClick={() => setAuditsShow(true)}>
|
|
|
+ 申请记录
|
|
|
+ </Button>
|
|
|
+ ) : null}
|
|
|
+
|
|
|
+ {key === '4' ? (
|
|
|
+ lookBtn
|
|
|
+ ) : (
|
|
|
+ <>
|
|
|
+ {key === '3' ? (
|
|
|
+ <Button type='primary' onClick={() => btnClickFu('审批')}>
|
|
|
+ 审批
|
|
|
+ </Button>
|
|
|
+ ) : (
|
|
|
+ <Button type='primary' onClick={() => btnClickFu(key === '1' ? '创建' : '保存')}>
|
|
|
+ {key === '1' ? '创建' : '保存'}
|
|
|
+ </Button>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {key === '1' ? (
|
|
|
+ <Button type='primary' onClick={() => btnClickFu('草稿')}>
|
|
|
+ 存草稿
|
|
|
+ </Button>
|
|
|
+ ) : null}
|
|
|
+
|
|
|
+ <MyPopconfirm txtK='取消' onConfirm={() => history.push('/impStor')} />
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* 新增弹窗 */}
|
|
|
+ {nowSta.id ? (
|
|
|
+ <ZGaddNow
|
|
|
+ nowSta={nowSta}
|
|
|
+ closeFu={() => setNowSta({ key: '', id: '' })}
|
|
|
+ dataResFu={data => setTopInfo({ ...topInfo, goods: data })}
|
|
|
+ oldCheckArr={topInfo.goods || []}
|
|
|
+ canObj={{ storageId: topInfo.storageId }}
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+const MemoF1edit = React.memo(F1edit)
|
|
|
+
|
|
|
+export default MemoF1edit
|