Commit 1521db5f2ae94a40948b98ab5ea904702d8479b1

Authored by jiangwei
1 parent b412162f

fix

src/pages/pms/storage/partShop/api.ts
... ... @@ -8,6 +8,10 @@ export function getPartShopPageApi(params: PmsStoragePartShop.QueryParams): http
8 8 }
9 9  
10 10 /** 编辑服务站配件 */
  11 +export function savePartShopeApi(params: PmsStoragePartShop.Params): http.PromiseResp<string> {
  12 + return request.post(`${PMS_HOST}/erp/part/shop/save`, { ...params });
  13 +}
  14 +/** 编辑服务站配件 */
11 15 export function savePartStockApi(params: PmsStoragePartShop.Params): http.PromiseResp<string> {
12 16 return request.post(`${PMS_HOST}/erp/part/shop/update/stock`, { ...params });
13 17 }
... ...
src/pages/pms/storage/partShop/components/PartShopModal.tsx
... ... @@ -2,19 +2,21 @@ import React, { useEffect, useState } from &#39;react&#39;;
2 2 import { Modal, Button, Form, Select, InputNumber, message, Input, MessageArgsProps } from 'antd';
3 3 import { useStore } from '../index';
4 4 import ChoosePart from './ChoosePart';
5   -import { savePartStockApi, savePartPriceApi } from '../api';
  5 +import { savePartStockApi, savePartPriceApi, savePartShopeApi } from '../api';
6 6  
7 7 const { Item } = Form;
8 8 const { Option } = Select;
9 9  
10 10 const apiObj: { [key: number]: any } = {
11   - 1: savePartPriceApi,
12   - 0: savePartStockApi
  11 + 1: savePartShopeApi,
  12 + 2: savePartStockApi,
  13 + 3: savePartPriceApi
13 14 };
14 15 export default function PartShopModal() {
15 16 const { visible, setVisible, shops, setLoading, item = {}, setItem, isprice, setIsprice, isadd, setIsadd, fw } = useStore();
16 17 const [form] = Form.useForm();
17 18 const [confirmLoading, setConfirmLoading] = useState(false);
  19 + const apiType = isadd ? 1 : isprice ? 3 : 2;
18 20  
19 21 useEffect(() => {
20 22 if (visible) {
... ... @@ -41,7 +43,7 @@ export default function PartShopModal() {
41 43 type: isadd ? 1 : isprice ? 3 : 2
42 44 };
43 45 setConfirmLoading(true);
44   - apiObj[Number(isprice)](params).then((res: { success: any; result: {} | null | undefined; }) => {
  46 + apiObj[apiType](params).then((res: { success: any; result: {} | null | undefined; }) => {
45 47 if (res.success) {
46 48 message.success(res.result);
47 49 setVisible(false);
... ...
src/pages/pms/storage/partShop/index.tsx
... ... @@ -20,7 +20,7 @@ function PartShop() {
20 20 const [storageFlowVisible, setStorageFlowVisible] = useState(false);
21 21  
22 22 return (
23   - <PageHeaderWrapper title={`服务站配件${fw ? `(霏微${fwS ? '(库存)' : ''})`: ''}`}>
  23 + <PageHeaderWrapper title={`服务站配件${fw ? `${fwS ? '(库存)' : '(霏微)'}`: ''}`}>
24 24 <Card>
25 25 <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: 20 }}>
26 26 <Filter />
... ...