提交 875a03f0 作者: 龚洪江

修复:新增商品,规格必须配置价格

上级 8b9b3b60
...@@ -411,12 +411,13 @@ export type serviceOrderType = InterItemFunction< ...@@ -411,12 +411,13 @@ export type serviceOrderType = InterItemFunction<
orderName: string; orderName: string;
orderNo: string; orderNo: string;
orderStatus: number; orderStatus: number;
images: string[]; coverPlan: string;
orderAmt: number; orderAmt: number;
phoneNum: string; phoneNum: string;
uid: string; uid: string;
createdTime: string; createdTime: string;
userName: string; userName: string;
nickName: string;
}[] }[]
>; >;
// 服务-订单字典 // 服务-订单字典
......
...@@ -89,6 +89,7 @@ export type ProductSpecListType = InterItemFunction< ...@@ -89,6 +89,7 @@ export type ProductSpecListType = InterItemFunction<
specName: string; specName: string;
versionDesc: string; versionDesc: string;
productSkuId: number; productSkuId: number;
priceList: any;
}[] }[]
>; >;
//产品-规格-新增 //产品-规格-新增
......
...@@ -175,16 +175,16 @@ const AddOrEditSkuModal: React.FC<ModalProps & selfProps> = ({ ...@@ -175,16 +175,16 @@ const AddOrEditSkuModal: React.FC<ModalProps & selfProps> = ({
getProductSpecList(id); getProductSpecList(id);
}; };
// // 选项来源选中 // // 选项来源选中
// const handleSourceSelect = (id: number | string) => { const handleSourceSelect = (id: number | string) => {
// const values: any[] = skuForm.getFieldValue('specIds'); const values: any[] = skuForm.getFieldValue('specIds');
// const obj = optionSource.find((v: sourceEntity) => v.id === id); const obj = productSpecList.find((v) => v.id === id);
// if (!obj?.priceList) { if (!obj?.priceList) {
// message.warning('所选规格来源未配置好价格,请配置好SKU价格后重新选择!'); message.warning('所选规格来源未配置好价格,请配置好SKU价格后重新选择!');
// const index: number = values.findIndex((i: number) => i === id); const index: number = values.findIndex((i: number) => i === id);
// values.splice(index, 1); values.splice(index, 1);
// } }
// skuForm.setFieldValue('specIds', values); skuForm.setFieldValue('specIds', values);
// }; };
// // 规格来源切换 // // 规格来源切换
const skuSourceRadioChange = (e: RadioChangeEvent) => { const skuSourceRadioChange = (e: RadioChangeEvent) => {
setIsCustomProd(e.target.value === 1); setIsCustomProd(e.target.value === 1);
...@@ -226,8 +226,7 @@ const AddOrEditSkuModal: React.FC<ModalProps & selfProps> = ({ ...@@ -226,8 +226,7 @@ const AddOrEditSkuModal: React.FC<ModalProps & selfProps> = ({
setProductSpecList(result.list || []); setProductSpecList(result.list || []);
if (result.list) { if (result.list) {
const ids: number[] = result.list.reduce((pre: number[], cur) => { const ids: number[] = result.list.reduce((pre: number[], cur) => {
// return cur.priceList ? [...pre, cur.id] : pre; return cur.priceList || goodsType === 1 ? [...pre, cur.id] : pre;
return [...pre, cur.id];
}, []); }, []);
skuForm.setFieldValue('specIds', ids); skuForm.setFieldValue('specIds', ids);
} }
...@@ -597,7 +596,7 @@ const AddOrEditSkuModal: React.FC<ModalProps & selfProps> = ({ ...@@ -597,7 +596,7 @@ const AddOrEditSkuModal: React.FC<ModalProps & selfProps> = ({
placeholder='请选择选项来源' placeholder='请选择选项来源'
allowClear allowClear
mode='multiple' mode='multiple'
// onSelect={handleSourceSelect} onSelect={handleSourceSelect}
> >
{productSpecList.map((item: any) => ( {productSpecList.map((item: any) => (
<Select.Option value={item.id} key={item.id} disabled={item.disabled}> <Select.Option value={item.id} key={item.id} disabled={item.disabled}>
......
...@@ -170,7 +170,7 @@ const GoodsList = () => { ...@@ -170,7 +170,7 @@ const GoodsList = () => {
if (result) { if (result) {
const options = result.map((v) => ({ id: v.id, name: v.directoryName })); const options = result.map((v) => ({ id: v.id, name: v.directoryName }));
searchColumns[1].options = options; searchColumns[1].options = options;
setSearchColumns(searchColumns); setSearchColumns([...searchColumns]);
} }
}); });
}; };
......
...@@ -165,11 +165,11 @@ const RentList = () => { ...@@ -165,11 +165,11 @@ const RentList = () => {
}; };
//获取目录列表 //获取目录列表
const getDirectoryList = () => { const getDirectoryList = () => {
CategoryManageAPI.getDirectoryListClone({ type: 4 }).then(({ result }) => { CategoryManageAPI.getDirectoryListClone({ type: 2 }).then(({ result }) => {
if (result) { if (result) {
const options = result.map((v) => ({ id: v.id, name: v.directoryName })); const options = result.map((v) => ({ id: v.id, name: v.directoryName }));
searchColumns[1].options = options; searchColumns[1].options = options;
setSearchColumns(searchColumns); setSearchColumns([...searchColumns]);
} }
}); });
}; };
......
...@@ -2,8 +2,7 @@ import { useEffect, useState } from 'react'; ...@@ -2,8 +2,7 @@ import { useEffect, useState } from 'react';
import SearchBox from '~/components/search-box'; import SearchBox from '~/components/search-box';
import { Button, Image, Table } from 'antd'; import { Button, Image, Table } from 'antd';
import { ColumnsType } from 'antd/es/table'; import { ColumnsType } from 'antd/es/table';
import { useNavigate } from 'react-router-dom'; // import { useNavigate } from 'react-router-dom';
import qs from 'query-string';
import { OrderManageAPI } from '~/api'; import { OrderManageAPI } from '~/api';
import { InterDataType, InterReqType, PaginationProps } from '~/api/interface'; import { InterDataType, InterReqType, PaginationProps } from '~/api/interface';
import { serviceOrderStatusType, serviceOrderType } from '~/api/interface/orderManageType'; import { serviceOrderStatusType, serviceOrderType } from '~/api/interface/orderManageType';
...@@ -27,7 +26,7 @@ const statusCodeButtonList = [ ...@@ -27,7 +26,7 @@ const statusCodeButtonList = [
function ServiceOrderView() { function ServiceOrderView() {
// 路由钩子 // 路由钩子
const navigate = useNavigate(); // const navigate = useNavigate();
// 当前选择的是第几个按钮 // 当前选择的是第几个按钮
const [statusCodeButtonIndex, setStatusCodeButtonIndex] = useState<number>(0); const [statusCodeButtonIndex, setStatusCodeButtonIndex] = useState<number>(0);
// 表格分页配置 // 表格分页配置
...@@ -49,7 +48,7 @@ function ServiceOrderView() { ...@@ -49,7 +48,7 @@ function ServiceOrderView() {
width: 250, width: 250,
render: (_text, record) => ( render: (_text, record) => (
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
{/*<Image src={record.images[0]} style={{ width: 48, height: 48 }} />*/} <Image src={record.coverPlan} style={{ width: 48, height: 48 }} />
<div style={{ marginLeft: 10, textAlign: 'left', lineHeight: '16px' }}> <div style={{ marginLeft: 10, textAlign: 'left', lineHeight: '16px' }}>
<div style={{ color: '#1677ff' }}>{record.orderName}</div> <div style={{ color: '#1677ff' }}>{record.orderName}</div>
<div>订单编号:{record.orderNo}</div> <div>订单编号:{record.orderNo}</div>
...@@ -72,12 +71,12 @@ function ServiceOrderView() { ...@@ -72,12 +71,12 @@ function ServiceOrderView() {
{ {
title: '买家', title: '买家',
align: 'center', align: 'center',
width: '130px', width: '150px',
render: (_text, record) => ( render: (_text, record) => (
<> <>
<div>{record.uid}</div> <div>{record.uid}</div>
<div> <div>
{record.userName}({record.phoneNum}) {record.userName || record.nickName}({record.phoneNum})
</div> </div>
</> </>
), ),
...@@ -143,9 +142,9 @@ function ServiceOrderView() { ...@@ -143,9 +142,9 @@ function ServiceOrderView() {
}); });
}; };
// 跳转订单详情 // 跳转订单详情
const handleDetail = (record: TableType[0]) => { // const handleDetail = (record: TableType[0]) => {
navigate(`/orderManage/serviceOrder/detail?${qs.stringify({ id: record.id })}`); // navigate(`/orderManage/serviceOrder/detail?${qs.stringify({ id: record.id })}`);
}; // };
//服务订单列表 //服务订单列表
const getServiceOrderList = (query?: serviceOrderTypeParameters) => { const getServiceOrderList = (query?: serviceOrderTypeParameters) => {
OrderManageAPI.getServiceOrderList({ OrderManageAPI.getServiceOrderList({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论