|
@@ -1,27 +1,8 @@
|
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
import styles from './index.module.scss'
|
|
import styles from './index.module.scss'
|
|
import { useParams } from 'react-router-dom'
|
|
import { useParams } from 'react-router-dom'
|
|
-import { Button, Cascader, DatePicker, Input, Select } from 'antd'
|
|
|
|
-import dayjs from 'dayjs'
|
|
|
|
-import Z3upFiles from '@/components/Z3upFiles'
|
|
|
|
-import ZRichTexts from '@/components/ZRichTexts'
|
|
|
|
-import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
|
-import history, {
|
|
|
|
- btnFlagFu2,
|
|
|
|
- cascaderObjFu,
|
|
|
|
- kuIsTreeChangeFu,
|
|
|
|
- openGoodsInfoFu,
|
|
|
|
- ruTransformDataFu
|
|
|
|
-} from '@/utils/history'
|
|
|
|
-import { MessageFu } from '@/utils/message'
|
|
|
|
-import MyTable from '@/components/MyTable'
|
|
|
|
-import classNames from 'classnames'
|
|
|
|
-import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
|
|
|
|
-import { D4goodsTableC, statusObj } from '@/utils/tableData'
|
|
|
|
-import ZGaddNow from '@/components/ZGaddNow'
|
|
|
|
-import X1setStoreLocS from '@/pages/X_stock/X1setStoreLocS'
|
|
|
|
-import X3auditInfo from '@/pages/X_stock/X3auditInfo'
|
|
|
|
-import ZflowTable from '@/components/ZflowTable'
|
|
|
|
|
|
+import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
|
|
|
|
+import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
|
|
import {
|
|
import {
|
|
D4_APIcreate,
|
|
D4_APIcreate,
|
|
D4_APIdel,
|
|
D4_APIdel,
|
|
@@ -32,17 +13,28 @@ import {
|
|
D4_APIsaveCreate,
|
|
D4_APIsaveCreate,
|
|
D4_APIsaveDraft
|
|
D4_APIsaveDraft
|
|
} from '@/store/action/D4impStor'
|
|
} from '@/store/action/D4impStor'
|
|
|
|
+import dayjs from 'dayjs'
|
|
|
|
+import { MessageFu } from '@/utils/message'
|
|
|
|
+import history, { btnFlagFu2, cascaderObjFu, openGoodsInfoFu } from '@/utils/history'
|
|
|
|
+import classNames from 'classnames'
|
|
|
|
+import { Button, Cascader, DatePicker, Input, InputNumber, Select } from 'antd'
|
|
|
|
+import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
|
+import { EXbtnFu } from '@/utils/EXBtn'
|
|
|
|
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
|
|
|
|
+import { D4tableCgoods, statusObj } from '@/utils/tableData'
|
|
import { useDispatch, useSelector } from 'react-redux'
|
|
import { useDispatch, useSelector } from 'react-redux'
|
|
-import { RootState } from '@/store'
|
|
|
|
import { D2_APIgetList } from '@/store/action/D2storSet'
|
|
import { D2_APIgetList } from '@/store/action/D2storSet'
|
|
-import { D1_APIgetSiteList } from '@/store/action/D1storage'
|
|
|
|
-import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
|
|
|
|
-import { TypeD2list } from '../../D2storSet/type'
|
|
|
|
-import { KuIsTreeType } from '../type'
|
|
|
|
-import { EXbtnFu } from '@/utils/EXBtn'
|
|
|
|
-import { D6_APIgetList } from '@/store/action/D6putsStor'
|
|
|
|
-import { B3aForm1 } from '@/pages/B_enterTibet/B1collect/data'
|
|
|
|
-import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
|
|
|
|
|
|
+import { RootState } from '@/store'
|
|
|
|
+import { FourAPI_getList } from '@/store/action/FourAll'
|
|
|
|
+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'
|
|
|
|
+import TextArea from 'antd/es/input/TextArea'
|
|
|
|
+import D4auto from './D4auto'
|
|
|
|
+import D4check from './D4check'
|
|
|
|
+import { API_goodsInfo } from '@/store/action/C1ledger'
|
|
|
|
|
|
export const pageTitTxtObj = {
|
|
export const pageTitTxtObj = {
|
|
1: '新增',
|
|
1: '新增',
|
|
@@ -52,57 +44,44 @@ export const pageTitTxtObj = {
|
|
}
|
|
}
|
|
|
|
|
|
function D4edit() {
|
|
function D4edit() {
|
|
- const { key, id } = useParams<any>()
|
|
|
|
- // key:1 新增 2编辑 3审批 4查看
|
|
|
|
-
|
|
|
|
- // 滚到顶部
|
|
|
|
- const sollrDom = useRef<HTMLDivElement>(null)
|
|
|
|
-
|
|
|
|
- // 获取出库列表,下拉 - 相关出库单用
|
|
|
|
|
|
+ // 获取库房设置列表/入馆凭证号-用于分库缩写下拉
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
- dispatch(D6_APIgetList({ pageNum: 1, pageSize: 99999 }))
|
|
|
|
|
|
+ dispatch(D2_APIgetList({ pageNum: 1, pageSize: 99999 }))
|
|
|
|
+ dispatch(FourAPI_getList({ pageNum: 1, pageSize: 99999 }, '1'))
|
|
}, [dispatch])
|
|
}, [dispatch])
|
|
|
|
|
|
- const putsList = useSelector((state: RootState) => state.D6putsStor.tableInfo.list)
|
|
|
|
|
|
+ const { list: storageIdArr } = useSelector((state: RootState) => state.D2storSet.tableInfo)
|
|
|
|
+ const { list: relatedOrderNumArr } = useSelector((state: RootState) => state.FourAll.listObj['1'])
|
|
|
|
|
|
|
|
+ const { key, id } = useParams<any>()
|
|
|
|
+ // key:1 新增 2编辑 3审批 4查看
|
|
|
|
+ // 滚到顶部
|
|
|
|
+ const sollrDom = useRef<HTMLDivElement>(null)
|
|
// 顶部数据
|
|
// 顶部数据
|
|
const [topInfo, setTopInfo] = useState({} as FourTableType)
|
|
const [topInfo, setTopInfo] = useState({} as FourTableType)
|
|
|
|
|
|
- // 入库库房数组信息
|
|
|
|
- useEffect(() => {
|
|
|
|
- dispatch(D2_APIgetList({ pageNum: 1, pageSize: 99999 }))
|
|
|
|
- }, [dispatch])
|
|
|
|
|
|
+ // 藏品清单快照数据
|
|
|
|
+ const [snaps, setSnaps] = useState<C1GoodType[]>([])
|
|
|
|
+ const delSnapIdsRef = useRef<number[]>([])
|
|
|
|
|
|
- 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 snapsID2ref = useRef<{ goodsId: number; id: number }[]>([])
|
|
|
|
|
|
// 创建订单
|
|
// 创建订单
|
|
const creatFu = useCallback(async () => {
|
|
const creatFu = useCallback(async () => {
|
|
const res = await D4_APIcreate()
|
|
const res = await D4_APIcreate()
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
setTopInfo(res.data)
|
|
setTopInfo(res.data)
|
|
- }
|
|
|
|
- }, [])
|
|
|
|
-
|
|
|
|
- // 入库的排架 层数 层格变成树
|
|
|
|
- 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 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) {
|
|
|
|
+ setSnaps([res2.data])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}, [])
|
|
}, [])
|
|
|
|
|
|
@@ -110,15 +89,25 @@ function D4edit() {
|
|
const getInfoFu = useCallback(async () => {
|
|
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)
|
|
|
|
|
|
+ const data = res.data
|
|
|
|
+
|
|
|
|
+ setTopInfo(data)
|
|
|
|
|
|
- // 设置富文本
|
|
|
|
- ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf || '{}'))
|
|
|
|
|
|
+ // 藏品清单快照信息id对比
|
|
|
|
+ const arrTemp: any = []
|
|
|
|
+ const snapsTemp = data.snaps || []
|
|
|
|
|
|
- // 入库库房筛选存放位置数据
|
|
|
|
- if (res.data.storageId) kuIsTreeFu(res.data.storageId)
|
|
|
|
|
|
+ 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, kuIsTreeFu])
|
|
|
|
|
|
+ }, [id])
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (key === '1') creatFu()
|
|
if (key === '1') creatFu()
|
|
@@ -127,60 +116,50 @@ function D4edit() {
|
|
if (sollrDom.current) sollrDom.current.scrollTop = 0
|
|
if (sollrDom.current) sollrDom.current.scrollTop = 0
|
|
}, [creatFu, getInfoFu, key])
|
|
}, [creatFu, getInfoFu, key])
|
|
|
|
|
|
- // 上传附件的ref
|
|
|
|
- const filesRef = useRef<any>(null)
|
|
|
|
- // const filesRes = filesRef.current.filesIdRes();
|
|
|
|
-
|
|
|
|
- // 富文本的ref
|
|
|
|
- const ZRichTextRef = useRef<any>(null)
|
|
|
|
-
|
|
|
|
- // 审批意见的ref
|
|
|
|
- const ZAuditRef = useRef<any>(null)
|
|
|
|
-
|
|
|
|
const pageTitTxt = useMemo(() => {
|
|
const pageTitTxt = useMemo(() => {
|
|
return Reflect.get(pageTitTxtObj, key)
|
|
return Reflect.get(pageTitTxtObj, key)
|
|
}, [key])
|
|
}, [key])
|
|
|
|
|
|
const timeChange = useCallback(
|
|
const timeChange = useCallback(
|
|
- (e: any) => {
|
|
|
|
- setTopInfo({ ...topInfo, date: dayjs(e).format('YYYY-MM-DD') })
|
|
|
|
|
|
+ (e: any, key: 'date') => {
|
|
|
|
+ setTopInfo({ ...topInfo, [key]: dayjs(e).format('YYYY-MM-DD') })
|
|
},
|
|
},
|
|
[topInfo]
|
|
[topInfo]
|
|
)
|
|
)
|
|
|
|
|
|
- const checkDataFu = useCallback(() => {
|
|
|
|
- if (!topInfo.name) {
|
|
|
|
- MessageFu.warning('申请名称不能为空')
|
|
|
|
|
|
+ // 审批意见的ref
|
|
|
|
+ const ZAuditRef = useRef<any>(null)
|
|
|
|
+
|
|
|
|
+ // 审批的sta
|
|
|
|
+ const [auditSta, setAuDitSta] = useState('')
|
|
|
|
+
|
|
|
|
+ // 字段的校验
|
|
|
|
+ const checkFu = useCallback(() => {
|
|
|
|
+ if (!topInfo.date) {
|
|
|
|
+ MessageFu.warning('请选择入库日期')
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
- if (!topInfo.sonTypeName) {
|
|
|
|
- MessageFu.warning('请选择业务类型')
|
|
|
|
|
|
+ if (!topInfo.num) {
|
|
|
|
+ MessageFu.warning('请输入入库单编号')
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
if (!topInfo.storageId) {
|
|
if (!topInfo.storageId) {
|
|
- MessageFu.warning('请选择入库库房')
|
|
|
|
|
|
+ MessageFu.warning('请选择分库缩写')
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
-
|
|
|
|
- return false
|
|
|
|
}, [topInfo])
|
|
}, [topInfo])
|
|
|
|
|
|
- // 审批的sta
|
|
|
|
- const [auditSta, setAuDitSta] = useState('')
|
|
|
|
-
|
|
|
|
// 新增的底部按钮点击
|
|
// 新增的底部按钮点击
|
|
const btnClickFu = useCallback(
|
|
const btnClickFu = useCallback(
|
|
async (val: '草稿' | '创建' | '保存' | '审批') => {
|
|
async (val: '草稿' | '创建' | '保存' | '审批') => {
|
|
- if (checkDataFu()) return
|
|
|
|
|
|
+ if (checkFu()) {
|
|
|
|
+ if (sollrDom.current) sollrDom.current.scrollTop = 0
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
|
|
if (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('请选择存放位置')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ if (snaps.length === 0) return MessageFu.warning('请添加藏品')
|
|
|
|
+ if (snaps.some(v => !v.txt4)) return MessageFu.warning('请输入藏品分库号')
|
|
}
|
|
}
|
|
|
|
|
|
if (val === '审批') {
|
|
if (val === '审批') {
|
|
@@ -203,23 +182,18 @@ function D4edit() {
|
|
history.push(`/impStor_edit/4/${topInfo.id}`)
|
|
history.push(`/impStor_edit/4/${topInfo.id}`)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
|
|
|
|
- // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
|
|
|
|
-
|
|
|
|
- // 上传附件
|
|
|
|
- const filesRes = filesRef.current.filesIdRes()
|
|
|
|
-
|
|
|
|
const obj = {
|
|
const obj = {
|
|
...topInfo,
|
|
...topInfo,
|
|
- fileIds: filesRes.join(','),
|
|
|
|
- rtf: JSON.stringify(rtf1.val || ''),
|
|
|
|
- goodsIds: topInfo.goods.map(v => v.id).join(','),
|
|
|
|
- goods: topInfo.goods.map(v => ({
|
|
|
|
|
|
+ goodsIds: snaps.map(v => v.id).join(','),
|
|
|
|
+ delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
|
|
|
|
+ snaps: snaps.map(v => ({
|
|
goodsId: v.id,
|
|
goodsId: v.id,
|
|
- siteId: v.siteId
|
|
|
|
|
|
+ id: v.id2 ? v.id2 : null,
|
|
|
|
+ orderId: topInfo.id,
|
|
|
|
+ snap: JSON.stringify(v)
|
|
}))
|
|
}))
|
|
}
|
|
}
|
|
- // console.log(123, obj)
|
|
|
|
|
|
+ // console.log(123, obj.snaps)
|
|
|
|
|
|
// if (1 + 1 === 2) return
|
|
// if (1 + 1 === 2) return
|
|
|
|
|
|
@@ -239,12 +213,25 @@ function D4edit() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- [auditSta, checkDataFu, topInfo]
|
|
|
|
|
|
+ [auditSta, checkFu, snaps, topInfo]
|
|
)
|
|
)
|
|
|
|
|
|
// 打开侧边栏
|
|
// 打开侧边栏
|
|
const [cathet, setCathet] = useState(0)
|
|
const [cathet, setCathet] = useState(0)
|
|
|
|
|
|
|
|
+ // 表格的输入框改变
|
|
|
|
+ const tableInputChange = useCallback(
|
|
|
|
+ (id: number, val: number | null, key: 'txt4') => {
|
|
|
|
+ setSnaps(
|
|
|
|
+ snaps.map(v => ({
|
|
|
|
+ ...v,
|
|
|
|
+ [key]: v.id === id ? val : v[key]
|
|
|
|
+ }))
|
|
|
|
+ )
|
|
|
|
+ },
|
|
|
|
+ [snaps]
|
|
|
|
+ )
|
|
|
|
+
|
|
const startBtn = useMemo(() => {
|
|
const startBtn = useMemo(() => {
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
@@ -259,51 +246,55 @@ function D4edit() {
|
|
</span>
|
|
</span>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '编号类型',
|
|
|
|
+ render: (item: C1GoodType) => item.numName || '(空)'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: (
|
|
|
|
+ <div>
|
|
|
|
+ <span style={{ color: '#ff4d4f' }}> * </span>藏品分库号
|
|
|
|
+ </div>
|
|
|
|
+ ),
|
|
|
|
+ render: (item: C1GoodType) => (
|
|
|
|
+ <InputNumber
|
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
|
+ min={1}
|
|
|
|
+ max={99999999}
|
|
|
|
+ precision={0}
|
|
|
|
+ value={item.txt4}
|
|
|
|
+ onChange={e => tableInputChange(item.id, e, 'txt4')}
|
|
|
|
+ placeholder='请输入'
|
|
|
|
+ />
|
|
|
|
+ )
|
|
}
|
|
}
|
|
]
|
|
]
|
|
- }, [cathet])
|
|
|
|
-
|
|
|
|
- const siteStrRes = useCallback((siteStr: string) => {
|
|
|
|
- let res: any = undefined
|
|
|
|
-
|
|
|
|
- if (siteStr) {
|
|
|
|
- let arr = siteStr.split(',')
|
|
|
|
- if (arr.length >= 5) arr = arr.slice(1)
|
|
|
|
- res = arr
|
|
|
|
- }
|
|
|
|
- return res
|
|
|
|
- }, [])
|
|
|
|
|
|
+ }, [cathet, key, tableInputChange])
|
|
|
|
|
|
const tableLastBtn = useMemo(() => {
|
|
const tableLastBtn = useMemo(() => {
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
- title: '存放位置',
|
|
|
|
- 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={siteStrRes(item.siteStr)}
|
|
|
|
- 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: '备注',
|
|
|
|
+ width: 240,
|
|
|
|
+ render: (item: C1GoodType) => (
|
|
|
|
+ <TextArea
|
|
|
|
+ readOnly={['3', '4'].includes(key)}
|
|
|
|
+ placeholder={
|
|
|
|
+ ['3', '4'].includes(key) && !item.txt1 ? '(空)' : '请输入内容,不超过200字'
|
|
|
|
+ }
|
|
|
|
+ maxLength={200}
|
|
|
|
+ value={item.txt1}
|
|
|
|
+ onChange={e =>
|
|
|
|
+ setSnaps(
|
|
|
|
+ snaps.map(v => ({
|
|
|
|
+ ...v,
|
|
|
|
+ txt1: v.id === item.id ? e.target.value : v.txt1
|
|
|
|
+ }))
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ />
|
|
|
|
+ )
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '操作',
|
|
title: '操作',
|
|
@@ -316,12 +307,11 @@ function D4edit() {
|
|
{['3', '4'].includes(key) ? null : (
|
|
{['3', '4'].includes(key) ? null : (
|
|
<MyPopconfirm
|
|
<MyPopconfirm
|
|
txtK='删除'
|
|
txtK='删除'
|
|
- onConfirm={() =>
|
|
|
|
- setTopInfo({
|
|
|
|
- ...topInfo,
|
|
|
|
- goods: topInfo.goods.filter(v => v.id !== item.id)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ onConfirm={() => {
|
|
|
|
+ if (item.id2 && !delSnapIdsRef.current.includes(item.id2))
|
|
|
|
+ delSnapIdsRef.current.push(item.id2)
|
|
|
|
+ setSnaps(snaps.filter(v => v.id !== item.id))
|
|
|
|
+ }}
|
|
/>
|
|
/>
|
|
)}
|
|
)}
|
|
</>
|
|
</>
|
|
@@ -329,43 +319,35 @@ function D4edit() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
]
|
|
- }, [key, kuIsTree, topInfo, siteStrRes])
|
|
|
|
|
|
+ }, [key, snaps])
|
|
|
|
|
|
- // 点击新增
|
|
|
|
|
|
+ // 点击添加按钮
|
|
const [nowSta, setNowSta] = useState({ key: '', id: '' })
|
|
const [nowSta, setNowSta] = useState({ key: '', id: '' })
|
|
|
|
|
|
- // 点击批量设置存放位置
|
|
|
|
- const [setLoc, setSetLoc] = useState(false)
|
|
|
|
-
|
|
|
|
// 查看的按钮创建-提交-撤回
|
|
// 查看的按钮创建-提交-撤回
|
|
const lookBtnFu = useCallback(
|
|
const lookBtnFu = useCallback(
|
|
async (val: '创建' | '提交' | '撤回') => {
|
|
async (val: '创建' | '提交' | '撤回') => {
|
|
if (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('请选择存放位置')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ if (snaps.length === 0) return MessageFu.warning('请添加藏品')
|
|
|
|
+ if (snaps.some(v => !v.txt4)) return MessageFu.warning('请输入藏品分库号')
|
|
}
|
|
}
|
|
|
|
|
|
- const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
|
|
|
|
- // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
|
|
|
|
-
|
|
|
|
- // 上传附件
|
|
|
|
- const filesRes = filesRef.current.filesIdRes()
|
|
|
|
const obj = {
|
|
const obj = {
|
|
...topInfo,
|
|
...topInfo,
|
|
- fileIds: filesRes.join(','),
|
|
|
|
- rtf: JSON.stringify(rtf1.val || ''),
|
|
|
|
- goodsIds: topInfo.goods.map(v => v.id).join(','),
|
|
|
|
- goods: topInfo.goods.map(v => ({
|
|
|
|
|
|
+ goodsIds: snaps.map(v => v.id).join(','),
|
|
|
|
+ delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
|
|
|
|
+ snaps: snaps.map(v => ({
|
|
goodsId: v.id,
|
|
goodsId: v.id,
|
|
- siteId: v.siteId
|
|
|
|
|
|
+ id: v.id2 ? v.id2 : null,
|
|
|
|
+ orderId: topInfo.id,
|
|
|
|
+ snap: JSON.stringify(v)
|
|
}))
|
|
}))
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // console.log(123, obj.snaps)
|
|
|
|
+
|
|
|
|
+ // if (1 + 1 === 2) return
|
|
|
|
+
|
|
const res =
|
|
const res =
|
|
val === '创建'
|
|
val === '创建'
|
|
? await D4_APIsaveCreate(obj)
|
|
? await D4_APIsaveCreate(obj)
|
|
@@ -379,7 +361,7 @@ function D4edit() {
|
|
getInfoFu()
|
|
getInfoFu()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- [getInfoFu, id, topInfo]
|
|
|
|
|
|
+ [getInfoFu, id, snaps, topInfo]
|
|
)
|
|
)
|
|
|
|
|
|
// 查看模式点击删除
|
|
// 查看模式点击删除
|
|
@@ -463,39 +445,21 @@ function D4edit() {
|
|
)
|
|
)
|
|
}, [delFu, lookBtnFu, lookJumpFu, topInfo])
|
|
}, [delFu, lookBtnFu, lookJumpFu, topInfo])
|
|
|
|
|
|
- // 自动分配空置库位
|
|
|
|
- const autoNullFu = useCallback(async () => {
|
|
|
|
- const res = await D1_APIgetSiteList(topInfo.storageId!, true)
|
|
|
|
- if (res.code === 0) {
|
|
|
|
- const arrRes: any = ruTransformDataFu(res.data || [])
|
|
|
|
-
|
|
|
|
- // arrRes.sort(() => Math.random() - 0.5)
|
|
|
|
-
|
|
|
|
- const oldGoods = [...topInfo.goods]
|
|
|
|
-
|
|
|
|
- oldGoods.forEach((v, i) => {
|
|
|
|
- if (i <= arrRes.length - 1) {
|
|
|
|
- v.siteId = arrRes[i].siteId
|
|
|
|
- v.siteStr = arrRes[i].siteStr
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- setTopInfo({
|
|
|
|
- ...topInfo,
|
|
|
|
- goods: oldGoods
|
|
|
|
- })
|
|
|
|
- MessageFu.success('自动分配空置库位成功')
|
|
|
|
- }
|
|
|
|
- }, [topInfo])
|
|
|
|
-
|
|
|
|
// 申请记录
|
|
// 申请记录
|
|
const [auditsShow, setAuditsShow] = useState(false)
|
|
const [auditsShow, setAuditsShow] = useState(false)
|
|
|
|
|
|
|
|
+ // 点击自动分配空置分库号
|
|
|
|
+ const [auto, setAuto] = useState(false)
|
|
|
|
+
|
|
|
|
+ // 二次校验分库号
|
|
|
|
+ // 待完善类型
|
|
|
|
+ const [numCheck, setNumCheck] = useState<any[]>([])
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<div className={styles.D4edit}>
|
|
<div className={styles.D4edit}>
|
|
<div className='pageTitle'>藏品入库-{pageTitTxt}</div>
|
|
<div className='pageTitle'>藏品入库-{pageTitTxt}</div>
|
|
|
|
|
|
- <div className='D4main' ref={sollrDom}>
|
|
|
|
|
|
+ <div className='D4main'>
|
|
{['3'].includes(key) ? (
|
|
{['3'].includes(key) ? (
|
|
<X3auditInfo
|
|
<X3auditInfo
|
|
dirCode='D4impStor'
|
|
dirCode='D4impStor'
|
|
@@ -513,154 +477,114 @@ function D4edit() {
|
|
<Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
|
|
<Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
|
|
)}
|
|
)}
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<div className='D4rowAll'>
|
|
<div className='D4rowAll'>
|
|
<div className='D4row'>
|
|
<div className='D4row'>
|
|
<div className='D4rowll'>
|
|
<div className='D4rowll'>
|
|
- <span> * </span>申请名称:
|
|
|
|
|
|
+ <span> * </span>入库日期:
|
|
</div>
|
|
</div>
|
|
<div className='D4rowrr'>
|
|
<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
|
|
|
|
|
|
+ <DatePicker
|
|
|
|
+ disabled={['3', '4'].includes(key)}
|
|
|
|
+ allowClear={false}
|
|
|
|
+ value={topInfo.date ? dayjs(topInfo.date) : null}
|
|
|
|
+ onChange={e => timeChange(e, 'date')}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<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
|
|
|
|
- value={topInfo.sonTypeName ? topInfo.sonTypeName.split(',') : []}
|
|
|
|
- onChange={e => setTopInfo({ ...topInfo, sonTypeName: e ? e.join(',') : '' })}
|
|
|
|
- disabled={['3', '4'].includes(key)}
|
|
|
|
- options={cascaderObjFu()['藏品入库']}
|
|
|
|
- changeOnSelect
|
|
|
|
- placeholder='请选择'
|
|
|
|
- fieldNames={{ label: 'name', value: 'id', children: 'children' }}
|
|
|
|
- allowClear={false}
|
|
|
|
|
|
+ <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>
|
|
</div>
|
|
|
|
|
|
- {B3aForm1.map(v => (
|
|
|
|
- <div className='D4row' key={v.name}>
|
|
|
|
- <div className='D4rowll'>{v.name}:</div>
|
|
|
|
- <div className='D4rowrr'>
|
|
|
|
- {topInfo[v.key as 'name']}
|
|
|
|
- {['3', '4'].includes(key) && v.name === '发起人'
|
|
|
|
- ? ' - ' + topInfo.createTime || ''
|
|
|
|
- : ''}
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- ))}
|
|
|
|
-
|
|
|
|
<div className='D4row'>
|
|
<div className='D4row'>
|
|
- <div className='D4rowll'>相关出库单:</div>
|
|
|
|
|
|
+ <div className='D4rowll'>
|
|
|
|
+ <span> * </span>分库缩写:
|
|
|
|
+ </div>
|
|
<div className='D4rowrr'>
|
|
<div className='D4rowrr'>
|
|
<Select
|
|
<Select
|
|
disabled={['3', '4'].includes(key)}
|
|
disabled={['3', '4'].includes(key)}
|
|
- placeholder={['3', '4'].includes(key) ? '(空)' : '请搜索出库单编码'}
|
|
|
|
|
|
+ placeholder='请搜索选择'
|
|
showSearch
|
|
showSearch
|
|
- options={putsList}
|
|
|
|
- fieldNames={{ label: 'num', value: 'num' }}
|
|
|
|
- allowClear={true}
|
|
|
|
- value={topInfo.relatedOrderNum || null}
|
|
|
|
- onChange={e => setTopInfo({ ...topInfo, relatedOrderNum: e ? e : '' })}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ filterOption={(input, option) => {
|
|
|
|
+ const txt = option!.label
|
|
|
|
|
|
- <div className='D4row'>
|
|
|
|
- <div className='D4rowll'>
|
|
|
|
- <span> * </span>业务日期:
|
|
|
|
- </div>
|
|
|
|
- <div className='D4rowrr'>
|
|
|
|
- <DatePicker
|
|
|
|
- disabled={['3', '4'].includes(key)}
|
|
|
|
|
|
+ return txt.toLowerCase().includes(input.toLowerCase())
|
|
|
|
+ }}
|
|
|
|
+ options={storageIdArr.map(v => ({ label: v.num + ' - ' + v.name, value: v.id }))}
|
|
|
|
+ // fieldNames={{ label: 'num', value: 'num' }}
|
|
allowClear={false}
|
|
allowClear={false}
|
|
- value={dayjs(topInfo.date)}
|
|
|
|
- onChange={timeChange}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <div className='D4row D4row2'>
|
|
|
|
- <div className='D4rowll'>附件:</div>
|
|
|
|
- <div className='D4rowrr'>
|
|
|
|
- <Z3upFiles
|
|
|
|
- max={10}
|
|
|
|
- isLook={['3', '4'].includes(key)}
|
|
|
|
- ref={filesRef}
|
|
|
|
- fileCheck={false}
|
|
|
|
- dirCode='impStor'
|
|
|
|
- myUrl='cms/orderIn/upload'
|
|
|
|
- lookData={topInfo.files || []}
|
|
|
|
- size={500}
|
|
|
|
- fromData={{ moduleId: topInfo.id }}
|
|
|
|
|
|
+ value={topInfo.storageId || null}
|
|
|
|
+ onChange={e => {
|
|
|
|
+ setSnaps([])
|
|
|
|
+ setTopInfo({ ...topInfo, storageId: e ? e : null })
|
|
|
|
+ }}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div className='D4row'>
|
|
<div className='D4row'>
|
|
- <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 })}
|
|
|
|
|
|
+ value={topInfo.sonNum2}
|
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, sonNum2: e.target.value.trim() })}
|
|
readOnly={['3', '4'].includes(key)}
|
|
readOnly={['3', '4'].includes(key)}
|
|
- placeholder='请输入内容'
|
|
|
|
|
|
+ placeholder={['3', '4'].includes(key) ? '(空)' : '请输入内容'}
|
|
maxLength={30}
|
|
maxLength={30}
|
|
showCount
|
|
showCount
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div className='D4row D4rowFull'>
|
|
|
|
- <div className='D4rowll'>备注:</div>
|
|
|
|
|
|
+ <div className='D4row'>
|
|
|
|
+ <div className='D4rowll'>入馆凭证号:</div>
|
|
<div className='D4rowrr'>
|
|
<div className='D4rowrr'>
|
|
- <ZRichTexts
|
|
|
|
- check={false}
|
|
|
|
- dirCode='impStor'
|
|
|
|
- myUrl='cms/goodsFile/upload'
|
|
|
|
- isLook={['3', '4'].includes(key)}
|
|
|
|
- ref={ZRichTextRef}
|
|
|
|
- isOne={true}
|
|
|
|
- upAudioBtnNone={true}
|
|
|
|
|
|
+ <Select
|
|
|
|
+ disabled={['3', '4'].includes(key)}
|
|
|
|
+ placeholder={['3', '4'].includes(key) ? '(空)' : '请搜索选择'}
|
|
|
|
+ showSearch
|
|
|
|
+ filterOption={(input, option) => {
|
|
|
|
+ const txt = option!.label
|
|
|
|
+
|
|
|
|
+ return txt.toLowerCase().includes(input.toLowerCase())
|
|
|
|
+ }}
|
|
|
|
+ options={relatedOrderNumArr.map(v => ({ label: v.num, value: v.id }))}
|
|
|
|
+ // fieldNames={{ label: 'num', value: 'num' }}
|
|
|
|
+ allowClear={true}
|
|
|
|
+ value={topInfo.relatedOrderNum || null}
|
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, relatedOrderNum: e ? e : '' })}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
|
|
- <div className='D4Tit'>库房信息</div>
|
|
|
|
- <div className='D4rowAll'>
|
|
|
|
<div className='D4row'>
|
|
<div className='D4row'>
|
|
- <div className='D4rowll'>
|
|
|
|
- <span> * </span>入库库房:
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div className='D4rowll'>来源:</div>
|
|
<div className='D4rowrr'>
|
|
<div className='D4rowrr'>
|
|
- <Select
|
|
|
|
- options={storSetList}
|
|
|
|
- value={topInfo.storageId}
|
|
|
|
- onChange={(storageId, arr) => {
|
|
|
|
- setTopInfo({ ...topInfo, storageId, goods: [] })
|
|
|
|
- kuIsTreeFu((arr as TypeD2list).id)
|
|
|
|
- }}
|
|
|
|
|
|
+ <Cascader
|
|
|
|
+ value={topInfo.sonSource ? topInfo.sonSource.split(',') : []}
|
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, sonSource: e ? e.join(',') : '' })}
|
|
disabled={['3', '4'].includes(key)}
|
|
disabled={['3', '4'].includes(key)}
|
|
- fieldNames={{ value: 'id', label: 'name' }}
|
|
|
|
|
|
+ options={cascaderObjFu()['藏品入库']}
|
|
|
|
+ changeOnSelect
|
|
placeholder='请选择'
|
|
placeholder='请选择'
|
|
|
|
+ fieldNames={{ label: 'name', value: 'id', children: 'children' }}
|
|
|
|
+ allowClear={true}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div className='D4row D4row3'>
|
|
|
|
- <div className='D4rowll'>库房负责人:</div>
|
|
|
|
- <div className='D4rowrr'>{managerUser || '(空)'}</div>
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{/* 藏品清单 */}
|
|
{/* 藏品清单 */}
|
|
@@ -672,26 +596,23 @@ function D4edit() {
|
|
<>
|
|
<>
|
|
<Button
|
|
<Button
|
|
type='primary'
|
|
type='primary'
|
|
- onClick={() => {
|
|
|
|
- if (!topInfo.storageId) return MessageFu.warning('请先选择入库库房')
|
|
|
|
- setNowSta({ key: '5', id: 'cms/orderIn/goods/getList' })
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 新增
|
|
|
|
- </Button>
|
|
|
|
- <Button
|
|
|
|
- type='primary'
|
|
|
|
- onClick={() => setSetLoc(true)}
|
|
|
|
- disabled={!(topInfo.goods && topInfo.goods.length)}
|
|
|
|
|
|
+ onClick={() => setAuto(true)}
|
|
|
|
+ disabled={snaps.length === 0}
|
|
>
|
|
>
|
|
- 批量设置存放位置
|
|
|
|
|
|
+ 自动分配空置分库号
|
|
</Button>
|
|
</Button>
|
|
|
|
+  
|
|
<Button
|
|
<Button
|
|
type='primary'
|
|
type='primary'
|
|
- onClick={autoNullFu}
|
|
|
|
- disabled={!(topInfo.goods && topInfo.goods.length)}
|
|
|
|
|
|
+ onClick={() => {
|
|
|
|
+ if (!topInfo.storageId) return MessageFu.warning('请先选择分库缩写')
|
|
|
|
+ setNowSta({
|
|
|
|
+ key: '藏品入库',
|
|
|
|
+ id: 'cms/orderIn/goods/getList'
|
|
|
|
+ })
|
|
|
|
+ }}
|
|
>
|
|
>
|
|
- 自动分配空置库位
|
|
|
|
|
|
+ 新增
|
|
</Button>
|
|
</Button>
|
|
</>
|
|
</>
|
|
)}
|
|
)}
|
|
@@ -700,8 +621,8 @@ function D4edit() {
|
|
|
|
|
|
{/* 表格 */}
|
|
{/* 表格 */}
|
|
<MyTable
|
|
<MyTable
|
|
- list={topInfo.goods || []}
|
|
|
|
- columnsTemp={D4goodsTableC}
|
|
|
|
|
|
+ list={snaps}
|
|
|
|
+ columnsTemp={D4tableCgoods}
|
|
startBtn={startBtn}
|
|
startBtn={startBtn}
|
|
lastBtn={tableLastBtn}
|
|
lastBtn={tableLastBtn}
|
|
pagingInfo={false}
|
|
pagingInfo={false}
|
|
@@ -712,71 +633,89 @@ function D4edit() {
|
|
{auditsShow ? (
|
|
{auditsShow ? (
|
|
<ZflowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
|
|
<ZflowTable tableArr={topInfo.audits || []} closeFu={() => setAuditsShow(false)} />
|
|
) : null}
|
|
) : null}
|
|
- </div>
|
|
|
|
|
|
|
|
- {/* 底部按钮 */}
|
|
|
|
- <div className='D4btn'>
|
|
|
|
- {['3', '4'].includes(key) && topInfo.audits && topInfo.audits.length ? (
|
|
|
|
- <Button type='primary' onClick={() => setAuditsShow(true)}>
|
|
|
|
- 申请记录
|
|
|
|
- </Button>
|
|
|
|
- ) : null}
|
|
|
|
|
|
+ {/* 底部按钮 */}
|
|
|
|
+ <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 === '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}
|
|
|
|
|
|
- {key === '1' ? (
|
|
|
|
- <Button type='primary' onClick={() => btnClickFu('草稿')}>
|
|
|
|
- 存草稿
|
|
|
|
- </Button>
|
|
|
|
- ) : null}
|
|
|
|
|
|
+ <MyPopconfirm txtK='取消' onConfirm={() => history.push('/repair')} />
|
|
|
|
+ </>
|
|
|
|
+ )}
|
|
|
|
+ </div>
|
|
|
|
|
|
- <MyPopconfirm txtK='取消' onConfirm={() => history.push('/impStor')} />
|
|
|
|
- </>
|
|
|
|
- )}
|
|
|
|
|
|
+ {/* 附件归档 */}
|
|
|
|
+ {topInfo.status === 4 ? (
|
|
|
|
+ <ZupFileTable
|
|
|
|
+ listTemp={topInfo.filing || []}
|
|
|
|
+ dirCode='D4impStor'
|
|
|
|
+ myUrl='cms/orderIn/upload'
|
|
|
|
+ fromData={{ moduleId: topInfo.id }}
|
|
|
|
+ />
|
|
|
|
+ ) : null}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{/* 打开侧边栏 */}
|
|
{/* 打开侧边栏 */}
|
|
<Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
|
|
<Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
|
|
- {/* 新增弹窗 */}
|
|
|
|
|
|
+
|
|
{nowSta.id ? (
|
|
{nowSta.id ? (
|
|
<ZGaddNow
|
|
<ZGaddNow
|
|
nowSta={nowSta}
|
|
nowSta={nowSta}
|
|
closeFu={() => setNowSta({ key: '', id: '' })}
|
|
closeFu={() => setNowSta({ key: '', id: '' })}
|
|
- dataResFu={data => setTopInfo({ ...topInfo, goods: data })}
|
|
|
|
- oldCheckArr={topInfo.goods || []}
|
|
|
|
- canObj={{ storageId: topInfo.storageId }}
|
|
|
|
|
|
+ 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}
|
|
) : null}
|
|
|
|
|
|
- {/* 批量设置存放位置 */}
|
|
|
|
- {setLoc ? (
|
|
|
|
- <X1setStoreLocS
|
|
|
|
- succFu={(val, siteId) =>
|
|
|
|
- setTopInfo({
|
|
|
|
- ...topInfo,
|
|
|
|
- goods: topInfo.goods.map(v => ({
|
|
|
|
- ...v,
|
|
|
|
- siteStr: val,
|
|
|
|
- siteId
|
|
|
|
- }))
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- kuIsTree={kuIsTree}
|
|
|
|
- closeFu={() => setSetLoc(false)}
|
|
|
|
|
|
+ {/* 点击自动分配 */}
|
|
|
|
+ {auto ? (
|
|
|
|
+ <D4auto
|
|
|
|
+ closeFu={() => setAuto(false)}
|
|
|
|
+ succFu={num => {
|
|
|
|
+ // 待完善
|
|
|
|
+ console.log('ppp', num)
|
|
|
|
+ setNumCheck([
|
|
|
|
+ { id: 1, num: 'xxx', shuzi: 3, name: '666' },
|
|
|
|
+ { id: 2, num: 'x2xx', shuzi: 7, name: '999' }
|
|
|
|
+ ])
|
|
|
|
+ }}
|
|
/>
|
|
/>
|
|
) : null}
|
|
) : null}
|
|
|
|
+
|
|
|
|
+ {/* 二次校验分库号 */}
|
|
|
|
+ {numCheck.length ? <D4check closeFu={() => setNumCheck([])} listTemp={numCheck} /> : null}
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|