Commit 0e6ebfdf authored by GuanHua's avatar GuanHua

merge

parents cce650bb 87846397
......@@ -143,7 +143,9 @@ export function render(oldRender: Function) {
*/
export function onRouteChange({ routes, matchedRoutes, location, action }) {
console.log('onRouteChange')
// 路由切换时, 自动回到顶部
document.body.scrollTop = document.documentElement.scrollTop = 0
if (isDev) {
return;
}
......
......@@ -79,7 +79,7 @@ const ModalTable:React.FC<ModalTableProps> = (props) => {
tableType='small'
currentRef={selfRef}
formRender={(child, ps) => <Row justify='space-between'>
<Col span={18}>{child}</Col>
<Col span={18} style={{zIndex: 99}}>{child}</Col>
<Col style={{marginTop: 4}}>{ps}</Col>
</Row>}
formilyProps={
......
import React from 'react'
import { ISchemaFieldProps } from '@formily/antd'
import { ISchemaFieldProps, ISchemaFieldComponentProps } from '@formily/antd'
const VirtualChildren = (props) => {
const VirtualChildren = (props: ISchemaFieldComponentProps) => {
// console.log(props)
const { children } = props
const { children } = props.schema.getExtendsComponentProps()
// const componentProps = schema.getExtendsComponentProps()
// const { children } = componentProps
return (
......
......@@ -26,8 +26,11 @@ import { Checkbox, Radio } from '@formily/antd-components';
import DateSelect from './components/DateSelect';
import VirtualChildren from './components/VirtualChildren'
import { useLinkComponentProps } from './linkages/linkComponentProps';
import Loading from '../Loading';
export interface NiceFormProps extends IAntdSchemaFormProps {}
export interface NiceFormProps extends IAntdSchemaFormProps {
loading?: boolean
}
const SchemaFormButtonGroup = createVirtualBox('schemaButtonGroup', FormButtonGroup)
const SchemaButton = createVirtualBox('schemaButton', Button)
......@@ -96,26 +99,30 @@ export const componentExport = {
RadioGroup: Radio.Group
}
const NiceForm: React.FC<NiceFormProps> = props => {
const { children, components, effects, expressionScope, ...reset } = props;
const { children, components, effects, expressionScope, loading = false, ...reset } = props;
const defineComponents = Object.assign(componentExport, components);
return (
<SchemaForm
colon={false}
components={defineComponents}
effects={($, ctx) => {
// 自定义联动scope收集器
useLinkComponentProps(expressionScope)
<div style={{width: '100%', position: 'relative'}}>
<SchemaForm
colon={false}
components={defineComponents}
style={{opacity: loading ? 0 : 1, position: loading ? 'absolute' : 'initial'}}
effects={($, ctx) => {
// 自定义联动scope收集器
useLinkComponentProps(expressionScope)
// 组件联动
effects && effects($, ctx)
}}
expressionScope={expressionScope}
{...reset}
>
{children}
</SchemaForm>
// 组件联动
effects && effects($, ctx)
}}
expressionScope={expressionScope}
{...reset}
>
{children}
</SchemaForm>
{ loading && <Loading/> }
</div>
);
};
......
......@@ -407,3 +407,210 @@ export enum COMMODITY_TYPE {
*/
integral = 3
}
// 采购订单外部工作流状态
export enum PurchaseOrderOutWorkState {
/**
* 取消订单
*/
CANCEL_ORDER = -1,
/**
* 提交订单
*/
SUBMIT_ORDER = 1,
/**
* 确认订单
*/
CONFIRM_ORDER,
/**
* 确认电子合同
*/
CONFIRM_ELECTRONIC,
/**
* 订单支付
*/
PAY_ORDER,
/**
* 确认支付结果
*/
CONFIRM_PAY_RESULT,
/**
* 新增销售发货单
*/
ADD_SALE_INVOICE_ORDER,
/**
* 新增物流单
*/
ADD_LOGISTICS_ORDER,
/**
* 订单发货确认
*/
CONFIRM_DELIVERY_ORDER,
/**
* 新增采购入库单
*/
ADD_PURCHASE_STOCK_ORDER,
/**
* 订单收货确认
*/
CONFIRM_RECEIPT_ORDER,
/**
* 确认回单
*/
CONFIRM_RECEIPT,
/**
* 订单归档供应商
*/
FILING_SUPPLIER_ORDER,
/**
* 订单归档采购商
*/
FILING_BUYER_ORDER,
/**
* 完成订单
*/
FINISH_ORDER,
/**
* 不接受订单
*/
NOT_ACCEPTED_ORDER = 20,
/**
* 确认没到账
*/
CONFIRM_NOT_ARRIVED_ACCOUNT,
/**
* 货品数量还没有全部发货重新发货
*/
PRODUCT_ACOUNT_NOT_SEND
}
// 采购订单内部工作流状态
export enum PurchaseOrderInsideWorkState {
/**
* 取消订单
*/
CANCEL_ORDER = -1,
/**
* 新增采购订单
*/
ADD_PURCHASE_ORDER = 1,
/**
* 一级审核订单
*/
ONE_LEVEL_AUDIT_ORDER,
/**
* 二级审核订单
*/
TWO_LEVEL_AUDIT_ORDER,
/**
* 提交订单
*/
SUBMIT_ORDER,
/**
* 提交订单完成
*/
SUBMIT_FINISH_ORDER,
/**
* 提交一级审核订单不通过
*/
ONE_LEVEL_AUDIT_ORDER_NOT_ALLOWED,
/**
* 提交二级审核订单不通过
*/
TWO_LEVEL_AUDIT_ORDER_NOT_ALLOWED,
/**
* 确认电子合同
*/
CONFIRM_ELECTRONIC,
/**
* 支付成功
*/
PAY_SUCCESS = 10,
/**
* 支付失败
*/
PAY_ERROR,
/**
* 确认收货
*/
CONFIRM_RECEIPT,
/**
* 订单入库
*/
WAREHOUSE_ORDER = 14,
/**
* 订单归档
*/
FILLING_ORDER,
}
// 采购订单外部显示文案
export const PurchaseOrderOutWorkStateTexts = {
"-1": "取消订单",
1: '提交订单',
2: '确认订单',
3: '确认电子合同',
4: '订单支付',
5: '确认支付结果',
6: '新增销售发货单',
7: '新增物流单',
8: '订单发货确认',
9: '新增采购入库单',
10: '订单收货确认',
11: '确认回单',
12: '订单归档供应商',
13: '订单归档采购商',
14: '完成订单',
20: '不接受订单',
21: '确认没到账',
22: '货品未全部发货'
}
export const PurchaseOrderInsideWorkStateTexts = {
"-1": '取消订单',
1: '新增采购订单',
2: '一级审核订单',
3: '二级审核订单',
4: '提交订单',
5: '提交订单完成',
6: '提交一级审核订单不通过',
7: '提交二级审核订单不通过',
8: '确认电子合同',
10: '支付成功',
11: '支付失败',
12: '确认收货',
14: '订单入库',
15: '订单归档'
}
......@@ -168,6 +168,7 @@ const SelectChannel:React.FC<IProps> = (props) => {
// 获取渠道会员
const fetchMemberData = (params: any) => {
params.roleId = selectedOption.value
return new Promise((resolve, reject) => {
PublicApi.getMemberManageLowerChannelPageByname(params).then(res => {
const { data } = res
......@@ -240,7 +241,7 @@ const SelectChannel:React.FC<IProps> = (props) => {
name="add-channel-merchant"
labelAlign="left"
colon={false}
initialValues={{channelMemberRoleId: memberRoleList[0].roleId}}
initialValues={{childMemberRoleId: memberRoleList[0].roleId}}
>
{/* <Form.Item name="channelMemberRoleId">
<Radio.Group buttonStyle="solid" defaultValue={1} className={styles.customizeRadio}>
......
......@@ -229,12 +229,12 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
<Form.Item
name="brandId"
label="商品品牌"
rules={[
{
required: true,
message: '请选择商品品牌'
}
]}
// rules={[
// {
// required: true,
// message: '请选择商品品牌'
// }
// ]}
>
<Select
disabled={!isUpdateAttribute}
......
......@@ -558,7 +558,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
label={
<span>
单位&nbsp;
<Tooltip title="这是一段描述?">
<Tooltip title="例如平方英尺、千克、米、升等,请设置为与货品管理中对应的货品相同单位">
<QuestionCircleOutlined />
</Tooltip>
</span>
......@@ -598,7 +598,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
label={
<span>
最小起订&nbsp;
<Tooltip title="这是一段描述?">
<Tooltip title="您设置了最小起订后,采购下单时最小购买数量为最小起订设置的值">
<QuestionCircleOutlined />
</Tooltip>
</span>
......@@ -621,7 +621,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
label={
<span>
产品定价&nbsp;
<Tooltip title="这是一段描述?">
<Tooltip title="现货价格:表示是现货销售的价格,价格明码标价,采购时按照标价下单,价格需要询价:表示价格未设定,需要询价报价后再下单采购">
<QuestionCircleOutlined />
</Tooltip>
</span>
......@@ -632,18 +632,24 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}]}
// initialValue={planPrice}
>
<Radio.Group onChange={handlePlanPriceChange}>
<Radio value={1}>现货价格</Radio>
<Radio value={2}>价格需要询价</Radio>
<Radio value={3}>积分兑换商品</Radio>
</Radio.Group>
{
history.location.query?.id ? <Radio.Group onChange={handlePlanPriceChange} disabled={!productInfoByEdit.isUpdateAttribute}>
<Radio value={1}>现货价格</Radio>
<Radio value={2}>价格需要询价</Radio>
<Radio value={3}>积分兑换商品</Radio>
</Radio.Group> : <Radio.Group onChange={handlePlanPriceChange}>
<Radio value={1}>现货价格</Radio>
<Radio value={2}>价格需要询价</Radio>
<Radio value={3}>积分兑换商品</Radio>
</Radio.Group>
}
</Form.Item>
<Form.Item
name="isMemberPrice"
label={
<span>
会员折扣&nbsp;
<Tooltip title="这是一段描述?">
<Tooltip title="是否允许会员使用会员折扣价购买当前商品">
<QuestionCircleOutlined />
</Tooltip>
</span>
......
......@@ -128,7 +128,7 @@ const SelectGoodsForm: React.FC<Iprops> = (props) => {
return (<>
{
selectCategoryId && selectBrandId ? <>
selectCategoryId ? <>
<Form
{...layout}
form={selectGoodsForm}
......
......@@ -38,12 +38,14 @@ interface Item {
interface paramItem {
name: string;
code: string;
priceType: number;
min: number;
max: number;
priceType?: number;
priceTypeList: number[];
min: any;
max: any;
brandId: number;
customerCategoryId: number;
status: number;
status?: number;
statusList: number[];
}
let timeChange: any;
......@@ -69,11 +71,13 @@ const Products: React.FC<{}> = () => {
name: '',
code: '',
priceType: null,
priceTypeList: null,
min: null,
max: null,
brandId: 0,
customerCategoryId: 0,
status: null,
statusList: null,
})
const [brandData, setBrandData] = useState<any>([])
const [brandValue, setBrandValue] = useState(undefined)
......@@ -245,7 +249,6 @@ const Products: React.FC<{}> = () => {
}
const fetchData = (params: any) => {
console.log(params, filterParams)
return new Promise((resolve, reject) => {
PublicApi.getProductCommodityGetCommodityList({ ...filterParams, ...params}).then(res => {
console.log(res, 'res')
......@@ -256,7 +259,6 @@ const Products: React.FC<{}> = () => {
}
const handleSee = (record: any) => {
console.log('see')
history.push(`/memberCenter/commodityAbility/commodity/products/viewProducts?id=${record.id}`)
}
......@@ -562,7 +564,7 @@ const Products: React.FC<{}> = () => {
}
const handleReset = () => {
let restObj = { name: '', code: '', max: null, min: null, priceType: null, brandId: 0, customerCategoryId: 0, status: null }
let restObj = { name: '', code: '', max: null, min: null, priceType: null, priceTypeList: null, brandId: 0, customerCategoryId: 0, status: null, statusList: null }
setFilterParams(restObj)
setBrandValue(undefined)
setClassValue(undefined)
......@@ -596,8 +598,12 @@ const Products: React.FC<{}> = () => {
}
const handleSearch = (val?: string) => {
console.log(val)
let obj = val ? {...filterParams, name: val} : { ...filterParams }
let _params: any = { ...filterParams }
if(_params.priceType)
_params.priceTypeList = [_params.priceType]
if(_params.status)
_params.statusList = [_params.status]
let obj = val ? {..._params, name: val} : { ..._params }
setFilterParams(obj)
ref.current.reload(obj)
}
......@@ -726,7 +732,7 @@ const Products: React.FC<{}> = () => {
style={{ width: '40%', textAlign: 'center' }}
min={0}
placeholder="最低价格"
onChange={(e)=>setFilterParams({...filterParams, min: +e})}
onChange={(e)=>setFilterParams({...filterParams, min: e})}
/>
<Input
style={{
......@@ -749,7 +755,7 @@ const Products: React.FC<{}> = () => {
}}
min={0}
placeholder="最高价格"
onChange={(e)=>setFilterParams({...filterParams, max: +e})}
onChange={(e)=>setFilterParams({...filterParams, max: e})}
/>
</Input.Group>
</Col>
......
......@@ -133,10 +133,10 @@ export const channelSchema: ISchema = {
label: '现货价格',
value: 1,
},
{
label: '价格需要询价',
value: 2,
},
// {
// label: '价格需要询价',
// value: 2,
// },
{
label: '积分兑换商品',
value: 3,
......@@ -232,21 +232,21 @@ export const addChannelSchema: ISchema = {
},
},
properties: {
categoryId: {
customerCategoryName: {
type: 'string',
"x-component": 'SearchSelect',
// "x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品类',
className: 'fixed-ant-selected-down',
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
placeholder: '请输入品类',
// className: 'fixed-ant-selected-down',
// fetchSearch: PublicApi.getProductSelectGetSelectCategory,
}
},
brandId: {
brandName: {
type: 'string',
"x-component": 'SearchSelect',
// "x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand,
placeholder: '请输入品牌',
// fetchSearch: PublicApi.getProductSelectGetSelectBrand,
}
},
parentMemberId: {
......
......@@ -176,7 +176,10 @@
color : #6B778C;
padding-right: 20px;
&:nth-of-type(n + 4) {
// &:nth-of-type(n + 4) {
// margin: 0;
// }
&:nth-of-type(3n+1) {
margin: 0;
}
......
......@@ -36,7 +36,7 @@ const AddRepository:React.FC<{}> = (props) => {
const formSubmit = async (values) => {
const params = omit(values, ['NO_SUBMIT3'])
if (params['applyMember']) {
params['applyMember'] = params['applyMember'].map(v => v.memberId)
params['applyMember'] = params['applyMember']
}
await PublicApi.postWarehouseFreightSpaceAdd(params)
setTimeout(() => {
......
......@@ -166,7 +166,7 @@ const AddRepository:React.FC<{}> = (props) => {
shopType: values.shopType
}
if (values['applyMember']) {
params['applyMember'] = values['applyMember'].map(v => v.memberId)
params['applyMember'] = values['applyMember']
}
setIsEdit(false)
await PublicApi.postWarehouseFreightSpaceUpdata(params)
......
......@@ -524,7 +524,11 @@ export const repositDetailSchema: ISchema = padRequiredMessage({
"x-component-props": {
rowKey: 'memberId',
columns: "{{tableColumns}}",
prefix: "{{tableAddButton}}"
prefix: "{{tableAddButton}}",
pagination: {
"onChange": "{{paginationChange}}",
"total": "{{membersLength}}"
}
}
}
}
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:32:05
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-17 15:49:30
* @LastEditTime: 2020-09-18 11:17:34
*/
import React, { Component, useEffect, useState, ReactNode, useRef } from 'react';
import { Row, Col, Modal, Table, Tooltip, Input, Select,Switch, Button, Popconfirm, Card, Tag, Badge, Steps, Tabs, } from 'antd'
......@@ -23,7 +23,8 @@ import style from './index.less'
import {interiorState,interiorStateTwo,enquirySearchInteriorState,
enquirySearchexternalState} from '../../common/tableStatusList'
import statuStyle from '../../common/colorTag'
import PlatType from '../../components/platType'
import RroductModal from '../components/productModal'
const { Step } = Steps
const { TabPane } = Tabs
const data = [
......@@ -60,6 +61,17 @@ const detailInfo: React.FC<{}> = () => {
const [platType, setplatType] = useState(1) //需求对接类型
const [otherList, setotherList] = useState([])//动态tab循环
const [productSource, setproductSource] = useState([])//商品列表 新增
const [RroductinitialValues, setRroductinitialValues] = useState({})
const [requisitionFormId, setrequisitionFormId] = useState(null)//对应需求单号
const [tabData, settabData] = useState<any>({})
const [dialogVisible, setdialogVisible] = useState(false)
const proRef = useRef<any>({})
const [mode, setmode] = useState(0)
const [eqInfo, seteqInfo] = useState({
purchaseNuit:'',
purchaseQuantity:null,
modelList:[]
})//报价明细里的规格列表
let [dataInfo, setdataInfo] = useState<any>({
status: '',
externalState: 0,
......@@ -245,22 +257,35 @@ const detailInfo: React.FC<{}> = () => {
const equiryColumns: ColumnType<any>[] = [
{
title: '报价商品名称',
dataIndex: 'productName',
key: 'productName',
align: 'left',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
setRroductinitialValues(records)
setdialogVisible(true)
setmode(2)
}}>{text}</EyePreview>
},
{
title: '品类',
dataIndex: 'category',
key: 'category',
align: 'left'
},
{
title: '商品规格型号',
dataIndex: 'model',
key: 'model',
align: 'left',
render: (text: any, records: any) => <EyePreview type="button" handleClick={() => {
handleOpenModal(records.id)
}}>{text}</EyePreview>
align: 'left'
},
{
title: '品牌',
dataIndex: 'brand',
key: 'brand',
align: 'center'
},
...otherList,
// ...otherList,//不展示
{
title: '单位',
dataIndex: 'purchaseNuit',
......@@ -272,6 +297,21 @@ const detailInfo: React.FC<{}> = () => {
dataIndex: 'purchaseQuantity',
key: 'purchaseQuantity',
align: 'center'
},
{
title: '报价单价',
dataIndex: 'price',
key: 'price',
align: 'center',
render:(text,record) => <>{text}</>
},
{
title: '金额',
dataIndex: 'totalPrice',
key: 'totalPrice',
align: 'center',
render:(text,record) => <>{(record.purchaseQuantity &&record.price) ?
record.purchaseQuantity * record.price : ''}</>
}
]
......@@ -290,6 +330,7 @@ const detailInfo: React.FC<{}> = () => {
// }
// }
setdataInfo(data)
getOrderProductAll(data.requisitionFormId)
// interiorStateList = [...data.interiorRequisitionFormStateResponses]
......@@ -313,43 +354,51 @@ const detailInfo: React.FC<{}> = () => {
})
//商品列表
PublicApi.getOrderRequisitionFormProductAll({ id: id }).then(res => {
if (res.code === 1000) {
let { data } = res
//商品
let source = []
let otherColumnkey = []//动态列的展示
data.forEach((v)=> {
let obj:any = {}
obj.model = v.model
obj.id = v.id
obj.brand = v.brand
obj.purchaseNuit = v.purchaseNuit
obj.purchaseQuantity = v.purchaseQuantity
if(v.productAttributeJson){
JSON.parse(v.productAttributeJson).forEach(child => {
Object.keys(child).forEach(key => {
//获取列头
otherColumnkey.push({
title: key,
dataIndex: key,
key: key,
align:'center'
})
// console.log('key',key,child,child[key])
obj[key] = child[key]
})
});
}
source.push(obj)
})
setotherList([...otherColumnkey])//生成列
setproductSource([...source])
PublicApi.getOrderQuotationParticulars({ id: id }).then(res => {
if(res.code === 1000){
let {data} = res.data
setproductSource([...data])
}
})
// //商品列表
// PublicApi.getOrderRequisitionFormProductAll({ id: id }).then(res => {
// if (res.code === 1000) {
// let { data } = res
// //商品
// let source = []
// let otherColumnkey = []//动态列的展示
// data.forEach((v)=> {
// let obj:any = {}
// obj.model = v.model
// obj.id = v.id
// obj.brand = v.brand
// obj.purchaseNuit = v.purchaseNuit
// obj.purchaseQuantity = v.purchaseQuantity
// if(v.productAttributeJson){
// JSON.parse(v.productAttributeJson).forEach(child => {
// Object.keys(child).forEach(key => {
// //获取列头
// otherColumnkey.push({
// title: key,
// dataIndex: key,
// key: key,
// align:'center'
// })
// // console.log('key',key,child,child[key])
// obj[key] = child[key]
// })
// });
// }
// source.push(obj)
// })
// setotherList([...otherColumnkey])//生成列
// setproductSource([...source])
// }
// })
}
......@@ -445,6 +494,31 @@ const detailInfo: React.FC<{}> = () => {
}
}
/**
* @description: 查询 商品规格 赋值单位和数量
* @param {type}
* @return {type}
*/
const getOrderProductAll = (id) => {
setrequisitionFormId(id)//需求id
PublicApi.getOrderRequisitionFormProductAll({id:id}).then(res => {
if(res.code === 1000){
let {data} = res || {}
let {purchaseNuit,purchaseQuantity} = data[0]
let list = data.map(v => v.model)
setRroductinitialValues({
...RroductinitialValues,
purchaseNuit: purchaseNuit,
purchaseQuantity: purchaseQuantity
})
seteqInfo({...eqInfo,modelList: list
})
}
})
}
return (
<PageHeaderWrapper
onBack={() => window.history.back()}
......@@ -676,6 +750,17 @@ const detailInfo: React.FC<{}> = () => {
onCancel={() => setvisible(false)}
onOK={ handleModalOK}
/>
<RroductModal
dialogVisible={dialogVisible}
eqInfo={eqInfo}//需求单相关
onRef={proRef}
// onRef={(refs) => setSetForm(refs)}
mode={mode}
initialValues={RroductinitialValues}
onCancel={() => setdialogVisible(false)}
>
</RroductModal>
</PageHeaderWrapper>
)
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-28 10:07:45
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-16 16:46:52
* @LastEditTime: 2020-09-18 11:18:40
*/
import React, { Component, useState,useRef, useEffect,useImperativeHandle } from 'react';
import { Modal, Button,Space, Form, Radio, AutoComplete, Badge,Tabs, Input, Select, Checkbox } from 'antd'
......@@ -20,17 +20,17 @@ const { TextArea } = Input
export interface Params {
sourceData?: Array<any>[],
eqInfo: any,
eqInfo: any,//重置需求单号列表
id?: any,
mode?: number,
mode?: number,// 0 新增 1编辑 2 查看
type?: number | string,
dialogVisible: boolean;
currentRef?: any;
onCancel: Function;
onRef?: any;
onOK?: Function;
initialValues?: any;
productAttributeJson: Function;//明细中的属性
initialValues?: any;//初始化
productAttributeJson?: Function;//明细中的属性
dontReceive?: boolean; //默认展示
}
const layout = {
......
import React from 'react'
import { Tag } from 'antd'
import { PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts, PurchaseOrderInsideWorkState, PurchaseOrderOutWorkState } from '@/constants'
export interface IStatusColor {
[key: string]: {
......@@ -10,7 +11,8 @@ export interface IStatusColor {
// 用于标签状态控制
export interface StatusColorsProps {
status: number
status: number,
type: 'out' | 'inside'
}
export enum ORDER_EXAMINE_ENUM {
......@@ -78,15 +80,20 @@ const matchStatusColor = (status: number): string => {
[ORDER_EXAMINE_ENUM.SUBMIT_ORDER_PROCESS]: StatusColorsMaps.submit,
[ORDER_EXAMINE_ENUM.SUBMIT_ORDER_SUCCESS]: StatusColorsMaps.success
}
const READY_LISTS = [
PurchaseOrderInsideWorkState.CANCEL_ORDER,
PurchaseOrderOutWorkState.CANCEL_ORDER
]
// 默认返回错误的状态颜色
return maps[status] || StatusColorsMaps.error
}
// 订单内部状态显示
const StatusColors:React.FC<StatusColorsProps> = (props) => {
const { status } = props
const { status, type } = props
const statusText = type === 'inside' ? PurchaseOrderInsideWorkStateTexts : PurchaseOrderOutWorkStateTexts
const statusShowColor = matchStatusColor(status)
return (<Tag color={statusShowColor}>{ORDER_EXAMINE_LIST[status]}</Tag>)
return (<Tag color={statusShowColor}>{statusText[status]}</Tag>)
}
StatusColors.defaultProps = {}
......
import React, { useRef, useEffect, useState } from 'react'
import React, { useRef, useEffect, useState, useContext } from 'react'
import { Button, Table } from 'antd'
import { StandardTable } from 'god'
import { formatTimeString } from '@/utils'
import './index.less'
import cx from 'classnames'
import { ReadyAddOrderDetailContext } from '../../context'
import StatusColors from '../StatusColors'
export interface CirculationRecordProps {}
......@@ -29,6 +31,7 @@ const outOrderCols: any[] = [
dataIndex: 'state',
align: 'center',
key: 'state',
render: text => <StatusColors status={text} type='out'/>
// @todo 需传递工作流状态重新render
},
{
......@@ -82,6 +85,7 @@ const sideOrderCols: any[] = [
dataIndex: 'state',
align: 'center',
key: 'state',
render: text => <StatusColors status={text} type='inside'/>
},
{
title: '操作',
......@@ -104,11 +108,20 @@ const sideOrderCols: any[] = [
]
const CirculationRecord:React.FC<CirculationRecordProps> = (props) => {
const colRef = useRef<any[]>(outOrderCols)
const colRef = useRef<any>({
columns: outOrderCols
})
const { detailData } = useContext(ReadyAddOrderDetailContext)
const [orderState, setOrderState] = useState<number>(0)
const [dataSource, setDataSource] = useState<any>([])
useEffect(() => {
colRef.current = orderState === 1 ? outOrderCols : sideOrderCols
}, [colRef, orderState])
if (detailData) {
colRef.current = {
columns: orderState === 1 ? sideOrderCols : outOrderCols
}
setDataSource(orderState === 1 ? detailData.interiorProcurementOrderLogResponses : detailData.externalProcurementOrderLogResponses)
}
}, [colRef, orderState, detailData])
return (
<div>
<div className='com-switch-btn-group' style={{margin: '20px 0'}}>
......@@ -116,8 +129,9 @@ const CirculationRecord:React.FC<CirculationRecordProps> = (props) => {
<div className={cx('switch-btn', orderState === 1 ? 'active' : '')} onClick={() => setOrderState(1)}>内部单据</div>
</div>
<Table
columns={colRef.current}
dataSource={[]}
columns={colRef.current.columns}
dataSource={dataSource}
rowKey="id"
/>
</div>
)
......
......@@ -2,6 +2,7 @@ import React from 'react'
import { formatTimeString } from '@/utils'
import { ORDER_TYPE } from '@/constants'
import StatusColors from '../components/StatusColors'
import EyePreview from '@/components/EyePreview'
export const baseOrderListColumns: any[] = [
......@@ -10,6 +11,12 @@ export const baseOrderListColumns: any[] = [
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return <EyePreview url={`/memberCenter/tranactionAbility/purchaseOrder/orderDetail?page_type=-1&id=${record.id}&preview=1`}>
{text}
</EyePreview>
}
},
{
title: '订单摘要',
......@@ -48,12 +55,13 @@ export const baseOrderListColumns: any[] = [
align: 'center',
dataIndex: 'externalState',
key: 'externalState',
render: text => <StatusColors status={text} type='out'/>
},
{
title: '内部状态',
align: 'center',
dataIndex: 'interiorState',
key: 'interiorState',
render: (text) => <StatusColors status={text}/>
render: (text) => <StatusColors status={text} type='inside'/>
},
]
\ No newline at end of file
import { createContext } from 'react';
export const readyAddOrderDetailContext = createContext<any>({})
\ No newline at end of file
export const ReadyAddOrderDetailContext = createContext<any>({})
\ No newline at end of file
import React, { useRef } from 'react'
import { history } from 'umi'
import { Card, Button, Space, Dropdown, Menu } from 'antd'
import { Card, Button, Space, Dropdown, Menu, message } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
......@@ -13,6 +13,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import { DatePicker } from '@formily/antd-components'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState } from '@/constants'
// 一级待审核订单
......@@ -33,9 +34,17 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
} = useSelfTable()
const handleSubmitBatch = async () => {
await PublicApi.postOrderProcurementOrderReviewedAll({
ids: rowSelectionCtl.selectedRowKeys
})
if (rowSelectionCtl.selectRow.length === 0) {
message.error('请先勾选订单')
return ;
}
const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER)
if (canBitch) {
await PublicApi.postOrderProcurementOrderReviewedAll({ids: rowSelectionCtl.selectedRowKeys})
ref.current.reload()
} else {
message.error('只能批量提交内部状态为审核中的订单')
}
}
return <PageHeaderWrapper>
<Card>
......
......@@ -4,14 +4,17 @@ import { baseOrderListColumns } from '../../constant'
import { history } from 'umi'
import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState } from '@/constants'
// 业务hooks, 待新增订单
export const useSelfTable = () => {
const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const handleSubmit = async (id) => {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/orderDetail?id=${id}&preview=1&page_type=1`)
const handleSubmit = async (record) => {
if (record.interiorState === PurchaseOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER) {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/orderDetail?id=${record.id}&preview=0&page_type=1`)
}
// await PublicApi.postOrderQuotationBeReviewed({id})
// ref.current.reload()
}
......@@ -22,7 +25,10 @@ export const useSelfTable = () => {
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
<Button type='link' onClick={() => handleSubmit(record.id)}>提交审核</Button>
{
record.interiorState === PurchaseOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER &&
<Button type='link' onClick={() => handleSubmit(record)}>提交审核</Button>
}
</>
}
])
......
......@@ -6,13 +6,18 @@ import './index.less'
import { PublicApi } from '@/services/api'
export interface InvoiceModalProps {
mode: 'add' | 'edit' | 'default',
mode: 'add' | 'edit' | 'preview' | 'default',
currentRef?: any,
formInitValue?: any,
reload?()
}
const schemaActions = createFormActions()
const modelTitle = {
'add': '新增发票',
'edit': "编辑发票",
'preview': '查看发票'
}
const InvoiceModal:React.FC<InvoiceModalProps> = (props) => {
const { mode, formInitValue } = props
......@@ -27,6 +32,10 @@ const InvoiceModal:React.FC<InvoiceModalProps> = (props) => {
schemaActions.reset({validate: false})
}
const handleConfirm = () => {
if (mode === 'preview') {
props.currentRef.current.setVisible(false)
return ;
}
schemaActions.submit()
}
......@@ -43,10 +52,12 @@ const InvoiceModal:React.FC<InvoiceModalProps> = (props) => {
}
return (
<ModalForm
modalTitle={mode === 'add' ? '新建发票信息' : '编辑发票信息'}
modalTitle={modelTitle[mode]}
previewPlaceholder=" "
confirm={handleConfirm}
cancel={resetForm}
value={selfInitValue}
editable={mode !== 'preview'}
effects={($, { setFieldState }) => {
$('onFormMount').subscribe(() => {
})
......
......@@ -18,9 +18,19 @@ const EditableContext = React.createContext<any>({});
export const EditableRow: React.FC<any> = (props) => {
const [form] = Form.useForm();
// form.setFieldsValue()
const { options = [] } = props?.children[5]?.props.additionalProps.formItemProps || {}
const [childOptions, setChildOptions] = useState<any[]>([])
const [childOptions, setChildOptions] = useState<any[]>(() => {
const { payWay } = props?.children[5]?.props.record || {}
if (payWay) {
return options.find(v => v.payType === payWay)?.payList.map(v => ({
label: v.way,
value: v.id
})) || []
} else {
return []
}
})
const ctx = {
form,
childOptions,
......@@ -79,6 +89,7 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
onChange={e => {
const result = originOptions.find(v => e === v.payType)
setChildOptions(result.payList.map(v => ({label: v.way, value: v.id})))
form.setFieldsValue({channel: ''})
save(e)
}}
{...rest}
......@@ -103,11 +114,13 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
let childNode = children;
if (editable) {
childNode = (forceEdit) ? (
<Form.Item
style={{ margin: 0 }}
name={dataIndex}
initialValue={record[dataIndex] || ''}
rules={[
{
required: true,
......
......@@ -46,7 +46,6 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
}) => {
const formItemRef = useRef<any>();
const { form } = useContext(EditableContext);
const save = async e => {
try {
const values = await form.validateFields();
......@@ -71,6 +70,7 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
<Form.Item
style={{ margin: 0 }}
name={dataIndex}
initialValue={record[dataIndex] || ''}
rules={[
{
required: true,
......
......@@ -9,58 +9,6 @@ import { PublicApi } from '@/services/api'
import InvoiceModal from '../invoiceModal'
import styles from './index.less'
const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)`
.select_style_border {
border: 1px solid #EBECF0;
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 14px;
cursor: pointer;
line-height: 28px;
position:relative;
}
.select_style_border.active {
border: 1px solid #00B382;
}
.select_style_border.active::after {
content: '';
position: absolute;
width: 0;
height: 0;
border-bottom: 12px solid #00B37A;
border-left: 12px solid transparent;
bottom: 0;
right: 0;
z-index: 5;
}
`
const MockData = [
{
id: 1,
type: 1,
name: '温州市龙昌皮业有限公司',
userType: 1,
isDefault: 1
},
{
id: 2,
type: 2,
name: '温州市龙昌皮业有限公司',
userType: 1,
isDefault: 0
},
{
id: 3,
type: 2,
name: '温州市龙昌皮业有限公司',
userType: 1,
isDefault: 0
}
]
const transformDefaultData = (data: any[]) => {
if (data.length === 0) return data
......@@ -82,7 +30,7 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
})
const modalRef = useRef<any>({})
const { dataSource, showMore } = state
const { value, mutators, form } = props
const { value, mutators, form, editable } = props
const transformData = transformDefaultData(dataSource)
const showDataSource = showMore ? [...transformData].splice(0, 3) : transformData
const handleAdd = () => {
......@@ -120,11 +68,11 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
}
}
const handleEdit = async (item, e) => {
const handleEdit = async (item, e, mode?) => {
e.stopPropagation()
const { data } = await PublicApi.getSettleAccountsInvoiceMessageDetails({id: item.id})
setFormInitValue({...data, isDefault: item.isDefault})
setMode('edit')
setMode(mode || 'edit')
modalRef.current.setVisible(true)
}
......@@ -136,7 +84,7 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
return (
<div style={{width: '100%'}} className={styles.invoice}>
<Button block onClick={handleAdd} icon={<PlusOutlined/>}>新增发票</Button>
{ editable && <Button block onClick={handleAdd} icon={<PlusOutlined/>}>新增发票</Button> }
<Radio.Group className={styles.raido_group} value={value} onChange={e => handleCheck(e)}>
<div className={styles.invoice_list}>
{
......@@ -156,10 +104,15 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
</div>
{
value === item.id && (
editable ?
<div className={styles.invoice_list_item_btn_group}>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleEdit(item, e)}>编辑</div>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleDelete(item.id, e)}>删除</div>
</div>
:
<div className={styles.invoice_list_item_btn_group}>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleEdit(item, e, 'preview')}>查看</div>
</div>
)
}
</div>
......
import React from 'react'
import { formatTimeString } from '@/utils'
import { Row, Space, Popover } from 'antd'
import { DELIVERY_TYPE, OrderModalType } from '@/constants'
import { DELIVERY_TYPE, OrderModalType, PurchaseOrderOutWorkStateTexts } from '@/constants'
import { EnvironmentOutlined } from '@ant-design/icons'
import { PublicApi } from '@/services/api'
......@@ -170,7 +170,8 @@ export const paymentInformationColumns: any[] = [
title: '外部状态',
dataIndex: 'externalState',
align: 'center',
key: 'externalState'
key: 'externalState',
render: text => PurchaseOrderOutWorkStateTexts[text]
},
{
title: '支付比例',
......@@ -182,7 +183,8 @@ export const paymentInformationColumns: any[] = [
formItemProps: {
addonAfter: '%'
},
width: 200
width: 200,
render: text => text + '%'
},
{
title: '支付金额',
......
import React, { useState, useEffect } from 'react'
import { OrderModalType } from '../constant'
import { OrderModalType } from '@/constants'
import { PublicApi } from '@/services/api'
import { useLocation, history } from 'umi'
import { ISchemaFormActions } from '@formily/antd'
......
......@@ -4,6 +4,7 @@ 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
......@@ -25,7 +26,7 @@ const getUnitPriceTotal = (record) => {
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
......@@ -39,12 +40,17 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
}
const [productColumns, setProductColumns] = useState(() => {
productInfoColumns[productInfoColumns.length - 1].render = (text, record) => {
return <>
<Button type='link' onClick={() => handleDelete(record)}>删除</Button>
<Button type='link'>选择合并订单</Button>
</>
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>
......
......@@ -395,9 +395,14 @@ const auditRecord: ISchema = {
NO_SUBMIT_LAYOUT_3: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'left',
labelCol: 4,
wrapperCol: 10
},
properties: {
state: {
title: ' ',
title: '是否审核通过',
type: 'radio',
enum: [
{
......@@ -409,6 +414,7 @@ const auditRecord: ISchema = {
value: 0
}
],
editable: true,
default: 1,
"x-linkages": [
{
......@@ -424,7 +430,8 @@ const auditRecord: ISchema = {
required: true,
"x-component-props": {
rows: 3
}
},
editable: true,
}
}
}
......@@ -457,9 +464,9 @@ export const orderDetailSchema: ISchema = {
"x-component": 'tab',
properties: {
basicInfo,
submitInfo,
orderProduct,
payInfo,
submitInfo,
ortherInfo,
transformRecord,
}
......@@ -476,9 +483,9 @@ export const auditOneSchema: ISchema = {
"x-component": 'tab',
properties: {
basicInfo,
submitInfo,
orderProduct,
payInfo,
submitInfo,
ortherInfo,
auditRecord,
transformRecord
......@@ -496,9 +503,9 @@ export const orderAddSchema: ISchema = {
"x-component": 'tab',
properties: {
basicInfo,
submitInfo,
orderProduct,
payInfo,
submitInfo,
ortherInfo,
}
}
......@@ -507,7 +514,11 @@ export const orderAddSchema: ISchema = {
// 根据传入的query参数 判断当前使用哪个schema
export const mergeAllSchemas = {
0: orderDetailSchema,
// 新增订单详情
"-1": orderDetailSchema,
0: orderAddSchema,
// 一级审核详情
1: auditOneSchema
1: auditOneSchema,
// 二级审核详情
2: auditOneSchema,
}
\ No newline at end of file
import React from 'react'
import { history } from 'umi'
import { Card, Button, Space, Dropdown, Menu } from 'antd'
import { Card, Button, Space, Dropdown, Menu, message } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
......@@ -13,6 +13,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import { DatePicker } from '@formily/antd-components'
import { useSelfTable } from './model/useReadyAddOrder'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState } from '@/constants'
// 待新增订单
......@@ -28,20 +29,29 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
const { columns, ref } = useSelfTable()
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const handleMenuClick = (e) => {
const handleMenuClick = async (e) => {
switch(e.key) {
case '1': {
// 批量删除
const canDelete = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER)
if (canDelete) {
await PublicApi.postOrderProcurementOrderDeleteAll({ids: rowSelectionCtl.selectedRowKeys})
} else {
message.error('只能删除内部状态为未审核过的订单')
}
break;
}
}
}
const handleBitchPush = async () => {
await PublicApi.postOrderProcurementOrderSubmitExamineAll({
ids: rowSelectionCtl.selectedRowKeys
})
ref.current.reload()
const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER)
if (canBitch) {
await PublicApi.postOrderProcurementOrderSubmitExamineAll({ids: rowSelectionCtl.selectedRowKeys})
ref.current.reload()
} else {
message.error('只能删除内部状态为未审核过的订单')
}
}
return <PageHeaderWrapper>
......
import React, { useRef } from 'react'
import { Button } from 'antd'
import { Button, Popconfirm } from 'antd'
import { baseOrderListColumns } from '../../constant'
import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { history } from 'umi'
import { PurchaseOrderInsideWorkState, PurchaseOrderOutWorkState } from '@/constants'
// 业务hooks, 待新增订单
export const useSelfTable = () => {
......@@ -10,21 +12,62 @@ export const useSelfTable = () => {
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const handleSubmit = async (id) => {
// 状态写死, 默认传-1
// 从待新增订单直接传到一级审核, 状态写死, 默认传-1
await PublicApi.postOrderProcurementOrderSubmitExamine({id, state: -1})
ref.current.reload()
}
const handleDelete = async (id) => {
await PublicApi.postOrderProcurementOrderDelete({id})
ref.current.reload()
}
const handleEdit = (id) => {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/orderDetail?page_type=0&id=${id}&preview=0`)
}
const handleCancel = async (id) => {
await PublicApi.postOrderPurchaseOrderCancel({id})
ref.current.reload()
}
const secondColumns: any[] = baseOrderListColumns.concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
<Button type='link' onClick={() => handleSubmit(record.id)}>提交审核</Button>
<Button type='link' onClick={() => {}}>修改订单</Button>
<Button type='link' onClick={() => handleSubmit(record.id)}>取消订单</Button>
</>
render: (text, record) => {
// 当内部状态为待审核状态,审核不通过, 或者外部状态为不接受订单时才可修改订单
const showEditOrCancel = PurchaseOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER_NOT_ALLOWED ||
PurchaseOrderInsideWorkState.TWO_LEVEL_AUDIT_ORDER_NOT_ALLOWED ||
PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER ||
PurchaseOrderOutWorkState.NOT_ACCEPTED_ORDER
// 待提交审核且从未提交过审核的订单才可删除
const showDeleteOrSubmit = PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER
return <>
{
showDeleteOrSubmit &&
<Button type='link' onClick={() => handleSubmit(record.id)}>提交审核</Button>
}
{
showEditOrCancel && <Button type='link' onClick={() => handleEdit(record.id)}>修改订单</Button>
}
{
showDeleteOrSubmit &&
<Popconfirm title='是否要删除该订单' onConfirm={() => handleDelete(record.id)}>
<Button type='link'>删除订单</Button>
</Popconfirm>
}
{
showEditOrCancel &&
<Popconfirm title='是否要取消该订单' onConfirm={() => handleCancel(record.id)}>
<Button type='link'>取消订单</Button>
</Popconfirm>
}
</>
}
}
])
......
......@@ -2,13 +2,16 @@ import React, { useRef } from 'react'
import { Button } from 'antd'
import { baseOrderListColumns } from '../../constant'
import { PublicApi } from '@/services/api'
import { history } from 'umi'
import { PurchaseOrderInsideWorkState } from '@/constants'
// 业务hooks, 待新增订单
export const useSelfTable = () => {
const ref = useRef<any>({})
const handleSubmit = async (id) => {
await PublicApi.postOrderQuotationBeReviewedTwo({id})
ref.current.reload()
const handleSubmit = async (record) => {
if (record.interiorState === PurchaseOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER) {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/orderDetail?id=${record.id}&preview=0&page_type=1`)
}
}
const secondColumns: any[] = baseOrderListColumns.concat([
{
......@@ -17,7 +20,7 @@ export const useSelfTable = () => {
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
<Button type='link' onClick={() => handleSubmit(record.id)}>提交审核</Button>
<Button type='link' onClick={() => handleSubmit(record)}>提交审核</Button>
</>
}
])
......
import { history } from 'umi'
/**
* 根据页面状态切换标题
*/
export const changeRouterTitleByStatus = () => {
const { id, page_type, preview } = history.location.query
if (id) {
if (preview === '1') {
return '查看订单'
}
switch(page_type) {
case '0': return '编辑订单'
case '1': return '订单审核'
case '2': return '订单审核'
}
} else {
// id不存在为新增页面
return '新增订单'
}
}
\ No newline at end of file
......@@ -83,7 +83,7 @@ baseRequest.interceptors.request.use((url: string, options: RequestOptionsInit):
}
options.paramsSerializer = params => {
return qs.stringify(params, { arrayFormat: 'brackets' })
return qs.stringify(params, { arrayFormat: 'indices' })
}
return {
// 前缀如果已经带上api, 跳过自动补前缀
......
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