Parcourir la source

审批流程修改

shaogen1995 il y a 18 heures
Parent
commit
d8273f38b0

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

@@ -166,6 +166,15 @@ function MyTable({
           return tempCom
         },
 
+        text2: (item: any) => {
+          return (
+            <div
+              style={{ textAlign: item[v[2]] ? 'left' : 'center' }}
+              dangerouslySetInnerHTML={{ __html: item[v[2]] || isNull }}
+            ></div>
+          )
+        },
+
         custom: (item: any) => v[2]?.(item) || isNull,
         sizeNum: (item: any) => {
           let txt = isNull

+ 20 - 5
src/pages/Abench/A2bench/A2table/index.tsx

@@ -1,6 +1,6 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
-import { Button, DatePicker, Input, Select } from 'antd'
+import { Button, Cascader, DatePicker, Input, Select } from 'antd'
 import tabLeftArr, { RouterTypeRow } from '@/pages/Layout/data'
 import MyTable from '@/components/MyTable'
 import { MessageFu } from '@/utils/message'
@@ -12,6 +12,7 @@ import { selectObj } from '@/utils/dataChange'
 import { GI5tableC } from '@/utils/tableData'
 import { useSelector } from 'react-redux'
 import store, { RootState } from '@/store'
+import { dictByProResFu } from '@/pages/Isystem/I2dict/data'
 
 const { RangePicker } = DatePicker
 
@@ -43,7 +44,10 @@ function A2table() {
 
   const getListFu = useCallback(async () => {
     if (formData.pageNum) {
-      const res = await A2_APIgetList(formData)
+      const obj = { ...formData }
+      if (obj.typeDictId && obj.typeDictId.length)
+        obj.typeDictId = obj.typeDictId[obj.typeDictId.length - 1]
+      const res = await A2_APIgetList(obj)
       if (res.code === 0) {
         setTableObj({ list: res.data.records || [], total: res.data.total })
       }
@@ -162,19 +166,30 @@ function A2table() {
         </div>
         <div className='A2TtopRR'>
           <div>
-            <Select
+            <Cascader
+              changeOnSelect
+              allowClear={true}
+              placeholder='业务类型'
+              style={{ width: 200 }}
+              value={formData.typeDictId || null}
+              fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+              onChange={e => setFormData({ ...formData, typeDictId: e })}
+              options={dictByProResFu()}
+            />
+
+            {/* <Select
               allowClear={true}
               placeholder='业务类型'
               style={{ width: 150 }}
               value={formData.type ? formData.type : null}
               onChange={e => setFormData({ ...formData, type: e, pageNum: 1 })}
               options={typePageArr.map(v => ({ value: v.pageType, label: v.name }))}
-            />
+            /> */}
           </div>
 
           <div>
             <Input
-              style={{ width: 150 }}
+              style={{ width: 200 }}
               placeholder='请输入业务编号'
               maxLength={30}
               onChange={e => txtChangeFu(e, 'num')}

+ 7 - 4
src/pages/Abench/A3flow/index.tsx

@@ -14,6 +14,7 @@ import { Button, Modal, Radio, Checkbox } from 'antd'
 import { exportExcelFile } from '@/utils/xlsxExport'
 import tabLeftArr from '@/pages/Layout/data'
 import { GI5tableType } from '@/pages/ZgoodsInfo/data'
+import { dictByProResFu } from '@/pages/Isystem/I2dict/data'
 
 const ExportModal = ({
   open,
@@ -153,10 +154,12 @@ function A3flow() {
   const A3topSearch = useMemo(
     () => [
       {
-        type: 'select',
-        key: 'type',
+        type: 'cascader',
+        key: 'typeDictId',
         placeholder: '业务类型',
-        options: list
+        options: dictByProResFu(),
+        // 可以单选
+        only: true
       },
       {
         type: 'input',
@@ -175,7 +178,7 @@ function A3flow() {
         options: selectObj['藏品入库申请状态']
       }
     ],
-    [list]
+    []
   )
 
   // 故事管理/藏品总账定制右侧内容

+ 7 - 4
src/pages/Abench/A4proof/index.tsx

@@ -13,6 +13,7 @@ import tabLeftArr from '@/pages/Layout/data'
 import { downloadFileByUrl } from '@/utils'
 import { authorityFu } from '@/utils/authority'
 import { MessageFu } from '@/utils/message'
+import { dictByProResFu } from '@/pages/Isystem/I2dict/data'
 
 function A4proof() {
   const tableInfo = useSelector((state: RootState) => state.A4proof.tableInfo)
@@ -121,13 +122,15 @@ function A4proof() {
         placeholder: `请输入凭证名称或业务编号`
       },
       {
-        type: 'select',
-        key: 'moduleName',
+        type: 'cascader',
+        key: 'typeDictId',
         placeholder: '业务类型',
-        options: list
+        options: dictByProResFu(),
+        // 可以单选
+        only: true
       }
     ],
-    [list]
+    []
   )
 
   // 故事管理/藏品总账定制右侧内容

+ 26 - 5
src/pages/Isystem/I2dict/I2add.tsx

@@ -1,4 +1,4 @@
-import React, { useCallback, useEffect, useRef, useState } from 'react'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, Cascader, Form, FormInstance, Input, InputNumber, Modal } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
@@ -6,9 +6,10 @@ import { useSelector } from 'react-redux'
 import { RootState } from '@/store'
 import { MessageFu } from '@/utils/message'
 import TextArea from 'antd/es/input/TextArea'
-import { I2AddInfoType } from './data'
+import { dictFilterArr, I2AddInfoType } from './data'
 import { I2_APIgetInfo, I2_APIsave } from '@/store/action/Isystem/I2dict'
 import { TypeI5Tree } from '../I5organization/data'
+import classNames from 'classnames'
 
 type Props = {
   addInfo: I2AddInfoType
@@ -72,6 +73,15 @@ function I2add({ addInfo, addFu, closeFu }: Props) {
     // return MessageFu.warning("有表单不符号规则!");
   }, [])
 
+  // 一些模块只能增加到二级字典
+  const isTowFlag = useMemo(() => {
+    let flag = false
+    if (parentIdArr && parentIdArr.length === 2 && dictFilterArr.includes(parentIdArr[0])) {
+      flag = true
+    }
+    return flag
+  }, [parentIdArr])
+
   // 通过校验点击确定
   const onFinish = useCallback(
     async (values: any) => {
@@ -80,6 +90,14 @@ function I2add({ addInfo, addFu, closeFu }: Props) {
       let ancestor = ''
       let parentId: string | null = null
 
+      if (isTowFlag) MessageFu.warning('该字典模块最多支持二级!')
+
+      // if (1 + 1 === 2) {
+      //   console.log('-----', parentIdArr)
+
+      //   return
+      // }
+
       if (parentIdArr && parentIdArr.length >= 5 && addInfo.txt === '新增')
         return MessageFu.warning('最多支持五级!')
 
@@ -124,7 +142,7 @@ function I2add({ addInfo, addFu, closeFu }: Props) {
         closeFu()
       }
     },
-    [acCardInfo, addFu, addInfo.id, addInfo.txt, closeFu, parentIdArr]
+    [acCardInfo, addFu, addInfo.id, addInfo.txt, closeFu, isTowFlag, parentIdArr]
   )
 
   return (
@@ -192,12 +210,15 @@ function I2add({ addInfo, addFu, closeFu }: Props) {
 
           {/* 确定和取消按钮 */}
           <br />
-          <Form.Item wrapperCol={{ offset: 9, span: 16 }}>
-            <Button type='primary' htmlType='submit'>
+          <Form.Item className='I2aTitBox'>
+            <Button type='primary' htmlType='submit' disabled={isTowFlag}>
               提交
             </Button>
             &emsp;
             <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+            <div className={classNames('I2aTit', isTowFlag ? 'I2aTitShow' : '')}>
+              该字典模块最多支持二级
+            </div>
           </Form.Item>
         </Form>
       </div>

+ 27 - 0
src/pages/Isystem/I2dict/data.ts

@@ -1,3 +1,4 @@
+import store from '@/store'
 import { TypeI5Tree } from '../I5organization/data'
 
 export type I2AddInfoType = {
@@ -55,3 +56,29 @@ export const filterTreeByName = (tree: TypeI5Tree[], searchTemp: string): TypeI5
 
   return tree.map(dfs).filter(Boolean) as TypeI5Tree[]
 }
+
+// 筛选字典的数据(只能增加二级字典)
+export const dictFilterArr = [
+  { name: '藏品征集', id: '6' },
+  { name: '藏品入馆', id: '7' },
+  { name: '藏品鉴定', id: '8' },
+  { name: '藏品入藏', id: '9' },
+  { name: '藏品登记', id: '10' },
+  { name: '藏品修改', id: '11' },
+  { name: '藏品注销', id: '12' },
+  { name: '资源使用', id: '13' },
+  { name: '藏品入库', id: '14' },
+  { name: '藏品移库', id: '15' },
+  { name: '藏品出库', id: '16' },
+  { name: '藏品盘点', id: '200' },
+  { name: '人员出入库', id: '17' },
+  { name: '事故登记', id: '18' },
+  { name: '现状登记', id: '19' },
+  { name: '修复登记', id: '20' }
+].map(v => v.id)
+
+// 获取字典中可以在流程设置中 筛选的数据
+export const dictByProResFu = () => {
+  const list = store.getState().I2dict.dictAll || []
+  return list.filter(v => dictFilterArr.includes(v.id))
+}

+ 18 - 0
src/pages/Isystem/I2dict/index.module.scss

@@ -182,6 +182,24 @@
           width: calc(100% - 94px);
         }
       }
+      .I2aTitBox {
+        position: relative;
+        text-align: center;
+        .I2aTit {
+          opacity: 0;
+          pointer-events: none;
+          transition: all 0.3s;
+          position: absolute;
+          bottom: -40px;
+          left: 50%;
+          transform: translateX(-50%);
+          color: #ff4d4f;
+        }
+        .I2aTitShow {
+          opacity: 1;
+          bottom: -26px;
+        }
+      }
     }
   }
 }

+ 41 - 6
src/pages/Isystem/I4processSet/I4edit/index.module.scss

@@ -15,7 +15,7 @@
       .I4RowBox {
         font-size: 16px;
         .I4row {
-          width: 50%;
+          width: 90%;
           margin-bottom: 20px;
           display: flex;
           .I4row1 {
@@ -42,16 +42,51 @@
             display: flex;
           }
         }
+
+        .I4box {
+          padding-left: 20px;
+          width: 90%;
+          .I4box1 {
+            font-weight: 700;
+          }
+          .I4box2 {
+            padding: 12px;
+            margin-top: 10px;
+            background-color: #e6e6e6;
+            border-radius: 8px;
+            .I4box2_row {
+              display: flex;
+              align-items: center;
+              margin-bottom: 15px;
+              .I4box2_row1 {
+                font-weight: 700;
+              }
+              .I4box2_row2 {
+                margin-left: 10px;
+                cursor: pointer;
+                color: var(--txtColor);
+                &:nth-of-type(3) {
+                  margin-right: 10px;
+                  color: var(--txtColor);
+                }
+              }
+            }
+
+            // .I4box2_rowCheck1 {
+            //   color: var(--txtColor);
+            // }
+          }
+        }
       }
     }
     .I4btn {
       margin-top: 30px;
       padding-left: 20px;
-      // position: absolute;
-      // top: 50%;
-      // right: 5%;
-      // transform: translateY(-50%);
-      // z-index: 10;
+      position: absolute;
+      top: 50%;
+      right: 5%;
+      transform: translateY(-50%);
+      z-index: 10;
     }
   }
 }

+ 119 - 14
src/pages/Isystem/I4processSet/I4edit/index.tsx

@@ -1,20 +1,22 @@
 import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
-import { Button, Radio } from 'antd'
+import { Button, Checkbox, Input, Radio } from 'antd'
 import TextArea from 'antd/es/input/TextArea'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { MessageFu } from '@/utils/message'
 import { I4tableType } from '../data'
 import { I4_APIgetInfo, I4_APIsave } from '@/store/action/Isystem/I4processSet'
+import { TypeI5Tree } from '../../I5organization/data'
 
 type Props = {
   sId: number
   closeFu: () => void
   succFu: () => void
+  treeData: TypeI5Tree[]
 }
 
-function I4edit({ sId, closeFu, succFu }: Props) {
-  const [info, setInfo] = useState({} as I4tableType)
+function I4edit({ sId, closeFu, succFu, treeData }: Props) {
+  const [info, setInfo] = useState((sId > 0 ? {} : { enabled: 1 }) as I4tableType)
 
   const getInfoFu = useCallback(async (id: number) => {
     const res = await I4_APIgetInfo(id)
@@ -23,15 +25,18 @@ function I4edit({ sId, closeFu, succFu }: Props) {
       setInfo({
         ...data
       })
+      if (data.dictIds) {
+        setCheckIds(data.dictIds.split(','))
+      }
     }
   }, [])
 
   useEffect(() => {
-    getInfoFu(sId)
+    if (sId > 0) getInfoFu(sId)
   }, [getInfoFu, sId])
 
   const formChange = useCallback(
-    (key: 'enabled' | 'remark', val: any) => {
+    (key: 'enabled' | 'remark' | 'name', val: any) => {
       setInfo({
         ...info,
         [key]: val
@@ -40,32 +45,93 @@ function I4edit({ sId, closeFu, succFu }: Props) {
     [info]
   )
 
+  // 已经选中的
+  const [checkIds, setCheckIds] = useState<string[]>([])
+
+  const checkFu = useCallback(
+    (id: string) => {
+      if (checkIds.includes(id)) setCheckIds(checkIds.filter(v => v !== id))
+      else setCheckIds([...checkIds, id])
+    },
+    [checkIds]
+  )
+
   // 点击确定
   const btnOk = useCallback(async () => {
     const obj = {
-      ...info
+      ...info,
+      id: sId > 0 ? sId : null,
+      dictIds: checkIds.join(',')
     }
 
+    if (!obj.name) return MessageFu.warning('请输入规则名称')
+    if (![0, 1].includes(obj.enabled)) return MessageFu.warning('请选择规则状态')
+
+    // if (1 + 1) {
+    //   console.log('-------', obj)
+
+    //   return
+    // }
+
     const res = await I4_APIsave(obj)
     if (res.code === 0) {
       MessageFu.success('编辑成功')
       succFu()
       closeFu()
     }
-  }, [closeFu, info, succFu])
+  }, [checkIds, closeFu, info, sId, succFu])
+
+  // 全选、反选
+  const allCheck = useCallback(
+    (id1: string, son?: TypeI5Tree[], flag?: boolean) => {
+      const ids = [id1]
+      if (son && son.length) {
+        son.forEach(v => {
+          ids.push(v.id)
+        })
+      }
+
+      let data = [...checkIds]
+
+      if (flag) {
+        // 反选
+        data = data.filter(c => !ids.includes(c))
+      } else {
+        // 全选
+        ids.forEach(v => {
+          if (!data.includes(v)) {
+            data.push(v)
+          }
+        })
+      }
+
+      setCheckIds(data)
+    },
+    [checkIds]
+  )
 
   return (
     <div className={styles.I4edit}>
       <div className='I4main'>
         <div className='I4RowBox'>
           <div className='I4row'>
-            <div className='I4row1'>流程名称:</div>
-            <div className='I4row2'>{info.name}</div>
+            <div className='I4row1 I4row1_2'>
+              <span> * </span> 规则名称:
+            </div>
+            <div className='I4row2'>
+              <Input
+                maxLength={30}
+                showCount
+                placeholder='请输入内容'
+                value={info.name}
+                onChange={e => formChange('name', e.target.value.trim())}
+              />
+            </div>
           </div>
 
           <div className='I4row'>
             <div className='I4row1'>
-              <span> * </span> 流程状态:
+              <span> * </span> 规则状态:
             </div>
             <div className='I4row2'>
               <Radio checked={info.enabled === 1} onClick={() => formChange('enabled', 1)}>
@@ -79,7 +145,7 @@ function I4edit({ sId, closeFu, succFu }: Props) {
           </div>
 
           <div className='I4row'>
-            <div className='I4row1'>流程说明:</div>
+            <div className='I4row1'>规则说明:</div>
             <div className='I4row2'>
               <TextArea
                 maxLength={500}
@@ -90,14 +156,53 @@ function I4edit({ sId, closeFu, succFu }: Props) {
               />
             </div>
           </div>
+
+          <div className='I4box'>
+            <div className='I4box1'>关联业务流程:</div>
+            <div className='I4box2'>
+              {treeData.map(item1 => (
+                <div className='I4box2_row' key={item1.id}>
+                  <div className='I4box2_row1'>{item1.name}</div>
+                  <div className='I4box2_row2' onClick={() => allCheck(item1.id, item1.children)}>
+                    [全选]
+                  </div>
+                  <div
+                    className='I4box2_row2'
+                    onClick={() => allCheck(item1.id, item1.children, true)}
+                  >
+                    [反选]
+                  </div>
+                  <Checkbox
+                    className='I4box2_rowCheck1'
+                    checked={checkIds.includes(item1.id)}
+                    onChange={() => checkFu(item1.id)}
+                  >
+                    默认流程
+                  </Checkbox>
+
+                  {item1.children &&
+                    item1.children.map(item2 => (
+                      <Checkbox
+                        key={item2.id}
+                        checked={checkIds.includes(item2.id)}
+                        onChange={() => checkFu(item2.id)}
+                      >
+                        {item2.name}
+                      </Checkbox>
+                    ))}
+                </div>
+              ))}
+            </div>
+          </div>
         </div>
 
         {/* 右侧按钮 */}
         <div className='I4btn'>
           <Button type='primary' onClick={btnOk}>
-            保存
-          </Button>{' '}
-          &emsp;
+            提交
+          </Button>
+          <br />
+          <br />
           <MyPopconfirm txtK='取消' onConfirm={closeFu} />
         </div>
       </div>

+ 1 - 0
src/pages/Isystem/I4processSet/data.ts

@@ -20,6 +20,7 @@ export type I4tableType = {
   type: string
   typeKey: string
   updateTime: string
+  dictIds: string
 }
 
 // 环节配置列表

+ 4 - 3
src/pages/Isystem/I4processSet/index.module.scss

@@ -5,10 +5,11 @@
       align-items: center;
       justify-content: space-between;
       border-radius: 10px;
-      padding: 15px 24px;
+      padding: 15px;
       background-color: var(--boxBcaColor);
-      .ant-select-selection-placeholder {
-        color: black;
+
+      .I4topTit {
+        color: #999;
       }
     }
     .tableBox {

+ 46 - 9
src/pages/Isystem/I4processSet/index.tsx

@@ -6,15 +6,32 @@ import { Button, Input, Select } from 'antd'
 import MyTable from '@/components/MyTable'
 import { getUserListAPI } from '@/store/action/Isystem/I7user'
 import { I4baseFormData, I4tableType } from './data'
-import { I4_APIgetList } from '@/store/action/Isystem/I4processSet'
+import { I4_APIdel, I4_APIgetList } from '@/store/action/Isystem/I4processSet'
 import { selectObj } from '@/utils/dataChange'
 import { I4tableC } from '@/utils/tableData'
 import I4edit from './I4edit'
 import I4linkSet from './I4linkSet'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { MessageFu } from '@/utils/message'
+import { TypeI5Tree } from '../I5organization/data'
+import { I2_APIgetDict } from '@/store/action/Isystem/I2dict'
+import { dictFilterArr } from '../I2dict/data'
 
 function I4processSet() {
   const dispatch = useDispatch()
 
+  // 获取最新的字典信息
+  const [treeData, setTreeData] = useState<TypeI5Tree[]>([])
+
+  useEffect(() => {
+    dispatch(
+      I2_APIgetDict(data => {
+        const dataRes = data || []
+        setTreeData(dataRes.filter(v => dictFilterArr.includes(v.id)))
+      })
+    )
+  }, [dispatch])
+
   // 获取用户列表
   useEffect(() => {
     dispatch(getUserListAPI({ pageNum: 1, pageSize: 99999 }))
@@ -75,6 +92,18 @@ function I4processSet() {
   const [proId, setProId] = useState(0)
   const titleRef = useRef('')
 
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res: any = await I4_APIdel([id])
+      if (res.code === 0) {
+        MessageFu.success('删除成功!')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
   const tableLastBtn = useMemo(() => {
     return [
       {
@@ -95,12 +124,13 @@ function I4processSet() {
               <Button size='small' type='text' onClick={() => setEditId(item.id)}>
                 编辑
               </Button>
+              <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
             </>
           )
         }
       }
     ]
-  }, [])
+  }, [delTableFu])
 
   // 点击编辑
   const [editId, setEditId] = useState(0)
@@ -108,30 +138,35 @@ function I4processSet() {
   return (
     <div className={styles.I4processSet}>
       <div className='pageTitle'>
-        流程设置{editId ? '-编辑' : ''}
+        流程设置{editId ? (editId > 0 ? '-编辑' : '-新增') : ''}
         {proId ? '-环节配置' : ''}
       </div>
       <div className='I4top'>
         <div className='I4topll'>
-          流程名称:
           <Input
-            placeholder='请输入流程名称'
+            placeholder='请输入规则名称'
             style={{ width: 200 }}
             maxLength={30}
             value={formData.name}
             onChange={e => txtChangeFu(e.target.value, 'name')}
           />
-          &emsp;启用状态:
+          &emsp;
           <Select
             allowClear={true}
-            placeholder='全部'
+            placeholder='启用状态'
             style={{ width: 200 }}
             value={formData.enabled}
             onChange={e => setFormData({ ...formData, enabled: e })}
             options={selectObj['启用状态']}
           />
+          &emsp;
+          <span className='I4topTit'>注:未配置规则的流程无需审批;删除规则不影响已存在的流程</span>
         </div>
         <div className='I4toprr'>
+          <Button type='primary' onClick={() => setEditId(-1)}>
+            新增
+          </Button>
+          &emsp;
           <Button type='primary' onClick={clickSearch}>
             查询
           </Button>
@@ -147,12 +182,14 @@ function I4processSet() {
           columnsTemp={I4tableC}
           lastBtn={tableLastBtn}
           pagingInfo={false}
-          widthSet={{ remark: 700 }}
+          widthSet={{ remark: 500, guanLian: 500 }}
         />
       </div>
 
       {/* 编辑 */}
-      {editId ? <I4edit sId={editId} closeFu={() => setEditId(0)} succFu={getListFu} /> : null}
+      {editId ? (
+        <I4edit sId={editId} closeFu={() => setEditId(0)} succFu={getListFu} treeData={treeData} />
+      ) : null}
 
       {/* 环节配置 */}
       {proId ? (

+ 15 - 9
src/pages/ZgoodsInfo/GItab5/index.tsx

@@ -1,6 +1,6 @@
 import React, { useCallback, useEffect, useMemo, useState } from 'react'
 import styles from './index.module.scss'
-import { Button, Select } from 'antd'
+import { Button, Cascader } from 'antd'
 import { API_GIlog } from '@/store/action/Cledger/C1ledger'
 import history from '@/utils/history'
 import MyTable from '@/components/MyTable'
@@ -9,23 +9,27 @@ import tabLeftArr from '@/pages/Layout/data'
 import { GI5tableType } from '../data'
 import { MessageFu } from '@/utils/message'
 import { authorityFu } from '@/utils/authority'
+import { dictByProResFu } from '@/pages/Isystem/I2dict/data'
 
 type Props = {
   goodId: number
 }
 
 function GItab5({ goodId }: Props) {
-  const [type, setType] = useState(null)
+  const [typeDictId, setTypeDictId] = useState<any>(null)
 
   const [tableList, setTableList] = useState<GI5tableType[]>([])
 
   // 封装发送请求的函数
   const getListFu = useCallback(async () => {
     if (goodId) {
+      const typeDictIdRes =
+        typeDictId && typeDictId.length ? typeDictId[typeDictId.length - 1] : null
+
       const params = {
         pageNum: 1,
         pageSize: 99999,
-        type,
+        typeDictId: typeDictIdRes,
         goodId
       }
 
@@ -34,7 +38,7 @@ function GItab5({ goodId }: Props) {
         setTableList(res.data.records || [])
       }
     }
-  }, [goodId, type])
+  }, [goodId, typeDictId])
 
   useEffect(() => {
     getListFu()
@@ -97,13 +101,15 @@ function GItab5({ goodId }: Props) {
   return (
     <div className={styles.GItab5}>
       <div className='GI5top'>
-        <Select
-          allowClear
+        <Cascader
+          changeOnSelect
+          allowClear={true}
           placeholder='申请类型'
           style={{ width: 300 }}
-          options={list}
-          value={type || null}
-          onChange={e => setType(e)}
+          value={typeDictId || null}
+          fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+          onChange={e => setTypeDictId(e)}
+          options={dictByProResFu()}
         />
       </div>
 

+ 1 - 0
src/pages/Zother/TableList/index.tsx

@@ -231,6 +231,7 @@ const TableList = forwardRef<any, Props>(function TableList(props, ref) {
                 />
               ) : item.type === 'cascader' ? (
                 <Cascader
+                  changeOnSelect={item.only}
                   allowClear={true}
                   placeholder={item.placeholder}
                   style={item.style || ''}

+ 59 - 4
src/store/action/Isystem/I4processSet.ts

@@ -1,4 +1,5 @@
-import { AppDispatch } from '@/store'
+import { dictFilterArr } from '@/pages/Isystem/I2dict/data'
+import store, { AppDispatch } from '@/store'
 import http from '@/utils/http'
 /**
  * 流程设置 - 获取分页列表
@@ -7,16 +8,70 @@ export const I4_APIgetList = (data: any): any => {
   return async (dispatch: AppDispatch) => {
     const res = await http.post('cms/flow/pageList', { ...data, pageSize: 99999, pageNum: 1 })
     if (res.code === 0) {
-      dispatch({ type: 'I4/getList', payload: res.data.records })
+      const treeData = store.getState().I2dict.dictAll.filter(v => dictFilterArr.includes(v.id))
+
+      let list: any[] = res.data.records || []
+
+      list.forEach(v => {
+        const ids: string = v.dictIds || ''
+        if (ids) {
+          const arr = ids.split(',')
+          const ids1: string[] = []
+          const ids2: string[] = []
+
+          arr.forEach(v2 => {
+            if (dictFilterArr.includes(v2)) ids1.push(v2)
+            else ids2.push(v2)
+          })
+
+          let txtTemp: any = []
+          treeData.forEach(v1 => {
+            if (ids1.includes(v1.id)) {
+              if (txtTemp[v1.name]) txtTemp[v1.name].push('默认')
+              else txtTemp[v1.name] = ['默认']
+            }
+
+            if (v1.children) {
+              v1.children.forEach(v2 => {
+                if (ids2.includes(v2.id)) {
+                  if (txtTemp[v1.name]) txtTemp[v1.name].push(v2.name)
+                  else txtTemp[v1.name] = [v2.name]
+                }
+              })
+            }
+          })
+
+          let txt = ''
+
+          for (const k in txtTemp) {
+            txt += k + ':'
+            if (txtTemp[k] && txtTemp[k].length) {
+              txt += txtTemp[k].join(',') + '<br/>'
+            }
+          }
+          txt = txt.substring(0, txt.length - 5)
+
+          v.guanLian = txt
+        }
+      })
+
+      dispatch({ type: 'I4/getList', payload: list })
     }
   }
 }
 
 /**
- * 流程设置-编辑
+ * 流程设置 - 删除
+ */
+export const I4_APIdel = (ids: number[]) => {
+  return http.post('cms/flow/removes', ids)
+}
+
+/**
+ * 流程设置-新增/编辑
  */
 export const I4_APIsave = (data: any) => {
-  return http.post('cms/flow/edit', data)
+  return http.post('cms/flow/saveEntity', data)
 }
 
 /**

+ 2 - 2
src/utils/http.ts

@@ -10,8 +10,8 @@ export const defaultPassWord = 'Aa147852'
 
 export const envFlag = process.env.NODE_ENV === 'development'
 
-// const baseUrlTemp = 'https://sit-qingdaobeer.4dage.com' // 测试环境
-const baseUrlTemp = 'http://192.168.20.61:8112' // 线下环境
+const baseUrlTemp = 'https://sit-qingdaobeer.4dage.com' // 测试环境
+// const baseUrlTemp = 'http://192.168.20.61:8112' // 线下环境
 
 const baseFlag = baseUrlTemp.includes('https://')
 

+ 4 - 4
src/utils/tableData.ts

@@ -77,10 +77,10 @@ export const I3tableC = [
   ['txt', '起始流水编号', 'length']
 ]
 export const I4tableC = [
-  // ['txt', '流程类型', 'typeKey'],
-  ['txt', '流程名称', 'name'],
-  ['text', '流程说明', 'remark', 50],
-  ['txtChange', '状态', 'enabled', { 0: '禁用', 1: '启用' }]
+  ['txt', '规则名称', 'name'],
+  ['text', '规则说明', 'remark', 50],
+  ['text2', '关联流程', 'guanLian', 200],
+  ['txtChange', '规则状态', 'enabled', { 0: '禁用', 1: '启用' }]
 ]
 
 export const I4tableC2 = [