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

fix: 代客下单查询支付方式添加采购会员/角色id字段,处理没有配置按钮权限的更多操作报错问题

parent 5d7abf4e
......@@ -36,7 +36,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
Object.values(buttonTextFieldMap).filter(Boolean).length > 2
?
<>
<AuthButton btnCode={buttonPermissionsMap[keyNames[0]]} menuCode={menuCode}>
<AuthButton btnCode={buttonPermissionsMap ? buttonPermissionsMap[keyNames[0]] : 'DevTest'} menuCode={menuCode}>
<Button type='link' onClick={operationHandler[keyNames[0]]}>{keyNames[0]}</Button>
</AuthButton>
......@@ -45,7 +45,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
{
keyNames.slice(1, keyNames.length).map((item, i) => buttonTextFieldMap[item] ? (
<Menu.Item key={`menuItem${i}`}>
<AuthButton btnCode={buttonPermissionsMap[item]} menuCode={menuCode}>
<AuthButton btnCode={buttonPermissionsMap ? buttonPermissionsMap[item] : 'DevTest'} menuCode={menuCode}>
<Button type='link' onClick={operationHandler[item]}>{item}</Button>
</AuthButton>
</Menu.Item>
......@@ -59,7 +59,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
</Dropdown>
</>
:
keyNames.map((item, i) => (buttonTextFieldMap[item] ? <AuthButton btnCode={buttonPermissionsMap[item]} menuCode={menuCode}><Button key={`btnItem${i}`} type='link' onClick={operationHandler[item]}>{item}</Button></AuthButton> : null))
keyNames.map((item, i) => (buttonTextFieldMap[item] ? <AuthButton btnCode={buttonPermissionsMap ? buttonPermissionsMap[item] : 'DevTest'} menuCode={menuCode}><Button key={`btnItem${i}`} type='link' onClick={operationHandler[item]}>{item}</Button></AuthButton> : null))
}
</>)
}
......
......@@ -123,7 +123,7 @@ export default {
'purchaseOrder.orderCollect.schema.buyerMemberMajorId': 'Purchase Member',
'purchaseOrder.orderCollect.schema.buyerMemberMajorIdPh': 'Please enter the search purchasing member',
'purchaseOrder.orderCollect.memberSchema.placeholder': 'Please enter the name of the member',
'purchaseOrder.orderCollect.model.message': 'Please select a supply member first',
'purchaseOrder.orderCollect.model.message': 'Please select supply member and adapt mall first',
'purchaseOrder.orderCollect.model.message1': 'Please select purchase inquiry contract first',
'purchaseOrder.orderCollect.model.message2': 'Please select a purchasing member first',
'purchaseOrder.orderCollect.model.button1': 'Select order item',
......@@ -335,6 +335,7 @@ export default {
'purchaseOrder.shifouquerenshen': 'Whether to confirm the review of the warehouse receipt number is',
'purchaseOrder.decaigouruku': 'Purchase receipt order?',
'saleOrder.daochuerweima': 'Export qr Code',
'saleOrder.tijiaoshenhe': 'Submit for review',
'saleOrder.qinggouxuanyaoshen': 'Please check the order to be reviewed',
'saleOrder.piliangtijiaoshen': 'Batch submission for review',
......
......@@ -123,7 +123,7 @@ export default {
'purchaseOrder.orderCollect.schema.buyerMemberMajorId': '구매 회원',
'purchaseOrder.orderCollect.schema.buyerMemberMajorIdPh': '구매 회원 검색 입력',
'purchaseOrder.orderCollect.memberSchema.placeholder': '회원 이름 입력',
'purchaseOrder.orderCollect.model.message': '우선 공급 회원을 선택하세요',
'purchaseOrder.orderCollect.model.message': '공급회원제와 쇼핑몰에 적합한 상품을 먼저 선택하십시오',
'purchaseOrder.orderCollect.model.message1': '먼저 구매 문의 계약을 선택하세요',
'purchaseOrder.orderCollect.model.message2': '먼저 구매 회원을 선택하세요',
'purchaseOrder.orderCollect.model.button1': '주문 품목 선택',
......@@ -335,6 +335,7 @@ export default {
'purchaseOrder.shifouquerenshen': '감사 입고 양식 번호가',
'purchaseOrder.decaigouruku': '의 구매 입고서?',
'saleOrder.daochuerweima': 'qr 코드를 내보내다',
'saleOrder.tijiaoshenhe': '제출 심사',
'saleOrder.qinggouxuanyaoshen': '검토할 주문을 선택하십시오.',
'saleOrder.piliangtijiaoshen': '대량 제출 심사',
......
......@@ -123,7 +123,7 @@ export default {
'purchaseOrder.orderCollect.schema.buyerMemberMajorId': '采购会员',
'purchaseOrder.orderCollect.schema.buyerMemberMajorIdPh': '请输入搜索采购会员',
'purchaseOrder.orderCollect.memberSchema.placeholder': '请输入会员名称',
'purchaseOrder.orderCollect.model.message': '请先选择供应会员',
'purchaseOrder.orderCollect.model.message': '请先选择供应会员和适应商城',
'purchaseOrder.orderCollect.model.message1': '请先选择采购询价合同',
'purchaseOrder.orderCollect.model.message2': '请先选择采购会员',
'purchaseOrder.orderCollect.model.button1': '选择订单商品',
......@@ -335,6 +335,7 @@ export default {
'purchaseOrder.shifouquerenshen': '是否确认审核入库单号为',
'purchaseOrder.decaigouruku': '的采购入库单?',
'saleOrder.daochuerweima': '导出二维码',
'saleOrder.tijiaoshenhe': '提交审核',
'saleOrder.qinggouxuanyaoshen': '请勾选要审核的订单',
'saleOrder.piliangtijiaoshen': '批量提交审核',
......
......@@ -124,8 +124,8 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
}, {}))
// 遍历 排空
let resultParams = _resultParams.filter((_item: any) => _item.customerAttributeValueList.length != 0)
let resultParams = _resultParams.filter((_item: any) => (_item.customerAttributeValueList.length != 0 && _item.customerAttributeValueList[0]['value'] !== ''))
console.log(resultParams, 'resultParams')
setProductSelectAttribute(resultParams)
}
......
......@@ -36,6 +36,7 @@ import PutawayGuide from './components/putawayGuide'
import { useRowSelectionTable, useRowSelectionTableCtl } from '@/hooks/useRowSelectionTable'
import AuthButton from '@/components/AuthButton'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
import allRouters from '../../../../config/router.config.json'
const { confirm } = Modal;
......
......@@ -130,6 +130,8 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
const newData = rowSelectionCtl.selectRow.map(v => {
v.orderMode = schemaAction.getFieldValue('orderMode')
v.shopId = schemaAction.getFieldValue('shopId')
v.buyerMemberId = schemaAction.getFieldValue('buyerMemberId')
v.buyerRoleId = schemaAction.getFieldValue('buyerRoleId')
return v
})
schemaAction.setFieldValue('products', await filterProductDataById([], newData))
......
......@@ -19,14 +19,14 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
useEffect(() => {
// 商品有传入时 调用支付方式api
if(products.length && markRef.current) {
getPayLists(products[0].memberId, products[0].memberRoleId)
getPayLists(products[0].buyerMemberId, products[0].buyerRoleId)
markRef.current = false
}
}, [products])
const initPayWayList = (memberId, memberRoleId) => {
let result = []
getOrderVendorCreateAgentPayTypes({vendorMemberId: memberId, vendorRoleId: memberRoleId}).then(res => {
getOrderVendorCreateAgentPayTypes({buyerMemberId: memberId, buyerRoleId: memberRoleId}).then(res => {
const { data = [], code } = res
for (let item of data) {
result.push({
......
......@@ -115,8 +115,9 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
return productInfoColumns
})
const handleShowProduct = () => {
const supplyMembersId = ctx.getFieldValue('vendorMemberName')
if (supplyMembersId) {
const buyerMemberId = ctx.getFieldValue('buyerMemberId')
const shopId = ctx.getFieldValue('shopId')
if (buyerMemberId && shopId) {
productRef.current.setVisible(true)
} else {
message.error(intl.formatMessage({id: 'purchaseOrder.orderCollect.model.message'}))
......
......@@ -18,7 +18,7 @@ import { getAuth } from '@/utils/auth'
import styles from './index.less'
import QRCode from 'qrcode'
import { MEMBER_ROLE_TYPE_SERVICE_CONSUMER } from '@/constants/member'
import { getOrderVendorGeneratePayLink, GetOrderVendorGeneratePayLinkResponse, getOrderVendorMiniAppCode, getOrderVendorPage, postOrderVendorCancel, postOrderVendorTerminate, postOrderVendorTransfer, postOrderVendorTransferPreview } from '@/services/OrderNewV2Api'
import { getOrderVendorGeneratePayLink, getOrderVendorMiniAppCode, getOrderVendorPage, postOrderVendorCancel, postOrderVendorTerminate, postOrderVendorTransfer, postOrderVendorTransferPreview } from '@/services/OrderNewV2Api'
import appImg from '@/assets/icons/app.png'
import miniappImg from '@/assets/icons/miniapp.png'
import scanImg from '@/assets/icons/scan.png'
......@@ -136,21 +136,20 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
const onSave = () => {
const img: any = document.getElementById('qrcodeElement');
const canvas = document.createElement('canvas');
// console.log(img)
canvas.width = img.width;
canvas.height = img.height;
canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height);
const url = canvas.toDataURL('image/png');
var downloadLink = document.getElementById('downloadLink');
downloadLink.setAttribute('href', url);
downloadLink.setAttribute('download', '二维码.png');
downloadLink.setAttribute('download', `${intl.formatMessage({ id: 'saleOrder.daochuerweima', defaultMessage: '导出二维码' })}.png`);
downloadLink.click();
}
const generatePayChart = (record) => {
getOrderVendorGeneratePayLink({orderId: record.orderId}).then(({ data }) => {
currentPayRef.current = data
// setPayModel(ORDER_SHOP_ORIGIN_MAP[data['shopEnvironment']])
setPayChartVisible(true)
})
}
......
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