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

Merge branch 'zwpFix' into dev

parents 17400726 a1cb76ba
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-15 17:48:36
* @LastEditors: zwp
* @LastEditTime: 2020-12-03 10:10:10
* @LastEditTime: 2021-01-06 10:54:54
* @Description: 内外部流转记录组件
*/
import React from 'react';
......@@ -45,7 +45,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
{
outerVerifySteps?.length &&
<Tabs.TabPane tab="外部审核流程" key="1">
<Steps style={{ marginTop: 30, overflow: "auto" }} progressDot current={outerVerifyCurrent}>
<Steps style={{ marginTop: 30, overflow: "auto", paddingTop: 5, paddingBottom: 5, }} progressDot current={outerVerifyCurrent}>
{outerVerifySteps.map(item => (
<Steps.Step
key={customKey ? item[customKey] : item.step}
......@@ -60,7 +60,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
{
innerVerifySteps?.length &&
<Tabs.TabPane tab="内部审核流程" key="2">
<Steps style={{ marginTop: 30, overflow: "auto" }} progressDot current={innerVerifyCurrent}>
<Steps style={{ marginTop: 30, overflow: "auto", paddingTop: 5, paddingBottom: 5, }} progressDot current={innerVerifyCurrent}>
{innerVerifySteps.map(item => (
<Steps.Step
key={customKey ? item[customKey] : item.step}
......
......@@ -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>({})
......
......@@ -60,7 +60,7 @@ export const useSelfTable = () => {
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
render: text => '¥' + text
render: (t, r) => r.type === 7 || r.type === 8 ? t : '¥' + t
},
{ title: '收货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 收货单号跳转
......
......@@ -278,10 +278,14 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
// // 查询已设置交易规则的列表
const fatchSetedProducts = (id) => {
PublicApi.getOrderTradingRulesProductIdList({shopId: id}).then(res => {
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 || [])
})
})
}
return (
......@@ -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