IO-1325 Automatically populate 3rd party modal.
This commit is contained in:
@@ -19,7 +19,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(Jobd3RdPartyModal);
|
export default connect(mapStateToProps, mapDispatchToProps)(Jobd3RdPartyModal);
|
||||||
|
|
||||||
export function Jobd3RdPartyModal({ bodyshop, jobId }) {
|
export function Jobd3RdPartyModal({ bodyshop, jobId, job }) {
|
||||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
@@ -33,6 +33,11 @@ export function Jobd3RdPartyModal({ bodyshop, jobId }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const showModal = () => {
|
const showModal = () => {
|
||||||
|
form.setFieldsValue({
|
||||||
|
ded_amt: job.ded_amt,
|
||||||
|
deprecieation: job.depreciation_taxes,
|
||||||
|
cust_gst: job.cust_gst,
|
||||||
|
});
|
||||||
setIsModalVisible(true);
|
setIsModalVisible(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -42,6 +47,7 @@ export function Jobd3RdPartyModal({ bodyshop, jobId }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
|
form.resetFields();
|
||||||
setIsModalVisible(false);
|
setIsModalVisible(false);
|
||||||
};
|
};
|
||||||
const handleFinish = (values) => {
|
const handleFinish = (values) => {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const mapDispatchToProps = (dispatch) => ({});
|
|||||||
|
|
||||||
export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) {
|
export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) {
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const { id: jobId } = printCenterModal.context;
|
const { id: jobId, job } = printCenterModal.context;
|
||||||
const tempList = TemplateList("job", {});
|
const tempList = TemplateList("job", {});
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const JobsReportsList = Object.keys(tempList)
|
const JobsReportsList = Object.keys(tempList)
|
||||||
@@ -54,7 +54,7 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) {
|
|||||||
extra={
|
extra={
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
<PrintCenterJobsLabels jobId={jobId} />
|
<PrintCenterJobsLabels jobId={jobId} />
|
||||||
<Jobd3RdPartyModal jobId={jobId} />
|
<Jobd3RdPartyModal jobId={jobId} job={job} />
|
||||||
<Input.Search
|
<Input.Search
|
||||||
onChange={(e) => setSearch(e.target.value)}
|
onChange={(e) => setSearch(e.target.value)}
|
||||||
value={search}
|
value={search}
|
||||||
|
|||||||
Reference in New Issue
Block a user