Commit 2cde7a06 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 7ca01d71 840c58e1
......@@ -34,6 +34,7 @@ const config: any = {
['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'],
['import', { libraryName: 'god', libraryDirectory: 'es', style: true }, 'god'],
['import', { libraryName: '@umijs/hooks', libraryDirectory: 'lib', camel2DashComponentName: false }, '@umijs/hooks'],// 将下划线转化关闭
isProduction && ['transform-remove-console', { "exclude": [ "error", "warn"] }], // 移除 console
],
history: {
type: 'browser', // 'brower' | 'hash'
......
......@@ -48,6 +48,7 @@
"@umijs/preset-react": "1.x",
"@umijs/test": "^3.2.0",
"antd-img-crop": "^3.12.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"bizcharts": "^4.0.14",
"copy-to-clipboard": "^3.3.1",
"crypto-js": "^4.0.0",
......
......@@ -927,6 +927,11 @@ export enum SaleOrderInsideWorkState {
* 手工发货
*/
HAND_DELEVED_ORDER,
/**
* 不接受物流单
*/
NOT_ACCEPTED_DELIVERY,
}
// 支付外部状态
......@@ -1039,7 +1044,8 @@ export const SaleOrderInsideWorkStateTexts = {
24: '订单归档',
25: '待审核发货单',
26: '待确认物流单',
27: '待手工发货'
27: '待手工发货',
28: '不接受物流单',
}
// 订单流转记录外部状态
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-18 11:22:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-09 17:06:14
* @LastEditTime: 2020-12-17 14:54:03
* @Description: 待新增换货发货单
*/
import React, { useState, useRef } from 'react';
......@@ -104,7 +104,7 @@ const ExchangePrAddLogistics: React.FC = () => {
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?createType=${4}&shipmentOrderCode=${record.returnDeliveryNo}&relevanceOrderId=${record.replaceId}&relevanceType=${2}`)
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?createType=${4}&id=${record.replaceId}`)
}
>
新增
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-18 11:22:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-09 17:10:48
* @LastEditTime: 2020-12-17 15:09:13
* @Description: 待新增换货发货单
*/
import React, { useState, useRef } from 'react';
......@@ -104,7 +104,7 @@ const ReturnPrAddLogistics: React.FC = () => {
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?createType=${5}&shipmentOrderCode=${record.replaceDeliveryNo}&relevanceOrderId=${record.replaceId}&relevanceType=${3}`)
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?createType=${5}&id=${record.replaceId}`)
}
>
新增
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-09 17:14:37
* @LastEditTime: 2020-12-17 15:13:16
* @Description: 待新增退货发货单
*/
import React, { useState, useRef } from 'react';
......@@ -109,7 +109,7 @@ const ReturnPrAddLogistics: React.FC = () => {
type="link"
onClick={
() =>
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?createType=${6}&shipmentOrderCode=${record.returnDeliveryNo}&relevanceOrderId=${record.returnId}&relevanceType=${4}`)
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?createType=${6}&id=${record.returnId}`)
}
>
新增
......
......@@ -49,7 +49,7 @@ const common_columns: any = [
]
const MemberSettleAdd: React.FC = () => {
const [visible, setVisible] = useState(false)
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'id' });
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'uniqueId' });
const [initialValue, setInitialValue] = useState({});
const { id, preview } = usePageStatus();
const [submitLoading, setSubmitLoading ] = useState(false);
......@@ -77,7 +77,7 @@ const MemberSettleAdd: React.FC = () => {
title: '操作',
render: (text, record) => {
return (
<div onClick={() => handleRemove(record.memberId)}>删除</div>
<div onClick={() => handleRemove(record.uniqueId)}>删除</div>
)
}
}
......@@ -102,7 +102,11 @@ const MemberSettleAdd: React.FC = () => {
const fetchMemberData = async (params: any) => {
//member/manage/lower/page/bynamerole
const { data } = await PublicApi.getMemberManageLowerPageBynamerole(params);
return data
return {
...data,
data: data.data.map((v) => ({...v, uniqueId: v.memberId + "_" + v.roleId})),
totalCount: data.totalCount
}
}
// 获取适用会员下拉搜索框
......@@ -155,11 +159,11 @@ const MemberSettleAdd: React.FC = () => {
const handleRemove = (id: number) => {
const string = 'Tabs.memberTab.someLists';
const chooseList = formActions.getFieldValue(string);
const res = chooseList.filter((item) => item.memberId !== id);
const res = chooseList.filter((item) => item.uniqueId !== id);
formActions.setFieldValue(string, res);
// 必须设置key
memberRowCtl.setSelectRow(res);
memberRowCtl.setSelectedRowKeys(res.map((item) => item.memberId))
memberRowCtl.setSelectedRowKeys(res.map((item) => item.uniqueId))
}
// 从PAAS平台--规则配置--平台规则配置取已勾选的结算方式决定是否显示结算方式
......@@ -188,10 +192,11 @@ const MemberSettleAdd: React.FC = () => {
otherValues: [res.data.settlementDays, res.data.settlementDate],
}
})
formActions.setFieldValue('Tabs.memberTab.someLists', res.data.memberList);
const list = res.data.memberList.map((item) => ({...item, uniqueId: item.memberId + "_" + item.roleId}))
formActions.setFieldValue('Tabs.memberTab.someLists', list);
// 必须设置key
memberRowCtl.setSelectRow(res.data.memberList);
memberRowCtl.setSelectedRowKeys(res.data.memberList.map((item) => item.memberId))
memberRowCtl.setSelectRow(list);
memberRowCtl.setSelectedRowKeys(res.data.memberList.map((item) => item.memberId + "_" + item.roleId))
} else {
message.error({content: res.message})
}
......@@ -238,7 +243,7 @@ const MemberSettleAdd: React.FC = () => {
rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberData(params)}
tableProps={{
rowKey: 'id',
rowKey: 'uniqueId',
}}
formilyProps={
{
......
......@@ -27,13 +27,13 @@ export const indexSchema = {
},
},
name: {
type: 'string',
'x-component': 'Search',
type: 'string',
'x-component': 'Search',
"x-mega-props": {
"span": 2
},
'x-component-props': {
placeholder: '搜索',
placeholder: '搜索',
advanced: false,
},
},
......@@ -44,7 +44,7 @@ export const indexSchema = {
/**
* 新增会员结算策略schema
*
*
*/
export const addSchema = {
......@@ -129,7 +129,7 @@ export const addSchema = {
},
'x-component': 'MultTable',
'x-component-props': {
rowKey: 'memberId',
rowKey: 'uniqueId',
prefix: "{{tableAddButton}}",
columns: "{{tableColumns}}"
// columns: "{{tableColumns}}",
......@@ -176,7 +176,7 @@ export const memberSchema = {
style: {width: '200px'}
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
......@@ -189,4 +189,4 @@ export const memberSchema = {
}
}
}
}
\ No newline at end of file
}
......@@ -41,8 +41,8 @@ const Add: React.FC<{}> = () => {
const postData = list.map((item) => {
return {
productId: "fullId" in item ? item.commodityId : item.id,
memberId: item.memberId,
memberRoleId: item.memberRoleId,
memberId: item.memberId || authInfo.memberId,
memberRoleId: item.memberRoleId || authInfo.memberRoleId,
shopId: ENTERPRISE_MALL[authInfo.memberType],
type: 5,
}
......@@ -72,7 +72,7 @@ const Add: React.FC<{}> = () => {
disabled: record.purchaseCount - (record.processNum || 0) <= 0,
}),
});
const enterpriseTableRowSelection = useRowSelection({primaryKey: 'id', type: 'radio'});
const enterpriseTableRowSelection = useRowSelection({primaryKey: 'uniqueId', type: 'radio'});
// 选择加工企业 modal 层
const connectProduct = (
......@@ -128,20 +128,21 @@ const Add: React.FC<{}> = () => {
...orderData
}
})
const keys = someLists.map((item) => item.id);
if(isOrderProcess) {
orderTableRowSelection.setSelectedKeys(keys);
const orderDetailkeys = someLists.map((item) => item.fullId);
orderTableRowSelection.setSelectedKeys(orderDetailkeys);
orderTableRowSelection.setSelectedRows(someLists);
} else {
const keys = someLists.map((item) => item.id);
productTableRowSelection.setSelectedKeys(keys);
productTableRowSelection.setSelectedRows(someLists);
}
enterpriseTableRowSelection.setSelectedKeys([data.processMemberId]);
enterpriseTableRowSelection.setSelectedKeys([data.processMemberId + "_" + data.processRoleId]);
enterpriseTableRowSelection.setSelectedRows([{
id: data.processMemberId,
memberId: data.processMemberId,
name: data.processName,
roleId: data.processRoleId
roleId: data.processRoleId,
uniqueId: data.processMemberId + "_" + data.processRoleId
}])
setEditInfo({
...descValue,
......@@ -153,7 +154,8 @@ const Add: React.FC<{}> = () => {
orderList: isOrderProcess ? someLists : [],
productList: !isOrderProcess ? someLists : [],
outerWorkFlow: data.outerWorkflowRecordsList,
innerWorkFlow: data.innerWorkflowRecordsList
innerWorkFlow: data.innerWorkflowRecordsList,
controller: 1,
})
}
})
......@@ -165,7 +167,8 @@ const Add: React.FC<{}> = () => {
setEditInfo({
source: 1,
createTime: " ",
noticeNo: " "
noticeNo: " ",
controller: 1
})
}
}, [])
......@@ -265,9 +268,9 @@ const Add: React.FC<{}> = () => {
*/
const enterPriseOnOk = () => {
const row = enterpriseTableRowSelection.hasSelectedRows;
const { memberId, name, roleId, id } = row[0];
const { memberId, name, roleId } = row[0];
formActions.setFieldValue('Tabs.tab-1.layout.processName', name);
formActions.setFieldValue('Tabs.tab-1.layout.processMemberId', id);
formActions.setFieldValue('Tabs.tab-1.layout.processMemberId', memberId);
formActions.setFieldValue('Tabs.tab-1.layout.processRoleId', roleId);
}
......@@ -295,6 +298,9 @@ const Add: React.FC<{}> = () => {
const {
deliveryDate,
receivefullAddress,
controller,
outerStatus,
innerStatus,
// receiveAddressID,
enclosure = [],
deliveryDesc = '',
......
......@@ -82,14 +82,26 @@ const basicTab = {
],
"x-linkages": [
{
"type": "value:visible",
"target": "*(orderList, orderSource)",
"condition": "{{ $self.value === 1 }}"
"type": "value:state",
"target": "*(productList, productSource)",
"condition": "{{ $self.value === 1 }}",
state: {
display: false,
},
otherwise:{//条件不满足时控制bbb字段的编辑状态
display:true
}
},
{
"type": "value:visible",
"target": "*(productList, productSource)",
"condition": "{{ $self.value === 2 }}"
"type": "value:state",
"target": "*(orderList, orderSource)",
"condition": "{{ $self.value === 2 }}",
state: {
display: false,
},
otherwise:{//条件不满足时控制bbb字段的编辑状态
display:true
}
},
]
},
......
......@@ -23,12 +23,12 @@ import {
ASSIGN_PENDING_RECEIVE,
PENDING_RECEIPT_PATH,
} from '../../common';
import { action } from 'mobx';
const formActions = createFormActions();
const ADD_PROCESS_PATH = '/memberCenter/tranactionAbility/stockSellStorage/bills/add';
const ADD_DELIVERY_PATH = '/memberCenter/tranactionAbility/stockSellStorage/bills/add';
const ADD_LOGISTICS_PATH = '/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add';
const DETAIL_LOGISTICS_PATH = '/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail'
const SERVICE_MAPS = {
......@@ -174,8 +174,8 @@ const processStock: React.FC<{}> = () => {
<a onClick={() => handleVisible(record.id)}>审核</a>
</Popconfirm>
),
[OuterAndInnerStatus.pending_add_logistics]: <Link to={`${ADD_LOGISTICS_PATH}?createType=3&shipmentOrderId=${record.deliveryId}&shipmentOrderCode=${record.deliveryNo}&relevanceOrderId=${record.id}`}>新增物流单</Link>,
[OuterAndInnerStatus.pending_confirm_logistics]: <Link to={`${ADD_LOGISTICS_PATH}?createType=3&shipmentOrderId=${record.deliveryId}&shipmentOrderCode=${record.deliveryNo}&relevanceOrderId=${record.id}&isPreview=1`}>查看物流单</Link>,
[OuterAndInnerStatus.pending_add_logistics]: <Link to={`${ADD_LOGISTICS_PATH}?createType=3&id=${record.id}`}>新增物流单</Link>,
[OuterAndInnerStatus.pending_confirm_logistics]: <Link to={`${DETAIL_LOGISTICS_PATH}?id=${record.id}`}>查看物流单</Link>,
[OuterAndInnerStatus.pending_confirm_deliver]: <Link to={`${PENDING_DELIVERD_PATH}/detail?id=${record.id}`}>发货</Link>,
[OuterAndInnerStatus.pending_add_process_in_warehouse]: (
<Link
......
......@@ -13,7 +13,15 @@ const EnterPrise = ({visible, cancel, rowSelection, ...restProps}) => {
// const [selectRow, memberRowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio'});
const fetchData = useCallback(async (params: any) => {
let res = await PublicApi.getMemberManageLowerPageBynamerole(params);
return res;
console.log(res);
return {
...res,
code: res.code,
data: {
data: res.data.data.map((v) => ({...v, uniqueId: v.memberId + "_" + v.roleId})),
total: res.data.code
}
};
}, []);
const onOk = () => {
......
......@@ -132,7 +132,7 @@ export const schema = {
"x-component": "Table",
"x-component-props": {
"columns": columns,
"rowKey": "id",
"rowKey": "uniqueId",
"pagination":false,
"rowSelection": "{{rowSelection}}"
}
......
......@@ -111,8 +111,6 @@ const Content: React.FC<Iprops> = React.forwardRef((props, conftentRef) => {
props.formSubmit(value);
}
console.log(files);
return (
<div className={styles.container}>
<div className={styles.menu}>
......
......@@ -53,12 +53,12 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
}, [shopInfo])
const findFirstAdvertsByType = (templateId) => {
let params = {
const params: any = {
templateId,
type: 1,
memberId
}
//@ts-ignore
PublicApi.getTemplateChannelFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
setFirstAdvertList(res.data)
......@@ -67,12 +67,12 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
}
const findSecondAdvertsByType = (templateId) => {
let params = {
const params: any = {
templateId,
type: 2,
memberId
}
//@ts-ignore
PublicApi.getTemplateChannelFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
setSecondAdvertList(res.data)
......@@ -85,9 +85,11 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
*/
const fetchFirstCategory = () => {
return new Promise((resolve) => {
const params: any = {
memberId
}
//@ts-ignore
PublicApi.getTemplateChannelFindAllFirstCategory({ memberId }).then(res => {
PublicApi.getTemplateChannelFindAllFirstCategory(params).then(res => {
if (res.code === 1000) {
setCategoryList(res.data)
resolve(res.data)
......@@ -101,13 +103,12 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
*/
const fetchCategoryById = (categoryId, templateId) => {
return new Promise((resolve) => {
let param = {
const param: any = {
templateId: templateId,
categoryId,
memberId
}
// @ts-ignore
PublicApi.getTemplateChannelFindFirstCategoryDetail(param).then(res => {
if(res.code === 1000) {
resolve(res.data)
......@@ -117,11 +118,11 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
}
const getCategoryComponents = async (templateId) => {
let result = []
let firstCategory: any = await fetchFirstCategory()
const result = []
const firstCategory: any = await fetchFirstCategory()
for (let item of firstCategory) {
let categoryDetail: any = await fetchCategoryById(item.id, templateId)
for (const item of firstCategory) {
const categoryDetail: any = await fetchCategoryById(item.id, templateId)
result.push(
<ShopFloorLine
linkUrl={`${GlobalConfig.channelRootRoute}/commodity?channelId=${shopUrlParam}&categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`}
......
......@@ -709,15 +709,19 @@ const CommodityDetail = (props) => {
}
}
}
if(unitPricePicList.lenght > 0) {
setCurrentPriceRange(sortUnitPrice(unitPricePicList[0].unitPrice))
if(unitPricePicList.length > 0) {
setCurrentPriceRange(sortUnitPrice(unitPricePicList[0].unitPrice))
initStockCount(unitPricePicList)
}
// setStockCount(unitPricePicList[0].stockCount)
setCommodityImgList(tempImgList)
setAttributeList(tempAttrList)
}
/**
* 初始化库存信息 每个规格库存总和
* @param unitPricePicList
*/
const initStockCount = (unitPricePicList: any) => {
if (!unitPricePicList) {
return
......
......@@ -40,7 +40,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
templateId: mallTemplateId,
type: 1
}
PublicApi.getTemplatePlatformFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebEnterpriseFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
setFirstAdvertList(res.data)
}
......@@ -52,7 +52,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
templateId: mallTemplateId,
type: 2
}
PublicApi.getTemplatePlatformFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebEnterpriseFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
setSecondAdvertList(res.data)
}
......@@ -64,7 +64,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
*/
const fetchFirstCategory = () => {
return new Promise((resolve) => {
PublicApi.getTemplatePlatformFindAllFirstCategory().then(res => {
PublicApi.getTemplateWebCategoryWebFindAllFirstCategory().then(res => {
if (res.code === 1000) {
setCategoryList(res.data)
resolve(res.data)
......@@ -83,7 +83,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
categoryId
}
PublicApi.getTemplatePlatformFindFirstCategoryDetail(param).then(res => {
PublicApi.getTemplateAdornWebEnterpriseCategoryAdorn(param).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......
......@@ -58,7 +58,8 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
const params: any = {
templateId: shopInfo.templateId,
type: 2,
memberId
memberId,
roleId: shopInfo.roleId
}
PublicApi.getTemplateShopFindAdvertsByType(params).then(res => {
......
......@@ -205,14 +205,15 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
}
} else {
actions.setFieldState('usingElectronicContracts', state => {
state.value = 0
// state.value = 0
state.props["x-component-props"] = {
disabled: true
}
})
actions.setFieldValue('usingElectronicContracts', data.usingElectronicContracts || 0)
}
$('onFieldValueChange', 'contractTemplateId').subscribe(state => {
console.log(state.props)
// console.log(state.props)
})
// })
}}
......
......@@ -153,7 +153,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
if(qrCodeInfo.qrUrl) {
// @ts-ignore
PublicApi.getOrderPayResultsl({id, paymentInformationId: currentPayInfoId}).then(res => {
console.log(res)
if(res.code === 1000) {
if(res.data) {
setOpenTimer(0)
......@@ -170,14 +169,13 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
const handleConfirm = () => {
console.log(data,'data')
if (current === 0) {
if (checked.id) {
if (checked.id === 5) { // 线下支付
setCurrent(1)
setPayStep(1)
// 获取账户信息
PublicApi.getSettleAccountsCorporateAccountConfig({memberId: data.supplyMembersId}).then(res => {
// 获取对公账户信息
PublicApi.getSettleAccountsCorporateAccountConfig({memberId: data.supplyMembersId, memberRoleId: data.supplyMembersRoleId}).then(res => {
if(res.code === 1000) {
setBlankAccountInfo(res.data)
}
......@@ -261,7 +259,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
handleSubmitPay()
} else if (current === 2) {
// 开始提交授信支付数据 (需要输入支付密码)
console.log('开始提交授信支付数据', payPrice)
if(payPrice <= creditInfo.canUseQuota){
setPayStep(2)
setCurrent(1000)
......@@ -270,7 +267,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
} else if(current === 3) {
// 开始提交余额支付数据 (需要输入支付密码)
console.log('开始提交余额支付数据', payPrice)
if(payPrice <= balanceInfo){
setPayStep(2)
setCurrent(1000)
......@@ -279,7 +275,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
} else if(current === 5) {
// 开始提交货到付款数据
console.log('开始提交货到付款数据', payPrice)
handleSubmitPay()
}
......
......@@ -251,8 +251,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
history.goBack()
}, 1000)
// history.replace('/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder')
} else {
setBtnLoading(false)
}
setBtnLoading(false)
} catch (error) {
setBtnLoading(false)
error?.message && message.error(error.message)
......
......@@ -87,6 +87,14 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = false
}
// 多次支付也要禁用到付
if(ctx.getFieldValue('paymentInformationResponses').length > 1) {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = true
} else {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = false
}
}
}, [orderProducts, columns])
......
......@@ -66,6 +66,11 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
rowSelectionCtl.setSelectRow(newData)
rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id))
ctx.setFieldValue('orderProductRequests', newData)
// 商品行数变动 清空之前的支付信息
if (pageStatus === PageStatus.ADD) {
ctx.setFieldValue('paymentInformationResponses', [])
}
}
const [productColumns, setProductColumns] = useState(() => {
if (pageStatus === PageStatus.ADD) {
......
import React, { useState, useRef, useEffect } from 'react'
import styled from 'styled-components'
import { ISchemaFormProps, ISchemaFieldProps, ISchemaFieldComponentProps, createFormActions, useFieldState } from '@formily/antd'
import { Button, Space, Row, Col, Tag } from 'antd'
import { PlusOutlined, DeleteColumnOutlined, EditOutlined, DeleteOutlined, CaretUpOutlined, CaretDownOutlined, EyeOutlined } from '@ant-design/icons'
import cx from 'classnames'
import { PublicApi } from '@/services/api'
const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)`
.select_style_border {
border: 1px solid #EEF0F3;
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 14px;
cursor: pointer;
line-height: 28px;
position:relative;
}
.select_style_border.active {
border: 1px solid #00B382;
}
.select_style_border.active::after {
content: '';
position: absolute;
width: 0;
height: 0;
border-bottom: 12px solid #00B37A;
border-left: 12px solid transparent;
bottom: 0;
right: 0;
z-index: 5;
}
`
enum ProcessTagColor {
'red',
'orange',
'purple',
'blue'
}
enum ProcessTagType {
'订单交易流程',
'售后换货流程',
'售后退货流程',
'售后维修流程'
}
const SelectProcesss = (props: ISchemaFieldComponentProps) => {
const [formInitValue, setFormInitValue] = useState<any>(null)
const [state, setFieldState] = useFieldState({
dataSource: [],
showMore: false
})
const { dataSource, showMore } = state
const { value, mutators, editable } = props
useEffect(() => {
PublicApi.getOrderTradingRulesTransactionProcessList().then(res => {
setFieldState({
dataSource: res.data,
showMore
})
})
}, [])
const showDataSource = showMore ? dataSource : [...dataSource].splice(0, 3)
const handleCheck = (id) => {
if (editable) {
mutators.change(id)
}
}
const toogleMore = () => {
setFieldState({
dataSource,
showMore: !showMore
})
}
const renderProcessType = (v: any) => {
return <Tag color={ProcessTagColor[v.type - 1]}>
{ProcessTagType[v.type - 1]}
</Tag>
}
return (
<div style={{ width: '100%' }}>
<SelectStyles>
{
showDataSource.map(v => <div key={v.id} onClick={() => handleCheck(v.id)} className={cx('select_style_border', value === v.id ? 'active' : '')}>
<div>
<Row style={{ color: '#303133' }}>
<Col>{v.name}</Col>
<Col style={{ marginLeft: 6 }}>
{
renderProcessType(v)
}
</Col>
</Row>
<div style={{ color: '#909399' }}>{v.explain}</div>
</div>
</div>)
}
</SelectStyles>
{dataSource.length > 3 &&
<div onClick={toogleMore} style={{ textAlign: 'center', cursor: 'pointer' }}>
显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
</div>
}
</div>
)
}
SelectProcesss.defaultProps = {}
SelectProcesss.isFieldComponent = true;
export default SelectProcesss
\ No newline at end of file
import React, { useState, useRef, useEffect } from 'react'
import styled from 'styled-components'
import { ISchemaFormProps, ISchemaFieldProps, ISchemaFieldComponentProps, createFormActions, useFieldState } from '@formily/antd'
import { Button, Space, Row, Col, Tag } from 'antd'
import { PlusOutlined, DeleteColumnOutlined, EditOutlined, DeleteOutlined, CaretUpOutlined, CaretDownOutlined, EyeOutlined } from '@ant-design/icons'
import cx from 'classnames'
import { PublicApi } from '@/services/api'
const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)`
.select_style_border {
border: 1px solid #EEF0F3;
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 14px;
cursor: pointer;
line-height: 28px;
position:relative;
}
.select_style_border.active {
border: 1px solid #00B382;
}
.select_style_border.active::after {
content: '';
position: absolute;
width: 0;
height: 0;
border-bottom: 12px solid #00B37A;
border-left: 12px solid transparent;
bottom: 0;
right: 0;
z-index: 5;
}
`
enum ProcessTagColor {
'red',
'orange',
'purple',
'blue',
'green'
}
enum ProcessTagType {
'订单交易流程',
'售后换货流程',
'售后退货流程',
'售后维修流程',
'加工生产流程'
}
const SelectProcesss = (props: ISchemaFieldComponentProps) => {
const [formInitValue, setFormInitValue] = useState<any>(null)
const [state, setFieldState] = useFieldState({
dataSource: [],
showMore: false
})
const { dataSource, showMore } = state
const { value, mutators, editable } = props
useEffect(() => {
PublicApi.getOrderTradingRulesTransactionProcessList().then(res => {
setFieldState({
dataSource: res.data,
showMore
})
})
}, [])
const showDataSource = showMore ? dataSource : [...dataSource].splice(0, 3)
const handleCheck = (id) => {
if (editable) {
mutators.change(id)
}
}
const toogleMore = () => {
setFieldState({
dataSource,
showMore: !showMore
})
}
const renderProcessType = (v: any) => {
return <Tag color={ProcessTagColor[v.type - 1]}>
{ProcessTagType[v.type - 1]}
</Tag>
}
return (
<div style={{ width: '100%' }}>
<SelectStyles>
{
showDataSource.map(v => <div key={v.id} onClick={() => handleCheck(v.id)} className={cx('select_style_border', value === v.id ? 'active' : '')}>
<div>
<Row style={{ color: '#303133' }}>
<Col>{v.name}</Col>
<Col style={{ marginLeft: 6 }}>
{
renderProcessType(v)
}
</Col>
</Row>
<div style={{ color: '#909399' }}>{v.explain}</div>
</div>
</div>)
}
</SelectStyles>
{dataSource.length > 3 &&
<div onClick={toogleMore} style={{ textAlign: 'center', cursor: 'pointer' }}>
显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
</div>
}
</div>
)
}
SelectProcesss.defaultProps = {}
SelectProcesss.isFieldComponent = true;
export default SelectProcesss
......@@ -520,13 +520,8 @@ export const findLastIndexFlowState = (data: any[], customKey = 'isExecute'): nu
}
// 循环数据,找到状态值,一直覆盖
for (let i = 0; i < data.length; i++) {
if (!data[i][customKey]) {
if (data[i][customKey]) {
index = i;
break;
}
// 循环到最后如果 index 还是为 0 的话,说明工作流全部跑完了,此时 index 为 data.length - 1
if (i === data.length - 1 && index === 0) {
index = data.length - 1;
}
}
return index;
......
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