Perbaikan Project PPOB
This commit is contained in:
parent
a346ffd8f1
commit
d5f3d59a32
|
@ -175,7 +175,7 @@ export const CategoryComponent = observer((props) => {
|
|||
}}
|
||||
>
|
||||
<List.Item.Meta
|
||||
className={["cariparkir-container"].join(" ")}
|
||||
className={[""].join(" ")}
|
||||
title={item.code}
|
||||
description={
|
||||
<div style={{}}>
|
||||
|
|
|
@ -265,7 +265,7 @@ export const PartnerComponent = observer((props) => {
|
|||
}}
|
||||
>
|
||||
<List.Item.Meta
|
||||
className={["cariparkir-container"].join(" ")}
|
||||
className={[""].join(" ")}
|
||||
title={item.code}
|
||||
description={
|
||||
<div style={{}}>
|
||||
|
@ -275,7 +275,7 @@ export const PartnerComponent = observer((props) => {
|
|||
<small>Npwp : {item.npwp}</small> <br />
|
||||
<small>Address : {item.address}</small>
|
||||
</div>
|
||||
<Space size="middle">
|
||||
<Space size="small">
|
||||
<Button
|
||||
type={
|
||||
item?.status === true ? "danger" : "primary"
|
||||
|
@ -359,7 +359,7 @@ export const PartnerComponent = observer((props) => {
|
|||
rules={[
|
||||
idData
|
||||
? { required: false }
|
||||
: { required: true, message: "Please input password name!" },
|
||||
: { required: true, message: "Please input name!" },
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
|
|
|
@ -343,7 +343,7 @@ export const ProductComponent = observer((props) => {
|
|||
}}
|
||||
>
|
||||
<List.Item.Meta
|
||||
className={["cariparkir-container"].join(" ")}
|
||||
className={[""].join(" ")}
|
||||
title={item.product_code}
|
||||
description={
|
||||
<div style={{}}>
|
||||
|
|
|
@ -178,7 +178,7 @@ export const SubcategoryComponent = observer((props) => {
|
|||
}}
|
||||
>
|
||||
<List.Item.Meta
|
||||
className={["cariparkir-container"].join(" ")}
|
||||
className={[""].join(" ")}
|
||||
title={item.code}
|
||||
description={
|
||||
<div style={{}}>
|
||||
|
|
|
@ -281,7 +281,7 @@ export const SupplierComponent = observer((props) => {
|
|||
}}
|
||||
>
|
||||
<List.Item.Meta
|
||||
className={["cariparkir-container"].join(" ")}
|
||||
className={[""].join(" ")}
|
||||
title={item.code}
|
||||
description={
|
||||
<div style={{}}>
|
||||
|
|
|
@ -280,7 +280,7 @@ export const DetailUser = observer(() => {
|
|||
"detail gambar"
|
||||
);
|
||||
return (
|
||||
<div className={["ppob-container"].join(" ")}>
|
||||
<div className={[""].join(" ")}>
|
||||
<BreadcumbComponent data={routeData} />
|
||||
<Card>
|
||||
<Row style={{ marginBottom: 10 }}>
|
||||
|
|
|
@ -1,141 +0,0 @@
|
|||
import React from 'react';
|
||||
import { Image, Modal, Upload, message } from 'antd';
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { http } from "../utils/http";
|
||||
|
||||
function getBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => resolve(reader.result);
|
||||
reader.onerror = error => reject(error);
|
||||
});
|
||||
}
|
||||
|
||||
export class PicturesWall extends React.Component {
|
||||
state = {
|
||||
previewVisible: false,
|
||||
previewImage: '',
|
||||
previewTitle: '',
|
||||
fileList: [],
|
||||
};
|
||||
|
||||
handleCancel = () => this.setState({ previewVisible: false });
|
||||
|
||||
handlePreview = async file => {
|
||||
if (!file.url && !file.preview) {
|
||||
file.preview = await getBase64(file.originFileObj);
|
||||
}
|
||||
|
||||
this.setState({
|
||||
previewImage: file.url || file.preview,
|
||||
previewTitle: file.name || file.url.substring(file.url.lastIndexOf('/') + 1),
|
||||
previewVisible: true,
|
||||
});
|
||||
};
|
||||
|
||||
handlePreviewCancel = () => {
|
||||
this.setState({
|
||||
previewVisible: false,
|
||||
});
|
||||
};
|
||||
|
||||
handleChange = ({ fileList }, info) => {
|
||||
|
||||
// if (this.props.maxUpload) {
|
||||
// if (fileList.length > this.props.maxUpload) {
|
||||
// fileList.splice(0, 1)
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (info.file.status !== 'uploading') {
|
||||
// console.log(info.file, info.fileList);
|
||||
// }
|
||||
// if (info.file.status === 'done') {
|
||||
// message.success(`${info.file.name} file uploaded successfully`);
|
||||
// } else if (info.file.status === 'error') {
|
||||
// message.error(`${info.file.name} file upload failed.`);
|
||||
// }
|
||||
|
||||
this.setState({ fileList })
|
||||
};
|
||||
|
||||
render() {
|
||||
const { previewVisible, previewImage, fileList, previewTitle, handlePreviewCancel } = this.state;
|
||||
const uploadButton = (
|
||||
<div>
|
||||
<PlusOutlined />
|
||||
<div style={{ marginTop: 8 }}>Upload</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Upload
|
||||
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
|
||||
listType="picture-card"
|
||||
fileList={fileList}
|
||||
accept={'.png, .jpg, .jpeg, .PNG, .JPG, .JPEG'}
|
||||
onPreview={this.handlePreview}
|
||||
onChange={this.handleChange}
|
||||
beforeUpload={(file) => {
|
||||
console.log({ file })
|
||||
http.uploadAntd({
|
||||
file,
|
||||
onError() {
|
||||
|
||||
},
|
||||
onProgress(event) {
|
||||
console.log({ event })
|
||||
},
|
||||
onSuccess: (res) => {
|
||||
if (this.props.onUpload) {
|
||||
const { fileList } = this.state
|
||||
const index = fileList.findIndex(d => d.uid === file.uid)
|
||||
|
||||
if (fileList.length > this.props.maxUpload) {
|
||||
this.setState({
|
||||
fileList: []
|
||||
}) && this.props.onUpload()
|
||||
message.error('Upload foto tidak boleh melebihi batas maksimal!');
|
||||
} else {
|
||||
fileList[index].path = res.body.path
|
||||
this.setState({
|
||||
...fileList
|
||||
})
|
||||
this.props.onUpload(fileList)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return false;
|
||||
}}
|
||||
{...(this.props.uploadProps || {})}
|
||||
>
|
||||
{/* {fileList.length > this.props.maxUpload ?
|
||||
this.setState({
|
||||
fileList: []
|
||||
}) && this.props.onUpload() && null
|
||||
:
|
||||
''} */}
|
||||
{fileList.length >= this.props.maxUpload ? '' : uploadButton}
|
||||
</Upload>
|
||||
|
||||
<Modal
|
||||
visible={previewVisible}
|
||||
title={previewTitle}
|
||||
footer={null}
|
||||
onCancel={this.handleCancel}
|
||||
>
|
||||
<Image
|
||||
onClick={this.handleCancel}
|
||||
src={previewImage}
|
||||
/>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PicturesWall;
|
|
@ -366,7 +366,7 @@ export const Payback = observer(() => {
|
|||
}}
|
||||
>
|
||||
<List.Item.Meta
|
||||
className={["cariparkir-container"].join(" ")}
|
||||
className={[""].join(" ")}
|
||||
title={item.userData_name}
|
||||
description={
|
||||
<div style={{}}>
|
||||
|
|
|
@ -304,11 +304,39 @@ export const PaybackCreated = observer(() => {
|
|||
}}
|
||||
>
|
||||
<List.Item.Meta
|
||||
className={["cariparkir-container"].join(" ")}
|
||||
className={[""].join(" ")}
|
||||
title={item.name}
|
||||
description={
|
||||
<div style={{}}>
|
||||
<small>Amount: {item.amount}</small>
|
||||
<br/>
|
||||
<div style={{marginTop:5}}>
|
||||
<small>Status : </small>
|
||||
<Tag
|
||||
color={
|
||||
item.status === 0
|
||||
? "purple"
|
||||
: item.status === 1
|
||||
? "blue"
|
||||
: item.status === 2
|
||||
? "warning"
|
||||
: item.status === 3
|
||||
? "success"
|
||||
: "red"
|
||||
}
|
||||
>
|
||||
{item.status === 0
|
||||
? "Pending"
|
||||
: item.status === 1
|
||||
? "Success"
|
||||
: item.status === 2
|
||||
? "Failed"
|
||||
: item.status === 3
|
||||
? "Approved"
|
||||
: "Rejected"}
|
||||
</Tag>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
|
|
|
@ -46,7 +46,7 @@ export const Category = observer(() => {
|
|||
];
|
||||
|
||||
return (
|
||||
<div className={["ppob-container"].join(" ")}>
|
||||
<div className={[""].join(" ")}>
|
||||
<BreadcumbComponent data={routeData} />
|
||||
<Card>
|
||||
<Row style={{ marginBottom: 20 }}>
|
||||
|
|
|
@ -152,7 +152,7 @@ export const Product = observer(() => {
|
|||
};
|
||||
|
||||
return (
|
||||
<div className={["ppob-container"].join(" ")}>
|
||||
<div className={[""].join(" ")}>
|
||||
<BreadcumbComponent data={routeData}/>
|
||||
<Card>
|
||||
<div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useContext, useEffect } from "react";
|
||||
import {Card, Col, Row, Table, Typography} from "antd";
|
||||
import { Card, Col, Row, Table, Typography, Tag } from "antd";
|
||||
import { BreadcumbComponent } from "../../component/BreadcumbComponent";
|
||||
import { LINKS } from "../../routes/app";
|
||||
import { useStore } from "../../utils/useStore";
|
||||
|
@ -25,7 +25,7 @@ export const ProductDetail = observer(() => {
|
|||
name: <span style={{ fontWeight: "bold" }}>Produk</span>,
|
||||
},
|
||||
{
|
||||
route: LINKS.PRODUCT_DETAIL.replace(':id', `${id}`),
|
||||
route: LINKS.PRODUCT_DETAIL.replace(":id", `${id}`),
|
||||
name: <span style={{ fontWeight: "bold" }}>Detail Produk</span>,
|
||||
},
|
||||
];
|
||||
|
@ -78,7 +78,9 @@ export const ProductDetail = observer(() => {
|
|||
key: "endDate",
|
||||
render: (text) => {
|
||||
return (
|
||||
<Text>{text ? format(parseISO(text), "dd MMMM yyyy") : "Sampai Sekarang"}</Text>
|
||||
<Text>
|
||||
{text ? format(parseISO(text), "dd MMMM yyyy") : "Sampai Sekarang"}
|
||||
</Text>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
@ -99,7 +101,7 @@ export const ProductDetail = observer(() => {
|
|||
: null;
|
||||
|
||||
return (
|
||||
<div className={["ppob-container"].join(" ")}>
|
||||
<div className={[""].join(" ")}>
|
||||
<BreadcumbComponent data={routeData} />
|
||||
<Card>
|
||||
<Title strong>Product Detail</Title>
|
||||
|
|
Loading…
Reference in New Issue
Block a user