瀏覽代碼

修复bug

shaogen1995 2 月之前
父節點
當前提交
ee59725c29

+ 3 - 3
public/index.html

@@ -12,11 +12,11 @@
 
     <script>
       // 域名地址
-      // const baseUrlTempOne = 'https://sit-yiwubwg.4dage.com'
-      const baseUrlTempOne = 'http://192.168.20.61:8096'
+      const baseUrlTempOne = 'https://sit-yiwubwg.4dage.com'
+      // const baseUrlTempOne = 'http://192.168.20.61:8096'
 
       // 钉钉模式
-      const isDingTemp = true
+      const isDingTemp = false
 
       // const script = document.createElement('script')
       // script.src = `//${window.g_config.cdnHost}/gdt/dd-web-dev-center/3.12.0/assets/js/app_567f70b3-6512-4dca-8683-c2b5e2755fd0.js`

+ 8 - 0
src/components/MyTable/index.tsx

@@ -178,6 +178,14 @@ const MyTable = forwardRef<MyTableMethods, MyTableProps>(
                 />
               </div>
             ),
+          // 附件大小
+          fileSize: (item: any) => {
+            if (item[v[2]]) {
+              const resTxt = (item[v[2]] / 1024).toFixed(2)
+              if (resTxt === '0.00') return '0.01'
+              else return resTxt
+            } else return isNull
+          },
           txtChange: (item: any) => Reflect.get(v[3], item[v[2]]) || v[4] || isNull,
           text: (item: any) => {
             let tempCom: any = item[v[2]] || isNull

+ 11 - 3
src/pages/A3_ledger/C1ledger/index.module.scss

@@ -33,16 +33,24 @@
         width: 100%;
         margin-top: 15px;
         text-align: right;
+        .ant-btn {
+          margin-right: 15px;
+        }
       }
 
       .C1toprrKai {
-        position: relative;
-        top: 10px;
+        position: absolute;
+        top: 65px;
+        right: 30px;
         width: 310px;
-        height: 84px;
+        height: 114px;
         display: flex;
         flex-wrap: wrap;
         justify-content: center;
+        .ant-btn {
+          margin-right: 15px;
+          width: 116px;
+        }
       }
 
       .C1topllAll {

+ 0 - 5
src/pages/A3_ledger/C1ledger/index.tsx

@@ -285,23 +285,18 @@ function C1ledger() {
           <Button type='primary' onClick={() => setImportPage(true)} hidden={antiqueSearch}>
             数据导入
           </Button>
-          &emsp;
           <Button type='primary' onClick={deriveFu} hidden={antiqueSearch}>
             批量导出
           </Button>
-          &emsp;
           <Button type='primary' onClick={deriveFu} hidden={antiqueSearch}>
             导出藏品总账
           </Button>
-          &emsp;
           <Button danger={advanced} onClick={() => advancedFu(!advanced)}>
             {advanced ? '收起' : ''}高级搜索
           </Button>
-          &emsp;
           <Button type='primary' onClick={clickSearch}>
             查询
           </Button>
-          &emsp;
           <Button onClick={resetSelectFu}>重置</Button>
         </div>
       </div>

+ 12 - 5
src/pages/B_enterTibet/B34typeIn/index.tsx

@@ -1,7 +1,7 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { useDispatch, useSelector } from 'react-redux'
-import { B1baseFormData } from '../B1collect/data'
+import { B1baseFormData, B1InputKeyType } from '../B1collect/data'
 import { FourAPI_del, FourAPI_getList } from '@/store/action/FourAll'
 import { MessageFu } from '@/utils/message'
 import history, { btnFlagFu } from '@/utils/history'
@@ -79,6 +79,17 @@ function B34typeIn({ type }: Props) {
     getListFu()
   }, [getListFu, timeKey])
 
+  // 输入框的改变
+  const txtChangeFu = useCallback(
+    (txt: string, key: B1InputKeyType) => {
+      setFormData({
+        ...formData,
+        [key]: txt
+      })
+    },
+    [formData]
+  )
+
   // 点击重置
   const resetSelectFu = useCallback(() => {
     setFormData(B1baseFormData)
@@ -198,10 +209,6 @@ function B34typeIn({ type }: Props) {
     }
   }, [type])
 
-  function txtChangeFu(value: string, arg1: string): void {
-    throw new Error('Function not implemented.')
-  }
-
   return (
     <div className={styles.B34typeIn}>
       <div className='pageTitle'>藏品{type}</div>

+ 2 - 0
src/pages/C_goodsManage/C22goodEdit/C22look/index.tsx

@@ -327,6 +327,8 @@ function C22look() {
                 }
               />
             ) : null}
+
+            <Button onClick={() => history.push('/goodEdit')}>返回</Button>
           </>
         )}
       </div>

+ 28 - 16
src/pages/C_goodsManage/C22goodEdit/data.ts

@@ -43,7 +43,12 @@ type C22tableBtnTxtType = '编辑' | '查看' | '撤回' | '审批'
 
 export const C22tableBtnFu = (item: FourTableType) => {
   //申请单状态     申请人id      当前节点审批人     历史审批人       抄送人
-  const { status, creatorId, currentAuditUserIds, auditUserIds, copyUserIds } = item
+  const {
+    status,
+    creatorId,
+    currentAuditUserIds
+    // auditUserIds, copyUserIds
+  } = item
   let flagObj: { [K in C22tableBtnTxtType]: boolean } = {
     编辑: false,
     查看: false,
@@ -55,10 +60,10 @@ export const C22tableBtnFu = (item: FourTableType) => {
   //  当前节点审批人
   const arr3 = (currentAuditUserIds || '').split(',').map(v => Number(v))
   // 历史审批人
-  const arr4 = (auditUserIds || '').split(',').map(v => Number(v))
+  // const arr4 = (auditUserIds || '').split(',').map(v => Number(v))
 
-  // 抄送人
-  const arr5 = (copyUserIds || '').split(',').map(v => Number(v))
+  // // 抄送人
+  // const arr5 = (copyUserIds || '').split(',').map(v => Number(v))
 
   const obj = {
     1: () => {
@@ -75,30 +80,37 @@ export const C22tableBtnFu = (item: FourTableType) => {
       // 待审批
       // 申请人是我自己(提交人)
       if (myId === creatorId) flagObj['查看'] = flagObj['撤回'] = true
-      // 历史审批人有我 =》查看
-      if (arr4.includes(myId)) flagObj['查看'] = true
       // 当前审批人有我 =》审批
       if (arr3.includes(myId)) flagObj['审批'] = true
-      // 抄送人有我 =》查看
-      if (arr5.includes(myId)) flagObj['查看'] = true
+
+      // 历史审批人有我 =》查看
+      // if (arr4.includes(myId)) flagObj['查看'] = true
+      // // 抄送人有我 =》查看
+      // if (arr5.includes(myId)) flagObj['查看'] = true
+
+      flagObj['查看'] = true
     },
     3: () => {
       //审批不通过
       // 申请人是我自己(提交人)
       if (myId === creatorId) flagObj['编辑'] = flagObj['查看'] = true
       // 历史审批人有我 =》查看
-      if (arr4.includes(myId)) flagObj['查看'] = true
-      // 抄送人有我 =》查看
-      if (arr5.includes(myId)) flagObj['查看'] = true
+      // if (arr4.includes(myId)) flagObj['查看'] = true
+      // // 抄送人有我 =》查看
+      // if (arr5.includes(myId)) flagObj['查看'] = true
+
+      flagObj['查看'] = true
     },
     4: () => {
       //已完成
       // 申请人是我自己 =》查看
-      if (myId === creatorId) flagObj['查看'] = true
-      // 历史审批人有我 =》查看
-      if (arr4.includes(myId)) flagObj['查看'] = true
-      // 抄送人有我 =》查看
-      if (arr5.includes(myId)) flagObj['查看'] = true
+      // if (myId === creatorId) flagObj['查看'] = true
+      // // 历史审批人有我 =》查看
+      // if (arr4.includes(myId)) flagObj['查看'] = true
+      // // 抄送人有我 =》查看
+      // if (arr5.includes(myId)) flagObj['查看'] = true
+
+      flagObj['查看'] = true
     }
   }
 

+ 40 - 24
src/utils/history.ts

@@ -8,6 +8,7 @@ import { KuIsTreeType } from '@/pages/D_storeManage/D4impStor/type'
 import { baseURL } from './http'
 import { cascaderArr } from '@/pages/C_goodsManage/C1register/AddGoods/data'
 import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
+// import dd from 'gdt-jsapi'
 const history = createHashHistory()
 export default history
 
@@ -18,6 +19,10 @@ export const openGoodsInfoFu = (id: number, src?: string) => {
 
   history.push(src ? (src + id).replace('#', '') : `/goodsLook/${id}`)
 
+  // dd.openLink({
+  //   url: 'https://sit-yiwubwg.4dage.com/abcd/index.html#/business'
+  // })
+
   // window.open(src ? urlQian + src + id : `${urlQian}#/goodsLook/${id}`, '_blank')
 }
 
@@ -105,7 +110,12 @@ export const buMenRes = (list: any[]) => {
 export type btnFlagTxtType = '查看' | '编辑' | '删除' | '审批' | '盘点'
 export const btnFlagFu = (item: FourTableType) => {
   //申请单状态     申请人id      当前节点审批人     历史审批人       抄送人
-  const { status, creatorId, currentAuditUserIds, auditUserIds, copyUserIds } = item
+  const {
+    status,
+    creatorId,
+    currentAuditUserIds
+    // auditUserIds, copyUserIds
+  } = item
 
   let flagObj: { [K in btnFlagTxtType]: boolean } = {
     查看: false,
@@ -120,9 +130,9 @@ export const btnFlagFu = (item: FourTableType) => {
   //  当前节点审批人
   const arr3 = (currentAuditUserIds || '').split(',').map(v => Number(v))
   // 历史审批人
-  const arr4 = (auditUserIds || '').split(',').map(v => Number(v))
-  // 抄送人
-  const arr5 = (copyUserIds || '').split(',').map(v => Number(v))
+  // const arr4 = (auditUserIds || '').split(',').map(v => Number(v))
+  // // 抄送人
+  // const arr5 = (copyUserIds || '').split(',').map(v => Number(v))
 
   const obj = {
     1: () => {
@@ -138,37 +148,43 @@ export const btnFlagFu = (item: FourTableType) => {
     2: () => {
       //待审批
       // 申请人是我自己 =》查看
-      if (myId === creatorId) flagObj['查看'] = true
-      // 历史审批人有我 =》查看
-      if (arr4.includes(myId)) flagObj['查看'] = true
+      // if (myId === creatorId) flagObj['查看'] = true
+      // // 历史审批人有我 =》查看
+      // if (arr4.includes(myId)) flagObj['查看'] = true
+      // // 抄送人有我 =》查看
+      // if (arr5.includes(myId)) flagObj['查看'] = true
       // 当前审批人有我 =》审批
       if (arr3.includes(myId)) flagObj['审批'] = true
-      // 抄送人有我 =》查看
-      if (arr5.includes(myId)) flagObj['查看'] = true
+
+      flagObj['查看'] = true
     },
     3: () => {
       //审批不通过
       // 申请人是我自己 =》查看
-      if (myId === creatorId) flagObj['查看'] = true
-      // 历史审批人有我 =》查看
-      if (arr4.includes(myId)) flagObj['查看'] = true
-      // 抄送人有我 =》查看
-      if (arr5.includes(myId)) flagObj['查看'] = true
+      // if (myId === creatorId) flagObj['查看'] = true
+      // // 历史审批人有我 =》查看
+      // if (arr4.includes(myId)) flagObj['查看'] = true
+      // // 抄送人有我 =》查看
+      // if (arr5.includes(myId)) flagObj['查看'] = true
+
+      flagObj['查看'] = true
     },
     4: () => {
       //已完成
       // 申请人是我自己 =》查看
-      if (myId === creatorId) flagObj['查看'] = true
-      // 历史审批人有我 =》查看
-      if (arr4.includes(myId)) flagObj['查看'] = true
-      // 抄送人有我 =》查看
-      if (arr5.includes(myId)) flagObj['查看'] = true
-    },
-    5: () => {
-      //待盘点
-      // 申请人是我自己 =》查看 编辑 盘点
-      if (myId === creatorId) flagObj['查看'] = flagObj['编辑'] = flagObj['盘点'] = true
+      // if (myId === creatorId) flagObj['查看'] = true
+      // // 历史审批人有我 =》查看
+      // if (arr4.includes(myId)) flagObj['查看'] = true
+      // // 抄送人有我 =》查看
+      // if (arr5.includes(myId)) flagObj['查看'] = true
+
+      flagObj['查看'] = true
     }
+    // 5: () => {
+    //   //待盘点
+    //   // 申请人是我自己 =》查看 编辑 盘点
+    //   if (myId === creatorId) flagObj['查看'] = flagObj['编辑'] = flagObj['盘点'] = true
+    // }
   }
   if (Reflect.get(obj, status)) Reflect.get(obj, status)()
 

+ 2 - 2
src/utils/tableData.ts

@@ -210,7 +210,7 @@ export const C2tableC = [
   ['txt', '附件名称', 'fileName'],
   ['txt', '上传日期', 'updateTime'],
   ['txt', '上传人', 'creatorName'],
-  ['txt', '附件大小', 'fileSize']
+  ['fileSize', '附件大小(MB)', 'fileSize']
 ]
 
 // 待完善
@@ -415,7 +415,7 @@ export const E4tableCgoods = [
 
 export const Y33tableC = [
   ['text', '附件名称', 'fileName', 50],
-  ['txt', '附件大小', 'fileSize'],
+  ['fileSize', '附件大小(MB)', 'fileSize'],
   ['txt', '上传日期', 'updateTime'],
   ['txt', '上传人', 'creatorName']
 ]