chenlei пре 1 месец
родитељ
комит
d852b41c6d

BIN
public/templates/2.docx


BIN
public/templates/3.docx


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

@@ -171,7 +171,7 @@ const MyTable = forwardRef<MyTableMethods, MyTableProps>(
             v[3] && !item[v[2]] ? (
               <div dangerouslySetInnerHTML={{ __html: v[3] }}></div>
             ) : (
-              item[v[2]] || isNull
+              item[v[2]] ?? isNull
             ),
           txtArr: (item: any) => (
             <div dangerouslySetInnerHTML={{ __html: (item[v[2]] || []).join('<br/>') }}></div>

+ 6 - 3
src/components/ZGaddNow/index.tsx

@@ -1,6 +1,6 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
-import { Button, Cascader, Checkbox, Input, Modal, Select } from 'antd'
+import { Button, Cascader, Checkbox, CheckboxProps, Input, Modal, Select } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import MyTable from '@/components/MyTable'
 import { B3eTableC } from '@/utils/tableData'
@@ -29,6 +29,7 @@ type Props = {
   httpType?: 'get' | 'post'
   // 不需要的搜索条件
   searchFilterKey?: string[]
+  checkboxProps?: (item: C1GoodType) => Omit<CheckboxProps, 'checked' | 'onChange'>
 }
 
 function ZGaddNow({
@@ -42,7 +43,8 @@ function ZGaddNow({
   canObj,
   register,
   httpType = 'post',
-  searchFilterKey = []
+  searchFilterKey = [],
+  checkboxProps
 }: Props) {
   // 入藏状态特别过滤
   const RuChangSelect = useMemo(() => {
@@ -138,6 +140,7 @@ function ZGaddNow({
         width: 50,
         render: (item: C1GoodType) => (
           <Checkbox
+            {...checkboxProps?.(item)}
             checked={checkArr.map(v => v.id).includes(item.id)}
             onChange={() => checkFu(item)}
           />
@@ -148,7 +151,7 @@ function ZGaddNow({
         render: (item: C1GoodType) => item.num || '(空)'
       }
     ]
-  }, [checkArr, checkFu, isOne])
+  }, [checkArr, checkFu, checkboxProps, isOne])
 
   const tableLastBtn = useMemo(() => {
     return [

+ 31 - 10
src/pages/A_workbench/A1dataSta/components/Tab2/index.tsx

@@ -50,19 +50,40 @@ export const A1Tab2: FC = () => {
   const handleColumnChange = useCallback(
     (v: any[]) => {
       const temp: any[] = []
-      Object.keys(sourceData).forEach(id => {
-        if (id === '0')
+
+      if (sourceData[0])
+        temp.push({
+          name: '全部',
+          id: 0,
+          ...sourceData[0]
+        })
+      v.forEach(relic => {
+        const i = sourceData[relic.dataIndex]
+        if (i) {
           temp.push({
-            name: '全部',
-            id,
-            ...sourceData[id]
+            id: relic.dataIndex,
+            ...i,
+            name: relic.title
           })
-        const relic = v.find(i => i.dataIndex === id)
-        if (relic) {
+        } else {
           temp.push({
-            id,
-            ...sourceData[id],
-            name: relic.title
+            id: relic.dataIndex,
+            name: relic.title,
+            pcsTotal: '-',
+            pcsZj: '-',
+            pcsJz: '-',
+            pcsYj: '-',
+            pcsSj: '-',
+            pcsDb: '-',
+            pcsOther: '-',
+            cl1: '-',
+            cl2: '-',
+            cl3: '-',
+            clTotal: '-',
+            jc1: '-',
+            jc2: '-',
+            jc3: '-',
+            jcTotal: '-'
           })
         }
       })

+ 6 - 1
src/pages/C_goodsManage/C1register/AddGoods/index.module.scss

@@ -201,9 +201,11 @@
       .B3Nbox1 {
         // 相关附件
         .B3Ntit {
-          width: 600px;
+          width: 100%;
           display: flex;
+          justify-content: space-between;
           .B3Ntitll {
+            display: flex;
             position: relative;
             top: 3px;
             & > span {
@@ -215,6 +217,9 @@
             margin-left: 20px;
             width: auto;
           }
+          &::before {
+            display: none;
+          }
         }
         .tableImgAuto {
           display: flex;

+ 54 - 40
src/pages/C_goodsManage/C1register/AddGoods/index.tsx

@@ -16,11 +16,12 @@ import { GoodFileType } from './type'
 import { baseURL } from '@/utils/http'
 import { fileImgArr, fileVideoArr } from '@/store/action/layout'
 import { API_C2dels } from '@/store/action/C2files'
-import { API_goodsAdd, API_goodsInfo } from '@/store/action/C1ledger'
+import { API_goodsAdd, API_goodsInfo, API_setThumb } from '@/store/action/C1ledger'
 import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
 import { MessageFu } from '@/utils/message'
 import history, { cascaderObjFu } from '@/utils/history'
 import ZGaddNow from '@/components/ZGaddNow'
+import ZupOne from '@/components/ZupOne'
 
 // 级联的数据转换成字符串
 export const cascaderChArr = [
@@ -78,7 +79,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
   // 编辑进来获取详情
   const getInfo = useCallback(
     async (id: number) => {
-      const res = await API_goodsInfo(id, 17)
+      const res = await API_goodsInfo(id, 310)
       if (res.code === 0) {
         // 藏品编辑信息保存
         objOld.current = { ...res.data }
@@ -131,7 +132,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
   const [ageAc, setAgeAc] = useState(false)
 
   // 封面图的ref
-  // const ZupThumbRef = useRef<any>(null)
+  const ZupThumbRef = useRef<any>(null)
 
   // 富文本的ref
   const ZRichTextRef = useRef<any>(null)
@@ -269,7 +270,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
   const onFinish = useCallback(
     async (values: any) => {
       // 封面图
-      // const coverUrl1 = ZupThumbRef.current?.fileComFileResFu()
+      const coverUrl1 = ZupThumbRef.current?.fileComFileResFu()
 
       // 富文本
       const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
@@ -295,19 +296,19 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
       if (values.dateMaking) dateMaking = dayjs(values.dateMaking).format('YYYY-MM-DD')
 
       // 默认以第一个附件为img的作为封面图
-      const imgArr = table.filter(v => {
-        const txtArr = v.fileName.split('.')
-        const txt = txtArr[txtArr.length - 1]
-        return v.type === 'img' && fileImgArr.includes(txt.toLowerCase())
-      })
-
-      let thumb = ''
-      let thumbPc = ''
-
-      if (imgArr && imgArr.length) {
-        thumb = imgArr[0].thumb
-        thumbPc = imgArr[0].filePath
-      }
+      // const imgArr = table.filter(v => {
+      //   const txtArr = v.fileName.split('.')
+      //   const txt = txtArr[txtArr.length - 1]
+      //   return v.type === 'img' && fileImgArr.includes(txt.toLowerCase())
+      // })
+
+      // let thumb = ''
+      // let thumbPc = ''
+
+      // if (imgArr && imgArr.length) {
+      //   thumb = imgArr[0].thumb
+      //   thumbPc = imgArr[0].filePath
+      // }
 
       let idRes = nowSta.id === 'null' ? null : Number(nowSta.id)
 
@@ -315,8 +316,6 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
 
       const obj = {
         ...values,
-        thumb,
-        thumbPc,
         rtf: JSON.stringify(rtf.val || ''),
         fileIds,
         fileSet,
@@ -358,6 +357,19 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
           }
         }
 
+        if (objOld.current.thumb !== coverUrl1.thumb) {
+          // 只修改封面图
+          coverUrl1 &&
+            (await API_setThumb({
+              id: objOld.current.id,
+              thumb: coverUrl1.thumb,
+              thumbPc: coverUrl1.thumb
+            }))
+          MessageFu.success(`${staTxt.current}成功`)
+          closeFu()
+          return
+        }
+
         if (flag) return MessageFu.warning('未修改藏品信息')
 
         // -----------藏品编辑模块进来---------------
@@ -380,6 +392,12 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
 
         const res = await API_goodsAdd(obj, idRes ? '编辑' : '新增')
         if (res.code === 0) {
+          coverUrl1 &&
+            (await API_setThumb({
+              id: res.data.id,
+              thumb: coverUrl1.thumb,
+              thumbPc: coverUrl1.thumb
+            }))
           MessageFu.success(nowSta.id === 'null' ? `${staTxt.current}成功` : '编辑成功')
           succFu(res.data, nowSta.id === 'null' ? '新增' : '编辑', staTxt.current as '提交')
           closeFu()
@@ -658,26 +676,6 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
                 </div>
               </div>
 
-              {/* 封面 */}
-              {/* <div className='formRow'>
-              <div className='formLeft'>封面图:</div>
-              <div className='formRight'>
-                <ZupOne
-                  ref={ZupThumbRef}
-                  isLook={false}
-                  fileCheck={false}
-                  size={5}
-                  dirCode='goodsAdd'
-                  myUrl='cms/goods/upload'
-                  format={['image/jpeg', 'image/png']}
-                  formatTxt='png、jpg和jpeg'
-                  checkTxt='请上传封面图!'
-                  upTxt='最多1张'
-                  myType='thumb'
-                />
-              </div>
-            </div> */}
-
               <div className='B3Nrow'>
                 <Form.Item label='完残情况' name='torn'>
                   <TextArea maxLength={500} showCount placeholder='请输入内容' />
@@ -953,8 +951,24 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
           <div className='B3Nbox B3Nbox1' hidden={tabTxt !== '附件信息'}>
             <div className='B3Ntit'>
               <div className='B3Ntitll'>
-                <span>附件类型为图像并且格式为图片的第一份数据为封面图</span>
+                {/* 封面 */}
+                <div className='B3NtitLeft'>封面图:</div>
+                <div className='B3NtitRight'>
+                  <ZupOne
+                    ref={ZupThumbRef}
+                    isLook={false}
+                    fileCheck={false}
+                    dirCode='goodsAdd'
+                    myUrl='cms/goods/upload'
+                    format={['image/jpeg', 'image/png']}
+                    formatTxt='png、jpg和jpeg'
+                    checkTxt='请上传封面图!'
+                    upTxt='最多1张'
+                    myType='thumb'
+                  />
+                </div>
               </div>
+
               <Z3upFiles
                 max={10000}
                 isLook={false}

+ 5 - 4
src/pages/C_goodsManage/C1register/C1look/index.tsx

@@ -13,7 +13,7 @@ import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
 import X3auditInfo from '@/pages/X_stock/X3auditInfo'
 import { Button } from 'antd'
 import { statusObj } from '@/utils/tableData'
-import history, { openGoodsInfoFu } from '@/utils/history'
+import history, { openGoodsInfoFu, useQuery } from '@/utils/history'
 import Y11com from '@/pages/Y_goodsDetails/Y1cathet/Y11com'
 import Y33com from '@/pages/Y_goodsDetails/Y1cathet/Y33com'
 import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
@@ -27,6 +27,7 @@ import { C22infoBtnFu } from '../../C22goodEdit/data'
 import { EXPORT_WORD_ENUM } from '@/utils/exportTemplates'
 function C1look() {
   const { key, id } = useParams<any>()
+  const query = useQuery()
   // key: 3审批 4查看
   // 滚到顶部
   const sollrDom = useRef<HTMLDivElement>(null)
@@ -43,13 +44,13 @@ function C1look() {
       const data = res.data
       setTopInfo(data)
       if (data.goodsIds) {
-        const res2 = await API_goodsInfo(data.goodsIds, 17)
+        const res2 = await API_goodsInfo(data.goodsIds, Number(query.mId || 310))
         if (res2.code === 0) {
           setInfo(res2.data)
         }
       }
     }
-  }, [id])
+  }, [id, query.mId])
 
   useEffect(() => {
     getInfoFu()
@@ -183,7 +184,7 @@ function C1look() {
           藏品详情
           <div className='C1TitRR'>
             更多操作请在详情页中进行
-            <Button type='primary' onClick={() => openGoodsInfoFu(Number(topInfo.goodsIds), 17)}>
+            <Button type='primary' onClick={() => openGoodsInfoFu(Number(topInfo.goodsIds), 310)}>
               查看详情
             </Button>
           </div>

+ 7 - 8
src/pages/C_goodsManage/C21wealth/C21edit/index.tsx

@@ -242,12 +242,7 @@ function C21edit() {
               {['3', '4'].includes(key) ? null : (
                 <MyPopconfirm
                   txtK='删除'
-                  onConfirm={() =>
-                    setTopInfo({
-                      ...topInfo,
-                      goods: topInfo.goods.filter(v => v.id !== item.id)
-                    })
-                  }
+                  onConfirm={() => setSnaps(snaps.filter(v => v.id !== item.id))}
                 />
               )}
             </>
@@ -255,7 +250,7 @@ function C21edit() {
         }
       }
     ]
-  }, [key, topInfo])
+  }, [key, snaps])
 
   // 点击新增
   const [nowSta, setNowSta] = useState({ key: '', id: '' })
@@ -479,7 +474,11 @@ function C21edit() {
           <div className='D4Tit2'>
             <div className='D4Tit2ll'>藏品清单</div>
             <div className='D4Tit2rr'>
-              <Button type='primary' onClick={() => downloadBatchZip(snaps.map(i => i.id))}>
+              <Button
+                disabled={!snaps.length}
+                type='primary'
+                onClick={() => downloadBatchZip(snaps.map(i => i.id))}
+              >
                 下载所有资源
               </Button>
               {['3', '4'].includes(key) ? null : (

+ 1 - 1
src/pages/C_goodsManage/C22goodEdit/index.tsx

@@ -114,7 +114,7 @@ function C22goodEdit() {
 
   // 点击 查看4 审批3
   const tableBtnFu = useCallback((id: number, key: '3' | '4', type: string) => {
-    let url = type === 'DJ' ? `/register_edit/${key}/${id}` : `/goodEdit_edit/${key}/${id}`
+    let url = type === 'DJ' ? `/register_edit/${key}/${id}?mId=350` : `/goodEdit_edit/${key}/${id}`
     history.push(url)
   }, [])
 

+ 4 - 1
src/pages/D_storeManage/D3staff/D3edit/index.tsx

@@ -522,7 +522,10 @@ function C21edit() {
 
       {/* 底部按钮 */}
       <div className='D4btn'>
-        {pageDisabled && topInfo.audits && topInfo.audits.length ? (
+        {['3', '4'].includes(key) &&
+        topInfo.audits &&
+        topInfo.audits.length &&
+        [2, 3, 4].includes(topInfo.status) ? (
           <Button type='primary' onClick={() => setAuditsShow(true)}>
             申请记录
           </Button>

+ 3 - 0
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -747,6 +747,9 @@ function D4edit() {
           menuId={7}
           orderId={topInfo.id}
           nowSta={nowSta}
+          checkboxProps={item => ({
+            disabled: ![0, 4].includes(item.statusStorage)
+          })}
           closeFu={() => setNowSta({ key: '', id: '' })}
           dataResFu={data => {
             const dataTemp = [...data]

+ 2 - 7
src/pages/D_storeManage/D7check/components/StocktakingModal/index.tsx

@@ -3,7 +3,7 @@ import { D7_APIGoodList } from '@/store/action/D7check'
 import { MessageFu } from '@/utils/message'
 import { InputNumber, Modal, Radio } from 'antd'
 import { FC, useCallback, useEffect, useState } from 'react'
-import { D7CEHCK_COLLECTION_RESULT_OPTIONS } from '../../constants'
+import { D7CEHCK_COLLECTION_RESULT_OBJ } from '../../constants'
 import { D7CHECK_COLLECTION_RESULT_ENUM } from '../../types'
 import { isNumber } from 'lodash'
 
@@ -151,12 +151,7 @@ export const StocktakingModal: FC<StocktakingModalProps> = ({
             ['txt', '藏品编号', 'num'],
             ['txt', '藏品名称', 'name'],
             ['ping', '数量', 'pcs', 'pcsUnit'],
-            [
-              'txtChange',
-              '库存状态',
-              'statusStorage',
-              D7CEHCK_COLLECTION_RESULT_OPTIONS.map(v => v.label)
-            ]
+            ['txtChange', '库存状态', 'statusStorage', D7CEHCK_COLLECTION_RESULT_OBJ]
           ]}
           list={list}
         />

+ 6 - 0
src/pages/D_storeManage/D7check/constants.tsx

@@ -68,6 +68,12 @@ export const D7CEHCK_COLLECTION_RESULT_OPTIONS = [
   }
 ]
 
+export const D7CEHCK_COLLECTION_RESULT_OBJ = {
+  [D7CHECK_COLLECTION_RESULT_ENUM.PENDING]: '待盘点',
+  [D7CHECK_COLLECTION_RESULT_ENUM.IN]: '在库',
+  [D7CHECK_COLLECTION_RESULT_ENUM.OUT]: '不在库'
+}
+
 export const D7CHECK_COLLECTION_COLUMNS = [
   ['txt', '登记号类型', 'numName'],
   ['txt', '编号', 'num'],

+ 5 - 2
src/pages/F_exhibition/F1exhibition/F1edit/index.tsx

@@ -221,7 +221,7 @@ function F1edit() {
     const res = await F1_APIdel(id)
     if (res.code === 0) {
       MessageFu.success('删除成功')
-      history.push('/exhibiton')
+      history.push('/exhibition')
     }
   }, [id])
 
@@ -255,7 +255,10 @@ function F1edit() {
           snap: JSON.stringify({
             ...v,
             cusForm: tableValues
-          })
+          }),
+          returnDate: tableValues[`${v.id}-returnDate`]
+            ? tableValues[`${v.id}-returnDate`].format('YYYY-MM-DD')
+            : undefined
         }))
       }
 

+ 1 - 1
src/pages/Y_goodsDetails/Y1cathet/Y33com.tsx

@@ -319,7 +319,7 @@ function Y33com({ isLook, sId, info, setImgCover }: Props) {
           ) : null}
         </>
       ) : (
-        <div className='Y33no'>没有权限</div>
+        <div className='Y33no'>抱歉,您暂无权限访问此页面</div>
       )}
     </div>
   )

+ 1 - 10
src/pages/Y_goodsDetails/Y2look/index.tsx

@@ -243,7 +243,7 @@ function Y2look() {
           ))}
         </div>
         <div className='Y2toprr'>
-          {info.display === 1 ? (
+          {info.display === 1 && info.statusStorage !== 7 ? (
             <>
               <Button
                 type='primary'
@@ -253,11 +253,6 @@ function Y2look() {
                 {info.isFocus === 1 ? '取消' : ''}关注
               </Button>
               &emsp;
-            </>
-          ) : null}
-
-          {info.display === 1 ? (
-            <>
               {goodsInfoPower.includes('goodsBtn1') ? (
                 <>
                   <Button type='primary' onClick={handleExport}>
@@ -266,7 +261,6 @@ function Y2look() {
                   &emsp;
                 </>
               ) : null}
-
               {goodsInfoPower.includes('goodsBtn2') ? (
                 <>
                   <Button type='primary' onClick={handleExport2}>
@@ -275,7 +269,6 @@ function Y2look() {
                   &emsp;
                 </>
               ) : null}
-
               {goodsInfoPower.includes('goodsBtn3') ? (
                 <>
                   <Dropdown menu={{ items: items1 }} placement='bottom' arrow>
@@ -284,7 +277,6 @@ function Y2look() {
                   &emsp;
                 </>
               ) : null}
-
               {goodsInfoPower.includes('goodsBtn4') ? (
                 <>
                   <Dropdown menu={{ items: items2 }} placement='bottom' arrow>
@@ -293,7 +285,6 @@ function Y2look() {
                   &emsp;
                 </>
               ) : null}
-
               {goodsInfoPower.includes('goodsBtn5') ? (
                 <>
                   <Dropdown menu={{ items: items3 }} placement='bottom' arrow>

+ 7 - 0
src/store/action/C1ledger.ts

@@ -71,3 +71,10 @@ export const API_getGoodsStorage = () => {
 export const API_getGoodsLedger = (goodId: number | string) => {
   return http.get(`cms/print/goods/ledger/${goodId}`)
 }
+
+/**
+ * 设置封面图
+ */
+export const API_setThumb = (data: any) => {
+  return http.post('cms/goods/updateThumb', data)
+}

+ 5 - 0
src/utils/exportTemplates.ts

@@ -630,6 +630,11 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
         rtf: removeHtmlTags(rtf),
         imgs: stack
       }
+
+      if (type === EXPORT_WORD_ENUM.COLLECTION_CURRENT_STATUS) {
+        temp.goodsNum = temp.numName === '藏品总登记号' ? temp.goodsNum : ``
+      }
+
       break
     case EXPORT_WORD_ENUM.COLLECTION_LIST:
       temp.goods.push({

+ 2 - 0
src/utils/select.ts

@@ -84,6 +84,8 @@ export const selectObj = {
     { value: '5', label: '馆内展览' }
   ],
   流程申请状态: [
+    { value: 1, label: '草稿' },
+    { value: 6, label: '待提交' },
     { value: 2, label: '待审批' },
     { value: 3, label: '审批不通过' },
     { value: 4, label: '已完成' }