123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822 |
- import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
- import styles from './index.module.scss'
- import { useDispatch, useSelector } from 'react-redux'
- import { D2_APIgetList } from '@/store/action/D2storSet'
- import { RootState } from '@/store'
- import { useParams } from 'react-router-dom'
- import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
- import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
- import {
- D5_APIcreate,
- D5_APIdel,
- D5_APIgetInfo,
- D5_APIgetStorageNum,
- D5_APIrevocation,
- D5_APIsaveApply,
- D5_APIsaveAudit,
- D5_APIsaveCreate,
- D5_APIsaveDraft
- } from '@/store/action/D5moveStor'
- import { API_goodsInfo } from '@/store/action/C1ledger'
- import { pageTitTxtObj } from '../../D4impStor/D4edit'
- import dayjs from 'dayjs'
- import { MessageFu } from '@/utils/message'
- import { findFirstDuplicate } from '../../D4impStor/data'
- import history, { btnFlagFu2, openGoodsInfoFu } from '@/utils/history'
- import classNames from 'classnames'
- import { Button, DatePicker, Input, InputNumber, Modal, Select } from 'antd'
- import TextArea from 'antd/es/input/TextArea'
- import MyPopconfirm from '@/components/MyPopconfirm'
- import { EXbtnFu } from '@/utils/EXBtn'
- import D4check, { D4checkArrType } from '../../D4impStor/D4edit/D4check'
- import X3auditInfo from '@/pages/X_stock/X3auditInfo'
- import { D4tableCgoods, statusObj } from '@/utils/tableData'
- import MyTable from '@/components/MyTable'
- import ZflowTable from '@/components/ZflowTable'
- import ZupFileTable from '@/components/ZupFileTable'
- import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
- import ZGaddNow from '@/components/ZGaddNow'
- function D5edit() {
- // 获取库房设置列表 用于分库缩写下拉
- const dispatch = useDispatch()
- useEffect(() => {
- dispatch(D2_APIgetList({ pageNum: 1, pageSize: 99999 }))
- }, [dispatch])
- const { list: storageIdArr } = useSelector((state: RootState) => state.D2storSet.tableInfo)
- const { key, id } = useParams<any>()
- // key:1 新增 2编辑 3审批 4查看
- // 滚到顶部
- const sollrDom = useRef<HTMLDivElement>(null)
- // 顶部数据
- const [topInfo, setTopInfo] = useState({} as FourTableType)
- // 藏品清单快照数据
- const [snaps, setSnaps] = useState<C1GoodType[]>([])
- const delSnapIdsRef = useRef<number[]>([])
- const snapsID2ref = useRef<{ goodsId: number; id: number }[]>([])
- // 创建订单
- const creatFu = useCallback(async () => {
- const res = await D5_APIcreate()
- if (res.code === 0) {
- // 从藏品详情点击按钮进来
- const urlAll = window.location.href
- if (urlAll.includes('?id=')) {
- const urlId = urlAll.split('?id=')[1]
- const res2 = await API_goodsInfo(Number(urlId))
- if (res2.code === 0) {
- setTopInfo({ ...res.data, storageOutId: res2.data.storageId })
- setSnaps([res2.data])
- }
- } else setTopInfo(res.data)
- }
- }, [])
- // 获取详情
- const getInfoFu = useCallback(
- async (id2?: number) => {
- const res = await D5_APIgetInfo(id2 || id)
- if (res.code === 0) {
- const data = res.data
- setTopInfo(data)
- // 藏品清单快照信息id对比
- const arrTemp: any = []
- const snapsTemp = data.snaps || []
- snapsTemp.forEach((v: any) => {
- snapsID2ref.current.push({ goodsId: v.goodsId, id: v.id })
- const obj = JSON.parse(v.snap || '{}')
- if (obj.id) obj.id2 = v.id
- arrTemp.push(obj)
- })
- setSnaps(arrTemp)
- }
- },
- [id]
- )
- useEffect(() => {
- if (key === '1') creatFu()
- else getInfoFu()
- if (sollrDom.current) sollrDom.current.scrollTop = 0
- }, [creatFu, getInfoFu, key])
- const pageTitTxt = useMemo(() => {
- return Reflect.get(pageTitTxtObj, key)
- }, [key])
- const timeChange = useCallback(
- (e: any, key: 'date') => {
- setTopInfo({ ...topInfo, [key]: dayjs(e).format('YYYY-MM-DD') })
- },
- [topInfo]
- )
- // 审批意见的ref
- const ZAuditRef = useRef<any>(null)
- // 审批的sta
- const [auditSta, setAuDitSta] = useState('')
- // 字段的校验
- const checkFu = useCallback(() => {
- if (!topInfo.date) {
- MessageFu.warning('请选择移库日期')
- return true
- }
- if (!topInfo.num) {
- MessageFu.warning('请输入移库单编号')
- return true
- }
- if (!topInfo.storageOutId) {
- MessageFu.warning('请选择出库分库缩写')
- return true
- }
- if (!topInfo.storageId) {
- MessageFu.warning('请选择入库分库缩写')
- return true
- }
- if (!topInfo.reason) {
- MessageFu.warning('请输入移库原因')
- return true
- }
- if (!topInfo.sonUser) {
- MessageFu.warning('请输入移库人员')
- return true
- }
- }, [topInfo])
- // 新增的底部按钮点击
- const btnClickFu = useCallback(
- async (val: '草稿' | '创建' | '保存' | '审批') => {
- if (checkFu()) {
- if (sollrDom.current) sollrDom.current.scrollTop = 0
- return
- }
- if (val !== '草稿') {
- if (snaps.length === 0) return MessageFu.warning('请添加藏品')
- if (snaps.some(v => !v.siteNumNew)) return MessageFu.warning('请输入入库分库号')
- // 分库号输入重复校验
- const siteNumArr = snaps.map(v => v.siteNumNew!)
- const num = findFirstDuplicate(siteNumArr)
- if (num) return MessageFu.warning(`入库分库号${num}重复`)
- }
- if (val === '审批') {
- // console.log('审批信息富文本', rtf2)
- if (!auditSta) {
- if (sollrDom.current) sollrDom.current.scrollTop = 0
- return MessageFu.warning('请选择审批结果')
- }
- const rtf2 = ZAuditRef.current?.resData()
- const res: any = await D5_APIsaveAudit({
- orderId: topInfo.id,
- rtfOpinion: rtf2,
- status: auditSta === '同意' ? 1 : 2
- })
- if (res.code === 0) {
- MessageFu.success('审批成功')
- // 跳详情页
- history.push(`/moveStor_edit/4/${topInfo.id}`)
- } else if (res.code === 3101) {
- const data = JSON.parse(res.msg || '[]')
- setCheckArr(data)
- }
- } else {
- const obj = {
- ...topInfo,
- goodsIds: snaps.map(v => v.id).join(','),
- siteNums: snaps.map(v => v.siteNumNew).join(','),
- delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
- snaps: snaps.map(v => ({
- goodsId: v.id,
- id: v.id2 ? v.id2 : null,
- orderId: topInfo.id,
- siteNum: v.siteNumNew,
- snap: JSON.stringify(v)
- }))
- }
- // console.log(123, obj.snaps)
- // if (1 + 1 === 2) return
- if (val === '草稿') {
- // 存草稿 当前页保存 不跳转
- const res = await D5_APIsaveDraft(obj)
- if (res.code === 0) {
- MessageFu.success('草稿保存成功')
- getInfoFu(topInfo.id)
- }
- } else {
- const res: any = val === '创建' ? await D5_APIsaveCreate(obj) : await D5_APIsaveApply(obj)
- if (res.code === 0) {
- MessageFu.success(`${val}成功`)
- // 跳到详情页
- history.push(`/moveStor_edit/4/${topInfo.id}`)
- } else if (res.code === 3101) {
- const data = JSON.parse(res.msg || '[]')
- // setCheckArr(data)
- const siteNumArr = data.map((v: any) => v.siteNum)
- MessageFu.warning(`入库分库号${siteNumArr}已存在`)
- }
- }
- }
- },
- [auditSta, checkFu, getInfoFu, snaps, topInfo]
- )
- // 打开侧边栏
- const [cathet, setCathet] = useState(0)
- // 表格的输入框改变
- const tableInputChange = useCallback(
- (id: number, val: number | null, key: 'siteNumNew') => {
- setSnaps(
- snaps.map(v => ({
- ...v,
- [key]: v.id === id ? val : v[key]
- }))
- )
- },
- [snaps]
- )
- const startBtn = useMemo(() => {
- return [
- {
- title: '编号',
- render: (item: C1GoodType) => {
- return (
- <span
- onClick={() => setCathet(item.id)}
- className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
- >
- {item.num || '(空)'}
- </span>
- )
- }
- },
- {
- title: '登记号类型',
- render: (item: C1GoodType) => item.numName || '(空)'
- },
- // {
- // title: '出库分库号',
- // render: (item: C1GoodType) => item.siteNumOld || '(空)'
- // },
- {
- title: (
- <div>
- <span style={{ color: '#ff4d4f' }}> * </span>入库分库号
- </div>
- ),
- width: 180,
- render: (item: C1GoodType) => (
- <InputNumber
- style={{ width: 170 }}
- disabled={!topInfo.storageId}
- readOnly={['3', '4'].includes(key)}
- min={1}
- max={99999999}
- precision={0}
- value={item.siteNumNew}
- onChange={e => tableInputChange(item.id, e, 'siteNumNew')}
- placeholder={!topInfo.storageId ? '请先选择入库分库缩写' : '请输入'}
- />
- )
- }
- ]
- }, [cathet, key, tableInputChange, topInfo.storageId])
- const tableLastBtn = useMemo(() => {
- return [
- {
- title: '备注',
- width: 240,
- render: (item: C1GoodType) => (
- <TextArea
- readOnly={['3', '4'].includes(key)}
- placeholder={
- ['3', '4'].includes(key) && !item.beiZhu ? '(空)' : '请输入内容,不超过200字'
- }
- maxLength={200}
- value={item.beiZhu}
- onChange={e =>
- setSnaps(
- snaps.map(v => ({
- ...v,
- beiZhu: v.id === item.id ? e.target.value.trim() : v.beiZhu
- }))
- )
- }
- />
- )
- },
- {
- title: '操作',
- render: (item: C1GoodType) => {
- return (
- <>
- <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
- 查看
- </Button>
- {['3', '4'].includes(key) ? null : (
- <MyPopconfirm
- txtK='删除'
- onConfirm={() => {
- if (item.id2 && !delSnapIdsRef.current.includes(item.id2))
- delSnapIdsRef.current.push(item.id2)
- setSnaps(snaps.filter(v => v.id !== item.id))
- }}
- />
- )}
- </>
- )
- }
- }
- ]
- }, [key, snaps])
- // 点击添加按钮
- const [nowSta, setNowSta] = useState({ key: '', id: '' })
- // 查看的按钮创建-提交-撤回
- const lookBtnFu = useCallback(
- async (val: '创建' | '提交' | '撤回') => {
- if (val !== '撤回') {
- if (snaps.length === 0) return MessageFu.warning('请添加藏品')
- if (snaps.some(v => !v.siteNumNew)) return MessageFu.warning('请输入入库分库号')
- // 分库号输入重复校验
- const siteNumArr = snaps.map(v => v.siteNumNew!)
- const num = findFirstDuplicate(siteNumArr)
- if (num) return MessageFu.warning(`入库分库号${num}重复`)
- }
- const obj = {
- ...topInfo,
- goodsIds: snaps.map(v => v.id).join(','),
- siteNums: snaps.map(v => v.siteNumNew).join(','),
- delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
- snaps: snaps.map(v => ({
- goodsId: v.id,
- id: v.id2 ? v.id2 : null,
- orderId: topInfo.id,
- siteNum: v.siteNumNew,
- snap: JSON.stringify(v)
- }))
- }
- // console.log(123, obj.snaps)
- // if (1 + 1 === 2) return
- const res: any =
- val === '创建'
- ? await D5_APIsaveCreate(obj)
- : val === '提交'
- ? await D5_APIsaveApply(obj)
- : await D5_APIrevocation(id)
- if (res.code === 0) {
- if (sollrDom.current) sollrDom.current.scrollTop = 0
- MessageFu.success(val + '成功')
- getInfoFu()
- } else if (res.code === 3101) {
- const data = JSON.parse(res.msg || '[]')
- // setCheckArr(data)
- const siteNumArr = data.map((v: any) => v.siteNum)
- MessageFu.warning(`入库分库号${siteNumArr}已存在`)
- }
- },
- [getInfoFu, id, snaps, topInfo]
- )
- // 查看模式点击删除
- const delFu = useCallback(async () => {
- const res = await D5_APIdel(id)
- if (res.code === 0) {
- MessageFu.success('删除成功')
- history.push('/moveStor')
- }
- }, [id])
- // 查看模式点击审批 编辑
- const lookJumpFu = useCallback(
- (val: '审批' | '编辑') => {
- history.push(`/moveStor_edit/${val === '审批' ? 3 : 2}/${id}`)
- MessageFu.success(`已跳转至${val}页面`)
- },
- [id]
- )
- // 查看模式下的按钮
- const lookBtn = useMemo(() => {
- return (
- <>
- {btnFlagFu2(topInfo)['创建'] ? (
- <Button type='primary' onClick={() => lookBtnFu('创建')}>
- 创建
- </Button>
- ) : null}
- {btnFlagFu2(topInfo)['提交'] ? (
- <Button type='primary' onClick={() => lookBtnFu('提交')}>
- 提交
- </Button>
- ) : null}
- {btnFlagFu2(topInfo)['撤回'] ? (
- <MyPopconfirm
- txtK='撤回'
- onConfirm={() => lookBtnFu('撤回')}
- Dom={
- <Button type='primary' danger>
- 撤回
- </Button>
- }
- />
- ) : null}
- {btnFlagFu2(topInfo)['审批'] ? (
- <Button type='primary' onClick={() => lookJumpFu('审批')}>
- 审批
- </Button>
- ) : null}
- {btnFlagFu2(topInfo)['编辑'] ? (
- <Button type='primary' onClick={() => lookJumpFu('编辑')}>
- 编辑
- </Button>
- ) : null}
- {btnFlagFu2(topInfo)['重新提交'] ? (
- <Button type='primary' onClick={() => lookBtnFu('提交')}>
- 重新提交
- </Button>
- ) : null}
- {EXbtnFu(topInfo)}
- {btnFlagFu2(topInfo)['删除'] ? (
- <MyPopconfirm
- txtK='删除'
- onConfirm={() => delFu()}
- Dom={
- <Button type='primary' danger>
- 删除
- </Button>
- }
- />
- ) : null}
- <Button onClick={() => history.push('/moveStor')}>返回</Button>
- </>
- )
- }, [delFu, lookBtnFu, lookJumpFu, topInfo])
- // 申请记录
- const [auditsShow, setAuditsShow] = useState(false)
- // 点击自动分配空置分库号
- const autoFu = useCallback(async () => {
- if (!topInfo.storageId) return MessageFu.warning('请先选择入库分库缩写')
- const res = await D5_APIgetStorageNum(snaps.length, topInfo.storageId!)
- if (res.code === 0) {
- setSnaps(
- snaps.map((v, i) => ({
- ...v,
- siteNumNew: res.data[i]
- }))
- )
- MessageFu.success('分配成功')
- }
- }, [snaps, topInfo.storageId])
- // 二次校验分库号
- const [checkArr, setCheckArr] = useState<D4checkArrType[]>([])
- // 变更入库分库缩写 清空 藏品清单
- const [isModalOpen, setIsModalOpen] = useState(0)
- return (
- <div className={styles.D5edit}>
- <div className='pageTitle'>藏品移库-{pageTitTxt}</div>
- <div className='D5main' ref={sollrDom}>
- {['3'].includes(key) ? (
- <X3auditInfo
- dirCode='D5moveStor'
- myUrl='cms/goodsFile/upload'
- auditSta={auditSta}
- auditStaFu={val => setAuDitSta(val)}
- ref={ZAuditRef}
- />
- ) : null}
- {/* 表单字段、附件等 */}
- <div className='D5Tit'>
- 申请信息
- {key === '1' ? null : (
- <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
- )}
- </div>
- <div className='D5rowAll'>
- <div className='D5row'>
- <div className='D5rowll'>
- <span> * </span>移库日期:
- </div>
- <div className='D5rowrr'>
- <DatePicker
- disabled={['3', '4'].includes(key)}
- allowClear={false}
- value={topInfo.date ? dayjs(topInfo.date) : null}
- onChange={e => timeChange(e, 'date')}
- />
- </div>
- </div>
- <div className='D5row'>
- <div className='D5rowll'>
- <span> * </span>移库单编号:
- </div>
- <div className='D5rowrr'>
- <Input
- value={topInfo.num}
- onChange={e => setTopInfo({ ...topInfo, num: e.target.value.trim() })}
- readOnly={['3', '4'].includes(key)}
- placeholder='请输入内容'
- maxLength={30}
- showCount
- />
- </div>
- </div>
- <div className='D5row'>
- <div className='D5rowll'>
- <span> * </span>出库分库缩写:
- </div>
- <div className='D5rowrr'>
- <Select
- disabled={['3', '4'].includes(key)}
- placeholder='请搜索选择'
- showSearch
- filterOption={(input, option) => {
- const txt = option!.label
- return txt.toLowerCase().includes(input.toLowerCase())
- }}
- options={storageIdArr.map(v => ({
- label: v.num + ' - ' + v.name,
- value: v.id,
- disabled: v.id === topInfo.storageId
- }))}
- // fieldNames={{ label: 'num', value: 'num' }}
- allowClear={true}
- value={topInfo.storageOutId || null}
- onChange={e => {
- if (topInfo.storageOutId && topInfo.storageOutId !== e && snaps.length) {
- setIsModalOpen(e)
- } else setTopInfo({ ...topInfo, storageOutId: e ? e : null })
- }}
- />
- </div>
- </div>
- <div className='D5row'>
- <div className='D5rowll'>
- <span> * </span>入库分库缩写:
- </div>
- <div className='D5rowrr'>
- <Select
- disabled={['3', '4'].includes(key) || !topInfo.storageOutId}
- placeholder={topInfo.storageOutId ? '请搜索选择' : '请先选择出库分库缩写'}
- showSearch
- filterOption={(input, option) => {
- const txt = option!.label
- return txt.toLowerCase().includes(input.toLowerCase())
- }}
- options={storageIdArr.map(v => ({
- label: v.num + ' - ' + v.name,
- value: v.id,
- disabled: v.id === topInfo.storageOutId
- }))}
- // fieldNames={{ label: 'num', value: 'num' }}
- allowClear={true}
- value={topInfo.storageId || null}
- onChange={e => {
- setSnaps(
- snaps.map(v => ({
- ...v,
- siteNumNew: null
- }))
- )
- setTopInfo({ ...topInfo, storageId: e ? e : null })
- }}
- />
- </div>
- </div>
- <div className='D5row D5row2'>
- <div className='D5rowll'>
- <span> * </span>移库原因:
- </div>
- <div className='D5rowrr'>
- <TextArea
- value={topInfo.reason}
- onChange={e => setTopInfo({ ...topInfo, reason: e.target.value.trim() })}
- readOnly={['3', '4'].includes(key)}
- placeholder={['3', '4'].includes(key) ? '(空)' : '请输入内容'}
- maxLength={200}
- showCount
- />
- </div>
- </div>
- <div className='D5row'>
- <div className='D5rowll'>
- <span> * </span>移库人员:
- </div>
- <div className='D5rowrr'>
- <Input
- value={topInfo.sonUser}
- onChange={e => setTopInfo({ ...topInfo, sonUser: e.target.value.trim() })}
- readOnly={['3', '4'].includes(key)}
- placeholder={['3', '4'].includes(key) ? '(空)' : '请输入内容'}
- maxLength={30}
- showCount
- />
- </div>
- </div>
- </div>
- {/* 藏品清单 */}
- <div className='D5googsBox'>
- <div className='D5Tit2'>
- <div className='D5Tit2ll'>藏品清单</div>
- <div className='D5Tit2rr'>
- {['3', '4'].includes(key) ? null : (
- <>
- <Button type='primary' onClick={autoFu} disabled={snaps.length === 0}>
- 自动分配空置分库号
- </Button>
-  
- <Button
- type='primary'
- onClick={() => {
- if (!topInfo.storageOutId) return MessageFu.warning('请先选择出库分库缩写')
- setNowSta({
- key: '藏品入库',
- id: 'cms/orderMove/goods/getList'
- })
- }}
- >
- 新增
- </Button>
- </>
- )}
- </div>
- </div>
- {/* 表格 */}
- <MyTable
- list={snaps}
- columnsTemp={D4tableCgoods}
- startBtn={startBtn}
- lastBtn={tableLastBtn}
- pagingInfo={false}
- />
- </div>
- {/* 申请流程 */}
- {auditsShow ? (
- <ZflowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
- ) : null}
- {/* 底部按钮 */}
- <div className='D5btn'>
- {['3', '4'].includes(key) &&
- topInfo.audits &&
- topInfo.audits.length &&
- [2, 3, 4].includes(topInfo.status) ? (
- <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('/moveStor')} />
- </>
- )}
- </div>
- {/* 附件归档 */}
- {topInfo.status === 4 ? (
- <ZupFileTable
- listTemp={topInfo.filing || []}
- dirCode='D5moveStor'
- myUrl='cms/orderMove/upload'
- fromData={{ moduleId: topInfo.id }}
- />
- ) : null}
- </div>
- {/* 打开侧边栏 */}
- <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
- {nowSta.id ? (
- <ZGaddNow
- canObj={{ storageId: topInfo.storageOutId }}
- nowSta={nowSta}
- closeFu={() => setNowSta({ key: '', id: '' })}
- dataResFu={data => {
- const dataTemp = [...data]
- dataTemp.forEach(v => {
- // id2表示的是自己这条数据的id id才是goodsId
- const obj = snapsID2ref.current.find(c => c.goodsId === v.id)
- if (obj) v.id2 = obj.id
- })
- setSnaps(dataTemp)
- }}
- oldCheckArr={snaps}
- />
- ) : null}
- {/* 二次校验分库号 */}
- {checkArr.length ? (
- <D4check
- storageId={Number(topInfo.storageId)}
- closeFu={() => setCheckArr([])}
- listTemp={checkArr}
- waiSiteNumArr={snaps.map(v => v.siteNumNew!)}
- type='移库'
- />
- ) : null}
- {/* 入库分库缩写改变的时候校验一下 */}
- <Modal
- wrapClassName={styles.D6editMo}
- title='变更入库分库后,将清空当前的藏品清单'
- open={!!isModalOpen}
- footer={[]}
- >
- <div className='D6editMoBtn'>
- <Button
- type='primary'
- onClick={() => {
- setTopInfo({ ...topInfo, storageId: isModalOpen })
- snaps.forEach(v => {
- if (!delSnapIdsRef.current.includes(v.id)) delSnapIdsRef.current.push(v.id)
- })
- setSnaps([])
- setIsModalOpen(0)
- }}
- >
- 继续
- </Button>
-  
- <Button onClick={() => setIsModalOpen(0)}>取消</Button>
- </div>
- </Modal>
- </div>
- )
- }
- const MemoD5edit = React.memo(D5edit)
- export default MemoD5edit
|