Commit 7f36328a887447e879a8d54fa66e31906a94687f
Merge branch 'Shinner-sale-task' into 'master'
零售任务分配设置--更换审批进度组件 See merge request !258
Showing
2 changed files
with
9 additions
and
42 deletions
src/pages/order3/SaleTask/components/ApprovalProgressModal.tsx deleted
1 | -import ApprovalProgress from "@/components/ApprovalProgress"; | |
2 | -import { Button, Modal } from "antd"; | |
3 | -import React from "react"; | |
4 | -import { useStore } from "../store"; | |
5 | - | |
6 | -export default function ApprovalProgressModal() { | |
7 | - const { approvalProgressModalInfo, setApprovalProgressModalInfo } = | |
8 | - useStore(); | |
9 | - | |
10 | - const onCancel = () => setApprovalProgressModalInfo({ visible: false }); | |
11 | - | |
12 | - return ( | |
13 | - <Modal | |
14 | - title={`${ | |
15 | - approvalProgressModalInfo.title | |
16 | - ? approvalProgressModalInfo.title + "-" | |
17 | - : "" | |
18 | - }审批进度`} | |
19 | - open={approvalProgressModalInfo.visible} | |
20 | - onCancel={onCancel} | |
21 | - maskClosable={false} | |
22 | - destroyOnClose | |
23 | - footer={[ | |
24 | - <Button key="cancel" onClick={onCancel}> | |
25 | - 关闭 | |
26 | - </Button>, | |
27 | - ]} | |
28 | - > | |
29 | - <ApprovalProgress orderNo={approvalProgressModalInfo.orderNo} /> | |
30 | - </Modal> | |
31 | - ); | |
32 | -} |
src/pages/order3/SaleTask/index.tsx
... | ... | @@ -15,7 +15,7 @@ import { history } from "umi"; |
15 | 15 | import moment, { Moment } from "moment"; |
16 | 16 | import useInitial from "@/hooks/useInitail"; |
17 | 17 | import { Provider, useStore } from "./store"; |
18 | -import ApprovalProgressModal from "./components/ApprovalProgressModal"; | |
18 | +import { default as ApprovalProgressModal } from "@/pages/stock/AdvanceProgress/components/ApproveModal"; | |
19 | 19 | import EntryTaskPreview from "./components/EntryTaskPreview"; |
20 | 20 | import { OrderTaskApprovalType } from "./entity"; |
21 | 21 | import AdviserTaskPreview from "./components/AdviserTaskPreview"; |
... | ... | @@ -31,12 +31,8 @@ export default () => ( |
31 | 31 | ); |
32 | 32 | |
33 | 33 | function SaleTaskList() { |
34 | - const { | |
35 | - isReadOnly, | |
36 | - setShopTaskItem, | |
37 | - setIsReadOnly, | |
38 | - setApprovalProgressModalInfo, | |
39 | - } = useStore(); | |
34 | + const { isReadOnly, setShopTaskItem, setIsReadOnly } = useStore(); | |
35 | + const [approve, setApprove] = useState({ visible: false, orderNo: "" }); | |
40 | 36 | const [approveOpen, setApproveOpen] = useState(false); |
41 | 37 | const [targetMonth, setTargetMonth] = useState(moment()); |
42 | 38 | const [etpVisible, setEtpVisible] = useState(false); |
... | ... | @@ -77,9 +73,8 @@ function SaleTaskList() { |
77 | 73 | |
78 | 74 | // 查看流程进度 |
79 | 75 | const viewProcess = () => { |
80 | - setApprovalProgressModalInfo({ | |
76 | + setApprove({ | |
81 | 77 | visible: true, |
82 | - title: `【${moment(targetMonth).format("YYYY-MM")}】月度零售任务审批进度`, | |
83 | 78 | orderNo: data.approvalNumber, |
84 | 79 | }); |
85 | 80 | }; |
... | ... | @@ -377,7 +372,11 @@ function SaleTaskList() { |
377 | 372 | > |
378 | 373 | <SeriesTaskPreview params={seriesTaskParams} /> |
379 | 374 | </Modal> |
380 | - <ApprovalProgressModal /> | |
375 | + <ApprovalProgressModal | |
376 | + visible={approve.visible} | |
377 | + orderNo={approve.orderNo} | |
378 | + onCancel={() => setApprove({ visible: false, orderNo: "" })} | |
379 | + /> | |
381 | 380 | <ApproveModal |
382 | 381 | callback={submitSaleTask} |
383 | 382 | open={approveOpen} | ... | ... |