提交 ff9a4444 作者: 龚洪江

修复:库存必填,规格图片回显问题

上级 8a64ef79
......@@ -184,6 +184,8 @@ export type listCompanyRemove = InterFunction<
},
NonNullable<unknown>
>;
//单位-详情
export type getCompanyInfoByIdType = InterFunction<{ id: number }, any>;
//账号权限-列表
export type listRoleInfoPageType = InterItemFunction<
{ numberOrName?: string },
......
import {
deleteRoleInfoType,
getCompanyInfoByIdType,
getSecondDistrictInfo,
insertBAccountType,
insertRoleInfoType,
......@@ -58,6 +59,9 @@ export class SystemManageAPI {
// 单位-删除
static listCompanyRemove: listCompanyRemove = (params) =>
axios.get('/userapp/company/remove', { params });
//单位-详情
static getCompanyInfoById: getCompanyInfoByIdType = (params) =>
axios.get('/userapp/company/getCompanyInfoById', { params });
// 单位-区域
static getSecondDistrictInfo: getSecondDistrictInfo = (params) =>
......
......@@ -70,7 +70,7 @@ const SkuAddOrEditModal: FC<ModalProps & selfProps> = ({
return Promise.reject(new Error('请输入正整数'));
}
} else {
return Promise.resolve();
return Promise.reject(new Error('请输入库存'));
}
};
......@@ -314,14 +314,16 @@ const SkuAddOrEditModal: FC<ModalProps & selfProps> = ({
setTableData(
currentSku.goodsSpecValuesList.map((v: any) => ({
...v,
fileList: [
{
id: Math.random(),
uid: Math.random(),
url: v.specValueImage,
name: 'specValueImage',
},
],
fileList: v.specValueImage
? [
{
id: Math.random(),
uid: Math.random(),
url: v.specValueImage,
name: 'specValueImage',
},
]
: [],
})),
);
const goodsSpecValuesObj = currentSku.goodsSpecValuesList.reduce((pre: any, cur: any) => {
......
import { useSearchParams } from 'react-router-dom';
import { useEffect, useState } from 'react';
import { SystemManageAPI } from '~/api';
const CompanyDetail = () => {
const [searchParams] = useSearchParams();
const [companyId, setCompanyId] = useState<number>(-1);
//单位详情
const getCompanyDetailInfo = (id: number) => {
SystemManageAPI.getCompanyInfoById({ id }).then(({ result }) => {});
};
useEffect(() => {
setCompanyId(Number(searchParams.get('id')));
getCompanyDetailInfo(Number(searchParams.get('id')));
}, []);
return <div className='company-detail'>单位详情</div>;
return (
<div className='company-detail'>
<div className='company-detail-info'></div>
</div>
);
};
export default CompanyDetail;
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论