shaogen1995 пре 1 месец
родитељ
комит
5cd1d8644d

BIN
后台管理/src/assets/img/bg.jpg


BIN
后台管理/src/assets/img/layAc.png


BIN
后台管理/src/assets/img/layLogo.png


BIN
后台管理/src/assets/img/layoutBj.png


BIN
后台管理/src/assets/img/loginBj.png


BIN
后台管理/src/assets/img/loginTit.png


BIN
后台管理/src/assets/img/logo.png


+ 2 - 2
后台管理/src/assets/styles/base.css

@@ -35,8 +35,8 @@ textarea {
 }
 /* 主题色 */
 :root {
-  --themeColor: #b5894b;
-  --themeColor2: #744e2e;
+  --themeColor: #b02b23;
+  --themeColor2: #f7c481;
 }
 /* 找不到页面 */
 .noFindPage {

+ 2 - 2
后台管理/src/assets/styles/base.less

@@ -45,8 +45,8 @@ textarea {
 
 /* 主题色 */
 :root {
-  --themeColor: #b5894b;
-  --themeColor2: #744e2e;
+  --themeColor: #b02b23;
+  --themeColor2: #f7c481;
 }
 
 /* 找不到页面 */

+ 6 - 0
后台管理/src/components/MyTable/index.tsx

@@ -88,6 +88,12 @@ function MyTable({
       const obj = {
         index: (_: any, __: any, index: number) => index + 1 + (pageNum - 1) * pageSize,
         txt: (item: any) => item[v[2]] || isNull,
+        adiutTxt: (item: any) => {
+          let txt1 = item.status === 1 ? '同意' : item.status === 2 ? '不同意' : '待处理'
+          if (item.isUse === 0) txt1 = '(空)'
+          const txt2 = item.isAuto === 1 ? '(自动)' : ''
+          return txt1 + txt2
+        },
 
         img: (item: any) => (
           <div className='tableImgAuto'>

+ 1 - 1
后台管理/src/index.tsx

@@ -22,7 +22,7 @@ root.render(
     locale={locale}
     theme={{
       token: {
-        colorPrimary: '#b5894b'
+        colorPrimary: '#b02b23'
       }
     }}
   >

+ 14 - 13
后台管理/src/pages/A0addGoods/index.tsx

@@ -23,9 +23,10 @@ type Props = {
   sId: number
   closeFu: () => void
   isEdit?: boolean
+  orderId?: number
 }
 
-function A0addGoods({ sId, closeFu, isEdit }: Props) {
+function A0addGoods({ sId, closeFu, isEdit, orderId }: Props) {
   // 设置表单ref
   const FormBoxRef = useRef<FormInstance>(null)
 
@@ -101,7 +102,7 @@ function A0addGoods({ sId, closeFu, isEdit }: Props) {
 
       if (sId > 0) {
         // 藏品登记页面点击重新提交
-        const res = await B2_APIresubmit(sId, obj)
+        const res = await B2_APIresubmit(orderId!, obj)
         if (res.code === 0) {
           MessageFu.success('重新提交成功')
           history.push(`/register_look/1/${res.data.id}`)
@@ -117,7 +118,7 @@ function A0addGoods({ sId, closeFu, isEdit }: Props) {
         }
       }
     },
-    [isEdit, sId]
+    [isEdit, orderId, sId]
   )
 
   return (
@@ -184,7 +185,7 @@ function A0addGoods({ sId, closeFu, isEdit }: Props) {
 
             <div className='AGrow'>
               <Form.Item label='来源类型' name='sourceDictId'>
-                <Select placeholder='请选择' options={dictSelect('藏品来源')} />
+                <Select allowClear placeholder='请选择' options={dictSelect('藏品来源')} />
               </Form.Item>
             </div>
 
@@ -202,28 +203,28 @@ function A0addGoods({ sId, closeFu, isEdit }: Props) {
 
             <div className='AGrow'>
               <Form.Item label='年代' name='ageDictId'>
-                <Select placeholder='请选择' options={dictSelect('藏品年代')} />
+                <Select allowClear placeholder='请选择' options={dictSelect('藏品年代')} />
               </Form.Item>
             </div>
             <div className='AGrow'>
               <Form.Item label='类型' name='typeDictId'>
-                <Select placeholder='请选择' options={dictSelect('藏品类型')} />
+                <Select allowClear placeholder='请选择' options={dictSelect('藏品类型')} />
               </Form.Item>
             </div>
             <div className='AGrow'>
               <Form.Item label='级别' name='level'>
-                <Select placeholder='请选择' options={levelSelect} />
+                <Select allowClear placeholder='请选择' options={levelSelect} />
               </Form.Item>
             </div>
             <div className='AGrow'>
               <Form.Item label='材质' name='textureDictId'>
-                <Select placeholder='请选择' options={dictSelect('藏品材质')} />
+                <Select allowClear placeholder='请选择' options={dictSelect('藏品材质')} />
               </Form.Item>
             </div>
 
             <div className='AGrow'>
               <Form.Item label='完残程度' name='torn'>
-                <Select placeholder='请选择' options={tornSelect} />
+                <Select allowClear placeholder='请选择' options={tornSelect} />
               </Form.Item>
             </div>
 
@@ -233,7 +234,7 @@ function A0addGoods({ sId, closeFu, isEdit }: Props) {
               </Form.Item>
 
               <Form.Item name='pcsUnitDictId'>
-                <Select placeholder='请选择单位' options={dictSelect('数量单位')} />
+                <Select allowClear placeholder='请选择单位' options={dictSelect('数量单位')} />
               </Form.Item>
             </div>
 
@@ -243,13 +244,13 @@ function A0addGoods({ sId, closeFu, isEdit }: Props) {
               </Form.Item>
 
               <Form.Item name='qualityUnit'>
-                <Select placeholder='请选择单位' options={qualitySelect} />
+                <Select allowClear placeholder='请选择单位' options={qualitySelect} />
               </Form.Item>
             </div>
 
             <div className='AGrow'>
               <Form.Item label='有无说明牌' name='isNote'>
-                <Select placeholder='请选择' options={isNoteSelect} />
+                <Select allowClear placeholder='请选择' options={isNoteSelect} />
               </Form.Item>
             </div>
 
@@ -269,7 +270,7 @@ function A0addGoods({ sId, closeFu, isEdit }: Props) {
                   </Form.Item>
 
                   <Form.Item name='sizeUnit'>
-                    <Select placeholder='请选择' options={sizeSelect} />
+                    <Select allowClear placeholder='请选择' options={sizeSelect} />
                   </Form.Item>
                 </div>
               </div>

+ 1 - 1
后台管理/src/pages/A0goodsInfo/Tab1info/index.tsx

@@ -16,7 +16,7 @@ function Tab1info({ info, auto }: Props) {
   const filesRef = useRef<any>(null)
 
   useEffect(() => {
-    filesRef.current?.showList(info.file)
+    filesRef.current?.showList(info.file || [])
   }, [info.file])
 
   return (

+ 19 - 2
后台管理/src/pages/B1ledger/data.ts

@@ -1,5 +1,5 @@
 export type B1fromDataType = {
-  searchkey: string
+  searchKey: string
   typeDictId: null | number
   textureDictId: null | number
   pageNum: number
@@ -7,7 +7,7 @@ export type B1fromDataType = {
 }
 
 export const B1fromDataBase: B1fromDataType = {
-  searchkey: '',
+  searchKey: '',
   typeDictId: null,
   textureDictId: null,
   pageNum: 1,
@@ -70,4 +70,21 @@ export type B1listType = {
   torn: string
   typeDictId: number
   updateTime: string
+
+  goodIds: string
+  audits: GoodsAduitsType[]
+}
+
+export type GoodsAduitsType = {
+  createTime: string
+  handler: string
+  id: number
+  isAuto: number
+  isUse: number
+  moduleIds?: any
+  nodeName: string
+  orderId: number
+  rtfOpinion?: any
+  status?: any
+  type?: any
 }

+ 2 - 2
后台管理/src/pages/B1ledger/index.tsx

@@ -28,7 +28,7 @@ function B1ledger() {
   // 输入框改变
   const timeRef = useRef(-1)
   const txtChangeFu = useCallback(
-    (e: React.ChangeEvent<HTMLInputElement>, key: 'searchkey') => {
+    (e: React.ChangeEvent<HTMLInputElement>, key: 'searchKey') => {
       clearTimeout(timeRef.current)
       timeRef.current = window.setTimeout(() => {
         setFormData({
@@ -90,7 +90,7 @@ function B1ledger() {
             showCount
             key={inputKey}
             allowClear
-            onChange={e => txtChangeFu(e, 'searchkey')}
+            onChange={e => txtChangeFu(e, 'searchKey')}
             style={{ width: 300 }}
           />
           &emsp;

+ 2 - 1
后台管理/src/pages/B2register/B2look/index.module.scss

@@ -38,7 +38,7 @@
       display: flex;
       justify-content: space-between;
       border-bottom: 1px solid #ccc;
-      padding: 15px 0;
+      padding: 15px 0 0;
       margin-bottom: 15px;
       .B2lTrow {
         width: 33%;
@@ -73,6 +73,7 @@
     .B2lGood {
       border-bottom: 1px solid #ccc;
       margin: 15px 0 15px;
+      padding-bottom: 15px;
     }
 
     .ant-table-wrapper {

+ 35 - 23
后台管理/src/pages/B2register/B2look/index.tsx

@@ -1,7 +1,6 @@
 import React, { useCallback, useEffect, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { useParams } from 'react-router-dom'
-import { API_getGoodsInfo } from '@/store/action/B1ledger'
 import { B1listType } from '@/pages/B1ledger/data'
 import { Button } from 'antd'
 import { statusSelect } from '@/utils/select'
@@ -10,17 +9,44 @@ import Tab1info from '@/pages/A0goodsInfo/Tab1info'
 import MyTable from '@/components/MyTable'
 import TextArea from 'antd/es/input/TextArea'
 import { MessageFu } from '@/utils/message'
-import { B2_APIaduit } from '@/store/action/B2register'
+import { B2_APIaduit, B2_APIgetInfo } from '@/store/action/B2register'
+import { API_getFileListByIds } from '@/store/action/B1ledger'
+import { auditTableC } from '@/utils/tableData'
 
 function B2look() {
   const { key, id } = useParams<any>()
 
+  // 订单相关信息
   const [info, setInfo] = useState({} as B1listType)
 
+  // 藏品相关信息
+  const [goodsInfo, setGoodsInfo] = useState({} as B1listType)
+
   const getInfoFu = useCallback(async (id: number) => {
-    const res = await API_getGoodsInfo(id)
+    const res = await B2_APIgetInfo(id)
     if (res.code === 0) {
       setInfo(res.data)
+
+      const goodsArr = res.data.snaps
+
+      if (goodsArr && goodsArr[0] && goodsArr[0].snap) {
+        const objStr = goodsArr[0].snap
+        try {
+          const obj: B1listType = JSON.parse(objStr)
+          if (obj.fileIds) {
+            const fileArr = obj.fileIds.split(',').map(v => Number(v))
+
+            const res2 = await API_getFileListByIds(fileArr)
+
+            if (res2.code === 0) {
+              obj.file = res2.data
+              setGoodsInfo(obj)
+            }
+          } else setGoodsInfo(obj)
+        } catch (error) {
+          MessageFu.warning('JSON数据错误')
+        }
+      }
     }
   }, [])
 
@@ -84,7 +110,6 @@ function B2look() {
 
           <div className='B2lTxt'>
             <div className='B2lTrow'>
-              {/* 待完善 返回数据确实参数 */}
               <div className='B2lTrow1'>订单编号:</div>
               <div className='B2lTrow2'>{info.num}</div>
             </div>
@@ -94,7 +119,7 @@ function B2look() {
             </div>
             <div className='B2lTrow'>
               <div className='B2lTrow1'>发起人:</div>
-              <div className='B2lTrow2'>待完善</div>
+              <div className='B2lTrow2'>{info.creatorName + ' - ' + info.createTime}</div>
             </div>
 
             {/* 审批相关 */}
@@ -116,7 +141,7 @@ function B2look() {
                     ))}
                   </div>
                 </div>
-                <div className='B2lTrow B2lTrowAll'>
+                <div className='B2lTrow B2lTrowAll' style={{ marginBottom: 25 }}>
                   <div className='B2lTrow1'>审批意见:</div>
                   <div className='B2lTrow2'>
                     <TextArea
@@ -135,29 +160,16 @@ function B2look() {
           <div className='B2lTit'>藏品详情</div>
 
           <div className='B2lGood'>
-            <Tab1info info={info} auto />
+            <Tab1info info={goodsInfo} auto />
           </div>
 
           <div className='B2lTit'>申请流程</div>
 
-          {/* 待完善 */}
           <MyTable
-            list={[
-              { id: 1, name: '11' },
-              { id: 2, name: '22' },
-              { id: 3, name: '33' },
-              { id: 4, name: '44' },
-              { id: 5, name: '55' }
-            ]}
-            columnsTemp={[
-              ['txt', '节点名称', 'name'],
-              ['txt', '提交日期', 'name'],
-              ['txt', '处理人', 'name'],
-              ['txt', '审批结果', 'name'],
-              ['text', '审批意见', 'xxxxx', 100]
-            ]}
+            list={info.audits || []}
+            columnsTemp={auditTableC}
             pagingInfo={false}
-            widthSet={{ xxxxx: 800 }}
+            widthSet={{ rtfOpinion: 600 }}
           />
         </>
       ) : null}

+ 28 - 13
后台管理/src/pages/B2register/index.tsx

@@ -6,7 +6,7 @@ import { B2_APIgetlist } from '@/store/action/B2register'
 import { RootState } from '@/store'
 import { B1listType } from '../B1ledger/data'
 import { Button, DatePicker, Input, Select } from 'antd'
-import history from '@/utils/history'
+import history, { aduitBtnRoleFu, resubmitBtnRoleFu } from '@/utils/history'
 import { statusSelect } from '@/utils/select'
 import MyTable from '@/components/MyTable'
 import { B2tableC } from '@/utils/tableData'
@@ -84,16 +84,25 @@ function B2register() {
               </Button>
 
               {/* 待完善 下面2个按钮权限 */}
-              <Button
-                size='small'
-                type='text'
-                onClick={() => history.push(`/register_look/2/${item.id}`)}
-              >
-                审批
-              </Button>
-              <Button size='small' type='text' onClick={() => setEditId(item.id)}>
-                重新提交
-              </Button>
+              {aduitBtnRoleFu(item) ? (
+                <Button
+                  size='small'
+                  type='text'
+                  onClick={() => history.push(`/register_look/2/${item.id}`)}
+                >
+                  审批
+                </Button>
+              ) : null}
+
+              {resubmitBtnRoleFu(item) ? (
+                <Button
+                  size='small'
+                  type='text'
+                  onClick={() => setEditId({ orderId: item.id, goodsId: Number(item.goodIds) })}
+                >
+                  重新提交
+                </Button>
+              ) : null}
             </>
           )
         }
@@ -110,7 +119,7 @@ function B2register() {
   )
 
   // 点击重新提交
-  const [editId, setEditId] = useState(0)
+  const [editId, setEditId] = useState({ orderId: 0, goodsId: 0 })
 
   return (
     <div className={styles.B2register}>
@@ -182,7 +191,13 @@ function B2register() {
       />
 
       {/* 点击重新提交*/}
-      {editId ? <A0addGoods sId={editId} closeFu={() => setEditId(0)} /> : null}
+      {editId.goodsId ? (
+        <A0addGoods
+          sId={editId.goodsId}
+          orderId={editId.orderId}
+          closeFu={() => setEditId({ orderId: 0, goodsId: 0 })}
+        />
+      ) : null}
     </div>
   )
 }

+ 1 - 1
后台管理/src/pages/Layout/data.ts

@@ -59,7 +59,7 @@ const tabLeftArr: RouterType = [
       {
         id: 700,
         name: '库房管理',
-        path: '/storage',
+        path: '/storageSet',
         Com: React.lazy(() => import('../C1storage'))
       },
       {

+ 13 - 9
后台管理/src/pages/Layout/index.module.scss

@@ -8,7 +8,8 @@
       position: relative;
       width: 220px;
       height: 100%;
-      background-color: var(--themeColor2);
+      background-image: url('../../assets/img/layoutBj.png');
+      background-size: 100% 100%;
 
       .layoutLeftTop {
         text-align: center;
@@ -16,7 +17,7 @@
       }
 
       .layoutLeftMain {
-        padding-top: 10px;
+        padding-top: 30px;
 
         .layoutLRowBox {
           .layoutLRowBoxTxt {
@@ -30,7 +31,7 @@
           }
 
           .layoutLRowBoxRow {
-            opacity: 0.8;
+            opacity: 1;
             color: #fff;
             text-align: center;
             cursor: pointer;
@@ -40,15 +41,17 @@
             line-height: 40px;
 
             &:hover {
-              background-color: var(--themeColor);
-              opacity: 1;
+              background-image: url('../../assets/img/layAc.png');
+              background-size: 100% 100%;
+              color: var(--themeColor);
             }
           }
 
           .active {
-            opacity: 1;
-            pointer-events: none;
-            background-color: var(--themeColor);
+            // pointer-events: none;
+            background-image: url('../../assets/img/layAc.png');
+            background-size: 100% 100%;
+            color: var(--themeColor);
           }
         }
       }
@@ -82,11 +85,12 @@
             height: 60px;
             display: flex;
             align-items: center;
+            color: var(--themeColor);
           }
 
           .userInco {
             margin-left: 10px;
-            color: black;
+            color: var(--themeColor);
           }
 
           .userInco1 {

+ 1 - 1
后台管理/src/pages/Layout/index.tsx

@@ -188,7 +188,7 @@ function Layout() {
       {/* 左边 */}
       <div className='layoutLeft'>
         <div className='layoutLeftTop'>
-          <img src={require('@/assets/img/logo.png')} alt='' />
+          <img src={require('@/assets/img/layLogo.png')} alt='' />
         </div>
         {/* 左边主体 */}
         <div className='layoutLeftMain'>

+ 19 - 26
后台管理/src/pages/Login/index.module.scss

@@ -15,46 +15,38 @@
       flex-direction: column;
       justify-content: center;
       align-items: center;
-      background-color: rgba(255, 255, 255, 0.8);
-      backdrop-filter: blur(4px);
-
-      .LogoImg {
-        padding-top: 20px;
-        color: var(--themeColor2);
-        font-size: 26px;
-        font-weight: 700;
-        letter-spacing: 4px;
-        line-height: 50px;
-        text-align: center;
-      }
 
       .inputBox {
-        margin: 20px 0 20px;
+        padding: 30px 0 60px;
         width: 100%;
 
+        background-image: url('../../assets/img/loginBj.png');
+        background-size: 100% 100%;
+
         input::-webkit-input-placeholder {
           /* WebKit browsers */
-          color: #ccc;
+          color: #999;
         }
 
         input:-moz-placeholder {
           /* Mozilla Firefox 4 to 18 */
-          color: #ccc;
+          color: #999;
         }
 
         input::-moz-placeholder {
           /* Mozilla Firefox 19+ */
-          color: #ccc;
+          color: #999;
         }
 
         input:-ms-input-placeholder {
           /* Internet Explorer 10+ */
-          color: #ccc;
+          color: #999;
         }
 
         .inputBoxRow {
           width: 370px;
           margin: 30px auto;
+
           .ant-input-suffix .ant-input-password-icon {
             color: var(--themeColor);
             font-size: 22px;
@@ -127,16 +119,17 @@
         .ant-input-affix-wrapper-focused {
           box-shadow: none;
         }
-      }
 
-      .loginBtn {
-        .ant-btn {
-          color: #fff;
-          background-color: var(--themeColor);
-          border-radius: 25px;
-          font-size: 18px;
-          width: 375px;
-          height: 50px;
+        .loginBtn {
+          text-align: center;
+          .ant-btn {
+            color: #fff;
+            background-color: var(--themeColor);
+            border-radius: 25px;
+            font-size: 18px;
+            width: 375px;
+            height: 50px;
+          }
         }
       }
     }

+ 7 - 12
后台管理/src/pages/Login/index.tsx

@@ -75,11 +75,7 @@ export default function Login() {
       <div className='mainRight'>
         {/* logg */}
         <div className='LogoImg'>
-          <h3>
-            集宁博物馆馆藏系统
-            <br />
-            欢迎登录
-          </h3>
+          <img src={require('@/assets/img/loginTit.png')} alt='' />
         </div>
 
         {/* 账号密码输入框 */}
@@ -117,13 +113,12 @@ export default function Login() {
               <img onClick={LoginGetCodeFu} className='loginCode' src={codeImg} alt='' />
             ) : null}
           </div>
-        </div>
-
-        {/* 登录按钮 */}
-        <div className='loginBtn'>
-          <Button type='primary' size='large' onClick={loginClickFu}>
-            登 录
-          </Button>
+          {/* 登录按钮 */}
+          <div className='loginBtn'>
+            <Button type='primary' size='large' onClick={loginClickFu}>
+              登 录
+            </Button>
+          </div>
         </div>
       </div>
     </div>

+ 7 - 0
后台管理/src/store/action/B1ledger.ts

@@ -33,3 +33,10 @@ export const API_addGoods = (data: any) => {
 export const API_getGoodsInfo = (id: number) => {
   return http.get(`cms/goods/detail/${id}`)
 }
+
+/**
+ * 附件-根据附件ids查询
+ */
+export const API_getFileListByIds = (data: number[]) => {
+  return http.post('cms/goods/file/getList', data)
+}

+ 29 - 0
后台管理/src/utils/history.ts

@@ -1,4 +1,6 @@
+import { B1listType } from '@/pages/B1ledger/data'
 import { createHashHistory } from 'history'
+import { getTokenInfo } from './storage'
 const history = createHashHistory()
 export default history
 
@@ -24,3 +26,30 @@ export const backPageFu = (path: string) => {
   if (routerLength) history.go(-1)
   else history.push(path)
 }
+
+const userInfo = (getTokenInfo() || {}).user
+
+// 列表按钮的权限-审批
+// 订单状态为待审批,且当前用户为当前节点审批人时
+export const aduitBtnRoleFu = (item: B1listType) => {
+  let flag = false
+
+  if (item.status === 1 && userInfo) {
+    // 待完善
+    flag = true
+  }
+
+  return flag
+}
+
+// 列表按钮的权限-重新提交
+// 申请状态为未通过,且当前用户为订单创建人时
+export const resubmitBtnRoleFu = (item: B1listType) => {
+  let flag = false
+
+  if (item.status === 2 && userInfo) {
+    if (userInfo.id === item.creatorId) flag = true
+  }
+
+  return flag
+}

+ 8 - 0
后台管理/src/utils/tableData.ts

@@ -16,6 +16,14 @@
 
 import { dictSelect, statusSelect } from './select'
 
+export const auditTableC = [
+  ['txt', '节点名称', 'nodeName'],
+  ['txt', '提交日期', 'createTime'],
+  ['txt', '处理人', 'handler'],
+  ['adiutTxt', '审批结果'],
+  ['text', '审批意见', 'rtfOpinion', 100]
+]
+
 export const B1tableC = [
   ['txt', '藏品编号', 'num'],
   ['txt', '藏品标题', 'name'],