Commit d8fd8efc authored by GuanHua's avatar GuanHua
parents 7bdf2640 9d30db74
......@@ -24,6 +24,7 @@
config/base.config.json
/src/services/index.ts
src/global/config/global.d.ts
src/global/config/global.d.ts
src/services/*Api.ts
src/services/*Api
.vscode
......@@ -31,26 +31,6 @@ const router = {
hideInMenu: true,
component: '@/pages/systemManage/sensitiveWords/template',
},{
// 汇率列表
path: '/system/exchangeRate',
name: 'exchangeRate',
hidePageHeader: true,
component: '@/pages/systemManage/exchangeRate',
},{
// 汇率列表 - 新增
path: '/system/exchangeRate/add',
name: 'exchangeRateAdd',
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/systemManage/exchangeRate/template',
},{
// 汇率列表 - 编辑
path: '/system/exchangeRate/edit',
name: 'exchangeRateEdit',
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/systemManage/exchangeRate/template',
},{
// 单位列表
path: '/system/unit',
name: 'unit',
......
......@@ -47,5 +47,28 @@ module.exports = {
// Passive mode is forced (EPSV command is not sent)
forcePasv: true
})
},
25: {
SITE_ID: '1',
BACK_GATEWAY: 'http://10.0.0.25:8100',
USE_ROUTE_CONFIG: true,
SOCKET_URL: 'ws://10.0.0.25:8100',
ssh: JSON.stringify({
user: "root",
// Password optional, prompted if none given
password: "123456",
host: "10.0.0.25",
port: 22,
localRoot: path.resolve('./dist/'),
remoteRoot: "/data/.jenkins/workspace/lingxi-business-system/dist/",
// include: ["*", "**/*"], // this would upload everything except dot files
include: ["*"],
// e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)
// exclude: ["dist/**/*.map", "node_modules/**", "node_modules/**/.*", ".git/**"],
// delete ALL existing files at destination before uploading, if true
deleteRemote: true,
// Passive mode is forced (EPSV command is not sent)
forcePasv: true
})
}
}
\ No newline at end of file
}
......@@ -5,6 +5,7 @@
"scripts": {
"upload:scm": "cross-env local=scm taskName=upload yarn scripts:build",
"upload:10": "cross-env local=10 taskName=upload yarn scripts:build",
"upload:25": "cross-env local=25 taskName=upload yarn scripts:build",
"api": "god-ytt",
"start:analyze": "ANALYZE=1 umi dev",
"scripts:build": "node scripts/run",
......@@ -18,13 +19,15 @@
"build:clean": "umi build",
"build:scm": "cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com yarn build",
"build:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 yarn build",
"build:25": "cross-env SITE_ID=352 BACK_GATEWAY=http://10.0.0.25:8100 yarn build",
"postinstall": "umi generate tmp",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test",
"test:coverage": "umi-test --coverage",
"start:cross": "cross-env SITE_ID=352 SOCKET_URL=ws://10.0.0.25:8100 yarn start",
"start:cross-dev": "cross-env SITE_ID=352 SOCKET_URL=ws://10.0.0.25:8100 yarn start",
"start:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 yarn start"
"start:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 yarn start",
"start:scm": "cross-env BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com SITE_ID=1 yarn start"
},
"lint-staged": {
"*.{js,jsx,less,md,json}": [
......@@ -73,7 +76,7 @@
"cross-env": "^7.0.2",
"express": "^4.17.1",
"god-upload-scp": "1.2.0",
"god-yapi2ts": "^1.6.0",
"god-yapi2ts": "^1.9.0",
"gulp": "^4.0.2",
"http-proxy-middleware": "^1.0.5",
"json2ts": "^0.0.7",
......
/*
* @Author: XieZhiXiong
* @Date: 2020-09-15 17:48:36
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-15 17:49:54
* @LastEditors: zwp
* @LastEditTime: 2020-12-01 18:12:54
* @Description: 内外部流转记录组件
*/
import React from 'react';
......@@ -32,28 +32,34 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
}) => (
<MellowCard>
<Tabs onChange={() => {}}>
<Tabs.TabPane tab="外部审核流程" key="1">
<Steps style={{ marginTop: 30 }} progressDot current={outerVerifyCurrent}>
{outerVerifySteps.map(item => (
<Steps.Step
key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName}
description={item.roleName}
/>
))}
</Steps>
</Tabs.TabPane>
<Tabs.TabPane tab="内部审核流程" key="2">
<Steps style={{ marginTop: 30 }} progressDot current={innerVerifyCurrent}>
{innerVerifySteps.map(item => (
<Steps.Step
key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName}
description={item.roleName}
/>
))}
</Steps>
</Tabs.TabPane>
{
outerVerifySteps?.length > 0 &&
<Tabs.TabPane tab="外部审核流程" key="1">
<Steps style={{ marginTop: 30 }} progressDot current={outerVerifyCurrent}>
{outerVerifySteps.map(item => (
<Steps.Step
key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName}
description={item.roleName}
/>
))}
</Steps>
</Tabs.TabPane>
}
{
innerVerifySteps?.length > 0 &&
<Tabs.TabPane tab="内部审核流程" key="2">
<Steps style={{ marginTop: 30 }} progressDot current={innerVerifyCurrent}>
{innerVerifySteps.map(item => (
<Steps.Step
key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName}
description={item.roleName}
/>
))}
</Steps>
</Tabs.TabPane>
}
</Tabs>
</MellowCard>
);
......
......@@ -220,7 +220,7 @@ export default {
'menu.system.unit': '单位',
'menu.system.unitAdd': '新建单位',
'menu.system.unitEdit': '编辑单位',
'menu.system.platformArg': '平参数',
'menu.system.platformArg': '平参数',
'menu.productionNotice': '生产通知单管理',
'menu.productionNotice.query': '生产通知单查询',
......
......@@ -135,7 +135,7 @@ const Products: React.FC<{}> = () => {
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getProductCommodityGetPlatformCommodityList(params).then(res => {
PublicApi.getProductCommodityGetPlatformCommodityList({...params, status: 2}).then(res => {
const { data } = res
resolve(data)
})
......
......@@ -101,6 +101,10 @@ const StatusColors:React.FC<StatusColorsProps> = (props) => {
const { status, type } = props
const statusText = typeMaps[type]
const statusShowColor = matchStatusColor(status)
// 单独处理支付比例 确认到账的状态颜色
if(type === 'payOut' && status === 3) {
return (<Tag color="#41CC9E">{statusText[status]}</Tag>)
}
return (<Tag color={statusShowColor}>{statusText[status]}</Tag>)
}
......
......@@ -84,7 +84,9 @@ const warehouseColumns: any[] = [
const modalPriceActions = createFormActions()
// 总计金额联动框
export const MoneyTotalBox = ({ dataSource, isEditData }) => {
const { orderProductRequests = [], receiverAddressId } = dataSource || {}
const { orderProductRequests = [], receiverAddressId, orderModel } = dataSource || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const sum = orderProductRequests.reduce((prev, next) => prev + Number((next.price || 0)), 0)
const modelRef = useRef<any>({})
const [freePrice, setFreePrice] = useState<number>(0)
......@@ -119,7 +121,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
}, [orderProductRequests])
return <RowStyle>
<Col span={2}>
<div>合计金额</div>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{sum}</div>
</Col>
<Col span={2}>
......@@ -127,7 +129,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
<div>{freePrice}</div>
</Col>
<Col span={2}>
<div>总计金额</div>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{sum + freePrice}</div>
</Col>
<ModalForm
......@@ -232,7 +234,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
rules={[
{
required: true,
message: `单价是必填的`,
message: `此项为必填项`,
},
]}
>
......@@ -252,7 +254,8 @@ const EditableCell: React.FC<EditableCellProps> = ({
const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const { ctl, data } = useContext(OrderDetailContext)
const { page_type } = usePageStatus()
const { orderProductRequests = [] } = data || {}
const { orderProductRequests = [], orderModel } = data || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const [warehouseVisible, setWarehouseVisible] = useState(false)
const [checkProductId, setCheckProductId] = useState(0) // 选中的商品id
......@@ -351,7 +354,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
key: 'unit',
},
{
title: '单价(元)',
title: creditsCommodity ? '所需积分' : '单价(元)',
dataIndex: 'price',
align: 'left',
key: 'price',
......@@ -365,7 +368,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
render: (text, record) => record.isMemberPrice ? (text + '%') : null
},
{
title: '采购数量',
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount'
......@@ -378,7 +381,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
render: () => '是'
},
{
title: '金额',
title: creditsCommodity ? '所需积分小计' : '金额',
dataIndex: 'price',
align: 'center',
key: 'price',
......
......@@ -57,4 +57,4 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
FirstApprovedOrder.defaultProps = {}
export default FirstApprovedOrder
\ No newline at end of file
export default FirstApprovedOrder
import React from 'react';
import { Card } from 'antd';
import AppendixItem from './AppendixItem';
interface Iprops {
files: {name: string, value: string}[]
}
const Appendix: React.FC<Iprops> = (props) => {
const { files = [] } = props;
return (
<>
<Card title={"附件"} style={{height: '100%'}} bordered={false}>
{
files.map((item, key) => {
return (
<AppendixItem key={key} name={item.name} url={item.value}/>
)
})
}
</Card>
</>
)
}
export default Appendix
\ No newline at end of file
import React from 'react';
import pdf_icon from '@/asserts/pdf_icon.png';
const styles = {
display: 'flex',
// flexDirection: "row",
alignItem: 'center',
color: '#00B37A',
backgroundColor: '#F4F5F7',
padding: '10px 10px',
cursor: 'pointer',
height: '100%'
}
interface Iprops {
style?: React.CSSProperties,
name: string,
url: string
}
const AppendixItem: React.FC<Iprops> = (props) => {
const handleDownload = (name:string, url: string) => {
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", name);
document.body.appendChild(link) //a标签插至页面中
link.click();
document.body.removeChild(link);
}
return (
<div style={styles}>
<img src={pdf_icon} style={{width: '20px', marginRight: '15px'}} />
<div onClick={() => handleDownload(props.name, props.url)}>{props.name}</div>
</div>
)
}
export default React.memo(AppendixItem)
\ No newline at end of file
......@@ -5,51 +5,10 @@
* @Description: 附件
*/
import React from 'react';
import { Card } from 'antd';
import pdf_icon from '@/asserts/pdf_icon.png';
import Appendix from './Appendix';
import AppendixItem from './AppendixItem';
const styles = {
display: 'flex',
flexDirection: 'row',
alignItem: 'center',
color: '#00B37A',
backgroundColor: '#F4F5F7',
padding: '10px 10px',
cursor: 'pointer',
height: '100%'
}
const AppendixItem = (props) => {
return (
<div style={styles}>
<img src={pdf_icon} style={{width: '20px', marginRight: '15px'}} />
<div >{props.name}</div>
</div>
)
}
interface Iprops {
files: any[]
}
const Appendix: React.FC<Iprops> = (props) => {
const { files = [] } = props;
return (
<>
<Card title={"附件"} style={{height: '100%'}} bordered={false}>
{
files.map((item, key) => {
return (
<AppendixItem key={key} name={item.name} value={item.value}/>
)
})
}
</Card>
</>
)
}
export default Appendix;
\ No newline at end of file
export {
Appendix,
AppendixItem
}
\ No newline at end of file
......@@ -18,10 +18,6 @@ interface Iprops {
deliveryAddress: string,
deliveryUserName: string,
deliveryUserTel: string,
editDeliverAddress: boolean,
deliverAddressOnChange?: (value: string) => void,
activeAddress?: string,
deliverAddressOption?: {label: string, value: string}[]
}
const DeliveryInfomation: React.FC<Iprops> = (props) => {
......@@ -49,37 +45,15 @@ const DeliveryInfomation: React.FC<Iprops> = (props) => {
<Col offset={5}>{props.receiveAddress}</Col>
</Row>
</Col>
{
props.editDeliverAddress
? <Col span={9}>
<Row style={{marginBottom: '20px'}}>
<Col span={5}>发货地址</Col>
<Col span={19}>
<Select style={{width: '100%'}} value={props.activeAddress}>
{
props.deliverAddressOption.map((item) => {
return (
<Option key={item.value} value={item.value}>
{item.label}
</Option>
)
})
}
{/* <Option value={"1"}>test</Option> */}
</Select>
</Col>
</Row>
</Col>
: <Col span={9} style={!props.deliveryUserName ? {display: 'none'} : {}}>
<Row style={{marginBottom: '20px'}}>
<Col span={5}>发货地址</Col>
<Col>{props.deliveryUserTel} / {props.deliveryUserName}</Col>
</Row>
<Row>
<Col offset={5}>{props.deliveryAddress}</Col>
</Row>
</Col>
}
<Col span={9} style={!props.deliveryUserName ? {display: 'none'} : {}}>
<Row style={{marginBottom: '20px'}}>
<Col span={5}>{props.deliveryType == 2 ? '自提地址' : '发货地址' }</Col>
<Col>{props.deliveryUserTel} / {props.deliveryUserName}</Col>
</Row>
<Row>
<Col offset={5}>{props.deliveryAddress}</Col>
</Row>
</Col>
</Row>
</Card>
......
import React, { useState, useEffect } from 'react';
import { Button, Drawer } from 'antd';
import Content from './content';
import { PublicApi } from '@/services/api'
import { createFormActions } from '@formily/antd'
const actions = createFormActions();
......@@ -71,7 +70,7 @@ const DrawerProcessDetail: React.FC<Iprops> = (props) => {
productProps={productProps}
quantity={quantity}
processUnitPrice={processUnitPrice}
type={"detail"}
type={"view"}
files={files}
actions={actions}
/>
......
......@@ -18,6 +18,8 @@
padding: 10px 24px;
margin-bottom: 15px;
cursor: pointer;
border-left: 2px solid transparent;
transition: all 0.2s ease-in-out;
}
.active {
......
import React, { useState, useRef, useEffect } from 'react';
import React, { useState, useRef, useEffect, useImperativeHandle, useMemo, useCallback } from 'react';
import styles from './content.less';
import { Row, Col, Anchor } from 'antd';
import { Row, Col } from 'antd';
import classnames from 'classnames';
// import {FileList, UploadFile} from '../../components/UploadFile';
import Appendix from '../Appendix';
import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd'
import {useScroll } from '@umijs/hooks';
import { AppendixItem } from '../Appendix';
const actions = createFormActions();
export interface IMenu {
const schema = {
type: 'object',
properties: {
layout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 9,
labelAlign: 'left'
},
properties: {
quantity: {
type: 'string',
title: '加工数量',
'x-rules': [
{
required: true,
message: '请填写加工数量'
}
]
},
processUnitPrice: {
type: 'string',
title: '加工单价',
'x-rules': [
{
required: true,
message: '请填写加工单价'
}
]
}
}
}
}
}
interface Iprops {
id: string,
name: string,
value: number
category: string,
brand: string,
files: {name: string, url: string}[],
productProps: { name: string, value: string}[],
quantity: number | string,
unitName: string,
processUnitPrice: number | string,
formSubmit: (value: any) => void,
type: 'edit' | 'view',
fileOnChange?: (value: any) => void
ref: any
}
const Content = (props) => {
const Content: React.FC<Iprops> = React.forwardRef((props, conftentRef) => {
const { id, name, category, brand, unitName, files, productProps, quantity, processUnitPrice } = props;
const [active, setActive] = useState<string>("基本信息");
const [menu, setMenu] = useState<IMenu[]>([])
const ref = useRef<any>(null);
const [menu, setMenu] = useState<any>([])
const [scroll, ref] = useScroll<HTMLDivElement>();
const getMenuItemCs = (name: string) => {
const getMenuItemCs = useCallback((minHeight: number, maxHeight: number) => {
return classnames({
[styles.menuItem]: true,
[styles.active]: name === active
[styles.active]: scroll.top >= minHeight && scroll.top < maxHeight
})
}
}, [scroll])
useImperativeHandle(conftentRef, () => ({
submit: () => {
actions.submit();
}
}));
const activeAndScroll = (item) => {
setActive(item.name);
ref.current.scrollTop = item.value;
ref.current.scrollTop = item.min;
}
useEffect(() => {
const basic = [{name: '基本信息', value: 0}]; // 238
let height = 238;
const basic = [{name: '基本信息', min: 0, max: height}]; // 238
let flag = false;
const attributes = productProps && productProps.map((item) => {
const prevHeight = height;
height = height + 112;
flag = true;
return {
name: item.customerAttribute?.name || item.name,
value: prevHeight
name: item.name,
min: prevHeight,
max: height
}
}) || [];
const files = [{name: '附件', value: flag ? height : height - 112}];
height += 130;
const progress = [{name: '加工要求', value: height}];
setMenu(basic.concat(attributes, files, progress));
}, [productProps])
const aboveFileHeight = flag ? height : height - 112;
const maxFileHeight = files.length > 0 && files.reduce((prev, next) => {
return prev += 60;
}, aboveFileHeight) || aboveFileHeight + 128;
const filesMenu = [{name: '附件', min: aboveFileHeight, max: maxFileHeight}];
const progress = [{name: '加工要求', min: maxFileHeight , max: maxFileHeight + 300}];
setMenu(basic.concat(attributes, filesMenu, progress));
}, [productProps, files])
const handleFormSubmit = (value) => {
props.formSubmit(value);
}
return (
<div className={styles.container}>
<div className={styles.menu}>
{
menu.map((item,key) => {
return (
<div key={item.name} className={getMenuItemCs(item.name)} onClick={() => activeAndScroll(item)}>
<div key={item.name} className={getMenuItemCs(item.min, item.max)} onClick={() => activeAndScroll(item)}>
{item.name}
</div>
)
......@@ -102,10 +164,18 @@ const Content = (props) => {
<div className={styles.header}>{"附件"}</div>
<div className={styles.info}>
{
files.length === 0
files.length === 0 && props.type != 'edit'
? <p></p>
: <Appendix files={files} />
: null
}
{
files.map((item,key) => {
return (
<AppendixItem name={item.name} url={item.url} key={key} />
)
})
}
</div>
</div>
<div className={styles.common} >
......@@ -116,22 +186,37 @@ const Content = (props) => {
<Col span={12}>{unitName}</Col>
</Row>
</div>
<div className={styles.info}>
<>
<Row className={styles.infoRow}>
<Col className={styles.label} span={4}>加工数量</Col>
<Col span={12}>{quantity}</Col>
</Row>
<Row className={styles.infoRow}>
<Col className={styles.label} span={4}>加工单价</Col>
<Col span={12}>{processUnitPrice}</Col>
</Row>
</>
<div className={styles.info} style={{marginBottom: '450px'}}>
{
props.type == 'edit'
? <NiceForm
schema={schema}
actions={actions}
// onSubmit={props.formSubmit}
onSubmit={handleFormSubmit}
initialValues={{
quantity: quantity,
processUnitPrice: processUnitPrice
}}
/>
: (
<>
<Row className={styles.infoRow}>
<Col className={styles.label} span={4}>加工数量</Col>
<Col span={12}>{quantity}</Col>
</Row>
<Row className={styles.infoRow}>
<Col className={styles.label} span={4}>加工单价</Col>
<Col span={12}>{processUnitPrice}</Col>
</Row>
</>
)
}
</div>
</div>
</div>
</div>
)
}
})
export default Content;
\ No newline at end of file
export default React.memo(Content);
\ No newline at end of file
import React, {useEffect, useState} from 'react';
import { ColumnsType } from 'antd/es/table';
import { Table, Row, Col, Popconfirm, Radio } from 'antd';
import styles from './index.less'
import moment from 'moment';
import { history } from 'umi'
// import { ASSIGN_PENDING_RECEIVE_DETAIL, PENDING_DELIVERD_PATH, PENDING_RECEIPT_PATH } from '../../common';
interface Iprops {
tab: string,
columns: ColumnsType<any>,
dataSource: any[],
handleConfirm?: (type: string, params: any) => void
}
const format = 'YYYY-MM-DD HH:mm:ss';
/**
* 只有在待发货生产通知单, 待收货生产通知、待回单生产通知单才能修改他table商品的状态
* 比如确认发货,确认收货、确认回单
* 并且上面三个状态的值为1才能修改
* @param props
*/
// const PENDING_DELIVERD_DETAIL_PATH = PENDING_DELIVERD_PATH + '/detail';
// const PENDING_RECEIPT_DETAIL_PATH = PENDING_RECEIPT_PATH + '/detail';
// //receiptStatus_1
// const MAP_PATH = {
// [PENDING_DELIVERD_DETAIL_PATH]: 'deliverStatus',
// [ASSIGN_PENDING_RECEIVE_DETAIL]: 'receiveStatus',
// [PENDING_RECEIPT_DETAIL_PATH]: 'receiptStatus',
// }
// const TEXT_MAP = {
// 'deliverStatus_1': '确认发货',
// 'receiveStatus_1': '确认收货',
// 'receiptStatus_1': '确认回单'
// }
// 从全部进来, 如果是confirm
const CONFIRM_STATUS_TEXT = {
'1_1_1': '待确认发货',
'2_1_1': '已确认发货',
'2_2_1': '待确认回单',
'2_2_2': '已确认回单'
}
// 如果是 指派通知单
const ASSIGN_STATUS_TEXT = {
'1_1_1': '待确认发货',
'2_1_1': '已确认发货',
'2_2_1': '已确认收货',
'2_2_2': '已确认回单'
}
const DetailTab: React.FC<Iprops> = (props) => {
const { columns, dataSource } = props;
const [activeBatch, setActiveBatch] = useState(0);
const [activeData, setActiveData] = useState<any>({});
// const [currentTarget, setCurrentTarget] = useState("deliverStatus");
const pathname = history.location.pathname;
// const currentPage = MAP_PATH[pathname];
const INNER_TEXT = pathname.includes('confirm') ? CONFIRM_STATUS_TEXT : ASSIGN_STATUS_TEXT;
useEffect(() => {
if(dataSource && dataSource.length > 0) {
setActiveData(dataSource[0])
}
}, [dataSource])
const handleOnChange = (e) => {
setActiveBatch(e.target.value)
setActiveData(dataSource[e.target.value])
}
const confirm = (params, type) => {
!!props.handleConfirm && props.handleConfirm(type, params);
}
return (
<div >
<div >
<Radio.Group value={activeBatch} onChange={handleOnChange}>
{
dataSource && dataSource.map((item, key) => {
return (
<Radio.Button key={item.deliveryBatch} value={key}>{item.deliveryBatch} 批次</Radio.Button>
)
})
}
</Radio.Group>
</div>
<div className={styles.header}>
<Row>
<Col span={6}>
<div className={styles.detailItem}>
<span className={styles.title}>发货单号</span>
<a className={styles.value}>{activeData.deliveryNo}</a>
</div>
<div>
<span className={styles.title}>发货时间</span>
<span className={styles.value}>
{
activeData.deliveryTime
&& moment(activeData.deliveryTime).format(format)
}</span>
</div>
</Col>
<Col span={6}>
<div className={styles.detailItem}>
<span className={styles.title}>物流单号</span>
<a className={styles.value}>{activeData.logisticsOrderNo}</a>
</div>
<div>
<span className={styles.title}>物流公司</span>
<span className={styles.value}>{activeData.logisticsCompany}</span>
</div>
</Col>
<Col span={6}>
<div className={styles.detailItem}>
<span className={styles.title}>入库单号</span>
<span className={styles.value}>{activeData.storageNo}</span>
</div>
<div>
<span className={styles.title}>入库时间</span>
<span className={styles.value}>
{
activeData.storageTime
&& moment(activeData.storageTime).format(format)
}</span>
</div>
</Col>
<Col span={4} className={styles.status}>
<div>
<span className={styles.title}>内部状态</span>
<span className={styles.value}>{
INNER_TEXT[`${activeData.deliverStatus}_${activeData.receiveStatus}_${activeData.receiptStatus}`]
}</span>
</div>
</Col>
{/* <Col span={2} className={styles.action}>
<Popconfirm
title={`是否${TEXT_MAP[`${currentPage}_${activeData[currentPage]}`]}`}
onConfirm={() => confirm(
{
produceNoticeOrderId: activeData.produceNoticeOrderId,
pnoReceiveDeliverDetailId: activeData.id
},
`${currentPage}_${activeData[currentPage]}`
)
}
okText="是"
cancelText="否"
>
<a href="#">
{TEXT_MAP[`${currentPage}_${activeData[currentPage]}`]}
</a>
</Popconfirm>
</Col> */}
</Row>
</div>
<Table
dataSource={activeData.pnoReceiveDeliverDetailProductBOList}
rowKey={"orderNo"}
columns={columns}
/>
</div>
)
}
export default DetailTab;
\ No newline at end of file
import React from 'react';
import { Card, Tabs } from 'antd';
const TabPane = Tabs.TabPane
interface Iprops {};
const ReceiptDeliveryDetailsCard: React.FC<Iprops> = (props) => {
const newChildren = React.Children.map(props.children, (child: any) => {
if(child && child.type) {
return (
<TabPane tab={child.props.tab}>
{child}
</TabPane>
)
} else {
return child
}
})
return (
<Card bodyStyle={{padding: '10px 24px 24px 24px'}}>
<Tabs>
{newChildren}
</Tabs>
</Card>
)
}
export default ReceiptDeliveryDetailsCard
\ No newline at end of file
import React from 'react';
import { Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
interface Iprops {
tab: string,
columns: ColumnsType<any>,
dataSource: any[],
}
const StatisticsTab: React.FC<Iprops> = (props) => {
const { columns, dataSource } = props;
return (
<Table rowKey={"id"} columns={columns} dataSource={dataSource} />
)
}
export default StatisticsTab
\ No newline at end of file
.header {
background: #F7F8FA;
padding: 25px 24px;
margin: 24px 0;
font-size: 12px;
.detailItem {
margin-bottom: 16px;
}
.heightLight {
color: @main-color;
}
.title {
margin-right: 40px;
color: #909399;
}
.status {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.action {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
color: #C0C4CC;;
}
}
\ No newline at end of file
import ReceiptDeliveryDetailsCard from './ReceiptDeliveryDetailsCard';
import DetailTab from './DetailTab';
import StatisticsTab from './StatisticsTab';
export {
ReceiptDeliveryDetailsCard,
DetailTab,
StatisticsTab
}
\ No newline at end of file
......@@ -158,64 +158,108 @@ export const outerWorkflowRecordsColumn: ColumnsType<any> = [
* 生产通知单收货统计
*/
export const receiveColumns: ColumnsType<any> = [
export const receiveColumns = (type: "order" | 'product'): ColumnsType<any> => {
/**
* 如果是商品加工,那么没有订单号
*/
const temp = [
{
title: '订单号',
dataIndex: 'orderNo',
},
{
title: 'ID',
dataIndex: 'id',
},
{
title: '商品名称',
dataIndex: 'productName',
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
{
title: '加工数量',
dataIndex: 'processNum',
},
{
title: '加工单价',
dataIndex: 'processPrice',
},
{
title: '加工费',
dataIndex: 'processTotalPrice',
},
{
title: '交期',
dataIndex: 'deliveryDate',
render: (text, record) => {
return moment(text).format('YYYY-MM-DD');
}
},
{
title: '已发货',
dataIndex: 'deliverNum'
},
{
title: '已收货',
dataIndex: 'receiveNum'
},
{
title: '差异数量',
dataIndex: 'differenceNum'
},
{
title: '未发货',
dataIndex: 'notDeliverNum'
}
];
if(type === 'order') {
return temp
}
return temp.slice(1)
}
export const pnoReceiveDeliverDetailDOListColumns = [
{
title: '订单号',
dataIndex: 'orderNo',
dataIndex: 'orderNo'
},
{
title: 'ID',
dataIndex: 'id',
dataIndex: 'productId'
},
{
title: '商品名称',
dataIndex: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
dataIndex: 'category',
dataIndex: 'category'
},
{
title: '品牌',
dataIndex: 'brand',
dataIndex: 'brand'
},
{
title: '单位',
dataIndex: 'unit',
dataIndex: 'unit'
},
{
title: '加工数量',
dataIndex: 'processNum',
},
{
title: '加工单价',
dataIndex: 'processPrice',
},
{
title: '加工费',
dataIndex: 'processTotalPrice',
dataIndex: 'processNum'
},
{
title: '交期',
dataIndex: 'deliveryDate',
render: (text, record) => {
return moment(text).format('YYYY-MM-DD');
}
},
{
title: '已发货',
title: '发货数量',
dataIndex: 'deliverNum'
},
{
title: '已收货',
dataIndex: 'receiveNum'
},
{
title: '差异数量',
dataIndex: 'differenceNum'
},
{
title: '未发货',
dataIndex: 'notDeliverNum'
}
];
\ No newline at end of file
]
\ No newline at end of file
......@@ -5,13 +5,14 @@ import AvatarWrap from '@/components/AvatarWrap';
import { PageHeader, Descriptions, Card, Tabs, Row, Col, Spin, Badge, Table } from 'antd';
import StatusStep from '../components/StatusStep';
import OtherRequirement from '../components/OtherRequirement';
import Appendix from '../components/Appendix';
import {Appendix} from '../components/Appendix';
import { usePageStatus } from '@/hooks/usePageStatus'
import { PublicApi } from '@/services/api';
import StatusTag from '@/components/StatusTag';
import DeliveryInfomation from '../components/DeliveryInformation';
import { ReceiptDeliveryDetailsCard, StatisticsTab, DetailTab } from '../components/ReceiptDeliveryDetails';
import moment from 'moment';
import { columns, orderDetailColumn, innerWorkFlowRecordColumn, outerWorkflowRecordsColumn, receiveColumns } from './columns';
import { columns, orderDetailColumn, innerWorkFlowRecordColumn, outerWorkflowRecordsColumn, receiveColumns, pnoReceiveDeliverDetailDOListColumns } from './columns';
export const COLOR = [
"red", // 不接受申请
"#d9d9d9", // 待提交申请,
......@@ -118,18 +119,23 @@ const Detail: React.FC<{}> = () => {
</Card>
</div>
<div style={{marginTop: '20px', display: info.pnoReceiveDeliverDetailDOList?.length > 0 ? 'block' : 'none'}}>
<Card bodyStyle={{padding: '10px 24px 24px 24px'}}>
<Tabs>
<TabPane tab="收发货统计" key="1">
<Table columns={receiveColumns} dataSource={info?.details} />
</TabPane>
<TabPane tab="收发货明细" key="2">
<Table dataSource={[]} />
</TabPane>
</Tabs>
</Card>
</div>
<div style={{marginTop: '20px'}}>
<ReceiptDeliveryDetailsCard>
<StatisticsTab tab="收发货统计" columns={receiveColumns(info.source === 2 ? 'product' : 'order')} dataSource={info.details}></StatisticsTab>
{
info.pnoReceiveDeliverDetailDOList &&
info.pnoReceiveDeliverDetailDOList.length > 0
? <DetailTab
tab="收发货明细"
columns={pnoReceiveDeliverDetailDOListColumns}
dataSource={info.pnoReceiveDeliverDetailDOList}
// handleConfirm={handleConfirm}
/>
: null
}
</ReceiptDeliveryDetailsCard>
</div>
<div style={{marginTop: '20px'}}>
<DeliveryInfomation
deliveryDate={info.deliveryDate}
......@@ -140,8 +146,6 @@ const Detail: React.FC<{}> = () => {
deliveryAddress={info.deliveryAddress}
deliveryUserName={info.deliveryUserName}
deliveryUserTel={info.deliveryUserTel}
editDeliverAddress={false}
/>
</div>
......@@ -160,12 +164,14 @@ const Detail: React.FC<{}> = () => {
<Tabs>
<TabPane tab="外部流转记录" key="1">
<Table
rowKey={"id"}
columns={outerWorkflowRecordsColumn}
dataSource={info.outerWorkflowRecordsList}
/>
</TabPane>
<TabPane tab="内部流转记录" key="2">
<Table
rowKey={"id"}
columns={innerWorkFlowRecordColumn}
dataSource={info.innerWorkflowRecordsList}
/>
......
......@@ -5,7 +5,7 @@ import {
createFormActions,
FormEffectHooks
} from '@formily/antd'
import { Input, FormMegaLayout } from '@formily/antd-components'
import { Input, FormMegaLayout, Select } from '@formily/antd-components'
import { PublicApi } from '@/services/api'
export interface Params {
id?: any,
......@@ -20,24 +20,28 @@ export interface Params {
const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks
const comfirmDialog: React.FC<Params> = (props) => {
const handleCancel = () => {
}
const [payWayCode, setPayWayCode] = useState<any>([]);
const handletOk = (values: any) => {
let value = { ...values }
if(props.type){
value.type = props.type
}
console.log('列表',value)
props.onOK(value)
}
useEffect(() => {
return () => {
}
PublicApi.getPayGetPayWayCodeTypeEnum().then(res => {
if(res.code === 1000) {
const { data } = res;
const arr: any = [];
data.forEach(item => {
arr.push({
label: item.name,
value: item.type
})
})
setPayWayCode(arr)
}
})
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
......@@ -56,10 +60,9 @@ const comfirmDialog: React.FC<Params> = (props) => {
cancelText='取消'
>
<SchemaForm
labelCol={3}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
Input, Radio: Radio.Group, TextArea: Input.TextArea, Select
}}
actions={actions}
effects={() => useFormEffects()}
......@@ -72,11 +75,11 @@ const comfirmDialog: React.FC<Params> = (props) => {
name='code'
title='参数代码'
required
enum={payWayCode}
x-component-props={{
placeholder: '',
placeholder: ''
}}
x-component="Input"
x-component="Select"
/>
<>
<Field
......
......@@ -178,6 +178,7 @@ const PaySetting: React.FC<{}> = () => {
payActions.setFieldValue(`id-${index}`, item.id)
payActions.setFieldValue(`ruleConfigurationId-${index}`, item.ruleConfigurationId)
// payActions.setFieldValue(`payWayIds-${index}`,item.payWayIds)
const ids: any = [];
item.payWays.forEach((v) => {
payActions.setFieldValue(`payWayIds-${index}`, v.id)
})
......@@ -372,66 +373,55 @@ const PaySetting: React.FC<{}> = () => {
// 整体表单提交
const handleSubmit = (values: any) => {
let baseList: any = GlobalConfig.payConfig.payInitializeConfig
console.log('values:', values, 'baseList:', baseList)
let list: any = []
baseList.forEach((item: any, index: number) => {
let payWayIds = `payWayIds-${index}`, ruleConfigurationId = `ruleConfigurationId-${index}`, _id = `id-${index}`
let v = [values[payWayIds], item.payWayResponses.filter((v => v.value == values[payWayIds])).map(v => v.label)]
let _payWays: any[] = []
if (v.length === 2) {
let obj: any = {}
// if(v[0] &&v[0].length > 0){
v[0].forEach(item => {
obj.id = item
});
// }
// if(v[1] &&v[1].length > 0 ){
v[1].forEach(item => {
obj.way = item
});
// }
_payWays.push(obj)
}
list.push({
id: values[_id],
const baseList: any = GlobalConfig.payConfig.payInitializeConfig
const paymentPolicyPayWayRequests: any = []
baseList.forEach((item: any, idx: number) => {
const payWays: any = [];
item.payWayResponses.forEach((items: any) => {
const ids = values[`payWayIds-${idx}`];
ids.forEach((id: number) => {
if (id === items.value) {
payWays.push({
id: items.value,
way: items.label,
payType: items.payType,
isPitchOn: 1
})
}
})
})
paymentPolicyPayWayRequests.push({
payType: item.payType,
['payWays']: [..._payWays],
// ['payWayIds']: values[payWayIds],
// ['payWays']:{
// id: values[payWayIds],
// way: item.payWayResponses.filter((v=> v.value == values[payWayIds])).map(v => v.label)
// },
['ruleConfigurationId']: values[ruleConfigurationId]
payWays,
ruleConfigurationId: values[`ruleConfigurationId-${idx}`]
})
});
let params: any = {
})
// 提交用到的query
const param: any = {
paymentPolicyName: values.paymentPolicyName,
paymentPolicyPayWayRequests: list,
isSelected: values.isSelected,
paymentPolicyPayWayRequests,
memberIdRoleIds: []
}
if (values.isSelected === 0) {
let memberIdRoleIds: any = []
memberRowCtl.selectRow.forEach((v => {
memberIdRoleIds.push({
memberId: v.memberId,
roleId: v.roleId
})
}))
params.memberIdRoleIds = memberIdRoleIds
if (memberRowCtl.selectRow.length > 0) {
const memberIdRoleId: any = [];
memberRowCtl.selectRow.forEach((v => {
memberIdRoleId.push({
memberId: v.memberId,
roleId: v.roleId
})
}))
param.memberIdRoleIds = memberIdRoleId
}
}
//新增
if (params.memberIdRoleIds.length === 0 && values.isSelected === 0) {
if (param.memberIdRoleIds.length === 0 && values.isSelected === 0) {
message.error('请选择指定的会员');
return
}
}
if (!usePageStatus().id) {
console.log('params', params)
PublicApi.postPayPayMemberTacticsAdd({ ...params }).then(res => {
PublicApi.postPayPayMemberTacticsAdd({ ...param }).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack()
......@@ -439,8 +429,8 @@ const PaySetting: React.FC<{}> = () => {
}
})
} else {
params.paymentPolicyId = usePageStatus().id
PublicApi.postPayPayMemberTacticsUpdate({ ...params }).then(res => {
param.paymentPolicyId = usePageStatus().id
PublicApi.postPayPayMemberTacticsUpdate({ ...param }).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack()
......@@ -448,8 +438,8 @@ const PaySetting: React.FC<{}> = () => {
}
})
}
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
......
......@@ -19,7 +19,7 @@ export const strategyDetailTab = (props: any, usePageStatus: any) => {
//新增时候就初始化
let baseList: any = GlobalConfig.payConfig.payInitializeConfig || []
console.log('初始化', JSON.stringify(baseList))
// console.log('初始化', JSON.stringify(baseList))
// baseList[2].ruleConfigurations = [{value:1,label:"1",platformType:1}]
let tabItem = {}, Tab1 = {}, arr = []
baseList.map((item, index) => {
......@@ -91,7 +91,8 @@ export const strategyDetailTab = (props: any, usePageStatus: any) => {
"type": 'object',
"x-component": 'tabpane',
"x-component-props": {
tab: '基本信息'
tab: '基本信息',
forceRender: true
},
"properties": {
......@@ -124,7 +125,8 @@ export const strategyDetailTab = (props: any, usePageStatus: any) => {
"type": 'object',
"x-component": 'tabpane',
"x-component-props": {
tab: '适用会员'
tab: '适用会员',
forceRender: true
},
properties: {
MEGA_LAYOUT2: {
......
import React, { useRef } from 'react';
import { Card, Row, Col, Space, Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
const SensitiveWords: React.FC<{}> = () => {
const ref = useRef<any>({});
const columns: ColumnType<any>[] = [
{
title: 'ID',
key: 'id',
dataIndex: 'id',
}, {
title: '外币英文简称',
key: 'name',
dataIndex: 'name',
}, {
title: '本地英文简称',
key: 'remarks',
dataIndex: 'remarks',
}, {
title: '汇率',
key: 'hui',
dataIndex: 'hui',
}, {
title: '有效期起',
key: 'qi',
dataIndex: 'qi',
},{
title: '有效期止',
key: 'zhi',
dataIndex: 'zhi',
},{
title: '状态',
key: 'status',
dataIndex: 'status',
},{
title: '操作',
key: 'options',
dataIndex: 'options',
},
]
const controllerBtns = <Row>
<Col span={24}>
<Space direction="horizontal" size={16}>
<Button type="primary" icon={<PlusOutlined />}>新建</Button>
</Space>
</Col>
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
formilyLayouts={{
justify: 'space-between'
}}
formilyProps={{
layouts: {
order: 1,
span: 4
},
ctx: {
inline: false,
schema: {
type: 'object',
properties: {
megaLayout0: {
type: 'object',
'x-component': 'mega-layout',
"x-component-props": {
grid: true,
columns: 1,
},
properties: {
name: {
type: 'string',
'x-component-props': {
placeholder: '属性名称',
},
'x-component': 'Search'
}
}
}
}
}
}
}}
formilyChilds={{
layouts: {
order: 0
},
children: (
<>
{controllerBtns}
</>
)
}}
/>
</Card>
</PageHeaderWrapper>
)
}
export default SensitiveWords;
\ No newline at end of file
import React from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle';
import { Card, Form, Input, Button, Space, Select, DatePicker } from 'antd';
import moment from 'moment'
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 9 },
labelAlign: "left"
};
const tailLayout = {
wrapperCol: { style: { marginLeft: '174px' } },
};
const { Option } = Select;
const Template:React.FC<{}> = () => {
// 只能选当天和之后的日期
const disabledDate = (current) => {
return current && current < moment().startOf('day');
}
return(
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
>
<Card>
<Form
{...layout}
>
<Form.Item label='外币英文简称' name='name' rules={[{ required: true, message: '请输入单位名称' }]}>
<Input />
</Form.Item>
<Form.Item label='本币英文简称' name='enName' rules={[{ required: true, message: '请输入英文简称' }]}>
<Input />
</Form.Item>
<Form.Item label='汇率' name='enName' rules={[{ required: true, message: '请输入英文简称' }]}>
<Input />
</Form.Item>
<Form.Item label='有效期起' name='enName' rules={[{ required: true, message: '请输入英文简称' }]}>
<DatePicker
disabledDate={disabledDate}
/>
</Form.Item>
<Form.Item label='有效期止' name='enName' rules={[{ required: true, message: '请输入英文简称' }]}>
<DatePicker
disabledDate={disabledDate}
/>
</Form.Item>
<Form.Item {...tailLayout}>
<Space size={24}>
<Button type='primary'>保存</Button>
<Button>取消</Button>
</Space>
</Form.Item>
</Form>
</Card>
</PageHeaderWrapper>
)
}
export default Template;
\ No newline at end of file
import React, { useRef } from 'react';
import { Card, Row, Col, Space, Button } from 'antd';
import React, { useRef, useState } from 'react';
import { Card, Row, Col, Space, Button, Popconfirm, message } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
const SensitiveWords: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<number[]>([]);
// 删除
const confirmCancel = (ids: number[], type: boolean) => {
if (ids.length > 0) {
PublicApi.postManageSensitiveWordDelete({ ids }).then(res => {
if (res.code === 1000) {
if (type) {
message.success('批量删除成功')
} else {
message.success('删除成功')
}
ref.current.Reload()
}
})
} else {
message.error('请选择要操作的数据')
}
}
const columns: ColumnType<any>[] = [
{
title: '敏感词编码',
key: 'no',
dataIndex: 'no',
}, {
key: 'batchNo',
dataIndex: 'batchNo',
},
{
title: '敏感词名称',
key: 'name',
dataIndex: 'name',
}, {
},
{
title: '备注',
key: 'remark',
dataIndex: 'remark',
}, {
title: '状态',
key: 'status',
dataIndex: 'status',
}, {
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
width: 200,
render: (text: any, record: any) => {
return (
<>
<Button
type='link'
href={`/system/sensitiveWords/edit?id=${record.id}&name=${btoa(encodeURIComponent(record.name))}&remark=${btoa(encodeURIComponent(record.remark))}`}
>修改</Button>
<Popconfirm
onConfirm={() => confirmCancel([record.id], false)}
title="确定要执行这个操作?"
okText="确定"
cancelText="取消"
>
<Button type='link'>删除</Button>
</Popconfirm>
</>
)
}
},
]
const controllerBtns = <Row>
<Col span={24}>
<Space direction="horizontal" size={16}>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/system/sensitiveWords/add`)}>新建</Button>
<Button>导入</Button>
<Button onClick={() => confirmCancel(selectedRowKeys, true)}>批量删除</Button>
<Button>导出</Button>
</Space>
</Col>
</Row>
const fetchdata = (params:any) => {
const fetchdata = (params: any) => {
return new Promise(resolve => {
PublicApi.getManageSensitiveWordPage({...params}).then(res => {
if(res.code === 1000) {
PublicApi.getManageSensitiveWordPage({ ...params }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
}
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
}
}
return (
<PageHeaderWrapper>
<Card>
......@@ -57,6 +103,7 @@ const SensitiveWords: React.FC<{}> = () => {
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
fetchTableData={(params) => fetchdata(params)}
formilyLayouts={{
justify: 'space-between'
......
import React from 'react';
import React, { useEffect, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle';
import { Card, Form, Input, Button, Space } from 'antd';
import { Card, Form, Input, Button, Space, Popconfirm, message } from 'antd';
import { PublicApi } from '@/services/api';
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
......@@ -12,8 +13,50 @@ const layout: any = {
const tailLayout = {
wrapperCol: { style: { marginLeft: '174px' } },
};
const { TextArea } = Input;
const Template:React.FC<{}> = () => {
const [form] = Form.useForm();
const { pathname, query } = history.location;
const type = pathname.split('/')[pathname.split('/').length - 1];
const onFinish = (values: any) => {
if(type === 'add') {
PublicApi.postManageSensitiveWordAdd(values).then(res => {
if(res.code === 1000) {
history.goBack();
message.success('新增敏感词成功')
}
})
}
else {
values.id = query.id;
PublicApi.postManageSensitiveWordUpdate(values).then(res => {
if(res.code === 1000) {
history.goBack();
message.success('修改敏感词成功')
}
})
}
}
const confirmCancel = () => {
history.goBack()
}
useEffect(() => {
try {
const data: {name: string, remark: string} = {
name: decodeURIComponent(atob(query.name)),
remark: decodeURIComponent(atob(query.remark)),
}
form.setFieldsValue({
name: data.name,
remark: data.remark
})
}catch(error) {
console.log(error)
}
}, [])
return(
<PageHeaderWrapper
onBack={() => history.goBack()}
......@@ -22,17 +65,26 @@ const Template:React.FC<{}> = () => {
<Card>
<Form
{...layout}
form={form}
onFinish={onFinish}
>
<Form.Item label='敏感词名称' name='name' rules={[{ required: true, message: '请输入敏感词名称' }]}>
<Input />
</Form.Item>
<Form.Item label='备注' name='remarks'>
<Form.Item label='备注' name='remark'>
<TextArea rows={4} />
</Form.Item>
<Form.Item {...tailLayout}>
<Space size={24}>
<Button type='primary'>保存</Button>
<Button>取消</Button>
<Button type='primary' htmlType="submit">保存</Button>
<Popconfirm
onConfirm={confirmCancel}
title="确定要执行这个操作?"
okText="确定"
cancelText="取消"
>
<Button>取消</Button>
</Popconfirm>
</Space>
</Form.Item>
</Form>
......@@ -41,4 +93,4 @@ const Template:React.FC<{}> = () => {
)
}
export default Template;
\ No newline at end of file
export default Template;
......@@ -4,6 +4,7 @@ import { PlusOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { PublicApi } from '@/services/api';
const SensitiveWords: React.FC<{}> = () => {
const ref = useRef<any>({});
const columns: ColumnType<any>[] = [
......@@ -36,6 +37,18 @@ const SensitiveWords: React.FC<{}> = () => {
</Space>
</Col>
</Row>
/**获取单位列表数据 */
// const fetchdata = (params: any) => {
// return new Promise(resolve => {
// PublicApi.getManageUnitGetUnitList({ ...params }).then(res => {
// if (res.code === 1000) {
// resolve(res.data)
// }
// })
// })
// }
return (
<PageHeaderWrapper>
<Card>
......
......@@ -7589,10 +7589,10 @@ god-upload-scp@1.2.0:
ssh2 "^0.8.9"
util "^0.12.3"
god-yapi2ts@^1.6.0:
version "1.6.0"
resolved "http://10.0.0.21:8081/repository/node-group/god-yapi2ts/-/god-yapi2ts-1.6.0.tgz#0206153d028a3841b0be7c50b5f342ef6690ff2f"
integrity sha512-JQl99IqXRD+xwOcfj0DiOaqpPxvpMlMhBKmMfHEMB0nEku/0L1HJmwTu+99QJ0QHlLT52jOqFwGPSAb6Pqwe1g==
god-yapi2ts@^1.9.0:
version "1.9.0"
resolved "http://10.0.0.21:8081/repository/node-group/god-yapi2ts/-/god-yapi2ts-1.9.0.tgz#2417e21efcf55fc8c00675200b2020800943790e"
integrity sha512-/SnmScN+TO/IHwJc3mFyk5nK58QfCtMblvqM8q6ETs5G6Jp9FBmi7DNeTifSYtqdyb6NWi6vjWgG9+qRonDehw==
dependencies:
"@types/react" "^16.9.2"
"@vtils/date" "^2.55.0"
......
const tokenList = [
{ name: 'Pass', token: 'b063a0a29fb1a570d9f00eaabbdd8ccfe8e6e10e24739441990cc1098e79b601' }, // 业务中台管理平台
{ name: 'Warehouse', token: '7c8f235d95f6224ceb97c4d832b09658f9a75fb8721a95699b230af0733d7fa4' }, // 仓库服务
{ name: 'Logistics', token: '8d14d945507d1f8cd89afe139ca6d111bbad25f702fafe0aec59d3c9cd2e0ffe' }, // 物流服务
{ name: 'Member', token: '3a46198c5b97ac7147e5b07ad2dff5ac5c93c1afed47e1911961db87149e6ebf' }, // 商户会员管理服务
{ name: 'Product', token: 'efe99e20ed1375dc0db3e809e4fc7692f42ecebaf60cd77e65c50ed65d6ba6c4' }, // 商品服务
{ name: 'Template', token: '7ec923520215c7e2f771867cb4d29cafbf823daf0fb2d3d9fa70b57a523c8bfb' }, // 店铺模板服务
{ name: 'Pay', token: 'c789e0e56ee8a8cc2fbd85f930eb2928c58fc1014583c6643acf29cff954da49' }, // 支付服务
{ name: 'Search', token: 'ca19f532efba91f7773cbfbd526b798c6ac83df670071e97d72c50dca1d53a48' }, // 搜索服务
{ name: 'Order', token: '5de0aaeaac12c8d911d86dada6cd128993e34cd6e13135fa79246aa5979a2bcd' }, //订单服务,
{ name: 'Settle', token: 'fffbeeaaa198c285955997c606bc279fc6950fea118580c786f2c73eecccaa6a' }, //结算服务
{ name: 'report', token: 'e709e5bd31eb2b84de468944b153a62a05afcc13f0ea880be7333b928c7c0620'}, //报表服务
{ name: 'enhance', token: '594a7e7ff17f6f40fb9fb726c1da9a3f282a926a8d386eb6cbfd668a3f75f251' } // 加工服务
{ name: 'Pass', token: 'b063a0a29fb1a570d9f00eaabbdd8ccfe8e6e10e24739441990cc1098e79b601', categoryIds: [0] }, // 业务中台管理平台
{ name: 'Warehouse', token: '7c8f235d95f6224ceb97c4d832b09658f9a75fb8721a95699b230af0733d7fa4', categoryIds: [0] }, // 仓库服务
{ name: 'Logistics', token: '8d14d945507d1f8cd89afe139ca6d111bbad25f702fafe0aec59d3c9cd2e0ffe', categoryIds: [0] }, // 物流服务
{ name: 'Member', token: '3a46198c5b97ac7147e5b07ad2dff5ac5c93c1afed47e1911961db87149e6ebf', categoryIds: [0] }, // 商户会员管理服务
{ name: 'Product', token: 'efe99e20ed1375dc0db3e809e4fc7692f42ecebaf60cd77e65c50ed65d6ba6c4', categoryIds: [0] }, // 商品服务
{ name: 'Template', token: '7ec923520215c7e2f771867cb4d29cafbf823daf0fb2d3d9fa70b57a523c8bfb', categoryIds: [0] }, // 店铺模板服务
{ name: 'Pay', token: 'c789e0e56ee8a8cc2fbd85f930eb2928c58fc1014583c6643acf29cff954da49', categoryIds: [0] }, // 支付服务
{ name: 'Search', token: 'ca19f532efba91f7773cbfbd526b798c6ac83df670071e97d72c50dca1d53a48', categoryIds: [0] }, // 搜索服务
{ name: 'Order', token: '5de0aaeaac12c8d911d86dada6cd128993e34cd6e13135fa79246aa5979a2bcd', categoryIds: [0] }, //订单服务,
{ name: 'Settle', token: 'fffbeeaaa198c285955997c606bc279fc6950fea118580c786f2c73eecccaa6a', categoryIds: [0] }, //结算服务
{ name: 'report', token: 'e709e5bd31eb2b84de468944b153a62a05afcc13f0ea880be7333b928c7c0620', categoryIds: [0]}, //报表服务
{ name: 'enhance', token: '594a7e7ff17f6f40fb9fb726c1da9a3f282a926a8d386eb6cbfd668a3f75f251', categoryIds: [0] } // 加工服务
]
const getConfigMap = (tokens) => tokens.map(v => ({
......@@ -19,7 +19,7 @@ const getConfigMap = (tokens) => tokens.map(v => ({
reactHooks: {
enabled: false,
},
outputFilePath: `src/services/${v.name}Api.ts`,
outputFilePath: `src/services/${v.name}Api`,
requestFunctionFilePath: 'request.ts',
dataKey: 'data',
projects: [
......@@ -27,7 +27,7 @@ const getConfigMap = (tokens) => tokens.map(v => ({
token: v.token,
categories: [
{
id: 0,
id: v.categoryIds,
getRequestFunctionName(interfaceInfo, changeCase) {
return changeCase.camelCase(interfaceInfo.method + interfaceInfo.path)
},
......@@ -37,4 +37,4 @@ const getConfigMap = (tokens) => tokens.map(v => ({
],
}))
export default getConfigMap(tokenList)
\ No newline at end of file
export default getConfigMap(tokenList)
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