فهرست منبع

feat: 人员出入库增加撤回;侧边栏显示角色管理菜单

chenlei 1 ماه پیش
والد
کامیت
56a7c4ed61

+ 21 - 3
src/pages/D_storeManage/D3staff/D3edit/index.tsx

@@ -14,6 +14,7 @@ import {
   D3_APIcreate,
   D3_APIdel,
   D3_APIgetInfo,
+  D3_APIrevocation,
   D3_APIsaveApply,
   D3_APIsaveAudit,
   D3_APIsaveCreate,
@@ -184,7 +185,7 @@ function C21edit() {
 
   // 查看的按钮创建-提交-撤回
   const lookBtnFu = useCallback(
-    async (val: '创建' | '提交') => {
+    async (val: '创建' | '提交' | '撤回') => {
       const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
       // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
 
@@ -193,7 +194,12 @@ function C21edit() {
         rtf: JSON.stringify(rtf1.val || '')
       }
 
-      const res = val === '创建' ? await D3_APIsaveCreate(obj) : await D3_APIsaveApply(obj)
+      const res =
+        val === '创建'
+          ? await D3_APIsaveCreate(obj)
+          : val === '提交'
+          ? await D3_APIsaveApply(obj)
+          : await D3_APIrevocation(id)
 
       if (res.code === 0) {
         if (sollrDom.current) sollrDom.current.scrollTop = 0
@@ -201,7 +207,7 @@ function C21edit() {
         getInfoFu()
       }
     },
-    [getInfoFu, topInfo]
+    [getInfoFu, id, topInfo]
   )
 
   // 查看模式点击删除
@@ -237,6 +243,18 @@ function C21edit() {
           </Button>
         ) : null}
 
+        {btnFlagFu2(topInfo)['撤回'] ? (
+          <MyPopconfirm
+            txtK='撤回'
+            onConfirm={() => lookBtnFu('撤回')}
+            Dom={
+              <Button type='primary' danger>
+                撤回
+              </Button>
+            }
+          />
+        ) : null}
+
         {btnFlagFu2(topInfo)['审批'] ? (
           <Button type='primary' onClick={() => lookJumpFu('审批')}>
             审批

+ 1 - 1
src/pages/Layout/data.ts

@@ -282,7 +282,7 @@ const tabLeftArr: RouterType = [
         Com: React.lazy(() => import('../Z_system/Z4organization'))
       },
       {
-        id: 9900,
+        id: 750,
         name: '角色管理',
         path: '/role',
         Com: React.lazy(() => import('../Z_system/Z5role'))

+ 4 - 7
src/pages/Layout/index.tsx

@@ -152,13 +152,10 @@ function Layout() {
       })
 
       // 是管理员
-      // if (userInfo.isAdmin === 1) {
-      //   // push角色管理
-      //   isOkIdArr.push(9900)
-      // }
-
-      // 说需要显示全部列表
-      isOkIdArr.push(9900)
+      if (userInfo.isAdmin === 1) {
+        // push角色管理
+        isOkIdArr.push(750)
+      }
 
       //  手动打开一些页面
       // ;[9800, 9801, 9802, 9803].forEach(v => {

+ 4 - 1
src/pages/Z_system/Z5role/Z5edit.tsx

@@ -253,7 +253,10 @@ function Z5edit({ sId, closeFu, addTableFu, editTableFu }: Props) {
                         disabled={c.name === '角色管理'}
                         key={c.id}
                         checked={c.authority}
-                        onChange={e => onChange(e.target.checked, v.id, c.id)}
+                        onChange={e => {
+                          console.log(v.id, c.id)
+                          onChange(e.target.checked, v.id, c.id)
+                        }}
                       >
                         {c.name}
                         {c.name === '角色管理' ? '(超级管理员才有)' : ''}

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

@@ -67,3 +67,10 @@ export const D3_APIsaveApply = (data: any) => {
 export const D3_APIsaveAudit = (data: any) => {
   return http.post('cms/orderMember/audit', data)
 }
+
+/**
+ * 人员出入库-撤回
+ */
+export const D3_APIrevocation = (id: number) => {
+  return http.get(`cms/orderMember/revocation/${id}`)
+}