+
);
}
diff --git a/src/pages/pms/partPlan/PlanPool/index.tsx b/src/pages/pms/partPlan/PlanPool/index.tsx
index 484a6c5..004cd7a 100644
--- a/src/pages/pms/partPlan/PlanPool/index.tsx
+++ b/src/pages/pms/partPlan/PlanPool/index.tsx
@@ -11,7 +11,6 @@ import st from "@/pages/pms/partPlan/PlanShipping/style.less";
import Filter from './components/Filter';
import {createStore} from "@/hooks/moz";
import store from "./useStore";
-import OutFlowModal from './components/OutFlowModal';
import CustBuyModal from './components/CustBuyModal';
export const { Provider, useStore } = createStore(store);
@@ -40,7 +39,7 @@ function Index() {
-
+ {/*
*/}
diff --git a/src/pages/pms/partPlan/PlanShipping/components/UploadExcel.tsx b/src/pages/pms/partPlan/PlanShipping/components/UploadExcel.tsx
index 7836558..d17a18a 100644
--- a/src/pages/pms/partPlan/PlanShipping/components/UploadExcel.tsx
+++ b/src/pages/pms/partPlan/PlanShipping/components/UploadExcel.tsx
@@ -31,9 +31,17 @@ export default function UploadExcel({ getList, importVisible, setImportVisible,
useEffect(() => {
if (!importVisible) {
setUploadResult(null);
+ setParam({ brandId: null, storageId: null, supplierId: null, settleShopId: null });
+ setFileList([]);
}
}, [importVisible]);
+ useEffect(() => {
+ if (!visibleDetail) {
+ setImportVisible(false);
+ }
+ }, [visibleDetail]);
+
function beforeUpload(file: any) {
const isLt2M = file.size / 1024 / 1024 < 20;
if (!isLt2M) {
@@ -145,7 +153,7 @@ export default function UploadExcel({ getList, importVisible, setImportVisible,
visible={visibleDetail}
item={uploadResult?.data || {}}
confirm
- onCancel={() => { setVisibleDetail(false); setImportVisible(false); }}
+ onCancel={() => setVisibleDetail(false)}
fetchList={() => { setUploadResult(null); getList(); }}
/>
diff --git a/src/pages/pms/setting/FreightTarget/api.ts b/src/pages/pms/setting/FreightTarget/api.ts
new file mode 100644
index 0000000..371fa95
--- /dev/null
+++ b/src/pages/pms/setting/FreightTarget/api.ts
@@ -0,0 +1,28 @@
+import { http } from '@/typing/http';
+import request from '@/utils/request';
+import { PMS_HOST } from '@/utils/host';
+
+export interface Item {
+ id?: number,
+ index?:number
+ amount?: any, //
+ startDays?: any
+ endDays?: any//
+}
+interface Params {
+ shopId?: number
+ keywords?: string
+ storageId?: number
+}
+/**
+ * 查询绩效--运费目标达成设置
+ */
+export function getDetail(params: Params): http.PromiseResp
- {
+ return request.get(`${PMS_HOST}/erp/target/amount/setting/get/list`, { params });
+}
+/**
+ * 新增或编辑绩效--运费目标设置
+ */
+export function saveApi(params: {list: Item[]}) {
+ return request.post(`${PMS_HOST}/erp/target/amount/setting/add/or/update`, params);
+}
diff --git a/src/pages/pms/setting/FreightTarget/components/AddModal.tsx b/src/pages/pms/setting/FreightTarget/components/AddModal.tsx
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/pages/pms/setting/FreightTarget/components/AddModal.tsx
diff --git a/src/pages/pms/setting/FreightTarget/index.tsx b/src/pages/pms/setting/FreightTarget/index.tsx
new file mode 100644
index 0000000..26c27de
--- /dev/null
+++ b/src/pages/pms/setting/FreightTarget/index.tsx
@@ -0,0 +1,124 @@
+import React, { useState } from 'react';
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
+import { Card, InputNumber, Button, message } from 'antd';
+import useInitial from '@/hooks/useInitail';
+import { getDetail, saveApi, Item} from './api';
+import ConfirmBnt from '../components/ConfirmBnt';
+import { DeleteOutlined } from '@ant-design/icons';
+
+const Index = () => {
+ const [disable, setDisable] = useState(false);
+ const { data, setData, loading, setLoading } = useInitial
- (getDetail, [{ startDays: 1, endDays: null, amount: null }, { startDays: null, endDays: null, amount: null }], {});
+
+ const handleAdd = () => {
+ setData([...data, { startDays: null, endDays: null, amount: null }]);
+ };
+
+ const handleInputChange = (index: number, p: any) => {
+ let arr = data;
+ if (p.endDays) {
+ arr[index + 1].startDays = p.endDays + 1;
+ }
+ setData(arr.map((it, i) => {
+ if (index == i) {
+ return { ...it, ...p};
+ } else {
+ return it;
+ }
+ }
+ ));
+ };
+
+ const handleDel = (event: any, index: number) => {
+ let arr = data;
+ arr.splice(index, 1);
+ arr[arr.length -1].startDays = arr[arr.length-2].endDays+1;
+ setData(arr);
+ };
+
+ const svae = () => {
+ saveApi({list: data}).then(() => {
+ message.success('保存成功');
+ setLoading(true);
+ setDisable(false);
+ }).catch(e => message.error(e.message));
+ };
+
+ return (
+
+
+ {!!data?.length && data.map((it, index) => (
+ index < data.length-1 ? (
+
+ {index + 1}、
+ <>
+ 缺件起始天数
+ 0 ? data[index - 1].endDays : 1}
+ value={index > 0 ? data[index - 1].endDays+1 : 1}
+ style={{ width: 100, marginLeft: 10, marginRight: 20 }}
+ />
+ >
+ <>
+ 缺件结束天数
+ {
+ handleInputChange(index, { startDays: index > 0 ? data[index - 1].endDays + 1 : it.startDays, endDays: value });
+ }}
+ style={{ width: 100, marginLeft: 10, marginRight: 20 }}
+ />
+ >
+ <>
+ 运费统计增加
+ handleInputChange(index, { amount: value })}
+ style={{ width: 100, marginLeft: 10, marginRight: 20 }}
+ />
+ >
+ {(index == data.length - 2 && disable && index != 0) ?
+ ) :
+ (
+
+
{data.length}、
+
+
+ 天及以上
+
+ <>
+ 运费统计增加
+
handleInputChange(data.length - 1, { startDays: index > 0 ? data[index - 1].endDays + 1 : it.startDays, endDays: null, amount: value })}
+ style={{ width: 100, marginLeft: 10, marginRight: 20 }}
+ />
+ >
+
+ )
+ ))}
+
+ svae()}
+ onCancel={() => { setDisable(false); setLoading(true); }}
+ onEdit={() => {
+ setDisable(true);
+ setData(data);
+ }}
+ />
+
+
+ );
+};
+export default Index;
\ No newline at end of file
diff --git a/src/pages/pms/setting/PerTarget/api.ts b/src/pages/pms/setting/PerTarget/api.ts
new file mode 100644
index 0000000..4de00a6
--- /dev/null
+++ b/src/pages/pms/setting/PerTarget/api.ts
@@ -0,0 +1,36 @@
+import { http } from '@/typing/http';
+import request from '@/utils/request';
+import { PMS_HOST } from '@/utils/host';
+
+export interface Item {
+ id?: number,
+ amount?: number, //
+ days?: number
+ storageId?: number// 员工调运费用, 1.5元 / 公里
+ shopId?: number // 备料时效
+ storageName?: string
+ shopName?: string
+}
+interface Params {
+ shopId?:number
+ keywords?:string
+ storageId?:number
+}
+/**
+ * 查询绩效--目标设置明细
+ */
+export function getDetail(params: Params): http.PromiseResp- {
+ return request.get(`${PMS_HOST}/erp/target/setting/get/list`, { params });
+}
+/**
+ * 新增或编辑绩效--目标设置明细
+ */
+export function saveApi(params: Item) {
+ return request.post(`${PMS_HOST}/erp/target/setting/add/or/update`, params);
+}
+/**
+ * 删除绩效--目标设置明细
+ */
+export function DeleteApi(params: {id?: number}) {
+ return request.post(`${PMS_HOST}/erp/target/setting/delete`, params, {contentType: 'form-urlencoded'});
+}
diff --git a/src/pages/pms/setting/PerTarget/components/AddModal.tsx b/src/pages/pms/setting/PerTarget/components/AddModal.tsx
new file mode 100644
index 0000000..9cdd2e0
--- /dev/null
+++ b/src/pages/pms/setting/PerTarget/components/AddModal.tsx
@@ -0,0 +1,75 @@
+import React, { useEffect } from 'react';
+import {Modal, Form, InputNumber, message} from 'antd';
+import PmsSelsct from '@/pages/pms/comonents/PmsSelect';
+import { getStoragePage } from '@/pages/pms/storage/StorageManage/api';
+import usePagination from '@/hooks/usePagination';
+import { saveApi } from '../api';
+
+const {Item} = Form;
+
+interface Props {
+ item:any
+ visible:boolean
+ onCancel:Function
+ refesh:Function
+}
+
+export default function Index(props: Props) {
+ const { item, onCancel, visible, refesh } = props;
+ const [form] = Form.useForm();
+ const { list: storages } = usePagination(getStoragePage, { pageSize: 1000 });
+
+ const OK = () => {
+ form.validateFields().then(fileds => {
+ const params = {
+ id: item?.id,
+ storageId: fileds.storageId,
+ days: fileds.days,
+ amount: fileds.amount
+ };
+ saveApi(params).then(res => {
+ message.success("提交成功");
+ onCancel();
+ refesh();
+ }).catch(e => {
+ message.error(e.message);
+ });
+ });
+ };
+
+ useEffect(() => {
+ if (visible && item.id) {
+ form.setFieldsValue({
+ ...item
+ });
+ }
+ if (!visible) {
+ form.resetFields();
+ }
+ }, [visible]);
+
+ return (
+ onCancel()}
+ onOk={() => OK()}
+ title={item.id ? '编辑' : '新增'}
+ >
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/pages/pms/setting/PerTarget/index.tsx b/src/pages/pms/setting/PerTarget/index.tsx
new file mode 100644
index 0000000..49cd1ee
--- /dev/null
+++ b/src/pages/pms/setting/PerTarget/index.tsx
@@ -0,0 +1,58 @@
+import React, { useState } from 'react';
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
+import { Table, Button, Card, Popconfirm, Divider, message } from 'antd';
+import AddModal from './components/AddModal';
+import {Item, getDetail, DeleteApi} from './api';
+import useInitial from '@/hooks/useInitail';
+
+const {Column} = Table;
+
+const Index = () => {
+ const [current, setCurrent] = useState<{visible:boolean, item?:any}>({visible: false, item: {}});
+ const { data, loading, setParams } = useInitial
- (getDetail, [], {});
+
+ const dele = (id?: number) => {
+ DeleteApi({id}).then(res => {
+ message.success('操作成功');
+ setParams({}, true);
+ }).catch(e => message.error(e.message));
+ };
+
+ return (
+
+
+
+
+
+
+ setCurrent({visible: false, item: {}})} refesh={() => setParams({}, true)} />
+
+
+ );
+};
+export default Index;
\ No newline at end of file
diff --git a/src/pages/pms/setting/PlanSetting/index.tsx b/src/pages/pms/setting/PlanSetting/index.tsx
index d27b0b7..fd87a6f 100644
--- a/src/pages/pms/setting/PlanSetting/index.tsx
+++ b/src/pages/pms/setting/PlanSetting/index.tsx
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
-import { Card, InputNumber, message, Radio } from 'antd';
+import { Card, InputNumber, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import useInitail from '@/hooks/useInitail';
import ConfirmBnt from '../components/ConfirmBnt';
@@ -65,12 +65,6 @@ export default function Index() {
/>
,配件计划不审批
- 4、计划员能否修改订件的错误配件编码:
- setData({ ...data, editBuyPartCode: !!v.target.value})}>
- 是
- 否
-
-