Просмотр исходного кода

Merge branch 'master' of http://192.168.0.115:3000/shaogen1995/qingDao_goods into master

shaogen1995 недель назад: 2
Родитель
Сommit
db2a9f8232

+ 85 - 0
src/pages/Benter/B3auth/B3edit/index.module.scss

@@ -0,0 +1,85 @@
+// .B3edit {
+//   :global {
+//   }
+// }
+
+.EditTop {
+  :global {
+    .EdTit {
+      padding: 15px;
+      font-weight: 700;
+      font-size: 18px;
+      display: flex;
+      justify-content: space-between;
+      .ant-btn {
+        margin-left: 15px;
+      }
+      .EdTitBtn {
+        pointer-events: none;
+      }
+    }
+
+    .Edtop1 {
+      border-top: 1px solid #ccc;
+      padding: 15px;
+      display: flex;
+      justify-content: space-between;
+      flex-wrap: wrap;
+      .Edtop1row {
+        display: flex;
+        width: 48%;
+        margin-bottom: 15px;
+        min-height: 32px;
+        line-height: 32px;
+        .Edtop1ll {
+          font-weight: 700;
+          width: 100px;
+          text-align: right;
+
+          span {
+            color: #ff4d4f;
+          }
+        }
+        .Edtop1rr {
+          width: calc(100% - 100px);
+          .ant-table-cell {
+            padding: 8px !important;
+          }
+          & > div {
+            width: 100%;
+          }
+          .ant-btn {
+            margin-right: 15px;
+          }
+        }
+      }
+      .Edtop1rowFull {
+        width: 100%;
+        .zztxtRow {
+          margin-bottom: 0;
+        }
+        .noUpThumb {
+          display: none;
+        }
+      }
+    }
+  }
+}
+
+.EditBtn {
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  width: 100%;
+  height: 60px;
+  display: flex;
+  align-items: center;
+  padding: 0 40px;
+  display: flex;
+  justify-content: space-between;
+  :global {
+    .ant-btn {
+      margin-right: 15px;
+    }
+  }
+}

+ 85 - 0
src/pages/Benter/B3auth/B3edit/index.tsx

@@ -0,0 +1,85 @@
+import React, { useState, useRef, useMemo } from 'react'
+import styles from './index.module.scss'
+import { rowArrTemp } from '@/pages/Zother/data'
+import { InfoProvider } from '@/pages/Zother/InfoContext'
+import EditTop from '@/pages/Zother/EditTop'
+import MyTable from '@/components/MyTable'
+import SelectGoods from '@/pages/Zother/SelectGoods'
+import { useParams } from 'react-router-dom'
+import { Button, Input } from 'antd'
+import { API_getGoodsLists } from '@/store/action/Cledger/C1ledger'
+import { B3_APIgetClueList, B3_APIgoodsSave, B3API_obj } from '@/store/action/Benter/B3auth'
+import EditBtn from '@/pages/Zother/EditBtn'
+import SonGoodsList from '@/pages/Zother/SonGoodsList'
+import { useInfo } from '@/pages/Zother/InfoContext'
+import { goodsSonTableC } from '@/utils/tableData'
+import { sgBaseFormDataGood, sgTopSelectDomGood } from '@/pages/Zother/SonGoodsList/data'
+
+const rowArr = [
+  {
+    name: `鉴定入藏`,
+    type: 'txt'
+  },
+  ...rowArrTemp('入藏').slice(1)
+]
+
+function B3edit() {
+  // const { info, setInfoFu, setSnapsFu, timeKey, auditInfo, setAuditInfoFu } = useInfo()
+  const [showSelectGoods, setShowSelectGoods] = useState(false)
+  const ZRichTextRef = useRef<any>(null)
+  const fileRef = useRef<any>(null)
+  const { key, id } = useParams<any>()
+  const isEdit = useMemo(() => {
+    return ['2'].includes(key)
+  }, [key])
+  const isView = useMemo(() => {
+    return ['3', '4'].includes(key)
+  }, [key])
+
+  return (
+    <InfoProvider>
+      <div className={styles.B3edit} id='editBox'>
+        <div className='editMain'>
+          {/* 顶部 */}
+          <EditTop
+            pageTxt='藏品鉴定'
+            rowArr={rowArr}
+            APIobj={B3API_obj}
+            fileUpInfo={{ myUrl: 'cms/order/auth/upload', dirCode: 'auth' }}
+          />
+
+          {/* <div className='Edtop1row Edtop1rowFull'>
+            <div className='Edtop1ll'>关联产品 :</div>
+            <div className='Edtop1rr'>
+              {!isView && (
+                <Button type='primary' onClick={() => setShowSelectGoods(true)}>
+                  添加藏品
+                </Button>
+              )}
+            </div>
+          </div> */}
+          {/* 添加藏品 */}
+          {/* {showSelectGoods && (
+            <SelectGoods
+              myType='藏品'
+              API_getList={API_getGoodsLists}
+              closeFu={() => setShowSelectGoods(false)}
+              baseFormData={sgBaseFormDataGood}
+              topSelectDom={sgTopSelectDomGood}
+              columnsTemp={goodsSonTableC(true)}
+              oldCheckArr={info.goods || []}
+              dataResFu={res => setInfoFu({ ...info, goods: res || [] })}
+            />
+          )} */}
+
+          {/* 底部按钮 */}
+          <EditBtn path='/auth' APIobj={B3API_obj} checkListTxt='请添加藏品' />
+        </div>
+      </div>
+    </InfoProvider>
+  )
+}
+
+const MemoB3edit = React.memo(B3edit)
+
+export default MemoB3edit

+ 4 - 4
src/pages/Benter/B3auth/index.module.scss

@@ -1,4 +1,4 @@
-.B3auth {
-  :global {
-  }
-}
+// .B3auth {
+//   :global {
+//   }
+// }

+ 23 - 0
src/pages/Benter/B3auth/index.tsx

@@ -1,9 +1,32 @@
 import React from 'react'
 import React from 'react'
 import styles from './index.module.scss'
 import styles from './index.module.scss'
+import { useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import { B3_APIgetList } from '@/store/action/Benter/B3auth'
+import TableList from '@/pages/Zother/TableList'
+import { baseFormData, topSearch } from '@/pages/Zother/data'
+import { baseTableC } from '@/utils/tableData'
+
+const D1search = topSearch('登记')
+
+const D1baseFormData = baseFormData()
+
 function B3auth() {
 function B3auth() {
+  // 从仓库拿数据
+  const tableInfo = useSelector((state: RootState) => state.D1register.tableInfo)
+
   return (
   return (
     <div className={styles.B3auth}>
     <div className={styles.B3auth}>
       <div className='pageTitle'>藏品鉴定</div>
       <div className='pageTitle'>藏品鉴定</div>
+      <TableList
+        baseFormData={D1baseFormData}
+        getListAPI={B3_APIgetList}
+        pageKey='auth'
+        tableInfo={tableInfo}
+        columnsTemp={baseTableC('鉴定')}
+        yHeight={585}
+        searchDom={D1search}
+      />
     </div>
     </div>
   )
   )
 }
 }

+ 6 - 0
src/pages/Layout/data.ts

@@ -330,6 +330,12 @@ export const routerSon: RouterTypeRow[] = [
     Com: React.lazy(() => import('../Benter/B2enterGuan/B2edit'))
     Com: React.lazy(() => import('../Benter/B2enterGuan/B2edit'))
   },
   },
   {
   {
+    id: 230,
+    name: '藏品鉴定-详情页',
+    path: '/auth_edit/:key/:id',
+    Com: React.lazy(() => import('../Benter/B3auth/B3edit'))
+  },
+  {
     id: 240,
     id: 240,
     name: '藏品入藏-详情页',
     name: '藏品入藏-详情页',
     path: '/enterCang_edit/:key/:id',
     path: '/enterCang_edit/:key/:id',

+ 45 - 0
src/store/action/Benter/B3auth.ts

@@ -0,0 +1,45 @@
+import { AppDispatch } from '@/store'
+import http from '@/utils/http'
+import { APIbase } from '../layout'
+
+/**
+ * 藏品鉴定 -获取分页列表
+ */
+export const B3_APIgetList = (data: any): any => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post('cms/order/auth/page', data)
+    if (res.code === 0) {
+      const obj = {
+        list: res.data.records,
+        total: res.data.total
+      }
+
+      dispatch({ type: 'B3/getList', payload: obj })
+    }
+  }
+}
+
+/**
+ * 藏品登记-鉴定新增-案例对象
+ */
+export const B3_APIgoodsSave = (data: any) => {
+  return http.post('cms/order/auth/add', data)
+}
+
+/**
+ * 藏品鉴定-藏品列表(取总账数据)-分页
+ */
+export const B3_APIgetClueList = (data: any) => {
+  return http.post('cms/order/auth/good/getList', data)
+}
+
+export const B3API_obj = {
+  创建订单: () => APIbase('get', 'cms/order/auth/create'),
+  获取详情: (id: number) => APIbase('get', `cms/order/auth/detail/${id}`),
+  草稿: (data: any) => APIbase('post', `cms/order/auth/saveDraft`, data),
+  发起: (data: any) => APIbase('post', `cms/order/auth/saveApply`, data),
+  重新发起: (id: number) => APIbase('get', `cms/order/auth/reissue/${id}`),
+  审批: (data: any) => APIbase('post', `cms/order/auth/audit`, data),
+  撤回: (id: number) => APIbase('get', `cms/order/auth/revocation/${id}`),
+  删除: (id: number) => APIbase('get', `cms/order/auth/remove/${id}`)
+}

+ 28 - 0
src/store/reducer/Benter/B3auth.ts

@@ -0,0 +1,28 @@
+import { Typetable } from '@/pages/Zother/data'
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as Typetable[],
+    total: 0
+  }
+}
+
+// 定义 action 类型
+type Props = {
+  type: 'B3/getList'
+  payload: { list: Typetable[]; total: number }
+}
+
+// reducer
+export default function Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case 'B3/getList':
+      return { ...state, tableInfo: action.payload }
+
+    default:
+      return state
+  }
+}

+ 2 - 0
src/store/reducer/index.ts

@@ -5,6 +5,7 @@ import { combineReducers } from 'redux'
 import A0Layout from './layout'
 import A0Layout from './layout'
 import B1collect from './Benter/B1collect'
 import B1collect from './Benter/B1collect'
 import B2enterGuan from './Benter/B2enterGuan'
 import B2enterGuan from './Benter/B2enterGuan'
+import B3auth from './Benter/B3auth'
 import B4enterCang from './Benter/B4enterCang'
 import B4enterCang from './Benter/B4enterCang'
 import C1ledger from './Cledger/C1ledger'
 import C1ledger from './Cledger/C1ledger'
 import D1register from './Dmanage/D1register'
 import D1register from './Dmanage/D1register'
@@ -25,6 +26,7 @@ const rootReducer = combineReducers({
   A0Layout,
   A0Layout,
   B1collect,
   B1collect,
   B2enterGuan,
   B2enterGuan,
+  B3auth,
   B4enterCang,
   B4enterCang,
   C1ledger,
   C1ledger,
   D1register,
   D1register,