审核状态

feature/price_manager
Lei OT 1 year ago
parent fa0550dfdb
commit f323f0b511

@ -21,6 +21,9 @@
"preview": "Preview",
"Total": "Total",
"Action": "Action",
"Import": "Import",
"Export": "Export",
"Copy": "Copy",
"Login": "Login",
"Username": "Username",

@ -16,11 +16,27 @@
"Rejected": "Rejected",
"Published": "Published"
},
"Status": "Status",
"Title": "Title",
"Vendor": "Vendor",
"AuState": "Audit State",
"CreatedBy": "Created By",
"CreateDate": "Create Date",
"AuditedBy": "Audited By",
"AuditDate": "Audit Date"
"AuditDate": "Audit Date",
"Quotation": "Quotation",
"Unit": "Unit",
"GroupSize": "Group Size",
"UseDates": "Use Dates",
"Weekdays": "Weekdays",
"AgeType": {
"Type": "Age Type",
"Adult": "Adult",
"Child": "Child"
},
"#": "#"
}

@ -21,6 +21,9 @@
"preview": "预览",
"Total": "总数",
"Action": "操作",
"Import": "导入",
"Export": "导出",
"Copy": "复制",
"Login": "登录",
"Username": "账号",

@ -16,11 +16,27 @@
"Rejected": "已拒绝",
"Published": "已发布"
},
"Status": "状态",
"Title": "名称",
"Vendor": "供应商",
"AuState": "审核状态",
"CreatedBy": "提交人员",
"CreateDate": "提交时间",
"Auditors": "审核人员",
"AuditDate": "审核时间"
"AuditedBy": "审核人员",
"AuditDate": "审核时间",
"Quotation": "报价",
"Unit": "单位",
"GroupSize": "人等",
"UseDates": "使用日期",
"Weekdays": "有效日",
"AgeType": {
"Type": "人群",
"Adult": "成人",
"Child": "儿童"
},
"#": "#"
}

@ -0,0 +1,12 @@
import { Select } from 'antd';
import { useProductsAuditStates } from '@/hooks/useProductsSets';
const AuditStateSelector = ({ ...props }) => {
const states = useProductsAuditStates();
return (
<>
<Select labelInValue allowClear options={states} {...props}/>
</>
);
};
export default AuditStateSelector;

@ -5,10 +5,13 @@ import { DATE_FORMAT, SMALL_DATETIME_FORMAT } from '@/config';
import useFormStore from '@/stores/Form';
import usePresets from '@/hooks/usePresets';
import { useTranslation } from 'react-i18next';
import SearchInput from './SearchInput';
import { fetchJSON } from '@/utils/request';
import { HT_HOST } from '@/config';
import SearchInput from './SearchInput';
import AuditStateSelector from './AuditStateSelector';
//
export const fetchVendorList = async () => {
@ -216,19 +219,8 @@ function getFields(props) {
item(
'auditState',
99,
<Form.Item name={`auditState`} initialValue={at(props, 'initialValue.auditState')[0] || { value: '0', label: 'Status' }}>
<Select
style={{ width: '100%' }}
labelInValue
allowClear
options={[ // todo:
{ value: '0', label: 'New' },
{ value: '1', label: 'Pending' },
{ value: '2', label: 'Approve' },
// { value: '3', label: 'Rejected' },
{ value: '4', label: 'Published' },
]}
/>
<Form.Item name={`auditState`} initialValue={at(props, 'initialValue.auditState')[0] || { value: '', label: 'Status' }}>
<AuditStateSelector />
</Form.Item>,
fieldProps?.auditState?.col || 3
),

@ -14,7 +14,7 @@ const HeaderWrapper = ({ children, header, ...props }) => {
<Header className='header px-6 h-10 ' style={{ background: 'white' }}>
<Flex justify={'space-between'} align={'center'} className='h-full'>
{/* {header} */}
<div className="flex-auto">{header}</div>
<div className="grow h-full">{header}</div>
<BackBtn />
</Flex>
</Header>

@ -27,17 +27,17 @@ export const useProductsTypes = () => {
};
export const useProductsAuditStatus = () => {
export const useProductsAuditStates = () => {
const [types, setTypes] = useState([]);
const { t, i18n } = useTranslation();
useEffect(() => {
const newData = [
{ value: '0', label: 'New' },
{ value: '1', label: 'Pending' },
{ value: '2', label: 'Approve' },
{ value: '3', label: 'Rejected' },
{ value: '4', label: 'Published' },
{ value: '0', label: t('products:auditState.New') },
{ value: '1', label: t('products:auditState.Pending') },
{ value: '2', label: t('products:auditState.Approve') },
{ value: '3', label: t('products:auditState.Rejected') },
{ value: '4', label: t('products:auditState.Published') },
];
setTypes(newData);
}, [i18n.language]);

@ -17,6 +17,7 @@ function Index() {
useEffect(() => {}, []);
const showTotal = (total) => `Total ${total} items`;
const columns = [
{ title: t('products:Vendor'), key: 'vendor', dataIndex: 'travel_agency_name' },
{ title: t('products:CreatedBy'), key: 'created_by', dataIndex: 'created_by' },
@ -38,9 +39,6 @@ function Index() {
return (
<Space direction='vertical' style={{ width: '100%' }}>
<SearchForm
initialValue={{
dates: [dayjs().subtract(2, 'M').startOf('M'), dayjs().endOf('M')],
}}
fieldsConfig={{
shows: ['agency', 'auditState', 'dates', 'keyword'], // todo:
fieldProps: {
@ -49,12 +47,16 @@ function Index() {
},
sort: { agency: 1, auditState: 2, keyword: 100},
}}
initialValue={{
dates: [dayjs().subtract(2, 'M').startOf('M'), dayjs().endOf('M')],
auditState: { value: '', label: t('products:Status')},
}}
onSubmit={(err, formVal, filedsVal) => {
}}
/>
<Row>
<Col md={24} lg={24} xxl={24}>
<Table bordered={true} columns={columns} dataSource={productsList} pagination={{ defaultPageSize: 20, showTotal: showTotal }} loading={loading} />
<Table bordered={true} columns={columns} dataSource={productsList} pagination={{ defaultPageSize: 20, showTotal: showTotal }} loading={loading} rowKey={'travel_agency_id'} />
</Col>
<Col md={24} lg={24} xxl={24}></Col>
</Row>

Loading…
Cancel
Save