Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
ae793c0d
提交
ae793c0d
authored
7月 05, 2023
作者:
龚洪江
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:服务关联单位,产品修改
上级
fb31c48d
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
108 行增加
和
110 行删除
+108
-110
mallManageType.ts
src/api/interface/mallManageType.ts
+4
-0
produceManageType.ts
src/api/interface/produceManageType.ts
+4
-3
index.tsx
...ponents/goods/commonAddOrEdit/addOrEditSkuModal/index.tsx
+37
-40
index.tsx
...ges/mallManage/mallGoods/goodsAddOrEditOrDetail/index.tsx
+1
-3
index.tsx
src/pages/mallManage/produceManage/produceDetail/index.tsx
+3
-2
index.tsx
...ge/produceList/components/addOrEditProduceModal/index.tsx
+10
-47
index.tsx
src/pages/mallManage/produceManage/produceList/index.tsx
+12
-13
index.tsx
src/pages/mallManage/serviceManage/serviceDetail/index.tsx
+1
-0
index.tsx
...ge/serviceList/components/addOrEditServiceModal/index.tsx
+35
-1
index.tsx
src/pages/mallManage/serviceManage/serviceList/index.tsx
+1
-1
没有找到文件。
src/api/interface/mallManageType.ts
浏览文件 @
ae793c0d
...
...
@@ -108,6 +108,7 @@ export type addServiceType = InterFunction<
serviceName
:
string
;
shareCard
?:
string
;
video
?:
string
;
companyId
:
number
;
},
any
>
;
...
...
@@ -123,6 +124,7 @@ export type editServiceType = InterFunction<
shareCard
?:
string
;
video
?:
string
;
id
:
number
;
companyId
:
number
;
},
any
>
;
...
...
@@ -141,6 +143,7 @@ export type serviceType = InterItemFunction<
applicationId
:
number
;
industryId
:
number
;
id
:
number
;
companyId
:
number
;
}[]
>
;
//服务-上下架-批量
...
...
@@ -165,5 +168,6 @@ export type serviceDetailType = InterFunction<
applicationId
:
number
;
industryId
:
number
;
id
:
number
;
companyName
:
string
;
}
>
;
src/api/interface/produceManageType.ts
浏览文件 @
ae793c0d
...
...
@@ -10,7 +10,7 @@ export type MakeListType = InterItemFunction<
>
;
//产品-列表
export
type
productListType
=
InterItemFunction
<
{
categoryId
?:
number
;
directoryId
?:
number
;
productName
?:
string
},
{
type
?:
number
;
productName
?:
string
},
{
id
:
number
;
productName
:
string
;
...
...
@@ -21,6 +21,7 @@ export type productListType = InterItemFunction<
categoryName
:
string
;
directoryId
:
number
;
directoryName
:
string
;
type
:
number
;
productSpecList
:
{
id
:
number
;
partNo
:
string
;
...
...
@@ -34,8 +35,7 @@ export type productListType = InterItemFunction<
//产品-新增
export
type
addProductType
=
InterFunction
<
{
categoryId
:
number
;
directoryId
:
number
;
type
:
number
;
model
:
string
;
productBrandId
:
number
;
productName
:
string
;
...
...
@@ -77,6 +77,7 @@ export type productDetailType = InterFunction<
versionDesc
:
string
;
productSkuId
:
number
;
}[];
type
:
number
;
}
>
;
//产品-规格-列表
...
...
src/components/goods/commonAddOrEdit/addOrEditSkuModal/index.tsx
浏览文件 @
ae793c0d
...
...
@@ -313,47 +313,44 @@ const AddOrEditSkuModal: React.FC<ModalProps & selfProps> = ({
};
// 点击确定,触发表单验证
const
submitSku
=
()
=>
{
skuForm
.
validateFields
()
.
then
(
async
(
values
)
=>
{
if
(
!
isCustomProd
)
{
let
productObj
:
productType
[
0
]
|
undefined
=
undefined
;
switch
(
currentDesc
)
{
case
2
:
// const schemeObj = schemeList.find((i) => i.id === values.skuId);
// values.skuName = schemeObj?.solutionName;
break
;
default
:
productObj
=
productList
.
find
((
i
)
=>
i
.
id
===
values
.
skuId
);
values
.
skuName
=
productObj
?.
productName
;
}
values
.
specIds
=
values
.
specIds
.
reduce
((
pre
:
any
,
cur
:
number
|
string
)
=>
{
const
sourceObj
=
productSpecList
.
find
((
i
)
=>
i
.
id
===
cur
);
const
specObj
:
any
=
curtRowData
?.
specIds
&&
curtRowData
?.
specIds
.
find
((
i
:
any
)
=>
i
.
mallSpecId
===
cur
);
pre
.
push
({
mallSpecId
:
cur
,
specName
:
sourceObj
?.
specName
,
partNo
:
sourceObj
?.
partNo
,
id
:
specObj
?
specObj
.
id
:
undefined
,
});
return
pre
;
},
[]);
handleOk
({
...
values
,
id
:
curtRowData
?.
id
||
Math
.
random
()
});
}
else
{
const
res
:
any
=
await
Promise
.
all
([
validateCustomForm
()]);
handleOk
({
...
values
,
customizeInfo
:
res
[
0
],
id
:
curtRowData
?.
id
||
Math
.
random
(),
skuId
:
curtRowData
?.
skuId
,
skuName
:
values
.
productName
,
delProductSpecId
:
selfIds
,
});
skuForm
.
validateFields
().
then
(
async
(
values
)
=>
{
if
(
!
isCustomProd
)
{
let
productObj
:
productType
[
0
]
|
undefined
=
undefined
;
switch
(
currentDesc
)
{
case
2
:
// const schemeObj = schemeList.find((i) => i.id === values.skuId);
// values.skuName = schemeObj?.solutionName;
break
;
default
:
productObj
=
productList
.
find
((
i
)
=>
i
.
id
===
values
.
skuId
);
values
.
skuName
=
productObj
?.
productName
;
}
// onCancel();
})
.
catch
(()
=>
{});
values
.
specIds
=
values
.
specIds
.
reduce
((
pre
:
any
,
cur
:
number
|
string
)
=>
{
const
sourceObj
=
productSpecList
.
find
((
i
)
=>
i
.
id
===
cur
);
const
specObj
:
any
=
curtRowData
?.
specIds
&&
curtRowData
?.
specIds
.
find
((
i
:
any
)
=>
i
.
mallSpecId
===
cur
);
pre
.
push
({
mallSpecId
:
cur
,
specName
:
sourceObj
?.
specName
,
partNo
:
sourceObj
?.
partNo
,
id
:
specObj
?
specObj
.
id
:
undefined
,
});
return
pre
;
},
[]);
handleOk
({
...
values
,
id
:
curtRowData
?.
id
||
Math
.
random
()
});
}
else
{
const
res
:
any
=
await
Promise
.
all
([
validateCustomForm
()]);
handleOk
({
...
values
,
customizeInfo
:
res
[
0
],
id
:
curtRowData
?.
id
||
Math
.
random
(),
skuId
:
curtRowData
?.
skuId
,
skuName
:
values
.
productName
,
delProductSpecId
:
selfIds
,
});
}
// onCancel();
});
// 验证自定义表单
const
validateCustomForm
:
any
=
()
=>
{
...
...
src/pages/mallManage/mallGoods/goodsAddOrEditOrDetail/index.tsx
浏览文件 @
ae793c0d
...
...
@@ -205,9 +205,7 @@ const GoodsAddOrEditOrDetail = () => {
});
cusPre
=
[
...
cusPre
,
bol
?
filterObjAttr
({
...
cusCur
,
id
:
cusCur
.
productSpec
},
[
'fileList'
])
:
filterObjAttr
(
cusCur
,
[
'id'
,
'fileList'
]),
bol
?
filterObjAttr
(
cusCur
,
[
'fileList'
])
:
filterObjAttr
(
cusCur
,
[
'id'
,
'fileList'
]),
];
return
cusPre
;
},
[]);
...
...
src/pages/mallManage/produceManage/produceDetail/index.tsx
浏览文件 @
ae793c0d
...
...
@@ -193,8 +193,9 @@ function ProduceDetail() {
}
>
<
Descriptions
.
Item
label=
'产品名称'
>
{
detailData
?.
productName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'产品目录'
>
{
detailData
?.
directoryName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'产品类型'
>
{
detailData
?.
categoryName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'归属商品'
>
{
detailData
?.
type
===
1
?
'租赁商品'
:
detailData
?.
type
===
0
?
'商城商品'
:
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'型号'
>
{
detailData
?.
model
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'产品品牌'
>
{
detailData
?.
productBrand
}
</
Descriptions
.
Item
>
</
Descriptions
>
...
...
src/pages/mallManage/produceManage/produceList/components/addOrEditProduceModal/index.tsx
浏览文件 @
ae793c0d
...
...
@@ -13,7 +13,7 @@ type addMakeParameterType = InterReqType<addProductType>;
interface
PropsType
{
closed
:
()
=>
void
;
data
:
(
addMakeParameterType
&
{
id
:
number
;
categoriesId
:
number
})
|
undefined
;
data
:
(
addMakeParameterType
&
{
id
:
number
})
|
undefined
;
makeList
:
makeListType
;
onOk
:
()
=>
void
;
}
...
...
@@ -25,8 +25,6 @@ const AddOrEditProduceModal: FC<ModalProps & PropsType> = ({
makeList
,
onOk
,
})
=>
{
// 产品类型下拉列表
// const [productTypeSelectList, setProductTypeSelectList] = useState<categoryType>([]);
// 表格事件
const
[
form
]
=
Form
.
useForm
<
addMakeParameterType
>
();
// 关闭弹窗
...
...
@@ -54,14 +52,6 @@ const AddOrEditProduceModal: FC<ModalProps & PropsType> = ({
message
.
warning
(
err
.
errorFields
[
0
].
errors
[
0
]).
then
();
});
};
//根据目录获取分类
// const getCategoryListByDirectory = (directoryId: number) => {
// CategoryManageAPI.getCategoryList({ pageNo: 1, pageSize: 99999, directoryId, type: 4 }).then(
// ({ result }) => {
// setProductTypeSelectList(result.list || []);
// },
// );
// };
// componentsDidMounted
useEffect
(()
=>
{
if
(
data
)
{
...
...
@@ -94,43 +84,16 @@ const AddOrEditProduceModal: FC<ModalProps & PropsType> = ({
>
<
Input
placeholder=
'请输入产品名称'
allowClear
maxLength=
{
30
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'归属商品'
>
<
Select
.
Option
value=
{
1
}
>
商城商品
</
Select
.
Option
>
<
Select
.
Option
value=
{
2
}
>
租赁商品
</
Select
.
Option
>
<
Form
.
Item
label=
'归属商品'
name=
'type'
rules=
{
[{
required
:
true
,
message
:
'请选择归属商品'
}]
}
>
<
Select
placeholder=
'请选择归属商品'
>
<
Select
.
Option
value=
{
0
}
>
商城商品
</
Select
.
Option
>
<
Select
.
Option
value=
{
1
}
>
租赁商品
</
Select
.
Option
>
</
Select
>
</
Form
.
Item
>
{
/*<Form.Item*/
}
{
/* label='产品目录'*/
}
{
/* name='directoryId'*/
}
{
/* rules={[{ required: true, message: '请选择产品目录' }]}*/
}
{
/*>*/
}
{
/* <Select placeholder='请选择产品目录' onChange={decSelectChange}>*/
}
{
/* {decList.map((v: any, index: number) => (*/
}
{
/* <Select.Option value={v.id} key={index}>*/
}
{
/* {v.directoryName}*/
}
{
/* </Select.Option>*/
}
{
/* ))}*/
}
{
/* </Select>*/
}
{
/*</Form.Item>*/
}
{
/*<Form.Item*/
}
{
/* name='categoryId'*/
}
{
/* label='产品类型'*/
}
{
/* rules={[{ required: true, message: '请选择产品类型' }]}*/
}
{
/*>*/
}
{
/* <Select*/
}
{
/* placeholder='请选择产品类型'*/
}
{
/* allowClear*/
}
{
/* showSearch*/
}
{
/* filterOption={(input, option) =>*/
}
{
/* (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())*/
}
{
/* }*/
}
{
/* >*/
}
{
/* {productTypeSelectList.map((i, j) => (*/
}
{
/* <Option value={i.id} key={j}>*/
}
{
/* {i.classifyName}*/
}
{
/* </Option>*/
}
{
/* ))}*/
}
{
/* </Select>*/
}
{
/*</Form.Item>*/
}
<
Form
.
Item
name=
'model'
label=
'产品型号'
...
...
src/pages/mallManage/produceManage/produceList/index.tsx
浏览文件 @
ae793c0d
...
...
@@ -37,9 +37,7 @@ function ProduceManage() {
// 新增弹窗是否显示
const
[
visibleAddEdit
,
setVisibleAddEdit
]
=
useState
(
false
);
// 新增弹窗内容
const
[
addEditData
,
setAddEditData
]
=
useState
<
addMakeParameterType
&
{
id
:
number
;
categoriesId
:
number
}
>
();
const
[
addEditData
,
setAddEditData
]
=
useState
<
addMakeParameterType
&
{
id
:
number
}
>
();
// 品牌列表
const
[
makeList
,
setMakeList
]
=
useState
<
makeListType
>
([]);
// 表格结构
...
...
@@ -52,10 +50,10 @@ function ProduceManage() {
},
{
title
:
'归属产品'
,
dataIndex
:
'
directoryNam
e'
,
dataIndex
:
'
typ
e'
,
align
:
'center'
,
render
:
(
text
:
number
)
=>
(
text
===
1
?
'租赁商品'
:
text
===
0
?
'商城商品'
:
''
),
},
{
title
:
'产品类型'
,
dataIndex
:
'categoryName'
,
align
:
'center'
},
{
title
:
'型号'
,
dataIndex
:
'model'
,
align
:
'center'
},
{
title
:
'产品品牌'
,
dataIndex
:
'productBrand'
,
align
:
'center'
},
{
...
...
@@ -87,7 +85,7 @@ function ProduceManage() {
totalCount
:
0
,
});
//筛选参数
const
[
searchColumnsData
,
setSearchColumnsData
]
=
useState
<
searchColumns
[]
>
([
const
[
searchColumnsData
]
=
useState
<
searchColumns
[]
>
([
{
label
:
'产品名称'
,
placeholder
:
'请输入产品名称'
,
...
...
@@ -95,11 +93,14 @@ function ProduceManage() {
name
:
'productName'
,
},
{
label
:
'
产品类型
'
,
placeholder
:
'请
输入产品名称
'
,
label
:
'
归属产品
'
,
placeholder
:
'请
选择归属产品
'
,
type
:
'select'
,
name
:
'categoryId'
,
options
:
[],
name
:
'type'
,
options
:
[
{
name
:
'商城商品'
,
id
:
0
},
{
name
:
'租赁商品'
,
id
:
1
},
],
},
]);
...
...
@@ -122,12 +123,10 @@ function ProduceManage() {
setVisibleAddEdit
(
true
);
setAddEditData
({
id
:
record
.
id
,
categoryId
:
record
.
categoriesId
,
directoryId
:
record
.
directoryId
,
model
:
record
.
model
,
productBrandId
:
record
.
productBrandId
,
productName
:
record
.
productName
,
categoriesId
:
record
.
categoriesId
,
type
:
record
.
type
,
});
};
// 关闭弹窗
...
...
src/pages/mallManage/serviceManage/serviceDetail/index.tsx
浏览文件 @
ae793c0d
...
...
@@ -41,6 +41,7 @@ const ServiceDetail = () => {
<
Form
.
Item
label=
'展示状态'
>
{
serviceDetail
?.
displayState
===
0
?
'上架'
:
'下架'
}
</
Form
.
Item
>
<
Form
.
Item
label=
'所属单位'
>
{
serviceDetail
?.
companyName
}
</
Form
.
Item
>
<
Form
.
Item
label=
'封面图'
>
<
Image
src=
{
serviceDetail
?.
coverPlan
}
width=
{
100
}
height=
{
100
}
/>
</
Form
.
Item
>
...
...
src/pages/mallManage/serviceManage/serviceList/components/addOrEditServiceModal/index.tsx
浏览文件 @
ae793c0d
...
...
@@ -6,12 +6,15 @@ import { Uploader } from '~/components/uploader';
import
{
InterDataType
,
InterReqType
}
from
'~/api/interface'
;
import
{
categoryListType
}
from
'~/api/interface/categoryManage'
;
import
{
addServiceType
,
serviceType
}
from
'~/api/interface/mallManageType'
;
import
{
MallManageAPI
}
from
'~/api'
;
import
{
MallManageAPI
,
SystemManageAPI
}
from
'~/api'
;
import
{
listCompanyPage
}
from
'~/api/interface/systemManageType'
;
//分类返回类型
type
categoryType
=
InterDataType
<
categoryListType
>
[
'list'
];
//服务返回类型
type
serviceListType
=
InterDataType
<
serviceType
>
[
'list'
];
//单位返回类型
type
companyType
=
InterDataType
<
listCompanyPage
>
[
'list'
];
interface
selfProps
{
industryCategoryList
:
categoryType
;
...
...
@@ -60,6 +63,8 @@ const AddOrEditServiceModal: FC<ModalProps & selfProps> = ({
url
:
string
;
}[]
>
([]);
//单位列表
const
[
companyList
,
setCompanyList
]
=
useState
<
companyType
>
([]);
//封面图上传成功
const
coverPlanUploadSuccess
=
(
...
...
@@ -121,6 +126,15 @@ const AddOrEditServiceModal: FC<ModalProps & selfProps> = ({
form
.
resetFields
();
handleCancel
();
};
//获取单位列表
const
getCompanyList
=
()
=>
{
SystemManageAPI
.
listCompanyPage
({
pageNo
:
1
,
pageSize
:
99999
}).
then
(({
result
})
=>
{
setCompanyList
(
result
.
list
);
});
};
useEffect
(()
=>
{
getCompanyList
();
},
[]);
useEffect
(()
=>
{
if
(
currentServiceData
)
{
form
.
setFieldsValue
({
...
...
@@ -131,6 +145,7 @@ const AddOrEditServiceModal: FC<ModalProps & selfProps> = ({
shareCard
:
currentServiceData
.
shareCard
||
undefined
,
video
:
currentServiceData
.
video
||
undefined
,
displayState
:
currentServiceData
.
displayState
,
companyId
:
currentServiceData
.
companyId
,
});
setCoverPlanFileList
([
{
...
...
@@ -209,6 +224,25 @@ const AddOrEditServiceModal: FC<ModalProps & selfProps> = ({
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
'所属单位'
name=
'companyId'
rules=
{
[{
required
:
true
,
message
:
'请选择所属单位'
}]
}
>
<
Select
placeholder=
'请选择所属单位'
filterOption=
{
(
input
,
option
)
=>
(
option
!
.
children
as
unknown
as
string
).
toLowerCase
().
includes
(
input
.
toLowerCase
())
}
showSearch
>
{
companyList
.
map
((
v
)
=>
(
<
Select
.
Option
value=
{
v
.
id
}
key=
{
v
.
id
}
>
{
v
.
companyName
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
'封面图'
name=
'coverPlan'
rules=
{
[{
required
:
true
,
message
:
'请上传封面图'
}]
}
...
...
src/pages/mallManage/serviceManage/serviceList/index.tsx
浏览文件 @
ae793c0d
...
...
@@ -73,7 +73,7 @@ const ServiceList: FC<any> = () => {
render
:
(
_text
:
any
,
_record
:
any
,
index
:
number
)
=>
(
pagination
.
pageNo
-
1
)
*
pagination
.
pageSize
+
index
+
1
,
},
{
title
:
'服务名称'
,
align
:
'center'
,
dataIndex
:
'serviceName'
},
{
title
:
'服务名称'
,
align
:
'center'
,
dataIndex
:
'serviceName'
,
width
:
'20%'
},
{
title
:
'应用'
,
align
:
'center'
,
dataIndex
:
'applicationName'
},
{
title
:
'对应行业'
,
align
:
'center'
,
dataIndex
:
'industryName'
},
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论