Commit 2568db0576b5c241a548555199f8e13981a8bad3
Merge remote-tracking branch 'origin/master' into cas
Showing
71 changed files
with
1291 additions
and
592 deletions
config/routers/capital.ts
... | ... | @@ -28,11 +28,19 @@ export default [ |
28 | 28 | component: './capital/StandardName' |
29 | 29 | }, |
30 | 30 | { |
31 | + path: '/ams/maintenance/stock', // 运维库存池查询 | |
32 | + component: './capital/Maintenance/StockQuery' | |
33 | + }, | |
34 | + { | |
35 | + path: '/ams/maintenance/standard/config/:disabled?', // 运维物品标准查询 | |
36 | + component: './capital/StandardMange' | |
37 | + }, | |
38 | + { | |
31 | 39 | path: '/ams/standardMange/receive/rules/goods/:id?/:name?', // 按物品领用规则 |
32 | 40 | component: './capital/ReceiveRules/subPages/GoodsDimension' |
33 | 41 | }, |
34 | 42 | { |
35 | - path: '/ams/standardMange/auth/goods/:id?', // 按物品授权分页列表 | |
43 | + path: '/ams/standardMange/auth/goods/:id?/:disabled?', // 按物品授权分页列表 | |
36 | 44 | component: './capital/ReceiveRules/subPages/GoodsDimension/components/PageAuthEdit' |
37 | 45 | }, |
38 | 46 | { | ... | ... |
src/pages/attendance/FieldService/subpages/WorkAddress/components/TravelAddressModal.tsx
... | ... | @@ -46,6 +46,9 @@ export default function ModalIndex(props: Props) { |
46 | 46 | if ((current.maxStayMinute || 0) >= 60) { |
47 | 47 | maxStayMinute = (current.maxStayMinute || 0) % 60; |
48 | 48 | maxStayHour = Math.floor((current.maxStayMinute || 0) / 60) |
49 | + } else { | |
50 | + maxStayMinute = (current.maxStayMinute || 0) | |
51 | + maxStayHour = 0 | |
49 | 52 | } |
50 | 53 | let feildsValue: any = { |
51 | 54 | ...current, |
... | ... | @@ -87,7 +90,7 @@ export default function ModalIndex(props: Props) { |
87 | 90 | // return; |
88 | 91 | // } |
89 | 92 | // } |
90 | - const maxStayMinute = params.maxStayMinute + params.maxStayHour * 60; | |
93 | + const maxStayMinute = (params.maxStayMinute || 0)+ (params.maxStayHour || 0) * 60; | |
91 | 94 | setLoading(true); |
92 | 95 | let _param = { |
93 | 96 | ...params, | ... | ... |
src/pages/capital/Maintenance/StockQuery/api.ts
0 → 100644
1 | +import request from '@/utils/request'; | |
2 | +import { AMS_HOST } from '@/utils/host'; | |
3 | +import { http } from '@/typing/http'; | |
4 | + | |
5 | +export interface ListParams { | |
6 | + /**是否代管物品 1代管 0被领用 */ | |
7 | + agent?: boolean; | |
8 | + /**资产类型 1固定资产 2低质品 3易耗品 */ | |
9 | + type?: number; | |
10 | + /**关键字 */ | |
11 | + keywords?: string; | |
12 | + /**库存来源类型 1.资产 2.配件 3.市场物料 */ | |
13 | + sourceType?: number; | |
14 | + /**状态 1正常2已报废3已变卖 */ | |
15 | + status?: number; | |
16 | + /**是否维修中 0正常1处理中 */ | |
17 | + repair?: boolean; | |
18 | + /**是否报废中 0正常1处理中 */ | |
19 | + scrap?: boolean; | |
20 | + /**是否变卖中 0正常1处理中 */ | |
21 | + sell?: boolean; | |
22 | + /**是否调拨中 0正常1处理中 */ | |
23 | + allocate?: boolean; | |
24 | + /**是否退回中 0正常1处理中 */ | |
25 | + transfer?: boolean; | |
26 | + /**管理人员姓名 | |
27 | + 216 */ | |
28 | + staffName?: string; | |
29 | + /** 物品唯一标识 */ | |
30 | + uniqueCode?: string; | |
31 | + pageSize?: number; | |
32 | + current?: number; | |
33 | +} | |
34 | +export interface ListItems { | |
35 | + poolId: number; | |
36 | + fids: string; | |
37 | + name: string; | |
38 | + type: number; | |
39 | + standardId: number; | |
40 | + code: string; | |
41 | + uniqueCode: string; | |
42 | + unit: string; | |
43 | + specList: StanderList.AuthSpecList, | |
44 | + assetShopId: number; | |
45 | + assetShopName: string; | |
46 | + useShopId: number; | |
47 | + useShopName: string; | |
48 | + storageTime: number; | |
49 | + receiveTime: number; | |
50 | + storageNum: number; | |
51 | + staffId: number; | |
52 | + staffName: string; | |
53 | + manager: string; | |
54 | + unitPrice: number; | |
55 | +} | |
56 | + | |
57 | +export function getDateApi(params: ListParams): http.PromisePageResp<ListItems> { | |
58 | + return request.get(`${AMS_HOST}/erp/operations/inventory/pool/page`, { params }); | |
59 | +} | ... | ... |
src/pages/capital/Maintenance/StockQuery/components/Filter.tsx
0 → 100644
1 | +import React from 'react'; | |
2 | +import { Input, Radio, Row, Select } from 'antd'; | |
3 | +import { debounce } from 'lodash'; | |
4 | +import useInitail from '@/hooks/useInitail'; | |
5 | +import { getShopApi } from '@/common/api'; | |
6 | + | |
7 | +const Option = Select.Option; | |
8 | +interface Props { | |
9 | + setParams: Function; | |
10 | + innerParams: AmsSpec.ListParams; | |
11 | +} | |
12 | +export default function SeriesFilter({ setParams, innerParams }: Props) { | |
13 | + const { data: shopList } = useInitail<Array<CommonApi.OptionVO>, CommonApi.ShopParam>(getShopApi, [], {}); | |
14 | + | |
15 | + const fetchListByName = debounce(value => { | |
16 | + setParams({ ...value, current: 1 }, true); | |
17 | + }, 500); | |
18 | + | |
19 | + const onSearch = (value: object) => setParams({ ...value, current: 1 }, true); | |
20 | + return ( | |
21 | + <div> | |
22 | + <Row justify="space-between" style={{ flexWrap: "wrap" }}> | |
23 | + <Input.Search | |
24 | + allowClear | |
25 | + style={{ flex: 1, marginRight: 10 }} | |
26 | + onChange={e => fetchListByName({ keywords: e.target.value })} | |
27 | + onSearch={v => setParams({ keywords: v }, true)} | |
28 | + placeholder="物品名称/编码" | |
29 | + /> | |
30 | + {/* <Input.Search | |
31 | + allowClear | |
32 | + style={{ flex: 1, marginRight: 10 }} | |
33 | + onChange={e => fetchListByName({ uniqueCode: e.target.value })} | |
34 | + onSearch={v => setParams({ uniqueCode: v }, true)} | |
35 | + placeholder="物品唯一标识" | |
36 | + /> */} | |
37 | + <Input.Search | |
38 | + allowClear | |
39 | + style={{ flex: 1, marginRight: 10 }} | |
40 | + onChange={e => fetchListByName({ staffName: e.target.value })} | |
41 | + onSearch={v => setParams({ staffName: v }, true)} | |
42 | + placeholder="管理人员姓名" | |
43 | + /> | |
44 | + <Select | |
45 | + optionFilterProp="children" | |
46 | + showSearch | |
47 | + allowClear | |
48 | + placeholder="物品使用门店" | |
49 | + style={{ flex: 1, marginRight: 10 }} | |
50 | + onChange={(value) => onSearch({ useShopId: value })} | |
51 | + > | |
52 | + {shopList.map((item) => ( | |
53 | + <Option key={item.id} value={item.id}> | |
54 | + {item.name} | |
55 | + </Option> | |
56 | + ))} | |
57 | + </Select> | |
58 | + <Select | |
59 | + optionFilterProp="children" | |
60 | + showSearch | |
61 | + allowClear | |
62 | + placeholder="物品归属门店" | |
63 | + style={{ flex: 1, marginRight: 10 }} | |
64 | + onChange={(value) => onSearch({ assetShopId: value })} | |
65 | + > | |
66 | + {shopList.map((item) => ( | |
67 | + <Option key={item.id} value={item.id}> | |
68 | + {item.name} | |
69 | + </Option> | |
70 | + ))} | |
71 | + </Select> | |
72 | + </Row> | |
73 | + | |
74 | + <Row justify="space-between" style={{ marginTop: 10 }}> | |
75 | + <Select style={{ flex: 1, marginRight: 10 }} allowClear onChange={(v) => onSearch({ type: v })} placeholder="资产类型"> | |
76 | + <Option value={1} key={1}>固定资产</Option> | |
77 | + <Option value={2} key={2}>低值品</Option> | |
78 | + <Option value={3} key={3}>易耗品</Option> | |
79 | + </Select> | |
80 | + <Select style={{ flex: 1, marginRight: 10 }} allowClear onChange={(v) => onSearch({ agent: v })} placeholder="是否代管物品"> | |
81 | + <Option value={1} key={1}>代管</Option> | |
82 | + <Option value={0} key={0}>被领用</Option> | |
83 | + </Select> | |
84 | + {/* <Select style={{ flex: 1, marginRight: 10 }} allowClear onChange={(v) => onSearch({ sourceType: v })} placeholder="库存来源类型"> | |
85 | + <Option value={1} key={1}>资产</Option> | |
86 | + <Option value={2} key={2}>配件</Option> | |
87 | + <Option value={3} key={3}>市场物料</Option> | |
88 | + </Select> */} | |
89 | + <Select style={{ flex: 1, marginRight: 10 }} allowClear onChange={(v) => onSearch({ status: v })} placeholder="状态"> | |
90 | + <Option value={1} key={1}>正常</Option> | |
91 | + <Option value={2} key={2}>已报废</Option> | |
92 | + <Option value={3} key={3}>已变卖</Option> | |
93 | + </Select> | |
94 | + <Select style={{ flex: 1, marginRight: 10 }} allowClear onChange={(v) => onSearch({ repair: v })} placeholder="是否维修中"> | |
95 | + <Option value={0} key={0}>正常</Option> | |
96 | + <Option value={1} key={1}>处理中</Option> | |
97 | + </Select> | |
98 | + </Row> | |
99 | + | |
100 | + <Row justify="space-between" style={{ marginTop: 10, marginBottom: 15 }}> | |
101 | + <Select style={{ flex: 1, marginRight: 10 }} allowClear onChange={(v) => onSearch({ sell: v })} placeholder="是否变卖中"> | |
102 | + <Option value={0} key={0}>正常</Option> | |
103 | + <Option value={1} key={1}>处理中</Option> | |
104 | + </Select> | |
105 | + <Select style={{ flex: 1, marginRight: 10 }} allowClear onChange={(v) => onSearch({ allocate: v })} placeholder="是否调拨中"> | |
106 | + <Option value={0} key={0}>正常</Option> | |
107 | + <Option value={1} key={1}>处理中</Option> | |
108 | + </Select> | |
109 | + <Select style={{ flex: 1, marginRight: 10 }} allowClear onChange={(v) => onSearch({ transfer: v })} placeholder="是否退回中"> | |
110 | + <Option value={0} key={0}>正常</Option> | |
111 | + <Option value={1} key={1}>处理中</Option> | |
112 | + </Select> | |
113 | + <Select style={{ flex: 1, marginRight: 10 }} allowClear onChange={(v) => onSearch({ scrap: v })} placeholder="是否报废中"> | |
114 | + <Option value={0} key={0}>正常</Option> | |
115 | + <Option value={1} key={1}>处理中</Option> | |
116 | + </Select> | |
117 | + </Row> | |
118 | + </div> | |
119 | + ); | |
120 | +} | |
0 | 121 | \ No newline at end of file | ... | ... |
src/pages/capital/Maintenance/StockQuery/index.tsx
0 → 100644
1 | +import React from 'react'; | |
2 | +import { PageHeaderWrapper } from '@ant-design/pro-layout'; | |
3 | +import { Card, Table } from 'antd'; | |
4 | +import * as api from './api'; | |
5 | +import Column from 'antd/lib/table/Column'; | |
6 | +import Filter from './components/Filter'; | |
7 | +import moment from 'moment'; | |
8 | +import usePagination from '@/hooks/usePagination'; | |
9 | +import RenderGoodsSpec from '@/pages/capital/components/RenderGoodsSpec'; | |
10 | +import { AssetTypeEnum } from '@/pages/capital/entity'; | |
11 | + | |
12 | +export default function SpecConfig() { | |
13 | + const { list, loading, paginationConfig, setParams, innerParams, setLoading } = usePagination(api.getDateApi, { status: 1 }); | |
14 | + | |
15 | + return ( | |
16 | + <PageHeaderWrapper title="库存池查询"> | |
17 | + <Card> | |
18 | + <Filter setParams={setParams} innerParams={innerParams} /> | |
19 | + <Table | |
20 | + dataSource={list} | |
21 | + loading={loading} | |
22 | + pagination={paginationConfig} | |
23 | + rowKey="poolId" | |
24 | + size="small" | |
25 | + > | |
26 | + <Column title="物品名称" dataIndex="name" /> | |
27 | + <Column title="物品编码" dataIndex="code" /> | |
28 | + <Column title="唯一标识" dataIndex="uniqueCode" /> | |
29 | + <Column | |
30 | + title="型号规格" | |
31 | + dataIndex="specList" | |
32 | + width="16%" | |
33 | + ellipsis | |
34 | + render={(text, record) => <RenderGoodsSpec specList={text} />} | |
35 | + /> | |
36 | + <Column | |
37 | + title="物品类型" | |
38 | + dataIndex="type" | |
39 | + render={(value) => ( | |
40 | + <span>{AssetTypeEnum[value]}</span> | |
41 | + )} | |
42 | + /> | |
43 | + <Column title="资产归属门店" dataIndex="assetShopName" /> | |
44 | + <Column title="使用门店" dataIndex="useShopName" /> | |
45 | + <Column title="是否代管" dataIndex="agent" render={t => (t ? "是" : "否")} /> | |
46 | + <Column title="库存数量" dataIndex="storageNum" render={(t, record: api.ListItems) => `${t || 0}${record.unit}`} /> | |
47 | + <Column title="管理员工" dataIndex="staffName" /> | |
48 | + <Column title="入库时间" dataIndex="storageTime" render={(t) => t && moment(t).format("YYYY-MM-DD hh:mm") || '--'} /> | |
49 | + <Column title="领用时间" dataIndex="receiveTime" render={(t) => t && moment(t).format("YYYY-MM-DD hh:mm") || '--'} /> | |
50 | + {/* <Column title="采购单价金额(元)" dataIndex="unitPrice" /> */} | |
51 | + </Table> | |
52 | + </Card> | |
53 | + </PageHeaderWrapper> | |
54 | + ); | |
55 | +} | |
0 | 56 | \ No newline at end of file | ... | ... |
src/pages/capital/ReceiveRules/subPages/GoodsDimension/components/PageAuthEdit/index.tsx
... | ... | @@ -18,7 +18,7 @@ interface Props { |
18 | 18 | |
19 | 19 | export default function SpecConfig(props: Props) { |
20 | 20 | const { match } = props; |
21 | - const { id } = match.params; | |
21 | + const { id, disabled } = match.params; | |
22 | 22 | const { list, loading, setLoading, paginationConfig, innerParams, setParams } = usePagination(getGoodsAuthDetail, { standardId: id }); |
23 | 23 | const [confirLoaing, setConfirLoading] = useState<boolean>(false); |
24 | 24 | const [modalPa, setModalPa] = useState({ visible: false, rowValue: undefined }); |
... | ... | @@ -82,7 +82,7 @@ export default function SpecConfig(props: Props) { |
82 | 82 | /> |
83 | 83 | </div> |
84 | 84 | </Row> |
85 | - <Button type="primary" icon={<PlusOutlined />} onClick={() => setModalPa({ visible: true })}>新增</Button> | |
85 | + {!disabled && (<Button type="primary" icon={<PlusOutlined />} onClick={() => setModalPa({ visible: true })}>新增</Button>)} | |
86 | 86 | </Row> |
87 | 87 | <Table |
88 | 88 | dataSource={list} |
... | ... | @@ -118,7 +118,7 @@ export default function SpecConfig(props: Props) { |
118 | 118 | align="center" |
119 | 119 | title="操作" |
120 | 120 | render={(value) => { |
121 | - return ( | |
121 | + return !disabled ? ( | |
122 | 122 | <> |
123 | 123 | <Button type="link" onClick={() => edit(value)}> |
124 | 124 | 编辑 |
... | ... | @@ -130,7 +130,7 @@ export default function SpecConfig(props: Props) { |
130 | 130 | </Button> |
131 | 131 | </Popconfirm> |
132 | 132 | </> |
133 | - ); | |
133 | + ) : null; | |
134 | 134 | }} |
135 | 135 | /> |
136 | 136 | </Table> | ... | ... |
src/pages/capital/ReceiveRules/subPages/GoodsDimension/index.tsx
... | ... | @@ -53,9 +53,10 @@ export default function Index(props: Props) { |
53 | 53 | <RenderSelectGoos /> |
54 | 54 | </Form.Item> |
55 | 55 | ) : ( |
56 | - <Form.Item label="物品名称"> | |
57 | - <Input bordered={false} value={name} /> | |
58 | - </Form.Item> | |
56 | + // <Form.Item label="物品名称"> | |
57 | + // <Input bordered={false} value={name} /> | |
58 | + // </Form.Item> | |
59 | + null | |
59 | 60 | )} |
60 | 61 | <Form.Item label="按门店授权" name="shopAuthPostList" rules={[{ required: true, message: '添加授权信息' }]}> |
61 | 62 | <AuthTableList /> | ... | ... |
src/pages/capital/StandardMange/components/Add/index.tsx
... | ... | @@ -17,10 +17,13 @@ const Option = Select.Option; |
17 | 17 | const RadioGroup = Radio.Group; |
18 | 18 | |
19 | 19 | export default function AddItem() { |
20 | - const { typeName, data = [], currentItem = {}, unitItem, setBreadcrumbs, setLoading, setCurrentBreadcrumb, setIsPart } = useStore() | |
20 | + const { typeName, data = [], currentItem = {}, unitItem, setBreadcrumbs, setLoading, setCurrentBreadcrumb, setIsPart, editDisabled } = useStore(); | |
21 | 21 | const [saveConfig, setSaveConfig] = useState<boolean>(false); |
22 | 22 | const [nameId, setNameId] = useState<number>(); |
23 | 23 | const [visible, setVisible] = useState(false); |
24 | + const [partValue, setPartValue] = useState<{ | |
25 | + partId?: number, partCode?: string, | |
26 | + }>({}); | |
24 | 27 | const [form] = Form.useForm(); |
25 | 28 | |
26 | 29 | useEffect(() => { |
... | ... | @@ -33,11 +36,13 @@ export default function AddItem() { |
33 | 36 | part: Number(currentItem.part) || 0, |
34 | 37 | purchaseChannelList: currentItem.purchaseChannelList && JSON.stringify(currentItem) != '{}' ? currentItem.purchaseChannelList.map(i => ({ value: i.subjectId, label: i.subjectName })) : undefined, |
35 | 38 | }); |
39 | + currentItem.partCode && setPartValue({ partCode: currentItem.partCode, partId: currentItem.partId }); | |
36 | 40 | }, []); |
37 | 41 | |
38 | 42 | function save(feildValue: any) { |
39 | 43 | const params = { |
40 | 44 | ...feildValue, |
45 | + ...partValue, | |
41 | 46 | id: currentItem.id, |
42 | 47 | name: currentItem.name || feildValue.name.label || feildValue.name, |
43 | 48 | nameId: currentItem.nameId || feildValue.name.value || nameId, |
... | ... | @@ -49,6 +54,7 @@ export default function AddItem() { |
49 | 54 | api.saveForm(params).then(res => { |
50 | 55 | setSaveConfig(false); |
51 | 56 | setNameId(undefined); |
57 | + setPartValue({}); | |
52 | 58 | if (res.data && !currentItem.id) { |
53 | 59 | Modal.confirm({ |
54 | 60 | title: '保存成功', |
... | ... | @@ -57,7 +63,7 @@ export default function AddItem() { |
57 | 63 | okText: '去授权', |
58 | 64 | cancelText: '返回', |
59 | 65 | onOk() { |
60 | - history.push(`/ams/standardMange/receive/rules/goods/${res.data}/${params.name}`); | |
66 | + history.push(`/ams/standardMange/receive/rules/goods/${res.data}/name`); | |
61 | 67 | }, |
62 | 68 | onCancel() { |
63 | 69 | setLoading(true); |
... | ... | @@ -104,7 +110,8 @@ export default function AddItem() { |
104 | 110 | }).catch(e => { |
105 | 111 | message.error(e.message); |
106 | 112 | }); |
107 | - form.setFieldsValue({ name: item.partName, specList: spec, type: 2 }); | |
113 | + setPartValue({ partCode: item.partCode, partId: item.id }); | |
114 | + form.setFieldsValue({ name: item.partName, partCode: item.partCode, partId: item.id, specList: spec, type: 2 }); | |
108 | 115 | } |
109 | 116 | |
110 | 117 | return ( |
... | ... | @@ -112,7 +119,7 @@ export default function AddItem() { |
112 | 119 | <h1 style={{ marginBottom: 20 }}>1.基本信息</h1> |
113 | 120 | <Form {...layout} form={form} onFinish={save}> |
114 | 121 | <Form.Item label="是否配件" name="part" rules={[{ required: true, message: '请选择' }]}> |
115 | - <RadioGroup onChange={(e) => { changeSpc(e.target.value); }}> | |
122 | + <RadioGroup disabled={!!editDisabled} onChange={(e) => { changeSpc(e.target.value); }}> | |
116 | 123 | <Radio value={1}>是</Radio> |
117 | 124 | <Radio value={0}>否</Radio> |
118 | 125 | </RadioGroup> |
... | ... | @@ -147,6 +154,7 @@ export default function AddItem() { |
147 | 154 | labelInValue |
148 | 155 | optionFilterProp="children" |
149 | 156 | showSearch |
157 | + disabled={!!editDisabled} | |
150 | 158 | > |
151 | 159 | {unitItem.map((i: StanderList.UnitItem) => ( |
152 | 160 | <Option value={i.id} key={i.id}>{i.unitName}</Option> |
... | ... | @@ -154,19 +162,19 @@ export default function AddItem() { |
154 | 162 | </Select> |
155 | 163 | </Form.Item> |
156 | 164 | <Form.Item label="状态" name="status" valuePropName="checked" rules={[{ required: true, message: '请选择' }]}> |
157 | - <Switch checkedChildren="启用" unCheckedChildren="禁用" /> | |
165 | + <Switch disabled={!!editDisabled} checkedChildren="启用" unCheckedChildren="禁用" /> | |
158 | 166 | </Form.Item> |
159 | 167 | <Form.Item noStyle shouldUpdate={(prevValues, currentValues) => prevValues.type != currentValues.type}> |
160 | 168 | {({ getFieldValue }): any => { |
161 | 169 | return getFieldValue("type") === 1 ? ( |
162 | 170 | <Form.Item label="摊销周期 (月)" name="amortizePeriod" rules={[{ required: true, message: '请输入摊销周期' }]}> |
163 | - <InputNumber min={0} style={{ width: '100%' }} placeholder="请输入" /> | |
171 | + <InputNumber disabled={!!editDisabled} min={0} style={{ width: '100%' }} placeholder="请输入" /> | |
164 | 172 | </Form.Item> |
165 | 173 | ) : null; |
166 | 174 | }} |
167 | 175 | </Form.Item> |
168 | 176 | <Form.Item label="备注" name="remark"> |
169 | - <Input.TextArea placeholder="请输入" allowClear /> | |
177 | + <Input.TextArea disabled={!!editDisabled} placeholder="请输入" allowClear /> | |
170 | 178 | </Form.Item> |
171 | 179 | <h1 style={{ marginBottom: 20 }}>2.规格型号</h1> |
172 | 180 | |
... | ... | @@ -180,7 +188,7 @@ export default function AddItem() { |
180 | 188 | noStyle |
181 | 189 | rules={[{ required: true, message: '最大采购金额(单个物品)' }]} |
182 | 190 | > |
183 | - <InputNumber style={{ width: 150 }} min={0} precision={4} placeholder="请输入金额" /> | |
191 | + <InputNumber disabled={!!editDisabled} style={{ width: 150 }} min={0} precision={4} placeholder="请输入金额" /> | |
184 | 192 | </Form.Item> |
185 | 193 | <span style={{ marginLeft: 10 }}>元</span> |
186 | 194 | </Form.Item> |
... | ... | @@ -188,16 +196,16 @@ export default function AddItem() { |
188 | 196 | {({ getFieldValue }): any => { |
189 | 197 | return getFieldValue("type") === 3 ? ( |
190 | 198 | <Form.Item label="最小单位采购数量" name="minNum" {...layout} rules={[{ required: true, message: '请输入最小采购数量' }]}> |
191 | - <InputNumber style={{ width: 150 }} min={0} placeholder="请输入单位数量" /> | |
199 | + <InputNumber disabled={!!editDisabled} style={{ width: 150 }} min={0} placeholder="请输入单位数量" /> | |
192 | 200 | </Form.Item> |
193 | 201 | ) : null; |
194 | 202 | }} |
195 | 203 | </Form.Item> |
196 | 204 | <Form.Item label="计划提前天数" name="planAheadDay" {...layout}> |
197 | - <InputNumber style={{ width: 150 }} min={0} placeholder="请输入" /> | |
205 | + <InputNumber disabled={!!editDisabled} style={{ width: 150 }} min={0} placeholder="请输入" /> | |
198 | 206 | </Form.Item> |
199 | 207 | <Form.Item label="采购渠道" name="purchaseChannelList" rules={[{ required: true, message: '请选择采购渠道' }]}> |
200 | - <Select placeholder="请选择采购渠道" allowClear labelInValue mode="multiple" showSearch optionFilterProp="children"> | |
208 | + <Select disabled={!!editDisabled} placeholder="请选择采购渠道" allowClear labelInValue mode="multiple" showSearch optionFilterProp="children"> | |
201 | 209 | {(data || []).map((i: any) => ( |
202 | 210 | <Option value={i.id} key={i.id}>{i.name}</Option> |
203 | 211 | ))} |
... | ... | @@ -205,7 +213,7 @@ export default function AddItem() { |
205 | 213 | </Form.Item> |
206 | 214 | <h1 style={{ marginBottom: 20 }}>4.领用条件</h1> |
207 | 215 | <Form.Item label="领用前提条件" name="premise" rules={[{ required: true, message: '请选择' }]}> |
208 | - <Select placeholder="请选择"> | |
216 | + <Select disabled={!!editDisabled} placeholder="请选择"> | |
209 | 217 | <Option value={0} key={0}>无限制</Option> |
210 | 218 | <Option value={1} key={1}>入职后</Option> |
211 | 219 | <Option value={2} key={2}>转正后</Option> |
... | ... | @@ -215,15 +223,15 @@ export default function AddItem() { |
215 | 223 | {({ getFieldValue }): any => { |
216 | 224 | const premise = getFieldValue("premise"); |
217 | 225 | return premise ? ( |
218 | - <Form.Item label={premise === 1 ? "入职后" :"转正后"} name="premiseValue" {...layout} rules={[{ required: true, message: '请输入' }]}> | |
219 | - <InputNumber style={{ width: '100%' }} addonAfter="月" min={0} placeholder="请输入领取前提条件值" /> | |
226 | + <Form.Item label={premise === 1 ? "入职后" : "转正后"} name="premiseValue" {...layout} rules={[{ required: true, message: '请输入' }]}> | |
227 | + <InputNumber disabled={!!editDisabled} style={{ width: '100%' }} addonAfter="月" min={0} placeholder="请输入领取前提条件值" /> | |
220 | 228 | </Form.Item> |
221 | 229 | ) : null; |
222 | 230 | }} |
223 | 231 | </Form.Item> |
224 | 232 | <Row justify="center"> |
225 | 233 | <Button type="primary" onClick={() => { setBreadcrumbs([{ name: '列表', key: 'list' }]); setCurrentBreadcrumb({ name: '列表', key: 'list' }); }}>返回</Button> |
226 | - <Button style={{ marginLeft: 25 }} type="primary" loading={saveConfig} onClick={() => form.submit()}>保存</Button> | |
234 | + <Button style={{ marginLeft: 25 }} type="primary" disabled={!!editDisabled} loading={saveConfig} onClick={() => form.submit()}>保存</Button> | |
227 | 235 | </Row> |
228 | 236 | </Form> |
229 | 237 | <SelectPartsTable | ... | ... |
src/pages/capital/StandardMange/components/List/index.tsx
... | ... | @@ -17,7 +17,8 @@ import { AssetTypeEnum } from '@/pages/capital/entity'; |
17 | 17 | const Option = Select.Option; |
18 | 18 | |
19 | 19 | export default function List() { |
20 | - const { typeName, setIsPart, breadcrumbs, MenuItems, setCurrentItem, innerParams, list, setBreadcrumbs, setLoading, setParams, paginationConfig, loading, setCurrentBreadcrumb } = useStore(); | |
20 | + const { typeName, setIsPart, breadcrumbs, MenuItems, setCurrentItem, innerParams, | |
21 | + list, setBreadcrumbs, setLoading, setParams, paginationConfig, loading, setCurrentBreadcrumb, editDisabled } = useStore(); | |
21 | 22 | const [switchLoading, setSwitchLoading] = useState(false); |
22 | 23 | |
23 | 24 | function editAdd(value?: any) { |
... | ... | @@ -51,7 +52,6 @@ export default function List() { |
51 | 52 | }); |
52 | 53 | |
53 | 54 | const handleMenuClick: MenuProps['onClick'] = (e) => { |
54 | - console.log("handleMenuClick", e.key); | |
55 | 55 | switch (e.key) { |
56 | 56 | case '1': |
57 | 57 | history.push("/ams/standardMange/receive/rules/goods"); |
... | ... | @@ -68,8 +68,9 @@ export default function List() { |
68 | 68 | }; |
69 | 69 | |
70 | 70 | const clickToAuth = (item: StanderList.ListVO) => { |
71 | - history.push(`/ams/standardMange/auth/goods/${item.id}`); | |
71 | + history.push(`/ams/standardMange/auth/goods/${item.id}/${editDisabled || ''}`); | |
72 | 72 | }; |
73 | + | |
73 | 74 | return ( |
74 | 75 | <Card> |
75 | 76 | <Row justify="space-between"> |
... | ... | @@ -85,29 +86,35 @@ export default function List() { |
85 | 86 | 禁用 |
86 | 87 | </Radio.Button> |
87 | 88 | </Radio.Group> |
88 | - <Select style={{ width: 200 }} allowClear onChange={(e) => _onChangeType({ type: e })} placeholder="请选择类型"> | |
89 | + <Select allowClear onChange={(e) => _onChangeType({ type: e })} placeholder="请选择类型"> | |
89 | 90 | {typeName.map(i => ( |
90 | 91 | <Option value={i.type} key={i.type}>{i.name}</Option> |
91 | 92 | ))} |
92 | 93 | </Select> |
94 | + <Select allowClear onChange={(v) => _onChangeType({ part: v })} placeholder="是否配件"> | |
95 | + <Option value={1} key={1}>是</Option> | |
96 | + <Option value={0} key={0}>否</Option> | |
97 | + </Select> | |
93 | 98 | <Search |
94 | 99 | style={{ width: 260 }} |
95 | 100 | placeholder="搜索资产名称/型号" |
96 | 101 | allowClear |
97 | 102 | onChange={(e) => _onChange(e.target.value)} |
98 | 103 | /> |
99 | - <div> | |
100 | - <Dropdown | |
101 | - overlay={ | |
102 | - <Menu onClick={handleMenuClick} items={MenuItems} /> | |
103 | - } | |
104 | - > | |
105 | - <Button icon={<SnippetsOutlined />} type="primary" style={{ width: 100, marginRight: 20 }}> | |
106 | - 领用授权 | |
107 | - </Button> | |
108 | - </Dropdown> | |
109 | - <Button type="primary" icon={<PlusOutlined />} onClick={() => editAdd(undefined)}>新增</Button> | |
110 | - </div> | |
104 | + {!editDisabled && ( | |
105 | + <div> | |
106 | + <Dropdown | |
107 | + overlay={ | |
108 | + <Menu onClick={handleMenuClick} items={MenuItems} /> | |
109 | + } | |
110 | + > | |
111 | + <Button icon={<SnippetsOutlined />} type="primary" style={{ width: 100, marginRight: 20 }}> | |
112 | + 领用授权 | |
113 | + </Button> | |
114 | + </Dropdown> | |
115 | + <Button type="primary" icon={<PlusOutlined />} onClick={() => editAdd(undefined)}>新增</Button> | |
116 | + </div> | |
117 | + )} | |
111 | 118 | </Row> |
112 | 119 | |
113 | 120 | <Table |
... | ... | @@ -146,6 +153,7 @@ export default function List() { |
146 | 153 | unCheckedChildren="关闭" |
147 | 154 | checked={!!value.status} |
148 | 155 | loading={switchLoading} |
156 | + disabled={!!editDisabled} | |
149 | 157 | onChange={() => changeSwich(value)} |
150 | 158 | /> |
151 | 159 | )} |
... | ... | @@ -166,7 +174,7 @@ export default function List() { |
166 | 174 | align="center" |
167 | 175 | render={(record: StanderList.ListVO) => ( |
168 | 176 | <> |
169 | - <Button type="link" style={{ padding: 0 }} onClick={() => { editAdd(record); }}>编辑</Button> | |
177 | + <Button type="link" style={{ padding: 0 }} onClick={() => { editAdd(record); }}> {!editDisabled ? "编辑" : "查看"}</Button> | |
170 | 178 | <Divider type="vertical" /> |
171 | 179 | <Button type="link" style={{ padding: 0 }} onClick={() => { clickToAuth(record); }}>授权</Button> |
172 | 180 | </> | ... | ... |
src/pages/capital/StandardMange/index.tsx
... | ... | @@ -8,9 +8,15 @@ import AddItem from './components/Add'; |
8 | 8 | |
9 | 9 | export const { Provider, useStore } = createStore(store); |
10 | 10 | |
11 | -function EditMange() { | |
11 | +function EditMange(props: any) { | |
12 | + const { match } = props; | |
13 | + const { disabled } = match.params; | |
12 | 14 | const [IndexDOM, setIndexDOM] = useState(<List />); |
13 | - const { setLoading, currentItem, breadcrumbs, currentBreadcrumb, setCurrentItem, setBreadcrumbs, setCurrentBreadcrumb } = useStore(); | |
15 | + const { setLoading, currentItem, breadcrumbs, currentBreadcrumb, setCurrentItem, setBreadcrumbs, setEditDisabled, setCurrentBreadcrumb } = useStore(); | |
16 | + | |
17 | + useEffect(() => { | |
18 | + setEditDisabled(!!disabled); | |
19 | + }, [disabled]); | |
14 | 20 | |
15 | 21 | useEffect(() => { |
16 | 22 | switch (currentBreadcrumb.key) { |
... | ... | @@ -49,4 +55,4 @@ function EditMange() { |
49 | 55 | ); |
50 | 56 | } |
51 | 57 | |
52 | -export default () => <Provider><EditMange /></Provider>; | |
53 | 58 | \ No newline at end of file |
59 | +export default (props: any) => <Provider><EditMange {...props} /></Provider>; | |
54 | 60 | \ No newline at end of file | ... | ... |
src/pages/capital/StandardMange/interface.d.ts
... | ... | @@ -6,6 +6,8 @@ declare namespace StanderList { |
6 | 6 | type?: number, //物品类型 1固定资产2低值品3易耗品 |
7 | 7 | name?: string, //物品名称 |
8 | 8 | nameId?: number, |
9 | + partCode?: string, | |
10 | + partId?: number, | |
9 | 11 | unit?: number, //单位 1个2只3把4枚5台6包7车8瓶9壶10套11张12打13担 |
10 | 12 | unitName?: string, |
11 | 13 | spec?: string, //型号规格 | ... | ... |
src/pages/capital/StandardMange/store.ts
... | ... | @@ -22,6 +22,8 @@ export default function useStore() { |
22 | 22 | const { list: postList, loading: postLoading } = usePagination(api.getPostList, {}); |
23 | 23 | const { list, setParams, paginationConfig, innerParams, loading, setLoading } = usePagination(api.getListApi, { status: 1 }); |
24 | 24 | const [isPart, setIsPart] = useState<boolean>(false); |
25 | + /**是否可编辑 */ | |
26 | + const [editDisabled, setEditDisabled] = useState<boolean>(false); | |
25 | 27 | |
26 | 28 | const typeName = [ |
27 | 29 | { name: '固定资产', type: 1 }, |
... | ... | @@ -60,6 +62,8 @@ export default function useStore() { |
60 | 62 | setLoading, |
61 | 63 | isPart, |
62 | 64 | setIsPart, |
63 | - MenuItems | |
65 | + MenuItems, | |
66 | + editDisabled, | |
67 | + setEditDisabled | |
64 | 68 | }; |
65 | 69 | } |
66 | 70 | \ No newline at end of file | ... | ... |
src/pages/capital/components/RenderGoodsSpec.tsx
1 | -import React from 'react'; | |
2 | -import { Popover } from 'antd'; | |
1 | +import React, { useCallback, useState } from 'react'; | |
2 | +import { Button, Modal, Popover, Table } from 'antd'; | |
3 | 3 | |
4 | 4 | interface Props { |
5 | 5 | specList: StanderList.AuthSpecList[] |
6 | 6 | } |
7 | 7 | |
8 | 8 | export default function RenderGoodsSpec({ specList }: Props) { |
9 | + const [visible, setVisible] = useState(false); | |
9 | 10 | const items = (specList || []).map(i => `${i.standardSpecName}:${i.specDetails}`); |
11 | + const RenderSpecModal = useCallback(() => (visible ? ( | |
12 | + <SpecModal | |
13 | + visible={visible} | |
14 | + onCancel={() => setVisible(false)} | |
15 | + items={specList} | |
16 | + /> | |
17 | + ) : null), [visible]); | |
10 | 18 | return ( |
11 | - <Popover | |
12 | - placement="topLeft" | |
13 | - content={<div style={{ maxWidth: 260 }}>{items.join(';')}</div>} | |
14 | - > | |
15 | - <div> | |
16 | - {items.slice(0, 3).map((i: string) => { | |
17 | - return ( | |
18 | - <p key={i} style={{ margin: 0, fontSize: 12 }}>{i}</p> | |
19 | - ); | |
20 | - })} | |
21 | - {items.length > 3 ? (<span>...</span>) : null} | |
22 | - </div> | |
23 | - </Popover> | |
19 | + <> | |
20 | + <Popover | |
21 | + placement="topLeft" | |
22 | + content={<div style={{ maxWidth: 260 }}>{items.join(';')}</div>} | |
23 | + > | |
24 | + <div> | |
25 | + {items.slice(0, 3).map((i: string) => { | |
26 | + return ( | |
27 | + <p key={i} style={{ margin: 0, fontSize: 12 }}>{i}</p> | |
28 | + ); | |
29 | + })} | |
30 | + {items.length > 3 ? (<span>...</span>) : null} | |
31 | + </div> | |
32 | + <Button type="link" style={{ fontSize: 12, padding: 0 }} onClick={() => setVisible(true)}>查看</Button> | |
33 | + </Popover> | |
34 | + {RenderSpecModal()} | |
35 | + </> | |
36 | + ); | |
37 | +} | |
38 | + | |
39 | +function SpecModal({ items, onCancel, visible }: any) { | |
40 | + const columns = [ | |
41 | + { | |
42 | + title: '规格名称', | |
43 | + dataIndex: 'standardSpecName', | |
44 | + }, | |
45 | + { | |
46 | + title: '规格内容', | |
47 | + dataIndex: 'specDetails', | |
48 | + }, | |
49 | + { | |
50 | + title: '排序', | |
51 | + dataIndex: 'sort', | |
52 | + }, | |
53 | + ]; | |
54 | + | |
55 | + return ( | |
56 | + <Modal title="规格属性" open={visible} onCancel={onCancel} footer={false}> | |
57 | + <Table | |
58 | + pagination={false} | |
59 | + bordered | |
60 | + rowKey="standardSpecName" | |
61 | + dataSource={items} | |
62 | + size="small" | |
63 | + columns={columns} | |
64 | + /> | |
65 | + </Modal> | |
24 | 66 | ); |
25 | 67 | } |
26 | 68 | \ No newline at end of file | ... | ... |
src/pages/contract/BearCostSetting/components/SaveModal/index.tsx
... | ... | @@ -70,10 +70,9 @@ const SaveModal = ({visible, onCancel, onRefresh}:Props) => { |
70 | 70 | }; |
71 | 71 | addPaymentMark(params) |
72 | 72 | .then(res => { |
73 | - console.log('res', res.result); | |
74 | - message.success("操作成功"); | |
75 | - _onCancel(); | |
76 | - onRefresh(); | |
73 | + message.success("操作成功"); | |
74 | + _onCancel(); | |
75 | + onRefresh(); | |
77 | 76 | }) |
78 | 77 | .catch(err => { |
79 | 78 | message.error(err?.message); |
... | ... | @@ -103,10 +102,12 @@ const SaveModal = ({visible, onCancel, onRefresh}:Props) => { |
103 | 102 | <Form form={form} onFinish={handleSave} wrapperCol={{ span: 18 }} labelCol={{ span: 4 }}> |
104 | 103 | <Form.Item |
105 | 104 | label="缴费标识:" |
106 | - name="name" | |
105 | + name="name" | |
107 | 106 | rules={[{ required: true, message: '请输入缴费标识' }]} |
108 | 107 | > |
109 | - <Input /> | |
108 | + <Input | |
109 | + placeholder="请填写" | |
110 | + /> | |
110 | 111 | </Form.Item> |
111 | 112 | <Form.Item |
112 | 113 | label="费用类型" |
... | ... | @@ -187,7 +188,7 @@ const SaveModal = ({visible, onCancel, onRefresh}:Props) => { |
187 | 188 | <Form.Item |
188 | 189 | label="缴费方式:" |
189 | 190 | name="paymentMode" |
190 | - rules={[{ required: false, message: '请选择缴费方式' }]} | |
191 | + rules={[{ required: true, message: '请选择缴费方式' }]} | |
191 | 192 | > |
192 | 193 | <Select |
193 | 194 | placeholder="请选择" |
... | ... | @@ -196,7 +197,6 @@ const SaveModal = ({visible, onCancel, onRefresh}:Props) => { |
196 | 197 | labelInValue |
197 | 198 | filterOption={(input, option: any) => option?.children.indexOf(input) >= 0} |
198 | 199 | onSelect={(it:any) => { |
199 | - console.log('it-->', it); | |
200 | 200 | setPaymentMode(it.value); |
201 | 201 | }} |
202 | 202 | > |
... | ... | @@ -216,7 +216,7 @@ const SaveModal = ({visible, onCancel, onRefresh}:Props) => { |
216 | 216 | name="unit" |
217 | 217 | rules={[{ required: false, message: '请输入计量单位' }]} |
218 | 218 | > |
219 | - <Input maxLength={4} /> | |
219 | + <Input placeholder="请填写" maxLength={4} /> | |
220 | 220 | </Form.Item> |
221 | 221 | ) |
222 | 222 | } | ... | ... |
src/pages/contract/BearCostSetting/components/ShareRateItemlist/index.tsx
src/pages/ehr/ProgramOfStudy/QuestionBank/api.ts
1 | 1 | import request from "@/utils/request"; |
2 | 2 | import { ABILITY_HOST } from "@/utils/host"; |
3 | -import { common } from "@/typing/common"; | |
4 | 3 | import { http } from "@/typing/http"; |
5 | 4 | |
6 | 5 | /** 获取题库列表 */ |
7 | -export function getQuestionBankListApi(params: QuestionBank.QueryParams) { | |
8 | - return request.get<common.Page<QuestionBank.List[]>>( | |
9 | - `${ABILITY_HOST}/erp/question/factory/list`, | |
10 | - { params } | |
11 | - ); | |
6 | +export function getQuestionBankListApi( | |
7 | + params: QuestionBank.QueryParams | |
8 | +): http.PromisePageResp<QuestionBank.List> { | |
9 | + return request.get(`${ABILITY_HOST}/erp/question/factory/list`, { params }); | |
12 | 10 | } |
13 | 11 | |
14 | 12 | /** 保存题库 */ |
... | ... | @@ -24,21 +22,20 @@ export function deleteQuestionBankApi(id: number) { |
24 | 22 | } |
25 | 23 | |
26 | 24 | /** 获取题目列表 */ |
27 | -export function getQuestionListApi(params: { factoryId: number }) { | |
28 | - return request.get<common.Page<QuestionBank.Question[]>>( | |
29 | - `${ABILITY_HOST}/erp/question/info/list`, | |
30 | - { params } | |
31 | - ); | |
25 | +export function getQuestionListApi(params: { | |
26 | + factoryId: number; | |
27 | +}): http.PromisePageResp<QuestionBank.Question> { | |
28 | + return request.get(`${ABILITY_HOST}/erp/question/info/list`, { params }); | |
32 | 29 | } |
33 | 30 | |
34 | 31 | /** 保存题目 */ |
35 | 32 | export function saveQuestionApi(params: QuestionBank.Question) { |
36 | - return request.post<any>(`${ABILITY_HOST}/erp/question/info/save`, params); | |
33 | + return request.post<string>(`${ABILITY_HOST}/erp/question/info/save`, params); | |
37 | 34 | } |
38 | 35 | |
39 | 36 | /** 删除题目 */ |
40 | 37 | export function deleteQuestionApi(id: number) { |
41 | - return request.get<any>(`${ABILITY_HOST}/erp/question/info/del`, { | |
38 | + return request.get<string>(`${ABILITY_HOST}/erp/question/info/del`, { | |
42 | 39 | params: { id }, |
43 | 40 | }); |
44 | 41 | } | ... | ... |
src/pages/ehr/ProgramOfStudy/QuestionBank/components/QuestionBankItem/MultipleChoice.tsx
... | ... | @@ -45,7 +45,7 @@ export default function MultipleChoice({ item, edit = false, index }: Props) { |
45 | 45 | |
46 | 46 | const formInit = () => { |
47 | 47 | form.setFieldsValue({ ...initContent, rightAnswer: initContent.rightAnswer!.split(',') }); |
48 | - } | |
48 | + }; | |
49 | 49 | |
50 | 50 | // 确定添加/修改 题 |
51 | 51 | const onOk = () => { |
... | ... | @@ -56,6 +56,7 @@ export default function MultipleChoice({ item, edit = false, index }: Props) { |
56 | 56 | } |
57 | 57 | const params: QuestionBank.Question = { |
58 | 58 | ...content, |
59 | + draftId, | |
59 | 60 | title: val.title, |
60 | 61 | rightAnswer: val.rightAnswer.sort().join(','), |
61 | 62 | }; |
... | ... | @@ -70,8 +71,8 @@ export default function MultipleChoice({ item, edit = false, index }: Props) { |
70 | 71 | setIsAddFinish(true); |
71 | 72 | }).catch(error => message.error(error.message)); |
72 | 73 | setContent({ ...content, id: content.index, title: val.title, rightAnswer: val.rightAnswer }); |
73 | - }) | |
74 | - } | |
74 | + }); | |
75 | + }; | |
75 | 76 | |
76 | 77 | // 添加选项 |
77 | 78 | const addOption = () => { |
... | ... | @@ -83,7 +84,7 @@ export default function MultipleChoice({ item, edit = false, index }: Props) { |
83 | 84 | setContent({ ...content, answerItemList: [...content.answerItemList!, param] }); |
84 | 85 | setAddInputValue(''); |
85 | 86 | // setIsAdd(false); |
86 | - } | |
87 | + }; | |
87 | 88 | |
88 | 89 | // 删除选项 |
89 | 90 | const delOption = (key: string) => { |
... | ... | @@ -96,7 +97,7 @@ export default function MultipleChoice({ item, edit = false, index }: Props) { |
96 | 97 | // 如果删除选项编号在正确答案之前,则重置选项编号 |
97 | 98 | const rightLabels = content.answerItemList!.filter(ans => rightAnswer.filter((ra: string) => ra !== key).includes(ans.itemNo)).map(ans => ans.answerItem); |
98 | 99 | if (rightAnswer.findIndex((ra: string) => +ra > +key) > -1) form.setFieldsValue({ rightAnswer: answerItemList.filter(ans => rightLabels.includes(ans.answerItem)).map(ans => ans.key) }); |
99 | - } | |
100 | + }; | |
100 | 101 | |
101 | 102 | // 删除题目 |
102 | 103 | const delQuestion = (item: QuestionBank.Question, index: number) => { |
... | ... | @@ -105,7 +106,7 @@ export default function MultipleChoice({ item, edit = false, index }: Props) { |
105 | 106 | addModalContents.length > 0 && setAddModalContents(addModalContents.filter(content => content.index !== index)); |
106 | 107 | TYPE === 1 ? setQuestionLoading(true) : setDraftLoading(true); |
107 | 108 | }).catch(error => message.error(error.message)); |
108 | - } | |
109 | + }; | |
109 | 110 | |
110 | 111 | // 取消编辑题目 |
111 | 112 | const cancel = () => { |
... | ... | @@ -118,7 +119,7 @@ export default function MultipleChoice({ item, edit = false, index }: Props) { |
118 | 119 | setAddModalContents(addModalContents.filter(cont => cont.index !== content.index)); |
119 | 120 | setIsAddFinish(true); |
120 | 121 | } |
121 | - } | |
122 | + }; | |
122 | 123 | |
123 | 124 | return ( |
124 | 125 | <Row |
... | ... | @@ -136,64 +137,68 @@ export default function MultipleChoice({ item, edit = false, index }: Props) { |
136 | 137 | > |
137 | 138 | {isBatchDelete ? <Checkbox style={{ marginRight: 10 }} checked={isChecked} /> : null} |
138 | 139 | <Card style={{ flex: 1, marginBottom: 10, borderColor: isChecked ? '#1890FF' : '' }}> |
139 | - <Row justify='space-between' align='top'> | |
140 | + <Row justify="space-between" align="top"> | |
140 | 141 | <Col span={2}>{!addVisible && (index !== undefined && typeof index === 'number') && <h1>{TYPE === 1 ? index + 1 + (current! - 1) * pageSize! : count}</h1>}</Col> |
141 | 142 | <Col span={18}> |
142 | 143 | <Form form={form}> |
143 | - <Form.Item name='title' rules={[{ required: isEdit, message: '请输入题目' }]}> | |
144 | + <Form.Item name="title" rules={[{ required: isEdit, message: '请输入题目' }]}> | |
144 | 145 | {!isEdit ? |
145 | 146 | <span style={{ fontSize: 16, display: 'block' }}>{content.title}</span> : |
146 | - <Input placeholder='请输入题目' allowClear />} | |
147 | + <Input placeholder="请输入题目" allowClear />} | |
147 | 148 | </Form.Item> |
148 | - <Form.Item name='rightAnswer' rules={[{ required: isEdit, message: '请选择正确答案' }]}> | |
149 | - <Checkbox.Group className='multipleChoice' disabled={!isEdit} > | |
150 | - {content.answerItemList!.map(ans => <Checkbox key={ans.itemNo} value={ans.itemNo} style={{ width: '100%', marginBottom: 10 }}> | |
151 | - <div style={{ display: 'flex', justifyContent: 'space-between', width: '100%' }}> | |
152 | - <span className="span_word_break" style={{ display: 'block', width: '95%' }}>{ans.itemNo}. {ans.answerItem}</span> | |
153 | - {isEdit && <Popconfirm title={`确定删除?`} onConfirm={() => delOption(ans.itemNo!)}><Button type='link' style={{ display: 'block' }} icon={<DeleteOutlined />} /></Popconfirm>} | |
154 | - </div> | |
155 | - </Checkbox> | |
149 | + <Form.Item name="rightAnswer" rules={[{ required: isEdit, message: '请选择正确答案' }]}> | |
150 | + <Checkbox.Group className="multipleChoice" disabled={!isEdit}> | |
151 | + {content.answerItemList!.map(ans => ( | |
152 | + <Checkbox key={ans.itemNo} value={ans.itemNo} style={{ width: '100%', marginBottom: 10 }}> | |
153 | + <div style={{ display: 'flex', justifyContent: 'space-between', width: '100%' }}> | |
154 | + <span className="span_word_break" style={{ display: 'block', width: '95%' }}>{ans.itemNo}. {ans.answerItem}</span> | |
155 | + {isEdit && <Popconfirm title="确定删除?" onConfirm={() => delOption(ans.itemNo!)}><Button type="link" style={{ display: 'block' }} icon={<DeleteOutlined />} /></Popconfirm>} | |
156 | + </div> | |
157 | + </Checkbox> | |
158 | +) | |
156 | 159 | )} |
157 | 160 | </Checkbox.Group> |
158 | 161 | </Form.Item> |
159 | 162 | </Form> |
160 | - <Row justify='space-between' style={{ height: 42 }}> | |
163 | + <Row justify="space-between" style={{ height: 42 }}> | |
161 | 164 | <Col span={6} style={{ justifyContent: 'center', alignItems: 'center', display: 'flex' }}> |
162 | - {isEdit && <Button disabled={!isEdit} type='link' icon={isAdd ? <CloseOutlined /> : <PlusOutlined />} style={{ padding: '4px 0' }} onClick={() => setIsAdd(!isAdd)}>{isAdd ? '取消添加选项' : '添加单个选项'}</Button>} | |
165 | + {isEdit && <Button disabled={!isEdit} type="link" icon={isAdd ? <CloseOutlined /> : <PlusOutlined />} style={{ padding: '4px 0' }} onClick={() => setIsAdd(!isAdd)}>{isAdd ? '取消添加选项' : '添加单个选项'}</Button>} | |
163 | 166 | </Col> |
164 | 167 | <Col span={18}> |
165 | - {isAdd && <Input | |
168 | + {isAdd && ( | |
169 | + <Input | |
166 | 170 | style={{ width: '100%' }} |
167 | - placeholder='请输入选项' | |
171 | + placeholder="请输入选项" | |
168 | 172 | allowClear |
169 | 173 | value={addInputValue} |
170 | 174 | onChange={e => setAddInputValue(e.target.value.trim())} |
171 | 175 | onPressEnter={() => addOption()} |
172 | 176 | suffix={ |
173 | - <Button type='link' icon={<PlusCircleOutlined />} onClick={() => addOption()} /> | |
174 | - } /> | |
175 | - } | |
177 | + <Button type="link" icon={<PlusCircleOutlined />} onClick={() => addOption()} /> | |
178 | + } | |
179 | + /> | |
180 | +)} | |
176 | 181 | </Col> |
177 | 182 | </Row> |
178 | 183 | </Col> |
179 | 184 | <Col span={4}> |
180 | 185 | {TYPE === 2 && !isBatchDelete ? ( |
181 | - <Row justify='end'> | |
186 | + <Row justify="end"> | |
182 | 187 | {/* {!isEdit && <Button disabled type='default' style={{ marginRight: 10 }} icon={<DragOutlined />} />} */} |
183 | 188 | {!isEdit ? |
184 | - <Button type='default' style={{ marginRight: 10 }} icon={<FormOutlined />} onClick={() => setIsEdit(!isEdit)} /> : | |
185 | - <Button type='default' style={{ marginRight: 10 }} icon={<CheckOutlined />} onClick={() => onOk()} />} | |
186 | - {!isEdit ? | |
187 | - <Popconfirm title={`确定删除?`} onConfirm={() => delQuestion(content!, content.index!)}> | |
188 | - <Button type='default' icon={<DeleteOutlined />} danger /> | |
189 | - </Popconfirm> : | |
190 | - <Button type='default' icon={<CloseOutlined />} onClick={cancel} /> | |
191 | - } | |
189 | + <Button type="default" style={{ marginRight: 10 }} icon={<FormOutlined />} onClick={() => setIsEdit(!isEdit)} /> : | |
190 | + <Button type="default" style={{ marginRight: 10 }} icon={<CheckOutlined />} onClick={() => onOk()} />} | |
191 | + {!isEdit ? ( | |
192 | + <Popconfirm title="确定删除?" onConfirm={() => delQuestion(content!, content.index!)}> | |
193 | + <Button type="default" icon={<DeleteOutlined />} danger /> | |
194 | + </Popconfirm> | |
195 | + ) : | |
196 | + <Button type="default" icon={<CloseOutlined />} onClick={cancel} />} | |
192 | 197 | </Row> |
193 | 198 | ) : null} |
194 | 199 | </Col> |
195 | 200 | </Row> |
196 | 201 | </Card> |
197 | 202 | </Row> |
198 | - ) | |
203 | + ); | |
199 | 204 | } |
200 | 205 | \ No newline at end of file | ... | ... |
src/pages/ehr/ProgramOfStudy/QuestionBank/components/QuestionBankList/QuestionBankModal.tsx
1 | 1 | /* |
2 | 2 | * @Date: 2021-07-14 10:54:47 |
3 | 3 | * @LastEditors: wangqiang@feewee.cn |
4 | - * @LastEditTime: 2022-12-09 19:06:15 | |
4 | + * @LastEditTime: 2023-02-10 09:13:23 | |
5 | 5 | */ |
6 | 6 | import React, { useEffect, useState } from "react"; |
7 | 7 | import { Modal, Form, Input, message, TreeSelect } from "antd"; |
8 | 8 | import { useStore } from "../../index"; |
9 | 9 | import { saveQuestionBankApi, saveDraftApi } from "../../api"; |
10 | -import { LabeledValue } from "antd/lib/select"; | |
11 | 10 | import RangeRoleSelector from "@/pages/ehr/ProgramOfStudy/components/RangeRoleSelector"; |
11 | +import SelectBrandOrSeries from '@/pages/ehr/ProgramOfStudy/components/SelectBrandOrSeries'; | |
12 | 12 | |
13 | 13 | export default function QuestionBankModal() { |
14 | 14 | const { |
... | ... | @@ -29,13 +29,11 @@ export default function QuestionBankModal() { |
29 | 29 | draftPagination; |
30 | 30 | const [form] = Form.useForm(); |
31 | 31 | const [confirmLoading, setComfirmLoading] = useState(false); |
32 | - const [standardId, setStandardId] = useState<number>(); | |
33 | 32 | |
34 | 33 | useEffect(() => { |
35 | 34 | if (visible) { |
36 | 35 | currentItem && form.setFieldsValue(currentItem); |
37 | 36 | if (currentItem) { |
38 | - setStandardId(currentItem.standardId); | |
39 | 37 | form.setFieldsValue({ |
40 | 38 | name: currentItem.name, |
41 | 39 | standardId: currentItem.standardId, |
... | ... | @@ -46,6 +44,13 @@ export default function QuestionBankModal() { |
46 | 44 | value: role.roleCode, |
47 | 45 | })), |
48 | 46 | }, |
47 | + adapter: { | |
48 | + type: currentItem.adapterType, | |
49 | + list: currentItem.adapterList?.map((range) => ({ | |
50 | + value: range.adapterId, | |
51 | + label: range.adapterName, | |
52 | + })), | |
53 | + }, | |
49 | 54 | }); |
50 | 55 | } else { |
51 | 56 | form.setFieldsValue({ |
... | ... | @@ -68,6 +73,11 @@ export default function QuestionBankModal() { |
68 | 73 | roleCode: item.value, |
69 | 74 | roleName: item.label, |
70 | 75 | })), |
76 | + adapterType: val?.adapter?.type, | |
77 | + adapterList: val?.adapter?.list?.map((item: any) => ({ | |
78 | + adapterId: item.value, | |
79 | + adapterName: item.label, | |
80 | + })), | |
71 | 81 | }; |
72 | 82 | const api = TYPE === 2 || isDraft ? saveDraftApi : saveQuestionBankApi; |
73 | 83 | api(params) |
... | ... | @@ -88,13 +98,6 @@ export default function QuestionBankModal() { |
88 | 98 | }); |
89 | 99 | }; |
90 | 100 | |
91 | - const standardChange = (standard: LabeledValue) => { | |
92 | - if (!!standard && visible) { | |
93 | - setStandardId(+standard?.value); | |
94 | - } | |
95 | - return standard; | |
96 | - }; | |
97 | - | |
98 | 101 | const validatorRole = (rule: any, value: any) => { |
99 | 102 | if (!value) return Promise.reject(Error("请选择适用角色")); |
100 | 103 | if (value.type === 2 && !value?.list) { |
... | ... | @@ -103,6 +106,32 @@ export default function QuestionBankModal() { |
103 | 106 | return Promise.resolve(); |
104 | 107 | }; |
105 | 108 | |
109 | + const validatorBrandOrSeries = ( | |
110 | + rule: any, | |
111 | + value: any = { type: 1, list: [] } | |
112 | + ) => { | |
113 | + if (value.type === 4) return Promise.resolve(); | |
114 | + if (!value.type || !value.list?.length) { | |
115 | + return Promise.reject(Error("请选择适用范围")); | |
116 | + } | |
117 | + if (value.list && value.list.length > 0) return Promise.resolve(); | |
118 | + else { | |
119 | + return Promise.reject( | |
120 | + Error( | |
121 | + `请选择${ | |
122 | + value.type === 1 | |
123 | + ? "品牌" | |
124 | + : value.type === 2 | |
125 | + ? "车系" | |
126 | + : value.type === 3 | |
127 | + ? "门店" | |
128 | + : "适用范围" | |
129 | + }` | |
130 | + ) | |
131 | + ); | |
132 | + } | |
133 | + }; | |
134 | + | |
106 | 135 | return ( |
107 | 136 | <Modal |
108 | 137 | title={ |
... | ... | @@ -144,7 +173,6 @@ export default function QuestionBankModal() { |
144 | 173 | name="standardId" |
145 | 174 | label="业务类型" |
146 | 175 | rules={[{ required: true, message: "请选择业务类型" }]} |
147 | - getValueFromEvent={standardChange} | |
148 | 176 | > |
149 | 177 | <TreeSelect |
150 | 178 | allowClear |
... | ... | @@ -164,6 +192,19 @@ export default function QuestionBankModal() { |
164 | 192 | /> |
165 | 193 | </Form.Item> |
166 | 194 | <Form.Item |
195 | + label="适用范围" | |
196 | + name="adapter" | |
197 | + rules={[ | |
198 | + { | |
199 | + required: true, | |
200 | + validator: validatorBrandOrSeries, | |
201 | + message: "请选择适用范围", | |
202 | + }, | |
203 | + ]} | |
204 | + > | |
205 | + <SelectBrandOrSeries mode="multiple" /> | |
206 | + </Form.Item> | |
207 | + <Form.Item | |
167 | 208 | name="role" |
168 | 209 | label="适用角色" |
169 | 210 | required | ... | ... |
src/pages/ehr/ProgramOfStudy/QuestionBank/components/QuestionBankList/components/ApprovalProgressModal.tsx
0 → 100644
1 | +/* | |
2 | + * @Author: wangqiang@feewee.cn | |
3 | + * @Date: 2022-10-26 09:24:59 | |
4 | + * @LastEditors: wangqiang@feewee.cn | |
5 | + * @LastEditTime: 2023-02-09 17:43:55 | |
6 | + */ | |
7 | +import ApprovalProgress from "@/components/ApprovalProgress"; | |
8 | +import { Button, Modal } from "antd"; | |
9 | +import React from "react"; | |
10 | +import { useStore } from "../../../index"; | |
11 | + | |
12 | +export default function ApprovalProgressModal() { | |
13 | + const { approvalProgressModalInfo, setApprovalProgressModalInfo } = | |
14 | + useStore(); | |
15 | + | |
16 | + const onCancel = () => setApprovalProgressModalInfo({ visible: false }); | |
17 | + | |
18 | + return ( | |
19 | + <Modal | |
20 | + title={`${ | |
21 | + approvalProgressModalInfo.title | |
22 | + ? approvalProgressModalInfo.title + "-" | |
23 | + : "" | |
24 | + }审批进度`} | |
25 | + open={approvalProgressModalInfo.visible} | |
26 | + onCancel={onCancel} | |
27 | + maskClosable={false} | |
28 | + destroyOnClose | |
29 | + footer={[ | |
30 | + <Button key="cancel" onClick={onCancel}> | |
31 | + 关闭 | |
32 | + </Button>, | |
33 | + ]} | |
34 | + > | |
35 | + <ApprovalProgress orderNo={approvalProgressModalInfo.orderNo} /> | |
36 | + </Modal> | |
37 | + ); | |
38 | +} | ... | ... |
src/pages/ehr/ProgramOfStudy/QuestionBank/components/QuestionBankList/components/DraftList/index.tsx
1 | 1 | /* |
2 | 2 | * @Date: 2021-07-26 17:19:45 |
3 | 3 | * @LastEditors: wangqiang@feewee.cn |
4 | - * @LastEditTime: 2022-11-21 20:01:42 | |
4 | + * @LastEditTime: 2023-02-09 17:54:02 | |
5 | 5 | */ |
6 | 6 | import React, { useEffect } from "react"; |
7 | 7 | import { useStore } from "../../../../index"; |
... | ... | @@ -20,6 +20,8 @@ import { |
20 | 20 | import { PlusOutlined } from "@ant-design/icons"; |
21 | 21 | import { debounce } from "lodash"; |
22 | 22 | import QuestionBankModal from "../../QuestionBankModal"; |
23 | +import { AdapterType } from "@/pages/ehr/ProgramOfStudy/Settings/store"; | |
24 | +import ApprovalProgressModal from "@/pages/ehr/ProgramOfStudy/QuestionBank/components/QuestionBankList/components/ApprovalProgressModal"; | |
23 | 25 | |
24 | 26 | enum Status { |
25 | 27 | "default" = 1, |
... | ... | @@ -44,10 +46,11 @@ export default function DraftList() { |
44 | 46 | breadcrumbs, |
45 | 47 | setBreadcrumbs, |
46 | 48 | setCurrentBreadcrumb, |
47 | - roleVisible, | |
48 | - setRoleVisible, | |
49 | + detailModalInfo, | |
50 | + setDetailModalInfo, | |
49 | 51 | isDraft, |
50 | 52 | setIsDraft, |
53 | + setApprovalProgressModalInfo, | |
51 | 54 | } = useStore(); |
52 | 55 | const { |
53 | 56 | list, |
... | ... | @@ -57,7 +60,6 @@ export default function DraftList() { |
57 | 60 | setParams, |
58 | 61 | paginationConfig, |
59 | 62 | } = draftPagination; |
60 | - const { current, pageSize } = paginationConfig; | |
61 | 63 | |
62 | 64 | useEffect(() => { |
63 | 65 | if (isDraft) { |
... | ... | @@ -81,21 +83,31 @@ export default function DraftList() { |
81 | 83 | }; |
82 | 84 | |
83 | 85 | const delBank = (id: number) => { |
86 | + const hide = message.loading("删除中,请稍后...", 0); | |
84 | 87 | deleteDraftApi(id) |
85 | 88 | .then((res) => { |
89 | + hide(); | |
86 | 90 | message.success(res.result); |
87 | 91 | setLoading(true); |
88 | 92 | }) |
89 | - .catch((error) => message.error(error.message)); | |
93 | + .catch((error) => { | |
94 | + hide(); | |
95 | + message.error(error.message); | |
96 | + }); | |
90 | 97 | }; |
91 | 98 | |
92 | 99 | const approvalDraft = (draftId: number) => { |
100 | + const hide = message.loading("提交中,请稍后...", 0); | |
93 | 101 | approvalDraftApi(draftId) |
94 | 102 | .then((res) => { |
103 | + hide(); | |
95 | 104 | message.success(res.result); |
96 | 105 | setLoading(true); |
97 | 106 | }) |
98 | - .catch((error) => message.error(error.message)); | |
107 | + .catch((error) => { | |
108 | + hide(); | |
109 | + message.error(error.message); | |
110 | + }); | |
99 | 111 | }; |
100 | 112 | |
101 | 113 | const search = debounce( |
... | ... | @@ -132,12 +144,6 @@ export default function DraftList() { |
132 | 144 | loading={loading} |
133 | 145 | > |
134 | 146 | <Table.Column |
135 | - title="题库编号" | |
136 | - dataIndex="id" | |
137 | - align="left" | |
138 | - render={(id: number, record: QuestionBank.List, index: number) => index + 1 + (current! - 1) * pageSize!} | |
139 | - /> | |
140 | - <Table.Column | |
141 | 147 | title="题库名称" |
142 | 148 | dataIndex="name" |
143 | 149 | align="left" |
... | ... | @@ -161,26 +167,44 @@ export default function DraftList() { |
161 | 167 | <Table.Column |
162 | 168 | title="适用角色" |
163 | 169 | align="left" |
164 | - render={(record: QuestionBank.List) => ( | |
165 | - <span | |
166 | - style={{ color: record.scopeType === 1 ? "orange" : "purple" }} | |
167 | - > | |
168 | - {record.scopeType === 1 ? ( | |
169 | - "全部" | |
170 | - ) : record.roleList?.length ? ( | |
170 | + render={(record: QuestionBank.List) => (record.scopeType === 1 ? ( | |
171 | + "全部角色" | |
172 | + ) : record.roleList?.length ? ( | |
173 | + <a | |
174 | + onClick={() => { | |
175 | + setCurrentItem(record); | |
176 | + setDetailModalInfo({ visible: true, type: "适用角色" }); | |
177 | + }} | |
178 | + > | |
179 | + 部分角色 | |
180 | + </a> | |
181 | + ) : ( | |
182 | + "-" | |
183 | + ))} | |
184 | + /> | |
185 | + <Table.Column | |
186 | + title="适用范围" | |
187 | + align="left" | |
188 | + render={(record: QuestionBank.List) => (record.adapterType ? ( | |
189 | + record.adapterType === AdapterType.全部门店 ? ( | |
190 | + "全部门店" | |
191 | + ) : ( | |
171 | 192 | <a |
172 | 193 | onClick={() => { |
173 | 194 | setCurrentItem(record); |
174 | - setRoleVisible(true); | |
195 | + setDetailModalInfo({ | |
196 | + visible: true, | |
197 | + type: "适用范围", | |
198 | + typeName: AdapterType[record.adapterType!], | |
199 | + }); | |
175 | 200 | }} |
176 | 201 | > |
177 | - 部分 | |
202 | + {AdapterType[record.adapterType]} | |
178 | 203 | </a> |
179 | - ) : ( | |
180 | - "-" | |
181 | - )} | |
182 | - </span> | |
183 | - )} | |
204 | + ) | |
205 | + ) : ( | |
206 | + "-" | |
207 | + ))} | |
184 | 208 | /> |
185 | 209 | <Table.Column |
186 | 210 | title="状态" |
... | ... | @@ -193,56 +217,90 @@ export default function DraftList() { |
193 | 217 | <Table.Column |
194 | 218 | title="操作" |
195 | 219 | align="left" |
196 | - render={(record: QuestionBank.List) => (record.status === StatusText["审批中"] ? ( | |
197 | - <span style={{ color: "#999" }}>审批中的草稿无法操作</span> | |
198 | - ) : ( | |
199 | - <> | |
200 | - <a | |
201 | - onClick={() => { | |
202 | - setCurrentItem(record); | |
203 | - setVisible(true); | |
204 | - }} | |
205 | - > | |
206 | - 编辑 | |
207 | - </a> | |
208 | - <Divider type="vertical" /> | |
209 | - <Popconfirm | |
210 | - title={`确定提交【${record.name}】审批?`} | |
211 | - onConfirm={() => approvalDraft(record.id!)} | |
212 | - > | |
213 | - <a style={{ color: "#faad14" }}>提交审批</a> | |
214 | - </Popconfirm> | |
215 | - <Divider type="vertical" /> | |
216 | - <Popconfirm | |
217 | - title={`确定删除【${record.name}】?`} | |
218 | - onConfirm={() => delBank(record.id!)} | |
219 | - > | |
220 | - <a style={{ color: "red" }}>删除</a> | |
221 | - </Popconfirm> | |
222 | - </> | |
223 | - ))} | |
220 | + render={(record: QuestionBank.List) => ( | |
221 | + <> | |
222 | + {record.auditNo ? ( | |
223 | + <> | |
224 | + <a | |
225 | + onClick={() => { | |
226 | + setApprovalProgressModalInfo({ | |
227 | + title: record.name, | |
228 | + visible: true, | |
229 | + orderNo: record.auditNo, | |
230 | + }); | |
231 | + }} | |
232 | + > | |
233 | + 审批进度 | |
234 | + </a> | |
235 | + <Divider type="vertical" /> | |
236 | + </> | |
237 | + ) : null} | |
238 | + {record.status === StatusText.审批中 ? null : ( | |
239 | + <> | |
240 | + <a | |
241 | + onClick={() => { | |
242 | + setCurrentItem(record); | |
243 | + setVisible(true); | |
244 | + }} | |
245 | + > | |
246 | + 编辑 | |
247 | + </a> | |
248 | + <Divider type="vertical" /> | |
249 | + <Popconfirm | |
250 | + title={`确定提交【${record.name}】审批?`} | |
251 | + onConfirm={() => approvalDraft(record.id!)} | |
252 | + > | |
253 | + <a style={{ color: "#faad14" }}>提交审批</a> | |
254 | + </Popconfirm> | |
255 | + <Divider type="vertical" /> | |
256 | + <Popconfirm | |
257 | + title={`确定删除【${record.name}】?`} | |
258 | + onConfirm={() => delBank(record.id!)} | |
259 | + > | |
260 | + <a style={{ color: "red" }}>删除</a> | |
261 | + </Popconfirm> | |
262 | + </> | |
263 | + )} | |
264 | + </> | |
265 | + )} | |
224 | 266 | /> |
225 | 267 | </Table> |
226 | 268 | <QuestionBankModal /> |
227 | 269 | <Modal |
228 | - title={currentItem && `【${currentItem.name}】适用角色`} | |
229 | - visible={roleVisible} | |
270 | + title={ | |
271 | + currentItem && | |
272 | + `【${currentItem.name}】-${detailModalInfo.type}${ | |
273 | + detailModalInfo.typeName ? `-${detailModalInfo.typeName}` : "" | |
274 | + }` | |
275 | + } | |
276 | + visible={detailModalInfo.visible} | |
230 | 277 | maskClosable={false} |
231 | - onOk={() => setRoleVisible(false)} | |
232 | - onCancel={() => setRoleVisible(false)} | |
278 | + onOk={() => setDetailModalInfo({ visible: false, type: "适用角色" })} | |
279 | + onCancel={() => setDetailModalInfo({ visible: false, type: "适用角色" })} | |
233 | 280 | footer={[ |
234 | - <Button key="1" onClick={() => setRoleVisible(false)}> | |
281 | + <Button | |
282 | + key="1" | |
283 | + onClick={() => setDetailModalInfo({ visible: false, type: "适用角色" })} | |
284 | + > | |
235 | 285 | 关闭 |
236 | 286 | </Button>, |
237 | 287 | ]} |
238 | 288 | afterClose={() => setCurrentItem(undefined)} |
239 | 289 | > |
240 | 290 | <div style={{ flex: 1, maxHeight: 550, overflowY: "auto" }}> |
241 | - {currentItem?.roleList?.map((role, index) => ( | |
242 | - <p key={role.roleCode}>{role.roleName}</p> | |
243 | - ))} | |
291 | + {detailModalInfo.type === "适用角色" | |
292 | + ? currentItem?.roleList?.map((role, index) => ( | |
293 | + <p key={role.roleCode}>{role.roleName}</p> | |
294 | + )) | |
295 | + : null} | |
296 | + {detailModalInfo.type === "适用范围" | |
297 | + ? currentItem?.adapterList?.map((adapter, index) => ( | |
298 | + <p key={adapter.adapterId}>{adapter.adapterName}</p> | |
299 | + )) | |
300 | + : null} | |
244 | 301 | </div> |
245 | 302 | </Modal> |
303 | + <ApprovalProgressModal /> | |
246 | 304 | </> |
247 | 305 | ); |
248 | 306 | } | ... | ... |
src/pages/ehr/ProgramOfStudy/QuestionBank/components/QuestionBankList/components/UsingList/index.tsx
1 | 1 | /* |
2 | 2 | * @Date: 2021-07-26 17:19:45 |
3 | 3 | * @LastEditors: wangqiang@feewee.cn |
4 | - * @LastEditTime: 2022-12-09 19:07:33 | |
4 | + * @LastEditTime: 2023-02-09 17:52:44 | |
5 | 5 | */ |
6 | 6 | import React, { useEffect, useState } from "react"; |
7 | 7 | import { useStore } from "../../../../index"; |
... | ... | @@ -21,6 +21,8 @@ import { debounce } from "lodash"; |
21 | 21 | import QuestionBankModal from "../../QuestionBankModal"; |
22 | 22 | import RangeRoleSelector from "@/pages/ehr/ProgramOfStudy/components/RangeRoleSelector"; |
23 | 23 | import FeeweeFilterOption from "@/pages/notice/components/FeeweeFilterOption"; |
24 | +import SelectBrandOrSeries from "@/pages/ehr/ProgramOfStudy/components/SelectBrandOrSeries"; | |
25 | +import { AdapterType } from "@/pages/ehr/ProgramOfStudy/Settings/store"; | |
24 | 26 | |
25 | 27 | export default function UsingList() { |
26 | 28 | const { |
... | ... | @@ -32,8 +34,8 @@ export default function UsingList() { |
32 | 34 | breadcrumbs, |
33 | 35 | setBreadcrumbs, |
34 | 36 | setCurrentBreadcrumb, |
35 | - roleVisible, | |
36 | - setRoleVisible, | |
37 | + detailModalInfo, | |
38 | + setDetailModalInfo, | |
37 | 39 | setIsDraft, |
38 | 40 | setTYPE, |
39 | 41 | draftPagination, |
... | ... | @@ -47,7 +49,6 @@ export default function UsingList() { |
47 | 49 | setParams, |
48 | 50 | paginationConfig, |
49 | 51 | } = pagination; |
50 | - const { current, pageSize } = paginationConfig; | |
51 | 52 | const [getDraftLoading, setGetDraftLoading] = useState(false); |
52 | 53 | |
53 | 54 | useEffect(() => { |
... | ... | @@ -62,12 +63,17 @@ export default function UsingList() { |
62 | 63 | }; |
63 | 64 | |
64 | 65 | const delBank = (id: number) => { |
66 | + const hide = message.loading("删除中,请稍后...", 0); | |
65 | 67 | deleteQuestionBankApi(id) |
66 | 68 | .then((res) => { |
69 | + hide(); | |
67 | 70 | message.success("删除成功"); |
68 | 71 | setLoading(true); |
69 | 72 | }) |
70 | - .catch((error) => message.error(error.message)); | |
73 | + .catch((error) => { | |
74 | + hide(); | |
75 | + message.error(error.message); | |
76 | + }); | |
71 | 77 | }; |
72 | 78 | |
73 | 79 | const search = debounce( |
... | ... | @@ -162,6 +168,32 @@ export default function UsingList() { |
162 | 168 | display: innerParams.standardId ? "flex" : "none", |
163 | 169 | }} |
164 | 170 | /> |
171 | + <SelectBrandOrSeries | |
172 | + useFilter | |
173 | + value={{ | |
174 | + type: pagination.innerParams.adapterType, | |
175 | + list: | |
176 | + pagination.innerParams.adapterId && | |
177 | + pagination.innerParams.adapterName | |
178 | + ? [ | |
179 | + { | |
180 | + value: pagination.innerParams.adapterId, | |
181 | + label: pagination.innerParams.adapterName, | |
182 | + }, | |
183 | + ] | |
184 | + : undefined, | |
185 | + }} | |
186 | + onChange={(value: any) => { | |
187 | + pagination.setParams( | |
188 | + { | |
189 | + adapterType: value?.type, | |
190 | + adapterId: value?.list?.[0]?.value, | |
191 | + adapterName: value?.list?.[0]?.label, | |
192 | + }, | |
193 | + true | |
194 | + ); | |
195 | + }} | |
196 | + /> | |
165 | 197 | {/* </Row> */} |
166 | 198 | {/* <Button icon={(<PlusOutlined />)} type="primary" onClick={() => { setCurrentItem(undefined); setVisible(true); }}>添加题库</Button> */} |
167 | 199 | </Row> |
... | ... | @@ -172,12 +204,6 @@ export default function UsingList() { |
172 | 204 | loading={loading || getDraftLoading} |
173 | 205 | > |
174 | 206 | <Table.Column |
175 | - title="题库编号" | |
176 | - dataIndex="id" | |
177 | - align="left" | |
178 | - render={(id: number, record: QuestionBank.List, index: number) => index + 1 + (current! - 1) * pageSize!} | |
179 | - /> | |
180 | - <Table.Column | |
181 | 207 | title="题库名称" |
182 | 208 | dataIndex="name" |
183 | 209 | align="left" |
... | ... | @@ -197,26 +223,44 @@ export default function UsingList() { |
197 | 223 | <Table.Column |
198 | 224 | title="适用角色" |
199 | 225 | align="left" |
200 | - render={(record: QuestionBank.List) => ( | |
201 | - <span | |
202 | - style={{ color: record.scopeType === 1 ? "orange" : "purple" }} | |
203 | - > | |
204 | - {record.scopeType === 1 ? ( | |
205 | - "全部角色" | |
206 | - ) : record.roleList?.length ? ( | |
226 | + render={(record: QuestionBank.List) => (record.scopeType === 1 ? ( | |
227 | + "全部角色" | |
228 | + ) : record.roleList?.length ? ( | |
229 | + <a | |
230 | + onClick={() => { | |
231 | + setCurrentItem(record); | |
232 | + setDetailModalInfo({ visible: true, type: "适用角色" }); | |
233 | + }} | |
234 | + > | |
235 | + 部分角色 | |
236 | + </a> | |
237 | + ) : ( | |
238 | + "-" | |
239 | + ))} | |
240 | + /> | |
241 | + <Table.Column | |
242 | + title="适用范围" | |
243 | + align="left" | |
244 | + render={(record: QuestionBank.List) => (record.adapterType ? ( | |
245 | + record.adapterType === AdapterType.全部门店 ? ( | |
246 | + "全部门店" | |
247 | + ) : ( | |
207 | 248 | <a |
208 | 249 | onClick={() => { |
209 | 250 | setCurrentItem(record); |
210 | - setRoleVisible(true); | |
251 | + setDetailModalInfo({ | |
252 | + visible: true, | |
253 | + type: "适用范围", | |
254 | + typeName: AdapterType[record.adapterType!], | |
255 | + }); | |
211 | 256 | }} |
212 | 257 | > |
213 | - 部分角色 | |
258 | + {AdapterType[record.adapterType]} | |
214 | 259 | </a> |
215 | - ) : ( | |
216 | - "-" | |
217 | - )} | |
218 | - </span> | |
219 | - )} | |
260 | + ) | |
261 | + ) : ( | |
262 | + "-" | |
263 | + ))} | |
220 | 264 | /> |
221 | 265 | <Table.Column |
222 | 266 | title="操作" |
... | ... | @@ -251,22 +295,37 @@ export default function UsingList() { |
251 | 295 | </Table> |
252 | 296 | <QuestionBankModal /> |
253 | 297 | <Modal |
254 | - title={currentItem && `【${currentItem.name}】适用角色`} | |
255 | - visible={roleVisible} | |
298 | + title={ | |
299 | + currentItem && | |
300 | + `【${currentItem.name}】-${detailModalInfo.type}${ | |
301 | + detailModalInfo.typeName ? `-${detailModalInfo.typeName}` : "" | |
302 | + }` | |
303 | + } | |
304 | + visible={detailModalInfo.visible} | |
256 | 305 | maskClosable={false} |
257 | - onOk={() => setRoleVisible(false)} | |
258 | - onCancel={() => setRoleVisible(false)} | |
306 | + onOk={() => setDetailModalInfo({ visible: false, type: "适用角色" })} | |
307 | + onCancel={() => setDetailModalInfo({ visible: false, type: "适用角色" })} | |
259 | 308 | footer={[ |
260 | - <Button key="1" onClick={() => setRoleVisible(false)}> | |
309 | + <Button | |
310 | + key="1" | |
311 | + onClick={() => setDetailModalInfo({ visible: false, type: "适用角色" })} | |
312 | + > | |
261 | 313 | 关闭 |
262 | 314 | </Button>, |
263 | 315 | ]} |
264 | 316 | afterClose={() => setCurrentItem(undefined)} |
265 | 317 | > |
266 | 318 | <div style={{ flex: 1, maxHeight: 550, overflowY: "auto" }}> |
267 | - {currentItem?.roleList?.map((role, index) => ( | |
268 | - <p key={role.roleCode}>{role.roleName}</p> | |
269 | - ))} | |
319 | + {detailModalInfo.type === "适用角色" | |
320 | + ? currentItem?.roleList?.map((role, index) => ( | |
321 | + <p key={role.roleCode}>{role.roleName}</p> | |
322 | + )) | |
323 | + : null} | |
324 | + {detailModalInfo.type === "适用范围" | |
325 | + ? currentItem?.adapterList?.map((adapter, index) => ( | |
326 | + <p key={adapter.adapterId}>{adapter.adapterName}</p> | |
327 | + )) | |
328 | + : null} | |
270 | 329 | </div> |
271 | 330 | </Modal> |
272 | 331 | </> | ... | ... |
src/pages/ehr/ProgramOfStudy/QuestionBank/index.tsx
1 | 1 | /* |
2 | 2 | * @Date: 2021-07-14 10:54:47 |
3 | 3 | * @LastEditors: wangqiang@feewee.cn |
4 | - * @LastEditTime: 2021-07-27 17:08:02 | |
4 | + * @LastEditTime: 2023-02-09 17:00:20 | |
5 | 5 | */ |
6 | -import React, { useEffect, useState } from 'react'; | |
7 | -import { Card, ConfigProvider, Breadcrumb } from 'antd'; | |
8 | -import zhCN from 'antd/lib/locale-provider/zh_CN'; | |
9 | -import { PageHeaderWrapper } from '@ant-design/pro-layout'; | |
10 | -import List from './components/QuestionBankList'; | |
11 | -import Item from './components/QuestionBankItem'; | |
12 | -import { createStore } from '@/hooks/moz'; | |
13 | -import store, { BreadcrumbItem } from './store'; | |
14 | -import './style.less'; | |
6 | +import React, { useEffect, useState } from "react"; | |
7 | +import { Card, ConfigProvider, Breadcrumb } from "antd"; | |
8 | +import zhCN from "antd/lib/locale-provider/zh_CN"; | |
9 | +import { PageHeaderWrapper } from "@ant-design/pro-layout"; | |
10 | +import List from "./components/QuestionBankList"; | |
11 | +import Item from "./components/QuestionBankItem"; | |
12 | +import { createStore } from "@/hooks/moz"; | |
13 | +import store, { BreadcrumbItem } from "./store"; | |
14 | +import "./style.less"; | |
15 | 15 | |
16 | 16 | export const { Provider, useStore } = createStore(store); |
17 | 17 | |
... | ... | @@ -25,17 +25,17 @@ function QuestionBank() { |
25 | 25 | setCurrentBreadcrumb, |
26 | 26 | currentItem, |
27 | 27 | setCurrentItem, |
28 | - TYPE | |
28 | + TYPE, | |
29 | 29 | } = useStore(); |
30 | 30 | const { setLoading } = pagination; |
31 | 31 | const [IndexDOM, setIndexDOM] = useState(<List />); |
32 | 32 | |
33 | 33 | useEffect(() => { |
34 | 34 | switch (currentBreadcrumb.key) { |
35 | - case 'list': | |
35 | + case "list": | |
36 | 36 | setIndexDOM(<List />); |
37 | 37 | break; |
38 | - case 'detail': | |
38 | + case "detail": | |
39 | 39 | setIndexDOM(<Item />); |
40 | 40 | break; |
41 | 41 | default: |
... | ... | @@ -45,32 +45,51 @@ function QuestionBank() { |
45 | 45 | |
46 | 46 | const breadcrumbClick = (breadcrumb: BreadcrumbItem, index: number) => { |
47 | 47 | if (breadcrumb.key === currentBreadcrumb.key) return; |
48 | - if (breadcrumb.key === 'list') { | |
48 | + if (breadcrumb.key === "list") { | |
49 | 49 | setCurrentItem(undefined); |
50 | 50 | setLoading(true); |
51 | 51 | setFactoryId(0); |
52 | 52 | } |
53 | 53 | setCurrentBreadcrumb(breadcrumb); |
54 | 54 | setBreadcrumbs(breadcrumbs.slice(0, index + 1)); |
55 | - } | |
55 | + }; | |
56 | 56 | |
57 | 57 | return ( |
58 | - <PageHeaderWrapper title={( | |
59 | - <div> | |
60 | - <span>题库设置{currentBreadcrumb.key === 'detail' ? `-${currentItem ? `编辑${TYPE === 2 ? '草稿' : ''}(${currentItem.name})` : `添加${TYPE === 2 ? '草稿' : ''}`}` : null}</span> | |
61 | - <Breadcrumb separator='>' style={{ marginTop: 10 }}> | |
62 | - {breadcrumbs.map((breadcrumb, index) => | |
63 | - <Breadcrumb.Item onClick={() => breadcrumbClick(breadcrumb, index)} key={breadcrumb.key}><a>{breadcrumb.name}</a></Breadcrumb.Item>)} | |
64 | - </Breadcrumb> | |
65 | - </div> | |
66 | - )}> | |
58 | + <PageHeaderWrapper | |
59 | + title={ | |
60 | + <div> | |
61 | + <span> | |
62 | + 题库设置 | |
63 | + {currentBreadcrumb.key === "detail" | |
64 | + ? `-${ | |
65 | + currentItem | |
66 | + ? `编辑${TYPE === 2 ? "草稿" : ""}(${currentItem.name})` | |
67 | + : `添加${TYPE === 2 ? "草稿" : ""}` | |
68 | + }` | |
69 | + : null} | |
70 | + </span> | |
71 | + <Breadcrumb separator=">" style={{ marginTop: 10 }}> | |
72 | + {breadcrumbs.map((breadcrumb, index) => ( | |
73 | + <Breadcrumb.Item | |
74 | + onClick={() => breadcrumbClick(breadcrumb, index)} | |
75 | + key={breadcrumb.key} | |
76 | + > | |
77 | + <a>{breadcrumb.name}</a> | |
78 | + </Breadcrumb.Item> | |
79 | + ))} | |
80 | + </Breadcrumb> | |
81 | + </div> | |
82 | + } | |
83 | + > | |
67 | 84 | <ConfigProvider locale={zhCN}> |
68 | - <Card bordered={false}> | |
69 | - {IndexDOM} | |
70 | - </Card> | |
85 | + <Card bordered={false}>{IndexDOM}</Card> | |
71 | 86 | </ConfigProvider> |
72 | 87 | </PageHeaderWrapper> |
73 | - ) | |
88 | + ); | |
74 | 89 | } |
75 | 90 | |
76 | -export default () => <Provider><QuestionBank /></Provider> | |
91 | +export default () => ( | |
92 | + <Provider> | |
93 | + <QuestionBank /> | |
94 | + </Provider> | |
95 | +); | ... | ... |
src/pages/ehr/ProgramOfStudy/QuestionBank/interface.d.ts
1 | 1 | /* |
2 | 2 | * @Date: 2021-02-24 09:57:33 |
3 | 3 | * @LastEditors: wangqiang@feewee.cn |
4 | - * @LastEditTime: 2022-11-21 19:50:00 | |
4 | + * @LastEditTime: 2023-02-10 14:49:06 | |
5 | 5 | */ |
6 | 6 | declare namespace QuestionBank { |
7 | 7 | interface QueryParams { |
... | ... | @@ -10,6 +10,10 @@ declare namespace QuestionBank { |
10 | 10 | standardId?: number; // 业务类型ID |
11 | 11 | scopeType?: number; // 适配范围 1通用 2部分 |
12 | 12 | roleCode?: string; // 角色码 |
13 | + adapterType?: number; // 适配类型 1品牌 2车系 3门店 4通用 | |
14 | + adapterIds?: string; // ids ,分割 | |
15 | + adapterId?: number; | |
16 | + adapterName?: string; | |
13 | 17 | } |
14 | 18 | |
15 | 19 | interface List { |
... | ... | @@ -21,7 +25,15 @@ declare namespace QuestionBank { |
21 | 25 | roleList?: RoleVO[]; |
22 | 26 | standardId?: number; //业务类型ID |
23 | 27 | standardName?: string; //业务类型名称 |
28 | + adapterType?: number; // 适配类型 1品牌 2车系 3门店 4通用 | |
29 | + adapterList?: AdapterVO[]; // 适配列表 | |
24 | 30 | status?: 1 | 2; //状态 1草稿 2审批中 3审批拒绝 |
31 | + auditNo?: string; // 审批编号 | |
32 | + } | |
33 | + | |
34 | + interface AdapterVO { | |
35 | + adapterId?: number; | |
36 | + adapterName?: string; | |
25 | 37 | } |
26 | 38 | |
27 | 39 | interface RoleVO { | ... | ... |
src/pages/ehr/ProgramOfStudy/QuestionBank/store.ts
1 | 1 | /* |
2 | 2 | * @Date: 2021-02-24 09:57:33 |
3 | 3 | * @LastEditors: wangqiang@feewee.cn |
4 | - * @LastEditTime: 2022-12-09 17:50:05 | |
4 | + * @LastEditTime: 2023-02-09 17:50:44 | |
5 | 5 | */ |
6 | 6 | import useInitial from "@/hooks/useInitail"; |
7 | 7 | import usePagination from "@/hooks/usePagination"; |
8 | -import { getUserAbilityTypeListApi } from '@/pages/ehr/ProgramOfStudy/api'; | |
8 | +import { getUserAbilityTypeListApi } from "@/pages/ehr/ProgramOfStudy/api"; | |
9 | 9 | import { useState, ReactNode } from "react"; |
10 | 10 | import { |
11 | 11 | getQuestionBankListApi, |
... | ... | @@ -68,11 +68,7 @@ export default function useStore() { |
68 | 68 | const [isAddFinish, setIsAddFinish] = useState(true); |
69 | 69 | const [currentItem, setCurrentItem] = useState<QuestionBank.List>(); |
70 | 70 | // 列表项 |
71 | - const pagination = usePagination<QuestionBank.List[]>( | |
72 | - getQuestionBankListApi, | |
73 | - {}, | |
74 | - {} | |
75 | - ); | |
71 | + const pagination = usePagination(getQuestionBankListApi, {}); | |
76 | 72 | const [delay, setQuestionDelay] = useState(true); |
77 | 73 | const [factoryId, setFactoryId] = useState(0); |
78 | 74 | const [draftId, setDraftId] = useState(0); |
... | ... | @@ -86,7 +82,11 @@ export default function useStore() { |
86 | 82 | { node: ReactNode; index: number }[] |
87 | 83 | >([]); |
88 | 84 | const [abilityAttachVisible, setAbilityAttachVisible] = useState(false); |
89 | - const [roleVisible, setRoleVisible] = useState(false); | |
85 | + const [detailModalInfo, setDetailModalInfo] = useState<{ | |
86 | + visible: boolean; | |
87 | + type: "适用角色" | "适用范围"; | |
88 | + typeName?: string; | |
89 | + }>({ visible: false, type: "适用角色" }); | |
90 | 90 | |
91 | 91 | const draftPagination = usePagination(getDraftListApi); |
92 | 92 | const draftQuestionInitial = useInitial( |
... | ... | @@ -104,6 +104,8 @@ export default function useStore() { |
104 | 104 | [], |
105 | 105 | undefined |
106 | 106 | ); |
107 | + const [approvalProgressModalInfo, setApprovalProgressModalInfo] = | |
108 | + useState<PublicNotice.ApprovalProgressModalInfo>({ visible: false }); | |
107 | 109 | |
108 | 110 | // useEffect(() => { |
109 | 111 | // if (factoryId > 0) { |
... | ... | @@ -145,8 +147,8 @@ export default function useStore() { |
145 | 147 | setAddModalContents, |
146 | 148 | abilityAttachVisible, |
147 | 149 | setAbilityAttachVisible, |
148 | - roleVisible, | |
149 | - setRoleVisible, | |
150 | + detailModalInfo, | |
151 | + setDetailModalInfo, | |
150 | 152 | draftPagination, |
151 | 153 | draftQuestionInitial, |
152 | 154 | isBatchDelete, |
... | ... | @@ -156,5 +158,7 @@ export default function useStore() { |
156 | 158 | isDraft, |
157 | 159 | setIsDraft, |
158 | 160 | abilityTypeInitial, |
161 | + approvalProgressModalInfo, | |
162 | + setApprovalProgressModalInfo, | |
159 | 163 | }; |
160 | 164 | } | ... | ... |
src/pages/ehr/ProgramOfStudy/Settings/components/ApprovalProgressModal.tsx
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | * @Author: wangqiang@feewee.cn |
3 | 3 | * @Date: 2022-10-26 09:24:59 |
4 | 4 | * @LastEditors: wangqiang@feewee.cn |
5 | - * @LastEditTime: 2022-10-26 17:56:29 | |
5 | + * @LastEditTime: 2023-02-09 17:43:52 | |
6 | 6 | */ |
7 | 7 | import ApprovalProgress from "@/components/ApprovalProgress"; |
8 | 8 | import { Button, Modal } from "antd"; |
... | ... | @@ -25,6 +25,7 @@ export default function ApprovalProgressModal() { |
25 | 25 | open={approvalProgressModalInfo.visible} |
26 | 26 | onCancel={onCancel} |
27 | 27 | maskClosable={false} |
28 | + destroyOnClose | |
28 | 29 | footer={[ |
29 | 30 | <Button key="cancel" onClick={onCancel}> |
30 | 31 | 关闭 | ... | ... |
src/pages/ehr/ProgramOfStudy/Settings/components/Modal.tsx
... | ... | @@ -30,7 +30,7 @@ import { |
30 | 30 | getStudyDetailApi, |
31 | 31 | } from "../api"; |
32 | 32 | import moment, { Moment } from "moment"; |
33 | -import { cloneDeepWith } from "lodash"; | |
33 | +import { cloneDeep } from "lodash"; | |
34 | 34 | |
35 | 35 | export default function ProgramOfStudySettingsModal() { |
36 | 36 | const { |
... | ... | @@ -59,6 +59,23 @@ export default function ProgramOfStudySettingsModal() { |
59 | 59 | api(current.id) |
60 | 60 | .then((res) => { |
61 | 61 | tempItem.current = res.data; |
62 | + | |
63 | + // 查询题库列表 | |
64 | + questionBankInitial.setParams( | |
65 | + { | |
66 | + standardId: res.data?.typeId, | |
67 | + adapterType: res.data?.adapterType, | |
68 | + adapterIds: res.data?.adapterList | |
69 | + ?.map((adapter) => adapter.adapterId) | |
70 | + .join(","), | |
71 | + scopeType: res.data?.roleRangeType, | |
72 | + roleCode: res.data?.roleRangeList | |
73 | + ?.map((role) => role.roleCode) | |
74 | + .join(","), | |
75 | + }, | |
76 | + true | |
77 | + ); | |
78 | + | |
62 | 79 | form.setFieldsValue({ |
63 | 80 | ...res.data, |
64 | 81 | adapter: { |
... | ... | @@ -156,9 +173,10 @@ export default function ProgramOfStudySettingsModal() { |
156 | 173 | return message.error("考试和实操至少需要一个"); |
157 | 174 | } |
158 | 175 | const params: EHrProgramOfStudySettings.ListVO = { |
159 | - id: listType === "列表" ? undefined : current?.id, | |
176 | + id: listType === "列表" ? undefined : tempItem.current?.id, | |
160 | 177 | // referId: submitType.current === "draft" ? (current?.referId || current?.id) : current?.id, |
161 | - referId: listType === "列表" ? current?.id : current?.referId, | |
178 | + referId: | |
179 | + listType === "列表" ? tempItem.current?.id : tempItem.current?.referId, | |
162 | 180 | name: val.name, |
163 | 181 | typeId: val.typeId, |
164 | 182 | roleRangeType: val?.rangeRole?.type, |
... | ... | @@ -196,8 +214,8 @@ export default function ProgramOfStudySettingsModal() { |
196 | 214 | tempItem.current && |
197 | 215 | !(listType === "草稿" && submitType.current === "save") |
198 | 216 | ) { |
199 | - const _p = cloneDeepWith(params), | |
200 | - _c = cloneDeepWith(tempItem.current); | |
217 | + const _p = cloneDeep(params), | |
218 | + _c = cloneDeep(tempItem.current); | |
201 | 219 | delete _p.id; |
202 | 220 | delete _p.referId; |
203 | 221 | delete _p.draft; |
... | ... | @@ -242,6 +260,7 @@ export default function ProgramOfStudySettingsModal() { |
242 | 260 | onCancel={() => setVisible(false)} |
243 | 261 | afterClose={() => { |
244 | 262 | form.resetFields(); |
263 | + tempItem.current = undefined; | |
245 | 264 | setCureent(undefined); |
246 | 265 | setIsView(false); |
247 | 266 | }} |
... | ... | @@ -331,6 +350,19 @@ export default function ProgramOfStudySettingsModal() { |
331 | 350 | message: "请选择适用范围", |
332 | 351 | }, |
333 | 352 | ]} |
353 | + getValueFromEvent={(value?: { | |
354 | + type?: number; | |
355 | + list?: { value?: string; label?: string }[]; | |
356 | + }) => { | |
357 | + questionBankInitial.setParams( | |
358 | + { | |
359 | + adapterType: value?.type, | |
360 | + adapterIds: value?.list?.map((item) => item.value).join(","), | |
361 | + }, | |
362 | + true | |
363 | + ); | |
364 | + return value; | |
365 | + }} | |
334 | 366 | > |
335 | 367 | <SelectBrandOrSeries disabled={isView} mode="multiple" /> |
336 | 368 | </Form.Item> | ... | ... |
src/pages/ehr/ProgramOfStudy/Settings/store.ts
... | ... | @@ -2,18 +2,18 @@ |
2 | 2 | * @Author: wangqiang@feewee.cn |
3 | 3 | * @Date: 2022-11-19 10:58:19 |
4 | 4 | * @LastEditors: wangqiang@feewee.cn |
5 | - * @LastEditTime: 2022-12-09 16:08:36 | |
5 | + * @LastEditTime: 2023-02-10 14:50:19 | |
6 | 6 | */ |
7 | 7 | import useInitial from "@/hooks/useInitail"; |
8 | 8 | import usePagination from "@/hooks/usePagination"; |
9 | 9 | import { |
10 | 10 | AbilitDraftType, |
11 | + getQuestionBankSelectListApi, | |
11 | 12 | getUserAbilityTypeListApi, |
12 | 13 | } from "@/pages/ehr/ProgramOfStudy/api"; |
13 | 14 | import { useEffect, useMemo, useRef, useState } from "react"; |
14 | 15 | import { getStudyListApi, checkStudyCanEditApi } from "./api"; |
15 | 16 | import { getAbilityDraftListApi } from "../api"; |
16 | -import { getQuestionBankSelectListApi } from "@/pages/ehr/StandardSetting/ExamSetting/api"; | |
17 | 17 | import { Form, message } from "antd"; |
18 | 18 | |
19 | 19 | // 使用角色类型 1全部角色 2部分角色 | ... | ... |
src/pages/ehr/ProgramOfStudy/api.ts
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | * @Author: wangqiang@feewee.cn |
3 | 3 | * @Date: 2022-11-30 14:34:52 |
4 | 4 | * @LastEditors: wangqiang@feewee.cn |
5 | - * @LastEditTime: 2022-11-30 15:32:26 | |
5 | + * @LastEditTime: 2023-02-10 14:50:23 | |
6 | 6 | */ |
7 | 7 | /* |
8 | 8 | * @Author: wangqiang@feewee.cn |
... | ... | @@ -37,3 +37,16 @@ export function getAbilityDraftListApi( |
37 | 37 | ): http.PromisePageResp<EHrAbilityCommon.DraftVo> { |
38 | 38 | return request.get(`${ABILITY_HOST}/erp/ability/draft/list`, { params }); |
39 | 39 | } |
40 | + | |
41 | +/** | |
42 | + * @description: 题库选择列表(标准中选择题库) | |
43 | + * @param {ExamSetting.QuestionBankSelectParams} params | |
44 | + * @return {common.Page<QuestionBank.List>} | |
45 | + */ | |
46 | +export function getQuestionBankSelectListApi( | |
47 | + params: QuestionBank.QueryParams | |
48 | +): http.PromiseRespA<QuestionBank.List> { | |
49 | + return request.get(`${ABILITY_HOST}/erp/question/choose/factory/list`, { | |
50 | + params, | |
51 | + }); | |
52 | +} | ... | ... |
src/pages/notice/PublicRelease/components/Modal.tsx
1 | 1 | /* |
2 | 2 | * @Date: 2021-08-10 10:15:56 |
3 | 3 | * @LastEditors: wangqiang@feewee.cn |
4 | - * @LastEditTime: 2023-01-05 16:24:04 | |
4 | + * @LastEditTime: 2023-02-11 17:11:04 | |
5 | 5 | */ |
6 | 6 | import { |
7 | 7 | Button, |
... | ... | @@ -435,11 +435,12 @@ export default function PublicReleaseModal() { |
435 | 435 | > |
436 | 436 | {/* @ts-ignore */} |
437 | 437 | <DatePicker |
438 | - showTime | |
438 | + // showTime | |
439 | 439 | disabled={disabled} |
440 | 440 | style={{ width: "100%" }} |
441 | 441 | disabledDate={(current) => current.valueOf() < moment().startOf("D").valueOf() || |
442 | 442 | current.valueOf() > moment().add(7, "d").startOf("D").valueOf()} |
443 | + showTime={{ defaultValue: moment("23:59:59", "HH:mm:ss") }} | |
443 | 444 | disabledTime={(cur) => { |
444 | 445 | const current = moment(); |
445 | 446 | if (cur?.valueOf() && cur.valueOf() > current.valueOf()) { | ... | ... |
src/pages/performance/CompensateGroupConfig/EditComfirm/components/AddCommissionParamsModal.tsx
... | ... | @@ -35,14 +35,14 @@ export default function AddCommissionParamsModal(props: Props) { |
35 | 35 | const percent = /^\d\.([1-9]{1,2}|[0-9][1-9])$|^[1-9]\d{0,1}(\.\d{1,2}){0,1}$|^100(\.0{1,2}){0,1}$/; |
36 | 36 | const Momney = /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/; |
37 | 37 | const [form] = Form.useForm(); |
38 | - const { selectedIndicators, setSelectedIndicators } = useStore(); | |
38 | + const { selectedIndicators, setSelectedIndicators, setCommissionParamAlias } = useStore(); | |
39 | 39 | |
40 | 40 | const [isTarget, setIsTarget] = useState(false); |
41 | 41 | // console.log(form); |
42 | 42 | const { addComVisible, onCancel, postId, shopIds, onOk, comItem, setItemId, caculateType } = props; |
43 | 43 | const [delay, setDelay] = useState(true); |
44 | 44 | const [only, setOnly] = useState<KpiGroupSetteing.IndicatorByPost[]>([]); |
45 | - // 保存选中绩效指标需要配置的绩效目标值类型 | |
45 | + // 保存选中绩效指标需要配置的绩效考核目标值类型 | |
46 | 46 | const [targetType, setTargetType] = useState<number>(); |
47 | 47 | // 保存过滤后指标列表 |
48 | 48 | const [newIndicators, setNewIndicators] = useState<KpiGroupSetteing.IndicatorByPost[]>([]); |
... | ... | @@ -157,6 +157,7 @@ export default function AddCommissionParamsModal(props: Props) { |
157 | 157 | setItemId(Option.key); |
158 | 158 | setId(Option.key); |
159 | 159 | setIndicatorName(Option.children); |
160 | + setCommissionParamAlias(Option.children); | |
160 | 161 | }} |
161 | 162 | showSearch |
162 | 163 | optionFilterProp="children" |
... | ... | @@ -190,35 +191,35 @@ export default function AddCommissionParamsModal(props: Props) { |
190 | 191 | targetType === TargetTypeEnum["数量"]) && ( |
191 | 192 | <div style={{ marginLeft: 65 }}> |
192 | 193 | <Button type="link" onClick={() => setIsTarget(true)}> |
193 | - 目标值设置(可选项) | |
194 | + 考核目标值设置(可选项) | |
194 | 195 | </Button> |
195 | 196 | {isTarget && ( |
196 | 197 | <Button type="link" onClick={() => setIsTarget(false)}> |
197 | - 删除该项目标设置 | |
198 | + 删除该项考核目标设置 | |
198 | 199 | </Button> |
199 | 200 | )} |
200 | 201 | </div> |
201 | 202 | )} |
202 | 203 | {isTarget && ( |
203 | 204 | <> |
204 | - <Form.Item label="目标名称" name="targetName"> | |
205 | + <Form.Item label="考核目标名称" name="targetName"> | |
205 | 206 | <Select disabled defaultValue={indicatorName} /> |
206 | 207 | </Form.Item> |
207 | 208 | <Form.Item |
208 | - label="目标计算类型" | |
209 | + label="考核目标计算类型" | |
209 | 210 | name="targetCalcType" |
210 | - rules={[{ required: true, message: "请选择目标计算类型" }]} | |
211 | + rules={[{ required: true, message: "请选择考核目标计算类型" }]} | |
211 | 212 | > |
212 | 213 | <Radio.Group> |
213 | - <Radio value={1}>目标值计算 </Radio> | |
214 | + <Radio value={1}>考核目标值计算 </Radio> | |
214 | 215 | <Radio value={2}>最低要求计算</Radio> |
215 | 216 | </Radio.Group> |
216 | 217 | </Form.Item> |
217 | 218 | <Form.Item |
218 | - label="目标值" | |
219 | + label="考核目标值" | |
219 | 220 | name="targetValue" |
220 | 221 | rules={[ |
221 | - { required: true, message: "请输入目标值" }, | |
222 | + { required: true, message: "请输入考核目标值" }, | |
222 | 223 | { |
223 | 224 | pattern: targetType === TargetTypeEnum["百分比"] ? percent : Momney, |
224 | 225 | message: |
... | ... | @@ -229,7 +230,7 @@ export default function AddCommissionParamsModal(props: Props) { |
229 | 230 | ]} |
230 | 231 | > |
231 | 232 | <InputNumber |
232 | - placeholder="请输入目标值" | |
233 | + placeholder="请输入考核目标值" | |
233 | 234 | style={{ width: "100%" }} |
234 | 235 | addonAfter={ |
235 | 236 | targetType === TargetTypeEnum["百分比"] | ... | ... |
src/pages/performance/CompensateGroupConfig/EditComfirm/components/AddCondModal.tsx
... | ... | @@ -23,7 +23,7 @@ interface Props { |
23 | 23 | } |
24 | 24 | type Commission = KpiGroupSetteing.CommissionParams; |
25 | 25 | export default function AddCondModal(props: Props) { |
26 | - const { selectedIndicatorsConds, setSelectedIndicatorsConds } = useStore(); | |
26 | + const { selectedIndicatorsConds, setSelectedIndicatorsConds, setPreconditionAlias } = useStore(); | |
27 | 27 | const percent = /^\d\.([1-9]{1,2}|[0-9][1-9])$|^[1-9]\d{0,1}(\.\d{1,2}){0,1}$|^100(\.0{1,2}){0,1}$/; |
28 | 28 | const Momney = /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/; |
29 | 29 | const [form] = Form.useForm(); |
... | ... | @@ -31,7 +31,7 @@ export default function AddCondModal(props: Props) { |
31 | 31 | // console.log(form); |
32 | 32 | const { addComVisible, onCancel, postId, shopIds, onOk, comItem, setItemId } = props; |
33 | 33 | const [delay, setDelay] = useState(true); |
34 | - // 保存选中绩效指标需要配置的绩效目标值类型 | |
34 | + // 保存选中绩效指标需要配置的绩效考核目标值类型 | |
35 | 35 | const [targetType, setTargetType] = useState<number>(); |
36 | 36 | // 保存选中绩效指标需要配置的数据类型 |
37 | 37 | const [dataType, setDataType] = useState<number>(); |
... | ... | @@ -157,6 +157,7 @@ export default function AddCondModal(props: Props) { |
157 | 157 | setId(Option.key); |
158 | 158 | setIndicatorName(Option.children); |
159 | 159 | setDataType(Option.dataType); |
160 | + setPreconditionAlias(Option.children); | |
160 | 161 | }} |
161 | 162 | showSearch |
162 | 163 | optionFilterProp="children" |
... | ... | @@ -180,35 +181,35 @@ export default function AddCondModal(props: Props) { |
180 | 181 | targetType === TargetTypeEnum["数量"]) && ( |
181 | 182 | <div style={{ marginLeft: 65 }}> |
182 | 183 | <Button type="link" onClick={() => setIsTarget(true)}> |
183 | - 目标值设置(可选项) | |
184 | + 考核目标值设置(可选项) | |
184 | 185 | </Button> |
185 | 186 | {isTarget && ( |
186 | 187 | <Button type="link" onClick={() => setIsTarget(false)}> |
187 | - 删除该项目标设置 | |
188 | + 删除该项考核目标设置 | |
188 | 189 | </Button> |
189 | 190 | )} |
190 | 191 | </div> |
191 | 192 | )} |
192 | 193 | {isTarget && ( |
193 | 194 | <> |
194 | - <Form.Item label="目标名称" name="targetName"> | |
195 | + <Form.Item label="考核目标名称" name="targetName"> | |
195 | 196 | <Select disabled defaultValue={indicatorName} /> |
196 | 197 | </Form.Item> |
197 | 198 | <Form.Item |
198 | - label="目标计算类型" | |
199 | + label="考核目标计算类型" | |
199 | 200 | name="targetCalcType" |
200 | - rules={[{ required: true, message: "请选择目标计算类型" }]} | |
201 | + rules={[{ required: true, message: "请选择考核目标计算类型" }]} | |
201 | 202 | > |
202 | 203 | <Radio.Group> |
203 | - <Radio value={1}>目标值计算 </Radio> | |
204 | + <Radio value={1}>考核目标值计算 </Radio> | |
204 | 205 | <Radio value={2}>最低要求计算</Radio> |
205 | 206 | </Radio.Group> |
206 | 207 | </Form.Item> |
207 | 208 | <Form.Item |
208 | - label="目标值" | |
209 | + label="考核目标值" | |
209 | 210 | name="targetValue" |
210 | 211 | rules={[ |
211 | - { required: true, message: "请输入目标值" }, | |
212 | + { required: true, message: "请输入考核目标值" }, | |
212 | 213 | { |
213 | 214 | pattern: targetType === TargetTypeEnum["百分比"] ? percent : Momney, |
214 | 215 | message: |
... | ... | @@ -219,7 +220,7 @@ export default function AddCondModal(props: Props) { |
219 | 220 | ]} |
220 | 221 | > |
221 | 222 | <InputNumber |
222 | - placeholder="请输入目标值" | |
223 | + placeholder="请输入考核目标值" | |
223 | 224 | style={{ width: "100%" }} |
224 | 225 | addonAfter={ |
225 | 226 | targetType === TargetTypeEnum["百分比"] | ... | ... |
src/pages/performance/CompensateGroupConfig/EditComfirm/components/AddLadderParamsModal.tsx
... | ... | @@ -24,14 +24,14 @@ export default function AddLadderParamsModal(props: Props) { |
24 | 24 | const percent = /^\d\.([1-9]{1,2}|[0-9][1-9])$|^[1-9]\d{0,1}(\.\d{1,2}){0,1}$|^100(\.0{1,2}){0,1}$/; |
25 | 25 | const Momney = /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/; |
26 | 26 | const [form] = Form.useForm(); |
27 | - const { selectedIndicatorsLadder, setSelectedIndicatorsLadder } = useStore(); | |
27 | + const { selectedIndicatorsLadder, setSelectedIndicatorsLadder, setLadderParamAlias } = useStore(); | |
28 | 28 | |
29 | 29 | const [isTarget, setIsTarget] = useState(false); |
30 | 30 | const [dataType, setDataType] = useState<number>(2); |
31 | 31 | // console.log(form); |
32 | 32 | const { addComVisible, onCancel, postId, shopIds, onOk, comItem, setItemId } = props; |
33 | 33 | const [delay, setDelay] = useState(true); |
34 | - // 保存选中绩效指标需要配置的绩效目标值类型 | |
34 | + // 保存选中绩效指标需要配置的绩效考核目标值类型 | |
35 | 35 | const [targetType, setTargetType] = useState<number>(); |
36 | 36 | // 保存过滤后指标列表 |
37 | 37 | const [newIndicators, setNewIndicators] = useState<KpiGroupSetteing.IndicatorByPost[]>([]); |
... | ... | @@ -151,6 +151,7 @@ export default function AddLadderParamsModal(props: Props) { |
151 | 151 | setId(Option.key); |
152 | 152 | setIndicatorName(Option.children); |
153 | 153 | setDataType(Option.dataType); |
154 | + setLadderParamAlias(Option.children); | |
154 | 155 | }} |
155 | 156 | showSearch |
156 | 157 | optionFilterProp="children" |
... | ... | @@ -186,35 +187,35 @@ export default function AddLadderParamsModal(props: Props) { |
186 | 187 | targetType === TargetTypeEnum["数量"]) && ( |
187 | 188 | <div style={{ marginLeft: 65 }}> |
188 | 189 | <Button type="link" onClick={() => setIsTarget(true)}> |
189 | - 目标值设置(可选项) | |
190 | + 考核目标值设置(可选项) | |
190 | 191 | </Button> |
191 | 192 | {isTarget && ( |
192 | 193 | <Button type="link" onClick={() => setIsTarget(false)}> |
193 | - 删除该项目标设置 | |
194 | + 删除该项考核目标设置 | |
194 | 195 | </Button> |
195 | 196 | )} |
196 | 197 | </div> |
197 | 198 | )} |
198 | 199 | {isTarget && ( |
199 | 200 | <> |
200 | - <Form.Item label="目标名称" name="targetName"> | |
201 | + <Form.Item label="考核目标名称" name="targetName"> | |
201 | 202 | <Select disabled defaultValue={indicatorName} /> |
202 | 203 | </Form.Item> |
203 | 204 | <Form.Item |
204 | - label="目标计算类型" | |
205 | + label="考核目标计算类型" | |
205 | 206 | name="targetCalcType" |
206 | - rules={[{ required: true, message: "请选择目标计算类型" }]} | |
207 | + rules={[{ required: true, message: "请选择考核目标计算类型" }]} | |
207 | 208 | > |
208 | 209 | <Radio.Group> |
209 | - <Radio value={1}>目标值计算 </Radio> | |
210 | + <Radio value={1}>考核目标值计算 </Radio> | |
210 | 211 | <Radio value={2}>最低要求计算</Radio> |
211 | 212 | </Radio.Group> |
212 | 213 | </Form.Item> |
213 | 214 | <Form.Item |
214 | - label="目标值" | |
215 | + label="考核目标值" | |
215 | 216 | name="targetValue" |
216 | 217 | rules={[ |
217 | - { required: true, message: "请输入目标值" }, | |
218 | + { required: true, message: "请输入考核目标值" }, | |
218 | 219 | { |
219 | 220 | pattern: targetType === TargetTypeEnum["百分比"] ? percent : Momney, |
220 | 221 | message: |
... | ... | @@ -225,7 +226,7 @@ export default function AddLadderParamsModal(props: Props) { |
225 | 226 | ]} |
226 | 227 | > |
227 | 228 | <InputNumber |
228 | - placeholder="请输入目标值" | |
229 | + placeholder="请输入考核目标值" | |
229 | 230 | style={{ width: "100%" }} |
230 | 231 | addonAfter={ |
231 | 232 | targetType === TargetTypeEnum["百分比"] | ... | ... |
src/pages/performance/CompensateGroupConfig/EditComfirm/components/CommissionParams.tsx
... | ... | @@ -88,7 +88,7 @@ const CommissionParams = ({ postId, shopIds, value, onChange, setItemId, isHundr |
88 | 88 | }, |
89 | 89 | }, |
90 | 90 | { |
91 | - title: "目标设置", | |
91 | + title: "考核目标设置", | |
92 | 92 | dataIndex: "targetValue", |
93 | 93 | key: "targetValue", |
94 | 94 | render: (value: number, record: Commission) => { |
... | ... | @@ -106,7 +106,7 @@ const CommissionParams = ({ postId, shopIds, value, onChange, setItemId, isHundr |
106 | 106 | }, |
107 | 107 | }, |
108 | 108 | { |
109 | - title: "目标值类型", | |
109 | + title: "考核目标值类型", | |
110 | 110 | dataIndex: "targetType", |
111 | 111 | key: "targetType", |
112 | 112 | render: (value: number, record: any) => { | ... | ... |
src/pages/performance/CompensateGroupConfig/EditComfirm/components/Conds.tsx
... | ... | @@ -32,7 +32,7 @@ type Commission = KpiGroupSetteing.CommissionParams; |
32 | 32 | const Conds = ({ postId, shopIds, value, onChange, setItemId, isHundred }: Props) => { |
33 | 33 | const [addComVisible, setAddComVisible] = useState(false); |
34 | 34 | const [one, setOne] = useState(0); |
35 | - const { readOnly, selectedIndicatorsConds, setSelectedIndicatorsConds } = useStore(); | |
35 | + const { readOnly, selectedIndicatorsConds, preconditionAlias, setPreconditionAlias } = useStore(); | |
36 | 36 | const [tableData, setTableData] = useState<Commission[]>(value || []); |
37 | 37 | // 查看得分阶梯 |
38 | 38 | const [ladderVisible, setladderVisible] = useState(false); |
... | ... | @@ -81,7 +81,7 @@ const Conds = ({ postId, shopIds, value, onChange, setItemId, isHundred }: Props |
81 | 81 | key: "indicatorName", |
82 | 82 | }, |
83 | 83 | { |
84 | - title: "目标设置", | |
84 | + title: "考核目标设置", | |
85 | 85 | dataIndex: "targetValue", |
86 | 86 | key: "targetValue", |
87 | 87 | render: (value: number, record: Commission) => { |
... | ... | @@ -99,7 +99,7 @@ const Conds = ({ postId, shopIds, value, onChange, setItemId, isHundred }: Props |
99 | 99 | }, |
100 | 100 | }, |
101 | 101 | { |
102 | - title: "目标值类型", | |
102 | + title: "考核目标值类型", | |
103 | 103 | dataIndex: "targetType", |
104 | 104 | key: "targetType", |
105 | 105 | render: (value: number, record: any) => { |
... | ... | @@ -139,6 +139,15 @@ const Conds = ({ postId, shopIds, value, onChange, setItemId, isHundred }: Props |
139 | 139 | </Button> |
140 | 140 | </div> |
141 | 141 | } |
142 | + title={ | |
143 | + <div style={{ display: "flex", justifyContent: "flex-start", width: 500 }}> | |
144 | + 前置条件名称: | |
145 | + <Input | |
146 | + value={(preconditionAlias)} | |
147 | + onChange={(e) => setPreconditionAlias(e.target.value)} | |
148 | + /> | |
149 | + </div> | |
150 | + } | |
142 | 151 | > |
143 | 152 | <Table |
144 | 153 | bordered | ... | ... |
src/pages/performance/CompensateGroupConfig/EditComfirm/components/IndivatorsTable.tsx
... | ... | @@ -101,11 +101,9 @@ const IndivatorsTable = ({ value, onChange, postId, shopIds }: Props) => { |
101 | 101 | const _onDelete = (record: Item, index: number) => { |
102 | 102 | const tempData = [...(value || [])]; |
103 | 103 | tempData.splice(index, 1); // splice直接修改原数组,不会返回新数组 |
104 | - //已选指标项同步删除 | |
105 | - selectedSalaryIds.splice(index, 1); | |
106 | 104 | onChange && onChange([...tempData]); |
107 | 105 | }; |
108 | - // 查看目标设置 | |
106 | + // 查看考核考核目标设置 | |
109 | 107 | const lookTar = (record: any) => { |
110 | 108 | setTarVisible(true); |
111 | 109 | setTarCommissionParams(record); |
... | ... | @@ -126,7 +124,7 @@ const IndivatorsTable = ({ value, onChange, postId, shopIds }: Props) => { |
126 | 124 | render: (text: number) => (text ? OptionalMethod_Enum[text] : "--"), |
127 | 125 | }, |
128 | 126 | { |
129 | - title: "目标设置", | |
127 | + title: "考核目标设置", | |
130 | 128 | render: (value: any, record: Item) => { |
131 | 129 | if (record.commissionParams && record.commissionParams.length > 0) { |
132 | 130 | const newValue = record.commissionParams.filter((item: any) => item.targetValue); | ... | ... |
src/pages/performance/CompensateGroupConfig/EditComfirm/components/LadderParams.tsx
... | ... | @@ -31,7 +31,7 @@ interface Props { |
31 | 31 | type Commission = KpiGroupSetteing.CommissionParams; |
32 | 32 | const LadderParams = ({ postId, shopIds, value, onChange, setItemId, isHundredLadder }: Props) => { |
33 | 33 | const [addComVisible, setAddComVisible] = useState(false); |
34 | - const { selectedIndicatorsLadder, readOnly } = useStore(); | |
34 | + const { selectedIndicatorsLadder, readOnly, ladderParamAlias, setLadderParamAlias } = useStore(); | |
35 | 35 | const [tableData, setTableData] = useState<Commission[]>(value || []); |
36 | 36 | // 参数 |
37 | 37 | const [comItem, setComItem] = useState<Commission>({}); |
... | ... | @@ -84,7 +84,7 @@ const LadderParams = ({ postId, shopIds, value, onChange, setItemId, isHundredLa |
84 | 84 | }, |
85 | 85 | }, |
86 | 86 | { |
87 | - title: "目标设置", | |
87 | + title: "考核目标设置", | |
88 | 88 | dataIndex: "targetValue", |
89 | 89 | key: "targetValue", |
90 | 90 | render: (value: number, record: Commission) => { |
... | ... | @@ -102,7 +102,7 @@ const LadderParams = ({ postId, shopIds, value, onChange, setItemId, isHundredLa |
102 | 102 | }, |
103 | 103 | }, |
104 | 104 | { |
105 | - title: "目标值类型", | |
105 | + title: "考核目标值类型", | |
106 | 106 | dataIndex: "targetType", |
107 | 107 | key: "targetType", |
108 | 108 | render: (value: number, record: any) => { |
... | ... | @@ -142,6 +142,15 @@ const LadderParams = ({ postId, shopIds, value, onChange, setItemId, isHundredLa |
142 | 142 | </Button> |
143 | 143 | </div> |
144 | 144 | } |
145 | + title={ | |
146 | + <div style={{ display: "flex", justifyContent: "flex-start", width: 500 }}> | |
147 | + 阶梯指标名称: | |
148 | + <Input | |
149 | + value={(ladderParamAlias)} | |
150 | + onChange={(e) => setLadderParamAlias(e.target.value)} | |
151 | + /> | |
152 | + </div> | |
153 | + } | |
145 | 154 | > |
146 | 155 | <Table |
147 | 156 | bordered | ... | ... |
src/pages/performance/CompensateGroupConfig/EditComfirm/index.tsx
... | ... | @@ -92,10 +92,14 @@ function Index(props: Props) { |
92 | 92 | const res = transformDTO(values); |
93 | 93 | const _shopNames = values.shop.map((item: any) => item.label); |
94 | 94 | let pa = null; |
95 | - if (type == 1) { | |
96 | - pa = { ...res, force: true, id: Number(configId), shopNames: _shopNames }; | |
97 | - } else if (type == 2) { | |
98 | - pa = { ...res, force: true, draftId: Number(configId), shopNames: _shopNames }; | |
95 | + if (type == 1 || type == 2) { | |
96 | + if (data?.id && !data?.draftId) { | |
97 | + pa = { ...res, force: true, id: data?.id, shopNames: _shopNames }; | |
98 | + } else if (data?.draftId && !data?.id) { | |
99 | + pa = { ...res, force: true, draftId: data?.draftId, shopNames: _shopNames }; | |
100 | + } else if (data?.id && data?.draftId) { | |
101 | + pa = { ...res, force: true, id: data?.id, draftId: data?.draftId, shopNames: _shopNames }; | |
102 | + } | |
99 | 103 | } else { |
100 | 104 | pa = { ...res, force: true, shopNames: _shopNames }; |
101 | 105 | } | ... | ... |
src/pages/performance/CompensateGroupConfig/interface.d.ts
src/pages/performance/KpiGroupSetting/EditComfirm/components/AddCommissionParamsModal.tsx
... | ... | @@ -40,7 +40,7 @@ export default function AddCommissionParamsModal(props: Props) { |
40 | 40 | // console.log(form); |
41 | 41 | const { addComVisible, onCancel, postId, shopIds, onOk, comItem, setItemId } = props; |
42 | 42 | const [delay, setDelay] = useState(true); |
43 | - // 保存选中绩效指标需要配置的绩效目标值类型 | |
43 | + // 保存选中绩效指标需要配置的绩效考核目标值类型 | |
44 | 44 | const [targetType, setTargetType] = useState<number>(); |
45 | 45 | // 保存过滤后指标列表 |
46 | 46 | const [newIndicators, setNewIndicators] = useState<KpiGroupSetteing.IndicatorByPost[]>([]); |
... | ... | @@ -189,35 +189,35 @@ export default function AddCommissionParamsModal(props: Props) { |
189 | 189 | targetType === TargetTypeEnum["数量"]) && ( |
190 | 190 | <div style={{ marginLeft: 65 }}> |
191 | 191 | <Button type="link" onClick={() => setIsTarget(true)}> |
192 | - 目标值设置(可选项) | |
192 | + 考核目标值设置(可选项) | |
193 | 193 | </Button> |
194 | 194 | {isTarget && ( |
195 | 195 | <Button type="link" onClick={() => setIsTarget(false)}> |
196 | - 删除该项目标设置 | |
196 | + 删除该项考核目标设置 | |
197 | 197 | </Button> |
198 | 198 | )} |
199 | 199 | </div> |
200 | 200 | )} |
201 | 201 | {isTarget && ( |
202 | 202 | <> |
203 | - <Form.Item label="目标名称" name="targetName"> | |
203 | + <Form.Item label="考核目标名称" name="targetName"> | |
204 | 204 | <Select disabled defaultValue={indicatorName} /> |
205 | 205 | </Form.Item> |
206 | 206 | <Form.Item |
207 | - label="目标计算类型" | |
207 | + label="考核目标计算类型" | |
208 | 208 | name="targetCalcType" |
209 | - rules={[{ required: true, message: "请选择目标计算类型" }]} | |
209 | + rules={[{ required: true, message: "请选择考核目标计算类型" }]} | |
210 | 210 | > |
211 | 211 | <Radio.Group> |
212 | - <Radio value={1}>目标值计算 </Radio> | |
212 | + <Radio value={1}>考核目标值计算 </Radio> | |
213 | 213 | <Radio value={2}>最低要求计算</Radio> |
214 | 214 | </Radio.Group> |
215 | 215 | </Form.Item> |
216 | 216 | <Form.Item |
217 | - label="目标值" | |
217 | + label="考核目标值" | |
218 | 218 | name="targetValue" |
219 | 219 | rules={[ |
220 | - { required: true, message: "请输入目标值" }, | |
220 | + { required: true, message: "请输入考核目标值" }, | |
221 | 221 | { |
222 | 222 | pattern: targetType === TargetTypeEnum["百分比"] ? percent : Momney, |
223 | 223 | message: |
... | ... | @@ -228,7 +228,7 @@ export default function AddCommissionParamsModal(props: Props) { |
228 | 228 | ]} |
229 | 229 | > |
230 | 230 | <InputNumber |
231 | - placeholder="请输入目标值" | |
231 | + placeholder="请输入考核目标值" | |
232 | 232 | style={{ width: "100%" }} |
233 | 233 | addonAfter={ |
234 | 234 | targetType === TargetTypeEnum["百分比"] | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/AddCondModal.tsx
... | ... | @@ -33,7 +33,7 @@ export default function AddCondModal(props: Props) { |
33 | 33 | // console.log(form); |
34 | 34 | const { addComVisible, onCancel, postId, shopIds, onOk, comItem, setItemId } = props; |
35 | 35 | const [delay, setDelay] = useState(true); |
36 | - // 保存选中绩效指标需要配置的绩效目标值类型 | |
36 | + // 保存选中绩效指标需要配置的绩效考核目标值类型 | |
37 | 37 | const [targetType, setTargetType] = useState<number>(); |
38 | 38 | // 保存过滤后指标列表 |
39 | 39 | const [newIndicators, setNewIndicators] = useState<KpiGroupSetteing.IndicatorByPost[]>([]); |
... | ... | @@ -172,35 +172,35 @@ export default function AddCondModal(props: Props) { |
172 | 172 | targetType === TargetTypeEnum["数量"]) && ( |
173 | 173 | <div style={{ marginLeft: 65 }}> |
174 | 174 | <Button type="link" onClick={() => setIsTarget(true)}> |
175 | - 目标值设置(可选项) | |
175 | + 考核目标值设置(可选项) | |
176 | 176 | </Button> |
177 | 177 | {isTarget && ( |
178 | 178 | <Button type="link" onClick={() => setIsTarget(false)}> |
179 | - 删除该项目标设置 | |
179 | + 删除该项考核目标设置 | |
180 | 180 | </Button> |
181 | 181 | )} |
182 | 182 | </div> |
183 | 183 | )} |
184 | 184 | {isTarget && ( |
185 | 185 | <> |
186 | - <Form.Item label="目标名称" name="targetName"> | |
186 | + <Form.Item label="考核目标名称" name="targetName"> | |
187 | 187 | <Select disabled defaultValue={indicatorName} /> |
188 | 188 | </Form.Item> |
189 | 189 | <Form.Item |
190 | - label="目标计算类型" | |
190 | + label="考核目标计算类型" | |
191 | 191 | name="targetCalcType" |
192 | - rules={[{ required: true, message: "请选择目标计算类型" }]} | |
192 | + rules={[{ required: true, message: "请选择考核目标计算类型" }]} | |
193 | 193 | > |
194 | 194 | <Radio.Group> |
195 | - <Radio value={1}>目标值计算 </Radio> | |
195 | + <Radio value={1}>考核目标值计算 </Radio> | |
196 | 196 | <Radio value={2}>最低要求计算</Radio> |
197 | 197 | </Radio.Group> |
198 | 198 | </Form.Item> |
199 | 199 | <Form.Item |
200 | - label="目标值" | |
200 | + label="考核目标值" | |
201 | 201 | name="targetValue" |
202 | 202 | rules={[ |
203 | - { required: true, message: "请输入目标值" }, | |
203 | + { required: true, message: "请输入考核目标值" }, | |
204 | 204 | { |
205 | 205 | pattern: targetType === TargetTypeEnum["百分比"] ? percent : Momney, |
206 | 206 | message: |
... | ... | @@ -211,7 +211,7 @@ export default function AddCondModal(props: Props) { |
211 | 211 | ]} |
212 | 212 | > |
213 | 213 | <InputNumber |
214 | - placeholder="请输入目标值" | |
214 | + placeholder="请输入考核目标值" | |
215 | 215 | style={{ width: "100%" }} |
216 | 216 | addonAfter={ |
217 | 217 | targetType === TargetTypeEnum["百分比"] | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/AddIndicatorsModal.tsx
... | ... | @@ -55,13 +55,12 @@ export default function AddIndicatorsModal(props: Props) { |
55 | 55 | } |
56 | 56 | // 修改 |
57 | 57 | if (visible && currentItem.name) { |
58 | - // setItemId(currentItem.id); | |
59 | 58 | setParamAlias(currentItem.paramAlias); |
60 | 59 | form.setFieldsValue({ |
61 | 60 | ...currentItem, |
62 | 61 | }); |
63 | 62 | } |
64 | - if (currentItem.conds) { | |
63 | + if (currentItem.conds && currentItem.conds.length > 0) { | |
65 | 64 | setCondsVisible(true); |
66 | 65 | } else { |
67 | 66 | setCondsVisible(false); | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/AddLadderParamsModal.tsx
... | ... | @@ -31,7 +31,7 @@ export default function AddLadderParamsModal(props: Props) { |
31 | 31 | // console.log(form); |
32 | 32 | const { addComVisible, onCancel, postId, shopIds, onOk, comItem, setItemId } = props; |
33 | 33 | const [delay, setDelay] = useState(true); |
34 | - // 保存选中绩效指标需要配置的绩效目标值类型 | |
34 | + // 保存选中绩效指标需要配置的绩效考核目标值类型 | |
35 | 35 | const [targetType, setTargetType] = useState<number>(); |
36 | 36 | // 保存过滤后指标列表 |
37 | 37 | const [newIndicators, setNewIndicators] = useState<KpiGroupSetteing.IndicatorByPost[]>([]); |
... | ... | @@ -193,35 +193,35 @@ export default function AddLadderParamsModal(props: Props) { |
193 | 193 | targetType === TargetTypeEnum["数量"]) && ( |
194 | 194 | <div style={{ marginLeft: 65 }}> |
195 | 195 | <Button type="link" onClick={() => setIsTarget(true)}> |
196 | - 目标值设置(可选项) | |
196 | + 考核目标值设置(可选项) | |
197 | 197 | </Button> |
198 | 198 | {isTarget && ( |
199 | 199 | <Button type="link" onClick={() => setIsTarget(false)}> |
200 | - 删除该项目标设置 | |
200 | + 删除该项考核目标设置 | |
201 | 201 | </Button> |
202 | 202 | )} |
203 | 203 | </div> |
204 | 204 | )} |
205 | 205 | {isTarget && ( |
206 | 206 | <> |
207 | - <Form.Item label="目标名称" name="targetName"> | |
207 | + <Form.Item label="考核目标名称" name="targetName"> | |
208 | 208 | <Select disabled defaultValue={indicatorName} /> |
209 | 209 | </Form.Item> |
210 | 210 | <Form.Item |
211 | - label="目标计算类型" | |
211 | + label="考核目标计算类型" | |
212 | 212 | name="targetCalcType" |
213 | - rules={[{ required: true, message: "请选择目标计算类型" }]} | |
213 | + rules={[{ required: true, message: "请选择考核目标计算类型" }]} | |
214 | 214 | > |
215 | 215 | <Radio.Group> |
216 | - <Radio value={1}>目标值计算 </Radio> | |
216 | + <Radio value={1}>考核目标值计算 </Radio> | |
217 | 217 | <Radio value={2}>最低要求计算</Radio> |
218 | 218 | </Radio.Group> |
219 | 219 | </Form.Item> |
220 | 220 | <Form.Item |
221 | - label="目标值" | |
221 | + label="考核目标值" | |
222 | 222 | name="targetValue" |
223 | 223 | rules={[ |
224 | - { required: true, message: "请输入目标值" }, | |
224 | + { required: true, message: "请输入考核目标值" }, | |
225 | 225 | { |
226 | 226 | pattern: targetType === TargetTypeEnum["百分比"] ? percent : Momney, |
227 | 227 | message: |
... | ... | @@ -232,7 +232,7 @@ export default function AddLadderParamsModal(props: Props) { |
232 | 232 | ]} |
233 | 233 | > |
234 | 234 | <InputNumber |
235 | - placeholder="请输入目标值" | |
235 | + placeholder="请输入考核目标值" | |
236 | 236 | style={{ width: "100%" }} |
237 | 237 | addonAfter={ |
238 | 238 | targetType === TargetTypeEnum["百分比"] | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/CommissionParams.tsx
... | ... | @@ -86,7 +86,7 @@ const CommissionParams = ({ postId, shopIds, value, onChange, setItemId, isHundr |
86 | 86 | }, |
87 | 87 | }, |
88 | 88 | { |
89 | - title: "目标设置", | |
89 | + title: "考核目标设置", | |
90 | 90 | dataIndex: "targetValue", |
91 | 91 | key: "targetValue", |
92 | 92 | render: (value: number, record: Commission) => { |
... | ... | @@ -104,7 +104,7 @@ const CommissionParams = ({ postId, shopIds, value, onChange, setItemId, isHundr |
104 | 104 | }, |
105 | 105 | }, |
106 | 106 | { |
107 | - title: "目标值类型", | |
107 | + title: "考核目标值类型", | |
108 | 108 | dataIndex: "targetType", |
109 | 109 | key: "targetType", |
110 | 110 | render: (value: number, record: any) => { | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/Conds.tsx
... | ... | @@ -92,7 +92,7 @@ const Conds = ({ postId, shopIds, value, onChange, setItemId, isHundred }: Props |
92 | 92 | )), |
93 | 93 | }, |
94 | 94 | { |
95 | - title: "目标设置", | |
95 | + title: "考核目标设置", | |
96 | 96 | dataIndex: "targetValue", |
97 | 97 | key: "targetValue", |
98 | 98 | render: (value: number, record: Commission) => { |
... | ... | @@ -110,7 +110,7 @@ const Conds = ({ postId, shopIds, value, onChange, setItemId, isHundred }: Props |
110 | 110 | }, |
111 | 111 | }, |
112 | 112 | { |
113 | - title: "目标值类型", | |
113 | + title: "考核目标值类型", | |
114 | 114 | dataIndex: "targetType", |
115 | 115 | key: "targetType", |
116 | 116 | render: (value: number, record: any) => { | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/IndivatorsTable.tsx
... | ... | @@ -102,8 +102,6 @@ const IndivatorsTable = ({ value, onChange, personModal }: Props) => { |
102 | 102 | const _onDelete = (record: Item, index: number) => { |
103 | 103 | const tempData = [...(value || [])]; |
104 | 104 | tempData.splice(index, 1);// splice直接修改原数组,不会返回新数组 |
105 | - //已选指标项同步删除 | |
106 | - selectedIndicators.splice(index, 1); | |
107 | 105 | onChange && onChange([...tempData]); |
108 | 106 | }; |
109 | 107 | const columns = [ |
... | ... | @@ -128,7 +126,7 @@ const IndivatorsTable = ({ value, onChange, personModal }: Props) => { |
128 | 126 | )), |
129 | 127 | }, |
130 | 128 | { |
131 | - title: "目标设置", | |
129 | + title: "考核目标设置", | |
132 | 130 | render: (value: any, record: Item) => { |
133 | 131 | if (record.commissionParams && record.commissionParams.length > 0) { |
134 | 132 | const newValue = record.commissionParams.filter((item: any) => item.targetValue); | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/LadderParams.tsx
... | ... | @@ -84,7 +84,7 @@ const LadderParams = ({ postId, shopIds, value, onChange, setItemId, isHundred } |
84 | 84 | }, |
85 | 85 | }, |
86 | 86 | { |
87 | - title: "目标设置", | |
87 | + title: "考核目标设置", | |
88 | 88 | dataIndex: "targetValue", |
89 | 89 | key: "targetValue", |
90 | 90 | render: (value: number, record: Commission) => { |
... | ... | @@ -102,7 +102,7 @@ const LadderParams = ({ postId, shopIds, value, onChange, setItemId, isHundred } |
102 | 102 | }, |
103 | 103 | }, |
104 | 104 | { |
105 | - title: "目标值类型", | |
105 | + title: "考核目标值类型", | |
106 | 106 | dataIndex: "targetType", |
107 | 107 | key: "targetType", |
108 | 108 | render: (value: number, record: any) => { | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/index.tsx
... | ... | @@ -73,7 +73,6 @@ function Index(props: Props) { |
73 | 73 | useEffect(() => { |
74 | 74 | if (configId && data) { |
75 | 75 | const res = transformFormData(data); |
76 | - console.log(data); | |
77 | 76 | form.setFieldsValue({ |
78 | 77 | ...res, |
79 | 78 | }); |
... | ... | @@ -105,10 +104,14 @@ function Index(props: Props) { |
105 | 104 | const res = transformDTO(values); |
106 | 105 | const _shopNames = values.shop.map((item: any) => item.label); |
107 | 106 | let pa = null; |
108 | - if (type == 1) { | |
109 | - pa = { ...res, force: true, id: Number(configId), shopNames: _shopNames }; | |
110 | - } else if (type == 2) { | |
111 | - pa = { ...res, force: true, draftId: Number(configId), shopNames: _shopNames }; | |
107 | + if (type == 1 || type == 2) { | |
108 | + if (data?.id && !data?.draftId) { | |
109 | + pa = { ...res, force: true, id: data?.id, shopNames: _shopNames }; | |
110 | + } else if (data?.draftId && !data?.id) { | |
111 | + pa = { ...res, force: true, draftId: data?.draftId, shopNames: _shopNames }; | |
112 | + } else if (data?.id && data?.draftId) { | |
113 | + pa = { ...res, force: true, id: data?.id, draftId: data?.draftId, shopNames: _shopNames }; | |
114 | + } | |
112 | 115 | } else { |
113 | 116 | pa = { ...res, force: true, shopNames: _shopNames }; |
114 | 117 | } | ... | ... |
src/pages/performance/KpiGroupSetting/interface.d.ts
src/pages/pms/entity.ts
... | ... | @@ -22,7 +22,6 @@ export function ParamArrToStr(params: any) { |
22 | 22 | //利用 WeekMap() 的键对自己所引用对象的引用都是弱引用的特性,在没有其他引用和该键引用同一对象的情况下,这个对象将会被垃圾回收 |
23 | 23 | //为了解决循环引用的问题,设置一个哈希表存储已拷贝过的对象进行循环检测,当检测到当前对象已存在于哈希表中时,取出该值并返回即可 |
24 | 24 | export function deepClone(obj: any, hash = new WeakMap()) { |
25 | - //判断是否为复杂数据类型 | |
26 | 25 | function isComplexDataType(obj: any) { |
27 | 26 | return (typeof obj === 'object' || typeof obj === 'function') && (obj !== null); |
28 | 27 | } |
... | ... | @@ -50,7 +49,6 @@ export function deepClone(obj: any, hash = new WeakMap()) { |
50 | 49 | hash.set(obj, cloneObj); |
51 | 50 | //Reflect.ownKeys(obj)拷贝不可枚举属性和符号类型 |
52 | 51 | for (let key of Reflect.ownKeys(obj)) { |
53 | - // 如果值是引用类型并且非函数则递归调用deepClone | |
54 | 52 | cloneObj[key] = |
55 | 53 | (isComplexDataType(obj[key]) && typeof obj[key] !== 'function') ? deepClone(obj[key], hash) : obj[key]; |
56 | 54 | } |
... | ... | @@ -175,7 +173,6 @@ export const fuelTypeData = [ |
175 | 173 | export const partTypeData = [ |
176 | 174 | { value: 1, label: "配件" }, |
177 | 175 | { value: 2, label: "装潢" }, |
178 | - { value: 3, label: "辅料" }, | |
179 | 176 | { value: 4, label: "养护" }, |
180 | 177 | ]; |
181 | 178 | |
... | ... | @@ -190,12 +187,12 @@ export const planPoolTypeData = [ |
190 | 187 | export const typeReceiverObj: {[key: string]: string} = { |
191 | 188 | '售后工单锁定': '服务', |
192 | 189 | '装潢零售锁定': '销售', |
193 | - '调件锁定': '', | |
190 | + '调出锁定': '', | |
194 | 191 | '': '', |
195 | 192 | }; |
196 | 193 | export const typeSenderObj: {[key: string]: string} = { |
197 | - '售后工单锁定': '送修人', | |
198 | - '装潢零售锁定': '下单人', | |
199 | - '调件锁定': '', | |
194 | + '售后工单锁定': '送修人:', | |
195 | + '装潢零售锁定': '下单人:', | |
196 | + '调出锁定': '', | |
200 | 197 | '': '', |
201 | 198 | }; | ... | ... |
src/pages/pms/partPlan/AmountPlan/subpages/Second/components/AreaTable.tsx
... | ... | @@ -32,7 +32,7 @@ export default function Index(props: Props = {}) { |
32 | 32 | <Column title="本次计划金额(元)" dataIndex="thisTimeAmount" /> |
33 | 33 | <Column title="动态库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> |
34 | 34 | <Column title="库存金额" dataIndex="stockAmount" render={t => (t || 0).toFixed(2)} /> |
35 | - <Column title="滚动90天月均出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
35 | + <Column title="滚动90天出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
36 | 36 | {showAnalyse && ( |
37 | 37 | <> |
38 | 38 | <Column | ... | ... |
src/pages/pms/partPlan/AmountPlan/subpages/Second/components/PartTable.tsx
... | ... | @@ -37,7 +37,7 @@ export default function Index(props: Props = {}) { |
37 | 37 | <Column title="拆分件数量" dataIndex="splitCnt" /> |
38 | 38 | <Column title="动态库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> |
39 | 39 | <Column title="库存数量" dataIndex="stockCnt" render={t => (t || 0).toFixed(2)} /> |
40 | - <Column title="滚动90天月均出库数量" dataIndex="outCnt" render={t => (t || 0).toFixed(2)} /> | |
40 | + <Column title="滚动90天出库数量" dataIndex="outCnt" render={t => (t || 0).toFixed(2)} /> | |
41 | 41 | {showAnalyse && ( |
42 | 42 | <> |
43 | 43 | <Column | ... | ... |
src/pages/pms/partPlan/AmountPlan/subpages/Second/components/SeriesTable.tsx
... | ... | @@ -32,7 +32,7 @@ export default function Index(props: Props = {}) { |
32 | 32 | <Column title="本次计划金额(元)" dataIndex="thisTimeAmount" /> |
33 | 33 | <Column title="动态库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> |
34 | 34 | <Column title="库存金额" dataIndex="stockAmount" render={t => (t || 0).toFixed(2)} /> |
35 | - <Column title="滚动90天月均出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
35 | + <Column title="滚动90天出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
36 | 36 | {showAnalyse && ( |
37 | 37 | <> |
38 | 38 | <Column | ... | ... |
src/pages/pms/partPlan/AmountPlan/subpages/Second/components/SpecTable.tsx
... | ... | @@ -23,7 +23,7 @@ export default function Index(props: Props) { |
23 | 23 | <Column title="本次计划金额(元)" dataIndex="thisTimeAmount" /> |
24 | 24 | <Column title="动态库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> |
25 | 25 | <Column title="库存金额" dataIndex="stockAmount" render={t => (t || 0).toFixed(2)} /> |
26 | - <Column title="滚动90天月均出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
26 | + <Column title="滚动90天出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
27 | 27 | </Table> |
28 | 28 | </div> |
29 | 29 | ); | ... | ... |
src/pages/pms/partPlan/AmountPlan/subpages/Second/components/StorageTable.tsx
... | ... | @@ -32,7 +32,7 @@ export default function Index(props: Props = {}) { |
32 | 32 | <Column title="本次计划金额(元)" dataIndex="thisTimeAmount" /> |
33 | 33 | <Column title="动态库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> |
34 | 34 | <Column title="库存金额" dataIndex="stockAmount" render={t => (t || 0).toFixed(2)} /> |
35 | - <Column title="滚动90天月均出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
35 | + <Column title="滚动90天出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
36 | 36 | {showAnalyse && ( |
37 | 37 | <> |
38 | 38 | <Column | ... | ... |
src/pages/pms/partPlan/AmountPlan/subpages/Third/index.tsx
src/pages/pms/partPlan/MinRatioPlan/index.tsx
... | ... | @@ -117,7 +117,7 @@ export default function Index() { |
117 | 117 | </div> |
118 | 118 | <div style={{display: 'flex', alignItems: 'center', marginBottom: 10}}> |
119 | 119 | <span>排除已提计划配件:</span> |
120 | - <DatePicker.RangePicker | |
120 | + <DatePicker.RangePicker | |
121 | 121 | style={{marginLeft: 10}} |
122 | 122 | placeholder={["开始日期", "至今"]} |
123 | 123 | disabled={[false, true]} |
... | ... | @@ -150,8 +150,11 @@ export default function Index() { |
150 | 150 | <Column title="配件名称" dataIndex="partName" /> |
151 | 151 | <Column title="库房名称" dataIndex="storageName" /> |
152 | 152 | <Column title="门店名称" dataIndex="shopName" /> |
153 | - <Column title="在库数量" dataIndex="stockCnt" /> | |
154 | - <Column title="滚动90天月均出库" dataIndex="outCnt" /> | |
153 | + <Column title="客户订件数量(个)" dataIndex="buyCnt" /> | |
154 | + <Column title="在途未锁(个)" dataIndex="onTheWayUnlockCnt" /> | |
155 | + <Column title="在库未锁(个)" dataIndex="storageUnlockCnt" /> | |
156 | + <Column title="在库已锁(个)" dataIndex="storageLockedCnt" /> | |
157 | + <Column title="滚动90天出库(个)" dataIndex="outCnt" /> | |
155 | 158 | <Column |
156 | 159 | title="可调出数量" |
157 | 160 | dataIndex="canOutCnt" | ... | ... |
src/pages/pms/partPlan/PlanManage/subpages/Apply/components/PartModal.tsx
... | ... | @@ -202,10 +202,8 @@ export default function Index({ onCancel, visible, parts=[], onOk, setParams }: |
202 | 202 | let newData = [...selectedParts]; |
203 | 203 | // 全选 |
204 | 204 | if (selected) { |
205 | - // 过滤掉已选的 | |
206 | 205 | newData = selectedParts.concat(changeRows.filter(row => !selectedParts.some(item => item.poolId == row.poolId)),); |
207 | 206 | } else { |
208 | - // 全不选 - 去掉已选的 | |
209 | 207 | newData = selectedParts.filter(row => !changedKeys.includes(`${row.poolId}`)); |
210 | 208 | } |
211 | 209 | setSelectedParts(newData); | ... | ... |
src/pages/pms/partPlan/PlanPool/api.ts
... | ... | @@ -13,6 +13,7 @@ export interface Params { |
13 | 13 | storageId?: number; // Form |
14 | 14 | isOil?: boolean; |
15 | 15 | keywords?: string |
16 | + poolType?:number | |
16 | 17 | } |
17 | 18 | |
18 | 19 | export interface ListVO { |
... | ... | @@ -29,7 +30,27 @@ export interface ListVO { |
29 | 30 | supplierName?: string; // 供应商名称 |
30 | 31 | shopId?: number; // 门店ID |
31 | 32 | shopName?: string; // 门店名称 |
32 | - ratio?: number; // 动态库销比 | |
33 | + | |
34 | + ratio?: number; // 动态库销比 前 | |
35 | + planRatio?: number // 计划后库销比 | |
36 | + storageLockedCnt?: number // 在库已锁数量 | |
37 | + storageUnlockCnt?: number // 在库未锁数量 | |
38 | + onTheWayLockedCnt?: number // 采购在途已锁总数量 | |
39 | + onTheWayUnlockCnt?: number // 采购在途未锁总数量 | |
40 | + onTheWayLockedAmount?: number // 采购在途已锁金额 | |
41 | + onTheWayUnlockAmount?: number // 采购在途未锁金额 | |
42 | + transferCnt?: number // 调件在途数量 | |
43 | + transferAmount?: number // 调件在途金额 | |
44 | + lockCnt?: number //锁件数量 | |
45 | + outStockCnt?: number //近90天出库数量 | |
46 | + outStockAmount?: number //近90天出库金额 | |
47 | + costPrice?: number //加权成本价 | |
48 | + buyCnt?: number // 订件数量 | |
49 | + buyAmount?: number // 订件金额 | |
50 | + typeName?: string // 来源类型 | |
51 | + partTypeName?: string // 配件类型 | |
52 | + isOil?: boolean | |
53 | + | |
33 | 54 | stockAmount?: number; // 库存金额 |
34 | 55 | stockCnt?: number; // 库存数量 |
35 | 56 | outCnt?: number; // 出库数量 |
... | ... | @@ -40,7 +61,7 @@ export interface ListVO { |
40 | 61 | unit?: string; // 采购规格(配件展示) |
41 | 62 | splitUnit?: string; // 拆分件规格(配件展示) |
42 | 63 | splitCnt?: number; // 拆分件数量(配件展示) |
43 | - typeName?:string | |
64 | + partType?:number | |
44 | 65 | } |
45 | 66 | |
46 | 67 | /** | ... | ... |
src/pages/pms/partPlan/PlanPool/components/AreaTable.tsx
... | ... | @@ -8,24 +8,22 @@ import {useStore} from "@/pages/pms/partPlan/PlanPool"; |
8 | 8 | const { Column } = Table; |
9 | 9 | interface Props { |
10 | 10 | showAnalyse?: boolean |
11 | - // eslint-disable-next-line react/no-unused-prop-types | |
12 | 11 | type?: number, // 类型1区域库2库房3车系4车型5配件 |
13 | 12 | // eslint-disable-next-line react/no-unused-prop-types |
14 | 13 | detailType?: number, // 类型1区域库2库房3车系4车型5配件 |
15 | - // eslint-disable-next-line react/no-unused-prop-types | |
16 | 14 | id?: number, // 上一个列表ID |
17 | 15 | } |
18 | 16 | export default function Index(props: Props = {}) { |
19 | 17 | const { dfParams, key } = useStore(); |
20 | 18 | const {showAnalyse=true} = props; |
21 | - const { data: parts, setParams } = useInitial(getList, [], {...dfParams, ...props}); | |
19 | + const { data: parts, setParams, loading } = useInitial(getList, [], {...dfParams, ...props}); | |
22 | 20 | const [visible, setVisible] = useState(false); |
23 | 21 | // 类型1区域库2库房3车系4车型5配件 |
24 | 22 | const [detailType, setDetailType] = useState<number>(); |
25 | 23 | const [id, setId] = useState<number>(); |
26 | 24 | |
27 | 25 | useEffect(() => { |
28 | - console.log('dfParams11', dfParams, key, props) | |
26 | + console.log('dfParams11', dfParams, key, props); | |
29 | 27 | if (key == props.type) { |
30 | 28 | setParams(dfParams, true); |
31 | 29 | } |
... | ... | @@ -33,12 +31,19 @@ export default function Index(props: Props = {}) { |
33 | 31 | |
34 | 32 | return ( |
35 | 33 | <div> |
36 | - <Table rowKey={(v: ListVO) => `${v.id}`} scroll={{y: 500, x: 1000}} dataSource={parts || []} pagination={false}> | |
34 | + <Table rowKey={(v: ListVO) => `${v.id}`} scroll={{y: 500, x: 2500}} dataSource={parts || []} pagination={false} loading={loading}> | |
37 | 35 | <Column title="区域库" dataIndex="name" fixed="left" /> |
36 | + <Column title="计划前库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> | |
37 | + <Column title="计划后库销比" dataIndex="planeRatio" render={t => (t || 0).toFixed(2)} /> | |
38 | + <Column title="本次计划数量(个)" dataIndex="cnt" /> | |
38 | 39 | <Column title="本次计划金额(元)" dataIndex="thisTimeAmount" /> |
39 | - <Column title="动态库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> | |
40 | - <Column title="库存金额" dataIndex="stockAmount" render={t => (t || 0).toFixed(2)} /> | |
41 | - <Column title="滚动90天月均出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
40 | + <Column title="客户订件数量(个)" dataIndex="buyCnt" /> | |
41 | + <Column title="客户订件金额(元)" dataIndex="buyAmount" /> | |
42 | + <Column title="在途未锁(个)" dataIndex="onTheWayUnlockCnt" /> | |
43 | + | |
44 | + <Column title="在库未锁(个)" dataIndex="storageUnlockCnt" /> | |
45 | + <Column title="在库已锁(个)" dataIndex="storageLockedCnt" /> | |
46 | + <Column title="滚动90天出库(个)" dataIndex="outStockCnt" /> | |
42 | 47 | {showAnalyse && ( |
43 | 48 | <> |
44 | 49 | <Column | ... | ... |
src/pages/pms/partPlan/PlanPool/components/Filter.tsx
... | ... | @@ -7,7 +7,6 @@ import usePagination from "@/hooks/usePagination"; |
7 | 7 | import {getStoragePage} from "@/pages/pms/storage/StorageManage/api"; |
8 | 8 | import useInitail from "@/hooks/useInitail"; |
9 | 9 | import * as api from "@/pages/pms/storage/partShop/api"; |
10 | -import {getPartTypeApi} from '@/pages/pms/part/Repertory/api'; | |
11 | 10 | import PmsSelect from '@/pages/pms/comonents/PmsSelect'; |
12 | 11 | |
13 | 12 | const { Search } = Input; |
... | ... | @@ -15,15 +14,14 @@ const { Search } = Input; |
15 | 14 | export default function Filter() { |
16 | 15 | const { list: storages } = usePagination<PartStorageSpace.PageVO>(getStoragePage, {pageSize: 1000}); |
17 | 16 | const { data: shops } = useInitail<PmsStoragePartShop.Option[], {}>(api.getShopApi, [], {}); |
18 | - const { dfParams, setDfParams } = useStore(); | |
19 | - const { data: partTypeData } = useInitail(getPartTypeApi, [], {}); | |
17 | + const { dfParams, setDfParams, partTypeData } = useStore(); | |
20 | 18 | |
21 | 19 | const handleChangeKeywords = debounce((value: string) => { |
22 | 20 | setDfParams({ ...dfParams, current: 1, keywords: value }); |
23 | 21 | }, 500); |
24 | 22 | |
25 | 23 | return ( |
26 | - <div style={{display: 'flex', flexWrap: 'wrap', justifyContent: 'flex-start'}}> | |
24 | + <div style={{display: 'flex', flexWrap: 'wrap', justifyContent: 'flex-start', marginBottom: 10}}> | |
27 | 25 | <PmsSelect |
28 | 26 | style={{ width: 200, marginRight: 10}} |
29 | 27 | allowClear |
... | ... | @@ -61,7 +59,7 @@ export default function Filter() { |
61 | 59 | /> |
62 | 60 | <PmsSelect |
63 | 61 | allowClear |
64 | - style={{ width: 200, marginRight: 10, marginBottom: 10}} | |
62 | + style={{ width: 200, marginRight: 10}} | |
65 | 63 | onChange={(partType) => setDfParams({ ...dfParams, current: 1, partType })} |
66 | 64 | placeholder="请选择配件类型" |
67 | 65 | options={partTypeData.map(i => ({value: i.value, label: i.label}))} | ... | ... |
src/pages/pms/partPlan/PlanPool/components/PartTable.tsx
... | ... | @@ -16,9 +16,9 @@ interface Props { |
16 | 16 | id?: number, // 上一个列表ID |
17 | 17 | } |
18 | 18 | export default function Index(props: Props = {}) { |
19 | - const { dfParams, key } = useStore(); | |
19 | + const { dfParams, key, partTypeData } = useStore(); | |
20 | 20 | const {showAnalyse=true} = props; |
21 | - const { data: parts, setParams } = useInitial(getList, [], {...dfParams, ...props}); | |
21 | + const { data: parts, setParams, loading } = useInitial(getList, [], {...dfParams, ...props}); | |
22 | 22 | const [visible, setVisible] = useState(false); |
23 | 23 | // 类型1区域库2库房3车系4车型5配件 |
24 | 24 | const [detailType, setDetailType] = useState<number>(); |
... | ... | @@ -32,15 +32,22 @@ export default function Index(props: Props = {}) { |
32 | 32 | |
33 | 33 | return ( |
34 | 34 | <div> |
35 | - <Table rowKey={(v: ListVO) => `${v.id}`} scroll={{y: 500, x: 2000}} dataSource={parts || []} pagination={false}> | |
35 | + <Table rowKey={(v: ListVO) => `${v.id}`} scroll={{y: 500, x: 3000}} dataSource={parts || []} pagination={false} loading={loading}> | |
36 | 36 | <Column title="配件编码" dataIndex="code" fixed="left" /> |
37 | 37 | <Column title="配件名称" dataIndex="name" /> |
38 | - <Column title="采购单价" dataIndex="price" /> | |
39 | - <Column title="采购数量" dataIndex="cnt" /> | |
40 | - <Column title="采购规格" dataIndex="unit" /> | |
41 | - <Column title="动态库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> | |
42 | - <Column title="库存数量" dataIndex="stockCnt" render={t => (t || 0).toFixed(2)} /> | |
43 | - <Column title="滚动90天月均出库数量" dataIndex="outCnt" render={t => (t || 0).toFixed(2)} /> | |
38 | + <Column title="来源类型" dataIndex="typeName" /> | |
39 | + <Column title="配件类型" dataIndex="partType" render={t => partTypeData.find(i => i.value == t)?.label} /> | |
40 | + <Column title="计划前库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> | |
41 | + <Column title="计划后库销比" dataIndex="planeRatio" render={t => (t || 0).toFixed(2)} /> | |
42 | + <Column title="本次计划数量(个)" dataIndex="cnt" /> | |
43 | + <Column title="本次计划金额(元)" dataIndex="thisTimeAmount" /> | |
44 | + <Column title="客户订件数量(个)" dataIndex="buyCnt" /> | |
45 | + <Column title="客户订件金额(元)" dataIndex="buyAmount" /> | |
46 | + <Column title="在途未锁(个)" dataIndex="onTheWayUnlockCnt" /> | |
47 | + | |
48 | + <Column title="在库未锁(个)" dataIndex="storageUnlockCnt" /> | |
49 | + <Column title="在库已锁(个)" dataIndex="storageLockedCnt" /> | |
50 | + <Column title="滚动90天出库(个)" dataIndex="outStockCnt" /> | |
44 | 51 | {showAnalyse && ( |
45 | 52 | <> |
46 | 53 | <Column |
... | ... | @@ -82,8 +89,6 @@ export default function Index(props: Props = {}) { |
82 | 89 | </a> |
83 | 90 | )} |
84 | 91 | /> |
85 | - <Column title="拆分件规格" dataIndex="splitUnit" /> | |
86 | - <Column title="拆分件数量" dataIndex="splitCnt" /> | |
87 | 92 | </> |
88 | 93 | )} |
89 | 94 | </Table> | ... | ... |
src/pages/pms/partPlan/PlanPool/components/SeriesTable.tsx
... | ... | @@ -10,15 +10,14 @@ interface Props { |
10 | 10 | showAnalyse?: boolean |
11 | 11 | // eslint-disable-next-line react/no-unused-prop-types |
12 | 12 | type?: number, // 类型1区域库2库房3车系4车型5配件 |
13 | - // eslint-disable-next-line react/no-unused-prop-types | |
14 | 13 | detailType?: number, // 类型1区域库2库房3车系4车型5配件 |
15 | - // eslint-disable-next-line react/no-unused-prop-types | |
14 | + // eslint-disable-next-line react/no-unused-prop-types, react/no-unused-prop-types | |
16 | 15 | id?: number, // 上一个列表ID |
17 | 16 | } |
18 | 17 | export default function Index(props: Props = {}) { |
19 | 18 | const { dfParams, key } = useStore(); |
20 | 19 | const {showAnalyse=true} = props; |
21 | - const { data: parts, setParams } = useInitial(getList, [], {...dfParams, ...props}); | |
20 | + const { data: parts, setParams, loading } = useInitial(getList, [], {...dfParams, ...props}); | |
22 | 21 | const [visible, setVisible] = useState(false); |
23 | 22 | // 类型1区域库2库房3车系4车型5配件 |
24 | 23 | const [detailType, setDetailType] = useState<number>(); |
... | ... | @@ -32,12 +31,19 @@ export default function Index(props: Props = {}) { |
32 | 31 | |
33 | 32 | return ( |
34 | 33 | <div> |
35 | - <Table rowKey={(v: ListVO) => `${v.id}`} scroll={{y: 500, x: 1000}} dataSource={parts || []} pagination={false}> | |
34 | + <Table rowKey={(v: ListVO) => `${v.id}`} scroll={{y: 500, x: 2500}} dataSource={parts || []} pagination={false} loading={loading}> | |
36 | 35 | <Column title="车系" dataIndex="name" fixed="left" /> |
36 | + <Column title="计划前库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> | |
37 | + <Column title="计划后库销比" dataIndex="planeRatio" render={t => (t || 0).toFixed(2)} /> | |
38 | + <Column title="本次计划数量(个)" dataIndex="cnt" /> | |
37 | 39 | <Column title="本次计划金额(元)" dataIndex="thisTimeAmount" /> |
38 | - <Column title="动态库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> | |
39 | - <Column title="库存金额" dataIndex="stockAmount" render={t => (t || 0).toFixed(2)} /> | |
40 | - <Column title="滚动90天月均出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
40 | + <Column title="客户订件数量(个)" dataIndex="buyCnt" /> | |
41 | + <Column title="客户订件金额(元)" dataIndex="buyAmount" /> | |
42 | + <Column title="在途未锁(个)" dataIndex="onTheWayUnlockCnt" /> | |
43 | + | |
44 | + <Column title="在库未锁(个)" dataIndex="storageUnlockCnt" /> | |
45 | + <Column title="在库已锁(个)" dataIndex="storageLockedCnt" /> | |
46 | + <Column title="滚动90天出库(个)" dataIndex="outStockCnt" /> | |
41 | 47 | {showAnalyse && ( |
42 | 48 | <> |
43 | 49 | <Column | ... | ... |
src/pages/pms/partPlan/PlanPool/components/SpecTable.tsx
... | ... | @@ -28,7 +28,7 @@ export default function Index(props: Props) { |
28 | 28 | <Column title="本次计划金额(元)" dataIndex="thisTimeAmount" /> |
29 | 29 | <Column title="动态库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> |
30 | 30 | <Column title="库存金额" dataIndex="stockAmount" render={t => (t || 0).toFixed(2)} /> |
31 | - <Column title="滚动90天月均出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
31 | + <Column title="滚动90天出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
32 | 32 | </Table> |
33 | 33 | </div> |
34 | 34 | ); | ... | ... |
src/pages/pms/partPlan/PlanPool/components/StoragePartTable.tsx
... | ... | @@ -12,9 +12,9 @@ interface Props { |
12 | 12 | type?: number, // 类型1区域库2库房3车系4车型5配件 |
13 | 13 | } |
14 | 14 | export default function Index(props: Props = {}) { |
15 | - const { dfParams, key } = useStore(); | |
15 | + const { dfParams, key, partTypeData } = useStore(); | |
16 | 16 | const [form] = Form.useForm(); |
17 | - const { data: parts, setParams } = useInitial(getList, [], dfParams); | |
17 | + const { data: parts, setParams, loading } = useInitial(getList, [], dfParams); | |
18 | 18 | const [visible, setVisible] = useState(false); |
19 | 19 | const [item, setItem] = useState<ListVO>(); |
20 | 20 | |
... | ... | @@ -34,18 +34,24 @@ export default function Index(props: Props = {}) { |
34 | 34 | |
35 | 35 | return ( |
36 | 36 | <div> |
37 | - <Table rowKey={(v: ListVO) => `${v.poolId}`} scroll={{y: 500, x: 2000}} dataSource={parts || []} pagination={false}> | |
37 | + <Table rowKey={(v: ListVO) => `${v.poolId}`} scroll={{y: 500, x: 3000}} dataSource={parts || []} pagination={false} loading={loading}> | |
38 | 38 | <Column title="配件编码" dataIndex="code" fixed="left" /> |
39 | 39 | <Column title="配件名称" dataIndex="name" /> |
40 | 40 | <Column title="库房名称" dataIndex="storageName" /> |
41 | 41 | <Column title="门店名称" dataIndex="shopName" /> |
42 | 42 | <Column title="来源类型" dataIndex="typeName" /> |
43 | - <Column title="采购规格" dataIndex="unit" render={t => t || '--'} /> | |
44 | - <Column title="采购数量" dataIndex="cnt" /> | |
45 | - <Column title="采购单价" dataIndex="price" /> | |
46 | - <Column title="在库数量" dataIndex="stockCnt" /> | |
47 | - <Column title="滚动90天月均出库" dataIndex="outCnt" /> | |
48 | - <Column | |
43 | + <Column title="配件类型" dataIndex="partType" render={t => partTypeData.find(i => i.value == t)?.label} /> | |
44 | + <Column title="计划前库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> | |
45 | + <Column title="计划后库销比" dataIndex="planeRatio" render={t => (t || 0).toFixed(2)} /> | |
46 | + <Column title="本次计划数量(个)" dataIndex="cnt" /> | |
47 | + <Column title="本次计划金额(元)" dataIndex="thisTimeAmount" /> | |
48 | + <Column title="客户订件数量(个)" dataIndex="buyCnt" /> | |
49 | + <Column title="客户订件金额(元)" dataIndex="buyAmount" /> | |
50 | + <Column title="在途未锁(个)" dataIndex="onTheWayUnlockCnt" /> | |
51 | + <Column title="在库未锁(个)" dataIndex="storageUnlockCnt" /> | |
52 | + <Column title="在库已锁(个)" dataIndex="storageLockedCnt" /> | |
53 | + <Column title="滚动90天出库(个)" dataIndex="outStockCnt" /> | |
54 | + <Column | |
49 | 55 | title="操作" |
50 | 56 | render={r => ( |
51 | 57 | <> |
... | ... | @@ -73,9 +79,9 @@ export default function Index(props: Props = {}) { |
73 | 79 | onCancel={() => setVisible(false)} |
74 | 80 | footer={[ |
75 | 81 | <Button key="cancel" onClick={() => setVisible(false)}>取消</Button>, |
76 | - <Button | |
77 | - key="ok" | |
78 | - type="primary" | |
82 | + <Button | |
83 | + key="ok" | |
84 | + type="primary" | |
79 | 85 | style={{marginLeft: 10}} |
80 | 86 | htmlType="submit" |
81 | 87 | onClick={() => { |
... | ... | @@ -84,9 +90,9 @@ export default function Index(props: Props = {}) { |
84 | 90 | setVisible(false); |
85 | 91 | message.success("操作成功"); |
86 | 92 | setParams({}, true); |
87 | - }).catch(e => { | |
88 | - message.error(e.message); | |
89 | - setVisible(false); | |
93 | + }).catch(e => { | |
94 | + message.error(e.message); | |
95 | + setVisible(false); | |
90 | 96 | }); |
91 | 97 | }); |
92 | 98 | }} |
... | ... | @@ -99,11 +105,11 @@ export default function Index(props: Props = {}) { |
99 | 105 | labelCol={{span: 7}} |
100 | 106 | wrapperCol={{span: 10}} |
101 | 107 | > |
102 | - <Item | |
103 | - label="配件采购数量" | |
104 | - name="cnt" | |
108 | + <Item | |
109 | + label="配件采购数量" | |
110 | + name="cnt" | |
105 | 111 | rules={[ |
106 | - {required: true}, | |
112 | + {required: true}, | |
107 | 113 | () => ({ |
108 | 114 | validator(_, value) { |
109 | 115 | if (value > 0) { | ... | ... |
src/pages/pms/partPlan/PlanPool/components/StorageTable.tsx
... | ... | @@ -8,17 +8,15 @@ import {useStore} from "@/pages/pms/partPlan/PlanPool"; |
8 | 8 | const { Column } = Table; |
9 | 9 | interface Props { |
10 | 10 | showAnalyse?: boolean |
11 | - // eslint-disable-next-line react/no-unused-prop-types | |
12 | 11 | type?: number, // 类型1区域库2库房3车系4车型5配件 |
13 | - // eslint-disable-next-line react/no-unused-prop-types | |
14 | 12 | detailType?: number, // 类型1区域库2库房3车系4车型5配件 |
15 | - // eslint-disable-next-line react/no-unused-prop-types | |
13 | + // eslint-disable-next-line react/no-unused-prop-types, react/no-unused-prop-types | |
16 | 14 | id?: number, // 上一个列表ID |
17 | 15 | } |
18 | 16 | export default function Index(props: Props = {}) { |
19 | 17 | const { dfParams, key } = useStore(); |
20 | 18 | const {showAnalyse=true} = props; |
21 | - const { data: parts, setParams } = useInitial(getList, [], {...dfParams, ...props}); | |
19 | + const { data: parts, setParams, loading } = useInitial(getList, [], {...dfParams, ...props}); | |
22 | 20 | const [visible, setVisible] = useState(false); |
23 | 21 | // 类型1区域库2库房3车系4车型5配件 |
24 | 22 | const [detailType, setDetailType] = useState<number>(); |
... | ... | @@ -32,12 +30,18 @@ export default function Index(props: Props = {}) { |
32 | 30 | |
33 | 31 | return ( |
34 | 32 | <div> |
35 | - <Table rowKey={(v: ListVO) => `${v.id}`} scroll={{y: 500, x: 1000}} dataSource={parts || []} pagination={false}> | |
33 | + <Table rowKey={(v: ListVO) => `${v.id}`} scroll={{y: 500, x: 2500}} dataSource={parts || []} pagination={false} loading={loading}> | |
36 | 34 | <Column title="库房" dataIndex="name" fixed="left" /> |
35 | + <Column title="计划前库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> | |
36 | + <Column title="计划后库销比" dataIndex="planeRatio" render={t => (t || 0).toFixed(2)} /> | |
37 | + <Column title="本次计划数量(个)" dataIndex="cnt" /> | |
37 | 38 | <Column title="本次计划金额(元)" dataIndex="thisTimeAmount" /> |
38 | - <Column title="动态库销比" dataIndex="ratio" render={t => (t || 0).toFixed(2)} /> | |
39 | - <Column title="库存金额" dataIndex="stockAmount" render={t => (t || 0).toFixed(2)} /> | |
40 | - <Column title="滚动90天月均出库金额" dataIndex="outAmount" render={t => (t || 0).toFixed(2)} /> | |
39 | + <Column title="客户订件数量(个)" dataIndex="buyCnt" /> | |
40 | + <Column title="客户订件金额(元)" dataIndex="buyAmount" /> | |
41 | + <Column title="在途未锁(个)" dataIndex="onTheWayUnlockCnt" /> | |
42 | + <Column title="在库未锁(个)" dataIndex="storageUnlockCnt" /> | |
43 | + <Column title="在库已锁(个)" dataIndex="storageLockedCnt" /> | |
44 | + <Column title="滚动90天出库(个)" dataIndex="outStockCnt" /> | |
41 | 45 | {showAnalyse && ( |
42 | 46 | <> |
43 | 47 | <Column | ... | ... |
src/pages/pms/partPlan/PlanPool/useStore.ts
1 | 1 | import { useState } from 'react'; |
2 | +import useInitail from "@/hooks/useInitail"; | |
3 | +import { getPartTypeApi } from '@/pages/pms/part/Repertory/api'; | |
2 | 4 | |
3 | 5 | export default function useStore() { |
4 | 6 | const [dfParams, setDfParams] = useState<any>({}); |
5 | 7 | const [key, setKey] = useState<any>('1'); |
8 | + const { data: partTypeData } = useInitail(getPartTypeApi, [], {}); | |
9 | + | |
6 | 10 | return { |
7 | 11 | dfParams, |
8 | 12 | setDfParams, |
9 | 13 | key, |
10 | - setKey | |
14 | + setKey, | |
15 | + partTypeData | |
11 | 16 | }; |
12 | 17 | } | ... | ... |
src/pages/pms/purchase/PurchaseRecord/comonents/AddPurchaseModal.tsx
... | ... | @@ -10,6 +10,9 @@ import {purchaseApply, getrelationlist, EditItem} from '../api'; |
10 | 10 | import {getList, ListVO, Params} from '@/pages/pms/partPlan/PlanPool/api'; |
11 | 11 | import _ from 'lodash'; |
12 | 12 | import useInitial from '@/hooks/useInitail'; |
13 | +import PmsSelect from '@/pages/pms/comonents/PmsSelect'; | |
14 | +import { getPartTypeApi } from '@/pages/pms/part/Repertory/api'; | |
15 | +import {planPoolTypeData} from '@/pages/pms/entity'; | |
13 | 16 | |
14 | 17 | const Option = Select.Option; |
15 | 18 | const {Item} = Form; |
... | ... | @@ -33,7 +36,8 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD |
33 | 36 | const {data: planeData, setParams, setData: setPlaneData} = useInitial<ListVO[], Params>(getList, [], {}, delay); |
34 | 37 | const {data: casData, setParams: casSetParams, setData: casSetData} = useInitial<poolitem[], Params>(getPurchasePool, [], {}, delay); |
35 | 38 | const [planePart, setPlanePart] = useState<ListVO[]>([]); |
36 | - | |
39 | + const { data: partTypeData } = useInitial(getPartTypeApi, [], {}); | |
40 | + | |
37 | 41 | const [choosePartVisable, setChoosePartVisable] = useState(false); |
38 | 42 | const [selectedParts, setSelectedParts] = useState<any[]>([]); |
39 | 43 | const [form] = Form.useForm(); |
... | ... | @@ -259,7 +263,23 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD |
259 | 263 | allowClear |
260 | 264 | placeholder="请输入配件名称/编码" |
261 | 265 | onChange={e => setParams({keywords: e.target.value}, true)} |
262 | - style={{ width: 240 }} | |
266 | + style={{ width: 210 }} | |
267 | + /> | |
268 | + <PmsSelect | |
269 | + allowClear | |
270 | + style={{ width: 180, marginRight: 10, marginLeft: 10}} | |
271 | + onChange={v => { | |
272 | + setParams({poolType: v}, true); | |
273 | + }} | |
274 | + placeholder="请选择来源类型" | |
275 | + options={planPoolTypeData.map(i => ({value: i.value, label: i.label}))} | |
276 | + /> | |
277 | + <PmsSelect | |
278 | + allowClear | |
279 | + style={{ width: 180}} | |
280 | + onChange={v => setParams({partType: v}, true)} | |
281 | + placeholder="请选择配件类型" | |
282 | + options={partTypeData.map(i => ({value: i.value, label: i.label}))} | |
263 | 283 | /> |
264 | 284 | </div> |
265 | 285 | <Table |
... | ... | @@ -279,6 +299,7 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD |
279 | 299 | <Column title="配件名称" dataIndex="partName" /> |
280 | 300 | <Column title="配件编码" dataIndex="partCode" /> |
281 | 301 | <Column title="数据来源" dataIndex="typeName" /> |
302 | + <Column title="配件类型" dataIndex="partType" render={t => partTypeData.find(i => i.value == t)?.label} /> | |
282 | 303 | <Column title="采购单价(元)" dataIndex="price" /> |
283 | 304 | <Column title="采购数量" dataIndex="cnt" /> |
284 | 305 | <Column title="总价(元)" render={r => _.ceil((r.cnt * r.price), 2)} /> | ... | ... |
src/pages/pms/storage/partShop/components/LockDetailModal.tsx
... | ... | @@ -60,7 +60,7 @@ export default function Index({ item = {}, visible, onCancel }: Props) { |
60 | 60 | <div>{`锁定库存数: ${it.lockCnt || 0}件`}</div> |
61 | 61 | <div>{`锁库天数: ${(it.days || 0).toFixed(0)}天`}</div> |
62 | 62 | {!!obj.receiverName && <div>{`${typeReceiverObj[it.type || '']}顾问: ${obj.receiverName}`}</div>} |
63 | - {!!obj.senderName && <div>{`${typeSenderObj[it.type || '']}: ${obj.senderName}`}</div>} | |
63 | + {!!obj.senderName && !!typeSenderObj[it.type || ''] && <div>{`${typeSenderObj[it.type || '']}${obj.senderName}`}</div>} | |
64 | 64 | {!!obj.ownerName && <div>{`车主: ${obj.ownerName}`}</div>} |
65 | 65 | {!!obj.senderTime && <div>{`进站时间: ${moment(obj.senderTime).format('YYYY-MM-DD HH:mm')}`}</div>} |
66 | 66 | {!!obj.plateNo && <div>{`车牌号: ${obj.plateNo}`}</div>} | ... | ... |
src/pages/pms/transfer/StorageOverStock/index.tsx
... | ... | @@ -30,7 +30,7 @@ export default function Index() { |
30 | 30 | /> |
31 | 31 | <PmsSelect |
32 | 32 | allowClear |
33 | - style={{ width: 200, marginRight: 10, marginBottom: 10}} | |
33 | + style={{ width: 200, marginRight: 10}} | |
34 | 34 | onChange={v => setParams({partType: v }, true)} |
35 | 35 | placeholder="请选择配件类型" |
36 | 36 | options={partTypeData.map((item: any) => ({value: item.value, label: item.label}))} | ... | ... |
src/pages/pms/transfer/transferManage/api.ts
... | ... | @@ -177,6 +177,7 @@ export interface transferApplyListParams{ |
177 | 177 | startTime?:string |
178 | 178 | endTime?:string |
179 | 179 | method?:number |
180 | + amountCom?:boolean | |
180 | 181 | } |
181 | 182 | export interface transferApplyList{ |
182 | 183 | transferId?:number |
... | ... | @@ -186,6 +187,7 @@ export interface transferApplyList{ |
186 | 187 | applyUserName?:string |
187 | 188 | method?:string |
188 | 189 | status?:string |
190 | + transferNo?:string | |
189 | 191 | } |
190 | 192 | //详情 |
191 | 193 | export interface transferDetailByApi{ | ... | ... |
src/pages/pms/transfer/transferManage/comonents/List.tsx
1 | 1 | import React, { useState } from 'react'; |
2 | -import { Table, Divider, Popconfirm, message, Button, DatePicker } from 'antd'; | |
2 | +import { Table, Divider, Popconfirm, message, Button, DatePicker, Switch } from 'antd'; | |
3 | 3 | import { PlusOutlined } from '@ant-design/icons'; |
4 | -import { transferApplyList, gettransferapplylist, getEditTransfer, delTransfer, getTransferDetail, getTransferProcess, transferProcess} from '../api'; | |
4 | +import { transferApplyList, gettransferapplylist, getEditTransfer, delTransfer, getTransferDetail, getTransferProcess, transferProcess } from '../api'; | |
5 | 5 | import usePagination from '@/hooks/usePagination'; |
6 | -import {useStore} from '../index'; | |
6 | +import { useStore } from '../index'; | |
7 | 7 | import TransferDetail from './TransferDetail'; |
8 | 8 | import TransferProcessModal from './TransferProcessModal'; |
9 | 9 | import PmsSelect from '@/pages/pms/comonents/PmsSelect'; |
10 | 10 | |
11 | -enum statusType{ | |
11 | +enum statusType { | |
12 | 12 | "草稿" = 0, |
13 | 13 | "待审批" = 1, |
14 | 14 | "进行中" = 2, |
15 | 15 | "审批不通过" = 9 |
16 | 16 | } |
17 | 17 | const statusList = [ |
18 | - {value: 0, label: "草稿"}, | |
19 | - {value: 1, label: "待审批"}, | |
20 | - {value: 2, label: "进行中"}, | |
21 | - {value: 9, label: "审批不通过"}, | |
18 | + { value: 0, label: "草稿" }, | |
19 | + { value: 1, label: "待审批" }, | |
20 | + { value: 2, label: "进行中" }, | |
21 | + { value: 9, label: "审批不通过" }, | |
22 | 22 | ]; |
23 | 23 | const methodList = [ |
24 | - {value: 1, label: "指定人员"}, | |
25 | - {value: 2, label: "第三方调运"}, | |
26 | - {value: 3, label: "快递物流"}, | |
27 | - {value: 4, label: "企业滴滴"}, | |
28 | - {value: 5, label: "货拉拉"}, | |
24 | + { value: 1, label: "指定人员" }, | |
25 | + { value: 2, label: "第三方调运" }, | |
26 | + { value: 3, label: "快递物流" }, | |
27 | + { value: 4, label: "企业滴滴" }, | |
28 | + { value: 5, label: "货拉拉" }, | |
29 | 29 | ]; |
30 | 30 | |
31 | -const {Column} = Table; | |
31 | +const { Column } = Table; | |
32 | 32 | export default function Index() { |
33 | - const {list, loading, setParams, paginationConfig} = usePagination<transferApplyList>(gettransferapplylist, {}); | |
34 | - const {setTransferDetailByApi, setAddVisible, setEditTransfer, setCurrent} = useStore(); | |
33 | + const { list, loading, setParams, paginationConfig } = usePagination<transferApplyList>(gettransferapplylist, {amountCom: false}); | |
34 | + const { setTransferDetailByApi, setAddVisible, setEditTransfer, setCurrent } = useStore(); | |
35 | 35 | const [pageNum, setPageNum] = useState(1); |
36 | 36 | const [processVisible, setProcessVisible] = useState(false); |
37 | 37 | const [processItem, setProcessItem] = useState<transferProcess>(); |
... | ... | @@ -39,7 +39,7 @@ export default function Index() { |
39 | 39 | |
40 | 40 | // 编辑 |
41 | 41 | const edit = (id: number) => { |
42 | - getEditTransfer({transferId: id}).then(res => { | |
42 | + getEditTransfer({ transferId: id }).then(res => { | |
43 | 43 | setEditTransfer(res.data || {}); |
44 | 44 | setCurrent(2); |
45 | 45 | }).catch(e => { |
... | ... | @@ -49,7 +49,7 @@ export default function Index() { |
49 | 49 | |
50 | 50 | // 删除 |
51 | 51 | const deltransfer = (id: number) => { |
52 | - delTransfer({transferId: id}).then(res => { | |
52 | + delTransfer({ transferId: id }).then(res => { | |
53 | 53 | message.success("操作成功"); |
54 | 54 | setParams({}, true); |
55 | 55 | }).catch(e => { |
... | ... | @@ -58,8 +58,8 @@ export default function Index() { |
58 | 58 | }; |
59 | 59 | |
60 | 60 | //查看 |
61 | - const transferDetail=(id: number) => { | |
62 | - getTransferDetail({type: 1, id}).then(res => { | |
61 | + const transferDetail = (id: number) => { | |
62 | + getTransferDetail({ type: 1, id }).then(res => { | |
63 | 63 | if (res.success) { |
64 | 64 | setTransferDetailByApi(res.data || {}); |
65 | 65 | setPageNum(2); |
... | ... | @@ -69,11 +69,11 @@ export default function Index() { |
69 | 69 | }).catch(e => { |
70 | 70 | message.error(e.message); |
71 | 71 | }); |
72 | - }; | |
72 | + }; | |
73 | 73 | |
74 | 74 | // 查看流程进度 |
75 | - const getProcess = (id:number) => { | |
76 | - getTransferProcess({type: 1, transferId: id}).then(res => { | |
75 | + const getProcess = (id: number) => { | |
76 | + getTransferProcess({ type: 1, transferId: id }).then(res => { | |
77 | 77 | if (res.success) { |
78 | 78 | setProcessItem(res.data || {}); |
79 | 79 | setItemId(id); |
... | ... | @@ -89,121 +89,128 @@ export default function Index() { |
89 | 89 | return ( |
90 | 90 | <> |
91 | 91 | {pageNum == 1 && ( |
92 | - <> | |
93 | - <div style={{display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 20}}> | |
94 | - <div style={{display: 'flex'}}> | |
95 | - <PmsSelect | |
96 | - placeholder="申请状态筛选" | |
97 | - allowClear | |
98 | - style={{width: 200, marginRight: 20}} | |
99 | - onChange={v => setParams({status: v}, true)} | |
100 | - options={statusList} | |
101 | - /> | |
102 | - <PmsSelect | |
103 | - placeholder="调运方式筛选" | |
104 | - allowClear | |
105 | - style={{width: 200, marginRight: 20}} | |
106 | - onChange={v => setParams({method: v}, true)} | |
107 | - options={methodList} | |
108 | - /> | |
109 | - <DatePicker | |
110 | - allowClear | |
111 | - showTime | |
112 | - placeholder="开始时间" | |
113 | - onChange={(t, ds) => setParams({startTime: ds}, true)} | |
114 | - style={{marginRight: 20}} | |
115 | - /> | |
116 | - <DatePicker | |
117 | - allowClear | |
118 | - showTime | |
119 | - placeholder="结束时间" | |
120 | - onChange={(t, ds) => setParams({endTime: ds}, true)} | |
121 | - /> | |
92 | + <> | |
93 | + <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 20 }}> | |
94 | + <div style={{ display: 'flex', alignItems: 'center' }}> | |
95 | + <PmsSelect | |
96 | + placeholder="申请状态筛选" | |
97 | + allowClear | |
98 | + style={{ width: 200, marginRight: 20 }} | |
99 | + onChange={v => setParams({ status: v }, true)} | |
100 | + options={statusList} | |
101 | + /> | |
102 | + <PmsSelect | |
103 | + placeholder="调运方式筛选" | |
104 | + allowClear | |
105 | + style={{ width: 200, marginRight: 20 }} | |
106 | + onChange={v => setParams({ method: v }, true)} | |
107 | + options={methodList} | |
108 | + /> | |
109 | + <DatePicker | |
110 | + allowClear | |
111 | + showTime | |
112 | + placeholder="开始时间" | |
113 | + onChange={(t, ds) => setParams({ startTime: ds }, true)} | |
114 | + style={{ marginRight: 20 }} | |
115 | + /> | |
116 | + <DatePicker | |
117 | + allowClear | |
118 | + showTime | |
119 | + placeholder="结束时间" | |
120 | + onChange={(t, ds) => setParams({ endTime: ds }, true)} | |
121 | + /> | |
122 | + <Switch | |
123 | + checkedChildren="金额确认未完成" | |
124 | + unCheckedChildren="金额确认未完成" | |
125 | + onChange={checked => setParams({ amountCom: checked }, true)} | |
126 | + style={{ marginLeft: 20 }} | |
127 | + /> | |
128 | + </div> | |
129 | + <Button type="primary" icon={<PlusOutlined />} onClick={() => setAddVisible(true)}>新增调拨申请</Button> | |
122 | 130 | </div> |
123 | - <Button type="primary" icon={<PlusOutlined />} onClick={() => setAddVisible(true)}>新增调拨申请</Button> | |
124 | - </div> | |
125 | - <Table | |
126 | - dataSource={list} | |
127 | - loading={loading} | |
128 | - pagination={paginationConfig} | |
129 | - rowKey={r => `${r.transferId}`} | |
130 | - > | |
131 | - <Column title="调拨品种数" dataIndex="transferKind" /> | |
132 | - <Column title="调拨配件金额(元)" dataIndex="transferAmount" /> | |
133 | - <Column title="调拨申请时间" dataIndex="applyTime" /> | |
134 | - <Column title="申请人员" dataIndex="applyUserName" /> | |
135 | - <Column title="调运方式" dataIndex="method" /> | |
136 | - <Column title="状态" dataIndex="status" /> | |
137 | - <Column | |
138 | - title="操作" | |
139 | - render={r => { | |
140 | - if (statusType[r.status] == "0") { | |
141 | - return ( | |
142 | - <div style={{display: 'flex', alignItems: 'center'}}> | |
143 | - <a onClick={() => edit(r.transferId)}>继续编辑</a> | |
144 | - <Divider type="vertical" /> | |
145 | - <Popconfirm | |
146 | - title="确认删除?" | |
147 | - onConfirm={() => deltransfer(r.transferId)} | |
148 | - okText="确认" | |
149 | - cancelText="取消" | |
150 | - > | |
151 | - <a>删除</a> | |
152 | - </Popconfirm> | |
153 | - </div> | |
154 | - ); | |
155 | - } else if (statusType[r.status] == "1") { | |
156 | - return ( | |
157 | - <div style={{display: 'flex', alignItems: 'center'}}> | |
158 | - <a onClick={() => getProcess(r.transferId)}>流程进度</a> | |
159 | - <Divider type="vertical" /> | |
160 | - <Popconfirm | |
161 | - title="确认撤销?" | |
162 | - onConfirm={() => deltransfer(r.transferId)} | |
163 | - okText="确认" | |
164 | - cancelText="取消" | |
165 | - > | |
166 | - <a>撤销</a> | |
167 | - </Popconfirm> | |
168 | - <Divider type="vertical" /> | |
169 | - <a onClick={() => transferDetail(r.transferId)}>查看</a> | |
170 | - </div> | |
171 | - ); | |
172 | - } else if (statusType[r.status] == "2") { | |
173 | - return ( | |
174 | - <div style={{display: 'flex', alignItems: 'center'}}> | |
175 | - <a onClick={() => getProcess(r.transferId)}>流程进度</a> | |
176 | - <Divider type="vertical" /> | |
177 | - <a onClick={() => transferDetail(r.transferId)}>查看</a> | |
178 | - </div> | |
179 | - ); | |
180 | - } else if (r.status == "已入库" && (r.method == '货拉拉' || r.method == '企业滴滴')) { | |
181 | - return ( | |
182 | - <div style={{display: 'flex', alignItems: 'center'}}> | |
183 | - <a onClick={() => getProcess(r.transferId)}>流程进度</a> | |
184 | - <Divider type="vertical" /> | |
185 | - <a onClick={() => transferDetail(r.transferId)}>查看</a> | |
186 | - </div> | |
187 | - ); | |
188 | - } else if (statusType[r.status] == "9") { | |
189 | - return ( | |
190 | - <div style={{display: 'flex', alignItems: 'center'}}> | |
191 | - <a onClick={() => getProcess(r.transferId)}>流程进度</a> | |
192 | - <Divider type="vertical" /> | |
193 | - <a onClick={() => edit(r.transferId)}>重新编辑</a> | |
194 | - <Divider type="vertical" /> | |
195 | - <a onClick={() => transferDetail(r.transferId)}>查看</a> | |
196 | - </div> | |
197 | - ); | |
198 | - } else { | |
199 | - return <></>; | |
200 | - } | |
201 | - }} | |
202 | - /> | |
203 | - </Table> | |
204 | - <TransferProcessModal processItem={processItem} visible={processVisible} onCancel={() => setProcessVisible(false)} itemId={itemId} /> | |
205 | - </> | |
206 | - )} | |
131 | + <Table | |
132 | + dataSource={list} | |
133 | + loading={loading} | |
134 | + pagination={paginationConfig} | |
135 | + rowKey={r => `${r.transferId}`} | |
136 | + > | |
137 | + <Column title="调拨单号" dataIndex="transferNo" /> | |
138 | + <Column title="调拨品种数" dataIndex="transferKind" /> | |
139 | + <Column title="调拨配件金额(元)" dataIndex="transferAmount" /> | |
140 | + <Column title="调拨申请时间" dataIndex="applyTime" /> | |
141 | + <Column title="申请人员" dataIndex="applyUserName" /> | |
142 | + <Column title="调运方式" dataIndex="method" /> | |
143 | + <Column title="状态" dataIndex="status" /> | |
144 | + <Column | |
145 | + title="操作" | |
146 | + render={r => { | |
147 | + if (statusType[r.status] == "0") { | |
148 | + return ( | |
149 | + <div style={{ display: 'flex', alignItems: 'center' }}> | |
150 | + <a onClick={() => edit(r.transferId)}>继续编辑</a> | |
151 | + <Divider type="vertical" /> | |
152 | + <Popconfirm | |
153 | + title="确认删除?" | |
154 | + onConfirm={() => deltransfer(r.transferId)} | |
155 | + okText="确认" | |
156 | + cancelText="取消" | |
157 | + > | |
158 | + <a>删除</a> | |
159 | + </Popconfirm> | |
160 | + </div> | |
161 | + ); | |
162 | + } else if (statusType[r.status] == "1") { | |
163 | + return ( | |
164 | + <div style={{ display: 'flex', alignItems: 'center' }}> | |
165 | + <a onClick={() => getProcess(r.transferId)}>流程进度</a> | |
166 | + <Divider type="vertical" /> | |
167 | + <Popconfirm | |
168 | + title="确认撤销?" | |
169 | + onConfirm={() => deltransfer(r.transferId)} | |
170 | + okText="确认" | |
171 | + cancelText="取消" | |
172 | + > | |
173 | + <a>撤销</a> | |
174 | + </Popconfirm> | |
175 | + <Divider type="vertical" /> | |
176 | + <a onClick={() => transferDetail(r.transferId)}>查看</a> | |
177 | + </div> | |
178 | + ); | |
179 | + } else if (statusType[r.status] == "2") { | |
180 | + return ( | |
181 | + <div style={{ display: 'flex', alignItems: 'center' }}> | |
182 | + <a onClick={() => getProcess(r.transferId)}>流程进度</a> | |
183 | + <Divider type="vertical" /> | |
184 | + <a onClick={() => transferDetail(r.transferId)}>查看</a> | |
185 | + </div> | |
186 | + ); | |
187 | + } else if (r.status == "已入库" && (r.method == '货拉拉' || r.method == '企业滴滴')) { | |
188 | + return ( | |
189 | + <div style={{ display: 'flex', alignItems: 'center' }}> | |
190 | + <a onClick={() => getProcess(r.transferId)}>流程进度</a> | |
191 | + <Divider type="vertical" /> | |
192 | + <a onClick={() => transferDetail(r.transferId)}>查看</a> | |
193 | + </div> | |
194 | + ); | |
195 | + } else if (statusType[r.status] == "9") { | |
196 | + return ( | |
197 | + <div style={{ display: 'flex', alignItems: 'center' }}> | |
198 | + <a onClick={() => getProcess(r.transferId)}>流程进度</a> | |
199 | + <Divider type="vertical" /> | |
200 | + <a onClick={() => edit(r.transferId)}>重新编辑</a> | |
201 | + <Divider type="vertical" /> | |
202 | + <a onClick={() => transferDetail(r.transferId)}>查看</a> | |
203 | + </div> | |
204 | + ); | |
205 | + } else { | |
206 | + return <></>; | |
207 | + } | |
208 | + }} | |
209 | + /> | |
210 | + </Table> | |
211 | + <TransferProcessModal processItem={processItem} visible={processVisible} onCancel={() => setProcessVisible(false)} itemId={itemId} /> | |
212 | + </> | |
213 | + )} | |
207 | 214 | {pageNum == 2 && <TransferDetail onOk={() => setPageNum(1)} />} |
208 | 215 | </> |
209 | 216 | ); | ... | ... |