|
@@ -8,15 +8,40 @@ import dayjs from 'dayjs'
|
|
|
import Z3upFiles from '@/components/Z3upFiles'
|
|
|
import ZRichTexts from '@/components/ZRichTexts'
|
|
|
import { MessageFu } from '@/utils/message'
|
|
|
-import history, { openGoodsInfoFu } from '@/utils/history'
|
|
|
+import history, {
|
|
|
+ btnFlagFu2,
|
|
|
+ cascaderObjFu,
|
|
|
+ kuIsTreeChangeFu,
|
|
|
+ openGoodsInfoFu
|
|
|
+} from '@/utils/history'
|
|
|
import B3GaddNow from '@/pages/B_enterTibet/B3goodsTable/B3GaddNow'
|
|
|
import MyTable from '@/components/MyTable'
|
|
|
import classNames from 'classnames'
|
|
|
import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
-import { D4tableC, D6goodsTableC } from '@/utils/tableData'
|
|
|
+import { D4goodsTableC, statusObj } from '@/utils/tableData'
|
|
|
import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
|
|
|
import X3auditInfo from '@/pages/X_stock/X3auditInfo'
|
|
|
import B3flowTable from '@/pages/B_enterTibet/B3flowTable'
|
|
|
+import { FourTableType } from '@/pages/B_enterTibet/B3_4page/type'
|
|
|
+import { useDispatch, useSelector } from 'react-redux'
|
|
|
+import { D2_APIgetList } from '@/store/action/D2storSet'
|
|
|
+import { RootState } from '@/store'
|
|
|
+import {
|
|
|
+ D6_APIcreate,
|
|
|
+ D6_APIdel,
|
|
|
+ D6_APIgetInfo,
|
|
|
+ D6_APIrevocation,
|
|
|
+ D6_APIsaveApply,
|
|
|
+ D6_APIsaveAudit,
|
|
|
+ D6_APIsaveCreate,
|
|
|
+ D6_APIsaveDraft
|
|
|
+} from '@/store/action/D6putsStor'
|
|
|
+import { KuIsTreeType } from '../../D4impStor/type'
|
|
|
+import { D1_APIgetSiteList } from '@/store/action/D1storage'
|
|
|
+import { C1GoodType } from '@/pages/C_goodsManage/C1ledger/type'
|
|
|
+import { EXbtnFu } from '@/utils/EXBtn'
|
|
|
+import { TypeD2list } from '../../D2storSet/type'
|
|
|
+import D6impRelation from '../D6impRelation'
|
|
|
|
|
|
function D6edit() {
|
|
|
const { key, id } = useParams<any>()
|
|
@@ -25,15 +50,67 @@ function D6edit() {
|
|
|
// 滚到顶部
|
|
|
const sollrDom = useRef<HTMLDivElement>(null)
|
|
|
|
|
|
+ // 顶部数据
|
|
|
+ const [topInfo, setTopInfo] = useState({} as FourTableType)
|
|
|
+
|
|
|
+ // 出库库房数组信息
|
|
|
+ const dispatch = useDispatch()
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
- console.log('key:', key)
|
|
|
+ dispatch(D2_APIgetList({ pageNum: 1, pageSize: 99999 }))
|
|
|
+ }, [dispatch])
|
|
|
|
|
|
- if (sollrDom.current) sollrDom.current.scrollTop = 0
|
|
|
- }, [key])
|
|
|
+ const { list: storSetList } = useSelector((state: RootState) => state.D2storSet.tableInfo)
|
|
|
|
|
|
- const pageTitTxt = useMemo(() => {
|
|
|
- return Reflect.get(pageTitTxtObj, key)
|
|
|
- }, [key])
|
|
|
+ // 库房负责人txt
|
|
|
+ const managerUser = useMemo(() => {
|
|
|
+ let txt = ''
|
|
|
+ if (topInfo.storageId && storSetList.length) {
|
|
|
+ let obj = storSetList.find(v => v.id === topInfo.storageId)
|
|
|
+ if (obj) txt = obj.managerUser
|
|
|
+ }
|
|
|
+ return txt
|
|
|
+ }, [storSetList, topInfo.storageId])
|
|
|
+
|
|
|
+ // 创建订单
|
|
|
+ const creatFu = useCallback(async () => {
|
|
|
+ const res = await D6_APIcreate()
|
|
|
+ if (res.code === 0) {
|
|
|
+ setTopInfo({ ...res.data, isReturn: 0 })
|
|
|
+ }
|
|
|
+ }, [])
|
|
|
+
|
|
|
+ // 入库的排架 层数 层格变成树
|
|
|
+ const [kuIsTree, setKuIsTreeFu] = useState<KuIsTreeType[]>([])
|
|
|
+
|
|
|
+ const kuIsTreeFu = useCallback(async (id: number) => {
|
|
|
+ const res = await D1_APIgetSiteList(id, false)
|
|
|
+ if (res.code === 0) {
|
|
|
+ const arrTemp: KuIsTreeType[] = kuIsTreeChangeFu(res.data)
|
|
|
+ setKuIsTreeFu(arrTemp)
|
|
|
+ }
|
|
|
+ }, [])
|
|
|
+
|
|
|
+ // 获取详情
|
|
|
+ const getInfoFu = useCallback(async () => {
|
|
|
+ const res = await D6_APIgetInfo(id)
|
|
|
+ if (res.code === 0) {
|
|
|
+ setTopInfo(res.data)
|
|
|
+
|
|
|
+ // 设置富文本
|
|
|
+ ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf) || '{}')
|
|
|
+
|
|
|
+ // 出库库房筛选存放位置数据
|
|
|
+ if (res.data.storageId) kuIsTreeFu(res.data.storageId)
|
|
|
+ }
|
|
|
+ }, [id, kuIsTreeFu])
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ if (key === '1') creatFu()
|
|
|
+ else getInfoFu()
|
|
|
+
|
|
|
+ if (sollrDom.current) sollrDom.current.scrollTop = 0
|
|
|
+ }, [creatFu, getInfoFu, key])
|
|
|
|
|
|
// 上传附件的ref
|
|
|
const filesRef = useRef<any>(null)
|
|
@@ -45,94 +122,114 @@ function D6edit() {
|
|
|
// 审批意见的ref
|
|
|
const ZAuditRef = useRef<any>(null)
|
|
|
|
|
|
- // 设置富文本
|
|
|
- // ZRichTextRef.current?.ritxtShowFu(JSON.parse(data.rtf))
|
|
|
-
|
|
|
- // 新增的底部按钮点击
|
|
|
- const btnClickFu = useCallback((val: number) => {
|
|
|
- const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
|
|
|
- console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
|
|
|
-
|
|
|
- const rtf2 = ZAuditRef.current?.resData()
|
|
|
- console.log('审批信息富文本', rtf2)
|
|
|
+ const pageTitTxt = useMemo(() => {
|
|
|
+ return Reflect.get(pageTitTxtObj, key)
|
|
|
+ }, [key])
|
|
|
|
|
|
- // if (1 + 1 === 2) return
|
|
|
+ const timeChange = useCallback(
|
|
|
+ (e: any) => {
|
|
|
+ setTopInfo({ ...topInfo, date: dayjs(e).format('YYYY-MM-DD') })
|
|
|
+ },
|
|
|
+ [topInfo]
|
|
|
+ )
|
|
|
|
|
|
- if (val === 2) {
|
|
|
- // 存草稿 当前页保存 不跳转
|
|
|
- MessageFu.success('草稿保存成功')
|
|
|
+ const checkDataFu = useCallback(() => {
|
|
|
+ if (!topInfo.name) {
|
|
|
+ MessageFu.warning('申请名称不能为空')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (!topInfo.sonTypeName) {
|
|
|
+ MessageFu.warning('请选择业务类型')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (!topInfo.storageId) {
|
|
|
+ MessageFu.warning('请选择出库库房')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
|
|
|
+ MessageFu.warning('请添加藏品')
|
|
|
+ return true
|
|
|
} else {
|
|
|
- // 跳到详情页
|
|
|
- history.push(`/putsStor_edit/4/999`)
|
|
|
+ if (topInfo.goods.some(v => !v.siteStr)) {
|
|
|
+ MessageFu.warning('请选择出库位置')
|
|
|
+ return true
|
|
|
+ }
|
|
|
}
|
|
|
- }, [])
|
|
|
|
|
|
- // 打开侧边栏
|
|
|
- const [cathet, setCathet] = useState(0)
|
|
|
-
|
|
|
- const timeChange = useCallback((e: any) => {
|
|
|
- console.log(123, e)
|
|
|
- }, [])
|
|
|
-
|
|
|
- // 是否归还 单选框
|
|
|
- const [bbbb, setBBBB] = useState(0)
|
|
|
-
|
|
|
- const [huanTime, setHuanTime] = useState('')
|
|
|
-
|
|
|
- // 是否归还 选择 否 的时候 清空预计归还日期
|
|
|
- useEffect(() => {
|
|
|
- if (!bbbb) setHuanTime('')
|
|
|
- }, [bbbb])
|
|
|
-
|
|
|
- // 点击新增
|
|
|
- const [nowSta, setNowSta] = useState({ key: '', id: '' })
|
|
|
+ return false
|
|
|
+ }, [topInfo])
|
|
|
|
|
|
// 审批的sta
|
|
|
const [auditSta, setAuDitSta] = useState('')
|
|
|
|
|
|
- // 查看模式下的按钮 待完善
|
|
|
- const lookBtn = useMemo(() => {
|
|
|
- return (
|
|
|
- <>
|
|
|
- <Button type='primary'>创建</Button>
|
|
|
- <Button type='primary'>提交</Button>
|
|
|
- <MyPopconfirm
|
|
|
- txtK='撤回'
|
|
|
- onConfirm={() => {}}
|
|
|
- Dom={
|
|
|
- <Button type='primary' danger>
|
|
|
- 撤回
|
|
|
- </Button>
|
|
|
- }
|
|
|
- />
|
|
|
+ // 新增的底部按钮点击
|
|
|
+ const btnClickFu = useCallback(
|
|
|
+ async (val: '草稿' | '创建' | '保存' | '审批') => {
|
|
|
+ if (checkDataFu()) return
|
|
|
+
|
|
|
+ if (val === '审批') {
|
|
|
+ // console.log('审批信息富文本', rtf2)
|
|
|
+ if (!auditSta) {
|
|
|
+ if (sollrDom.current) sollrDom.current.scrollTop = 0
|
|
|
+ return MessageFu.warning('请选择审批结果')
|
|
|
+ }
|
|
|
+ const rtf2 = ZAuditRef.current?.resData()
|
|
|
+
|
|
|
+ const res = await D6_APIsaveAudit({
|
|
|
+ orderId: topInfo.id,
|
|
|
+ rtfOpinion: rtf2,
|
|
|
+ status: auditSta === '同意' ? 1 : 2
|
|
|
+ })
|
|
|
+
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success('审批成功')
|
|
|
+ // 跳详情页
|
|
|
+ history.push(`/putsStor_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(',')
|
|
|
+ }
|
|
|
+ // console.log(123, obj)
|
|
|
|
|
|
- <Button type='primary'>审批</Button>
|
|
|
- <Button type='primary'>编辑</Button>
|
|
|
- <Button type='primary'>重新提交</Button>
|
|
|
- <Button type='primary'>导出</Button>
|
|
|
- <MyPopconfirm
|
|
|
- txtK='删除'
|
|
|
- onConfirm={() => {}}
|
|
|
- Dom={
|
|
|
- <Button type='primary' danger>
|
|
|
- 删除
|
|
|
- </Button>
|
|
|
+ // if (1 + 1 === 2) return
|
|
|
+
|
|
|
+ if (val === '草稿') {
|
|
|
+ // 存草稿 当前页保存 不跳转
|
|
|
+ const res = await D6_APIsaveDraft(obj)
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success('草稿保存成功')
|
|
|
}
|
|
|
- />
|
|
|
- <Button onClick={() => history.push('/putsStor')}>返回</Button>
|
|
|
- </>
|
|
|
- )
|
|
|
- }, [])
|
|
|
+ } else {
|
|
|
+ const res = val === '创建' ? await D6_APIsaveCreate(obj) : await D6_APIsaveApply(obj)
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success(`${val}成功`)
|
|
|
+ // 跳到详情页
|
|
|
+ history.push(`/putsStor_edit/4/${topInfo.id}`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ [auditSta, checkDataFu, topInfo]
|
|
|
+ )
|
|
|
|
|
|
- // ----------------表格的逻辑
|
|
|
- // 点击删除
|
|
|
- const delTableFu = useCallback(async (id: number) => {}, [])
|
|
|
+ // 打开侧边栏
|
|
|
+ const [cathet, setCathet] = useState(0)
|
|
|
|
|
|
const startBtn = useMemo(() => {
|
|
|
return [
|
|
|
{
|
|
|
title: '藏品编号',
|
|
|
- render: (item: any) => {
|
|
|
+ render: (item: C1GoodType) => {
|
|
|
return (
|
|
|
<span
|
|
|
onClick={() => setCathet(item.id)}
|
|
@@ -150,57 +247,162 @@ function D6edit() {
|
|
|
return [
|
|
|
{
|
|
|
title: '出库位置',
|
|
|
- render: (item: any) => (
|
|
|
- <Cascader
|
|
|
- disabled={['3', '4'].includes(key)}
|
|
|
- options={[
|
|
|
- { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
|
|
|
- { value: '其他', label: '其他' }
|
|
|
- ]}
|
|
|
- placeholder='请选择'
|
|
|
- // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
|
|
|
- allowClear={false}
|
|
|
- />
|
|
|
- )
|
|
|
+ width: 200,
|
|
|
+ render: (item: C1GoodType) => {
|
|
|
+ return (
|
|
|
+ <Cascader
|
|
|
+ disabled
|
|
|
+ // disabled={['3', '4'].includes(key)}
|
|
|
+ options={kuIsTree}
|
|
|
+ placeholder='请选择'
|
|
|
+ // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
|
|
|
+ allowClear={false}
|
|
|
+ value={item.siteStr ? item.siteStr.split(',').map(v => Number(v)) : undefined}
|
|
|
+ onChange={() => {}}
|
|
|
+ />
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
- render: (item: any) => {
|
|
|
+ render: (item: C1GoodType) => {
|
|
|
return (
|
|
|
<>
|
|
|
<Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
|
|
|
查看
|
|
|
</Button>
|
|
|
{['3', '4'].includes(key) ? null : (
|
|
|
- <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
|
|
|
+ <MyPopconfirm
|
|
|
+ txtK='删除'
|
|
|
+ onConfirm={() =>
|
|
|
+ setTopInfo({
|
|
|
+ ...topInfo,
|
|
|
+ goods: topInfo.goods.filter(v => v.id !== item.id)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ />
|
|
|
)}
|
|
|
</>
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
- }, [delTableFu, key])
|
|
|
+ }, [key, kuIsTree, topInfo])
|
|
|
|
|
|
- const tableLastBtn2 = useMemo(() => {
|
|
|
- return [
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- render: (item: any) => {
|
|
|
- return (
|
|
|
- <Button
|
|
|
- size='small'
|
|
|
- type='text'
|
|
|
- onClick={() => {
|
|
|
- window.open(`/#/impStor_edit/4/${item.id}`, '_blank')
|
|
|
- }}
|
|
|
- >
|
|
|
- 查看
|
|
|
- </Button>
|
|
|
- )
|
|
|
- }
|
|
|
+ // 点击新增
|
|
|
+ const [nowSta, setNowSta] = useState({ key: '', id: '' })
|
|
|
+
|
|
|
+ // 查看的按钮创建-提交-撤回
|
|
|
+ const lookBtnFu = useCallback(
|
|
|
+ async (val: '创建' | '提交' | '撤回') => {
|
|
|
+ const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
|
|
|
+ // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
|
|
|
+
|
|
|
+ // 上传附件
|
|
|
+ const filesRes = filesRef.current.filesIdRes()
|
|
|
+ const obj = {
|
|
|
+ ...topInfo,
|
|
|
+ fileIds: filesRes.join(','),
|
|
|
+ rtf: JSON.stringify(rtf1.val || ''),
|
|
|
+ goodsIds: topInfo.goods.map(v => v.id).join(',')
|
|
|
}
|
|
|
- ]
|
|
|
- }, [])
|
|
|
+
|
|
|
+ const res =
|
|
|
+ val === '创建'
|
|
|
+ ? await D6_APIsaveCreate(obj)
|
|
|
+ : val === '提交'
|
|
|
+ ? await D6_APIsaveApply(obj)
|
|
|
+ : await D6_APIrevocation(id)
|
|
|
+
|
|
|
+ if (res.code === 0) {
|
|
|
+ if (sollrDom.current) sollrDom.current.scrollTop = 0
|
|
|
+ MessageFu.success(val + '成功')
|
|
|
+ getInfoFu()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ [getInfoFu, id, topInfo]
|
|
|
+ )
|
|
|
+
|
|
|
+ // 查看模式点击删除
|
|
|
+ const delFu = useCallback(async () => {
|
|
|
+ const res = await D6_APIdel(id)
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success('删除成功')
|
|
|
+ history.push('/putsStor')
|
|
|
+ }
|
|
|
+ }, [id])
|
|
|
+
|
|
|
+ // 查看模式点击审批 编辑
|
|
|
+ const lookJumpFu = useCallback(
|
|
|
+ (val: '审批' | '编辑') => {
|
|
|
+ history.push(`/putsStor_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()}
|
|
|
+
|
|
|
+ {btnFlagFu2(topInfo)['删除'] ? (
|
|
|
+ <MyPopconfirm
|
|
|
+ txtK='删除'
|
|
|
+ onConfirm={() => delFu()}
|
|
|
+ Dom={
|
|
|
+ <Button type='primary' danger>
|
|
|
+ 删除
|
|
|
+ </Button>
|
|
|
+ }
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
+
|
|
|
+ <Button onClick={() => history.push('/putsStor')}>返回</Button>
|
|
|
+ </>
|
|
|
+ )
|
|
|
+ }, [delFu, lookBtnFu, lookJumpFu, topInfo])
|
|
|
|
|
|
return (
|
|
|
<div className={styles.D6edit}>
|
|
@@ -209,8 +411,8 @@ function D6edit() {
|
|
|
<div className='D6main' ref={sollrDom}>
|
|
|
{['3'].includes(key) ? (
|
|
|
<X3auditInfo
|
|
|
- dirCode='待完善'
|
|
|
- myUrl='待完善'
|
|
|
+ dirCode='putsStor'
|
|
|
+ myUrl='cms/orderOut/upload'
|
|
|
auditSta={auditSta}
|
|
|
auditStaFu={val => setAuDitSta(val)}
|
|
|
ref={ZAuditRef}
|
|
@@ -219,9 +421,10 @@ function D6edit() {
|
|
|
|
|
|
{/* 表单字段、附件等 */}
|
|
|
<div className='D6Tit'>
|
|
|
- {/* 待完善 */}
|
|
|
申请信息
|
|
|
- <Button type='dashed'>草稿</Button>
|
|
|
+ {key === '1' ? null : (
|
|
|
+ <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
|
|
|
+ )}
|
|
|
</div>
|
|
|
|
|
|
<div className='D6rowAll'>
|
|
@@ -231,6 +434,8 @@ function D6edit() {
|
|
|
</div>
|
|
|
<div className='D6rowrr'>
|
|
|
<Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
readOnly={['3', '4'].includes(key)}
|
|
|
placeholder='请输入内容'
|
|
|
maxLength={30}
|
|
@@ -245,14 +450,13 @@ function D6edit() {
|
|
|
</div>
|
|
|
<div className='D6rowrr'>
|
|
|
<Cascader
|
|
|
+ value={topInfo.sonTypeName ? topInfo.sonTypeName.split(',') : []}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, sonTypeName: e ? e.join(',') : '' })}
|
|
|
disabled={['3', '4'].includes(key)}
|
|
|
- options={[
|
|
|
- { value: '年代1', label: '年代11', children: [{ value: 1, label: 'xxx' }] },
|
|
|
- { value: '其他', label: '其他' }
|
|
|
- ]}
|
|
|
+ options={cascaderObjFu()['藏品出库']}
|
|
|
changeOnSelect
|
|
|
placeholder='请选择'
|
|
|
- // fieldNames={{ label: 'name', value: 'id', children: 'children' }}
|
|
|
+ fieldNames={{ label: 'name', value: 'id', children: 'children' }}
|
|
|
allowClear={false}
|
|
|
/>
|
|
|
</div>
|
|
@@ -262,9 +466,9 @@ function D6edit() {
|
|
|
<div className='D6row' key={v.name}>
|
|
|
<div className='D6rowll'>{v.name}:</div>
|
|
|
<div className='D6rowrr'>
|
|
|
- 这是一段文本
|
|
|
+ {topInfo[v.key as 'name']}
|
|
|
{['3', '4'].includes(key) && v.name === '发起人'
|
|
|
- ? ' - 查看和审批后面显示创建时间'
|
|
|
+ ? ' - ' + topInfo.createTime || ''
|
|
|
: ''}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -277,8 +481,14 @@ function D6edit() {
|
|
|
<div className='D6rowrr'>
|
|
|
<Radio.Group
|
|
|
disabled={['3', '4'].includes(key)}
|
|
|
- value={bbbb}
|
|
|
- onChange={e => setBBBB(e.target.value)}
|
|
|
+ value={topInfo.isReturn}
|
|
|
+ onChange={e =>
|
|
|
+ setTopInfo({
|
|
|
+ ...topInfo,
|
|
|
+ isReturn: e.target.value,
|
|
|
+ returnDate: e.target.value === 0 ? '' : topInfo.returnDate
|
|
|
+ })
|
|
|
+ }
|
|
|
options={[
|
|
|
{ value: 1, label: '是' },
|
|
|
{ value: 0, label: '否' }
|
|
@@ -288,13 +498,16 @@ function D6edit() {
|
|
|
</div>
|
|
|
|
|
|
<div className='D6row'>
|
|
|
- <div className='D6rowll'>{bbbb ? <span> * </span> : null} 预计归还日期:</div>
|
|
|
+ <div className='D6rowll'> 预计归还日期:</div>
|
|
|
<div className='D6rowrr'>
|
|
|
<DatePicker
|
|
|
- disabled={['3', '4'].includes(key) || bbbb === 0}
|
|
|
- allowClear={false}
|
|
|
- value={huanTime ? dayjs(huanTime) : null}
|
|
|
- onChange={e => setHuanTime(dayjs(e).format('YYYY-MM-DD'))}
|
|
|
+ placeholder={topInfo.isReturn !== 1 ? '(空)' : '请选择日期'}
|
|
|
+ disabled={['3', '4'].includes(key) || topInfo.isReturn !== 1}
|
|
|
+ allowClear={true}
|
|
|
+ value={topInfo.returnDate ? dayjs(topInfo.returnDate) : null}
|
|
|
+ onChange={e =>
|
|
|
+ setTopInfo({ ...topInfo, returnDate: e ? dayjs(e).format('YYYY-MM-DD') : '' })
|
|
|
+ }
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -307,7 +520,7 @@ function D6edit() {
|
|
|
<DatePicker
|
|
|
disabled={['3', '4'].includes(key)}
|
|
|
allowClear={false}
|
|
|
- value={dayjs()}
|
|
|
+ value={dayjs(topInfo.date)}
|
|
|
onChange={timeChange}
|
|
|
/>
|
|
|
</div>
|
|
@@ -316,6 +529,8 @@ function D6edit() {
|
|
|
<div className='D6rowll'>原因事由:</div>
|
|
|
<div className='D6rowrr'>
|
|
|
<Input
|
|
|
+ value={topInfo.reason}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, reason: e.target.value })}
|
|
|
readOnly={['3', '4'].includes(key)}
|
|
|
placeholder='请输入内容'
|
|
|
maxLength={30}
|
|
@@ -332,9 +547,9 @@ function D6edit() {
|
|
|
isLook={['3', '4'].includes(key)}
|
|
|
ref={filesRef}
|
|
|
fileCheck={false}
|
|
|
- dirCode={'xxxxxxx'}
|
|
|
- myUrl='xxxxxxxxxxxx'
|
|
|
- lookData={[]}
|
|
|
+ dirCode='putsStor'
|
|
|
+ myUrl='cms/orderOut/upload'
|
|
|
+ lookData={topInfo.files || []}
|
|
|
size={500}
|
|
|
/>
|
|
|
</div>
|
|
@@ -345,10 +560,10 @@ function D6edit() {
|
|
|
<div className='D6rowrr'>
|
|
|
<ZRichTexts
|
|
|
check={false}
|
|
|
- dirCode={'xxxxxxxx'}
|
|
|
+ dirCode='putsStor'
|
|
|
+ myUrl='cms/orderOut/upload'
|
|
|
isLook={['3', '4'].includes(key)}
|
|
|
ref={ZRichTextRef}
|
|
|
- myUrl='xxxxxxxxxx'
|
|
|
isOne={true}
|
|
|
upAudioBtnNone={true}
|
|
|
/>
|
|
@@ -363,13 +578,22 @@ function D6edit() {
|
|
|
<span> * </span>出库库房:
|
|
|
</div>
|
|
|
<div className='D6rowrr'>
|
|
|
- {/* 待完善 从库房设置列表里面选择 --根据选择刷新下面的藏品清单列表*/}
|
|
|
- <Select disabled={['3', '4'].includes(key)} placeholder='请选择' />
|
|
|
+ <Select
|
|
|
+ options={storSetList}
|
|
|
+ value={topInfo.storageId}
|
|
|
+ onChange={(storageId, arr) => {
|
|
|
+ setTopInfo({ ...topInfo, storageId, goods: [] })
|
|
|
+ kuIsTreeFu((arr as TypeD2list).id)
|
|
|
+ }}
|
|
|
+ disabled={['3', '4'].includes(key)}
|
|
|
+ fieldNames={{ value: 'id', label: 'name' }}
|
|
|
+ placeholder='请选择'
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className='D6row D6row3'>
|
|
|
<div className='D6rowll'>库房负责人:</div>
|
|
|
- <div className='D6rowrr'>这是一段文本</div>
|
|
|
+ <div className='D6rowrr'>{managerUser || '(空)'}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -379,7 +603,13 @@ function D6edit() {
|
|
|
<div className='D6Tit2ll'>藏品清单</div>
|
|
|
<div className='D6Tit2rr'>
|
|
|
{['3', '4'].includes(key) ? null : (
|
|
|
- <Button type='primary' onClick={() => setNowSta({ key: '6', id })}>
|
|
|
+ <Button
|
|
|
+ type='primary'
|
|
|
+ onClick={() => {
|
|
|
+ if (!topInfo.storageId) return MessageFu.warning('请先选择出库库房')
|
|
|
+ setNowSta({ key: '5', id: 'cms/orderOut/goods/getList' })
|
|
|
+ }}
|
|
|
+ >
|
|
|
新增
|
|
|
</Button>
|
|
|
)}
|
|
@@ -388,8 +618,8 @@ function D6edit() {
|
|
|
|
|
|
{/* 表格 */}
|
|
|
<MyTable
|
|
|
- list={[{ id: 99, thumb: '', num: '一段编号_可点击' }]}
|
|
|
- columnsTemp={D6goodsTableC}
|
|
|
+ list={topInfo.goods || []}
|
|
|
+ columnsTemp={D4goodsTableC}
|
|
|
startBtn={startBtn}
|
|
|
lastBtn={tableLastBtn}
|
|
|
pagingInfo={false}
|
|
@@ -397,31 +627,10 @@ function D6edit() {
|
|
|
</div>
|
|
|
|
|
|
{/* 相关入库单 */}
|
|
|
-
|
|
|
- {/* 通过后端数据,没有入库单的隐藏 */}
|
|
|
-
|
|
|
- {key === '4' ? (
|
|
|
- <div className='D6_4tableBox'>
|
|
|
- <div className='D6Tit'>相关入库单</div>
|
|
|
- <MyTable
|
|
|
- list={[{ id: 77, thumb: '' }]}
|
|
|
- columnsTemp={D4tableC}
|
|
|
- lastBtn={tableLastBtn2}
|
|
|
- pagingInfo={false}
|
|
|
- />
|
|
|
- </div>
|
|
|
- ) : null}
|
|
|
+ {key === '4' ? <D6impRelation list={topInfo.relatedOrder || []} /> : null}
|
|
|
|
|
|
{/* 申请流程 */}
|
|
|
- {['3', '4'].includes(key) ? (
|
|
|
- <B3flowTable
|
|
|
- tableArr={
|
|
|
- [
|
|
|
- // 待完善
|
|
|
- ]
|
|
|
- }
|
|
|
- />
|
|
|
- ) : null}
|
|
|
+ {['3', '4'].includes(key) ? <B3flowTable tableArr={topInfo.audits || []} /> : null}
|
|
|
</div>
|
|
|
|
|
|
{/* 底部按钮 */}
|
|
@@ -430,12 +639,18 @@ function D6edit() {
|
|
|
lookBtn
|
|
|
) : (
|
|
|
<>
|
|
|
- <Button type='primary' onClick={() => btnClickFu(1)}>
|
|
|
- {key === '1' ? '创建' : '保存'}
|
|
|
- </Button>
|
|
|
+ {key === '3' ? (
|
|
|
+ <Button type='primary' onClick={() => btnClickFu('审批')}>
|
|
|
+ 审批
|
|
|
+ </Button>
|
|
|
+ ) : (
|
|
|
+ <Button type='primary' onClick={() => btnClickFu(key === '1' ? '创建' : '保存')}>
|
|
|
+ {key === '1' ? '创建' : '保存'}
|
|
|
+ </Button>
|
|
|
+ )}
|
|
|
|
|
|
{key === '1' ? (
|
|
|
- <Button type='primary' onClick={() => btnClickFu(2)}>
|
|
|
+ <Button type='primary' onClick={() => btnClickFu('草稿')}>
|
|
|
存草稿
|
|
|
</Button>
|
|
|
) : null}
|
|
@@ -452,9 +667,9 @@ function D6edit() {
|
|
|
<B3GaddNow
|
|
|
nowSta={nowSta}
|
|
|
closeFu={() => setNowSta({ key: '', id: '' })}
|
|
|
- dataResFu={data => {}}
|
|
|
- // 待完善
|
|
|
- oldCheckArr={[]}
|
|
|
+ dataResFu={data => setTopInfo({ ...topInfo, goods: data })}
|
|
|
+ oldCheckArr={topInfo.goods || []}
|
|
|
+ canObj={{ storageId: topInfo.storageId }}
|
|
|
/>
|
|
|
) : null}
|
|
|
</div>
|