Prechádzať zdrojové kódy

入藏和登记添加 tempStatus 给后端

shaogen1995 2 mesiacov pred
rodič
commit
a4c61ba526

+ 16 - 15
src/components/ZGaddNow/index.tsx

@@ -79,15 +79,8 @@ function ZGaddNow({
     }
     const res = await API_goodsNowAdd(nowSta.id, obj, httpType)
     if (res.code === 0) {
-      const arr: any = res.data.map((v: any) => ({
-        ...v,
-        statusCollect: (selectObj['入藏状态'].find(c => c.value === v.statusCollect) || {}).label,
-        statusStorage: (selectObj['库存状态'].find(c => c.value === v.statusStorage) || {}).label
-      }))
-
-      setTableList(arr)
-
-      if (timeKey === 0) setTableListAll(arr)
+      setTableList(res.data)
+      if (timeKey === 0) setTableListAll(res.data)
     }
   }, [canObj, httpType, nowSta.id, timeKey])
 
@@ -151,8 +144,20 @@ function ZGaddNow({
   const tableLastBtn = useMemo(() => {
     return [
       {
+        title: '入藏状态',
+        render: (item: C1GoodType) =>
+          (selectObj['入藏状态'].find(c => c.value === item.statusCollect) || { label: '(空)' })
+            .label
+      },
+      {
+        title: '库存状态',
+        render: (item: C1GoodType) =>
+          (selectObj['库存状态'].find(c => c.value === item.statusStorage) || { label: '(空)' })
+            .label
+      },
+      {
         title: '操作',
-        render: (item: any) => {
+        render: (item: C1GoodType) => {
           return (
             <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
               查看
@@ -257,11 +262,7 @@ function ZGaddNow({
           yHeight={575}
           classKey='ZGaddNow'
           list={tableList}
-          columnsTemp={[
-            ...B3eTableC,
-            ['txt', '入藏状态', 'statusCollect'],
-            ['txt', '库存状态', 'statusStorage']
-          ]}
+          columnsTemp={B3eTableC}
           startBtn={startBtn}
           lastBtn={tableLastBtn}
           pagingInfo={false}

+ 0 - 1
src/pages/A_workbench/A2business/A2table/index.tsx

@@ -4,7 +4,6 @@ import { Button, DatePicker, Input, Select } from 'antd'
 import { A2_APIgetList } from '@/store/action/A2business'
 import { RouterTypeRow } from '@/types'
 import tabLeftArr from '@/pages/Layout/data'
-import dayjs from 'dayjs'
 import { selectObj } from '@/utils/select'
 import { LogListType } from '@/pages/Y_goodsDetails/Y1cathet/Y44com'
 import MyTable from '@/components/MyTable'

+ 2 - 0
src/pages/B_enterTibet/B34typeIn/B34edit/index.tsx

@@ -212,6 +212,7 @@ function B34edit({ type }: Props) {
             goodsId: v.id,
             id: v.id2 ? v.id2 : null,
             orderId: topInfo.id,
+            tempStatus: type === '入馆' ? null : v.statusCollect || null,
             snap: JSON.stringify(v)
           }))
         }
@@ -257,6 +258,7 @@ function B34edit({ type }: Props) {
           goodsId: v.id,
           id: v.id2 ? v.id2 : null,
           orderId: topInfo.id,
+          tempStatus: type === '入馆' ? null : v.statusCollect || null,
           snap: JSON.stringify(v)
         }))
       }

+ 1 - 0
src/pages/C_goodsManage/C1register/index.tsx

@@ -68,6 +68,7 @@ function C1register() {
                   goodsId: obj.id,
                   id: type === '新增' ? null : snapsIdRef.current ? snapsIdRef.current : null,
                   orderId: topInfo.id,
+                  tempStatus: obj.statusCollect || null,
                   snap: JSON.stringify(obj)
                 }
               ]