shaogen1995 hace 11 meses
padre
commit
9c9401ada6

+ 1 - 0
src/assets/styles/base.css

@@ -105,6 +105,7 @@ textarea {
 }
 #root .ant-table-cell {
   text-align: center !important;
+  min-width: 100px;
 }
 #root #A2Table3 .ant-table-row-expand-icon {
   background-color: var(--themeColor);

+ 1 - 0
src/assets/styles/base.less

@@ -190,6 +190,7 @@ textarea {
 
   .ant-table-cell {
     text-align: center !important;
+    min-width: 100px;
   }
 
   // 树型 表格 定制化

+ 16 - 0
src/pages/A2Blogistics/AddLogistics/index.module.scss

@@ -10,6 +10,15 @@
   padding: 24px;
 
   :global {
+    .A2AlookToA2Badd {
+      position: absolute;
+      right: 100px;
+      top: 50px;
+      font-weight: 700;
+      font-size: 20px;
+      margin-bottom: 15px;
+    }
+
     .A2BaddMain {
       overflow-y: auto;
       width: 100%;
@@ -32,6 +41,13 @@
           .ant-btn {
             margin-left: 15px;
           }
+          .A2Btit2Row {
+            display: flex;
+            align-items: center;
+            .ant-input-affix-wrapper {
+              font-weight: 400;
+            }
+          }
         }
       }
       .A2Btit3 {

+ 25 - 7
src/pages/A2Blogistics/AddLogistics/index.tsx

@@ -24,6 +24,8 @@ type Props = {
 function AddLogistics({ openInfo, closeFu, upTableFu, addTableFu, orderNumTemp }: Props) {
   // 关联业务订单
   const [orderNum, setOrderNum] = useState('')
+  // 关联业务订单--查询
+  const [orderNumSearch, setOrderNumSearch] = useState('')
 
   useEffect(() => {
     if (orderNumTemp) setOrderNum(orderNumTemp)
@@ -167,8 +169,8 @@ function AddLogistics({ openInfo, closeFu, upTableFu, addTableFu, orderNumTemp }
 
   // 点击 从业务订单中添加
   const getCameraFu = useCallback(async () => {
-    if (!orderNum) return MessageFu.warning('请输入关联业务订单')
-    const res = await A2B_APIgetCamera(orderNum)
+    if (!orderNumSearch) return MessageFu.warning('请输入查询的业务订单编号')
+    const res = await A2B_APIgetCamera(orderNumSearch)
     if (res.code === 0) {
       const data: A2AListCamerasType[] = res.data || []
       if (data.length) {
@@ -181,10 +183,10 @@ function AddLogistics({ openInfo, closeFu, upTableFu, addTableFu, orderNumTemp }
         )
         setCheckShow(true)
       } else {
-        MessageFu.warning('当前 业务订单 未查询到数据')
+        MessageFu.warning('未查询到业务订单')
       }
     }
-  }, [orderNum])
+  }, [orderNumSearch])
 
   // 关联业务订单列表
   const [checkList, setCheckList] = useState<A2AListCamerasType[]>([])
@@ -209,6 +211,11 @@ function AddLogistics({ openInfo, closeFu, upTableFu, addTableFu, orderNumTemp }
 
   return (
     <div className={styles.AddLogistics}>
+      {/* 从业务订单进来 才显示在右边的  入库还是出库 */}
+      {orderNumTemp ? (
+        <div className='A2AlookToA2Badd'>{openInfo.type === 'CK' ? '新增出库' : '新增入库'}</div>
+      ) : null}
+
       <div className='A2BaddMain'>
         <Form
           scrollToFirstError={true}
@@ -229,7 +236,7 @@ function AddLogistics({ openInfo, closeFu, upTableFu, addTableFu, orderNumTemp }
             <DatePicker placeholder='请选择日期' />
           </Form.Item>
 
-          <Form.Item label='收货地址' name='address'>
+          <Form.Item label={openInfo.type === 'CK' ? '收货地址' : '发货地址'} name='address'>
             <Input maxLength={50} showCount placeholder='请输入内容' />
           </Form.Item>
 
@@ -252,6 +259,7 @@ function AddLogistics({ openInfo, closeFu, upTableFu, addTableFu, orderNumTemp }
             <div className='formBoxLL'>关联业务订单:</div>
             <div className='formBoxRR'>
               <Input
+                disabled={!!orderNumTemp}
                 value={orderNum}
                 onChange={e => setOrderNum(e.target.value.replace(/\s+/g, ''))}
                 maxLength={12}
@@ -274,10 +282,20 @@ function AddLogistics({ openInfo, closeFu, upTableFu, addTableFu, orderNumTemp }
 
         <div className='A2Btit A2Btit2'>
           <div>
-            <div>相机清单</div>
+            <div className='A2Btit2Row'>
+              相机清单&emsp;&emsp;{' '}
+              <Input
+                value={orderNumSearch}
+                onChange={e => setOrderNumSearch(e.target.value.replace(/\s+/g, ''))}
+                maxLength={12}
+                showCount
+                placeholder='请输入业务订单编号'
+                style={{ width: 400 }}
+              />
+            </div>
             <div>
               <Button type='primary' onClick={getCameraFu}>
-                从业务订单中添加
+                从业务订单中查询
               </Button>
 
               <a href='/xlsx/相机列表导入模板.xlsx' download>

+ 1 - 1
src/pages/A2Blogistics/CheckTable/index.tsx

@@ -54,7 +54,7 @@ function CheckTable({ checkTableList, allList, checkSonBtnOk, checkSonClose }: P
     const delIdxx = delArrRef.current.filter(v => !lastIdxx.includes(v))
 
     checkSonBtnOk(tableSelectList, delIdxx)
-    MessageFu.success('添加成功')
+    MessageFu.success('编辑成功')
     checkSonClose()
   }, [checkSonBtnOk, checkSonClose, tableSelectList])
 

+ 44 - 14
src/pages/ALookPage/A1List/index.tsx

@@ -11,9 +11,10 @@ import { A1addType } from '@/pages/A1Camera/data'
 import AddCamera from '@/pages/A1Camera/AddCamera'
 import { TopTypeType } from '@/pages/A2Abusiness/data'
 import LookTable from '../components/LookTable'
-import { lookTable1 } from '../components/LookTable/tableData'
+import { lookTable1, lookTable3 } from '../components/LookTable/tableData'
+import { A2BListType } from '@/types'
 
-type TxtOrdersType = {
+type InfoOrdersType = {
   id: number
   type: TopTypeType
   num: string
@@ -21,13 +22,15 @@ type TxtOrdersType = {
   updateTime: string
 }
 
-type TxtType = {
+type InfoType = {
   id: number
   cameraSn: string
   cameraType: 'KJ' | 'KK'
   remark: string
   // 业务订单数组
-  orders: TxtOrdersType[]
+  orders: InfoOrdersType[]
+  // 物流订单数组
+  logistics: A2BListType[]
 }
 
 function A1List() {
@@ -46,9 +49,17 @@ function A1List() {
     if (res.code === 0) {
       const data = res.data
 
-      setTxtInfo({
+      let logistics: any[] = data.logistics || []
+      logistics = logistics.map(v => ({
+        ...v,
+        RKDate: v.type === 'RK' ? v.dateStart : '/',
+        CKDate: v.type === 'CK' ? v.dateStart : '/'
+      }))
+
+      setInfo({
         ...data,
-        orders: data.orders || []
+        orders: data.orders || [],
+        logistics: logistics
       })
     }
   }, [])
@@ -61,7 +72,7 @@ function A1List() {
   }, [getInfoFu, urlId])
 
   // 详情信息
-  const [txtInfo, setTxtInfo] = useState({} as TxtType)
+  const [info, setInfo] = useState({} as InfoType)
 
   // 点击删除
   const delFu = useCallback(async () => {
@@ -92,7 +103,7 @@ function A1List() {
         />
       </div>
 
-      {txtInfo.id ? (
+      {info.id ? (
         <div className='lookListBox'>
           <div className='lookTit'>相机信息</div>
 
@@ -100,29 +111,29 @@ function A1List() {
             <div className='lLtxtLeft'>
               <span>*</span> 相机类型:
             </div>
-            <div className='lLtxtRight'>{txtInfo.cameraType === 'KJ' ? '看见' : '看看'}</div>
+            <div className='lLtxtRight'>{info.cameraType === 'KJ' ? '看见' : '看看'}</div>
           </div>
 
           <div className='lLtxt'>
             <div className='lLtxtLeft'>
               <span>*</span> SN编码:
             </div>
-            <div className='lLtxtRight'>{txtInfo.cameraSn}</div>
+            <div className='lLtxtRight'>{info.cameraSn}</div>
           </div>
 
           <div className='lLtxt'>
             <div className='lLtxtLeft'>备注:</div>
-            <div className='lLtxtRight'>{txtInfo.remark || '(空)'}</div>
+            <div className='lLtxtRight'>{info.remark || '(空)'}</div>
           </div>
 
           <div className='lookTit'>业务订单</div>
           <LookTable
-            list={txtInfo.orders}
+            list={info.orders}
             columnsTemp={lookTable1}
             lastBtn={[
               {
                 title: '操作',
-                render: (item: TxtOrdersType) => (
+                render: (item: InfoOrdersType) => (
                   <Button
                     size='small'
                     type='text'
@@ -135,8 +146,27 @@ function A1List() {
             ]}
           />
 
-          {/* 待完善 */}
           <div className='lookTit'>物流订单</div>
+
+          <LookTable
+            list={info.logistics}
+            columnsTemp={lookTable3}
+            isNull='/'
+            lastBtn={[
+              {
+                title: '操作',
+                render: (item: A2BListType) => (
+                  <Button
+                    size='small'
+                    type='text'
+                    onClick={() => history.push(`/lookLog/${item.id}`)}
+                  >
+                    查看
+                  </Button>
+                )
+              }
+            ]}
+          />
         </div>
       ) : null}
 

+ 71 - 0
src/pages/ALookPage/A2BLog/index.module.scss

@@ -0,0 +1,71 @@
+.A2BLog {
+  position: absolute;
+  z-index: 10;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 24px;
+  :global {
+    .lookLogtBtn {
+      text-align: end;
+      margin-bottom: 10px;
+      padding-right: 45px;
+    }
+
+    .lookLogtBox {
+      width: 100%;
+      height: calc(100% - 42px);
+      position: relative;
+      overflow-y: auto;
+      .lookTit {
+        width: calc(100% - 30px);
+        font-weight: 700;
+        color: var(--themeColor);
+        font-size: 18px;
+        padding: 12px 0;
+        border-top: 1px solid #ccc;
+      }
+
+      .lookTit2 {
+        padding: 20px 0;
+      }
+
+      .lLtxt {
+        display: flex;
+        width: 100%;
+        margin-bottom: 10px;
+        .lLtxtLeft {
+          width: 100px;
+          text-align: right;
+          font-weight: 700;
+          span {
+            color: #ff4d4f;
+          }
+        }
+        .lLtxtRight {
+          width: calc(100% - 100px);
+        }
+      }
+    }
+
+    .lookLogtBoxAdd {
+      position: absolute;
+      top: 0;
+      left: 0;
+      z-index: 100;
+      width: 100%;
+      height: 100%;
+      padding: 50px;
+      background-color: rgba(0, 0, 0, 0.6);
+      border-radius: 10px;
+      & > div {
+        position: relative;
+        width: 100%;
+        height: 100%;
+      }
+    }
+  }
+}

+ 155 - 0
src/pages/ALookPage/A2BLog/index.tsx

@@ -0,0 +1,155 @@
+import React, { useCallback, useEffect, useState } from 'react'
+import styles from './index.module.scss'
+import { useParams } from 'react-router-dom'
+import { A2B_APIgetInfo, A2B_APIremove } from '@/store/action/A2Blogistics'
+import { MessageFu } from '@/utils/message'
+import history from '@/utils/history'
+import { A2AListCamerasType, A2BListType } from '@/types'
+import { Button } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import LookTable from '../components/LookTable'
+import { lookTable2 } from '../components/LookTable/tableData'
+import AddLogistics from '@/pages/A2Blogistics/AddLogistics'
+import { A2BaddType } from '@/pages/A2Blogistics/data'
+function A2BLog() {
+  const urlObj: any = useParams()
+
+  const [urlId, setUrlId] = useState(0)
+
+  // 获取地址栏参数
+  useEffect(() => {
+    setUrlId(Number(urlObj.id))
+  }, [urlObj])
+
+  // 通过id获取详情
+  const getInfoFu = useCallback(async (id: number) => {
+    const res = await A2B_APIgetInfo(id)
+    if (res.code === 0) {
+      const data = res.data
+      setInfo({
+        ...data,
+        orders: data.orders || []
+      })
+    }
+  }, [])
+
+  // 进页面发送请求
+  useEffect(() => {
+    if (urlId) {
+      getInfoFu(urlId)
+    }
+  }, [getInfoFu, urlId])
+
+  // 详情信息
+  const [info, setInfo] = useState({} as A2BListType)
+
+  // 点击删除
+  const delFu = useCallback(async () => {
+    const res = await A2B_APIremove(urlId)
+    if (res.code === 0) {
+      MessageFu.success('删除成功!')
+      history.go(-1)
+    }
+  }, [urlId])
+
+  // 点击编辑
+  const [openInfo, setOpenInfo] = useState<A2BaddType>({ id: 0, txt: '', type: '' })
+
+  return (
+    <div className={styles.A2BLog}>
+      <div className='pageTitle'>物流订单-查看({info.type === 'CK' ? '出库' : '入库'})</div>
+      <div className='lookLogtBtn'>
+        <Button
+          type='primary'
+          onClick={() => setOpenInfo({ id: urlId, txt: '编辑', type: info.type })}
+        >
+          编辑
+        </Button>
+        &emsp;
+        <MyPopconfirm
+          txtK='删除'
+          loc='bottom'
+          onConfirm={() => delFu()}
+          Dom={<Button danger>删除</Button>}
+        />
+      </div>
+
+      {info.id ? (
+        <div className='lookLogtBox'>
+          <div className='lookTit'>订单信息</div>
+
+          <div className='lLtxt'>
+            <div className='lLtxtLeft'>
+              <span>*</span> {info.type === 'CK' ? '发货日期' : '收货日期'}:
+            </div>
+            <div className='lLtxtRight'>{info.dateStart}</div>
+          </div>
+
+          <div className='lLtxt'>
+            <div className='lLtxtLeft'>{info.type === 'CK' ? '收货地址' : '发货地址'}:</div>
+            <div className='lLtxtRight'>{info.address || '(空)'}</div>
+          </div>
+
+          <div className='lLtxt'>
+            <div className='lLtxtLeft'>
+              <span>*</span> 物流编号:
+            </div>
+            <div className='lLtxtRight'>{info.logisticsNum}</div>
+          </div>
+
+          <div className='lLtxt'>
+            <div className='lLtxtLeft'>备注:</div>
+            <div className='lLtxtRight'>{info.rtf || '(空)'}</div>
+          </div>
+
+          <div className='lookTit lookTit2'>业务订单</div>
+
+          <div className='lLtxt'>
+            <div className='lLtxtLeft'>关联业务订单:</div>
+            <div className='lLtxtRight'>{info.orderNum || '(空)'}</div>
+          </div>
+          <br />
+
+          <div className='lookTit'>相机清单</div>
+
+          <LookTable
+            list={info.cameras}
+            columnsTemp={lookTable2}
+            lastBtn={[
+              {
+                title: '操作',
+                render: (item: A2AListCamerasType) => (
+                  <Button
+                    size='small'
+                    type='text'
+                    onClick={() => history.push(`/lookList/${item.id}`)}
+                  >
+                    查看
+                  </Button>
+                )
+              }
+            ]}
+          />
+        </div>
+      ) : null}
+
+      {/* 编辑  出来的页面 */}
+      {openInfo.id ? (
+        <div className='lookLogtBoxAdd'>
+          <div>
+            <AddLogistics
+              openInfo={openInfo}
+              closeFu={() => setOpenInfo({ id: 0, txt: '', type: '' })}
+              upTableFu={() => getInfoFu(urlId)}
+              addTableFu={() => {}}
+            />
+          </div>
+        </div>
+      ) : null}
+    </div>
+  )
+}
+
+const MemoA2BLog = React.memo(A2BLog)
+
+export default MemoA2BLog

+ 66 - 5
src/pages/ALookPage/A2LookIndex/index.tsx

@@ -1,7 +1,7 @@
 import React, { useCallback, useEffect, useMemo, useState } from 'react'
 import styles from './index.module.scss'
 import { useParams } from 'react-router-dom'
-import { A2AListCamerasType, A2AListType } from '@/types'
+import { A2AListCamerasType, A2AListType, A2BListType } from '@/types'
 import { A2A_APIgetInfo, A2A_APIremove } from '@/store/action/A2Abusiness'
 import { MessageFu } from '@/utils/message'
 import history from '@/utils/history'
@@ -12,8 +12,10 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import LookTxt from '../components/LookTxt'
 import LookTxt2 from '../components/LookTxt2'
 import LookTable from '../components/LookTable'
-import { lookTable2 } from '../components/LookTable/tableData'
+import { lookTable2, lookTable3 } from '../components/LookTable/tableData'
 import AddBusiness from '@/pages/A2Abusiness/AddBusiness'
+import { A2BaddType } from '@/pages/A2Blogistics/data'
+import AddLogistics from '@/pages/A2Blogistics/AddLogistics'
 
 type Props = {
   pageTit: string
@@ -42,9 +44,18 @@ function A2Index({ pageTit }: Props) {
 
       const rtfDesc = data.rtfDesc || '{"isSection":"true","txtArr":[{"txt":"<p></p>"}]}'
       const rtfDescObj = JSON.parse(rtfDesc)
+
+      let logistics: any[] = data.logistics || []
+      logistics = logistics.map(v => ({
+        ...v,
+        RKDate: v.type === 'RK' ? v.dateStart : '/',
+        CKDate: v.type === 'CK' ? v.dateStart : '/'
+      }))
+
       setInfo({
         ...data,
         cameras: data.cameras || [],
+        logistics: logistics,
         files: data.files || [],
         rtf: refObj,
         rtfDesc: rtfDescObj
@@ -76,6 +87,9 @@ function A2Index({ pageTit }: Props) {
     return Reflect.get(A2AtopTypeObj, info.type)
   }, [info.type])
 
+  // 点击编辑
+  const [logAddInfo, setLogAddInfo] = useState<A2BaddType>({ id: 0, txt: '', type: '' })
+
   return (
     <div className={styles.A2LookIndex}>
       <div className='pageTitle'>{pageTit}</div>
@@ -123,19 +137,51 @@ function A2Index({ pageTit }: Props) {
               }
             ]}
           />
+          <br />
 
-          {/* 待完善 */}
           {['ZL', 'XS', 'BX', 'WX'].includes(info.type) ? (
             <div className='lookTit'>
               <div>物流订单</div>
               <div>
                 {['ZL', 'XS', 'WX'].includes(info.type) ? (
-                  <Button type='primary'>新增出库</Button>
+                  <Button
+                    type='primary'
+                    onClick={() => setLogAddInfo({ id: -1, txt: '新增', type: 'CK' })}
+                  >
+                    新增出库
+                  </Button>
+                ) : null}
+                {['ZL', 'BX'].includes(info.type) ? (
+                  <Button
+                    type='primary'
+                    onClick={() => setLogAddInfo({ id: -1, txt: '新增', type: 'RK' })}
+                  >
+                    新增入库
+                  </Button>
                 ) : null}
-                {['ZL', 'BX'].includes(info.type) ? <Button type='primary'>新增入库</Button> : null}
               </div>
             </div>
           ) : null}
+
+          <LookTable
+            list={info.logistics}
+            columnsTemp={lookTable3}
+            isNull='/'
+            lastBtn={[
+              {
+                title: '操作',
+                render: (item: A2BListType) => (
+                  <Button
+                    size='small'
+                    type='text'
+                    onClick={() => history.push(`/lookLog/${item.id}`)}
+                  >
+                    查看
+                  </Button>
+                )
+              }
+            ]}
+          />
         </div>
       ) : null}
 
@@ -153,6 +199,21 @@ function A2Index({ pageTit }: Props) {
           </div>
         </div>
       ) : null}
+
+      {/* 物流订单 点击 新增出库 新增入库  出来的页面 */}
+      {logAddInfo.id ? (
+        <div className='lookIndexBoxAdd'>
+          <div>
+            <AddLogistics
+              openInfo={logAddInfo}
+              closeFu={() => setLogAddInfo({ id: 0, txt: '', type: '' })}
+              upTableFu={() => {}}
+              addTableFu={() => getInfoFu(urlId)}
+              orderNumTemp={info.num}
+            />
+          </div>
+        </div>
+      ) : null}
     </div>
   )
 }

+ 9 - 0
src/pages/ALookPage/components/LookTable/tableData.ts

@@ -11,3 +11,12 @@ export const lookTable2 = [
   ['txt', 'SN码', 'cameraSn'],
   ['text', '备注', 'remark', 50]
 ]
+
+export const lookTable3 = [
+  ['txt', '物流编号', 'logisticsNum'],
+  ['txtChange', '订单类型', 'type', { RK: '入库', CK: '出库' }],
+  ['txt', '发货日期', 'CKDate'],
+  ['txt', '收货日期', 'RKDate'],
+  ['txt', '编辑人', 'creatorName'],
+  ['txt', '更新时间', 'updateTime']
+]

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

@@ -77,6 +77,17 @@ const tabLeftArr: RouterType = [
         Com: React.lazy(() => import('../A2Blogistics')),
         done: false
       },
+
+      // 相机列表的查看
+      {
+        id: '1.4.1',
+        name: '物流订单-查看',
+        path: '/lookLog/:id',
+        Com: React.lazy(() => import('../ALookPage/A2BLog')),
+        done: false,
+        noShow: true
+      },
+
       {
         id: '1.2',
         name: '机房管理',

+ 3 - 0
src/pages/Layout/index.tsx

@@ -88,6 +88,9 @@ function Layout() {
     // 匹配业务订单的查看
     if (businessUrlArr.current.includes(pathTemp)) pathTemp = '/business'
 
+    // 匹配物流订单的 查看
+    if (pathTemp === '/lookLog') pathTemp = '/logistics'
+
     setPath(pathTemp)
   }, [location])
 

+ 2 - 0
src/types/api/A2Abusiness.ts

@@ -1,5 +1,6 @@
 import { TopTypeType } from '@/pages/A2Abusiness/data'
 import { FileImgListType } from './layot'
+import { A2BListType } from './A2Blogistics'
 
 export type A2AListCamerasType = {
   cameraSn: string
@@ -12,6 +13,7 @@ export type A2AListCamerasType = {
 export type A2AListType = {
   cameraIds: string
   cameras?: A2AListCamerasType[]
+  logistics?: A2BListType[]
   createTime: string
   creatorId: number
   creatorName: string

+ 1 - 0
src/types/api/A2Blogistics.ts

@@ -17,4 +17,5 @@ export type A2BListType = {
   rtf: string
   type: A2BFromTypeType
   updateTime: string
+  address: string
 }