Browse Source

feat: 更新联系人检索接口

lanjianrong 4 years ago
parent
commit
8eb40f1021

+ 2 - 2
src/components/AuditContent/index.tsx

@@ -1,4 +1,4 @@
-import { userStore } from '@/store/mobx'
+import { tenderStore, userStore } from '@/store/mobx'
 import { iAuditHistoryState, iAuditor } from '@/types/safe'
 import { iAccountGroupItem, iUserInfo } from '@/types/setting'
 import { auditConsts } from '@/utils/common/constStatus'
@@ -83,7 +83,7 @@ const Index: React.FC<iAuditContentProps> = props => {
     }
   }, [ visible.check, visible.reCheck ])
   const initGroupList = async (serach?: string) => {
-    const data = await getUserGroup({ name: serach })
+    const data = await getUserGroup({ name: serach, bidsectionId: tenderStore.bid })
     setGroups(data)
   }
   const handleVisibleChange = (type: string, isShow: boolean) => {

+ 4 - 4
src/components/Button/index.module.scss

@@ -54,8 +54,8 @@
 .submitButton {
   :global(.ant-btn) {
     color: #ffffff;
-    background-color: #1e7e34;
-    border-color: #1c7430;
+    background-color: #28a745;
+    border-color: #28a745;
   }
   :global(.ant-btn:hover) {
     background-color: #218838;
@@ -72,8 +72,8 @@
 
   :global(.ant-btn:not(:hover)) {
     color: #ffffff;
-    background-color: #1e7e34;
-    border-color: #1c7430;
+    background-color: #28a745;
+    border-color: #28a745;
   }
 }
 

+ 2 - 2
src/pages/Management/Tender/Member/index.tsx

@@ -3,7 +3,7 @@ import { ZhButton, ZhDangerButton } from '@/components/Button'
 import Header from '@/components/Header'
 import Slot from '@/components/Header/slot'
 import SvgIcon from '@/components/SvgIcon'
-import { userStore } from '@/store/mobx'
+import { tenderStore, userStore } from '@/store/mobx'
 import { iAccountGroupItem, iPermissionData, iUserInfo } from '@/types/setting'
 import { getUserGroup } from '@/utils/common/user'
 import consts from '@/utils/consts'
@@ -184,7 +184,7 @@ const Member: React.FC<RouteComponentProps> = props => {
     }
   ]
   const initGroupList = async (serach?: string) => {
-    const data = await getUserGroup({ name: serach, hasOwner: false })
+    const data = await getUserGroup({ name: serach, hasOwner: false, bidsectionId: tenderStore.bid })
     setState({ ...state, groups: data })
   }
 

+ 1 - 1
src/pages/Management/Tender/Member/modal.tsx

@@ -27,7 +27,7 @@ const PermissionSettingModal: React.FC<iPermissionSettingProps> = ({ onCreate, o
   }, [ visible ])
   const checkboxOptions: CheckboxOptionType[] = [
     { label: '查看所有', value: 'access' },
-    { label: '创建', value: 'add' },
+    { label: '创建、编辑', value: 'add' },
     { label: '删除', value: 'delete' }
   ]
   const columns: ColumnsType<iPermissionData> = [

+ 2 - 2
src/pages/Quality/Content/Info/Detail/components/Modal/index.tsx

@@ -1,7 +1,7 @@
 import { GroupItem } from '@/components/AuditContent'
 import Authorization from '@/components/Authorization'
 import { ZhAuditBackButton, ZhButton, ZhCloseButton, ZhSubmitButton } from '@/components/Button'
-import { userStore } from '@/store/mobx'
+import { tenderStore, userStore } from '@/store/mobx'
 import { iAuditor, iLatestAuditorState } from '@/types/safe'
 import { iAccountGroupItem, iUserInfo } from '@/types/setting'
 import { getUserGroup } from '@/utils/common/user'
@@ -114,7 +114,7 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
     }
   }, [ visible ])
   const initGroupList = async (serach?: string) => {
-    const data = await getUserGroup({ name: serach })
+    const data = await getUserGroup({ name: serach, bidsectionId: tenderStore.bid })
     setGroups(data)
   }
 

+ 3 - 3
src/pages/Safe/Content/List/modal.tsx

@@ -58,10 +58,10 @@ const SafeCreateForm: React.FC<iSafeCreateFormProps> = ({
           <Input />
         </Form.Item>
         {/* <span className={[ styles.position, "pi-link-blue" ].join(" ")}>部位设置</span> */}
-        <Form.Item name="position" label="部位" rules={[ { required: true, message: '请选择' } ]}>
+        {/* <Form.Item name="position" label="部位" rules={[ { required: true, message: '请选择' } ]}> */}
           {/* <span className={[ styles.position, "pi-link-blue" ].join(" ")}>部位设置</span> */}
-          <Input />
-        </Form.Item>
+          {/* <Input /> */}
+        {/* </Form.Item> */}
         <Form.Item name="code" label="安全编号" rules={[ { required: true, message: '请输入/生成安全编号' } ]}>
           <Input addonAfter={<span className="pi-pd-lr-11"onClick={() => autoCode()}>自动编号</span>}/>
         </Form.Item>

+ 3 - 3
src/utils/common/api.ts

@@ -44,9 +44,9 @@ export async function apiGetGroupList() {
   return data
 }
 
-/** 获取账号列表(检索) */
-export async function apiGetAccountWithSearch(name?: string) {
-  const { data } = await request.get("/api/projectAccount/search", { name })
+/** 获取账号列表(检索标段下的成员账号) */
+export async function apiGetAccountWithSearch(bidsectionId: string, name?: string) {
+  const { data } = await request.get("/api/projectSetting/bid/account", { bidsectionId, name })
   return data
 }
 

+ 3 - 2
src/utils/common/user.ts

@@ -44,11 +44,12 @@ export const getUserGroupName = (key: number): iGroup | undefined =>{
 
 interface UserGroupQuery {
   name?: string
+  bidsectionId: string
   hasOwner?: boolean
 }
 // 根据group对用户列表进行分组
-export const getUserGroup = async ({ name = '', hasOwner = true } : UserGroupQuery) => {
-  const { code = -1, data = [] } = await apiGetAccountWithSearch(name)
+export const getUserGroup = async ({ name = '', bidsectionId = '', hasOwner = true } : UserGroupQuery) => {
+  const { code = -1, data = [] } = await apiGetAccountWithSearch(bidsectionId, name)
   const accountGroup: iAccountGroupItem[] = []
   if (code === consts.RET_CODE.SUCCESS) {
     for (const group of userStore.groupList) {