Commit eb68dc0b authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents a258ea54 709d5479
import React, { useContext, useEffect, useRef, useState } from 'react'
import { Row, Col, Modal, List, Table, Button, Form, Input } from 'antd'
import { history } from 'umi'
import { OrderDetailContext } from '../../_public/order/context'
import MellowCard from '@/components/MellowCard'
import OverflowText from '@/components/OverflowText'
......@@ -28,6 +29,7 @@ interface EditableCellProps {
dataIndex: string;
record: any;
handleSave: (record: any) => void;
formItemProps: any,
}
const EditableCell: React.FC<EditableCellProps> = ({
......@@ -36,6 +38,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
children,
dataIndex,
record,
formItemProps = {},
handleSave,
...restProps
}) => {
......@@ -68,7 +71,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
if (editable) {
childNode = editing ? (
<Form.Item
style={{ margin: 0, width: 140 }}
style={{ margin: 0, width: record.width || 80 }}
name={dataIndex}
rules={[
{
......@@ -81,7 +84,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
}
]}
>
<Input type='number' ref={inputRef} onBlur={save} onPressEnter={save}/>
<Input type='number' ref={inputRef} onBlur={save} onPressEnter={save} {...formItemProps} />
</Form.Item>
) : (
<div className="editable-cell-value-wrap" style={{ paddingRight: 24 }} onClick={toggleEdit}>
......@@ -110,6 +113,9 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
const processEnum = data.processEnum
const payments = data.payments.sort((a, b) => a.batchNo - b.batchNo)
// 是否可编辑比例
const canEdit = history.location.pathname.indexOf('/readyApprovedOrder/detail') !== -1
useEffect(() => {
// 过滤支付信息 取第一个待支付或者未到账的id
if(payments.length) {
......@@ -177,15 +183,15 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
key: 'outerStatusName',
},
{
title: '支付比例',
title: '支付比例(%)',
key: 'payRate',
dataIndex: 'payRate',
formItem: 'input',
editable: data.innerStatusName === '待提交审核',
width: 80,
formItemProps: {
suffix: '%',
},
editable: canEdit,
// width: 80,
// formItemProps: {
// suffix: '%',
// },
},
{
title: '支付金额',
......@@ -233,6 +239,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = () => {
editable: col.editable,
dataIndex: col.dataIndex,
title: col.title,
formItemProps: col.formItemProps,
handleSave: handleSave,
}),
};
......
......@@ -44,7 +44,7 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
const item = rowSelectionCtl.selectRow[0]
if (item) {
schemaAction.setFieldValue('quoteNo', item.quotationNo)
schemaAction.setFieldValue('quoteId', item.inquiryListId)
schemaAction.setFieldValue('quoteId', item.id)
const data = await fetchOrderApi.getProductListByQuotationOrderId({
id: item.inquiryListId
})
......
......@@ -11,7 +11,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import { useSelfTable } from './model/useReadyAddOrder'
import { OrderModalType, PurchaseOrderInsideWorkState } from '@/constants/order'
import { OrderModalType } from '@/constants/order'
import { useHttpRequest } from '@/hooks/useHttpRequest'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import '../index.less'
......
import React, { useRef } from 'react'
import { Button, Dropdown, Menu } from 'antd'
import { baseOrderListColumns } from '../../constant'
import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { history } from 'umi'
import { CaretDownOutlined } from '@ant-design/icons'
import TableOperation from '@/components/TableOperation'
// 业务hooks, 待新增订单
......@@ -30,7 +28,7 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const buttonGroup = { '提交': true, '修改': true, '删除': true }
const buttonGroup = { '提交': true, '修改': record.showUpdate, '删除': true }
const operationHandler = {
'提交': () => handleSubmit(record.orderId),
......
......@@ -37,7 +37,6 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
const {
id,
preview,
pageStatus
} = usePageStatus()
......@@ -103,7 +102,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
dataIndex: 'priceType',
title: '商品定价',
key: 'priceType',
render: (text:any, reocrd:any)=>{
render: (text)=>{
if(text===1)
return '现货价格'
else if(text===2)
......@@ -168,7 +167,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
dataIndex: 'priceType',
title: '商品定价',
key: 'priceType',
render: (text:any, reocrd:any)=>{
render: (text)=>{
if(text===1)
return '现货价格'
else if(text===2)
......@@ -401,7 +400,6 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
}
// 不是多次支付 隐藏支付配置
if(selectedObject && selectedObject['payTimes'] > 0) {
console.log(selectedObject, 'ds')
setFieldState("payments", state => {
state.visible = true
})
......
......@@ -22,7 +22,7 @@ const TransactionRules: React.FC<{}> = () => {
const fetchData = (params: any) => {
if(!params?.name) delete params.name
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
PublicApi.getOrderTradeProcessPage(params).then(res => {
const { data } = res
resolve(data)
......@@ -56,7 +56,7 @@ const TransactionRules: React.FC<{}> = () => {
title: '操作时间',
dataIndex: 'createTime',
key: 'createTime',
render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss')
render: (text) => text && moment(text).format('YYYY-MM-DD HH:mm:ss')
},
{
title: '状态',
......@@ -68,7 +68,6 @@ const TransactionRules: React.FC<{}> = () => {
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => confirm(record)}
onCancel={cancel}
okText="是"
cancelText="否"
>
......@@ -91,7 +90,6 @@ const TransactionRules: React.FC<{}> = () => {
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => handelDelete(record)}
onCancel={cancel}
okText="是"
cancelText="否"
>
......@@ -112,10 +110,6 @@ const TransactionRules: React.FC<{}> = () => {
})
}
const cancel = () => {
console.log('cancel')
}
const handelDelete = (record: any) => {
PublicApi.postOrderTradeProcessDelete({ processId: record.processId }).then(res => {
if(res.code === 1000)
......@@ -148,9 +142,6 @@ const TransactionRules: React.FC<{}> = () => {
expressionScope={{
Actions,
}}
effects={($, actions) => {
}}
schema={{
type: 'object',
properties: {
......
import React from 'react';
import { Button, notification, message } from 'antd';
import { Button, notification, message, Typography } from 'antd';
import { GlobalConfig } from '@/global/config'
import { PublicApi } from '@/services/api';
......@@ -12,8 +12,9 @@ const COOKIEPREFIX = 'CHATROOM_';
// 主动调起聊天室 mmeberId 为接收人的memberId
export const toChatRoom = (memberId: string = '', shopType: number = 1) => {
let _curUserInfo: any = getAuth();
if (!memberId) {
document.cookie = `${COOKIEPREFIX}curMemberId="";path=/;domain=${DOMAIN}`;
document.cookie = `${COOKIEPREFIX}curUserId="";path=/;domain=${DOMAIN}`;
document.cookie = `${COOKIEPREFIX}shopType=${shopType};path=/;domain=${DOMAIN}`;
document.cookie = `${COOKIEPREFIX}ENTERPRISE_CENTER_URL=${ENTERPRISE_CENTER_URL};path=/;domain=${DOMAIN}`;
document.cookie = `${COOKIEPREFIX}CHANNEL_CENTER_URL=${CHANNEL_CENTER_URL};path=/;domain=${DOMAIN}`;
......@@ -91,7 +92,7 @@ export const notificationChatRoom = (content: any) => {
}
notification.open({
message: '你收到一条消息',
description: _text,
description: <Typography.Text ellipsis>{_text}</Typography.Text>,
btn,
key,
duration: 10,
......
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