wjx 1 gün önce
ebeveyn
işleme
3395ffadee

+ 2 - 0
src/pages/weComTask/API/weChatApiLicense/index.ts

@@ -10,6 +10,8 @@ export interface GetLicenseAppListProps {
     expiredEnd?: string,
     licenseCheckStart?: string,
     licenseCheckEnd?: string
+    sortFiled?: string
+    sortAsc?: boolean
 }
 
 /**

+ 18 - 3
src/pages/weComTask/page/weChatApiLicense/enterprise/editCallUser.tsx

@@ -1,7 +1,7 @@
 import { getAdAccountAllOfMember } from "@/API/global";
 import { useAjax } from "@/Hook/useAjax";
 import { updateCallUserAppApi } from "@/pages/weComTask/API/weChatApiLicense";
-import { App, Form, Modal, Select } from "antd";
+import { App, Form, Modal, Radio, Select } from "antd";
 import React, { useEffect } from "react";
 
 interface EditCallUserProps {
@@ -27,7 +27,11 @@ export const EditCallUser: React.FC<EditCallUserProps> = ({ visible, onClose, on
     }, [])
 
     const handleOk = () => {
-        form.validateFields().then((values) => { 
+        form.validateFields().then((values) => {
+            if ((values?.userIdList?.length === 0 || values?.userIdList === undefined) && values?.bugStatus === undefined) {
+                message.error('请选择通知人员或者购买状态')
+                return
+            }
             updateCallUserApp.run({
                 ...values,
                 corpIdList: selectedRows.map(item => item.corpId)
@@ -38,7 +42,7 @@ export const EditCallUser: React.FC<EditCallUserProps> = ({ visible, onClose, on
                 }
             })
         })
-        
+
     }
 
     return <Modal
@@ -69,6 +73,17 @@ export const EditCallUser: React.FC<EditCallUserProps> = ({ visible, onClose, on
                     }
                 />
             </Form.Item>
+            <Form.Item label={<strong>购买状态</strong>} name="bugStatus">
+                <Select
+                    allowClear
+                    placeholder="请选择购买状态"
+                    showSearch
+                    options={[{ label: '已购买', value: 1 }, { label: '未购买', value: 0 }]}
+                    filterOption={(input, option) =>
+                        ((option?.label ?? '') as string).toLowerCase().includes(input.toLowerCase())
+                    }
+                />
+            </Form.Item>
         </Form>
     </Modal>
 }

+ 38 - 9
src/pages/weComTask/page/weChatApiLicense/enterprise/index.tsx

@@ -104,11 +104,26 @@ const Enterprise: React.FC = () => {
                     align: 'center',
                     render: (text) => text ? <Tag color="green">已开启状态检查</Tag> : <Tag color="red">未开启状态检查</Tag>
                 },
+                {
+                    title: '试用期已过天数',
+                    dataIndex: 'dayPassed',
+                    key: 'dayPassed',
+                    width: 60,
+                    align: 'center',
+                },
+                {
+                    title: '购买状态',
+                    dataIndex: 'bugStatus',
+                    key: 'bugStatus',
+                    width: 70,
+                    align: 'center',
+                    render: (text) => text ? <Tag color="green">已购买</Tag> : <Tag color="red">未购买</Tag>
+                },
                 {
                     title: '接口许可试用开始时间',
                     dataIndex: 'startTime',
                     key: 'startTime',
-                    width: 145,
+                    width: 135,
                     align: 'center',
                     ellipsis: true,
                     render: (text) => text || '--'
@@ -117,18 +132,20 @@ const Enterprise: React.FC = () => {
                     title: '接口许可试用到期时间',
                     dataIndex: 'endTime',
                     key: 'endTime',
-                    width: 145,
+                    width: 135,
                     align: 'center',
                     ellipsis: true,
+                    sorter: true,
                     render: (text) => text || '--'
                 },
                 {
                     title: '接口开启拦截校验时间',
                     dataIndex: 'licenseCheckTime',
                     key: 'licenseCheckTime',
-                    width: 145,
+                    width: 135,
                     align: 'center',
                     ellipsis: true,
+                    sorter: true,
                     render: (text) => text || '--'
                 },
                 {
@@ -151,10 +168,22 @@ const Enterprise: React.FC = () => {
                 defaultPageSize: 20,//默认初始的每页条数
                 current: getLicenseAppList?.data?.data?.current || 1,
                 pageSize: getLicenseAppList?.data?.data?.size || 20,
-                onChange: (page, pageSize) => {
-                    setQueryParams({ ...queryParams, pageNum: page, pageSize })
-                    setOldQueryParams({ ...oldQueryParams, pageNum: page, pageSize })
+            }}
+            onChange={(pagination, _, sortData: any) => {
+                let { current, pageSize } = pagination
+                let newQueryForm = JSON.parse(JSON.stringify(queryParams))
+                let newOldQueryParams = JSON.parse(JSON.stringify(oldQueryParams))
+                if (sortData && sortData?.order) {
+                    newQueryForm['sortAsc'] = sortData?.order === 'ascend' ? true : false
+                    newQueryForm['sortFiled'] = sortData?.field
+                } else {
+                    delete newQueryForm['sortAsc']
+                    delete newQueryForm['sortFiled']
                 }
+                newQueryForm.pageNum = current || newQueryForm.pageNum
+                newQueryForm.pageSize = pageSize || newQueryForm.pageSize
+                setQueryParams({ ...newQueryForm })
+                setOldQueryParams({ ...newOldQueryParams })
             }}
             rowSelection={{
                 selectedRowKeys: selectedRows?.map((item: any) => item?.corpId),
@@ -193,10 +222,10 @@ const Enterprise: React.FC = () => {
         />
 
         {/* 编辑呼叫用户 */}
-        {visible && <EditCallUser 
+        {visible && <EditCallUser
             selectedRows={selectedRows}
-            visible={visible} 
-            onClose={() => setVisible(false)} 
+            visible={visible}
+            onClose={() => setVisible(false)}
             onChange={() => {
                 setselectedRows([])
                 setVisible(false)