|
@@ -8,12 +8,7 @@ import dayjs from 'dayjs'
|
|
|
import Z3upFiles from '@/components/Z3upFiles'
|
|
|
import ZRichTexts from '@/components/ZRichTexts'
|
|
|
import { MessageFu } from '@/utils/message'
|
|
|
-import history, {
|
|
|
- btnFlagFu2,
|
|
|
- cascaderObjFu,
|
|
|
- kuIsTreeChangeFu,
|
|
|
- openGoodsInfoFu
|
|
|
-} from '@/utils/history'
|
|
|
+import history, { btnFlagFu2, cascaderObjFu, openGoodsInfoFu } from '@/utils/history'
|
|
|
import B3GaddNow from '@/pages/B_enterTibet/B3goodsTable/B3GaddNow'
|
|
|
import MyTable from '@/components/MyTable'
|
|
|
import classNames from 'classnames'
|
|
@@ -36,11 +31,8 @@ import {
|
|
|
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() {
|
|
@@ -80,17 +72,6 @@ function D6edit() {
|
|
|
}
|
|
|
}, [])
|
|
|
|
|
|
- // 入库的排架 层数 层格变成树
|
|
|
- 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)
|
|
@@ -99,11 +80,8 @@ function D6edit() {
|
|
|
|
|
|
// 设置富文本
|
|
|
ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf) || '{}')
|
|
|
-
|
|
|
- // 出库库房筛选存放位置数据
|
|
|
- if (res.data.storageId) kuIsTreeFu(res.data.storageId)
|
|
|
}
|
|
|
- }, [id, kuIsTreeFu])
|
|
|
+ }, [id])
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (key === '1') creatFu()
|
|
@@ -161,10 +139,6 @@ function D6edit() {
|
|
|
if (val !== '草稿') {
|
|
|
if (!topInfo.goods || (topInfo.goods && topInfo.goods.length === 0)) {
|
|
|
return MessageFu.warning('请添加藏品')
|
|
|
- } else {
|
|
|
- if (topInfo.goods.some(v => !v.siteStr)) {
|
|
|
- return MessageFu.warning('请选择出库位置')
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -250,18 +224,7 @@ function D6edit() {
|
|
|
title: '出库位置',
|
|
|
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={() => {}}
|
|
|
- />
|
|
|
- )
|
|
|
+ return item.siteStr ? item.siteStr.replaceAll(',', ' / ') : '(空)'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -288,7 +251,7 @@ function D6edit() {
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
- }, [key, kuIsTree, topInfo])
|
|
|
+ }, [key, topInfo])
|
|
|
|
|
|
// 点击新增
|
|
|
const [nowSta, setNowSta] = useState({ key: '', id: '' })
|
|
@@ -584,7 +547,6 @@ function D6edit() {
|
|
|
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' }}
|