Explorar el Código

date格式截取00:00:00

shaogen1995 hace 1 mes
padre
commit
2ad6405f05

+ 2 - 2
public/index.html

@@ -12,8 +12,8 @@
 
     <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 = false

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

@@ -162,6 +162,11 @@ const MyTable = forwardRef<MyTableMethods, MyTableProps>(
           txtArr: (item: any) => (
             <div dangerouslySetInnerHTML={{ __html: (item[v[2]] || []).join('<br/>') }}></div>
           ),
+          // 日期去掉00:00:00
+          dateRes: (item: any) => {
+            let res: string = item[v[2]] || isNull
+            return res.replace('00:00:00', '')
+          },
           // 多个字段拼接
           ping: (item: any) => (item[v[2]] || '') + (resJiLianFu(item[v[3]]) || '') || isNull,
           // 这个模块特有的级联控制

+ 12 - 1
src/components/Zexport/index.tsx

@@ -32,11 +32,22 @@ function Zexport() {
 
     const numArr = keyArr.map(v => 10)
 
+    const resData = exInfo.data.map(v => ({
+      ...v,
+      date: v.date ? v.date.replace('00:00:00', '') : ''
+    }))
+
+    // if (1 + 1 === 2) {
+    //   console.log('---', resData, keyArr, txtAcArr)
+
+    //   return
+    // }
+
     const option = {
       fileName: name,
       datas: [
         {
-          sheetData: exInfo.data,
+          sheetData: resData,
           sheetName: name,
           sheetFilter: keyArr,
           sheetHeader: txtAcArr,

+ 10 - 3
src/pages/B_enterTibet/B1collect/B1edit/B1upXLSX/index.tsx

@@ -1,4 +1,4 @@
-import React, { useCallback, useRef, useState } from 'react'
+import React, { useCallback, useEffect, useRef, useState } from 'react'
 import { Button, Modal } from 'antd'
 import { MessageFu } from '@/utils/message'
 import { API_upFile } from '@/store/action/layout'
@@ -24,9 +24,10 @@ const arrTemp = [
   'dictTexture3',
   'inDictDateScope',
   'qualityDictScope',
-  'qualityUnit',
   'dictTorn',
   'preserveState'
+  // 重量单位。藏品征集的没有前缀
+  // 'qualityUnit',
 ]
 
 type Props = {
@@ -44,6 +45,12 @@ function B1upXLSX(
   { closeFu, infoXLSX, clickSuccFu, upSuccFu, isZongZhang, url, pageType }: Props,
   ref: any
 ) {
+  const arrTempRef = useRef(arrTemp)
+
+  useEffect(() => {
+    if (pageType === '藏品总账') arrTempRef.current.push('qualityUnit')
+  }, [pageType])
+
   // 藏品总账导入的类型 一普 和省平台
   const zongZhnagType = useRef('')
 
@@ -88,7 +95,7 @@ function B1upXLSX(
             const errArr: B1Xtype[] = []
 
             arrAll.forEach((v, i) => {
-              arrTemp.forEach(c => {
+              arrTempRef.current.forEach(c => {
                 if (v[c] && v[c] !== '-1') {
                   let tttt: string[] = v[c].split(',')
                   v[c] = tttt.slice(3).join(',')

+ 1 - 1
src/pages/D_storeManage/D7check/constants.tsx

@@ -24,7 +24,7 @@ export const D7CHECK_PARAM_ROWS: D7CheckSearchType[] = [
 ]
 
 export const D7CHECK_TABLE_COLUMNS = [
-  ['txt', '移库日期', 'date'],
+  ['dateRes', '移库日期', 'date'],
   ['txt', '移库单编号', 'num'],
   ['txt', '分库缩写', 'sonNum'],
   ['txt', '发起部门', 'deptName'],

+ 1 - 1
src/pages/E_goodsStorage/E4repair/index.tsx

@@ -181,7 +181,7 @@ function E4repair() {
           show: true,
           arr: [
             { key: 'num', txt: '申请编号' },
-            { key: 'businessTimeStart', txt: '交修日期' },
+            { key: 'date', txt: '交修日期' },
             { key: 'authUnit', txt: '交修部门' },
             { key: 'creatorName', txt: '发起人' },
             { key: 'createTime', txt: '发起日期' },

+ 8 - 8
src/utils/tableData.ts

@@ -70,7 +70,7 @@ export const A2tableC = [
 // 藏品征集
 export const B1TableC = [
   ['txt', '业务单号', 'num'],
-  ['txt', '征集日期', 'date'],
+  ['dateRes', '征集日期', 'date'],
   ['txt', '发起部门', 'deptName'],
   ['txt', '发起人', 'creatorName'],
   ['txt', '发起日期', 'createTime'],
@@ -124,7 +124,7 @@ export const B2TableC2 = [
 // 藏品入馆、入藏
 export const B34TableC = (type: '入馆' | '入藏') => {
   return [
-    ['txt', `${type}日期`, 'date'],
+    ['dateRes', `${type}日期`, 'date'],
     ['txt', `${type}凭证号`, 'num'],
     ['txt', '发起部门', 'deptName'],
     ['txt', '发起人', 'creatorName'],
@@ -266,7 +266,7 @@ export const D2tableCSon = [
 ]
 
 export const D4tableC = [
-  ['txt', '入库日期', 'date'],
+  ['dateRes', '入库日期', 'date'],
   ['txt', '入库单编号', 'num'],
   ['txt', '分库缩写', 'sonNum'],
   ['txt', '发起部门', 'deptName'],
@@ -277,7 +277,7 @@ export const D4tableC = [
 
 // 移库
 export const D5tableC = [
-  ['txt', '移库日期', 'date'],
+  ['dateRes', '移库日期', 'date'],
   ['txt', '移库单编号', 'num'],
   ['txt', '出库分库缩写', 'sonNum2'],
   ['txt', '入库分库缩写', 'sonNum'],
@@ -315,7 +315,7 @@ export const D4tableCgoods = [
 ]
 
 export const D6tableC = [
-  ['txt', '提用日期', 'date'],
+  ['dateRes', '提用日期', 'date'],
   ['txtChange', '提退类型', 'sonTypeName', businessTypeObj],
   ['txt', '提退单编号', 'num'],
   ['txt', '提用/借入单位', 'sonUnit'],
@@ -373,7 +373,7 @@ export const D8tableCgoods = [
 export const E1tableC = [
   ['txt', '编号类型', 'numName'],
   ['txt', '申请编号', 'num'],
-  ['txt', '事故时间', 'date'],
+  ['dateRes', '事故时间', 'date'],
   ['txt', '事故责任', 'sonTypeName'],
   ['txt', '藏品名称', 'goodsName'],
   ['txt', '鉴定人', 'authUser'],
@@ -396,7 +396,7 @@ export const E2tableC = [
 export const E3tableC = [
   ['txt', '编号类型', 'numName'],
   ['txt', '申请编号', 'num'],
-  ['txt', '登记日期', 'date'],
+  ['dateRes', '登记日期', 'date'],
   ['txt', '藏品名称', 'goodsName'],
   ['txt', '经手人', 'sonUser'],
   ['txt', '发起人', 'creatorName'],
@@ -407,7 +407,7 @@ export const E3tableC = [
 //文物修复
 export const E4tableC = [
   ['txt', '申请编号', 'num'],
-  ['txt', '交修日期', 'date'],
+  ['dateRes', '交修日期', 'date'],
   ['txt', '交修部门', 'authUnit'],
   ['txt', '发起人', 'creatorName'],
   ['txt', '发起日期', 'createTime'],