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

fix: 对接品类关联属性属性列表排序,对接开启MRO配置接口,交易规则添加跨境交易规则类型和查询跨境商品字段

parent 151bacd4
module.exports = [
{ name: 'LogisticsV2', token: '732fb8e33970ff5dee830423a630e8e85c3ef3293abba7581b16749dfce8608b', categoryIds: [0], }, // 物流能力v2
{ name: 'ProductV2', token: 'df37f2a0e3829c4288708ae211920bdbdee55e5e2f48b1e8cf7d1925ac618d9a', categoryIds: [0], }, // 商品服务V2
{ name: 'ProductV2', token: 'fb618349dba7b6f41008bb42d2a5776090dff0492f132f7e59a37ea7c78c7d1f', categoryIds: [0], }, // 商品服务V2-318
{ name: 'TemplateV2', token: '7bb5578bc50e4e7935cbc146a2192e978053d5380cc96fcfdc0a754cfe885ec5', categoryIds: [0], }, // 页面模板服务V2
{ name: 'PayV2', token: '4b5f2f2d42f0774b61074d69d5d756c725ba067d9dafe2c3785f592ae85d1696', categoryIds: [0], }, // 支付服务
{ name: 'SearchV2', token: 'f3e6ec26764f54d06ba33f487ff42d7debeaef397e51dc395040447737eb2e66', categoryIds: [0], }, // 搜索服务V2
......
......@@ -7,7 +7,7 @@ import DetailPage from '@/components/DetailPage'
import UseModal from '../components/useModal'
import { Environment_Status } from '@/constants'
import { GlobalConfig } from '@/global/config'
import { getTemplateWebPageTemplateWebFindChannelTemplateDetails, postTemplateWebPageTemplateWebUseChannelTemplate } from '@/services/TemplateV2Api'
import { getTemplateWebPageTemplateWebFindChannelTemplateDetails, postTemplateWebPageTemplateWebOpenMro, postTemplateWebPageTemplateWebUseChannelTemplate } from '@/services/TemplateV2Api'
import styles from './index.less'
import { getManageShopOpenMro } from '@/services/ManageV2Api'
......@@ -34,11 +34,13 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}, [])
useEffect(() => {
getManageShopOpenMro({shopId: detailInfo.shopId}).then(({code, data}) => {
if(code === 1000) {
setIsMro(data)
}
})
if(detailInfo?.shopId) {
getManageShopOpenMro({shopId: detailInfo.shopId}).then(({code, data}) => {
if(code === 1000) {
setIsMro(data)
}
})
}
}, [detailInfo]);
const getType = (info: any): number => {
......@@ -105,7 +107,11 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}
const onChangeMroSetting = (e) => {
console.log(`checked = ${e.target.checked}`);
postTemplateWebPageTemplateWebOpenMro({openMro: e.target.checked ? 1 : 0, templateId: detailInfo.id, type: 0}).then(({code}) => {
if(code === 1000) {
fetchDetail()
}
})
}
return (
......@@ -141,10 +147,9 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
</div>
</div>
</div>
{/* @todo 需要通过PASS配置MRO才能显示是否开启MRO商城筛选 */}
{
isMro && <div>
<Checkbox onChange={onChangeMroSetting} value={detailInfo.openMro}>启用商城MRO筛选模式</Checkbox>
<Checkbox onChange={onChangeMroSetting} checked={detailInfo.openMro}>启用商城MRO筛选模式</Checkbox>
</div>
}
<div className={styles.btn} onClick={() => handleLinkPreview()}>
......
......@@ -17,7 +17,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import Search from '@/components/NiceForm/components/Search'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import Submit from '@/components/NiceForm/components/Submit'
import { getProductCustomerGetCustomerCategoryAttributeList, getProductCustomerGetCustomerCategoryTree, postProductCustomerDeleteCustomerCategoryAttribute, postProductCustomerSaveCustomerCategoryAttribute } from '@/services/ProductV2Api';
import { getProductCustomerGetCustomerCategoryAttributeList, getProductCustomerGetCustomerCategoryTree, postProductCustomerDeleteCustomerCategoryAttribute, postProductCustomerSaveCustomerCategoryAttribute, postProductCustomerSaveCustomerCategoryAttributeSort } from '@/services/ProductV2Api';
import { ISchema } from '@formily/antd';
import { Sortable, SortableEvent } from 'react-sortablejs';
import { arrayMoveImmutable } from '@/utils';
......@@ -76,6 +76,10 @@ const searchSchema: ISchema = {
}
}
interface IPage {
current: number,
pageSize: number,
}
const CategoryAttributes: React.FC<{}> = () => {
const intl = useIntl();
const ref = useRef<any>({})
......@@ -89,6 +93,7 @@ const CategoryAttributes: React.FC<{}> = () => {
const flag = useRef<boolean>(false) // 标识 初始点击品类不执行effect的重载表格
const [dataSource, setDataSource] = useState<any>([]) // 拖拽表格排序当前页数据
const sorttableRef = useRef<Sortable>()
const currentPage = useRef<IPage>({current: 1, pageSize: 10})
const {
treeStatus,
......@@ -118,6 +123,7 @@ const CategoryAttributes: React.FC<{}> = () => {
}, [selectKey])
const fetchLinkAttributeData = (params) => {
currentPage.current = { current: params.current, pageSize: params.pageSize }
return new Promise((resolve) => {
getProductCustomerGetCustomerCategoryAttributeList({
...params,
......@@ -328,9 +334,19 @@ const CategoryAttributes: React.FC<{}> = () => {
const start = evt.oldIndex || 0
const end = evt.newIndex || 0
const result = arrayMoveImmutable([].concat(data), start, end)
// @todo 这里setData应该提交到后端数据库
setDataSource([...result])
console.log('after:', result)
const {current, pageSize} = currentPage.current
const params = result.map((item, index) => ({
categoryId: currentCategoryRef.current,
attributeId: item['id'],
sort: index + (current - 1) * pageSize,
}))
console.log('after:', result, params)
postProductCustomerSaveCustomerCategoryAttributeSort(params).then(({code}) => {
if(code === 1000) {
setTimeout(() => { ref.current.reload() }, 1000)
}
})
},
}
)
......
......@@ -7,7 +7,7 @@ import DetailPage from '@/components/DetailPage'
import UseModal from '../components/useModal'
import { Environment_Status } from '@/constants'
import styles from './index.less'
import { getTemplateWebPageTemplateWebFindSelfTemplateDetails, postTemplateWebPageTemplateWebUseSelfTemplate } from '@/services/TemplateV2Api'
import { getTemplateWebPageTemplateWebFindSelfTemplateDetails, postTemplateWebPageTemplateWebOpenMro, postTemplateWebPageTemplateWebUseSelfTemplate } from '@/services/TemplateV2Api'
import { getManageShopOpenMro } from '@/services/ManageV2Api'
interface TemplateDetailPropsType {
......@@ -32,11 +32,13 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}, [])
useEffect(() => {
getManageShopOpenMro({shopId: detailInfo.sourceShopId}).then(({code, data}) => {
if(code === 1000) {
setIsMro(data)
}
})
if(detailInfo?.shopId) {
getManageShopOpenMro({shopId: detailInfo.sourceShopId}).then(({code, data}) => {
if(code === 1000) {
setIsMro(data)
}
})
}
}, [detailInfo]);
const fetchDetail = () => {
......@@ -100,7 +102,11 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}
const onChangeMroSetting = (e) => {
console.log(`checked = ${e.target.checked}`);
postTemplateWebPageTemplateWebOpenMro({openMro: e.target.checked ? 1 : 0, templateId: detailInfo.id, type: 1}).then(({code}) => {
if(code === 1000) {
fetchDetail()
}
})
}
return (
......@@ -136,10 +142,9 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
</div>
</div>
</div>
{/* @todo 需要通过PASS配置MRO才能显示是否开启MRO商城筛选 */}
{
isMro && <div>
<Checkbox onChange={onChangeMroSetting} value={detailInfo.openMro}>启用商城MRO筛选模式</Checkbox>
<Checkbox onChange={onChangeMroSetting} checked={detailInfo.openMro}>启用商城MRO筛选模式</Checkbox>
</div>
}
<div className={styles.btn} onClick={() => handleLinkPreview()}>
......
......@@ -7,7 +7,7 @@ import DetailPage from '@/components/DetailPage'
import UseModal from '../components/useModal'
// import { Environment_Status } from '@/constants'
import styles from './index.less'
import { getTemplateWebPageTemplateWebFindShopTemplateDetails, postTemplateWebPageTemplateWebUseShopTemplate } from '@/services/TemplateV2Api'
import { getTemplateWebPageTemplateWebFindShopTemplateDetails, postTemplateWebPageTemplateWebOpenMro, postTemplateWebPageTemplateWebUseShopTemplate } from '@/services/TemplateV2Api'
import { getManageShopOpenMro } from '@/services/ManageV2Api'
interface TemplateDetailPropsType {
......@@ -38,11 +38,13 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}, [])
useEffect(() => {
getManageShopOpenMro({shopId: detailInfo.shopId}).then(({code, data}) => {
if(code === 1000) {
setIsMro(data)
}
})
if(detailInfo?.shopId) {
getManageShopOpenMro({shopId: detailInfo.shopId}).then(({code, data}) => {
if(code === 1000) {
setIsMro(data)
}
})
}
}, [detailInfo]);
const fetchDetail = () => {
......@@ -96,7 +98,11 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}
const onChangeMroSetting = (e) => {
console.log(`checked = ${e.target.checked}`);
postTemplateWebPageTemplateWebOpenMro({openMro: e.target.checked ? 1 : 0, templateId: detailInfo.id, type: 0}).then(({code}) => {
if(code === 1000) {
fetchDetail()
}
})
}
return (
......@@ -132,10 +138,9 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
</div>
</div>
</div>
{/* @todo 需要通过PASS配置MRO才能显示是否开启MRO商城筛选 */}
{
isMro && <div>
<Checkbox onChange={onChangeMroSetting} value={detailInfo.openMro}>启用商城MRO筛选模式</Checkbox>
<Checkbox onChange={onChangeMroSetting} checked={detailInfo.openMro}>启用商城MRO筛选模式</Checkbox>
</div>
}
<div className={styles.btn} onClick={() => handleLinkPreview()}>
......
......@@ -125,7 +125,11 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
icon: <ExclamationCircleOutlined />,
content: '',
onOk() {
postOrderBuyerRefund({orderId})
postOrderBuyerRefund({orderId}).then(({code}) => {
if(code === 1000) {
ref.current.reload()
}
})
},
});
}
......@@ -137,9 +141,13 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
icon: <ExclamationCircleOutlined />,
content: '',
onOk() {
postOrderBuyerPageDelete({orderId})
postOrderBuyerPageDelete({orderId}).then(({code}) => {
if(code === 1000) {
ref.current.reload()
}
})
},
});
})
}
/** 参照后台数据生成 */
......
......@@ -47,11 +47,14 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
const fetchProductList = async (params) => {
const shopIds = addSchemaAction.getFieldValue('shopIds')
const processType = addSchemaAction.getFieldValue('processType')
if(shopIds.length){
let shopInfo: any = GlobalConfig.web.shopInfo.filter(item => item.id === shopIds[0])
console.log(shopIds, shopInfo)
const res = await getProductCommodityCommonGetCommodityListBySeller({
...params,
// 查跨境
isCrossBorder: processType === 7,
// shopType: shopInfo[0].type,
// environment: shopInfo[0].environment,
shopId: shopInfo['id'],
......@@ -407,6 +410,9 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
// 此项隐藏操作在编辑下能无效
$('onFieldValueChange', 'baseProcessId').subscribe(parentState => {
const selectedObject = parentState.dataSource.filter(item => item.baseProcessid === parentState.value)[0]
if(selectedObject) {
setFieldValue('processType', selectedObject["processType"])
}
// 不是下单交易类型 隐藏取消时间
if(selectedObject && selectedObject["processType"] !== 1) {
setFieldState("MEGA_LAYOUT1_1", state => {
......
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