Commit 807a81e5 authored by XieZhiXiong's avatar XieZhiXiong
parents a8ee8c7c a6ceabf8
......@@ -27,7 +27,9 @@
/src/services/index.ts
.vscode
config/base.config.json
config/base.router.ts
src/global/config/global.d.ts
src/global/config/navigation.config.ts
src/services/*Api.ts
src/services/*Api
/*
* @Author: XieZhiXiong
* @Date: 2020-09-15 17:48:36
* @LastEditors: zwp
* @LastEditTime: 2020-12-03 10:10:10
* @Description: 内外部流转记录组件
*/
import React from 'react';
import {
Steps,
Tabs,
} from 'antd';
import MellowCard from '@/components/MellowCard';
import styles from './index.less';
interface AuditProcessProp {
outerVerifyCurrent?: number;
innerVerifyCurrent?: number;
outerVerifySteps?: {
step: number,
stepName: string,
roleName: string,
status?: 'wait' | 'process' | 'finish' | 'error',
}[];
innerVerifySteps?: {
step: number,
stepName: string,
roleName: string,
status?: 'wait' | 'process' | 'finish' | 'error',
}[];
customTitleKey?: string
customKey?: string
};
const AuditProcess: React.FC<AuditProcessProp> = ({
outerVerifyCurrent = 0,
innerVerifyCurrent = 0,
outerVerifySteps = [],
innerVerifySteps = [],
customTitleKey,
customKey
}) => (
<MellowCard>
<Tabs onChange={() => {}}>
{
outerVerifySteps?.length &&
<Tabs.TabPane tab="外部审核流程" key="1">
<Steps style={{ marginTop: 30, overflow: "auto" }} progressDot current={outerVerifyCurrent}>
{outerVerifySteps.map(item => (
<Steps.Step
key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName}
description={item.roleName}
status={item.status}
/>
))}
</Steps>
</Tabs.TabPane>
}
{
innerVerifySteps?.length &&
<Tabs.TabPane tab="内部审核流程" key="2">
<Steps style={{ marginTop: 30, overflow: "auto" }} progressDot current={innerVerifyCurrent}>
{innerVerifySteps.map(item => (
<Steps.Step
key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName}
description={item.roleName}
status={item.status}
/>
))}
</Steps>
</Tabs.TabPane>
}
</Tabs>
</MellowCard>
);
export default AuditProcess;
/*
* @Author: XieZhiXiong
* @Date: 2020-09-15 17:48:36
* @LastEditors: zwp
* @LastEditTime: 2021-01-06 10:54:54
* @Description: 内外部流转记录组件
*/
import React from 'react';
import {
Steps,
Tabs,
} from 'antd';
import MellowCard from '@/components/MellowCard';
import styles from './index.less';
interface AuditProcessProp {
outerVerifyCurrent?: number;
innerVerifyCurrent?: number;
outerVerifySteps?: {
step: number,
stepName: string,
roleName: string,
status?: 'wait' | 'process' | 'finish' | 'error',
}[];
innerVerifySteps?: {
step: number,
stepName: string,
roleName: string,
status?: 'wait' | 'process' | 'finish' | 'error',
}[];
customTitleKey?: string
customKey?: string
};
const AuditProcess: React.FC<AuditProcessProp> = ({
outerVerifyCurrent = 0,
innerVerifyCurrent = 0,
outerVerifySteps = [],
innerVerifySteps = [],
customTitleKey,
customKey
}) => (
<MellowCard>
<Tabs onChange={() => {}}>
{
outerVerifySteps?.length &&
<Tabs.TabPane tab="外部审核流程" key="1">
<Steps style={{ marginTop: 30, overflow: "auto", paddingTop: 5, paddingBottom: 5, }} progressDot current={outerVerifyCurrent}>
{outerVerifySteps.map(item => (
<Steps.Step
key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName}
description={item.roleName}
status={item.status}
/>
))}
</Steps>
</Tabs.TabPane>
}
{
innerVerifySteps?.length &&
<Tabs.TabPane tab="内部审核流程" key="2">
<Steps style={{ marginTop: 30, overflow: "auto", paddingTop: 5, paddingBottom: 5, }} progressDot current={innerVerifyCurrent}>
{innerVerifySteps.map(item => (
<Steps.Step
key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName}
description={item.roleName}
status={item.status}
/>
))}
</Steps>
</Tabs.TabPane>
}
</Tabs>
</MellowCard>
);
export default AuditProcess;
......@@ -101,7 +101,7 @@ const AddUser: React.FC<{}> = () => {
// 模拟请求
const fetchUserList = async (params: any) => {
const data = await PublicApi.getMemberRolePage(params)
const data = await PublicApi.getMemberRolePageByname(params)
return data.data
}
......
......@@ -386,9 +386,9 @@ const ModifyDirectChannel:React.FC<{}> = () => {
}
}
const onSave = () => {
const onSave = async () => {
setIsDisabledSave(true)
console.log(originHasIds,'originHasIds')
let logistics = await logisticsForm.validateFields()
let params: any = {
id: channelDetails.id,
isMemberPrice: formPrice.getFieldValue('isMemberPrice'),
......@@ -398,7 +398,8 @@ const ModifyDirectChannel:React.FC<{}> = () => {
delete item.id
}
return item
})
}),
logistics: logistics,
}
PublicApi.postProductChannelCommodityUpdatePriceChannelCommodity(params).then(res => {
setIsDisabledSave(false)
......
......@@ -314,7 +314,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
dataIndex: 'memberPrice',
align: 'center',
key: 'memberPrice',
render: (text, record) => record.isMemberPrice ? (text * 100 + '%') : null
render: (text, record) => record.isMemberPrice ? (text * 10000 / 100 + '%') : null
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
......
import React, { useState, useRef } from 'react'
import { Card, Button, Modal, Row, Col } from 'antd'
import { Card, Button, Modal, Row, Col, message } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
......@@ -69,15 +69,31 @@ const showDataSource = [
const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const [saleVisible, setSaleVisible] = useState<any>(false)
const [checkedId, setCheckedId] = useState<any>()
const [recordId, setRecordId] = useState<any>()
const ref = useRef<any>({})
// 售后唤起弹窗 @todo
const handleSaleAfter = (id) => {
setSaleVisible(true)
setRecordId(id)
}
const handleOk = () => {
if(checkedId) {
switch(checkedId) {
case 1:
history.push(`/memberCenter/afterService/exchangeApplication/exchangePrSubmit/add?orderId=${recordId}`)
break;
case 2:
history.push(`/memberCenter/afterService/returnApplication/returnPrSubmit/add?orderId=${recordId}`)
break;
case 3:
history.push(`/memberCenter/afterService/repairApplication/repairPrSubmit/add?orderId=${recordId}`)
break;
}
} else {
message.error("请选择售后类型")
}
}
const handleEvaluate = (id) => {
......@@ -92,8 +108,9 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
key: 'ctl',
render: (text, record) => <>
{ record.externalState === PurchaseOrderOutWorkState.FINISH_ORDER && <Button type='link' onClick={() => handleEvaluate(record.id)}>评价</Button> }
{/* todo */}
{/* <Button type='link' onClick={() => handleSaleAfter(record.id)}>售后</Button> */}
{
record.receivingTimes >= 1 && <Button type='link' onClick={() => handleSaleAfter(record.id)}>售后</Button>
}
</>
}
])
......
......@@ -36,6 +36,16 @@ const DemandModalTable:React.FC<DemandModalTableProps> = (props) => {
const data = await fetchOrderApi.getProductListByDemandOrderId({
id: item.id
})
// 判断所选择的商品是否属于同一个工作流
const res = await PublicApi.postOrderIsWorkFlow({
memberId: data[0].memberId,
memberRoleId: data[0].memberRoleId,
productIds: data.map(item => item.productId),
orderModel: schemaAction.getFieldValue('orderModel')
}, { ctlType: 'none' })
console.log(res, 'res')
// schemaAction.setFieldValue('orderProductRequests', data)
// 把地址信息冗余给商品字段render
schemaAction.setFieldValue('orderProductRequests', await filterProductDataById([], data))
......
......@@ -36,6 +36,16 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
const data = await fetchOrderApi.getProductListByQuotationOrderId({
id: item.inquiryListId
})
// 判断所选择的商品是否属于同一个工作流
const res = await PublicApi.postOrderIsWorkFlow({
memberId: data[0].memberId,
memberRoleId: data[0].memberRoleId,
productIds: data.map(item => item.productId),
orderModel: schemaAction.getFieldValue('orderModel')
}, { ctlType: 'none' })
console.log(res, 'res')
// 将询价报价单的id字段 冗余给商品列表
// schemaAction.setFieldValue('orderProductRequests', data.map((v: any) => {
// v.memberId = item.offerMemberId
......
import React, { useState, useRef, useContext, useEffect } from 'react'
import { Form, Input, Select } from 'antd';
import { history } from 'umi'
import styles from "../../index.less"
export interface PayInfoCellProps {
title: React.ReactNode;
......@@ -65,6 +67,19 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
}) => {
const formItemRef = useRef<any>();
const { form, childOptions, setChildOptions, originOptions } = useContext(EditableContext);
// fix: 没有childOptions 导致第一次进入编辑页面无法显示支付渠道
let _childOptions = null;
if(history.location.query?.id && title === "支付渠道") {
let payList = originOptions.filter(item => item.payType === record.payWay) || []
if(payList.length) {
_childOptions = payList[0].payList.map(_item => ({
label: _item.way,
value: _item.wayId,
}))
}
}
const save = async e => {
try {
const values = await form.validateFields();
......@@ -106,7 +121,7 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
return <Select
ref={formItemRef}
onChange={save}
options={childOptions}
options={childOptions.length ? childOptions : _childOptions}
{...rest}
id={formId}
/>
......@@ -139,7 +154,7 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
);
}
return <td {...restProps}>{childNode}</td>;
return <td {...restProps} style={{height: 90}}>{childNode}</td>;
}
PayInfoCell.defaultProps = {}
......
......@@ -217,7 +217,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
// 查询商品对应的工作流 获取电子合同
FormEffectHooks.onFieldValueChange$('orderProductRequests').subscribe(state => {
if (state.value?.length) {
if (state.value?.length && state.loading) {
useElectronicContract(ctx)
}
})
......@@ -278,7 +278,7 @@ export const useElectronicContract = (ctx: ISchemaFormActions | ISchemaFormAsync
ctx.setFieldState("usingElectronicContracts", state => {
state.props["x-component-props"].contract = { contractTemplateId: data['electronicContractId'], ..._data, }
})
ctx.setFieldValue("electronicContractName", _data.contractName)
ctx.setFieldValue("electronicContractName", _data?.contractName)
})
}
})
......
......@@ -3,7 +3,6 @@ import { PayInfoCell, EditableRow } from '../components/payInfoTableCell'
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import { useEffect, useState, useRef, useContext } from 'react'
import { PublicApi } from '@/services/api'
import { orderCombination } from '@/pages/transaction/saleOrder/readyApprovedOrder/constant'
export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, memberId: any, memberRoleId: any, orderProducts: any): any => {
const paywayData = useRef<any>({})
......
import React, { useRef } from 'react'
import { history, Link } from 'umi'
import { Button, Row, Col } from 'antd'
import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview'
import { formatTimeString } from '@/utils'
import { ORDER_TYPE, PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
import {
Chart,
Interval,
Axis,
Tooltip,
Coordinate,
Legend,
View,
Annotation,
} from 'bizcharts';
import DataSet from "@antv/data-set";
// 业务hooks
export const useSelfTable = () => {
const ref = useRef<any>({})
const customOrderColumns: any[] = [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return (
<EyePreview url={`/memberCenter/tranactionAbility/purchaseOrder/readyReceiveOrder/preview?id=${record.id}`}>
{text}
</EyePreview>
)
}
},
{
title: '订单摘要/下单时间',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe',
render: (text, record) => <>
<div>{text}</div>
<div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div>
</>,
width: 200
},
{
title: '采购会员',
align: 'left',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
},
{
title: '总金额',
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
render: text => '¥' + text
},
{ title: '收货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 收货单号跳转
{
title: '入库单号',
align: 'center',
dataIndex: 'invoiceNumber',
key: 'invoiceNumber',
render: (t, r) => r.orderDeliveryDetailsId ? <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${r.orderDeliveryDetailsId}&preview=1`}>{t}</Link> : <a href={`https://www.kuaidi100.com/chaxun?nu=${t}`} target="blank">{t}</a>
},
{
title: '订单类型',
align: 'center',
dataIndex: 'type',
key: 'type',
render: (text) => ORDER_TYPE[text]
},
{
title: '外部状态',
align: 'center',
dataIndex: 'externalState',
key: 'externalState',
render: text => <StatusColors status={text} type='out'/>
},
{
title: '内部状态',
align: 'center',
dataIndex: 'interiorState',
key: 'interiorState',
render: (text) => <StatusColors status={text} type='inside'/>
},
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ (record.interiorState === PurchaseOrderInsideWorkState.CONFIRM_RECEIPT || record.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER) &&
<Button type='link' onClick={() => handleConfirm(record)}>确认收货</Button>
}
</>
}
]
const handleConfirm = async (record) => {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyReceiveOrder/detail?id=${record.id}&orderDeliveryDetailsId=${record.orderDeliveryDetailsId}`);
}
return {
columns: customOrderColumns
}
}
import React, { useRef } from 'react'
import { history, Link } from 'umi'
import { Button, Row, Col } from 'antd'
import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview'
import { formatTimeString } from '@/utils'
import { ORDER_TYPE, PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
import {
Chart,
Interval,
Axis,
Tooltip,
Coordinate,
Legend,
View,
Annotation,
} from 'bizcharts';
import DataSet from "@antv/data-set";
// 业务hooks
export const useSelfTable = () => {
const ref = useRef<any>({})
const customOrderColumns: any[] = [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return (
<EyePreview url={`/memberCenter/tranactionAbility/purchaseOrder/readyReceiveOrder/preview?id=${record.id}`}>
{text}
</EyePreview>
)
}
},
{
title: '订单摘要/下单时间',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe',
render: (text, record) => <>
<div>{text}</div>
<div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div>
</>,
width: 200
},
{
title: '采购会员',
align: 'left',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
},
{
title: '总金额',
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
render: (t, r) => r.type === 7 || r.type === 8 ? t : '¥' + t
},
{ title: '收货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 收货单号跳转
{
title: '入库单号',
align: 'center',
dataIndex: 'invoiceNumber',
key: 'invoiceNumber',
render: (t, r) => r.orderDeliveryDetailsId ? <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${r.orderDeliveryDetailsId}&preview=1`}>{t}</Link> : <a href={`https://www.kuaidi100.com/chaxun?nu=${t}`} target="blank">{t}</a>
},
{
title: '订单类型',
align: 'center',
dataIndex: 'type',
key: 'type',
render: (text) => ORDER_TYPE[text]
},
{
title: '外部状态',
align: 'center',
dataIndex: 'externalState',
key: 'externalState',
render: text => <StatusColors status={text} type='out'/>
},
{
title: '内部状态',
align: 'center',
dataIndex: 'interiorState',
key: 'interiorState',
render: (text) => <StatusColors status={text} type='inside'/>
},
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ (record.interiorState === PurchaseOrderInsideWorkState.CONFIRM_RECEIPT || record.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER) &&
<Button type='link' onClick={() => handleConfirm(record)}>确认收货</Button>
}
</>
}
]
const handleConfirm = async (record) => {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyReceiveOrder/detail?id=${record.id}&orderDeliveryDetailsId=${record.orderDeliveryDetailsId}`);
}
return {
columns: customOrderColumns
}
}
......@@ -278,9 +278,13 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
// // 查询已设置交易规则的列表
const fatchSetedProducts = (id) => {
PublicApi.getOrderTradingRulesProductIdList({shopId: id}).then(res => {
const { data, code } = res
setIdNotInList(() => data?.productIds || [])
let transactionProcesssId = addSchemaAction.getFieldValue("transactionProcesssId")
addSchemaAction.getFieldState("transactionProcesssId", state => {
let type = state.dataSource.filter(item => item.id === transactionProcesssId)[0]["type"]
PublicApi.getOrderTradingRulesProductIdList({shopId: id, type}).then(res => {
const { data, code } = res
setIdNotInList(() => data?.productIds || [])
})
})
}
......@@ -315,6 +319,18 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
})
fatchSetedProducts(parentState.value[0])
})
$('onFieldInputChange', 'transactionProcesssId').subscribe(parentState => {
// 不是下单交易类型 隐藏电子合同
if(parentState.dataSource.filter(item => item.id === parentState.value)[0]["type"] !== 1) {
setFieldState("MEGA_LAYOUT1_1", state => {
state.visible = false
})
} else {
setFieldState("MEGA_LAYOUT1_1", state => {
state.visible = true
})
}
})
}}
onSubmit={handleSubmit}
actions={addSchemaAction}
......
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