Commit adad797b authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 29f50b81 02df26b7
......@@ -49,18 +49,16 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const PDFList = ['application/pdf']
const isPDF = PDFList.includes(file.type)
if (!isLt50M) {
setFileLoading(true);
message.error('上传文件大小不超过 50M!');
}
if (!isPDF) {
setFileLoading(true);
message.error('请上传pdf格式文件');
}
return isLt50M && isPDF;
}
const handleChange = ({ file }) => {
setFileLoading(true);
if (file.response) {
setFileLoading(true);
if (file.response.code !== 1000) {
setFileLoading(false);
return
......@@ -70,6 +68,8 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
albumName: file.name,
albumUrl: file.response.data,
})
} else {
setFileLoading(false);
}
}
const fileRemove = () => {
......
......@@ -140,7 +140,7 @@ const FormList = (props: any) => {
associatedGoods: _filter(sourceType, item, ['', 'productAttributeJson', 'commodityAttribute', '']), //关联
associatedMaterielNo: _filter(sourceType, item, ['', 'number', 'commodityCode']), // 关联物料编号
associatedMaterielName: _filter(sourceType, item, ['', 'productName', 'commodityName']), // 关联商品名称
associatedType: _filter(sourceType, item, ['', 'productAttributeJson', 'commodityCategory', '']).split('-')[1], //规格型号
associatedType: sourceType == 1 ? _filter(sourceType, item, ['', 'productAttributeJson', 'commodityCategory', '']).split('-')[1] : _filter(sourceType, item, ['', 'productAttributeJson', 'commodityCategory', '']), //规格型号
associatedCategory: _filter(sourceType, item, ['', 'productAttributeJson', 'commodityCategory', '']), // 关联商品品类
associatedBrand: _filter(sourceType, item, ['', 'productBrand', 'commodityBrand', '']),// 关联品牌
rowId: index,
......@@ -322,7 +322,7 @@ const FormList = (props: any) => {
purchaseCount: item.purchaseCount,
price: Number(item.price),
bidCount: item.bidCount,
bidAmount: item.bidCount && item.price ? Number(item.bidCount) * Number(item.price) : '',
bidAmount: item.bidCount && item.price ? (Number(item.bidCount) * Number(item.price)).toFixed(2) : '',
associatedMaterielName: Object.keys(Row).length === 0 ? '' : item.associatedMaterielName,
associatedGoods: Object.keys(Row).length === 0 ? '' : item.associatedGoods,
associatedDataId: Object.keys(Row).length === 0 ? '' : item.associatedDataId,
......
......@@ -91,7 +91,7 @@ const FormList = (props: any) => {
width: 130,
}}
placeholder=""
value={item.payAmount}
value={Number(item.payAmount).toFixed(2)}
onChange={(e) => onSelectChange(e, 'payAmount', index)}
/>
</div>
......@@ -224,7 +224,7 @@ const FormList = (props: any) => {
PlanList.map(item => {
item.payNum = Number(item.payNum)
item.payRatio = Number(item.payRatio)
item.payAmount = Number(item.payAmount)
item.payAmount = Number(item.payAmount).toFixed(2)
item.payWay = Number(item.payWay)
item.payParam = Number(item.payParam)
// 付款方式: 1 - 账期,2 - 月结,3 - 现结
......
......@@ -104,7 +104,7 @@ const Information = (props: any) => {
basicsVO.partyBName = Row.partyBName ? Row.partyBName : '';
basicsVO.sourceNo = Row.sourceNo ? Row.sourceNo : '';
basicsVO.sourceId = Row.sourceId ? Row.sourceId : '';
basicsVO.totalAmount = Row.totalAmount ? Row.totalAmount : '';
basicsVO.totalAmount = Row.totalAmount ? Number(Row.totalAmount).toFixed(2) : '';
basicsVO.partyBMemberId = sourceType === '1' ? Row.awardRoleId ? Row.awardMemberId : '' : Row.partyBMemberId;
basicsVO.partyBRoleId = sourceType === '1' ? Row.awardRoleId ? Row.awardRoleId : '' : Row.partyBRoleId;
console.log(Row, basicsVO)
......@@ -183,7 +183,7 @@ const Information = (props: any) => {
default:
break;
}
basicsVO.totalAmount = totalAmount;
basicsVO.totalAmount = Number(totalAmount).toFixed(2);
basicsVO.sourceId = sourceId;
basicsVO.partyBName = partyBName;
basicsVO.partyBMemberId = partyBMemberId;
......
......@@ -192,6 +192,7 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
const handleConfirmSave = useCallback((e: any) => {
e.preventDefault();
if (JSON.stringify(props) === JSON.stringify(newProps)) {
clearSelectedStatus()
return
}
setConfirmLoading(true)
......
......@@ -105,6 +105,7 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
const handleConfirmSave = () => {
if (JSON.stringify(brandList) === JSON.stringify(selectBrandList)) {
clearSelectedStatus()
return
}
// if (selectBrandList.length <= 0) {
......
......@@ -79,6 +79,7 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
const handleConfirmSave = useCallback((e: any) => {
e.preventDefault();
if (JSON.stringify(props) === JSON.stringify(newProps)) {
clearSelectedStatus()
return
}
......
......@@ -190,8 +190,8 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
}
const handleConfirmSave = () => {
console.log('handleConfirmSave1')
if (JSON.stringify(goodsList) === JSON.stringify(selectGoodsList)) {
clearSelectedStatus()
return
}
// console.log('handleConfirmSave2')
......
......@@ -106,6 +106,7 @@ const ShopSetting: React.FC<ShopSettingPropsType> = (props) => {
const handleConfirmSave = () => {
if (JSON.stringify(shopsList) === JSON.stringify(selectShopsList)) {
clearSelectedStatus()
return
}
......
......@@ -49,18 +49,16 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const PDFList = ['application/pdf']
const isPDF = PDFList.includes(file.type)
if (!isLt50M) {
setFileLoading(true);
message.error('上传文件大小不超过 50M!');
}
if (!isPDF) {
setFileLoading(true);
message.error('请上传pdf格式文件');
}
return isLt50M && isPDF;
}
const handleChange = ({ file }) => {
setFileLoading(true);
if (file.response) {
setFileLoading(true);
if (file.response.code !== 1000) {
setFileLoading(false);
return
......@@ -70,6 +68,8 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
albumName: file.name,
albumUrl: file.response.data,
})
} else {
setFileLoading(false);
}
}
const fileRemove = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment