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