Commit 84e8b11d authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理编辑商品编辑图片问题和重新组合提示重新上传商品图片

parent 6a8dcf22
......@@ -71,5 +71,5 @@ export default {
'afterService.components.ExchangeDeliverInfo.receive':'Confirm exchange receipt',
'afterService.components.ExchangeDeliverInfo.back':'Confirm exchange receipt',
'afterService.components.ExchangeReceivedInfo.title':'Return shipping information',
'afterService.components.ExchangeReceivedInfo.summaryColumns.deliver
\ No newline at end of file
'afterService.components.ExchangeReceivedInfo.title':'Return shipping information afterService.components.ExchangeReceivedInfo.summaryColumns.deliver'
}
......@@ -83,7 +83,7 @@ export default {
'logistics.shouhuorenxingming':'Consignee Name',
'logistics.shouhuodizhi':'Receiving address',
'logistics.fahuodiqu':'shipping area',
'logistics.fahuorenxingming':'shipper's name',
'logistics.fahuorenxingming':'shippers name',
'logistics.fahuodizhi':'Shipping address',
'logistics.wuliudanhao':'logistics order number',
'logistics.fahuofang':'Ship from',
......@@ -204,4 +204,4 @@ export default {
'logistics.lunbotutiaozhuanlianjie':'Carousel diagram jump link',
'logistics.qingshurumiaoshu':'Please enter a description',
'logistics.qingshuruguanjianzi':'Please enter a keyword',
}
\ No newline at end of file
}
......@@ -125,7 +125,7 @@ export default {
"activePage.PreSale": "Presale",
"activePage.Package": "Package",
"activePage.onTrial": "Trial",
"activePage.CustomArea": ​​"Custom Area",
"activePage.CustomArea":"Custom Area",
"activePage.AddActivity": "Add Activity",
"activePage.ActivityAreaName": "Activity Area Name",
"activePage.AdvertisingMap": "Advertising Map",
......@@ -153,5 +153,5 @@ export default {
"activePage.Submit": "Submit",
"activePage.Pleaseuploadpictures": "Please upload pictures",
"activePage.Pleasefillintheactivityname": "Please fill in the activity name",
"activePage.save": "Save"
}
\ No newline at end of file
"activePage.save": "Save",
}
......@@ -100,8 +100,8 @@ export default {
'payandSettle.eAccountApprove.components.company.mellowCard.1.bankNo.message':'Please enter the branch number',
'payandSettle.eAccountApprove.components.company.mellowCard.1.bankNo.placeholder':'Please enter the branch number',
'payandSettle.eAccountApprove.components.company.mellowCard.1.phone':'Corporate phone number',
'payandSettle.eAccountApprove.components.company.mellowCard.1.phone.message':'Please enter the legal person's mobile phone number',
'payandSettle.eAccountApprove.components.company.mellowCard.1.phone.placeholder':'Please enter the legal person's mobile phone number',
'payandSettle.eAccountApprove.components.company.mellowCard.1.phone.message':'Please enter the legal persons mobile phone number',
'payandSettle.eAccountApprove.components.company.mellowCard.1.phone.placeholder':'Please enter the legal persons mobile phone number',
'payandSettle.eAccountApprove.components.company.mellowCard.1.uniCredit':'Unified Social Credit Code',
'payandSettle.eAccountApprove.components.company.mellowCard.1.uniCredit.message':'Please enter the unified social credit code',
'payandSettle.eAccountApprove.components.company.mellowCard.1.uniCredit.message1':'Please fill in the 12-digit unified social credit number',
......@@ -117,8 +117,8 @@ export default {
'payandSettle.eAccountApprove.components.company.mellowCard.3':'Enterprise certification (3/4)',
'payandSettle.eAccountApprove.components.company.mellowCard.4':'Enterprise Certification (4/4)',
'payandSettle.eAccountApprove.components.company.mellowCard.2.phone':'Corporate phone number',
'payandSettle.eAccountApprove.components.company.mellowCard.2.phone.message':'Please enter the legal person's mobile phone number',
'payandSettle.eAccountApprove.components.company.mellowCard.2.phone.placeholder':'Please enter the legal person's mobile phone number',
'payandSettle.eAccountApprove.components.company.mellowCard.2.phone.message':'Please enter the legal persons mobile phone number',
'payandSettle.eAccountApprove.components.company.mellowCard.2.phone.placeholder':'Please enter the legal persons mobile phone number',
'payandSettle.eAccountApprove.components.company.mellowCard.2.captcha':'Verification code',
'payandSettle.eAccountApprove.components.company.mellowCard.2.captcha.button':'Get verification code',
'payandSettle.eAccountApprove.components.company.mellowCard.2.captcha.message':'Please enter the verification code',
......@@ -1056,4 +1056,4 @@ export default {
'payandSettle.capitalAccounts.eAccount.shurunideshou':'Enter your mobile phone number',
'payandSettle.capitalAccounts.eAccount.qingtianxieyanzheng':'Please fill in the verification code',
'payandSettle.capitalAccounts.eAccount.qingshuruduanxin':'Please enter the SMS verification code',
}
\ No newline at end of file
}
......@@ -477,7 +477,7 @@ export default {
'detail.purchase.tips11':'The price reduction of each quotation must be greater than or equal to the minimum spread',
'detail.purchase.tips12':'The maximum number of quotations allowed for each supplier',
'detail.purchase.tips13':'Choose to publish the current lowest price, and the current lowest price quoted by the supplier will be published on the bidding page in real time during the bidding process. ',
'detail.purchase.tips14':'Select the public offer ranking, and the supplier's current offer ranking will be disclosed on the bidding page in real time during the bidding process. ',
'detail.purchase.tips14':'Select the public offer ranking, and the suppliers current offer ranking will be disclosed on the bidding page in real time during the bidding process. ',
'detail.purchase.isMix1':'Open the current minimum',
'detail.purchase.isMix2':'Quote',
'detail.purchase.tips15':'The current quotation amount does not meet the minimum spread requirement, please modify it before quoting! ',
......@@ -548,8 +548,7 @@ export default {
'schma.purchase.orderThe':'Please enter the order summary',
'schma.purchase.supplyMembersName':'Please enter the supply member name',
'schma.purchase.purchaseType':'Please select the purchase type',
'schma.purchase.purchaseTypeTips':
'Purchase Type', "With fixed purchase amount: the purchase amount is fixed, and cannot exceed the purchase amount during the contract period. No fixed purchase amount: the purchase amount is not fixed, and you can purchase on demand during the contract period.',
'schma.purchase.purchaseTypeTips': 'Purchase Type, With fixed purchase amount: the purchase amount is fixed, and cannot exceed the purchase amount during the contract period. No fixed purchase amount: the purchase amount is not fixed, and you can purchase on demand during the contract period.',
'schma.purchase.projectName':'Please enter the bidding project',
'schma.purchase.remark':'Bidding summary',
'schma.purchase.remarkMessage':'Please enter the tender summary',
......@@ -716,7 +715,7 @@ export default {
'table.purchase.xingming':'Name',
'table.purchase.shoujihao':'Mobile phone number',
'table.purchase.xinjianpingbiaozhuan':'New bid evaluation expert',
'table.purchase.bianjipingbiaozhuan':'Editor's bid evaluation expert',
'table.purchase.bianjipingbiaozhuan':'Editors bid evaluation expert',
'table.purchase.qingshuruxingming':'Please enter your name',
'table.purchase.qingshurusuoshu1':'Please enter the institution',
'table.purchase.qingshuruzhiwei':'Please enter a position',
......@@ -977,4 +976,4 @@ export default {
'table.purchase.duiying':'Correspondence',
'table.purchase.zhi':'To',
}
\ No newline at end of file
}
......@@ -18,7 +18,7 @@ export default {
'repositories.modalSchema.inventoryAmount.placeholder':'Please fill in the position inventory',
'repositories.modalSchema.inventoryAmount.message.1':'Please fill in the position inventory',
'repositories.modalSchema.inventoryAmount.message.2':'Only three decimal places',
'repositories.modalSchema.inventoryRate':'"Position inventory adjustment ratio", "Enter a percentage, that is, increase or decrease the percentage of inventory according to the original position. Please enter a negative value for the decrease",
'repositories.modalSchema.inventoryRate':"Position inventory adjustment ratio, Enter a percentage, that is, increase or decrease the percentage of inventory according to the original position. Please enter a negative value for the decrease",
'repositories.modalSchema.inventoryRate.placeholder':'Please fill in the position inventory adjustment ratio',
'repositories.modalSchema.inventoryRate.message.1':'Please fill in the position inventory adjustment ratio',
'repositories.modalSchema.inventoryRate.message.2':'Please fill in the value, keep up to 3 decimal places',
......@@ -245,4 +245,4 @@ export default {
'repositories.schema.repositOutSchema.noSUBMIT1':'Current position inventory',
'repositories.schema.repositOutSchema.noSUBMIT2':'Current position inventory',
};
\ No newline at end of file
};
......@@ -265,17 +265,37 @@ const AddProducts: React.FC<{}> = (props) => {
_params.unitPriceAndPicList = productInfoByEdit.unitPriceAndPicList
_params.isAllAttributePic = productInfoByEdit.isAllAttributePic
// 没有点击图片单单修改了商品价格 取原有的图片和新的价格合成(编辑属性组合变更,不点击图片,直接报存)
if (clickTabIndex.indexOf("4") !== -1) {
_params.unitPriceAndPicList = priceAttributeParams.map((item, index) => {
return {
id: item.id,
// if (clickTabIndex.indexOf("4") !== -1) {
// _params.unitPriceAndPicList = priceAttributeParams.map((item, index) => {
// return {
// id: item.id,
// goods: { id: item.goodsId },
// attributeAndValueList: item.attributeAndValueList,
// unitPrice: item.unitPrice,
// priceRate: item.priceRate,
// commodityPic: productInfoByEdit.unitPriceAndPicList[index].commodityPic
// }
// })
// }
try {
if (clickTabIndex.indexOf("4") !== -1) {
_params.unitPriceAndPicList = priceAttributeParams.map((item, index) => {
const pic = productInfoByEdit.unitPriceAndPicList[index]?.commodityPic
if (!pic) {
throw new Error('请重新上传商品图片!')
}
return {
id: item.id,
goods: { id: item.goodsId },
attributeAndValueList: item.attributeAndValueList,
unitPrice: item.unitPrice,
priceRate: item.priceRate,
commodityPic: productInfoByEdit.unitPriceAndPicList[index].commodityPic
}
})
commodityPic: pic
}
})
}
} catch (e) {
return e
}
}
}
......
......@@ -29,6 +29,8 @@ const ProductImageForm: React.FC<{}> = (props) => {
// 选中的图片
const uploadFileSelectRef = useRef<any>({})
const editRowIndexRef = useRef<number>(0)
// 点击编辑的DOM ID
const editImageIdRef = useRef<any>()
const { ProductStore } = store
const {
......@@ -170,13 +172,11 @@ const ProductImageForm: React.FC<{}> = (props) => {
}
/** 编辑的时候 监听mousemove判断是否有选文件上传 */
const addMonitor = () => {
}
const monitor = (ele) => {
const monitor = () => {
document.removeEventListener('mousemove', monitor);
if (ele.files && ele.files.length > 0) {
console.log('您选择中文件:', ele.files)
console.log(editImageIdRef.current?.files)
if (editImageIdRef.current?.files && editImageIdRef.current.files.length > 0) {
console.log('您选择中文件:', editImageIdRef.current.files)
} else {
uploadFileSelectRef.current = {}
console.log('您没有选择文件')
......@@ -244,7 +244,8 @@ const ProductImageForm: React.FC<{}> = (props) => {
editRowIndexRef.current = index
// 触发图片上传
uploadEle.click()
document.addEventListener('mousemove', () => monitor(uploadEle), false);
editImageIdRef.current = uploadEle
document.addEventListener('mousemove', monitor, false);
}
return (<div>
......
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