shaogen1995 před 2 dny
rodič
revize
7b777d506e

+ 6 - 1
src/assets/styles/base.css

@@ -180,7 +180,12 @@ textarea {
 .ant-table-body .ant-table-cell {
   border-color: #ccc !important;
 }
-.editMain {
+#editBox {
+  font-size: 16px;
+  background-color: var(--boxBcaColor);
+  border-radius: 10px;
+}
+#editBox .editMain {
   width: 100%;
   height: calc(100% - 60px);
   overflow-y: auto;

+ 9 - 5
src/assets/styles/base.less

@@ -312,9 +312,13 @@ textarea {
 //     stroke: var(--themeColor) !important;
 //   }
 // }
-
-.editMain {
-  width: 100%;
-  height: calc(100% - 60px);
-  overflow-y: auto;
+#editBox {
+  font-size: 16px;
+  background-color: var(--boxBcaColor);
+  border-radius: 10px;
+  .editMain {
+    width: 100%;
+    height: calc(100% - 60px);
+    overflow-y: auto;
+  }
 }

+ 3 - 0
src/pages/Benter/B1collect/B1edit/index.module.scss

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

+ 40 - 0
src/pages/Benter/B1collect/B1edit/index.tsx

@@ -0,0 +1,40 @@
+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 { B1API_obj } from '@/store/action/Benter/B1collect'
+import SonClueList from '@/pages/Zother/SonClueList'
+
+const rowArr = rowArrTemp('征集')
+
+function B1edit() {
+  return (
+    <InfoProvider>
+      <div className={styles.B1edit} id='editBox'>
+        <div className='editMain'>
+          {/* 顶部 */}
+          <EditTop
+            pageTxt='藏品征集'
+            rowArr={rowArr}
+            APIobj={B1API_obj}
+            fileUpInfo={{ myUrl: 'cms/order/collect/upload', dirCode: 'collect' }}
+          />
+
+          {/* 线索清单 */}
+          <SonClueList
+            fileUpInfo={{ myUrl: 'cms/order/collect/son/upload', dirCode: 'collectClues' }}
+          />
+
+          {/* 底部按钮 */}
+          <EditBtn path='/collect' APIobj={B1API_obj} checkListTxt='线索' />
+        </div>
+      </div>
+    </InfoProvider>
+  )
+}
+
+const MemoB1edit = React.memo(B1edit)
+
+export default MemoB1edit

+ 4 - 4
src/pages/Benter/B1collect/index.module.scss

@@ -1,4 +1,4 @@
-.B1collect {
-  :global {
-  }
-}
+// .B1collect {
+//   :global {
+//   }
+// }

+ 24 - 0
src/pages/Benter/B1collect/index.tsx

@@ -1,9 +1,33 @@
 import React from 'react'
 import styles from './index.module.scss'
+import { baseFormData, topSearch } from '@/pages/Zother/data'
+import { useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import TableList from '@/pages/Zother/TableList'
+import { B1_APIgetList } from '@/store/action/Benter/B1collect'
+import { baseTableC } from '@/utils/tableData'
+
+const B1search = topSearch('征集')
+
+const B1baseFormData = baseFormData()
+
 function B1collect() {
+  // 从仓库拿数据
+  const tableInfo = useSelector((state: RootState) => state.B1collect.tableInfo)
+
   return (
     <div className={styles.B1collect}>
       <div className='pageTitle'>藏品征集</div>
+
+      <TableList
+        baseFormData={B1baseFormData}
+        getListAPI={B1_APIgetList}
+        pageKey='collect'
+        tableInfo={tableInfo}
+        columnsTemp={baseTableC('征集')}
+        yHeight={585}
+        searchDom={B1search}
+      />
     </div>
   )
 }

+ 4 - 6
src/pages/Dmanage/D1register/D1edit/index.module.scss

@@ -1,6 +1,4 @@
-.D1edit {
-  font-size: 16px;
-  background-color: var(--boxBcaColor);
-  border-radius: 10px;
-  // :global {}
-}
+// .D1edit {
+
+//   // :global {}
+// }

+ 10 - 3
src/pages/Dmanage/D1register/D1edit/index.tsx

@@ -12,13 +12,20 @@ const rowArr = rowArrTemp('登记')
 function D1edit() {
   return (
     <InfoProvider>
-      <div className={styles.D1edit}>
+      <div className={styles.D1edit} id='editBox'>
         <div className='editMain'>
           {/* 顶部 */}
-          <EditTop pageTxt='藏品登记' rowArr={rowArr} APIobj={D1API_obj} />
+          <EditTop
+            pageTxt='藏品登记'
+            rowArr={rowArr}
+            APIobj={D1API_obj}
+            fileUpInfo={{ myUrl: 'cms/order/register/upload', dirCode: 'register' }}
+          />
 
           {/* 藏品清单 */}
-          <SonGoodsList />
+          <SonGoodsList
+            fileUpInfo={{ myUrl: 'cms/order/register/son/upload', dirCode: 'registerGoods' }}
+          />
 
           {/* 底部按钮 */}
           <EditBtn path='/register' APIobj={D1API_obj} />

+ 2 - 2
src/pages/Dmanage/D1register/index.tsx

@@ -2,10 +2,10 @@ import React from 'react'
 import styles from './index.module.scss'
 import { useSelector } from 'react-redux'
 import { RootState } from '@/store'
-import { D1tableC } from '@/utils/tableData'
 import { D1_APIgetList } from '@/store/action/Dmanage/D1register'
 import TableList from '@/pages/Zother/TableList'
 import { baseFormData, topSearch } from '@/pages/Zother/data'
+import { baseTableC } from '@/utils/tableData'
 
 const D1search = topSearch('登记')
 
@@ -24,7 +24,7 @@ function D1register() {
         getListAPI={D1_APIgetList}
         pageKey='register'
         tableInfo={tableInfo}
-        columnsTemp={D1tableC}
+        columnsTemp={baseTableC('登记')}
         yHeight={585}
         searchDom={D1search}
       />

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

@@ -318,6 +318,12 @@ export default tabLeftArr
 // 这里的id要和tab栏的id相同,不然没有权限进入页面
 export const routerSon: RouterTypeRow[] = [
   {
+    id: 210,
+    name: '藏品征集-详情页',
+    path: '/collect_edit/:key/:id',
+    Com: React.lazy(() => import('../Benter/B1collect/B1edit'))
+  },
+  {
     id: 410,
     name: '藏品登记-详情页',
     path: '/register_edit/:key/:id',

+ 97 - 0
src/pages/Zother/AddClues/index.module.scss

@@ -0,0 +1,97 @@
+.AddClues {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 99;
+  background-color: rgba(0, 0, 0, 0.8);
+  padding: 50px 100px;
+  :global {
+    .ACbox {
+      width: 100%;
+      height: 100%;
+      background-color: #fff;
+      border-radius: 10px;
+      padding: 20px 20px 0;
+      .AC1 {
+        font-weight: 700;
+        padding-bottom: 10px;
+        border-bottom: 1px solid #ccc;
+      }
+      .ant-form {
+        height: calc(100% - 40px);
+      }
+      .ACmain {
+        width: 100%;
+        height: 100%;
+        padding-right: 150px;
+        display: flex;
+        flex-wrap: wrap;
+        align-content: start;
+        padding-top: 10px;
+        justify-content: space-between;
+        overflow-y: auto;
+        padding-bottom: 30px;
+        .ant-form-item {
+          width: 48%;
+          .ant-form-item-label {
+            font-weight: 700;
+            width: 110px;
+          }
+          .ant-form-item-control {
+            width: 100%;
+            .ant-picker,
+            .ant-input-number {
+              width: 100%;
+            }
+          }
+        }
+        .ant-form-itemFull {
+          width: 100%;
+        }
+        .ACrow {
+          display: flex;
+          width: 48%;
+          .ACrow1 {
+            width: 70%;
+          }
+          .ACrow2 {
+            width: 30%;
+            .ant-form-item-label {
+              display: none;
+            }
+          }
+        }
+
+        .ACfull {
+          width: 100%;
+          display: flex;
+          margin-bottom: 24px;
+          .ACfullll {
+            width: 110px;
+            position: relative;
+            top: 4px;
+            text-align: right;
+            font-weight: 700;
+          }
+          .ACfullrr {
+            width: calc(100% - 110px);
+          }
+        }
+        .ACbtnok {
+          width: auto;
+          position: absolute;
+          top: 50%;
+          transform: translateY(-50%);
+          right: 165px;
+          .ant-btn {
+            width: 74px;
+            margin: 24px 0;
+            display: block;
+          }
+        }
+      }
+    }
+  }
+}

+ 230 - 0
src/pages/Zother/AddClues/index.tsx

@@ -0,0 +1,230 @@
+import React, { useCallback, useEffect, useRef } from 'react'
+import styles from './index.module.scss'
+import { GoodsType } from '../SonGoodsList/data'
+import { FileUpInfoType } from '../data'
+import { Button, Cascader, Form, FormInstance, Input, Select } from 'antd'
+import { addZiSelectChArr, cascaderChArr } from '../AddGoods'
+import { API_getFileListByIds } from '@/store/action/Cledger/C4file'
+import { MessageFu } from '@/utils/message'
+import TextArea from 'antd/es/input/TextArea'
+import { getDictFu, selectObj } from '@/utils/dataChange'
+import Z3upFilesRef from '@/components/Z3upFilesRef'
+import MyPopconfirm from '@/components/MyPopconfirm'
+
+type Props = {
+  info: GoodsType
+  closeFu: () => void
+  succFu: (val: '新增' | '编辑', info: GoodsType) => void
+  moduleId: number
+  // 上传附件的信息
+  fileUpInfo: FileUpInfoType
+  isLook: boolean
+}
+
+function AddClues({ closeFu, succFu, moduleId, info, fileUpInfo, isLook }: Props) {
+  // 设置表单ref
+  const FormBoxRef = useRef<FormInstance>(null)
+
+  // 附件模块的ref
+  const fileRef = useRef<any>(null)
+
+  // 编辑进来获取详情
+  const getInfo = useCallback(
+    async (id: number) => {
+      const obj: any = { ...info }
+
+      cascaderChArr.forEach(v => {
+        if (obj[v] === '0') obj[v] = null
+        else if (obj[v]) {
+          obj[v] = obj[v].split(',')
+        }
+      })
+
+      addZiSelectChArr.forEach(v => {
+        if (!obj[v]) obj[v] = null
+      })
+
+      FormBoxRef.current?.setFieldsValue(obj)
+
+      // 设置附件
+      if (obj.fileIds) {
+        const fileRes = await API_getFileListByIds(obj.fileIds.split(','))
+        if (fileRes.code === 0) {
+          fileRef.current?.sonSetListFu(fileRes.data || [])
+        }
+      }
+    },
+    [info]
+  )
+
+  useEffect(() => {
+    if (info.id > 0) getInfo(info.id)
+  }, [getInfo, info.id])
+
+  // 没有通过校验
+  const onFinishFailed = useCallback(() => {}, [])
+
+  // 通过校验点击确定
+  const onFinish = useCallback(
+    async (values: any) => {
+      // 获取附件
+      const { list: flieList, thumb, thumbPc } = fileRef.current?.sonResListFu()
+
+      const obj = {
+        ...values,
+        id: info.id > 0 ? info.id : Date.now(),
+        fileIds: flieList.map((v: any) => v.id).join(','),
+        thumb,
+        thumbPc,
+        isNew: info.id > 0 ? info.isNew : true
+      }
+      for (const k in obj) {
+        if (obj[k] === null || obj[k] === undefined) obj[k] = ''
+      }
+
+      // 级联的数据转换成字符串
+      cascaderChArr.forEach(v => {
+        if (values[v]) obj[v] = values[v].join(',')
+      })
+      // if (1 + 1 === 2) {
+      //   console.log(123, obj)
+      //   return
+      // }
+
+      MessageFu.success(info.id > 0 ? '编辑成功' : '新增成功')
+      succFu(info.id > 0 ? '编辑' : '新增', obj)
+      closeFu()
+    },
+    [closeFu, info.id, info.isNew, succFu]
+  )
+
+  return (
+    <div className={styles.AddClues}>
+      <div className='ACbox'>
+        <div className='AC1'>{isLook ? '线索查看' : info.id > 0 ? '线索编辑' : '线索新增'}</div>
+
+        <Form
+          scrollToFirstError={true}
+          ref={FormBoxRef}
+          name='basic'
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete='off'
+        >
+          <div className='ACmain'>
+            <Form.Item
+              label='线索名称'
+              name='name'
+              rules={[{ required: true, message: '请输入' }]}
+              getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
+            >
+              <Input readOnly={isLook} placeholder='请输入' showCount maxLength={30} />
+            </Form.Item>
+
+            <Form.Item
+              label='线索编号'
+              name='num'
+              getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
+            >
+              <Input
+                readOnly={isLook}
+                placeholder={isLook ? '(空)' : '请输入'}
+                showCount
+                maxLength={30}
+              />
+            </Form.Item>
+
+            <Form.Item label='联系方式' name='phone'>
+              <Input
+                readOnly={isLook}
+                placeholder={isLook ? '(空)' : '请输入'}
+                showCount
+                maxLength={30}
+              />
+            </Form.Item>
+
+            <Form.Item label='完残程度' name='tornLevel'>
+              <Select
+                disabled={isLook}
+                allowClear={true}
+                placeholder={isLook ? '(空)' : '请输入'}
+                options={selectObj['完残程度']}
+              />
+            </Form.Item>
+
+            <Form.Item label='初步藏品类别' name='typeDictId'>
+              <Cascader
+                disabled={isLook}
+                changeOnSelect
+                options={getDictFu('藏品类别')}
+                placeholder={isLook ? '(空)' : '请输入'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                allowClear={true}
+                showSearch={true}
+              />
+            </Form.Item>
+
+            <Form.Item label='初步藏品年代' name='ageDictId'>
+              <Cascader
+                disabled={isLook}
+                changeOnSelect
+                options={getDictFu('藏品年代')}
+                placeholder={isLook ? '(空)' : '请输入'}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                allowClear={true}
+                showSearch={true}
+              />
+            </Form.Item>
+
+            <Form.Item label='线索简介' name='intro' className='ant-form-itemFull'>
+              <TextArea
+                readOnly={isLook}
+                placeholder={isLook ? '(空)' : '请输入'}
+                showCount
+                maxLength={500}
+              />
+            </Form.Item>
+
+            <Form.Item label='线索意向' name='intention' className='ant-form-itemFull'>
+              <TextArea
+                readOnly={isLook}
+                placeholder={isLook ? '(空)' : '请输入'}
+                showCount
+                maxLength={500}
+              />
+            </Form.Item>
+
+            <Form.Item label='备注' name='remark' className='ant-form-itemFull'>
+              <TextArea
+                readOnly={isLook}
+                placeholder={isLook ? '(空)' : '请输入'}
+                showCount
+                maxLength={500}
+              />
+            </Form.Item>
+
+            {/* 附件 */}
+            <div className='ACfull'>
+              <div className='ACfullll'>附件:</div>
+              <div className='ACfullrr'>
+                <Z3upFilesRef ref={fileRef} isLook={isLook} moduleId={moduleId} {...fileUpInfo} />
+              </div>
+            </div>
+
+            {/* 确定和取消按钮 */}
+            <Form.Item className='ACbtnok'>
+              <Button type='primary' htmlType='submit'>
+                提交
+              </Button>
+              <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+            </Form.Item>
+          </div>
+        </Form>
+      </div>
+    </div>
+  )
+}
+
+const MemoAddClues = React.memo(AddClues)
+
+export default MemoAddClues

+ 43 - 49
src/pages/Zother/AddGoods/index.tsx

@@ -14,6 +14,7 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import { API_getGoodsInfo } from '@/store/action/Cledger/C1ledger'
 import { MessageFu } from '@/utils/message'
 import { API_getFileListByIds } from '@/store/action/Cledger/C4file'
+import { FileUpInfoType } from '../data'
 
 // 级联的数据转换成字符串
 export const cascaderChArr = [
@@ -40,13 +41,15 @@ type Props = {
   info: GoodsType
   closeFu: () => void
   isEdit: boolean //藏品编辑-模块
-  editSnap?: GoodsType //藏品编辑-属于新增还是编辑
   succFu: (val: '新增' | '编辑', info: GoodsType) => void
   moduleId: number
+  // 上传附件的信息
+  fileUpInfo: FileUpInfoType
   APIsave: any
 }
 
-function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info, APIsave }: Props) {
+function AddGoods({ closeFu, succFu, isEdit, moduleId, info, APIsave, fileUpInfo }: Props) {
+  // 获取标签 树结构
   const E1tree = useSelector((state: RootState) => state.E1tag.treeData)
 
   // 设置表单ref
@@ -62,42 +65,39 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info, APIsave }
   const objOld = useRef({} as GoodsType)
 
   // 编辑进来获取详情
-  const getInfo = useCallback(
-    async (id: number) => {
-      const res = await API_getGoodsInfo(id)
-      if (res.code === 0) {
-        // 藏品编辑信息保存
-        objOld.current = { ...res.data }
-
-        const obj = editSnap && editSnap.id ? { ...editSnap } : { ...res.data }
-        // makeDate inGoodYear 2个日期需要格式处理一下
-        if (obj.makeDate) obj.makeDate = dayjs(obj.makeDate)
-        if (obj.inGoodYear) obj.inGoodYear = dayjs(obj.inGoodYear)
-
-        cascaderChArr.forEach(v => {
-          if (obj[v] === '0') obj[v] = null
-          else if (obj[v]) {
-            obj[v] = obj[v].split(',')
-          }
-        })
-
-        addZiSelectChArr.forEach(v => {
-          if (!obj[v]) obj[v] = null
-        })
-
-        FormBoxRef.current?.setFieldsValue(obj)
-
-        // 设置附件
-        if (obj.fileIds) {
-          const fileRes = await API_getFileListByIds(obj.fileIds.split(','))
-          if (fileRes.code === 0) {
-            fileRef.current?.sonSetListFu(fileRes.data || [])
-          }
+  const getInfo = useCallback(async (id: number) => {
+    const res = await API_getGoodsInfo(id)
+    if (res.code === 0) {
+      // 藏品编辑信息保存
+      objOld.current = { ...res.data }
+
+      const obj = { ...res.data }
+      // makeDate inGoodYear 2个日期需要格式处理一下
+      if (obj.makeDate) obj.makeDate = dayjs(obj.makeDate)
+      if (obj.inGoodYear) obj.inGoodYear = dayjs(obj.inGoodYear)
+
+      cascaderChArr.forEach(v => {
+        if (obj[v] === '0') obj[v] = null
+        else if (obj[v]) {
+          obj[v] = obj[v].split(',')
+        }
+      })
+
+      addZiSelectChArr.forEach(v => {
+        if (!obj[v]) obj[v] = null
+      })
+
+      FormBoxRef.current?.setFieldsValue(obj)
+
+      // 设置附件
+      if (obj.fileIds) {
+        const fileRes = await API_getFileListByIds(obj.fileIds.split(','))
+        if (fileRes.code === 0) {
+          fileRef.current?.sonSetListFu(fileRes.data || [])
         }
       }
-    },
-    [editSnap]
-  )
+    }
+  }, [])
 
   useEffect(() => {
     if (info.id > 0) getInfo(info.id)
@@ -144,7 +144,7 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info, APIsave }
       // }
       const res = await APIsave(obj)
       if (res.code === 0) {
-        MessageFu.warning(info.id > 0 ? '编辑成功' : '新增成功')
+        MessageFu.success(info.id > 0 ? '编辑成功' : '新增成功')
         succFu(info.id > 0 ? '编辑' : '新增', res.data)
         closeFu()
       }
@@ -155,7 +155,7 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info, APIsave }
   return (
     <div className={styles.AddGoods}>
       <div className='AGbox'>
-        <div className='AG1'>{isEdit ? '藏品修改' : editSnap ? '藏品编辑' : '藏品新增'}</div>
+        <div className='AG1'>{isEdit ? '藏品修改' : info.id > 0 ? '藏品编辑' : '藏品新增'}</div>
 
         <Form
           scrollToFirstError={true}
@@ -177,7 +177,7 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info, APIsave }
               rules={[{ required: true, message: '请输入' }]}
               getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
             >
-              <Input placeholder='请输入' showCount maxLength={20} />
+              <Input placeholder='请输入' showCount maxLength={30} />
             </Form.Item>
 
             <Form.Item label='藏品标签' name='tagDictId'>
@@ -208,7 +208,7 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info, APIsave }
               rules={[{ required: true, message: '请输入' }]}
               getValueFromEvent={e => e.target.value.trim()}
             >
-              <Input placeholder='请输入' showCount maxLength={20} />
+              <Input placeholder='请输入' showCount maxLength={30} />
             </Form.Item>
 
             {/* 横线 */}
@@ -220,11 +220,11 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info, APIsave }
               rules={[{ required: true, message: '请输入' }]}
               getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
             >
-              <Input placeholder='请输入' showCount maxLength={20} />
+              <Input placeholder='请输入' showCount maxLength={30} />
             </Form.Item>
 
             <Form.Item label='藏品原名' name='oldName'>
-              <Input placeholder='请输入' showCount maxLength={20} />
+              <Input placeholder='请输入' showCount maxLength={30} />
             </Form.Item>
 
             <Form.Item label='藏品级别' name='level'>
@@ -396,13 +396,7 @@ function AddGoods({ closeFu, succFu, isEdit, editSnap, moduleId, info, APIsave }
             <div className='AGfull'>
               <div className='AGfullll'>附件:</div>
               <div className='AGfullrr'>
-                <Z3upFilesRef
-                  ref={fileRef}
-                  oneIsCover={true}
-                  moduleId={moduleId}
-                  dirCode='registerGoods'
-                  myUrl='cms/order/register/son/upload'
-                />
+                <Z3upFilesRef ref={fileRef} oneIsCover={true} moduleId={moduleId} {...fileUpInfo} />
               </div>
             </div>
             {/* 横线 */}

+ 2 - 0
src/pages/Zother/AuditList/index.module.scss

@@ -8,6 +8,7 @@
   background-color: rgba(0, 0, 0, 0.6);
   padding: 50px 80px;
   border-radius: 10px;
+  overflow-y: auto;
   :global {
     .ALbox {
       width: 100%;
@@ -15,6 +16,7 @@
       border-radius: 10px;
       padding: 20px;
       background-color: var(--boxBcaColor);
+      min-height: 790px;
       .ALtit {
         margin-bottom: 24px;
         border-bottom: 1px solid #ccc;

+ 1 - 1
src/pages/Zother/AuditList/index.tsx

@@ -39,9 +39,9 @@ function AuditList({ list, closeFu }: Props) {
           <div>申请记录</div>
           <Button onClick={closeFu}>关闭</Button>
         </div>
-
         {/* 表格 */}
         <MyTable
+          yHeight={650}
           classKey='AuditListTable'
           list={list}
           columnsTemp={[

+ 30 - 10
src/pages/Zother/EditBtn/index.tsx

@@ -52,13 +52,19 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
         const obj = {
           ...info,
           fileIds: fileIdsResFu(info.files),
-          goodIds: snaps.map(v => v.id).join(','),
+          goodIds: snaps
+            .filter(c => !c.isNew)
+            .map(v => v.id)
+            .join(','),
           delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
           snaps: snaps.map(v => ({
-            goodsId: v.id,
+            goodsId: v.isNew ? null : v.id,
             id: v.id2 ? v.id2 : null,
             orderId: info.id,
-            snap: JSON.stringify(v)
+            snap: JSON.stringify({
+              ...v,
+              id: v.isNew ? null : v.id
+            })
           }))
         }
 
@@ -90,12 +96,24 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
           }
         } else if (val === '发起') {
           if (!info.num) {
-            editPageToTopFu()
-            return MessageFu.warning('请输入申请编号')
+            let txt = ''
+            if (key !== '2') {
+              txt = ',已为您跳转到编辑页面'
+              history.replace(`${path}_edit/2/${info.id}`)
+            }
+            MessageFu.warning('请输入申请编号' + txt)
+
+            return
           }
           if (snaps.length === 0) {
-            // editPageToTopFu()
-            return MessageFu.warning(`请至少添加一个${checkListTxt}`)
+            let txt = ''
+            if (key !== '2') {
+              txt = ',已为您跳转到编辑页面'
+              history.replace(`${path}_edit/2/${info.id}`)
+            }
+
+            MessageFu.warning(`请至少添加一个${checkListTxt}${txt}`)
+            return
           }
           const res = await APIobj['发起'](obj)
           if (res.code === 0) {
@@ -188,13 +206,15 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
           </>
         ) : null}
 
+        {isLook ? <Button onClick={() => backPageFu(path)}>返回</Button> : null}
+      </div>
+
+      <div>
         {isLook && info.audits && info.audits.length ? (
-          <Button onClick={() => backPageFu(path)}>返回</Button>
+          <Button onClick={() => setAuditListShow(true)}>申请记录</Button>
         ) : null}
       </div>
 
-      <div>{isLook ? <Button onClick={() => setAuditListShow(true)}>申请记录</Button> : null}</div>
-
       {auditListShow ? (
         <AuditList list={info.audits} closeFu={() => setAuditListShow(false)} />
       ) : null}

+ 8 - 3
src/pages/Zother/EditTop/index.tsx

@@ -10,6 +10,7 @@ import { useInfo } from '../InfoContext'
 import Z3upFiles from '@/components/Z3upFiles'
 import { API_objType } from '@/store/action/Dmanage/D1register'
 import { editPageToTopFu } from '@/utils/authority'
+import { FileUpInfoType } from '../data'
 
 const pageKeyTxtObj = {
   1: '新增',
@@ -30,9 +31,11 @@ type Props = {
   pageTxt: string
   // api
   APIobj: API_objType
+  // 上传附件的信息
+  fileUpInfo: FileUpInfoType
 }
 
-function EditTop({ rowArr, pageTxt, APIobj }: Props) {
+function EditTop({ rowArr, pageTxt, APIobj, fileUpInfo }: Props) {
   const { info, setInfoFu, setSnapsFu, snapsID2ref, timeKey, auditInfo, setAuditInfoFu } = useInfo()
 
   const { key, id } = useParams<any>()
@@ -65,11 +68,13 @@ function EditTop({ rowArr, pageTxt, APIobj }: Props) {
         // 藏品清单快照信息id对比
         const arrTemp: any = []
         const snapsTemp = data.snaps || []
-        snapsTemp.forEach((v: any) => {
+        snapsTemp.forEach((v: any, i: number) => {
           snapsID2ref.current.push({ goodsId: v.goodsId, id: v.id })
 
           const obj = JSON.parse(v.snap || '{}')
 
+          if (obj.id === null && obj.isNew) obj.id = Date.now() + i
+
           if (obj.id) obj.id2 = v.id
 
           arrTemp.push(obj)
@@ -245,7 +250,7 @@ function EditTop({ rowArr, pageTxt, APIobj }: Props) {
             <div className='Edtop1row Edtop1rowFull'>
               <div className='Edtop1ll'>附件:</div>
               <div className='Edtop1rr'>
-                <Z3upFiles isLook={isLook} dirCode='register' myUrl='cms/order/register/upload' />
+                <Z3upFiles isLook={isLook} {...fileUpInfo} />
               </div>
             </div>
           </div>

+ 25 - 0
src/pages/Zother/SonClueList/index.module.scss

@@ -0,0 +1,25 @@
+.SonClueList {
+  width: 100%;
+  border-top: 1px solid #ccc;
+  :global {
+    .EdTit {
+      padding: 15px;
+      font-weight: 700;
+      font-size: 18px;
+      display: flex;
+      justify-content: space-between;
+      .ant-btn {
+        margin-left: 15px;
+      }
+      .EdTitBtn {
+        pointer-events: none;
+      }
+    }
+    .SonClueListTable {
+      padding: 0 15px 15px;
+      .ant-table-cell {
+        padding: 8px !important;
+      }
+    }
+  }
+}

+ 140 - 0
src/pages/Zother/SonClueList/index.tsx

@@ -0,0 +1,140 @@
+import React, { useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { FileUpInfoType } from '../data'
+import { useInfo } from '../InfoContext'
+import { useParams } from 'react-router-dom'
+import { GoodsType } from '../SonGoodsList/data'
+import { Button } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import MyTable from '@/components/MyTable'
+import { SonClueListTableC } from '@/utils/tableData'
+import AddClues from '../AddClues'
+
+type Props = {
+  // 上传附件的信息
+  fileUpInfo: FileUpInfoType
+}
+
+function SonClueList({ fileUpInfo }: Props) {
+  const { info, snaps, setSnapsFu, delSnapIdsRef, snapsID2ref } = useInfo()
+
+  const { key } = useParams<any>()
+  // key:1 新增 2编辑 3审批 4查看
+
+  const isLook = useMemo(() => {
+    return ['3', '4'].includes(key)
+  }, [key])
+
+  const [openInfo, setOpenInfo] = useState({} as GoodsType)
+
+  const sonLook = useRef(false)
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: GoodsType) => (
+          <>
+            {isLook ? (
+              <Button
+                size='small'
+                type='text'
+                onClick={() => {
+                  sonLook.current = true
+                  setOpenInfo(item)
+                }}
+              >
+                查看
+              </Button>
+            ) : (
+              <>
+                <Button
+                  size='small'
+                  type='text'
+                  onClick={() => {
+                    sonLook.current = false
+                    setOpenInfo(item)
+                  }}
+                >
+                  编辑
+                </Button>
+                <MyPopconfirm
+                  txtK='删除'
+                  onConfirm={() => {
+                    if (item.id2 && !delSnapIdsRef.current.includes(item.id2)) {
+                      delSnapIdsRef.current.push(item.id2)
+                    }
+                    setSnapsFu(snaps.filter(v => v.id !== item.id))
+                  }}
+                />
+              </>
+            )}
+          </>
+        )
+      }
+    ]
+  }, [delSnapIdsRef, isLook, setSnapsFu, snaps])
+
+  return (
+    <div className={styles.SonClueList}>
+      <div className='EdTit'>
+        <div>线索清单</div>
+        {isLook ? (
+          <div></div>
+        ) : (
+          <div>
+            <Button
+              type='primary'
+              onClick={() => {
+                sonLook.current = false
+                setOpenInfo({ id: -1 } as GoodsType)
+              }}
+            >
+              新增
+            </Button>
+          </div>
+        )}
+      </div>
+
+      <div className='SonClueListTable'>
+        <MyTable
+          classKey='SonClueListTable'
+          list={snaps}
+          columnsTemp={SonClueListTableC}
+          lastBtn={tableLastBtn}
+          pagingInfo={false}
+        />
+      </div>
+
+      {openInfo.id ? (
+        <AddClues
+          isLook={sonLook.current}
+          fileUpInfo={fileUpInfo}
+          info={openInfo}
+          closeFu={() => setOpenInfo({} as GoodsType)}
+          moduleId={info.id}
+          succFu={(val: '新增' | '编辑', info: GoodsType) => {
+            let objTemp = { ...info }
+            const id2Obj = snapsID2ref.current.find(c => c.goodsId === objTemp.id)
+            if (id2Obj) objTemp.id2 = id2Obj.id
+            if (val === '新增') {
+              // 是新增
+              setSnapsFu([objTemp, ...snaps])
+            } else {
+              setSnapsFu(
+                snaps.map(v => {
+                  if (v.id === objTemp.id) return objTemp
+                  else return v
+                })
+              )
+            }
+          }}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoSonClueList = React.memo(SonClueList)
+
+export default MemoSonClueList

+ 3 - 0
src/pages/Zother/SonGoodsList/data.ts

@@ -54,4 +54,7 @@ export type GoodsType = {
   tornLevel: string
   typeDictId: string
   updateTime: string
+
+  // 不用录数据库,新增和编辑 用这个区分
+  isNew: boolean
 }

+ 9 - 1
src/pages/Zother/SonGoodsList/index.tsx

@@ -10,7 +10,14 @@ import { D1_APIgoodsSave } from '@/store/action/Dmanage/D1register'
 import { goodsSonTableC } from '@/utils/tableData'
 import { useParams } from 'react-router-dom'
 import { openLink } from '@/utils/history'
-function SonGoodsList() {
+import { FileUpInfoType } from '../data'
+
+type Props = {
+  // 上传附件的信息
+  fileUpInfo: FileUpInfoType
+}
+
+function SonGoodsList({ fileUpInfo }: Props) {
   const { info, snaps, setSnapsFu, delSnapIdsRef, snapsID2ref } = useInfo()
 
   const { key } = useParams<any>()
@@ -81,6 +88,7 @@ function SonGoodsList() {
       </div>
       {openInfo.id ? (
         <AddGoods
+          fileUpInfo={fileUpInfo}
           APIsave={D1_APIgoodsSave}
           info={openInfo}
           isEdit={false}

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

@@ -173,3 +173,9 @@ export type Typetable = {
   updateTime: string
   deptName: string
 }
+
+// 上传的附近路径和文件夹名字
+export type FileUpInfoType = {
+  myUrl: string
+  dirCode: string
+}

+ 38 - 0
src/store/action/Benter/B1collect.ts

@@ -0,0 +1,38 @@
+import { AppDispatch } from '@/store'
+import http from '@/utils/http'
+import { APIbase } from '../layout'
+
+/**
+ * 藏品征集 -获取分页列表
+ */
+export const B1_APIgetList = (data: any): any => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post('cms/order/collect/page', data)
+    if (res.code === 0) {
+      const obj = {
+        list: res.data.records,
+        total: res.data.total
+      }
+
+      dispatch({ type: 'B1/getList', payload: obj })
+    }
+  }
+}
+
+/**
+ * 藏品征集-线索新增|编辑
+ */
+export const B1_APIgoodsSave = (data: any) => {
+  return http.post('cms/order/collect/add', data)
+}
+
+export const B1API_obj = {
+  创建订单: () => APIbase('get', 'cms/order/collect/create'),
+  获取详情: (id: number) => APIbase('get', `cms/order/collect/detail/${id}`),
+  草稿: (data: any) => APIbase('post', `cms/order/collect/saveDraft`, data),
+  发起: (data: any) => APIbase('post', `cms/order/collect/saveApply`, data),
+  重新发起: (id: number) => APIbase('get', `cms/order/collect/reissue/${id}`),
+  审批: (data: any) => APIbase('post', `cms/order/collect/audit`, data),
+  撤回: (id: number) => APIbase('get', `cms/order/collect/revocation/${id}`),
+  删除: (id: number) => APIbase('get', `cms/order/collect/remove/${id}`)
+}

+ 28 - 0
src/store/reducer/Benter/B1collect.ts

@@ -0,0 +1,28 @@
+import { Typetable } from '@/pages/Zother/data'
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as Typetable[],
+    total: 0
+  }
+}
+
+// 定义 action 类型
+type Props = {
+  type: 'B1/getList'
+  payload: { list: Typetable[]; total: number }
+}
+
+// reducer
+export default function Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case 'B1/getList':
+      return { ...state, tableInfo: action.payload }
+
+    default:
+      return state
+  }
+}

+ 2 - 0
src/store/reducer/index.ts

@@ -3,6 +3,7 @@ import { combineReducers } from 'redux'
 
 // 导入 登录 模块的 reducer
 import A0Layout from './layout'
+import B1collect from './Benter/B1collect'
 import D1register from './Dmanage/D1register'
 import E1tag from './Eculture/E1tag'
 
@@ -17,6 +18,7 @@ import I8log from './Isystem/I8log'
 // 合并 reducer
 const rootReducer = combineReducers({
   A0Layout,
+  B1collect,
   D1register,
   E1tag,
 

+ 22 - 11
src/utils/tableData.ts

@@ -16,20 +16,31 @@
 
 import { selectObj } from './dataChange'
 
-// const statusObj: any = {}
-// selectObj['订单审批状态'].forEach(v => {
-//   statusObj[v.value] = v.label
-// })
+// 列表页面(大部分相同和复用的)
+export const baseTableC = (val: string) => {
+  return [
+    ['dateRes', `${val}日期`, 'date'],
+    ['txt', '申请编号', 'num'],
+    ['txt', '发起部门', 'deptName'],
+    ['txt', '发起人', 'creatorName'],
+    ['txt', '发起日期', 'createTime'],
+    ['select', '申请状态', 'status', selectObj['订单审批状态']]
+  ]
+}
 
-export const D1tableC = [
-  ['dateRes', '登记日期', 'date'],
-  ['txt', '申请编号', 'num'],
-  ['txt', '发起部门', 'deptName'],
-  ['txt', '发起人', 'creatorName'],
-  ['txt', '发起日期', 'createTime'],
-  ['select', '申请状态', 'status', selectObj['订单审批状态']]
+// 藏品征集-订单页面的线索清单
+export const SonClueListTableC = [
+  ['txt', '线索名称', 'name'],
+  ['txt', '线索编号', 'num'],
+  ['text', '线索简介', 'intro', 50],
+  ['txt', '联系方式', 'phone'],
+  ['txtC', '初步藏品类别', 'typeDictId'],
+  ['txtC', '初步藏品年代', 'ageDictId'],
+  ['select', '完残程度', 'tornLevel', selectObj['完残程度']],
+  ['text', '备注', 'remark', 50]
 ]
 
+// 藏品登记-订单页面的藏品清单
 export const goodsSonTableC = [
   ['txt', '藏品登记号', 'num'],
   ['img', '封面', 'thumb'],