diff --git a/src/pages/contract/BearCostSetting/components/SaveModal/index.tsx b/src/pages/contract/BearCostSetting/components/SaveModal/index.tsx index 183558d..93f120f 100644 --- a/src/pages/contract/BearCostSetting/components/SaveModal/index.tsx +++ b/src/pages/contract/BearCostSetting/components/SaveModal/index.tsx @@ -122,7 +122,7 @@ const SaveModal = ({visible, onCancel, onRefresh}:Props) => { onSelect={(it:any) => { const item = feetypeList.filter(i => it.value === i.typeValue); const {compTypes, roleCodes} = item[0]; - setData({...data, compTypes, roleCodes}); + setData({...data, compTypes, roleCodes, typeValue: it.value}); setDisabled(false); }} filterOption={(input, option: any) => option?.children.indexOf(input) >= 0} @@ -210,7 +210,7 @@ const SaveModal = ({visible, onCancel, onRefresh}:Props) => { { - paymentMode == 2 && ( + paymentMode == 2 && ['RP00000053', 'RP00000066', 'RP00000067'].includes(data.typeValue || '') && ( ) { const params = useScene === 1 ? { workTypes: "1,2,5,9" } : { workType: useScene }; const { loading, setLoading, list, setParams, paginationConfig, innerParams } = usePagination(API.fetchListApi, params); const { data: brandList } = useInitial(getBrandFilterApi, [], {}); + const [seriesList, setSeriesList] = useState([]); const [visible, setVisible] = useState(false); const [listData, setListData] = useState([]); - const [keyWords, setKeyWords] = useState(''); - const keyWordsTerm = useDebounce(keyWords, 800); useEffect(() => { value && setListData(value.map((v: any) => ({ itemCode: v.applyValue, itemName: v.applyName }))); }, []); - useEffect(() => { - setParams({ keywords: keyWordsTerm || undefined, current: 1 }, true); - }, [keyWordsTerm]); + function getSeries(brandId: number) { + getSeriesApi(brandId).then((res) => { + setSeriesList(res.data || []); + }).catch((err) => { + message.error(err.message); + }); + } + const onFilter = debounce((params) => setParams({ ...innerParams, ...params }, true), 600); function selectedItems(value: any[]) { const partIds = value.length && value.map((i: any) => i.applyValue).toString(); API.fetItemsApi({ partIds }).then(res => { @@ -93,7 +97,7 @@ function PartItem(props: Props, ref?: Ref) { width="20%" render={(text, record: IF.ListVO) => { return ( - remove(record.itemCode)}>删除 + remove(record.itemCode!)}>删除 ); }} /> @@ -120,16 +124,38 @@ function PartItem(props: Props, ref?: Ref) { showSearch allowClear placeholder="搜索品牌" - style={{ width: 200, marginRight: 15 }} - onChange={(value) => setParams({ ...innerParams, brandId: value }, true)} + style={{ width: 200, margin: 5 }} + onChange={(value) => { + setParams({ ...innerParams, brandId: value }, true); + getSeries(value); + }} > {brandList.map((item) => {item.name})} , + , setKeyWords(e.target.value)} + onChange={(e) => onFilter({ keywords: e.target.value })} + />, + onFilter({ specCode: e.target.value })} /> ]} /> diff --git a/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/interface.d.ts b/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/interface.d.ts index 4230867..dbcb0a3 100644 --- a/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/interface.d.ts +++ b/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/interface.d.ts @@ -3,7 +3,8 @@ export interface QueryList { workType?: number, //作业项类型 1:机修 2:电器 3:钣喷 4:装潢 5:基础保养 6:贴膜 workTypes?: string, //多个作业项组合参数 keywords?: string, //关键词 - specGroupCode?: string, //车型分组代码 + seriesIds?:string, //车系id集合,查询多个车系 + specCode?: string, //整车代码 current?: number, pageSize?: number, seriesId?: number, @@ -48,51 +49,51 @@ export interface PartListVO { /**查询保养套餐卡列表通用接口 */ export interface MpList { - id: number, //null - maintainId: number, //套餐卡配置ID - name: string, //套餐卡名称 - remark: string, // 备注 - times: number, // 套餐次数 - validity: number, // 有效期(年) - mainItemCode: string, //机油项编码 - mainItemName: string, // 机油项名称 - groupId: number, //集团id - brandName: string, //品牌名称 - seriesName: string, //车系名称 - status: number, //状态 1待发布 2已发布 3已下架 + id: number, //null + maintainId: number, //套餐卡配置ID + name: string, //套餐卡名称 + remark: string, // 备注 + times: number, // 套餐次数 + validity: number, // 有效期(年) + mainItemCode: string, //机油项编码 + mainItemName: string, // 机油项名称 + groupId: number, //集团id + brandName: string, //品牌名称 + seriesName: string, //车系名称 + status: number, //状态 1待发布 2已发布 3已下架 } /**保养套餐卡查询条件 */ export interface Params { - mpName?: string, // 套餐名称 - startDate?: number, // 创建日期开始 - endDate?: number, // 创建日期结束 + mpName?: string, // 套餐名称 + startDate?: number, // 创建日期开始 + endDate?: number, // 创建日期结束 brandId?: string, //品牌ID - status?: number, // 状态 1:待发布 4:已发 + status?: number, // 状态 1:待发布 4:已发 current?: number, pageSize?: number, } /**查询集团VIP卡列表 */ export interface VipList { - id: number, //null - warrantyId: number, // 质保卡id - name: string, // 质保卡名称 - price: number, // 价格 - remark: string, //备注 - groupId: number, //集团id - brandId: number, //品牌id - brandName: string, //品牌名称 - seriesId: number, //车系id - seriesName: string, // 车系名称 - status: number, //状态 1 待上架 2 已上架 2 已下架 + id: number, //null + warrantyId: number, // 质保卡id + name: string, // 质保卡名称 + price: number, // 价格 + remark: string, //备注 + groupId: number, //集团id + brandId: number, //品牌id + brandName: string, //品牌名称 + seriesId: number, //车系id + seriesName: string, // 车系名称 + status: number, //状态 1 待上架 2 已上架 2 已下架 } /**vip卡查询条件 */ export interface VipParams { - brandId?: number, // 品牌ID - status?: number, // 状态 1:待发布 4:已发 + brandId?: number, // 品牌ID + status?: number, // 状态 1:待发布 4:已发 current?: number, pageSize?: number, - name?: number, //质保卡名称 + name?: number, //质保卡名称 } diff --git a/src/pages/pms/partPlan/AmountPlan/subpages/Second/components/AreaTable.tsx b/src/pages/pms/partPlan/AmountPlan/subpages/Second/components/AreaTable.tsx index 414d810..55ef642 100644 --- a/src/pages/pms/partPlan/AmountPlan/subpages/Second/components/AreaTable.tsx +++ b/src/pages/pms/partPlan/AmountPlan/subpages/Second/components/AreaTable.tsx @@ -32,7 +32,7 @@ export default function Index(props: Props = {}) { (t || 0).toFixed(2)} /> (t || 0).toFixed(2)} /> - (t || 0).toFixed(2)} /> + (t || 0).toFixed(2)} /> {showAnalyse && ( <> - - - (t || 0).toFixed(2)} /> (t || 0).toFixed(2)} /> - (t || 0).toFixed(2)} /> + (t || 0)} /> {showAnalyse && ( <> (t || 0).toFixed(2)} /> (t || 0).toFixed(2)} /> - (t || 0).toFixed(2)} /> + (t || 0).toFixed(2)} /> {showAnalyse && ( <> (t || 0).toFixed(2)} /> (t || 0).toFixed(2)} /> - (t || 0).toFixed(2)} /> + (t || 0).toFixed(2)} /> {showAnalyse && ( <> - t || '--'} /> - - t || '--'} /> - - { - const c = (_.cnt || 0) - (_.count || 0); - return c == 0 ? '' : `${c > 0 ? '增' : '减'}${Math.abs(c)}`; - }} - /> - + getPart(p)} /> - ({ @@ -74,7 +74,7 @@ export default function Index({ onCancel, visible, onOk, partParams }: Props) { - + diff --git a/src/pages/pms/storage/partShop/components/PartShopModal.tsx b/src/pages/pms/storage/partShop/components/PartShopModal.tsx index 56ef65b..9223318 100644 --- a/src/pages/pms/storage/partShop/components/PartShopModal.tsx +++ b/src/pages/pms/storage/partShop/components/PartShopModal.tsx @@ -18,31 +18,10 @@ export default function PartShopModal() { } else { setIsadd(false); setIsprice(false); - form.setFieldsValue({ - costPrice: "", - stock: 0, - lockStock: 0, - shopId: "", - part: "", - user: "", - fixRemark: "" - }); - } - }, [visible]); - - useEffect(() => { - if (isadd) { setItem({}); - console.log(isadd, item); - form.setFieldsValue({ - costPrice: "", - stock: 0, - lockStock: 0, - shopId: "", - part: "" - }); + form.resetFields(); } - }, [isadd]); + }, [visible]); const handleSubmit = () => { form.validateFields().then(values => { @@ -50,11 +29,12 @@ export default function PartShopModal() { ...item, partId: values.part.partId, costPrice: values.costPrice, - stock: values.stock, - lockStock: values.lockStock, + stock: values.stock || 0, + lockStock: values.lockStock || 0, shopId: values.shopId, user: values.user, - fixRemark: values.fixRemark + fixRemark: values.fixRemark, + type: isadd ? 1 : isprice ? 3 : 2 }; setConfirmLoading(true); savePartShopApi(params).then(res => { @@ -76,8 +56,7 @@ export default function PartShopModal() { const validatorLockStock = (rule: any, value: number) => { if (value > form.getFieldsValue(['stock']).stock) { - // eslint-disable-next-line prefer-promise-reject-errors - return Promise.reject('锁定库存不能超过总库存数量!'); + return Promise.reject(new Error('锁定库存不能超过总库存数量!')); } else return Promise.resolve(); }; @@ -113,13 +92,13 @@ export default function PartShopModal() { - + - - + + - - + + {!!fw && !isprice && !isadd && ( diff --git a/src/pages/pms/storage/partShop/interface.d.ts b/src/pages/pms/storage/partShop/interface.d.ts index c1aaa14..bcf46f4 100644 --- a/src/pages/pms/storage/partShop/interface.d.ts +++ b/src/pages/pms/storage/partShop/interface.d.ts @@ -34,6 +34,7 @@ declare namespace PmsStoragePartShop { shopId?: number, // 服务站ID user?: string //修改人名称 fixRemark?: string //修改原因 + type?: number //类型1新增2修改库存3修改价格 } interface Option {