소스 검색

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

shaogen1995 2 달 전
부모
커밋
099eb09554

BIN
public/templates/10.docx


BIN
public/templates/13.docx


BIN
public/templates/14.docx


BIN
public/templates/6.docx


+ 1 - 1
src/components/MyTable/index.tsx

@@ -221,7 +221,7 @@ const MyTable = forwardRef<MyTableMethods, MyTableProps>(
           datePicker: (item: any) => {
             return (
               <Form.Item noStyle name={`${item.id}-${v[2]}`}>
-                <DatePicker disabled={readOnly} />
+                <DatePicker disabled={readOnly} {...(v[3] || {})} />
               </Form.Item>
             )
           },

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

@@ -18,7 +18,7 @@ import { statusObj } from '@/utils/tableData'
 import X3auditInfo from '@/pages/X_stock/X3auditInfo'
 import ZupFileTable from '@/components/ZupFileTable'
 import { C22infoBtnFu } from '../data'
-import { EXbtnFu } from '@/utils/EXBtn'
+// import { EXbtnFu } from '@/utils/EXBtn'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import ZflowTable from '@/components/ZflowTable'
 import { GoodFileType } from '@/components/Z3upFiles'
@@ -308,7 +308,7 @@ function C22look() {
               </Button>
             ) : null}
 
-            {EXbtnFu(topInfo)}
+            {/* {EXbtnFu(topInfo)} */}
 
             {C22infoBtnFu(topInfo)['审批'] ? (
               <Button type='primary' onClick={toAuditFu}>

+ 2 - 2
src/pages/D_storeManage/D3staff/constants.ts

@@ -3,7 +3,7 @@ import { D3StaffSearchType, ID3StaffParams } from './types'
 import { sonTypeNameObj, statusObj } from '@/utils/tableData'
 
 export const D3STAFF_PARAM_ROWS2: D3StaffSearchType[] = [
-  { name: '发起人', key: 'creatorName', type: '输入框' },
+  { name: '发起人', key: 'userName', type: '输入框' },
   { name: '发起日期范围', key: 'date', type: '日期选择' },
   { name: '申请状态', key: 'status', type: '下拉框', data: selectObj['流程申请状态'] },
   { name: '选择角色', key: 'userType', type: '下拉框', data: selectObj['角色'] }
@@ -32,7 +32,7 @@ export const DEFAULT_D3STAFF_PARAMS: ID3StaffParams = {
   pageNum: 1,
   pageSize: 10,
   num: '',
-  creatorName: '',
+  userName: '',
   deptName: '',
   status: '',
   userType: ''

+ 3 - 1
src/pages/D_storeManage/D3staff/index.tsx

@@ -15,6 +15,7 @@ import { D3_APIList } from '@/store/action/D3staff'
 import { filterEmptyStrings } from '@/utils/objects'
 import { selectObj } from '@/utils/select'
 import { D2_APIgetList } from '@/store/action/D2storSet'
+import dayjs from 'dayjs'
 
 const { RangePicker } = DatePicker
 
@@ -82,7 +83,8 @@ function D3staff() {
               <RangePicker
                 format='YYYY-MM-DD'
                 allowClear={true}
-                onChange={(e, dateStrings) => setFormData({ ...formData, [item.key]: dateStrings })}
+                value={formData[item.key] as undefined}
+                onChange={e => setFormData({ ...formData, [item.key]: e })}
               />
             ) : (
               <Cascader

+ 1 - 1
src/pages/D_storeManage/D3staff/types.ts

@@ -20,7 +20,7 @@ export interface ID3StaffParams {
   date?: string[]
   userType: string
   status: string
-  creatorName: string
+  userName: string
   deptName: string
   sonTypeName?: SON_TYPE_NAME
   storageInId?: string

+ 4 - 2
src/pages/D_storeManage/D5moveStor/D5edit/index.tsx

@@ -474,7 +474,9 @@ function D5edit() {
           </Button>
         ) : null}
 
-        {EXbtnFu(topInfo, [EXPORT_WORD_ENUM.COLLECTION_RELOCATION])}
+        {EXbtnFu({ ...topInfo, sonNum: storageIdArr.find(i => i.id === topInfo.storageId)?.num }, [
+          EXPORT_WORD_ENUM.COLLECTION_RELOCATION
+        ])}
 
         {btnFlagFu2(topInfo)['删除'] ? (
           <MyPopconfirm
@@ -491,7 +493,7 @@ function D5edit() {
         <Button onClick={() => infoPageBackFu('/moveStor')}>返回</Button>
       </>
     )
-  }, [delFu, lookBtnFu, lookJumpFu, topInfo])
+  }, [delFu, lookBtnFu, lookJumpFu, storageIdArr, topInfo])
 
   // 申请记录
   const [auditsShow, setAuditsShow] = useState(false)

+ 5 - 3
src/pages/D_storeManage/D6putsStor/D6edit/index.tsx

@@ -517,9 +517,11 @@ function D6edit() {
         ) : null}
 
         {EXbtnFu(topInfo, [
-          EXPORT_WORD_ENUM.SUB_PUT_BACK,
-          EXPORT_WORD_ENUM.HALL_PUT_BACK,
-          EXPORT_WORD_ENUM.BORROW
+          topInfo.sonTypeName === '1'
+            ? EXPORT_WORD_ENUM.SUB_PUT_BACK
+            : topInfo.sonTypeName === '2'
+            ? EXPORT_WORD_ENUM.HALL_PUT_BACK
+            : EXPORT_WORD_ENUM.BORROW
         ])}
 
         {btnFlagFu2(topInfo)['删除'] ? (

+ 4 - 2
src/pages/D_storeManage/D7check/D7edit/index.tsx

@@ -301,7 +301,9 @@ function D7edit() {
           </Button>
         ) : null}
 
-        {EXbtnFu(topInfo, [EXPORT_WORD_ENUM.COLLECTION_INVENTORY])}
+        {EXbtnFu({ ...topInfo, sonNum: storageIdArr.find(i => i.id === topInfo.storageId)?.num }, [
+          EXPORT_WORD_ENUM.COLLECTION_INVENTORY
+        ])}
 
         {btnFlagFu2(topInfo)['删除'] ? (
           <MyPopconfirm
@@ -318,7 +320,7 @@ function D7edit() {
         <Button onClick={() => infoPageBackFu('/check')}>返回</Button>
       </>
     )
-  }, [delFu, lookBtnFu, lookJumpFu, topInfo])
+  }, [delFu, lookBtnFu, lookJumpFu, storageIdArr, topInfo])
 
   // 申请记录
   const [auditsShow, setAuditsShow] = useState(false)

+ 10 - 2
src/pages/D_storeManage/D7check/index.tsx

@@ -12,6 +12,7 @@ import { D7_APIdel, D7_APIList } from '@/store/action/D7check'
 import { filterEmptyStrings } from '@/utils/objects'
 import { MessageFu } from '@/utils/message'
 import { statusObj } from '@/utils/tableData'
+import dayjs from 'dayjs'
 
 const { RangePicker } = DatePicker
 
@@ -60,7 +61,8 @@ function D7check() {
               <RangePicker
                 format='YYYY-MM-DD'
                 allowClear={true}
-                onChange={(e, dateStrings) => setFormData({ ...formData, [item.key]: dateStrings })}
+                value={formData[item.key] as undefined}
+                onChange={e => setFormData({ ...formData, [item.key]: e })}
               />
             ) : (
               <Cascader
@@ -114,13 +116,19 @@ function D7check() {
 
   // 封装发送请求的函数
   const getListFu = useCallback(() => {
-    const { date, ...rest } = formDataRef.current
+    const { date, date2, ...rest } = formDataRef.current
     if (Array.isArray(date) && date.length) {
       // @ts-ignore
       rest.startTime = dayjs(date[0]).format('YYYY-MM-DD') + ' 00:00:00'
       // @ts-ignore
       rest.endTime = dayjs(date[1]).format('YYYY-MM-DD') + ' 23:59:59'
     }
+    if (Array.isArray(date2) && date2.length) {
+      // @ts-ignore
+      rest.businessTimeStart = dayjs(date2[0]).format('YYYY-MM-DD') + ' 00:00:00'
+      // @ts-ignore
+      rest.businessTimeEnd = dayjs(date2[1]).format('YYYY-MM-DD') + ' 23:59:59'
+    }
     formDataOldRef.current = rest
     dispatch(D7_APIList(filterEmptyStrings(rest)))
   }, [dispatch])

+ 139 - 18
src/pages/F_exhibition/F1exhibition/F1edit/index.tsx

@@ -5,7 +5,7 @@ import X3auditInfo from '@/pages/X_stock/X3auditInfo'
 import { Button, Input, Radio, Select } from 'antd'
 import { statusObj } from '@/utils/tableData'
 import MyTable, { MyTableMethods } from '@/components/MyTable'
-import { F1_GOOD_COLUMNS, F1_SON_TYPE_NAME_OPTS, F1_SON_TYPE_OPTS } from '../constants'
+import { F1_SON_TYPE_NAME_OPTS, F1_SON_TYPE_OPTS } from '../constants'
 import ZGaddNow from '@/components/ZGaddNow'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import history, { btnFlagFu2, infoPageBackFu, openGoodsInfoFu } from '@/utils/history'
@@ -26,10 +26,17 @@ import ZflowTable from '@/components/ZflowTable'
 import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
 import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
 import { areAllCheckersFilled } from '@/utils/objects'
-import dayjs from 'dayjs'
+import dayjs, { Dayjs } from 'dayjs'
 import { EXPORT_WORD_ENUM } from '@/utils/exportTemplates'
+import { useDispatch, useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import { D6_APIgetList } from '@/store/action/D6putsStor'
+import { D4_APIgetList } from '@/store/action/D4impStor'
 
 function F1edit() {
+  const dispatch = useDispatch()
+  const putsStor = useSelector((state: RootState) => state.D6putsStor.tableInfo)
+  const impStor = useSelector((state: RootState) => state.D4impStor.tableInfo)
   const { key, id } = useParams<any>()
   // 滚到顶部
   const sollrDom = useRef<HTMLDivElement>(null)
@@ -46,6 +53,96 @@ function F1edit() {
   // 藏品清单快照数据
   const [snaps, setSnaps] = useState<C1GoodType[]>([])
   const delSnapIdsRef = useRef<number[]>([])
+  const label1 = useMemo(
+    () => (topInfo.sonType === F1_SON_TYPE_ENUM.IN ? '借展部门' : '借展单位'),
+    [topInfo]
+  )
+  const goodColumns = useMemo(() => {
+    const temp = [
+      ['txt', '编号类型', 'numName'],
+      ['txt', '藏品编号', 'num'],
+      ['txt', '藏品名称', 'name'],
+      ['ping', '数量', 'pcs', 'pcsUnit'],
+      ['datePicker', '借出日期 *', 'lendDate'],
+      [
+        'input',
+        '出借经手人(甲方)',
+        'lenderA',
+        {
+          maxLength: 20,
+          placeholder: '请填写内容,不超过20字'
+        }
+      ],
+      [
+        'input',
+        '出借经手人(乙方)',
+        'lenderb',
+        {
+          maxLength: 20,
+          placeholder: '请填写内容,不超过20字'
+        }
+      ],
+      ['datePicker', '预计归还日期', 'expectedReturnDate'],
+      [
+        'datePicker',
+        '归还日期',
+        'returnDate',
+        {
+          disabledDate: (current?: Dayjs) => current && current > dayjs().endOf('day')
+        }
+      ],
+      [
+        'input',
+        '归还经手人(甲方)',
+        'handlerA',
+        {
+          maxLength: 20,
+          placeholder: '请填写内容,不超过20字'
+        }
+      ],
+      [
+        'input',
+        '归还经手人(乙方)',
+        'handlerB',
+        {
+          maxLength: 20,
+          placeholder: '请填写内容,不超过20字'
+        }
+      ],
+      [
+        'input',
+        '记录人',
+        'recorder',
+        {
+          maxLength: 20,
+          placeholder: '请填写内容,不超过20字'
+        }
+      ],
+      [
+        'input',
+        '备注',
+        'remark',
+        {
+          maxLength: 20,
+          placeholder: '请填写内容,不超过20字'
+        }
+      ]
+    ]
+
+    if (topInfo.sonType === F1_SON_TYPE_ENUM.IN) {
+      temp.splice(-1, 0, [
+        'input',
+        '放置位置',
+        'address',
+        {
+          maxLength: 20,
+          placeholder: '请填写内容,不超过20字'
+        }
+      ])
+    }
+
+    return temp
+  }, [topInfo.sonType])
 
   const snapsID2ref = useRef<{ goodsId: number; id: number }[]>([])
 
@@ -242,7 +339,7 @@ function F1edit() {
       return true
     }
     if (!topInfo.sonUnit) {
-      MessageFu.warning('借展部门不能为空')
+      MessageFu.warning(label1 + '不能为空')
       return true
     }
 
@@ -253,7 +350,7 @@ function F1edit() {
     }
 
     return false
-  }, [topInfo.sonUnit, topInfo.typeName])
+  }, [topInfo.sonUnit, topInfo.typeName, label1])
 
   // 新增的底部按钮点击
   const btnClickFu = useCallback(
@@ -344,6 +441,21 @@ function F1edit() {
     if (sollrDom.current) sollrDom.current.scrollTop = 0
   }, [creatFu, getInfoFu, key])
 
+  useEffect(() => {
+    dispatch(
+      D6_APIgetList({
+        pageNum: 1,
+        pageSize: 999
+      })
+    )
+    dispatch(
+      D4_APIgetList({
+        pageNum: 1,
+        pageSize: 999
+      })
+    )
+  }, [dispatch])
+
   return (
     <div className={style.F1edit}>
       <div className='pageTitle'>借展管理-{pageTitTxt}</div>
@@ -436,19 +548,24 @@ function F1edit() {
           <div className='D4row'>
             <div className='D4rowll'>提用审批单号:</div>
             <div className='D4rowrr'>
-              <Input
-                value={topInfo.sonNum}
-                onChange={e => setTopInfo({ ...topInfo, sonNum: e.target.value.trim() })}
-                readOnly={pageDisabled}
+              <Select
+                allowClear
+                showSearch
+                options={putsStor.list}
+                fieldNames={{
+                  label: 'num',
+                  value: 'num'
+                }}
                 placeholder='请输入内容'
-                maxLength={30}
-                showCount
+                value={topInfo.sonNum ? topInfo.sonNum : undefined}
+                onChange={e => setTopInfo({ ...topInfo, sonNum: e })}
               />
             </div>
           </div>
           <div className='D4row'>
             <div className='D4rowll'>
-              <span> * </span>借展部门:
+              <span> * </span>
+              {label1}:
             </div>
             <div className='D4rowrr'>
               <Input
@@ -464,13 +581,17 @@ function F1edit() {
           <div className='D4row'>
             <div className='D4rowll'>提退凭证号:</div>
             <div className='D4rowrr'>
-              <Input
-                value={topInfo.sonNum2}
-                onChange={e => setTopInfo({ ...topInfo, sonNum2: e.target.value.trim() })}
-                readOnly={pageDisabled}
+              <Select
+                allowClear
+                showSearch
+                options={[...impStor.list, ...putsStor.list]}
+                fieldNames={{
+                  label: 'num',
+                  value: 'num'
+                }}
                 placeholder='请输入内容'
-                maxLength={30}
-                showCount
+                value={topInfo.sonNum2 ? topInfo.sonNum2 : undefined}
+                onChange={e => setTopInfo({ ...topInfo, sonNum2: e })}
               />
             </div>
           </div>
@@ -499,7 +620,7 @@ function F1edit() {
           <MyTable
             ref={tableRef}
             list={snaps}
-            columnsTemp={F1_GOOD_COLUMNS}
+            columnsTemp={goodColumns}
             pagingInfo={false}
             lastBtn={tableLastBtn}
             readOnly={pageDisabled}

+ 5 - 65
src/pages/F_exhibition/F1exhibition/constants.ts

@@ -43,77 +43,17 @@ export const F1EXHIBITION_TABLE_COLUMNS = [
   ['txtChange', '申请状态', 'status', statusObj]
 ]
 
-export const F1_GOOD_COLUMNS = [
-  ['txt', '编号类型', 'numName'],
-  ['txt', '藏品编号', 'num'],
-  ['txt', '藏品名称', 'name'],
-  ['ping', '数量', 'pcs', 'pcsUnit'],
-  ['datePicker', '借出日期 *', 'lendDate'],
-  [
-    'input',
-    '出借经手人(甲方)',
-    'lenderA',
-    {
-      maxLength: 20,
-      placeholder: '请填写内容,不超过20字'
-    }
-  ],
-  [
-    'input',
-    '出借经手人(乙方)',
-    'lenderb',
-    {
-      maxLength: 20,
-      placeholder: '请填写内容,不超过20字'
-    }
-  ],
-  ['datePicker', '预计归还日期', 'expectedReturnDate'],
-  ['datePicker', '归还日期', 'returnDate'],
-  [
-    'input',
-    '归还经手人(甲方)',
-    'handlerA',
-    {
-      maxLength: 20,
-      placeholder: '请填写内容,不超过20字'
-    }
-  ],
-  [
-    'input',
-    '归还经手人(乙方)',
-    'handlerB',
-    {
-      maxLength: 20,
-      placeholder: '请填写内容,不超过20字'
-    }
-  ],
-  [
-    'input',
-    '记录人',
-    'recorder',
-    {
-      maxLength: 20,
-      placeholder: '请填写内容,不超过20字'
-    }
-  ],
-  [
-    'input',
-    '备注',
-    'remark',
-    {
-      maxLength: 20,
-      placeholder: '请填写内容,不超过20字'
-    }
-  ]
-]
-
 export const F1_SON_TYPE_NAME_OPTS = [
   {
     label: '临时展览',
     value: F1_SON_TYPE_NAME_ENUM.TEMP
   },
   {
-    label: '固定展览',
+    label: '主题展览',
+    value: F1_SON_TYPE_NAME_ENUM.THEME
+  },
+  {
+    label: '常设展览',
     value: F1_SON_TYPE_NAME_ENUM.FIXED
   }
 ]

+ 3 - 2
src/pages/F_exhibition/F1exhibition/types.ts

@@ -26,8 +26,9 @@ export interface IF1exhibitionParams {
 }
 
 export enum F1_SON_TYPE_NAME_ENUM {
-  TEMP = 1,
-  FIXED = 2
+  TEMP = '1',
+  FIXED = '2',
+  THEME = '3'
 }
 
 export enum F1_SON_TYPE_ENUM {

+ 25 - 6
src/utils/exportTemplates.ts

@@ -16,6 +16,7 @@ import dayjs from 'dayjs'
 import { D7CEHCK_COLLECTION_RESULT_OPTIONS } from '@/pages/D_storeManage/D7check/constants'
 import { exportTempExcel, getImageBase64Extension } from './exportExcelUtils'
 import { selectObj } from './select'
+import { MEDIA_TYPES } from '@/pages/C_goodsManage/C21wealth/constants'
 
 export enum EXPORT_WORD_ENUM {
   /** 借用藏品点交凭证 */
@@ -447,8 +448,12 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
       good.source && (good.source = resJiLianFu(good.source))
       good.dictAgeFirst && (good.dictAgeFirst = resJiLianFu(good.dictAgeFirst))
       good.qualityUnit && (good.qualityUnit = resJiLianFu(good.qualityUnit))
-      if (good.sizeUnit || good.quality)
-        good.size = good.sizeUnit ? myTableTransferSize(good) : good.quality + good.qualityUnit
+      if (good.sizeUnit || good.quality) {
+        const arr: string[] = []
+        if (good.sizeUnit) arr.push(myTableTransferSize(good))
+        if (good.quality) arr.push(good.quality + good.qualityUnit)
+        good.size = arr.join('、')
+      }
     }
   } else {
     temp.goods = []
@@ -515,11 +520,18 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
       }
       break
     case EXPORT_WORD_ENUM.FORM_FOR_DIGITAL:
+      const __date = dayjs(temp.createTime)
+
       temp = {
         ...temp,
-        year: date.format('YYYY'),
-        month: date.format('MM'),
-        day: date.format('DD')
+        effect: resJiLianFu(temp.effect),
+        sonTypeName: MEDIA_TYPES.filter(media => temp.sonTypeName.split(',').includes(media.value))
+          .map(media => media.label)
+          .join(','),
+        year2: date.format('YYYY'),
+        year: __date.format('YYYY'),
+        month: __date.format('MM'),
+        day: __date.format('DD')
       }
       break
     case EXPORT_WORD_ENUM.SUB_PUT_IN:
@@ -533,6 +545,7 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
       }
       break
     case EXPORT_WORD_ENUM.COLLECTION_RELOCATION:
+      console.log(temp.goods)
       temp = {
         ...temp,
         year: date.format('YYYY'),
@@ -586,7 +599,13 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
       break
     case EXPORT_WORD_ENUM.RELIC_REPAIR_LIST:
     case EXPORT_WORD_ENUM.COLLECTION_CURRENT_STATUS:
-      temp.rtf = removeHtmlTags(JSON.parse(temp.rtf).txtArr[0].txt)
+      const ___date = dayjs(temp.date)
+      temp = {
+        ...temp,
+        year: ___date.format('YYYY'),
+        page,
+        rtf: removeHtmlTags(JSON.parse(temp.rtf).txtArr[0].txt)
+      }
       break
     case EXPORT_WORD_ENUM.COLLECTION_LIST:
       temp.goods.push({