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