提交 df9f9e70 作者: ZhangLingKun

功能:服务问题修复

上级 824b78c9
......@@ -349,6 +349,7 @@ function ServiceDetailView() {
options={industryList}
allowClear
onChange={(e) => {
form.setFieldValue('inspectionTagId', undefined);
if (e.length === 2) setInspectionId(Number(e?.at(-1)));
}}
/>
......
......@@ -130,9 +130,22 @@ const ServiceListView = () => {
},
});
};
// 价格单位列表
const [priceUnitList, setPriceUnitList] = useState<{ id: number; unitName: string }[]>([]);
// 获取价格单位
const getPriceUnit = async () => {
const res = await MallManageAPI.listInspectionPriceUnit({});
if (res && res.code === '200') {
setPriceUnitList(res.result || []);
}
};
// 获取商品的价格单位
const getPriceUnitStr = (i: TableType[0]) =>
priceUnitList.find((j) => j.id === i?.inspectionPriceUnitId)?.unitName || '';
// 组件挂载
useEffect(() => {
getIndustryList().then();
getPriceUnit().then();
getTableList().then();
}, []);
// 表格结构
......@@ -183,7 +196,11 @@ const ServiceListView = () => {
title: '价格',
dataIndex: 'price',
align: 'center',
render: (text) => <>{text.toLocaleString()}</>,
render: (text, record) => (
<>
{text.toLocaleString()}/{getPriceUnitStr(record)}
</>
),
},
{
title: '状态',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论