Sfoglia il codice sorgente

feat: 5.31 daily commit 2

lanjianrong 4 anni fa
parent
commit
8fb0e66fd6

+ 7 - 1
src/pages/Customer/Company/components/CompanyDetail/SyncClient.jsx

@@ -6,7 +6,13 @@ import { useState, useMemo } from 'react'
 import { useDispatch } from 'umi'
 import { VList } from 'virtuallist-antd'
 
-const SyncClient = ({ customer, client, actionPayload }) => {
+type SyncClientProps = {
+  customer: API.CompanyItem
+  client: API.ClientItem
+  actionPayload: ActionPayload
+}
+
+const SyncClient: React.FC<SyncClientProps> = ({ customer, client, actionPayload }) => {
   const dispatch = useDispatch()
   const [state, setState] = useState({
     visible: false,

+ 40 - 81
src/pages/Product/Lock/LockStore/components/LockDetail/TabList.tsx

@@ -1,8 +1,7 @@
-import React, { useState } from 'react'
-import { Row, Col, List, Tabs, message, Button, Popconfirm } from 'antd'
+import React from 'react'
+import { Tabs, message, Button, Popconfirm } from 'antd'
 import { dayjsFormat } from '@/utils/utils'
 import consts from '@/consts'
-import classNames from 'classnames'
 import { isDevMode } from '@/utils/env'
 import { apiSoftwareAddLonglelog, apiDelLonglelog } from '@/services/product'
 import { ProductLabel } from '@/pages/Product/Lock/LockStore'
@@ -12,47 +11,49 @@ import { useDispatch, useAccess } from 'umi'
 import { useModal } from '@/components/ModalStore'
 import TimeLineList from '@/components/TimeLineList'
 
+enum StockStatus {
+  /** 接收 */
+  RECEIVE = 0,
+  /** 出库 */
+  CHUKU = 1,
+  /** 生成 */
+  CREATE = 2
+}
+
+enum SellStatus {
+  /** 没有设置 */
+  NONE = 0,
+  /** 销售 */
+  SALES = 1,
+  /** 借出 */
+  LENDING = 2,
+  /** 赠送 */
+  GIFT = 3
+}
+
+enum PreserveStatus {
+  /** 没有设置 */
+  NONE = 0,
+  /** 维护 */
+  SAFEGUARD = 1,
+  /** 升级 */
+  UPGRADE = 2,
+  /** 更换 */
+  REPLACE = 3
+}
+
 type LockTabListProps = {
   logList: {
     log: any[]
   }
   serviceList: API.ServiceLogItem[]
 }
-// export enum LockStockStatusNum {
-//   /** 接收 */
-//   RECEIVE = 0,
-//   /** 出库 */
-//   CHUKU = 1,
-//   /** 生成 */
-//   CREATE = 2
-// }
-// export enum LockSellStatusNum {
-//   /** 没有设置 */
-//   NONE = 0,
-//   /** 销售 */
-//   SALES = 1,
-//   /** 借出 */
-//   LENDING = 2,
-//   /** 赠送 */
-//   GIFT = 3
-// }
-// export enum LockPreserveStatusNum {
-//   /** 没有设置 */
-//   NONE = 0,
-//   /** 维护 */
-//   SAFEGUARD = 1,
-//   /** 升级 */
-//   UPGRADE = 2,
-//   /** 更换 */
-//   REPLACE = 3
-// }
-const LockTabList: React.FC<LockTabListProps> = props => {
-  const {
-    longle: { id: longleId, keyNum, status, stockStatus, sellStatus, preserveStatus } = {},
-    longleLog,
-    upgradeProduct,
-    actionPayload
-  } = props
+const LockTabList: React.FC<LockTabListProps> = ({
+  longle: { id: longleId, keyNum, status, stockStatus, sellStatus, preserveStatus } = {},
+  longleLog,
+  upgradeProduct,
+  actionPayload
+}) => {
   const hasAddPerm = useAccess()?.validatePermByType('lockstore_delete_record')
   const dispatchModal = useModal()
   const dispatch = useDispatch()
@@ -208,46 +209,6 @@ const LockTabList: React.FC<LockTabListProps> = props => {
                 dataSource={longleLog}
                 renderItem={item => renderServiceLogItem(item)}
               />
-              {/* <Row>
-                <Col span="8">类型/时间</Col>
-                <Col span="16">服务内容</Col>
-              </Row> */}
-              {/* <List
-                dataSource={longleLog}
-                split={false}
-                renderItem={item => (
-                  <List.Item>
-                    <Row className="w-full">
-                      <Col span="8">
-                        {servicelogEnum[item.status]}{' '}
-                        <span
-                          className="textPurple text-hex-967bbd cursor-pointer"
-                          onClick={() => dispatchModal('D_CLIENT_DETAIL', { dataId: item.clientId })}>
-                          {item.status !== 6 ? <>{item.client}</> : null}
-                        </span>
-                        <br />
-                        <a>@{item.operator}</a>{' '}
-                        <span className="text-gray-500">{dayjsFormat(item.dateline, 'YYYY-MM-DD')}</span>
-                      </Col>
-                      <Col span="16">
-                        {renderLongleCon(item)}
-                        {hasAddPerm &&
-                        (item.status === 3 || item.status === 4 || item.status === 5 || item.status === 9) ? (
-                          <Popconfirm
-                            title="确认删除"
-                            onConfirm={() => delLonglelog(item.id)}
-                            okText="确认"
-                            cancelText="取消">
-                            <Button className="mt-2" type="primary" ghost size="small" danger>
-                              删除
-                            </Button>
-                          </Popconfirm>
-                        ) : null}
-                      </Col>
-                    </Row>
-                  </List.Item>
-                )}
-              /> */}
             </div>
           </TabPane>
         </Tabs>
@@ -283,9 +244,7 @@ const LockTabList: React.FC<LockTabListProps> = props => {
             更换
           </Button>
         ) : null}
-        {[API.PreserveStatus.NONE, API.PreserveStatus.SAFEGUARD, API.PreserveStatus.UPGRADE].includes(
-          preserveStatus
-        ) ? (
+        {[PreserveStatus.NONE, PreserveStatus.SAFEGUARD, PreserveStatus.UPGRADE].includes(preserveStatus) ? (
           <Button
             type="primary"
             ghost

+ 30 - 31
src/services/typding.d.ts

@@ -107,38 +107,37 @@ declare namespace API {
     mark?: string
     priority?: string
     createTime?: string
-    serviceTime?: any
+    serviceTime?: string
   }
 
-  enum StockStatus {
-    /** 接收 */
-    RECEIVE = 0,
-    /** 出库 */
-    CHUKU = 1,
-    /** 生成 */
-    CREATE = 2
-  }
-
-  enum SellStatus {
-    /** 没有设置 */
-    NONE = 0,
-    /** 销售 */
-    SALES = 1,
-    /** 借出 */
-    LENDING = 2,
-    /** 赠送 */
-    GIFT = 3
-  }
-
-  enum PreserveStatus {
-    /** 没有设置 */
-    NONE = 0,
-    /** 维护 */
-    SAFEGUARD = 1,
-    /** 升级 */
-    UPGRADE = 2,
-    /** 更换 */
-    REPLACE = 3
+  /** @description 单位 */
+  type CompanyItem = {
+    id: string
+    staffId?: string
+    companyName?: string
+    staffName?: string
+    phone?: string
+    tagIds?: string[]
+    tagName?: string[]
+    tagCooperationIds?: string[]
+    tagCooperationName?: string[]
+    natureIds?: string[]
+    nature?: string
+    clientTotal?: number
+    longleTotal?: number
+    districtIds?: string[]
+    districtName?: string
+    mail?: string
+    fax?: string
+    webservice?: string
+    office?: string
+    address?: string
+    ride?: string
+    landmarks?: string
+    stay?: string
+    remarks?: string
+    createTime: string
+    updateTime?: string
   }
 
   /** 软件锁 */
@@ -155,7 +154,7 @@ declare namespace API {
     status?: number
     stockStatus?: number
     sellStatus?: SellStatus
-    preserveStatus?: preserveStatus
+    preserveStatus?: PreserveStatus
     stockTime?: string
     sellTime?: string
     preserveTime?: string

+ 2 - 0
src/typings.d.ts

@@ -41,3 +41,5 @@ declare let ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: 'site' | undefine
 declare const REACT_APP_ENV: 'test' | 'dev' | 'pre' | false
 
 declare type Nullable<T> = T | null
+
+declare type ActionPayload = { main: string; target: string }