Explorar el Código

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

shaogen1995 hace 1 día
padre
commit
cfb45d12ce

+ 6 - 0
src/components/MyTable/form.tsx

@@ -260,6 +260,12 @@ const MyTable = forwardRef<MyTableMethods, MyTableProps>(
             const obj = data.find((v: any) => v.value === id)
             if (obj) txt = obj.label
             return txt
+          },
+          connectTxt: (item: any) => {
+            const txt1 = v[2] ? item[v[2]] || isNull : isNull
+            const txt2 = v[3] ? item[v[3]] || isNull : isNull
+            console.log(txt1, txt2, item[v[2]], item[v[3]])
+            return !item[v[2]] && !item[v[3]] ? isNull : `${txt1}-${txt2}`
           }
         }
 

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

@@ -172,6 +172,12 @@ function MyTable({
           const size = item[v[2]] || ''
           if (size) txt = (size / v[3]).toFixed(2)
           return txt
+        },
+        connectTxt: (item: any) => {
+          const txt1 = v[2] ? item[v[2]] || isNull : isNull
+          const txt2 = v[3] ? item[v[3]] || isNull : isNull
+          console.log(txt1, txt2, item[v[2]], item[v[3]])
+          return !item[v[2]] && !item[v[3]] ? isNull : `${txt1}-${txt2}`
         }
       }
 

+ 3 - 0
src/pages/Abench/A4proof/A4edit/index.module.scss

@@ -0,0 +1,3 @@
+// .B1edit {
+//   // :global {}
+// }

+ 44 - 0
src/pages/Abench/A4proof/A4edit/index.tsx

@@ -0,0 +1,44 @@
+import React from 'react'
+import styles from './index.module.scss'
+import EditTop from '@/pages/Zother/EditTop'
+import EditBtn from '@/pages/Zother/EditBtn'
+import { InfoProvider } from '@/pages/Zother/InfoContext'
+import { rowArrTemp } from '@/pages/Zother/data'
+import { A4API_obj } from '@/store/action/Abench/A4proof'
+import SonClueList from '@/pages/Zother/SonClueList'
+import FileArchive from '@/pages/Zother/FileArchive'
+
+const rowArr = rowArrTemp('征集')
+
+function A4edit() {
+  return (
+    <InfoProvider>
+      <div className={styles.A4edit} id='editBox'>
+        <div className='editMain'>
+          {/* 顶部 */}
+          <EditTop
+            pageTxt='凭证中心'
+            rowArr={rowArr}
+            APIobj={A4API_obj}
+            fileUpInfo={{ myUrl: 'cms/order/collect/upload', dirCode: 'collect' }}
+          />
+
+          {/* 线索清单 */}
+          <SonClueList
+            fileUpInfo={{ myUrl: 'cms/order/collect/son/upload', dirCode: 'collectClues' }}
+          />
+
+          {/* 附件归档 */}
+          <FileArchive />
+
+          {/* 底部按钮 */}
+          <EditBtn path='/collect' APIobj={A4API_obj} checkListTxt='请添加线索' />
+        </div>
+      </div>
+    </InfoProvider>
+  )
+}
+
+const MemoA4edit = React.memo(A4edit)
+
+export default MemoA4edit

+ 15 - 26
src/pages/Abench/A4proof/index.tsx

@@ -1,4 +1,4 @@
-import React, { useMemo, useState, useEffect } from 'react'
+import React, { useMemo, useState, useEffect, useCallback } from 'react'
 import styles from './index.module.scss'
 import history from '@/utils/history'
 import { MessageFu } from '@/utils/message'
@@ -12,6 +12,7 @@ import { baseFormData } from '@/pages/Zother/data'
 import { voucherCenterTableC } from '@/utils/tableData'
 import { Button, message } from 'antd'
 import tabLeftArr from '@/pages/Layout/data'
+import { downloadFileByUrl } from '@/utils'
 
 function A4proof() {
   const tableInfo = useSelector((state: RootState) => state.A4proof.tableInfo)
@@ -67,7 +68,7 @@ function A4proof() {
       window.open(fullUrl)
     }
   }
-  // 已知路径,单独下载
+  // 已知路径,单独下载 改为使用downloadFileByUrl
   // const downloadSingleFn = (path: string, fileName: string) => {
   //   const downloadUrl = `${baseURL}${path}`
   //   const link = document.createElement('a')
@@ -89,12 +90,19 @@ function A4proof() {
     setList(arr)
   }, [])
 
+  // 点击各种操作按钮
+  const tableBtnFu = useCallback((id: number, key: string) => {
+    history.push(`/proof_edit/${key}/${id}`)
+  }, [])
+
   const staBtn = useMemo(() => {
     return [
       {
-        title: '申请类型',
+        title: '业务类型',
         render: (item: any) => {
           let txt = '(空)'
+          console.log('--------', item.moduleName)
+
           const obj = list.find(v => v.value === item.moduleName)
           if (obj) txt = obj.label
           return txt
@@ -159,32 +167,13 @@ function A4proof() {
         title: '操作',
         render: (item: any) => (
           <>
-            <Button
-              size='small'
-              type='text'
-              onClick={() => {
-                console.log(item)
-                const obj = list.find(v => v.value === item.type)
-                if (obj) {
-                  authorityFu(obj.id, obj.label, () =>
-                    history.push(`${obj.path}_edit/4/${item.id}`)
-                  )
-                } else MessageFu.warning('申请类型错误')
-              }}
-            >
+            <Button size='small' type='text' onClick={() => tableBtnFu(item.moduleId, '4')}>
               查看
             </Button>
             <Button
               size='small'
               type='text'
-              onClick={() => {
-                const id = Number(item.id)
-                if (Number.isNaN(id)) {
-                  message.error('当前附件ID异常,无法下载')
-                  return
-                }
-                downloadFn(id)
-              }}
+              onClick={() => downloadFileByUrl(item.filePath, item.fileName)}
             >
               下载
             </Button>
@@ -192,7 +181,7 @@ function A4proof() {
         )
       }
     ]
-  }, [list])
+  }, [tableBtnFu])
 
   return (
     <div className={styles.A4proof}>
@@ -201,7 +190,7 @@ function A4proof() {
       <TableList
         baseFormData={baseFormData}
         getListAPI={API_getGoodsList}
-        pageKey='A4proof'
+        pageKey='proof'
         tableInfo={tableInfo}
         columnsTemp={voucherCenterTableC}
         rightBtnWidth={240}

+ 2 - 2
src/pages/Cledger/C2routing/index.tsx

@@ -54,8 +54,8 @@ const C2baseFormData = {
 const C2columnsTempAdd = [
   ...goodsSonTableC(false),
   ['select', '入藏状态', 'status', selectObj['藏品入藏状态']],
-  ['txt', '库存状态', 'siteStatus'],
-  ['txt', '库房位置', 'siteLoc']
+  ['select', '库存状态', 'siteStatus', selectObj['藏品库存状态']],
+  ['connectTxt', '库房位置', 'storageName', 'siteLoc']
 ]
 
 // 递归收集树中所有节点的 key(用于默认全选)

+ 2 - 2
src/pages/Cledger/C3goodsInfo/index.tsx

@@ -82,8 +82,8 @@ const C1baseFormData = {
 const columnsTempAdd = [
   ...goodsSonTableC(false),
   ['select', '入藏状态', 'status', selectObj['藏品入藏状态']],
-  ['txt', '库存状态', 'siteStatus'],
-  ['txt', '库房位置', 'siteLoc']
+  ['select', '库存状态', 'siteStatus', selectObj['藏品库存状态']],
+  ['connectTxt', '库房位置', 'storageName', 'siteLoc']
 ]
 
 function C3goodsInfo() {

+ 1 - 1
src/pages/Fstorehouse/F3outStorage/F3edit/index.tsx

@@ -136,7 +136,7 @@ function F3editContent() {
             ['txtC', '质地', 'textureDictId'],
             ['select', '完残程度', 'tornLevel', selectObj['完残程度']],
             ['ping', '数量', 'pcs', 'pcsUnitDictId'],
-            ['txt', '库房位置', 'siteLoc']
+            ['connectTxt', '库房位置', 'storageName', 'siteLoc']
           ]}
           fileUpInfo={{ myUrl: 'cms/orderSite/out/upload', dirCode: 'outStorageGoods' }}
           selectApi={F3_APIgetClueList}

+ 1 - 1
src/pages/Fstorehouse/F4check/F4edit/index.tsx

@@ -186,7 +186,7 @@ function F1editContent() {
           btnTxt='选择藏品'
           addShow={false}
           goodsSonTable={[
-            ['txt', '库房位置', 'siteLoc'],
+            ['connectTxt', '库房位置', 'storageName', 'siteLoc'],
             ['txt', '藏品登记号', 'num'],
             ['img', '封面', 'thumb'],
             ['txtCTag', '藏品标签', 'tagDictId'],

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

@@ -348,6 +348,12 @@ export default tabLeftArr
 // 这里的id要和tab栏的id相同,不然没有权限进入页面
 export const routerSon: RouterTypeRow[] = [
   {
+    id: 140,
+    name: '凭证中心-详情页',
+    path: '/proof_edit/:key/:id',
+    Com: React.lazy(() => import('../Abench/A4proof/A4edit'))
+  },
+  {
     id: 210,
     name: '藏品征集-详情页',
     path: '/collect_edit/:key/:id',

+ 17 - 15
src/store/action/Abench/A4proof.ts

@@ -1,15 +1,9 @@
 import http from '@/utils/http'
 import { AppDispatch } from '@/store'
+import { APIbase } from '../layout'
 
 /**
- * 流程中心-获取详情
- */
-export const API_getGoodsInfo = (id: number) => {
-  return http.get(`cms/workVoucher/orderDetail/${id}`)
-}
-
-/**
- * 流程中心-获取分页列表
+ * 凭证中心-获取分页列表
  */
 export const API_getGoodsList = (data: any): any => {
   return async (dispatch: AppDispatch) => {
@@ -26,7 +20,7 @@ export const API_getGoodsList = (data: any): any => {
 }
 
 /**
- * 流程中心-获取全部数据
+ * 凭证中心-获取全部数据
  */
 export const API_getGoodsListAll = () => {
   return http.post(`cms/workVoucher/pageList`, {
@@ -37,8 +31,19 @@ export const API_getGoodsListAll = () => {
   })
 }
 
+export const A4API_obj = {
+  创建订单: () => APIbase('get', 'cms/workVoucher/create'),
+  获取详情: (id: number) => APIbase('get', `cms/workVoucher/orderDetail/${id}`),
+  草稿: (data: any) => APIbase('post', `cms/workVoucher/saveDraft`, data),
+  发起: (data: any) => APIbase('post', `cms/workVoucher/saveApply`, data),
+  重新发起: (id: number) => APIbase('get', `cms/workVoucher/reissue/${id}`),
+  审批: (data: any) => APIbase('post', `cms/workVoucher/audit`, data),
+  撤回: (id: number) => APIbase('get', `cms/workVoucher/revocation/${id}`),
+  删除: (id: number) => APIbase('get', `cms/workVoucher/remove/${id}`)
+}
+
 /**
- * 流程中心-删除附件
+ * 凭证中心-删除附件
  */
 // export const API_delFiles = (ids: number[]) => {
 //   return http.post(`cms/workVoucher/removes`, ids)
@@ -47,9 +52,6 @@ export const API_getGoodsListAll = () => {
 /**
  * 通用下载-批量下载
  */
-export const API_download = (ids: number[], downloadType?: number) => {
-  return http.post(`cms/file/downloadBatch`, {
-    ids,
-    downloadType
-  })
+export const API_download = (ids: number[]) => {
+  return http.post(`cms/file/downloadBatch`, ids)
 }

+ 1 - 1
src/utils/tableData.ts

@@ -57,7 +57,7 @@ export const goodsSonTableC = (loc?: boolean) => {
     ['select', '完残程度', 'tornLevel', selectObj['完残程度']],
     ['ping', '数量', 'pcs', 'pcsUnitDictId']
   ]
-  if (loc) arr.push(['txt', '库房位置', 'siteLoc'])
+  if (loc) arr.push(['connectTxt', '库房位置', 'storageName', 'siteLoc'])
   return arr
 }