wjx 1 tydzień temu
rodzic
commit
1d1cc8966d

+ 31 - 26
src/pages/launchSystemV3/tencenTasset/corpWechat/csgroup/components/group/addCsGroup.tsx

@@ -48,7 +48,7 @@ const AddCsGroup: React.FC<AddCsGroupProps> = ({ corpWechatList, userRotatePolic
     }
 
     return <Modal
-        title={<strong>新增客服组</strong>}
+        title={<strong>{initialValues?.id ? '修改客服组' : '新增客服组'} (<span style={{ color: 'red' }}>{accountId}</span>)</strong>}
         open={visible}
         onOk={handleOk}
         onCancel={onClose}
@@ -65,7 +65,7 @@ const AddCsGroup: React.FC<AddCsGroupProps> = ({ corpWechatList, userRotatePolic
             labelAlign='left'
             initialValues={initialValues || { type: 1 }} // 默认类型为客服组
         >
-            {!initialValues?.id && <Form.Item label={<strong>类型</strong>} name="type" rules={[{ required: true, message: '请选择类型!' }]}>
+            <Form.Item label={<strong>类型</strong>} name="type" rules={[{ required: true, message: '请选择类型!' }]}>
                 <Radio.Group
                     buttonStyle="solid"
                     optionType='button'
@@ -73,34 +73,39 @@ const AddCsGroup: React.FC<AddCsGroupProps> = ({ corpWechatList, userRotatePolic
                         { value: 1, label: '客服组' },
                         { value: 0, label: '客服组集' }
                     ]}
+                    disabled={initialValues?.id}
                 />
-            </Form.Item>}
+            </Form.Item>
             <Form.Item label={<strong>客服组{type == 1 ? '' : '集'}名称</strong>} name="csgroupName" rules={[{ required: true, message: `请输入客服组${type == 1 ? '' : '集'}名称!` }]}>
                 <Input placeholder={`请输入客服组${type == 1 ? '' : '集'}名称`} />
             </Form.Item>
-            <Form.Item label={<strong>腾讯企业</strong>} name="tencentCorpId" rules={[{ required: true, message: '请选择腾讯企业!' }]}>
-                <Select
-                    showSearch
-                    placeholder="请选择企业"
-                    filterOption={(input, option) =>
-                        ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
-                    }
-                    allowClear
-                    options={corpWechatList}
-                />
-            </Form.Item>
-            {type == 1 && <Form.Item label={<strong>客服组集</strong>} name="parentId">
-                <Select
-                    showSearch
-                    placeholder="请选择客服组集"
-                    filterOption={(input, option) =>
-                        ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
-                    }
-                    allowClear
-                    options={localCorpCsgroupList}
-                />
-            </Form.Item>}
-            {!parentId && <Form.Item label={<strong>切号策略</strong>} name="policyId">
+
+            {type == 1 && <>
+                <Form.Item label={<strong>腾讯企业</strong>} name="tencentCorpId" rules={[{ required: true, message: '请选择腾讯企业!' }]}>
+                    <Select
+                        showSearch
+                        placeholder="请选择企业"
+                        filterOption={(input, option) =>
+                            ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
+                        }
+                        allowClear
+                        disabled={initialValues?.id}
+                        options={corpWechatList}
+                    />
+                </Form.Item>
+                <Form.Item label={<strong>客服组集</strong>} name="parentId">
+                    <Select
+                        showSearch
+                        placeholder="请选择客服组集"
+                        filterOption={(input, option) =>
+                            ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
+                        }
+                        allowClear
+                        options={localCorpCsgroupList}
+                    />
+                </Form.Item>
+            </>}
+            {(initialValues?.id ? !initialValues?.parentId : !parentId) && <Form.Item label={<strong>切号策略</strong>} name="policyId">
                 <Select
                     showSearch
                     placeholder="请选择切号策略"

+ 1 - 1
src/pages/launchSystemV3/tencenTasset/corpWechat/csgroup/components/group/groupUserEdit.tsx

@@ -45,7 +45,7 @@ const GroupUserEdit: React.FC<GroupUserEditProps> = ({ idList, visible, onClose,
             colon={false}
             layout='vertical'
         >
-            <Form.Item label={<strong>归属客服池</strong>} name="poolType" rules={[{ required: true, message: '请选择归属客服池!' }]}>
+            <Form.Item label={<strong>归属客服池</strong>} name="poolType" rules={[{ required: idList?.length > 0 ? false : true, message: '请选择归属客服池!' }]}>
                 <Select
                     showSearch
                     placeholder="归属客服池"

+ 1 - 1
src/pages/launchSystemV3/tencenTasset/corpWechat/csgroup/components/group/groupUserInfo.tsx

@@ -167,7 +167,7 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
                                     width: 110,
                                     align: 'center',
                                     render(value) {
-                                        return <span style={{ fontSize: 12 }}>{value && value === 0 ? value : '--'}</span>
+                                        return <span style={{ fontSize: 12 }}>{(value || value === 0) ? value : '--'}</span>
                                     }
                                 },
                                 {

+ 7 - 10
src/pages/launchSystemV3/tencenTasset/corpWechat/csgroup/components/group/index.tsx

@@ -10,7 +10,7 @@ import AddCsGroup from './addCsGroup';
 const Group: React.FC<{ adAccountId?: number }> = ({ adAccountId }) => {
 
     /**********************************/
-    const [queryParamsNew, setQueryParamsNew] = useState<GetCustomerServiceGroupListProps>({ pageNum: 1, pageSize: 20, accountId: adAccountId })
+    const [queryParamsNew, setQueryParamsNew] = useState<GetCustomerServiceGroupListProps>({ pageNum: 1, pageSize: 20 })
 
     const [visible, setVisible] = useState<boolean>(false);
     const [corpWechatList, setCorpWechatList] = useState<{ label: string, value: string }[]>([]);
@@ -38,13 +38,11 @@ const Group: React.FC<{ adAccountId?: number }> = ({ adAccountId }) => {
     }, [])
 
     useEffect(() => {
-        if (adAccountId) {
-            getList()
-        }
-    }, [adAccountId])
+        getList()
+    }, [])
 
     const getList = () => {
-        getLocalCorpCsgroupListAll.run({ type: 0, accountId: adAccountId }).then((res) => {
+        getLocalCorpCsgroupListAll.run({ type: 0 }).then((res) => {
             if (res && res.length > 0) {
                 setLocalCorpCsgroupList(res.map((item: { csgroupName: string; id: string; }) => ({ label: item.csgroupName, value: item.id })));
             }
@@ -52,10 +50,8 @@ const Group: React.FC<{ adAccountId?: number }> = ({ adAccountId }) => {
     }
 
     useEffect(() => {
-        if (adAccountId) {
-            getCustomerServiceGroupList.run({ ...queryParamsNew, accountId: adAccountId })
-        }
-    }, [queryParamsNew, adAccountId])
+        getCustomerServiceGroupList.run({ ...queryParamsNew })
+    }, [queryParamsNew])
 
     const handleEdit = (data: any) => {
         setInitialValues(data)
@@ -65,6 +61,7 @@ const Group: React.FC<{ adAccountId?: number }> = ({ adAccountId }) => {
     return <>
         <div className="flexStart" style={{ gap: 8, marginBottom: 16 }}>
             <Input.Search style={{ width: 200 }} enterButton placeholder='请输入客服组名称' onSearch={(e) => setQueryParamsNew({ ...queryParamsNew, csgroupName: e, pageNum: 1 })} allowClear />
+            <Input.Search style={{ width: 190 }} enterButton placeholder='请输入媒体账户' onSearch={(e) => setQueryParamsNew({ ...queryParamsNew, accountId: e, pageNum: 1 })} allowClear />
             <Select
                 showSearch
                 placeholder="请选择企业"

+ 1 - 1
src/pages/launchSystemV3/tencenTasset/corpWechat/csgroup/components/group/settingsEnterprise.tsx

@@ -135,7 +135,7 @@ const SettingsEnterprise: React.FC<IProps> = ({ adAccountId, data, visible, onCl
 
 
     return <Modal
-        title={<strong>设置客服</strong>}
+        title={<strong>设置客服(<span style={{ color: 'red' }}>{adAccountId}</span>)</strong>}
         open={visible}
         onCancel={onClose}
         onOk={handleOk}

+ 1 - 1
src/services/adqV3/global.ts

@@ -1030,7 +1030,7 @@ export async function getApplicationDetailApi(id: number) {
 export interface GetCustomerServiceGroupListProps {
     pageNum: number,
     pageSize: number,
-    accountId?: number,
+    accountId?: string,
     csgroupName?: string, // 客服组名称
     tencentCorpId?: string, // 企业微信ID
     parentId?: number, // 父级ID