Commit 30257485 authored by alwayOnlie's avatar alwayOnlie

替换api

parents 459a9052 1fb662be
import { GetProductGoodsGetGoodsListResponseDetail, GetProductCommodityGetCommodityResponse } from '@/services/ProductApi';
import { GetProductCommodityGetCommodityResponse } from "@/services/ProductV2Api/id6033";
import { GetProductGoodsGetGoodsListResponseDetail } from "@/services/ProductV2Api/id6049";
export interface IBasicFormParam {
brandId: number;
......
......@@ -8,8 +8,8 @@ import {
import ReutrnEle from '@/components/ReturnEle';
import styles from './index.less'
import { PublicApi } from '@/services/api';
import { GetProductCustomerGetCustomerCategoryTreeResponse } from '@/services/ProductApi';
import { validatorByte } from '@/utils/regExp';
import { GetProductCustomerGetCustomerCategoryTreeResponse } from '@/services/ProductV2Api/id6097';
const { Option } = Select;
const layout = {
......
......@@ -11,7 +11,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { addChannelSchema } from '../schema/channelSchema';
import { PublicApi } from '@/services/api';
import ModalTable from '@/components/ModalTable'
import { GetProductChannelCommodityGetCommodityListResponseDetail } from '@/services/ProductApi';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import Search from '@/components/NiceForm/components/Search'
......@@ -20,6 +19,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import { inject, observer } from 'mobx-react'
import { store } from '@/store'
import { clearModalParams } from '@/utils';
import { GetProductChannelCommodityGetCommodityListResponseDetail } from '@/services/ProductV2Api/id6041';
const layout = {
labelCol: {
......
......@@ -5,9 +5,9 @@ import { PublicApi } from '@/services/api'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { EyeOutlined } from '@ant-design/icons'
import { GetProductGoodsGetGoodsListResponseDetail } from '@/services/ProductApi';
import { inject, observer } from 'mobx-react'
import { store } from '@/store'
import { GetProductGoodsGetGoodsListResponseDetail } from '@/services/ProductV2Api/id6049'
const layout = {
labelCol: {
......
......@@ -26,8 +26,8 @@ import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from './effect'
import EyePreview from '@/components/EyePreview'
import moment from 'moment'
import { GetProductChannelCommodityGetShopResponse } from '@/services/ProductApi'
import { productStatusColor, productStatusLabel } from './constant'
import { GetProductChannelCommodityGetShopResponse } from '@/services/ProductV2Api/id6041'
// 定义选择的行数据的类型
interface Item {
......
......@@ -18,7 +18,6 @@ import { ColumnType } from 'antd/lib/table/interface'
import moment from 'moment'
import styles from "./index.less"
import { PublicApi } from '@/services/api'
import { GetProductCommodityGetShopResponse } from '@/services/ProductApi'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import TableOperation from '@/components/TableOperation'
import { productSchema } from './schema/productSchema'
......@@ -32,6 +31,7 @@ import { priceTypeLabel, productStatusColor, productStatusLabel } from './consta
import EyePreview from '@/components/EyePreview'
import UpperProductModalTable from './components/upperProductModalTable'
import { Item } from '@/components/ButtonTabs'
import { GetProductCommodityGetShopResponse } from '@/services/ProductV2Api/id6033'
const { confirm } = Modal;
......
......@@ -11,11 +11,8 @@ import cx from 'classnames'
import ReutrnEle from '@/components/ReturnEle'
import styles from "./index.less"
import { PublicApi } from '@/services/api'
import {
GetProductCommodityGetCommodityResponse,
GetProductCommodityGetCommodityCheckRecordResponse,
} from '@/services/ProductApi'
import { carriageTypeLabel, columns, CommodityImagesType, customerCategoryTypeLabel, deliveryTypeLabel, orderlyLadderPrice, priceTypeLabel, productStatusColor, productStatusLabel } from './constant'
import { GetProductCommodityGetCommodityCheckRecordResponse, GetProductCommodityGetCommodityResponse } from '@/services/ProductV2Api/id6033'
interface IAttributeByValue {
groupName: string;
......
......@@ -4,7 +4,8 @@ import styles from '../index.less'
import cx from 'classnames'
import { QuestionCircleOutlined } from '@ant-design/icons';
import { postContractSignatureAuthAgentAuth } from '@/services/ContractV2Api'
// import { getManageCountryAreaGetTelCode } from '@/services/PassApi';
import { getManageCountryAreaGetTelCode } from '@/services/ManageV2Api';
// import { getManageCountryAreaGetTelCode } from '@/services/ManageV2Api';
interface queryProps {
......
......@@ -8,7 +8,7 @@ import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd';
import EyePreview from '@/components/EyePreview';
import { PlusOutlined, PlayCircleOutlined, PauseCircleOutlined } from '@ant-design/icons';
// import { getContractContractTemplatePage, postContractContractTemplateDelete, postContractContractTemplateEnable } from '@/services/ContractV2Api'
import { getContractContractTemplatePage, postContractContractTemplateDelete, postContractContractTemplateEnable } from '@/services/ContractV2Api';
const formActions = createFormActions();
const Template: React.FC<{}> = () => {
......
import React, { ReactText, useRef, useEffect, useLayoutEffect, useState } from 'react';
import { StandardTable } from 'god';
import { ISchema } from '@formily/antd';
import NestTable from '@/components/NestTable';
import { IStandardTableProps } from 'god/dist/src/standard-table';
import { Row, Col, Modal, Form, Radio } from 'antd';
import Search from '@/components//NiceForm/components/Search';
import SearchSelect from '@/components//NiceForm/components/SearchSelect';
import Submit from '@/components//NiceForm/components/Submit';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import DateSelect from '@/components//NiceForm/components/DateSelect';
import { getAsReplaceGoodsPageToBeAddReplaceByLogistics, getAsReplaceGoodsPageToBeAddReturnByLogistics, getAsReturnGoodsPageByLogistics } from '@/services/AfterServiceV2Api';
import { getEnhanceProcessToBeDeliveryList } from '@/services/EnhanceV2Api';
export interface ModalTableProps extends IStandardTableProps<any> {
width?: number,
confirm?: Function,
cancel?(),
visible?: boolean,
resetModal?: object,
useNestTable?: boolean, // 是否使用嵌套表格
nestColumns?: any[],
nestTableProps?: any,
// fix: 新增参数, 为true时每次开启弹窗都会重新reload接口
forceRender?: boolean,
invoicesNo?: string, // 对应订单号/售后单号
relevanceType?: number, //对应单据类型
}
export const logisticsDeliverySearchSchema: ISchema = {
type: 'object',
properties: {
orderNo: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '单据号',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
memberName: {
type: 'string',
"x-component-props": {
placeholder: '会员名称',
style: {
width: 160
}
}
},
orderThe: {
type: 'string',
"x-component-props": {
placeholder: '单据摘要',
style: {
width: 160
}
}
},
"[startCreateTime,endCreateTime]": {
type: 'string',
"x-component": "dateSelect",
"x-component-props": {
placeholder: '单据时间(全部)',
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
export const otherSearchSchema: ISchema = {
type: 'object',
properties: {
applyNo: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '申请单号',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
memberName: {
type: 'string',
"x-component-props": {
placeholder: '会员名称',
style: {
width: 160
}
}
},
applyAbstract: {
type: 'string',
"x-component-props": {
placeholder: '单据摘要',
style: {
width: 160
}
}
},
"[startTime,endTime]": {
type: 'string',
"x-component": "dateSelect",
"x-component-props": {
placeholder: '单据时间(全部)',
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
const ModalTableOrder: React.FC<ModalTableProps> = (props) => {
const { width = 704, confirm, cancel, visible, currentRef, resetModal, forceRender, useNestTable = false, nestColumns, nestTableProps, invoicesNo, relevanceType, ...resetTable } = props
const selfRef = currentRef || useRef<any>({})
useEffect(() => {
if (visible && forceRender) {
// 重新开启时需reload接口
// fix: 去掉自动reload接口, 防止重复请求
// fix: 新增forceRender接口, 用于控制弹窗是否需要reload
selfRef.current.reload && selfRef.current.reload()
} else {
selfRef.current.resetField && selfRef.current.resetField({
validate: false
})
}
}, [visible])
const [form] = Form.useForm();
const [type, setType] = useState<number>(1);
const [modalTitle, setmodalTitle] = useState<string>('订单');
useEffect(() => {
console.log(relevanceType)
setType(relevanceType)
}, [visible])
useEffect(() => {
form.setFieldsValue({
radio: type
})
}, [type])
const fetchData = (parmas?: any) => {
if (visible) {
return new Promise(resolve => {
switch (type) {
case 1:
/** 接口待转v2 */
getOrderLogisticsOrderList({ ...parmas }).then(res => {
if (res.code === 1000) {
res.data.data.forEach((item: any) => {
item.applyNo = item.orderNo
item.applyAbstract = item.orderThe
item.applyTime = item.createTime
})
resolve(res.data)
}
})
break;
case 2:
getAsReplaceGoodsPageToBeAddReturnByLogistics({ ...parmas }).then((res: any) => {
if (res.code === 1000) {
res.data.data.forEach((item: any) => {
item.id = item.applyId
})
resolve(res.data)
}
})
break;
case 3:
getAsReplaceGoodsPageToBeAddReplaceByLogistics({ ...parmas }).then((res: any) => {
if (res.code === 1000) {
res.data.data.forEach((item: any) => {
item.id = item.applyId
})
resolve(res.data)
}
})
break;
case 4:
getAsReturnGoodsPageByLogistics({ ...parmas }).then((res: any) => {
if (res.code === 1000) {
res.data.data.forEach((item: any) => {
item.id = item.applyId
})
resolve(res.data)
}
})
break;
case 5:
getEnhanceProcessToBeDeliveryList({ ...parmas }).then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
break;
}
})
}
}
return (
<Modal
width={width}
title={modalTitle}
onOk={() => confirm(type)}
onCancel={cancel}
visible={visible}
{...resetModal}
maskClosable={false}
>
{
useNestTable ? (
<NestTable
NestColumns={nestColumns}
className="common_tb"
rowClassName={(_, index) => (index % 2) === 0 && "tb_bg"}
{...nestTableProps}
/>
) : (
<StandardTable
tableType='small'
currentRef={selfRef}
fetchTableData={(params) => fetchData(params)}
formRender={(child, ps) => <Row justify='space-between' style={{ marginBottom: 16 }}>
<Col span={18} style={{ zIndex: 99 }}>
<Form form={form}>
<Form.Item name='radio' label='单据选择'>
<Radio.Group onChange={(e) => { setType(e.target.value); selfRef.current.reload(); }}>
<Radio value={1}>订单</Radio>
<Radio value={2}>换货申请单(退货发货)</Radio>
<Radio value={3}>换货申请单(换货发货)</Radio>
<Radio value={4}>退货申请单</Radio>
<Radio value={5}>生产通知单</Radio>
</Radio.Group>
</Form.Item>
</Form>
</Col>
<Col style={{ marginTop: 4 }}>{ps}</Col>
<Col span={18} style={{ zIndex: 99 }}>{child}</Col>
</Row >}
formilyProps={
{
ctx: {
schema: type === 1 ? logisticsDeliverySearchSchema : otherSearchSchema,
components: { ModalSearch: Search, SearchSelect, Submit, DateSelect },
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
type === 1 ? 'orderNo' : 'applyNo',
FORM_FILTER_PATH,
);
}
}
}
}
{...resetTable}
/>
)
}
</Modal>
)
}
ModalTableOrder.defaultProps = {}
export default ModalTableOrder
import { ColumnType } from 'antd/lib/table/interface';
import moment from 'moment'
export const SelectGoodsColumns: ColumnType<any>[] = [
{
title: '商品ID',
key: 'productId',
dataIndex: 'productId',
},
{
title: '商品名称',
key: 'productName',
dataIndex: 'productName',
},
{
title: '品类',
key: 'category',
dataIndex: 'category',
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
}
]
export const AfterSalesSelectGoodsColumns: ColumnType<any>[] = [
{
title: '商品ID',
key: 'productId',
dataIndex: 'productId',
},
{
title: '商品名称',
key: 'productName',
dataIndex: 'productName',
},
{
title: '品类',
key: 'category',
dataIndex: 'category',
},
{
title: '订单编号',
key: 'orderNo',
dataIndex: 'orderNo',
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
}
]
export const ExternalListColumns: ColumnType<any>[] = [
{
title: '流转顺序号',
key: 'number',
dataIndex: 'number',
render:(text:any, record:any, index:number) => {return index + 1;}
},
{
title: '操作角色',
key: 'operatorRoleName',
dataIndex: 'operatorRoleName',
},
{
title: '状态',
key: 'status',
dataIndex: 'status',
render:(text:any, record:any, index:number) => {
return (
text === 1 ? '待提交':
text === 2 ? '待确认':
text === 3 ? '不接收物流单':
'接收物流单'
)
}
},
{
title: '操作',
key: 'type',
dataIndex: 'type',
render:(text:any, record:any, index:number) => {
return (
text === 1 ? '提交物流单':'确认物流单'
)
}
},
{
title: '操作时间',
key: 'operateTime',
dataIndex: 'operateTime',
render:(text:any, record:any) => {
return(
moment(text).format('YYYY-MM-DD HH:mm:ss')
)
}
},
{
title: '审核意见',
key: 'remark',
dataIndex: 'remark',
}
]
This diff is collapsed.
.revise_style {
:global {
.ant-form-item-label {
width: 174px;
label {
color:#6B778C
}
}
.ant-form-item-control {
width: 500px;
.ant-form-item-control-input-content {
position: relative;
.ant-btn-link {
position: absolute;
right: -120px;
}
.ant-picker {
width: 100%;
}
}
.ant-input-group-addon {
.ant-input-search-button {
background-color: #6B778C;
border-color: #6B778C;
}
}
}
.ant-radio-group-solid {
.ant-radio-button-wrapper-checked {
background: #6B778C;
border-color: #6B778C;
&:hover {
background: #6B778C;
border-color: #6B778C;
}
}
}
}
.upload_item {
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FAFBFC;
.upload_left {
display: flex;
align-items: center;
color: #303133;
:global {
.anticon-file-word {
color: #4279df;
font-size: 20px;
margin-right: 8px;
}
}
}
.upload_right {
color: #00B37A;
cursor: pointer;
:global {
.anticon-delete {
margin-left: 19px;
color: #C0C4CC;
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
/*
* @Author: LeeJiancong
* @Date: 2020-07-30 17:23:48
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 17:24:49
*/
export default {
default: {
padding: '2px 5px',
background: 'rgba(244,245,247,1)',
borderRadius: '4px'
},
confirm: {
color: '#3F7ED2',
padding: '2px 5px',
background: 'rgba(240, 248, 255, 1)',
borderRadius: '4px'
},
success: {
color: '#00B37A',
padding: '2px 5px',
background: 'rgba(235,247,242,1)',
borderRadius: '4px'
},
warn: {
color: '#E63F3B',
padding: '2px 5px',
background: 'rgba(255,235,230,1)',
borderRadius: '4px'
},
error: {
color: '#ff0404',
padding: '2px 5px',
background: 'rgba(247,235,235,1)',
borderRadius: '4px'
}
}
import React, { useRef, ReactNode, useEffect } from 'react';
import { StandardTable } from 'god';
import { Row, Col, Space, Button, Card } from 'antd';
import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { LogisticsOrderSubmitSearchSchema, LogisticsOrderToBeSubmitSearchSchema, LogisticsOrderProcessingSearchSchema, LogisticsOrderToBeConfirmedSearchSchema, None } from './schema';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
interface tableListParams {
columns?: any, // 表头
reloadRef?: any, // 处理刷新
fetchData?: Function, // 列表数据
schema?: boolean, // 是否显示schema 搜索
schemaType?: 'LogisticsOrderSubmitSearchSchema' | 'LogisticsOrderToBeSubmitSearchSchema' | 'LogisticsOrderProcessingSearchSchema' | 'LogisticsOrderToBeConfirmedSearchSchema' | 'none'
}
const formActions = createFormActions();
const LogisticsTableList: React.FC<tableListParams> = (props) => {
const { columns, reloadRef, fetchData, schema = false, schemaType = 'none' } = props;
const ref = useRef<any>({});
const controllerBtns: ReactNode = <Row>
<Col>
<Button type='primary'>新建</Button>
</Col>
</Row>
const schemaRender = () => {
switch (schemaType) {
case 'LogisticsOrderSubmitSearchSchema': {
return LogisticsOrderSubmitSearchSchema
}
case 'LogisticsOrderToBeSubmitSearchSchema': {
return LogisticsOrderToBeSubmitSearchSchema
}
case 'LogisticsOrderProcessingSearchSchema': {
return LogisticsOrderProcessingSearchSchema
}
case 'LogisticsOrderToBeConfirmedSearchSchema': {
return LogisticsOrderToBeConfirmedSearchSchema
}
case 'none': {
return None
}
}
}
useEffect(() => {
if (reloadRef) {
const userAction = {
reload: () => ref.current.reload()
}
if (reloadRef && typeof reloadRef === 'function') {
reloadRef(userAction);
}
if (reloadRef && typeof reloadRef !== 'function') {
reloadRef.current = userAction;
}
}
})
return (
<PageHeaderWrapper>
<Card >
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{ rowKey: 'id' }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'logisticsOrderNo', FORM_FILTER_PATH)
}}
expressionScope={{ controllerBtns }}
schema={schemaRender()}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default LogisticsTableList
import React, { Component, useState, useEffect } from 'react';
import { Modal, Button, Form, message } from 'antd'
import {
SchemaForm, SchemaMarkupField as Field,
createFormActions,
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout, NumberPicker } from '@formily/antd-components'
import { PATTERN_MAPS } from '@/constants/regExp'
import { postLogisticsOrderWaitConfirmConfirm } from '@/services/LogisticsV2Api';
export interface Params {
id: number | string;
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
taxRate?: any,
freightPrice?: any;
dontReceive?: boolean; //默认展示
}
const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks
const comfirmDialog: React.FC<Params> = (props) => {
console.log(props.dialogVisible)
const handleCancel = () => {
}
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
value.freightPrice = props.freightPrice
value.taxRate = props.taxRate
value.taxInclusive = 1
postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if (res.code === 1000) {
props.onOK()
}
}).catch(error => {
console.log(error)
props.onOK()
})
}
useEffect(() => {
return () => {
}
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({ value }) => {
setFieldState('remark', state => {
if (value == 4) {
state.visible = false
} else {
state.visible = true
}
})
setFieldState('freightPrice', state => {
if (value != 4) {
state.visible = false
} else {
state.visible = true
}
})
})
}
return (
<>
<Modal
title='单据确认'
width={800}
visible={props.dialogVisible}
onOk={() => actions.submit()}
onCancel={() => props.onCancel()}
destroyOnClose
afterClose={() => actions.reset()}
okText='确定'
cancelText='取消'
>
<SchemaForm
labelCol={3}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea, NumberPicker
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
status: 4
}}
>
<Field
enum={
[
{ label: '接受物流单', value: 4 },
{ label: '不接受物流单', value: 3 }
]}
name='status'
required
x-component="Radio"
/>
{props.dontReceive &&
<>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='不接受原因'
name="remark"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-mega-prop={{
labelAlign: 'left'
}}
x-rules={{
max: 60,
// maximum:10,//最大数值
message: '原因最多60个汉字'
}}
/>
</>
}
</SchemaForm>
</Modal>
</>
)
}
comfirmDialog.defaultProps = {
dontReceive: true
}
export default comfirmDialog
// @import "../../member/components/index.less";
.count{
font-size: 24px;
color: #303133;
font-weight: 500;
}
.add-btn{
margin-bottom: 24px;
padding: 6px 0;
text-align: center;
background: #FAFBFC;
}
.alignCenter{
text-align: center;
}
.alignLeft{
text-align: left;
}
.hidden{
display: none;
}
.block{
display: block;
}
.selectBtn {
margin: 0 16px;
}
.filter-btn{
width : 112px;
margin: 0 0 0 16px;
}
.select {
width : 160px;
&:nth-last-of-type(1) {
margin-right: 0;
}
}
.mainCol {
background-color: #fff;
margin-bottom : 24px;
padding : 0 24px;
box-sizing : border-box;
border-radius: 8px;
&-title {
font-size : 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color : #303133;
padding : 20px 0;
}
&:nth-last-of-type(1) {
margin: 0;
}
&-row {
display : flex;
flex-wrap : wrap;
padding-bottom: 16px;
&-col {
display: flex;
width : calc(100% / 3);
padding: 16px 0;
&-option {
flex : 1;
font-size : 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #909399;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #303133;
}
}
}
}
&-rows {
display : flex;
padding-bottom: 16px;
&-cols {
flex: 1;
.cols-main {
display: flex;
padding: 16px 0;
&:nth-last-of-type(1) {
padding-bottom: 0;
}
&-options {
flex : 1;
font-size : 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #909399;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #303133;
}
}
}
}
}
}
This diff is collapsed.
This diff is collapsed.
/*
* @Author: LeeJiancong
* @Date: 2020-09-23 10:24:42
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-29 14:25:20
* 外部流转记录
*/
import React, { Component,useRef,ReactNode } from 'react';
import {StandardTable} from 'god'
import {Badge} from 'antd'
import {ColumnType} from 'antd/lib/table/interface'
import moment from 'moment'
const columns: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'operatorRoleId',
align: 'center',
key: 'operatorRoleId',
},
{
title: '操作角色',
dataIndex: 'operatorRoleName',
align: 'center',
key: 'operatorRoleName',
},
{
title: '状态',
dataIndex: 'status',
align: 'left',
key: 'status',
render: (text: number, record: any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="待提交" />:
text === 2 ? component = <Badge status='processing' text="待确认" />:
text === 3 ? component = <Badge status='error' text="不接受物流单" />:
component = <Badge status='success' text="接受物流单" />
return component;
},
},
{
title: '操作',
dataIndex: 'type',
align: 'center',
key: 'type',
render: (text: number ,record:any) =>
<>{text === 1 ?'提交物流单':'确认物流单'}</>
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
key: 'operateTime',
render:(text: any, record: any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
},
{
title: '审核意见',
dataIndex: 'remark',
align: 'center',
key: 'remark',
width: 300
},
];
export interface Params{
id: string | number,
pathName?: string,
type?: string //Submit 能力中心待提交新增编辑
}
const Log: React.FC<Params> = (props) => {
const ref = useRef<any>({})
const fetchData = (params: any) => {
//待提交新增物流单
if(props.type === 'Submit' ){
return new Promise((resolve, reject) => {
if(!props.id){
resolve([])
}else{
/** 接口待转v2 */
getLogisticsOrderWaitSubmitPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
}
});
}
//物流单提交-物流单查询
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail'){
return new Promise((resolve, reject) => {
/** 接口待转v2 */
getLogisticsOrderSubmitPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
//物流单处理-物流单查询
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail'){
return new Promise((resolve, reject) => {
/** 接口待转v2 */
getLogisticsOrderConfirmPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
//物流单处理-待确认物流单
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/detail'){
return new Promise((resolve, reject) => {
/** 接口待转v2 */
getLogisticsOrderWaitConfirmPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
};
return <StandardTable
tableProps={{rowKey:'operatorRoleId'}}
currentRef={ref}
columns={columns}
fetchTableData={(params: any) => fetchData(params)}
/>
}
Log.defaultProps= {
type:"Submit"
}
export default Log
This diff is collapsed.
This diff is collapsed.
.selectBtn {
padding: 0 !important;
}
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .ant-input-group-wrapper .ant-input-wrapper .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .selectBtn .ant-input-wrapper .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .ant-input-group-wrapper .ant-input-group .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .selectBtn .ant-input-group .ant-input-group-addon {
padding: 0 !important;
}
.selectBtn{
padding: 0 !important;
}
.ant-form-item-control{
.ant-form-item-control-input{
.ant-form-item-control-input-content{
.ant-input-group-wrapper, .selectBtn{
.ant-input-wrapper ,.ant-input-group{
.ant-input-group-addon{
padding: 0 !important;
}
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
/*
* @Date: 2020-07-13 15:01:40
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-17 17:17:12
*/
import React, { ReactNode, useRef } from 'react'
import { history } from 'umi'
import { Button, Popconfirm, Card, message } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import {
PlusOutlined,
PlayCircleOutlined,
PauseCircleOutlined,
EyeOutlined
} from '@ant-design/icons'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import EyePreview from '@/components/EyePreview'
import StatusSwitch from '@/components/StatusSwitch'
import { getLogisticsCompanyPage, postLogisticsCompanyDelete, postLogisticsCompanyEnable } from '@/services/LogisticsV2Api'
const data = [
{
key: '1',
attrName: '采购商',
attrGroup: '采购',
displayType: '单选',
required: '平台物流服务商',
status: 1,
},
{
key: '2',
attrName: '供应商',
attrGroup: '供应',
displayType: '双选',
required: '商户合作物流公司',
status: 0,
},
]
// 模拟请求
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
getLogisticsCompanyPage({ ...params }).then(res => {
resolve(res.data)
})
})
}
// const fetchData = async (params?: any) => {
// console.log(params)//可以直接打印参数
// let res = await getLogisticsCompanyPage({...params })
// return res.data
// }
const Company: React.FC<{}> = () => {
const ref = useRef<any>({})
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '物流公司编码/平台会员ID',
align: 'center',
dataIndex: 'companyMemberId',
key: "companyMemberId",
render: (value: any, recond: any) =>
<>{value ? value : recond.code}</>
},
{
title: '物流公司名称',
dataIndex: 'name',
align: 'left',
key: 'name',
render: (text: any, record: any) => (
<EyePreview url={`/memberCenter/logisticsAbility/logistics/company/detail?id=${record.id}`}>{text}</EyePreview>
)
},
{
title: '合作类型',
align: 'center',
dataIndex: 'cooperateType',
key: 'cooperateType',
render: (value: any, recode: any) =>
<>
{value == 1 ? '平台物流服务商' : '商户合作物流公司'}
</>
},
{
title: '状态',
align: 'center',
dataIndex: 'status',
key: 'status',
render: (text: any, record: any) => (
<StatusSwitch fieldNames="status" handleConfirm={() => handleChangeStatus(record.id, record.status)} record={record} />
)
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text: any, record: any) => {
const title = `确定要${status}吗?`
return (
<>
{record.status === 0 &&
<>
<Button type='link' onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/company/edit?id=${record.id}`)}>编辑</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() => handleDelete(record.id)}>
<Button type='link'>
删除
</Button>
</Popconfirm>
</>
}
</>
)
}
}
];
const search: IFormFilter[] = [
{
type: 'Input',
value: 'keywords',
col: 4,
placeHolder: '输入属性名称'
}
]
const searchBarActions: IButtonFilter[] = [
{
type: 'primary',
text: '新建',
icon: <PlusOutlined />,
handler: () => {
history.push('/memberCenter/logisticsAbility/logistics/company/add')
}
}
]
const handleDelete = (id: any) => {
postLogisticsCompanyDelete({ id: id }).then(res => {
if (res.code === 1000) {
ref.current.reload()
}
})
}
const handleChangeStatus = async (id: any, status: any) => {
let _status = status == 1 ? 0 : 1
await postLogisticsCompanyEnable({ id: id, status: _status })
ref.current.reload()
}
const handleSee = (id: number) => {
history.push(`/memberCenter/logisticsAbility/logistics/company/detail?id=${id}&isSee=true`)
}
const confirm = () => {
console.log('confirm')
}
const cancel = () => {
console.log('cancel')
}
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record)
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
formilyChilds={{
children: (
<>
<Button type="primary" onClick={() => history.push('/memberCenter/logisticsAbility/logistics/company/add')}>
新建 <PlusOutlined />
</Button>
</>
)
}}
/>
</Card>
</PageHeaderWrapper>
)
}
export default Company
This diff is collapsed.
/*
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-25 14:09:11
*/
import React, { Component, ReactNode, useRef, useState } from 'react'
import { history } from 'umi'
import { Modal, Card, Button, Form, InputNumber, Radio, Popconfirm, Switch, Input } from 'antd';
import {
PlayCircleOutlined,
PauseCircleOutlined,
PlusOutlined,
EyeOutlined,
PlusCircleOutlined
} from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import { getLogisticsReceiverAddressPage, getLogisticsShipperAddressPage, postLogisticsReceiverAddressDelete, postLogisticsShipperAddressDelete } from '@/services/LogisticsV2Api';
const data = [
{
key: '1',
shipperName: '采购商',
phone: '18819276235',
tel: '02020',
required: '平台物流服务商',
isDefault: 0,
code: 252525,
status: 1,
address: '地址'
},
{
key: '2',
shipperName: '采购商',
phone: '18819276235',
tel: '02020',
required: '平台物流服务商',
isDefault: 0,
code: 252525,
status: 0,
address: '地址32'
},
]
// const fetchData = (param: any) => {
// return new Promise((resolve) => {
// let reqParam = {
// ...param
// }
// getUserInfoList(reqParam).then(res => {
// resolve(res.data)
// })
// })
// }
interface Item {
key: string
}
//父页面传递来的参数
export interface ListProps {
title?: React.ReactNode,
type: string,
}
export interface ListType {
checked: boolean //可选
}
interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
editing: boolean;
dataIndex: string;
title: any;
inputType: 'number' | 'text';
record: Item;
index: number;
children: React.ReactNode;
}
const EditableCell: React.FC<EditableCellProps> = ({
editing,
dataIndex,
title,
inputType,
record,
index,
children,
...restProps
}) => {
const inputNode = inputType === 'number' ? <InputNumber /> : <Input />;
return (
<td {...restProps}>
{editing ? (
<Form.Item
name={dataIndex}
style={{ margin: 0 }}
rules={[
{
required: true,
message: `Please Input ${title}!`,
},
]}
>
{inputNode}
</Form.Item>
) : (
children
)}
</td>
);
};
/**
* @description:
* @param {type}
* @return:
*/
const AddressList: React.FC<ListProps> = (props) => {
console.log(props)
const ref = useRef<any>({})
const [form] = Form.useForm();
const [table, setTable] = useState([])
const [editingKey, setEditingKey] = useState('');
const toEdit = (id: number) => {
// 发货地址管理列表,否则是收件地址管理列表
if (props.type == '1') {
history.push(`/memberCenter/logisticsAbility/logistics/deliveryAddress/edit?id=${id}`)
} else {
// history.push(`/memberCenter/logisticsAbility/logistics/addressForm?page_type=${props.type}&id=${id}`)
history.push(`/memberCenter/logisticsAbility/logistics/receivingAddress/edit?id=${id}`)
}
};
const columns: ColumnType<any>[] = [
{
title: props.type == '1' ? '发货人姓名' : '收货人姓名',
dataIndex: props.type == '1' ? 'shipperName' : 'receiverName',
align: 'center',
key: props.type == '1' ? 'shipperName' : 'receiverName',
},
{
title: props.type == '1' ? '发货地址' : '收货地址',
align: 'left',
dataIndex: 'address',
key: 'address',
render: (_: any, record: any) => (
<>
{record.fullAddress}
</>
)
},
{
title: '邮编',
dataIndex: 'postalCode',
align: 'center',
key: 'postalCode'
},
{
title: '手机号码',
align: 'center',
dataIndex: 'phone',
key: 'phone',
},
{
title: '电话号码',
align: 'center',
dataIndex: 'tel',
key: 'tel'
},
{
title: '是否默认',
align: 'center',
dataIndex: 'isDefault',
key: 'isDefault',
render: (_: any, record: any) =>
<Switch size='small' disabled defaultChecked={record.isDefault == 0 ? false : true}
/>,
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (_: any, record: any) => {
return (
<>
<><Button type="link" onClick={() => toEdit(record.id)}>编辑</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() => handleDelete(record.id)}>
<Button type='link'>删除</Button>
</Popconfirm>
</>
</>
)
}
}
];
// 模拟请求
const fetchData = (params: any) => {
console.log(params);
return new Promise((resolve, reject) => {
if (props.type === '1') {//发货
getLogisticsShipperAddressPage({...params }).then(res => {
resolve(res.data)
})
} else {
getLogisticsReceiverAddressPage({...params}).then(res => {
resolve(res.data)
})
}
})
}
//生命周期
// useEffect(() => {
// effect
// return () => {
// cleanup
// }
// }, [input])
const onDefaultChange = (id: any, checked: boolean) => {
console.log(id, checked)
columns.forEach((v, index) => {
})
}
const handleDelete = (id:number) => {
if(props.type === '1'){
postLogisticsShipperAddressDelete({id:id}).then(res => {
ref.current.reload()
})
}else{
postLogisticsReceiverAddressDelete({id:id}).then(res => {
ref.current.reload()
})
}
}
const search: IFormFilter[] = [
{
type: 'Input',
value: 'keywords',
col: 4,
placeHolder: '输入属性名称'
}
]
const searchBarActions: IButtonFilter[] = [
{
type: 'primary',
text: '新建',
icon: <PlusOutlined />,
handler: () => {
history.push('/logisticsAbility/logistics/addCompany')
}
}
]
const handleSee = (record: any) => {
console.log('see')
}
const confirm = () => {
console.log('confirm')
}
const cancel = () => {
console.log('cancel')
}
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record)
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{rowKey:'id'}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
rowClassName="editable-row"
formilyChilds={{
children: (
<>
<Button
type="primary"
icon={<PlusOutlined />}
onClick={() => {
// 发货地址管理列表,否则是收件地址管理列表
if (props.type == '1') {
// history.push(`/memberCenter/logisticsAbility/logistics/addressForm?page_type=${props.type}&id=0`)
history.push(`/memberCenter/logisticsAbility/logistics/deliveryAddress/add`)
} else {
// history.push(`/memberCenter/logisticsAbility/logistics/addressForm?page_type=${props.type}&id=0`)
history.push(`/memberCenter/logisticsAbility/logistics/receivingAddress/add`)
}
}}
>
新建
</Button>
</>
)
}}
/>
</Card>
</PageHeaderWrapper>
)
}
AddressList.defaultProps = {
}
export default AddressList
.schemaform {
:global {
.ant-row {
.ant-form-item-label {
label {
font-size: 12px !important;
}
}
.formily-mega-item-after,
.formily-mega-item-before {
font-size: 12px !important;
}
.mega-layout-item-content {
line-height: normal !important;
}
.formily-mega-item-before {
margin-left: 108px;
}
.preview-text {
line-height: 32px;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
import React, { useState } from 'react';
import AddressList from './components/addressList'
const List = () => {
return (
<AddressList title='发货地址管理' type='1'/>
)
}
export default List
\ No newline at end of file
import React, { useState } from 'react';
import AddressList from './components/addressList'
const List = () => {
return (
<AddressList title='收货地址管理' type='2'/>
)
}
export default List
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-10-16 14:29:56
*/
import React, { Component, ReactNode, useRef, useState } from 'react'
import { history } from 'umi'
import { Modal, Card, Row, Col, Button, Form, InputNumber, Radio, Popconfirm, Switch, Input } from 'antd';
import {
PlayCircleOutlined,
PauseCircleOutlined,
PlusOutlined,
EyeOutlined,
PlusCircleOutlined
} from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import StatusSwitch from '@/components/StatusSwitch'
import EyePreview from '@/components/EyePreview'
import { getLogisticsFreightTemplatePage, postLogisticsFreightTemplateDelete, postLogisticsFreightTemplateEnable } from '@/services/LogisticsV2Api';
const data = [
{
key: '1',
name: '采购商',
pricingMode: '计价方式',
transportMode: '运费方式',
explain: '运费说明',
code: 252525,
status: 1
},
{
key: '2',
name: '采购商',
pricingMode: '计价方式',
transportMode: '运费方式',
explain: '运费说明',
code: 252525,
status: 2
}
]
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
getLogisticsFreightTemplatePage({ ...params }).then(res => {
resolve(res.data)
})
})
}
interface Item {
key: string
}
//父页面传递来的参数
export interface ListProps {
title?: React.ReactNode,
type: string
}
export interface ListType {
checked: boolean //可选
}
interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
editing: boolean;
dataIndex: string;
title: any;
inputType: 'number' | 'text';
record: Item;
index: number;
children: React.ReactNode;
}
const EditableCell: React.FC<EditableCellProps> = ({
editing,
dataIndex,
title,
inputType,
record,
index,
children,
...restProps
}) => {
const inputNode = inputType === 'number' ? <InputNumber /> : <Input />;
return (
<td {...restProps}>
{editing ? (
<Form.Item
name={dataIndex}
style={{ margin: 0 }}
rules={[
{
required: true,
message: `Please Input ${title}!`,
},
]}
>
{inputNode}
</Form.Item>
) : (
children
)}
</td>
);
};
/**
* @description:
* @param {type}
* @return:
*/
const Template: React.FC<ListProps> = (props) => {
console.log(props)
const ref = useRef<any>({})
const [searchForm, setSearchForm] = useState({
name: ''
})
const [form] = Form.useForm();
const [table, setTable] = useState([])
const [editingKey, setEditingKey] = useState('');
const edit = (record: Item) => {
setEditingKey(record.key);
form.setFieldsValue({ code: '', ...record });
console.log(record.key)
};
const columns: ColumnType<any>[] = [
{
title: '模板名称',
dataIndex: 'name',
align: 'left',
key: 'name',
render: (text:any,record:any) => (
<EyePreview url={`/memberCenter/logisticsAbility/logistics/template/detail?id=${record.id}&isSee=${true}`}>{text}</EyePreview>
)
},
{
title: '计价方式',
align: 'center',
dataIndex: 'pricingMode',
key: 'pricingMode',
render: (_: any, record: any) => {
return (
<>{record.transportMode === 1 ? '按重量' : ''}</>
)
}
},
{
title: '运送方式',
dataIndex: 'transportMode',
align: 'center',
key: 'transportMode',
render: (_: any, record: any) => {
return (
<>{record.transportMode === 1 ? '快递' : ''}</>
)
}
},
{
title: '运费说明',
align: 'center',
dataIndex: 'explain',
key: 'explain',
},
{
title: '状态',
align: 'center',
dataIndex: 'status',
key: 'status',
render: (text: any, record: any) => (
<StatusSwitch fieldNames="status" handleConfirm={() => handleChangeStatus(record.id, record.status)} record={record} />
)
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (_: any, record: any) => {
return (
<>
{
record.status === 0 ?
<>
<Button type='link' onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/template/edit?id=${record.id}`)}>编辑</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() =>handleDelete(record.id)}>
<Button type='link'>
删除
</Button>
</Popconfirm>
</> : ''
}
</>
)
}
}
];
//生命周期
// useEffect(() => {
// effect
// return () => {
// cleanup
// }
// }, [input])
const onDefaultChange = (id: any, checked: boolean) => {
console.log(id, checked)
columns.forEach((v, index) => {
})
}
const handleChangeStatus = (id: any, status: any) => {
let _status = status == 0 ? 1 : 0
postLogisticsFreightTemplateEnable({ id: id, status: _status }).then(res => {
if (res.code === 1000) {
console.log(ref)
ref.current.reload()
}
})
}
const handleDelete = (id: number) => {
postLogisticsFreightTemplateDelete({ id: id }).then(res => {
if (res.code === 1000) {
ref.current.reload()
}
})
}
const search: IFormFilter[] = [
{
type: 'Input',
value: 'keywords',
col: 4,
placeHolder: '输入属性名称'
}
]
const handleSee = (id: number) => {
history.push(`/memberCenter/logisticsAbility/logistics/template/detail?id=${id}&isSee=${true}`)
}
const confirm = () => {
console.log('confirm')
}
const cancel = () => {
console.log('cancel')
}
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record)
}
const handleChange = (key: any, val: any) => {
let obj: any = {}
switch (key) {
case 'name':
obj = { ...searchForm, name: val }
break;
}
setSearchForm(obj)
ref.current.reload(obj)
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
rowClassName="editable-row"
formilyChilds={{
children: (
<>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/template/add?id=0`)}>
新建
</Button>
</>
)
}}
/>
</Card>
</PageHeaderWrapper>
)
}
Template.defaultProps = {
}
export default Template
import React from 'react';
import { history } from 'umi';
import CompanyTemplate from '../list/addCompany';
const AddCompany: React.FC<{}> = () => {
return(
<CompanyTemplate />
)
}
export default AddCompany;
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import CompanyTemplate from '../list/addCompany';
const DetailCompany: React.FC<{}> = () => {
const { id } = history.location.query;
return(
<CompanyTemplate
pageStatus={'PREVIEW'}
id={id}
isSee={true}
/>
)
}
export default DetailCompany;
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import CompanyTemplate from '../list/addCompany';
const EditCompany: React.FC<{}> = () => {
const { id } = history.location.query;
return(
<CompanyTemplate
pageStatus={'EDIT'}
id={id}
/>
)
}
export default EditCompany;
\ No newline at end of file
import React, { Component } from 'react'
import OrderList from '../components/orderSearchList'
const List = () => {
return (
<OrderList title='处理' type='2'/>
)
}
export default List
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-18 14:15:07
*/
import React, { Component, ReactNode, useRef, useState, useEffect } from 'react'
import { history } from 'umi'
import {
Modal, Card, Button, Form, InputNumber, Radio,
Popconfirm, Tooltip, Switch, Select, Input, Tag, Row, Col, Space
} from 'antd';
import {
PlayCircleOutlined,
PauseCircleOutlined,
PlusOutlined,
EyeOutlined,
UpOutlined,
DownOutlined,
PlusCircleOutlined
} from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ConfirmModal from '../components/confirmModal'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import { timeRange } from '@/utils/index'
import moment from 'moment'
import statuStyle from '../colorTag'
import { TimeList, outSideStatusList, statusList } from '../statusList'
import style from '../components/index.less'
import { confirmLogisticsOrderSchema } from '../components/schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd';
import { getLogisticsOrderWaitConfirmPage } from '@/services/LogisticsV2Api';
const formActions = createFormActions();
const { Option } = Select
const data = [
{
key: '1',
shipperName: '采购商',
phone: '18819276235',
tel: '02020',
required: '平台物流服务商',
isDefault: 0,
code: 252525,
status: 1,
address: '地址'
},
{
key: '2',
shipperName: '采购商',
phone: '18819276235',
tel: '02020',
required: '平台物流服务商',
isDefault: 0,
code: 252525,
status: 0,
address: '地址32'
},
]
interface Item {
key: string
}
//父页面传递来的参数
export interface ListProps {
title?: React.ReactNode,
type: string
}
interface DiaLogParams {
onCancel: Function
}
export interface ListType {
checked: boolean //可选
}
interface paramsType {
logisticsOrderNo?: string;
invoicesTimeStart?: any;
invoicesTimeEnd?: any;
status?: number | string;
shipperId?: any;
}
interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
editing: boolean;
dataIndex: string;
title: any;
inputType: 'number' | 'text';
record: Item;
index: number;
children: React.ReactNode;
}
const EditableCell: React.FC<EditableCellProps> = ({
editing,
dataIndex,
title,
inputType,
record,
index,
children,
...restProps
}) => {
const inputNode = inputType === 'number' ? <InputNumber /> : <Input />;
return (
<td {...restProps}>
{editing ? (
<Form.Item
name={dataIndex}
style={{ margin: 0 }}
rules={[
{
required: true,
message: `Please Input ${title}!`,
},
]}
>
{inputNode}
</Form.Item>
) : (
children
)}
</td>
);
};
/**
* @description:
* @param {type}
* @return:
*/
const OrderList: React.FC<ListProps> = (props) => {
console.log(props)
const ref = useRef<any>({})
const [form] = Form.useForm();
const [table, setTable] = useState([])
const [editingKey, setEditingKey] = useState('');
const [orderid, setOrderid] = useState(null)
let [visible, setvisible] = useState<boolean>(false)
let [isSearch, setIsSearch] = useState<boolean>(false)
const [TimeRange, setTimeRange] = useState<number>(0)
const [searchForm, setSearchForm] = useState<paramsType>({
logisticsOrderNo: '',
shipperId: '',//收货商
status: '',
invoicesTimeStart: '',
invoicesTimeEnd: ''
})
const columns: ColumnType<any>[] = [
{
title: '物流单号',
dataIndex: 'logisticsOrderNo',
align: 'center',
key: 'logisticsOrderNo',
render: (text: any, reconds: any) =>
<span className="commonPickColor" onClick={() => handleSee(false ,reconds.id)}>{text}&nbsp;<EyeOutlined /></span>
},
{
title: '对应订单号',
align: 'left',
dataIndex: 'relevanceOrderCode',
key: 'relevanceOrderCode'
},
{
title: '发货方',
dataIndex: 'shipperMemberName',
align: 'center',
key: 'shipperMemberName'
},
{
title: '收货方',
align: 'center',
dataIndex: 'receiverMemberName',
key: 'receiverMemberName',
},
{
title: '总箱数',
align: 'center',
dataIndex: 'totalCarton',
key: 'totalCarton'
},
{
title: '总重量',
align: 'center',
dataIndex: 'totalWeight',
key: 'totalWeight'
},
{
title: '总体积',
align: 'center',
dataIndex: 'totalVolume',
key: 'totalVolume'
},
{
title: '单据时间',
align: 'center',
dataIndex: 'invoicesTime',
key: 'invoicesTime',
render: (text: any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
},
{
title: '外部状态',
align: 'left',
dataIndex: 'status',
key: 'status',
filters: statusList,
filterMultiple: false,
onFilter: (value, record) => record.status === value,
render: (text: any, record: any) => {
let component: ReactNode = null
if (text == 3) {
component = <><span style={statuStyle.success}>不接受物流单</span></>
} else if (text == 4) {
component = <><span style={statuStyle.warn}>接受物流单</span></>
} else if (text == 2) {
component = <><span style={statuStyle.confirm}>待确认</span></>
} else if (text == 1) {
component = <><span style={statuStyle.default}>待提交</span></>
}
return component
}
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (_: any, record: any) => {
return (
<>
<Button type='link' onClick={() => handleSee(true, record.id)}>确认</Button>
</>
)
}
}
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
getLogisticsOrderWaitConfirmPage({
...searchForm,
...params
}).then(res => {
resolve(res.data)
})
})
}
const handleDialog = (id: any) => {
setOrderid(id)
setvisible(true)
}
const onDefaultChange = (id: any, checked: boolean) => {
console.log(id, checked)
columns.forEach((v, index) => {
})
}
const handleDelete = () => {
console.log('delete')
}
const handleSee = (option: boolean ,id: any) => {
if(option) {
history.push(`/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/option?id=${id}`)
}else {
history.push(`/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/detail?id=${id}`)
}
}
const confirm = () => {
console.log('confirm')
}
const cancel = () => {
console.log('cancel')
}
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record)
}
const handleSearch = () => {
}
const handleReset = () => {
for (let key in searchForm) {
searchForm[key] = ''
}
setSearchForm({ ...searchForm })
}
const handleModalOK = () => {
setvisible(false)
ref.current.reload()
}
// 搜索
const search = (values: any) => {
ref.current.reload(values)
}
const onCancel = () => {
setvisible(false)
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => search(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'logisticsOrderNo', FORM_FILTER_PATH)
}}
schema={confirmLogisticsOrderSchema}
>
</NiceForm>
}
/>
<ConfirmModal
id={orderid}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK={() => handleModalOK()}
/>
</Card>
</PageHeaderWrapper>
)
}
OrderList.defaultProps = {
}
export default OrderList
import { useState } from 'react'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
export const useModalTable = (options?) => {
const [visible, setVisible] = useState(false)
const [rowSelection, rowSelectionCtl] = useRowSelectionTable(options)
return {
visible,
setVisible,
rowSelection,
rowSelectionCtl
}
}
\ No newline at end of file
import React, { useRef, useMemo, useState } from 'react'
import { ISchemaFormActions, ISchemaFormAsyncActions, createControllerBox, useFormSpy } from '@formily/antd';
import { Button, Row, Col } from 'antd';
import { productInfoColumns } from '../constant';
import ProductTableCell, { ProductEditableRow } from '../components/productTableCell';
import { useModalTable } from './useModalTable';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
const getUnitPriceTotal = (record) => {
const purchaseCount = Number(record['purchaseCount']) || 0
let unitPrice = 0
Object.entries(record.unitPrice).forEach(([key, value]) => {
const [min, max] = key.split('-').map(v => Number(v))
if (min === 0 && max === 0) {
unitPrice = Number(value)
return false
}
if (purchaseCount >= min && purchaseCount <= max) {
// 处于该区间
unitPrice = Number(value)
return false
}
})
return unitPrice * purchaseCount
}
export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
const productRef = useRef<any>({})
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'})
const { pageStatus } = usePageStatus()
const handleDelete = (record) => {
const newData = [...ctx.getFieldValue('orderProductRequests')]
// 删除formvalue
const colIndex = newData.findIndex(v => v.id === record.id)
newData.splice(colIndex, 1)
// 删除选中的项
rowSelectionCtl.setSelectRow(newData)
rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id))
ctx.setFieldValue('orderProductRequests', newData)
}
const [productColumns, setProductColumns] = useState(() => {
if (pageStatus === PageStatus.ADD) {
productInfoColumns[productInfoColumns.length - 1].render = (text, record) => {
return <>
<Button type='link' onClick={() => handleDelete(record)}>删除</Button>
<Button type='link'>选择合并订单</Button>
</>
}
} else {
return [...productInfoColumns].slice(0, productInfoColumns.length - 1)
}
return productInfoColumns
})
const productAddButton = <Button onClick={() => productRef.current.setVisible(true)} block type='default' style={{margin: '24px auto'}}>选择订单商品</Button>
const productComponents = {
body: {
row: ProductEditableRow,
cell: ProductTableCell
}
}
const handleSave = row => {
return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('orderProductRequests')];
const index = newData.findIndex(item => row.id === item.id);
const item = newData[index];
row['price'] = getUnitPriceTotal(row)
row['productId'] = row.id
newData.splice(index, 1, {
...item,
...row,
});
ctx.setFieldValue('orderProductRequests', newData)
resolve({item, newData})
})
};
const productMergeColumns = productColumns.map(col => {
if (!col.editable) {
return col;
}
return {
...col,
onCell: record => ({
record,
editable: ctx.getFormState().editable === false ? false : col.editable,
dataIndex: col.dataIndex,
title: col.title,
formItem: col.formItem,
formItemProps: col.formItemProps,
handleSave
}),
};
})
return {
productRef,
productAddButton,
productColumns: productMergeColumns,
productComponents,
visible,
setVisible,
rowSelection,
rowSelectionCtl
}
}
\ No newline at end of file
import React, { Component } from 'react'
import OrderList from '../components/orderSearchList'
const List = () => {
return (
<OrderList title='提交' type='1'/>
)
}
export default List
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const AddShipingAddress:React.FC<{}> = () => {
return(
<AddressTemplate
type={2}
/>
)
}
export default AddShipingAddress;
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const EditShipingAddress:React.FC<{}> = () => {
const { id } = history.location.query;
return(
<AddressTemplate
type={2}
id={id}
/>
)
}
export default EditShipingAddress;
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const AddShipingAddress:React.FC<{}> = () => {
return(
<AddressTemplate
type={1}
id={0}
/>
)
}
export default AddShipingAddress;
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const EditShipingAddress:React.FC<{}> = () => {
const { id } = history.location.query;
return(
<AddressTemplate
type={1}
id={id}
/>
)
}
export default EditShipingAddress;
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-08-01 11:06:09
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-01 11:07:49
*/
export const TimeList = [
{
label: '单据时间(全部)', value: 0
},
{
label: '今天', value: 1
},
{
label: '一周内', value: 2
},
{
label: '一个月内', value: 3
},
{
label: '三个月内', value: 4
},
{
label: '六个月内', value: 5
},
{
label: '一年内', value: 6
},
{
label: '一年前', value: 7
}
]
export const outSideStatusList = [
{
label: '外部状态(全部)', value: ''
},
{
label: '待提交', value: 1
},
{
label: '待确认', value: 2
},
{
label: '接受物流单', value: 3
},
{
label: '不接受物流单', value: 4
}
]
export const statusList = [
{
text: '待提交', value: 1
},
{
text: '待确认', value: 2
},
{
text: '接受物流单', value: 3
},
{
text: '不接受物流单', value: 4
}
]
\ No newline at end of file
......@@ -17,13 +17,21 @@ import {
FormEffectHooks,
FormPath,
} from '@formily/antd';
<<<<<<< HEAD
import { getMemberDepositClassifyCity, getMemberDepositClassifyProvince } from '@/services/MemberV2Api';
=======
>>>>>>> 1fb662be44e7d6f880b3e886f596bb2a2c814806
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { ArrayCards } from '@formily/antd-components';
import { schema } from './schema';
import CascaderFormItem from '../../../components/CascaderFormItem';
import styles from './index.less';
<<<<<<< HEAD
// import { getProductCustomerGetCustomerCategoryTree } from '@/services/ProductApi';
=======
import { getMemberDepositClassifyCity, getMemberDepositClassifyProvince } from '@/services/MemberV2Api/id9022';
import { getProductCustomerGetCustomerCategoryTree } from '@/services/ProductV2Api/id6097';
>>>>>>> 1fb662be44e7d6f880b3e886f596bb2a2c814806
type CategoriesType = {
/**
......
......@@ -22,8 +22,11 @@ import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import MellowCard from '@/components/MellowCard';
import NoData from '@/components/NoData';
<<<<<<< HEAD
import { getMemberAbilityInfoApplyDepositDetail, getMemberAbilityInfoDepositDetail, postMemberAbilityInfoApply, postMemberAbilityInfoDepositDetailUpdate } from '@/services/MemberV2Api';
import { getManageContentNoticeFindAllByColumnType } from '@/services/ManageV2Api';
=======
>>>>>>> 1fb662be44e7d6f880b3e886f596bb2a2c814806
import { normalizeFiledata, FileData } from '@/utils';
import schema, { GroupItem } from './schema';
import { useBusinessEffects } from '../../components/QualitiesUploadFormItem/effects';
......@@ -33,6 +36,11 @@ import SubmitSuccess from './components/SubmitSuccess';
import QualitiesUpload from '../../components/QualitiesUpload';
import QualitiesUploadFormItem from '../../components/QualitiesUploadFormItem';
import AreaSelect from '../../components/AreaSelect';
<<<<<<< HEAD
=======
import { getMemberAbilityInfoApplyDepositDetail, getMemberAbilityInfoDepositDetail, postMemberAbilityInfoApply, postMemberAbilityInfoDepositDetailUpdate } from '@/services/MemberV2Api/id9393';
import { getManageContentNoticeFindAllByColumnType } from '@/services/ManageV2Api';
>>>>>>> 1fb662be44e7d6f880b3e886f596bb2a2c814806
type ValueType = {
......@@ -243,7 +251,11 @@ const MemberQueryApplyMember: React.FC<RouteComponentProps> = (props: any) => {
});
} else {
postMemberAbilityInfoDepositDetailUpdate({
<<<<<<< HEAD
validateId: validateId as number,
=======
validateId: validateId as number,
>>>>>>> 1fb662be44e7d6f880b3e886f596bb2a2c814806
detail: step3,
...commonPayload,
}).then(res => {
......
......@@ -8,7 +8,7 @@ import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd';
import EyePreview from '@/components/EyePreview';
import { PlusOutlined, PlayCircleOutlined, PauseCircleOutlined } from '@ant-design/icons';
import { getContractContractTemplatePage } from '@/services/ContractV2Api';
import { getContractContractTemplatePage, postContractContractTemplateDelete, postContractContractTemplateEnable } from '@/services/ContractV2Api';
const formActions = createFormActions();
const Template: React.FC<{}> = () => {
......@@ -125,7 +125,7 @@ const Template: React.FC<{}> = () => {
/**合同模板停用/启用 */
const confirm = (recode: any) => {
PublicApi.postContractContractTemplateEnable({
postContractContractTemplateEnable({
id: recode.id,
state: recode.state === 1 ? 0 : 1,
}).then(res => {
......@@ -135,7 +135,7 @@ const Template: React.FC<{}> = () => {
/**删除 */
const confirmDel = (recode: any) => {
PublicApi.postContractContractTemplateDelete({ id: recode.id }).then(res => {
postContractContractTemplateDelete({ id: recode.id }).then(res => {
ref.current.reload()
})
}
......
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