Commit b000b1a337f2642d000cd1169eaec7356733793d
Merge branch 'decorate' into 'master'
Decorate See merge request !695
Showing
7 changed files
with
100 additions
and
214 deletions
src/pages/decoration/deco/DeoGoodsManagement/api.ts
1 | -import { http } from "@/typing/http"; | |
1 | +import type { http } from "@/typing/http"; | |
2 | 2 | import request from "@/utils/request"; |
3 | 3 | import { DECORATION } from "@/utils/host"; |
4 | 4 | |
... | ... | @@ -44,11 +44,11 @@ export interface Params { |
44 | 44 | ready?: boolean //信息是否完善 |
45 | 45 | } |
46 | 46 | |
47 | -export function getShop(params:Params): PromisePageResp<WorkItem> { | |
47 | +export function getShop(params: Params): PromisePageResp<WorkItem> { | |
48 | 48 | return request.get(`${DECORATION}/deco/goods/list`, {params}); |
49 | 49 | } |
50 | 50 | |
51 | -export function getShopDetail(id:number): PromisePageResp<WorkItem> { | |
51 | +export function getShopDetail(id: number): PromisePageResp<WorkItem> { | |
52 | 52 | return request.get(`${DECORATION}/deco/goods/detail?id=${id}`); |
53 | 53 | } |
54 | 54 | |
... | ... | @@ -69,12 +69,12 @@ export function AddShop(params: AddParams) { |
69 | 69 | return request.post(`${DECORATION}/deco/goods/save`, { ...params }); |
70 | 70 | } |
71 | 71 | |
72 | -export function DeleteShop(goodsId:number) { | |
72 | +export function DeleteShop(goodsId: number) { | |
73 | 73 | return request.post(`${DECORATION}/deco/goods/delete`, {goodsId}, {contentType: "form-data"}); |
74 | 74 | } |
75 | 75 | |
76 | 76 | // 上架装潢商品 |
77 | -export function upApi(id?:number) { | |
77 | +export function upApi(id?: number) { | |
78 | 78 | return request.post(`${DECORATION}/deco/goods/up`, {id}, {contentType: "form-data"}); |
79 | 79 | } |
80 | 80 | |
... | ... | @@ -112,11 +112,15 @@ export interface Price { |
112 | 112 | price: number |
113 | 113 | } |
114 | 114 | |
115 | -export function upDetailApi(params: {goodsId: number}):PrResArr<UpDetail> { | |
115 | +export function upDetailApi(params: {goodsId: number}): PrResArr<UpDetail> { | |
116 | 116 | return request.get(`${DECORATION}/deco/goods/sale/shop`, {params}); |
117 | 117 | } |
118 | 118 | |
119 | 119 | // 删除装潢商品 |
120 | -export function deleteApi(goodsId?:number) { | |
120 | +export function deleteApi(goodsId?: number) { | |
121 | 121 | return request.post(`${DECORATION}/deco/goods/delete`, {goodsId}); |
122 | +} | |
123 | +// 获取装潢分类 | |
124 | +export function decorationType(): PrResArr<WorkItem> { | |
125 | + return request.get(`${DECORATION}/deco/goods/category`); | |
122 | 126 | } |
123 | 127 | \ No newline at end of file | ... | ... |
src/pages/decoration/deco/DeoGoodsManagement/components/AddModal.tsx
1 | 1 | import React, { useEffect, useState } from 'react'; |
2 | -import { Modal, Form, Input, Radio, Select, message, TreeSelect, Upload, Button } from 'antd'; | |
2 | +import { Modal, Form, Input, Radio, Select, message, TreeSelect, Upload } from 'antd'; | |
3 | 3 | import NewTag from '../../componets/NewTag'; |
4 | 4 | import ImageUpload from './ImageUpload'; |
5 | 5 | import ItemModal from './ItemModal'; |
6 | 6 | import * as API from '@/common/api'; |
7 | 7 | import { AddShop } from '../api'; |
8 | -import { FeeweeFileAccept, FeeweeFileChange, FeeweeFileInit } from '@/utils/getFidFile'; | |
9 | 8 | import COS from '@/utils/COS'; |
10 | -import { UploadProps } from 'antd/lib/upload'; | |
11 | -import FeeweeUpload from '@/components/FeeweeUpload'; | |
12 | -import { IMGURL } from '@/utils'; | |
13 | -import { InboxOutlined, PlusOutlined } from '@ant-design/icons'; | |
9 | +import { InboxOutlined } from '@ant-design/icons'; | |
14 | 10 | import WorkModal from './WorkModal'; |
11 | +import { useStore } from '../index'; | |
12 | +import PmsSelect from '@/pages/pms/comonents/PmsSelect' | |
15 | 13 | |
16 | 14 | const FormItem = Form.Item; |
17 | 15 | const { Option } = Select; |
18 | 16 | const { Dragger } = Upload; |
19 | -enum typeName { | |
20 | - '部分品牌' = 1, | |
21 | - '部分车系' = 2, | |
22 | - '部分车型' = 3, | |
23 | -} | |
24 | 17 | |
25 | 18 | interface Props { |
26 | 19 | visible: boolean; |
... | ... | @@ -31,6 +24,7 @@ interface Props { |
31 | 24 | } |
32 | 25 | |
33 | 26 | export default function AddModal(props: Props) { |
27 | + const { decotypes } = useStore(); | |
34 | 28 | const { visible, item, setVisible, setLoading, setItem } = props; |
35 | 29 | const [form] = Form.useForm(); |
36 | 30 | const [optionType, setOptionType] = useState<number>(0); |
... | ... | @@ -45,7 +39,6 @@ export default function AddModal(props: Props) { |
45 | 39 | |
46 | 40 | useEffect(() => { |
47 | 41 | if (item && item.id) { |
48 | - console.log('回显数据', item); | |
49 | 42 | setImageVisible(false); |
50 | 43 | const _url = (item.videoUrl ? item.videoUrl : []).map((e: any, index: any) => { |
51 | 44 | return { |
... | ... | @@ -61,6 +54,7 @@ export default function AddModal(props: Props) { |
61 | 54 | setIsDo(item.itemId ? '1' : '2'); |
62 | 55 | form.setFieldsValue({ |
63 | 56 | videoUrl: item.videoUrl ? _url : [], |
57 | + decoCategory: item.decoCategory, | |
64 | 58 | imageDetail: item.detailImgFids, |
65 | 59 | image: item.mainImgFids, |
66 | 60 | rang: item.applyType || 0, |
... | ... | @@ -70,23 +64,23 @@ export default function AddModal(props: Props) { |
70 | 64 | carSpecIds: |
71 | 65 | item.applyType === 3 |
72 | 66 | ? item.applyValue.map((e: any, i: any) => ({ |
73 | - value: e, | |
74 | - label: item.applyValueNames[i], | |
75 | - })) | |
67 | + value: e, | |
68 | + label: item.applyValueNames[i], | |
69 | + })) | |
76 | 70 | : [], |
77 | 71 | carSeriesIds: |
78 | 72 | item.applyType === 2 |
79 | 73 | ? item.applyValue.map((e: any, i: any) => ({ |
80 | - value: e, | |
81 | - label: item.applyValueNames[i], | |
82 | - })) | |
74 | + value: e, | |
75 | + label: item.applyValueNames[i], | |
76 | + })) | |
83 | 77 | : [], |
84 | 78 | brands: |
85 | 79 | item.applyType === 1 |
86 | 80 | ? item.applyValue.map((e: any, i: any) => ({ |
87 | - value: e, | |
88 | - label: item.applyValueNames[i], | |
89 | - })) | |
81 | + value: e, | |
82 | + label: item.applyValueNames[i], | |
83 | + })) | |
90 | 84 | : [], |
91 | 85 | nameMsg: { |
92 | 86 | partCode: item.partCode, |
... | ... | @@ -159,12 +153,10 @@ export default function AddModal(props: Props) { |
159 | 153 | } |
160 | 154 | |
161 | 155 | async function loadSpecData(selectedOptions: any) { |
162 | - console.log('选择', selectedOptions); | |
163 | 156 | const brandId: string = String(selectedOptions.props.value); |
164 | 157 | const ids: string[] = brandId.split('-'); |
165 | 158 | const len = ids.length; |
166 | 159 | const brand: any = specsOptions.find((item: any) => item.value === Number(ids[0])); |
167 | - console.log('品牌', brand); | |
168 | 160 | try { |
169 | 161 | if (len > 1) { |
170 | 162 | const series = brand.children.find((item: any) => item.value === brandId); |
... | ... | @@ -195,11 +187,11 @@ export default function AddModal(props: Props) { |
195 | 187 | } |
196 | 188 | |
197 | 189 | function handleSave(value: any) { |
198 | - console.log('vvvv', value); | |
199 | 190 | const videoUrl = (value.videoUrl || []).map((e: any) => e.response.data); |
200 | 191 | const params = { |
201 | 192 | id: item && item.id ? item.id : '', |
202 | 193 | name: value.name, |
194 | + decoCategory: value.decoCategory, | |
203 | 195 | partId: item && item.partId ? item.partId : value.nameMsg.partId, |
204 | 196 | itemId: value.item && value.item.id, |
205 | 197 | videoUrl, |
... | ... | @@ -209,22 +201,22 @@ export default function AddModal(props: Props) { |
209 | 201 | mainImgFids: |
210 | 202 | value.image && value.image.fileList |
211 | 203 | ? value.image.fileList.map((item: any) => { |
212 | - if (item.response) { | |
213 | - return item.response.data; | |
214 | - } else { | |
215 | - return item.fid; | |
216 | - } | |
217 | - }) | |
204 | + if (item.response) { | |
205 | + return item.response.data; | |
206 | + } else { | |
207 | + return item.fid; | |
208 | + } | |
209 | + }) | |
218 | 210 | : value.image, |
219 | 211 | detailImgFids: |
220 | 212 | value.imageDetail && value.imageDetail.fileList |
221 | 213 | ? value.imageDetail.fileList.map((item: any) => { |
222 | - if (item.response) { | |
223 | - return item.response.data; | |
224 | - } else { | |
225 | - return item.fid; | |
226 | - } | |
227 | - }) | |
214 | + if (item.response) { | |
215 | + return item.response.data; | |
216 | + } else { | |
217 | + return item.fid; | |
218 | + } | |
219 | + }) | |
228 | 220 | : value.imageDetail, |
229 | 221 | tag, |
230 | 222 | applyType: value.rang, |
... | ... | @@ -232,21 +224,12 @@ export default function AddModal(props: Props) { |
232 | 224 | value.rang === 0 |
233 | 225 | ? undefined |
234 | 226 | : value.rang === 1 |
235 | - ? value.brands.map((e: any) => e.value) | |
236 | - : value.rang === 2 | |
237 | - ? value.carSeriesIds.map((e: any) => e.value) | |
238 | - : value.carSpecIds.map((e: any) => e.value), | |
227 | + ? value.brands.map((e: any) => e.value) | |
228 | + : value.rang === 2 | |
229 | + ? value.carSeriesIds.map((e: any) => e.value) | |
230 | + : value.carSpecIds.map((e: any) => e.value), | |
239 | 231 | }; |
240 | - console.log('xxxx', params); | |
241 | - // AddShop(params) | |
242 | - // .then(() => { | |
243 | - // setVisible(false); | |
244 | - // setLoading(true); | |
245 | - // message.success("保存成功"); | |
246 | - // }) | |
247 | - // .catch((e) => { | |
248 | - // message.error(e.message); | |
249 | - // }); | |
232 | + | |
250 | 233 | if (item && item.id) { |
251 | 234 | if (value.carSeriesIds === item.applyValueNames || value.carSpecIds === item.applyValueNames) { |
252 | 235 | const applyValue = item.applyValue; |
... | ... | @@ -310,7 +293,6 @@ export default function AddModal(props: Props) { |
310 | 293 | }; |
311 | 294 | |
312 | 295 | const isEmptyList = (rule: any, value: any, callback: Function) => { |
313 | - console.log('规则', !value); | |
314 | 296 | if (!value || (value.fileList && value.fileList.length == 0)) { |
315 | 297 | callback('请上传主图'); |
316 | 298 | } else { |
... | ... | @@ -319,7 +301,6 @@ export default function AddModal(props: Props) { |
319 | 301 | }; |
320 | 302 | |
321 | 303 | const isDetailEmptyList = (rule: any, value: any, callback: Function) => { |
322 | - console.log(value); | |
323 | 304 | if (!value || (value.fileList && value.fileList.length == 0)) { |
324 | 305 | callback('请上传详情图片'); |
325 | 306 | } else { |
... | ... | @@ -329,11 +310,10 @@ export default function AddModal(props: Props) { |
329 | 310 | |
330 | 311 | return ( |
331 | 312 | <Modal |
332 | - visible={visible} | |
313 | + open={visible} | |
333 | 314 | onCancel={() => onClose()} |
334 | 315 | width={600} |
335 | 316 | onOk={() => form.submit()} |
336 | - // getContainer={false} | |
337 | 317 | > |
338 | 318 | <Form form={form} labelCol={{ span: 4 }} wrapperCol={{ span: 17 }} onFinish={handleSave}> |
339 | 319 | <FormItem name="nameMsg" label="装潢件" rules={[{ required: true, message: '必填' }]} hidden={item && item.id}> |
... | ... | @@ -357,9 +337,16 @@ export default function AddModal(props: Props) { |
357 | 337 | ) : null; |
358 | 338 | }} |
359 | 339 | </Form.Item> |
360 | - <FormItem name="name" label="商品名称" wrapperCol={{ span: 15 }} rules={[{ required: true, message: '请填写商品名称' }]}> | |
340 | + <FormItem name="name" label="商品名称" rules={[{ required: true, message: '请填写商品名称' }]}> | |
361 | 341 | <Input /> |
362 | 342 | </FormItem> |
343 | + <FormItem name="decoCategory" label="装潢分类"> | |
344 | + <PmsSelect | |
345 | + options={decotypes.map(i => ({ value: i.value, label: i.label }))} | |
346 | + allowClear | |
347 | + placeholder="请选择装潢分类" | |
348 | + /> | |
349 | + </FormItem> | |
363 | 350 | <FormItem name="image" label="主图上传" wrapperCol={{ span: 15 }} rules={[{ required: true, message: '请上传主图', validator: isEmptyList }]}> |
364 | 351 | <ImageUpload clear={imageVisible} length={6} /> |
365 | 352 | </FormItem> |
... | ... | @@ -377,41 +364,11 @@ export default function AddModal(props: Props) { |
377 | 364 | > |
378 | 365 | <ImageUpload clear={imageVisible} /> |
379 | 366 | </FormItem> |
380 | - {/* <Form.Item | |
381 | - name="videoUrl" | |
382 | - label="装潢视频" | |
383 | - valuePropName="fileList" | |
384 | - getValueFromEvent={FeeweeFileChange} | |
385 | - // rules={[{ required: true, message: "请上传视频" }]} | |
386 | - > | |
387 | - <FeeweeUpload | |
388 | - accept={FeeweeFileAccept} | |
389 | - // listType="picture-card" | |
390 | - limitSize={100} | |
391 | - action={IMGURL.uploadUrl} | |
392 | - > | |
393 | - <Dragger {...draggerProps}> | |
394 | - <p className="ant-upload-drag-icon"> | |
395 | - <InboxOutlined /> | |
396 | - </p> | |
397 | - <p className="ant-upload-text"> | |
398 | - 单击或拖动文件到此区域以导入视频 | |
399 | - </p> | |
400 | - <p className="ant-upload-hint"> | |
401 | - 视频格式要求 MP4,大小限制 50 MB 以内 | |
402 | - </p> | |
403 | - </Dragger> | |
404 | - </FeeweeUpload> | |
405 | - </Form.Item> */} | |
406 | 367 | <FormItem |
407 | 368 | name="videoUrl" |
408 | 369 | label="装潢视频" |
409 | - // rules={[{ required: true, message: "请上传视频" }]} | |
410 | 370 | valuePropName="fileList" |
411 | 371 | getValueFromEvent={(e) => { |
412 | - // if (Array.isArray(e)) { | |
413 | - // return e.slice(-1); | |
414 | - // } | |
415 | 372 | const { status, response } = e.file; |
416 | 373 | if (!status) return []; |
417 | 374 | if (status == 'error') { | ... | ... |
src/pages/decoration/deco/DeoGoodsManagement/index.tsx
... | ... | @@ -10,6 +10,7 @@ import { history } from 'umi'; |
10 | 10 | import ImportModal from './components/UploadExcel'; |
11 | 11 | import UpDetail from './components/UpDetail'; |
12 | 12 | import usePagination from '@/hooks/usePagination'; |
13 | +import PmsSelect from '@/pages/pms/comonents/PmsSelect' | |
13 | 14 | |
14 | 15 | const { Column } = Table; |
15 | 16 | const { Search } = Input; |
... | ... | @@ -17,7 +18,7 @@ const { Search } = Input; |
17 | 18 | export const { Provider, useStore } = createStore(store); |
18 | 19 | |
19 | 20 | function DeoGoodsManagement() { |
20 | - const { brandOptions, setBrandOptions } = useStore(); | |
21 | + const { brandOptions, setBrandOptions, decotypes } = useStore(); | |
21 | 22 | const { list, setLoading, loading, paginationConfig, setParams } = usePagination(API.getShop, { bizType: 0 }); |
22 | 23 | const [visible, setVisible] = useState(false); |
23 | 24 | const [item, setItem] = useState<any>({}); |
... | ... | @@ -135,6 +136,15 @@ function DeoGoodsManagement() { |
135 | 136 | loadData={(selectedOptions) => loadData(selectedOptions)} |
136 | 137 | notFoundContent="暂无数据" |
137 | 138 | /> |
139 | + <PmsSelect | |
140 | + style={{ width: 200, marginRight: 10, marginBottom: 10 }} | |
141 | + allowClear | |
142 | + onChange={(value) => { | |
143 | + setParams({ decoCategory: value }, true); | |
144 | + }} | |
145 | + placeholder="请装潢分类" | |
146 | + options={decotypes.map(i => ({ value: i.value, label: i.label }))} | |
147 | + /> | |
138 | 148 | <Search style={{ width: 200, marginBottom: 10 }} placeholder="装潢名称/编码" allowClear onSearch={onSearch} /> |
139 | 149 | </div> |
140 | 150 | <div> |
... | ... | @@ -160,6 +170,7 @@ function DeoGoodsManagement() { |
160 | 170 | <Column title="装潢名称" dataIndex="name" align="center" /> |
161 | 171 | <Column title="配件编码" dataIndex="partCode" align="center" /> |
162 | 172 | <Column title="配件件号" dataIndex="partNo" align="center" /> |
173 | + <Column title="装潢分类" dataIndex="decoCategory" align="center" render={t => decotypes.find(i => i.value == t)?.label} /> | |
163 | 174 | <Column |
164 | 175 | title="信息完善" |
165 | 176 | dataIndex="ready" | ... | ... |
src/pages/decoration/deco/DeoGoodsManagement/useStore.ts
1 | 1 | import { useState, useEffect } from 'react'; |
2 | -import * as API from '@/common/api'; | |
3 | -import { Option } from './interface.d'; | |
2 | +import type { Option } from './interface.d'; | |
4 | 3 | import { message } from 'antd'; |
5 | 4 | import usePagination from '@/hooks/usePagination'; |
5 | +import useInitial from '@/hooks/useInitail'; | |
6 | 6 | import * as api from './api'; |
7 | -import { getGroupCasBrandApi, getShopApi } from '@/common/api'; | |
8 | -import { Value } from '@/pages/decoration/deco/DeoGoodsManagement/subpages/pullOffShelves/components/ShopContent/api'; | |
7 | +import { getGroupCasBrandApi } from '@/common/api'; | |
8 | +import type { Value } from '@/pages/decoration/deco/DeoGoodsManagement/subpages/pullOffShelves/components/ShopContent/api'; | |
9 | 9 | |
10 | 10 | export default function useStore() { |
11 | 11 | const [currentType, setCurrentType] = useState<number>(0); |
... | ... | @@ -19,6 +19,8 @@ export default function useStore() { |
19 | 19 | const [shopSelected, setShopSelected] = useState<Value[]>([]); |
20 | 20 | // 装潢选择 |
21 | 21 | const [decoSelected, setDecoSelected] = useState<api.WorkItem[]>([]); |
22 | + // 装潢分类 | |
23 | + const {data: decotypes} = useInitial(api.decorationType, [], {}) | |
22 | 24 | |
23 | 25 | useEffect(() => { |
24 | 26 | fetchBrand(); |
... | ... | @@ -50,5 +52,6 @@ export default function useStore() { |
50 | 52 | setShopSelected, |
51 | 53 | decoSelected, |
52 | 54 | setDecoSelected, |
55 | + decotypes | |
53 | 56 | }; |
54 | 57 | } | ... | ... |
src/pages/decoration/deco/RetailPriceCoefficient/index.tsx
1 | -// import React from 'react'; | |
2 | -// import { PageHeaderWrapper } from '@ant-design/pro-layout'; | |
3 | -// import { Button, Card, Divider, message, Popconfirm, Table } from 'antd'; | |
4 | -// import Modal from './components/Modal'; | |
5 | -// import { createStore } from '@/hooks/moz'; | |
6 | -// import store from './useStore'; | |
7 | -// import * as API from './api'; | |
8 | - | |
9 | -// const { Column } = Table; | |
10 | - | |
11 | -// export const { Provider, useStore } = createStore(store); | |
12 | - | |
13 | -// function RetailPriceCoefficient() { | |
14 | -// const { list, paginationConfig, setVisible, setCurrent, setLoading} = useStore(); | |
15 | - | |
16 | -// function deleteHandle(id: number) { | |
17 | -// API.DeleteShop(id) | |
18 | -// .then((res) => { | |
19 | -// message.success("删除成功"); | |
20 | -// setLoading(true); | |
21 | -// }) | |
22 | -// .catch((e) => { | |
23 | -// message.error(e.message); | |
24 | -// }); | |
25 | -// } | |
26 | - | |
27 | -// return ( | |
28 | -// <PageHeaderWrapper title="装潢零售价格系数"> | |
29 | -// <Card> | |
30 | -// <div | |
31 | -// style={{ | |
32 | -// display: "flex", | |
33 | -// flexDirection: "row", | |
34 | -// alignItems: "center", | |
35 | -// marginBottom: 20, | |
36 | -// justifyContent: "flex-end", | |
37 | -// }} | |
38 | -// > | |
39 | -// <Button type="primary" onClick={() => setVisible(true)}> | |
40 | -// 新增 | |
41 | -// </Button> | |
42 | -// </div> | |
43 | -// <Table dataSource={list} rowKey="id" pagination={paginationConfig}> | |
44 | -// <Column title="门店" dataIndex="shopNames" align="center" render={(text:any, record:any) => text.join(',')} width={700} /> | |
45 | -// <Column | |
46 | -// title="零售价格系数" | |
47 | -// align="center" | |
48 | -// render={(value) => ( | |
49 | -// <> | |
50 | -// <Button | |
51 | -// type="link" | |
52 | -// color="#4189FD" | |
53 | -// onClick={() => { | |
54 | -// setVisible(true); | |
55 | -// setCurrent(value); | |
56 | -// }} | |
57 | -// > | |
58 | -// 设置 | |
59 | -// </Button> | |
60 | -// <Divider type="vertical" /> | |
61 | -// <Popconfirm | |
62 | -// title="是否删除?" | |
63 | -// onConfirm={() => deleteHandle(value.id || 0)} | |
64 | -// okText="确定" | |
65 | -// cancelText="取消" | |
66 | -// > | |
67 | -// <Button type="link" style={{ color: "red" }}> | |
68 | -// 删除 | |
69 | -// </Button> | |
70 | -// </Popconfirm> | |
71 | -// </> | |
72 | -// )} | |
73 | -// /> | |
74 | -// </Table> | |
75 | -// <Modal /> | |
76 | -// </Card> | |
77 | -// </PageHeaderWrapper> | |
78 | -// ); | |
79 | -// } | |
80 | -// export default () => <Provider><RetailPriceCoefficient /></Provider>; | |
81 | 1 | import React, { useState } from 'react'; |
82 | 2 | import { PageHeaderWrapper } from '@ant-design/pro-layout'; |
83 | -import { Table, Select, Button, Input, Card } from 'antd'; | |
3 | +import { Table, Button, Input, Card } from 'antd'; | |
84 | 4 | import { PlusOutlined, VerticalAlignBottomOutlined, UploadOutlined } from '@ant-design/icons'; |
85 | 5 | import FixedPriceModal from './components/FixedPriceModal'; |
86 | 6 | import usePagination from '@/hooks/usePagination'; |
... | ... | @@ -89,16 +9,16 @@ import { debounce } from 'lodash'; |
89 | 9 | import UploadModal from './components/UploadModal'; |
90 | 10 | import ShopModal from '@/pages/pms/part/PartPriceCoefficient/components/ShopModal'; |
91 | 11 | import store from './useStore'; |
12 | +import PmsSelect from '@/pages/pms/comonents/PmsSelect' | |
92 | 13 | import { createStore } from '@/hooks/moz'; |
93 | 14 | |
94 | 15 | const { Column } = Table; |
95 | -const { Option } = Select; | |
96 | 16 | const { Search } = Input; |
97 | 17 | export const { Provider, useStore } = createStore(store); |
98 | 18 | |
99 | 19 | function InsuranceTab() { |
100 | - const { list, loading, setParams, paginationConfig } = usePagination(getFixedPageListApi, {type: 2}); | |
101 | - const {shops } = useStore(); | |
20 | + const { list, loading, setParams, paginationConfig } = usePagination(getFixedPageListApi, { type: 2 }); | |
21 | + const { shops } = useStore(); | |
102 | 22 | const [visible, setVisible] = useState(false); |
103 | 23 | const [currentFixedPrice, setCurrentFixedPrice] = useState<PartPriceCoefficientSpace.FixedItem>({}); |
104 | 24 | const [uploadVisible, sertUploadVisible] = useState(false); |
... | ... | @@ -114,11 +34,15 @@ function InsuranceTab() { |
114 | 34 | <Card> |
115 | 35 | <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', marginBottom: 20 }}> |
116 | 36 | <div style={{ display: 'flex' }}> |
117 | - <Select onChange={value => setParams({ current: 1, shopId: value }, true)} style={{ width: 250 }} placeholder="请选择服务站" allowClear> | |
118 | - {shops.map(shop => ( | |
119 | - <Option value={shop.id || ''} key={shop.id}>{shop.name}</Option> | |
120 | - ))} | |
121 | - </Select> | |
37 | + <PmsSelect | |
38 | + onChange={value => setParams({ shopId: value }, true)} | |
39 | + style={{ width: 300 }} | |
40 | + placeholder="请选择服务站" | |
41 | + allowClear | |
42 | + options={shops.map(shop => ( | |
43 | + { value: shop.id, label: shop.name } | |
44 | + ))} | |
45 | + /> | |
122 | 46 | <Search |
123 | 47 | enterButton |
124 | 48 | allowClear |
... | ... | @@ -128,10 +52,10 @@ function InsuranceTab() { |
128 | 52 | style={{ maxWidth: 300, marginLeft: 10 }} |
129 | 53 | /> |
130 | 54 | </div> |
131 | - <div style={{display: 'flex'}}> | |
132 | - <Button type="primary" icon={<UploadOutlined />} onClick={() => sertUploadVisible(true)} style={{marginRight: 10}}>导入</Button> | |
133 | - <Button type="primary" icon={<VerticalAlignBottomOutlined />} style={{marginRight: 10}}> | |
134 | - <a href="/api/pms/erp/part/price/export/fix/price" target="_blank" rel="noopener noreferrer" style={{color: '#ffffff'}}>导出</a> | |
55 | + <div style={{ display: 'flex' }}> | |
56 | + <Button type="primary" icon={<UploadOutlined />} onClick={() => sertUploadVisible(true)} style={{ marginRight: 10 }}>导入</Button> | |
57 | + <Button type="primary" icon={<VerticalAlignBottomOutlined />} style={{ marginRight: 10 }}> | |
58 | + <a href="/api/pms/erp/part/price/export/fix/price" target="_blank" rel="noopener noreferrer" style={{ color: '#ffffff' }}>导出</a> | |
135 | 59 | </Button> |
136 | 60 | <Button type="primary" icon={<PlusOutlined />} onClick={() => { setVisible(true); setCurrentFixedPrice({}); }}>新增</Button> |
137 | 61 | </div> |
... | ... | @@ -157,7 +81,7 @@ function InsuranceTab() { |
157 | 81 | <span> |
158 | 82 | <a onClick={() => { setVisible(true); setCurrentFixedPrice(_item); }}>编辑</a> |
159 | 83 | </span> |
160 | - )} | |
84 | + )} | |
161 | 85 | /> |
162 | 86 | </Table> |
163 | 87 | <FixedPriceModal visible={visible} setVisible={setVisible} currentFixedPrice={currentFixedPrice} setParams={setParams} /> | ... | ... |
src/pages/decoration/deco/WorkKnowledgeBase/index.tsx
1 | 1 | import React from 'react'; |
2 | 2 | import { PageHeaderWrapper } from '@ant-design/pro-layout'; |
3 | 3 | import { createStore } from '@/hooks/moz'; |
4 | -import { Button, Card, Input, Table, Popconfirm, Divider, message } from 'antd'; | |
4 | +import { Button, Card, Input, Table, Popconfirm, message } from 'antd'; | |
5 | 5 | import store from './useStore'; |
6 | 6 | import * as API from './api'; |
7 | 7 | import usePagination from '@/hooks/usePagination'; |
... | ... | @@ -18,7 +18,7 @@ function WorkKnowledgeBase() { |
18 | 18 | |
19 | 19 | function deleteHandle(id: number) { |
20 | 20 | API.DeleteWork(id) |
21 | - .then((res) => { | |
21 | + .then(() => { | |
22 | 22 | message.success("删除成功"); |
23 | 23 | setLoading(true); |
24 | 24 | }) |
... | ... | @@ -51,19 +51,11 @@ function WorkKnowledgeBase() { |
51 | 51 | }} |
52 | 52 | > |
53 | 53 | <Search |
54 | - style={{ width: "100%"}} | |
55 | - placeholder="装潢名称/代码" | |
54 | + style={{ width: 250}} | |
55 | + placeholder="装潢名称/代码/作业名称" | |
56 | 56 | allowClear |
57 | - enterButton="搜索" | |
58 | 57 | onSearch={onSearch} |
59 | 58 | /> |
60 | - {/* <Search | |
61 | - style={{ width: "60%", marginLeft: 30 }} | |
62 | - placeholder="搜索装潢作业名称/代码" | |
63 | - allowClear | |
64 | - enterButton="搜索" | |
65 | - onSearch={onSearch} | |
66 | - /> */} | |
67 | 59 | </div> |
68 | 60 | <Button type="primary" onClick={() => setVisible(true)}> |
69 | 61 | 新增 | ... | ... |
src/pages/pms/part/DecoPriceCoefficient/components/DecoFixedPriceTable.tsx
1 | 1 | import usePagination from '@/hooks/usePagination'; |
2 | 2 | import { PlusOutlined, UploadOutlined, VerticalAlignBottomOutlined } from '@ant-design/icons'; |
3 | -import { Button, Input, Select, Table, message, Divider, Popconfirm } from 'antd'; | |
3 | +import { Button, Input, Table, message, Divider, Popconfirm } from 'antd'; | |
4 | 4 | import React, { useState } from 'react'; |
5 | 5 | import { getFixedPageListApi, fixdelete, getShopApi } from '../api'; |
6 | 6 | import FixedPriceModal from './FixedPriceModal'; |
7 | 7 | import ShopModal from './ShopModal'; |
8 | 8 | import useInitail from '@/hooks/useInitail'; |
9 | 9 | import UploadModal from './UploadModal'; |
10 | +import PmsSelect from '@/pages/pms/comonents/PmsSelect' | |
10 | 11 | |
11 | 12 | const { Column } = Table; |
12 | -const { Option } = Select; | |
13 | 13 | const { Search } = Input; |
14 | 14 | |
15 | 15 | export default function InsuranceTab() { |
... | ... | @@ -32,20 +32,15 @@ export default function InsuranceTab() { |
32 | 32 | <> |
33 | 33 | <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', marginBottom: 20 }}> |
34 | 34 | <div style={{ display: 'flex' }}> |
35 | - <Select | |
35 | + <PmsSelect | |
36 | 36 | onChange={(value) => setParams({ current: 1, shopId: value }, true)} |
37 | 37 | style={{ width: 350 }} |
38 | 38 | placeholder="筛选门店" |
39 | 39 | allowClear |
40 | - showSearch | |
41 | - optionFilterProp="children" | |
42 | - > | |
43 | - {shops.map((shop) => ( | |
44 | - <Option value={shop.id || ''} key={shop.id}> | |
45 | - {shop.name} | |
46 | - </Option> | |
40 | + options={shops.map(shop => ( | |
41 | + { value: shop.id, label: shop.name } | |
47 | 42 | ))} |
48 | - </Select> | |
43 | + /> | |
49 | 44 | <Search |
50 | 45 | allowClear |
51 | 46 | placeholder="请输入配件名称/编码/件号" | ... | ... |