Commit 35880b2e authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents c86a26dd dbc9e8db
......@@ -100,7 +100,7 @@
"rgbaster": "^2.1.1",
"sortablejs": "^1.12.0",
"typescript": "^3.9.7",
"umi": "^3.2.28",
"umi": "~3.2.28",
"video-react": "^0.14.1",
"yorkie": "^2.0.0"
},
......
/*
* @Author: XieZhiXiong
* @Date: 2020-09-15 17:48:36
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-05 18:18:12
* @Description: 内外部流转记录组件
* @LastEditors: zwp
* @LastEditTime: 2021-09-0 11:18:12
* @Description: 内外部流转记录组件 最后编辑-添加自定义默认的Radio显示类型
*/
import React, { useState, useEffect } from 'react';
import {
......@@ -33,6 +33,8 @@ export interface StepsItem {
status?: 'wait' | 'process' | 'finish' | 'error',
}
type radioItem = 'inner' | 'outer'
interface AuditProcessProp extends Omit<ButtonTabsProps, 'options'> {
/**
* 当前外部流程步骤
......@@ -61,7 +63,11 @@ interface AuditProcessProp extends Omit<ButtonTabsProps, 'options'> {
/**
* 是否省略title超出的内容,默认为 false
*/
ellipsis?: boolean
ellipsis?: boolean,
/**
* 初始radio值
*/
initRadioValue?: radioItem,
};
const AuditProcess: React.FC<AuditProcessProp> = ({
......@@ -72,9 +78,10 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
customTitleKey,
customKey,
ellipsis = false,
initRadioValue = 'inner',
...rest
}) => {
const [radioValue, setRadioValue] = useState<('inner' | 'outer')>('inner');
const [radioValue, setRadioValue] = useState<radioItem>(initRadioValue);
useEffect(() => {
// 这里判断如果只有外部步骤,没有内部步骤的时候,默认设置 radioValue 为 outer
......@@ -123,7 +130,6 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
<ButtonTabs
options={options}
extra="流转进度"
defaultValue="inner"
onChange={handleRadioChange}
value={radioValue}
{...rest}
......
......@@ -172,7 +172,7 @@ const AddProducts: React.FC<{}> = (props) => {
}
}
if(productInfoByEdit?.type === CommodityType.UPPER_SUPPORTER_COMMODITY) {
// @ 上游商品 直接原信息中的品类品牌id
// @ 上游商品 直接原信息中的品类品牌id
_bacsicForm.customerCategoryId = productInfoByEdit?.customerCategory.fullId.split('.').map(item => Number(item) + '')
_bacsicForm.brandId = productInfoByEdit?.brand.id
}
......@@ -254,6 +254,7 @@ const AddProducts: React.FC<{}> = (props) => {
return e
}
_params.unitPriceAndPicList = _productAttributeAndImageParams
console.log(_productAttributeAndImageParams, productAttributeAndImageParams, '001')
} else { // 编辑时没有点击商品图片(新增没有点击也就没有数据)
if(productInfoByEdit){
_params.unitPriceAndPicList = productInfoByEdit.unitPriceAndPicList
......@@ -270,6 +271,7 @@ const AddProducts: React.FC<{}> = (props) => {
}
})
}
console.log(_params.unitPriceAndPicList, priceAttributeParams, '001')
}
}
......
......@@ -415,6 +415,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
/* 生成传输数据 */
const constructedPrarams = () => {
let _paramsArray: any[] = [];
console.log(combineAttributeArray, 'combineAttributeArray')
Array.isArray(combineAttributeArray) ? combineAttributeArray.map((item, index)=>{ // 非数组情况下默认无组合 从table数据中获取 // 当属性减少的时候 这个combine数组还是之前的 /* code1 */
let _tempArr: any = []
Array.isArray(item) ? item.map((_item, _index) => { /* code2 */
......@@ -424,16 +425,19 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
id: attributeObjArr[_index].customerAttributeId,
name: attributeObjArr[_index].attributeName
}
// console.log(attributeObjArr, attributeValObjArr, item, index, _item, _index, _tableDataSource, '调试属性')
console.log(attributeObjArr, attributeValObjArr, item, index, _item, _index, _tableDataSource, '调试属性')
// @fixed bug: 属性名称相同的情况下 只找第一个元素 会出现id异常
let filterData = attributeValObjArr.map((__item, __index) => {
if(_index === __index) {
return __item.find(_ => _.value===_item)
let filterData = null
for(let i = 0; i < attributeValObjArr.length; i++) {
const element = attributeValObjArr[i]
filterData = element.find(ele => ele.value === _item)
if(filterData) {
break;
}
}).filter(__ => __)[0]
}
console.log(filterData, 'fff')
_tempObject.customerAttributeValue = {
// @fixed bug: 属性名称相同的情况下 只找第一个元素 会出现id异常
// id: attributeValObjArr.map(__item => __item.find(_ => _.value===_item)).filter(__ => __)[0].id,
id: filterData?.id ? filterData.id : null,
value: item[_index]
}
......
......@@ -144,12 +144,13 @@ const BatchPositionSetting:React.FC<BatchPositionSettingProps> = (props) => {
const handleAddMemberBtn = () => {
const shopType = addSchemaAction.getFieldValue('shopType');
const itemNo = addSchemaAction.getFieldValue('productId');
const itemNo = addSchemaAction.getFieldValue('commodityList');
console.log(shopType, itemNo, 'iii')
if (!shopType) {
message.error('请先选择商城类型');
return;
}
if(CANAL.includes(shopType) && !itemNo) {
if(CANAL.includes(shopType) && !itemNo?.length) {
message.error('请先选择商品');
return;
}
......
......@@ -20,6 +20,7 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext, type
<AuditProcess
customTitleKey='stepName'
customKey='step'
initRadioValue='outer'
outerVerifyCurrent={formContext.data.currentOuterStep}
innerVerifyCurrent={formContext.data.currentInnerStep}
outerVerifySteps={
......
import React from 'react'
import { Tag } from 'antd'
export interface IStatusColor {
[key: string]: {
value: string | number,
color: string
}
}
// 用于标签状态控制
export interface StatusColorsProps {
status: number,
text?: string,
type: 'out' | 'inside' | 'saleInside'
}
export enum ORDER_EXAMINE_ENUM {
/**
* 新增订单
*/
ADD_ORDER = 1,
/**
* 一级审核
*/
ONE_LEVEL_VALIDATE,
/**
* 二级审核
*/
TWO_LEVEL_VALIDATE,
/**
* 提交订单中
*/
SUBMIT_ORDER_PROCESS,
/**
* 提交订单成功
*/
SUBMIT_ORDER_SUCCESS,
/**
* 一级审核失败
*/
ONE_LEVEL_VALIDATE_ERROR,
/**
* 二级审核失败
*/
TWO_LEVEL_VALIDATE_ERROR
}
export const ORDER_EXAMINE_LIST = ['',
'新增订单',
'一级审核中',
'二级审核中',
'提交订单',
'提交成功',
'一级审核不通过',
'二级审核不通过'
]
// 状态颜色映射
export const StatusColorsMaps = {
ready: '#C0C4CC',
process: '#FFC400',
submit: '#6C9CEB',
success: '#41CC9E',
error: '#EF6260'
}
const matchStatusColor = (status: number): string => {
const maps = {
[ORDER_EXAMINE_ENUM.ADD_ORDER]: StatusColorsMaps.ready,
[ORDER_EXAMINE_ENUM.ONE_LEVEL_VALIDATE]: StatusColorsMaps.process,
[ORDER_EXAMINE_ENUM.TWO_LEVEL_VALIDATE]: StatusColorsMaps.process,
[ORDER_EXAMINE_ENUM.SUBMIT_ORDER_PROCESS]: StatusColorsMaps.submit,
[ORDER_EXAMINE_ENUM.SUBMIT_ORDER_SUCCESS]: StatusColorsMaps.success
}
// 默认返回错误的状态颜色
return maps[status] || StatusColorsMaps.error
}
// 订单内部状态显示
const StatusColors: React.FC<StatusColorsProps> = (props) => {
const { status, type, text = null } = props
const statusShowColor = matchStatusColor(status)
// 优先显示 后端返回的状态文本
return (<Tag color={statusShowColor}>{ text }</Tag>)
}
StatusColors.defaultProps = {}
export default StatusColors
......@@ -73,7 +73,6 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
} else {
ctx.setFieldState('deliveryAddresId', state => state.visible = true )
}
fetchOrderApi.getPayInfoList({
products: products,
memberId: productItem?.memberId,
......
......@@ -40,7 +40,6 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
}
const getPayLists = (memberId, memberRoleId) => {
console.log('1')
PublicApi.postOrderBuyerCreateB2bPaymentFind({
memberId,
roleId: memberRoleId,
......
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