Commit 50b6fdcd authored by LeeJiancong's avatar LeeJiancong

'编写需求单详情静态'

parent 7792d18d
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Date: 2020-07-31 19:56:22 * @Date: 2020-07-31 19:56:22
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com * @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-25 11:23:35 * @LastEditTime: 2020-09-02 19:14:41
*/ */
const TranactionRoute = { const TranactionRoute = {
...@@ -70,19 +70,38 @@ const TranactionRoute = { ...@@ -70,19 +70,38 @@ const TranactionRoute = {
key:'enquirySubmit', key:'enquirySubmit',
routes:[ routes:[
{ {
path:'/memberCenter/tranactionAbility/enquirySubmit/SearchList', path:'/memberCenter/tranactionAbility/enquirySubmit/toAddSubmitList',
name:'SearchList', name:'toAddSubmitList',
key:'SearchList', key:'toAddSubmitList',
component: '@/pages/transaction/enquirySubmit/toSubmit' component: '@/pages/transaction/enquirySubmit/toAddSubmit'
}, },
{ {
path:'/memberCenter/tranactionAbility/enquirySubmit/addEnquiry', path:'/memberCenter/tranactionAbility/enquirySubmit/addEnquiry',
name:'addEnquiry', name:'addEnquiry',
key:'addEnquiry', key:'addEnquiry',
component: '@/pages/transaction/enquirySubmit/toSubmit/detail', component: '@/pages/transaction/enquirySubmit/toAddSubmit/detail',
hideInMenu: true,
},
{//需求单详情
path:'/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail',
name:'viewEnquiryDetail',
key:'viewEnquiryDetail',
component: '@/pages/transaction/enquirySubmit/components/detail',
hideInMenu: true, hideInMenu: true,
}, },
{
path:'/memberCenter/tranactionAbility/enquirySubmit/enquiryOne',
name:'enquiryOne',
key:'enquiryOne',
component: '@/pages/transaction/enquirySubmit/enquiryOne'
},
{
path:'/memberCenter/tranactionAbility/enquirySubmit/enquiryTwo',
name:'enquiryTwo',
key:'enquiryTwo',
component: '@/pages/transaction/enquirySubmit/enquiryTwo'
},
] ]
}, },
// 采购订单 // 采购订单
......
/* /*
* @Author: LeeJiancong * @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50 * @Date: 2020-07-13 14:08:50
* @LastEditors: XieZhiXiong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-28 17:48:20 * @LastEditTime: 2020-09-02 15:11:21
*/ */
export default { export default {
...@@ -102,8 +102,10 @@ export default { ...@@ -102,8 +102,10 @@ export default {
'menu.tranactionAbility.stockSellStorage.addBills': '新增单据', 'menu.tranactionAbility.stockSellStorage.addBills': '新增单据',
'menu.tranactionAbility.stockSellStorage.inventory': '库存', 'menu.tranactionAbility.stockSellStorage.inventory': '库存',
'menu.tranactionAbility.enquirySubmit': '需求发布', 'menu.tranactionAbility.enquirySubmit': '需求发布',
'menu.tranactionAbility.enquirySubmit.SearchList': '待新增需求单', 'menu.tranactionAbility.enquirySubmit.toAddSubmitList': '待新增需求单',
'menu.tranactionAbility.enquirySubmit.addEnquiry': '新增需求单', 'menu.tranactionAbility.enquirySubmit.addEnquiry': '新增需求单',
'menu.tranactionAbility.enquirySubmit.enquiryOne': '待审核报价单(一级)',
'menu.tranactionAbility.enquirySubmit.enquiryTwo': '待审核报价单(二级)',
'menu.tranactionAbility.purchaseOrder': '采购订单', 'menu.tranactionAbility.purchaseOrder': '采购订单',
'menu.tranactionAbility.purchaseOrder.purchaseOrderSearch': '订单查询', 'menu.tranactionAbility.purchaseOrder.purchaseOrderSearch': '订单查询',
'menu.tranactionAbility.purchaseOrder.readyAddOrder': '待新增订单', 'menu.tranactionAbility.purchaseOrder.readyAddOrder': '待新增订单',
......
import React, { Component, useState, useEffect } from 'react';
import { Modal, Button, Form } from 'antd'
import {
SchemaForm, SchemaMarkupField as Field,
createFormActions,
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { PublicApi } from '@/services/api'
import {PATTERN_MAPS} from '@/constants/regExp'
export interface Params {
id: number | string;
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
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
console.log(values)
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if (res.code === 1000) {
props.onOK()
}
})
}
useEffect(() => {
return () => {
}
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({ value }) => {
setFieldState('remark', state => {
if (value == 3) {
state.visible = false
} else {
state.visible = true
}
})
setFieldState('freightPrice', state => {
if (value == 3) {
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
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
status: 3
}}
>
<Field
enum={
[
{ label: '接受物流单', value: 3 },
{ label: '不接受物流单', value: 4 }
]}
name='status'
required
x-component="Radio"
/>
{props.dontReceive &&
<>
<Field
title='运费'
name="freightPrice"
x-component="Input"
required
x-component-props={{
placeholder:'运费',
// addonBefore: ' '
}}
x-rules ={{
pattern: PATTERN_MAPS.money,
message:'数字类型,币制为当前站点对应的币制,保留2位小数'
}}
/>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='不接受原因'
name="remark"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules ={{
max:60,
// maximum:10,//最大数值
message:'原因最多60个汉字'
}}
/>
</>
}
</SchemaForm>
</Modal>
</>
)
}
comfirmDialog.defaultProps = {
dontReceive: true
}
export default comfirmDialog
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-02 15:26:14
*/
import React, { ReactNode, useRef, useState,useEffect } from 'react';
import { history } from 'umi';
import {
Button,
Card,
Space,
Row,
Col,
Dropdown,
Menu,
Popconfirm
} from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import {
PlusOutlined,DownOutlined,DeleteOutlined
} 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 {interiorState} from '../../common/tableStatusList'
import statuStyle from '../../common/colorTag'
import NiceForm from '@/components/NiceForm';
import {timeRange} from '@/utils/index'
import moment from 'moment'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import {PageStatus} from '@/hooks/usePageStatus'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { enquierySchema } from '../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
export interface listParams{
type: number,
des?: string
}
const formActions = createFormActions();
const fetchData = async (params: any) => {
const res = await PublicApi.getOrderRequisitionFormAwaitList(params);
return res.data
}
const List:React.FC<listParams> = (props) => {
const ref = useRef<any>({})
const [more, setmore] = useState(false)
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const columns : ColumnType<any>[] = [
{
title:'需求单号',
key:'requisitionFormNo',
dataIndex:'requisitionFormNo',
align:'center'
},
{
title:'需求摘要',
key:'details',
dataIndex:'details',
align:'left'
},
{
title:'品类',
key:'category',
dataIndex:'category',
align:'left'
},
{
title:'交付日期',
key:'deliveryTime',
dataIndex:'deliveryTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'报价截至时间',
key:'quotationAsTime',
dataIndex:'quotationAsTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'单据时间',
key:'voucherTime',
dataIndex:'voucherTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'外部状态',
key:'externalState',
dataIndex:'externalState',
align:'center',
render: (text: any, reconds) => {
let component: ReactNode = null
if (text == 3) {
component = <><span style={statuStyle.warn}>审核不通过需求单</span></>
}else if (text == 1) {
component = <><span style={statuStyle.default}>待提交需求单</span></>
}
return component
}
},
{
title:'内部状态',
key:'interiorState',
dataIndex:'interiorState',
align:'center',
render:(text:any) => interiorState(text)
},
{
title:'操作',
key:'options',
dataIndex:'options',
align:'center',
render: (_: any, record: any) => {
return (
<>
<Popconfirm title="确定要审核吗?" okText="是" cancelText="否" onConfirm={() => handleSubmit(record.id)}>
<Button type='link'>审核</Button>
</Popconfirm>
</>
)
}
},
]
useEffect(()=> {
},[])
const toEdit = (id:number | string) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/addEnquiry?id=${id}`)
}
/**
* @description: 删除
* @param {type}
* @return {type}
*/
const handleDelete = (arr:number[]| string[]) => {
PublicApi.postOrderRequisitionFormDeleteAll({ ids: arr }).then(res => {
ref.current.reload()
})
}
//批量提交
const handleSubmitAll = (ids: number[]) => {
PublicApi.postOrderSubmitRequisitionFormAll({ ids: ids }).then(res => {
ref.current.reload()
})
}
//提交审核
const handleSubmit = (id) => {
PublicApi.postOrderNewRequisitionFormAudit({ id: id }).then(res => {
ref.current.reload()
})
}
const handleSumbit = (values:any) => {
if(values.voucherTime){
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
console.log('values',values)
ref.current.reload(values)
}
const menu = (
<Menu onClick={() => handleDelete(selectedRowKeys)}>
<Menu.Item key='1' icon={<DeleteOutlined/>}>
批量删除
</Menu.Item>
</Menu>
)
const handleBatchDel = (e:any) => {
}
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
const controllerBtns = <Row>
<Col span={24}>
<Space direction="horizontal" size={16}>
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>批量审核通过</Button>
</Space>
</Col>
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{rowKew:'id'}}
fetchTableData={(params: any) => fetchData(params)}
rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => handleSumbit(values)}
effects={($,actions) => {
useStateFilterSearchLinkageEffect($,actions,'requisitionFormNo',FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={enquierySchema}
>
</NiceForm>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default List
\ No newline at end of file
.count {
font-size: 24px;
color: #172B4D;
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;
}
.select:nth-last-of-type(1) {
margin-right: 0;
}
.mainCol {
background-color: #fff;
margin-bottom: 24px;
padding: 0 24px;
box-sizing: border-box;
}
.mainCol-title {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #172B4D;
padding: 20px 0;
}
.mainCol:nth-last-of-type(1) {
margin: 0;
}
.mainCol-row {
display: flex;
flex-wrap: wrap;
padding-bottom: 16px;
}
.mainCol-row-col {
display: flex;
width: calc(100% / 3);
padding: 16px 0;
}
.mainCol-row-col-option {
flex: 1;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #6B778C;
}
.mainCol-row-col-option:nth-last-of-type(1) {
flex: 3;
padding-right: 20px;
box-sizing: border-box;
color: #172B4D;
}
.mainCol-rows {
display: flex;
padding-bottom: 16px;
}
.mainCol-rows-cols {
flex: 1;
}
.mainCol-rows-cols .cols-main {
display: flex;
padding: 16px 0;
}
.mainCol-rows-cols .cols-main:nth-last-of-type(1) {
padding-bottom: 0;
}
.mainCol-rows-cols .cols-main-options {
flex: 1;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #6B778C;
}
.mainCol-rows-cols .cols-main-options:nth-last-of-type(1) {
flex: 3;
padding-right: 20px;
box-sizing: border-box;
color: #172B4D;
}
@import "../../../member/components/index.less";
.count{
font-size: 24px;
color: #172B4D;
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;
&-title {
font-size : 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color : #172B4D;
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 : 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #6B778C;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #172B4D;
}
}
}
}
&-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 : 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #6B778C;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #172B4D;
}
}
}
}
}
}
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-02 19:44:31
*/
import React, { ReactNode, useRef, useState,useEffect } from 'react';
import { history } from 'umi';
import {
Button,
Card,
Space,
Row,
Col,
Dropdown,
Menu,
Popconfirm
} from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import {
PlusOutlined,DownOutlined,DeleteOutlined
} 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 {interiorState} from '../../common/tableStatusList'
import statuStyle from '../../common/colorTag'
import NiceForm from '@/components/NiceForm';
import {timeRange} from '@/utils/index'
import moment from 'moment'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import {PageStatus} from '@/hooks/usePageStatus'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { enquierySchema } from '../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
/**
* @description: 按页面来 type一级为1 二级为2
* @param {type}
* @return {type}
*/
export interface listParams{
type: number;
des?: string;
}
const formActions = createFormActions();
const List:React.FC<listParams> = (props) => {
const ref = useRef<any>({})
const [more, setmore] = useState(false)
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const fetchData = async (params: any) => {
if(props.type === 1){//一级
const res = await PublicApi.getOrderRequisitionFormAuditList(params);
return res.data
}else if(props.type === 2){//二级
const res = await PublicApi.getOrderRequisitionFormAuditTwoList(params);
return res.data
}
// else{
// const res = await PublicApi.getOrderRequisitionFormAwaitList(params);
// return res.data
// }
}
/**
* @description:
* @param {type} 可以根据props.type处理
* @return {type}
*/
const handleToDetail= (id) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?id=${id}`)
}
const columns : ColumnType<any>[] = [
{
title:'需求单号',
key:'requisitionFormNo',
dataIndex:'requisitionFormNo',
align:'center',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
handleToDetail(records.id)
}}>{text}</EyePreview>
},
{
title:'需求摘要',
key:'details',
dataIndex:'details',
align:'left'
},
{
title:'品类',
key:'category',
dataIndex:'category',
align:'left'
},
{
title:'交付日期',
key:'deliveryTime',
dataIndex:'deliveryTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'报价截至时间',
key:'quotationAsTime',
dataIndex:'quotationAsTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'单据时间',
key:'voucherTime',
dataIndex:'voucherTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'外部状态',
key:'externalState',
dataIndex:'externalState',
align:'center',
render: (text: any, reconds) => {
let component: ReactNode = null
if (text == 3) {
component = <><span style={statuStyle.warn}>审核不通过需求单</span></>
}else if (text == 1) {
component = <><span style={statuStyle.default}>待提交需求单</span></>
}
return component
}
},
{
title:'内部状态',
key:'interiorState',
dataIndex:'interiorState',
align:'center',
render:(text:any) => interiorState(text)
},
{
title:'操作',
key:'options',
dataIndex:'options',
align:'center',
render: (_: any, record: any) => {
return (
<>
{
(props.type === 1 || props.type === 2) ?
<Button type="link" onClick={() => {}}>审核</Button>
:
<>
{
(record.interiorState !== 3 &&
<Button type="link" onClick={() => toEdit(record.id)}>编辑</Button>
)
}
{
(record.externalState === 1 && record.interiorState === 1) &&
<>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() => handleDelete([record.id])}>
<Button type='link'>
删除
</Button>
</Popconfirm>
<Popconfirm title="确定要提交吗?" okText="是" cancelText="否" onConfirm={() => handleSubmit(record.id)}>
<Button type='link'>提交</Button>
</Popconfirm>
</>
}
</>
}
</>
)
}
},
]
useEffect(()=> {
},[])
const toEdit = (id:number | string) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/addEnquiry?id=${id}`)
}
/**
* @description: 删除
* @param {type}
* @return {type}
*/
const handleDelete = (arr:number[]| string[]) => {
PublicApi.postOrderRequisitionFormDeleteAll({ ids: arr }).then(res => {
ref.current.reload()
})
}
//批量提交
const handleSubmitAll = (ids: number[]) => {
if(ids.length === 0){
return
}
PublicApi.postOrderSubmitRequisitionFormAll({ ids: ids }).then(res => {
ref.current.reload()
})
}
//提交审核
const handleSubmit = (id) => {
PublicApi.postOrderNewRequisitionFormAudit({ id: id }).then(res => {
ref.current.reload()
})
}
const handleSumbit = (values:any) => {
if(values.voucherTime){
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
console.log('values',values)
ref.current.reload(values)
}
const menu = (
<Menu onClick={() => handleDelete(selectedRowKeys)}>
<Menu.Item key='1' icon={<DeleteOutlined/>}>
批量删除
</Menu.Item>
</Menu>
)
const handleBatchDel = (e:any) => {
}
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
const controllerBtns = <Row>
<Col span={24}>
<Space direction="horizontal" size={16}>
{
(props.type !== 1 && props.type !== 2)&&
<Button type="primary" onClick={() => history.push('/memberCenter/tranactionAbility/enquirySubmit/addEnquiry')} icon={<PlusOutlined/>}>新建</Button>
}
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>批量提交审核</Button>
{
(props.type !== 1 && props.type !== 2)&&
<>
<Dropdown.Button
overlay={menu}
trigger={['click']}
icon={<DownOutlined />}
>
更多
</Dropdown.Button>
</>
}
</Space>
</Col>
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{rowKew:'id'}}
fetchTableData={(params: any) => fetchData(params)}
rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => handleSumbit(values)}
effects={($,actions) => {
useStateFilterSearchLinkageEffect($,actions,'requisitionFormNo',FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={enquierySchema}
>
</NiceForm>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default List
\ No newline at end of file
import React, { Component } from 'react'
import OrderList from "../components/index"
const List = () => {
return (
<OrderList des='待审核报价单(一级)' type={1}/>
)
}
export default List
\ No newline at end of file
import React, { Component } from 'react'
import OrderList from "../components/index"
const List = () => {
return (
<OrderList des='待审核报价单(二级)' type={2}/>
)
}
export default List
\ No newline at end of file
...@@ -3,6 +3,7 @@ import ReactDOM from 'react-dom' ...@@ -3,6 +3,7 @@ import ReactDOM from 'react-dom'
import { import {
FormSpy, FormSpy,
SchemaForm, SchemaForm,
ISchema,
SchemaMarkupField as Field, SchemaMarkupField as Field,
createFormActions, createFormActions,
FormButtonGroup, FormButtonGroup,
...@@ -27,8 +28,10 @@ import { getAuth} from '@/utils/auth' ...@@ -27,8 +28,10 @@ import { getAuth} from '@/utils/auth'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import styles from './templateForm.less'; import styles from './templateForm.less';
import ReutrnEle from '@/components/ReturnEle' import ReutrnEle from '@/components/ReturnEle'
import ModalTable from '@/components/ModalTable'
import RroductModal from '../components/productModal' import RroductModal from '../components/productModal'
import { PATTERN_MAPS } from '@/constants/regExp' import { PATTERN_MAPS } from '@/constants/regExp'
import {useRowSelectionTable} from '@/hooks/useRowSelectionTable'
import {PageStatus,usePageStatus} from '@/hooks/usePageStatus' import {PageStatus,usePageStatus} from '@/hooks/usePageStatus'
import statuStyle from '../../common/colorTag' import statuStyle from '../../common/colorTag'
import {interiorState} from '../../common/tableStatusList' import {interiorState} from '../../common/tableStatusList'
...@@ -67,14 +70,24 @@ interface AreaParams { ...@@ -67,14 +70,24 @@ interface AreaParams {
cityCode: any; cityCode: any;
cityName: any; cityName: any;
} }
const fetchMemberList = async (params) => {
const res = await PublicApi.getMemberManageLowerProviderPage(params)
return res.data
}
const init = { const init = {
deliveryTime: '' deliveryTime: ''
} }
const Detail: React.FC<{}> = () => { const Detail: React.FC<{}> = () => {
const headerTitle = '需求单'
const [tabForm] = Form.useForm() const [tabForm] = Form.useForm()
const {pageStatus, id} = usePageStatus() const {pageStatus, id} = usePageStatus()
//PageStatus:{0: "ADD", 1: "EDIT", 2: "PREVIEW", ADD: 0, EDIT: 1, PREVIEW: 2}0: "ADD"1: "EDIT"2: "PREVIEW"ADD: 0EDIT: 1PREVIEW: 2} 1
let _title = pageStatus === PageStatus.PREVIEW ? '查看' : id ? '编辑' : '新建'
const headerTitle = (`${_title}需求单`)
const [initialValues, setinitialValues] = useState<any>({ const [initialValues, setinitialValues] = useState<any>({
details: '', details: '',
addresId: null, addresId: null,
...@@ -89,10 +102,13 @@ const Detail: React.FC<{}> = () => { ...@@ -89,10 +102,13 @@ const Detail: React.FC<{}> = () => {
voucherTime:'', voucherTime:'',
requisitionFormAddress:[]//地市 requisitionFormAddress:[]//地市
}) })
const [menberList2, setmenberList2] = useState([])
const [requisitionFormAddress, setrequisitionFormAddress] = useState([])//地市多项回显用 const [requisitionFormAddress, setrequisitionFormAddress] = useState([])//地市多项回显用
const [customerCategoryId, setcustomerCategoryId] = useState<any>([]) //品类 const [customerCategoryId, setcustomerCategoryId] = useState<any>([]) //品类
const [selectRow, setSelectRow] = useState([])//需求单用 const [selectRow, setSelectRow] = useState([])//需求单用
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])//需求单 const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])//需求单
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'memberId' })
const [visibleChannelMember, setVisibleChannelMember] = useState(false)
const [categoryId, setcategoryId] = useState(null)//选择的分类id const [categoryId, setcategoryId] = useState(null)//选择的分类id
const [otherList, setotherList] = useState([])//动态tab循环 const [otherList, setotherList] = useState([])//动态tab循环
const [dockingList, setdockingList] = useState([])//需求列表 const [dockingList, setdockingList] = useState([])//需求列表
...@@ -110,6 +126,50 @@ const Detail: React.FC<{}> = () => { ...@@ -110,6 +126,50 @@ const Detail: React.FC<{}> = () => {
const [memberType, setmemberType] = useState(1) const [memberType, setmemberType] = useState(1)
const { ProductStore } = store const { ProductStore } = store
const { setAreaOption, productInfoByEdit, getBasicFormParamsByEdit, setAttributeLists, setProductName } = ProductStore const { setAreaOption, productInfoByEdit, getBasicFormParamsByEdit, setAttributeLists, setProductName } = ProductStore
const columnsSetMember: any[] = [
{
title: 'ID',
dataIndex: 'memberId',
align: 'center',
key: 'memberId',
},
{
title: '会员名称',
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
align: 'center',
key: 'memberTypeName',
},
{
title: '会员角色',
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '会员等级',
dataIndex: 'levelTag',
align: 'center',
key: 'levelTag',
}
]
const menberList = [
{
memberId:1 ,
name:'名称1',
roleName:'角色1',
memberTypeName:'采购商',
levelTag:'青铜'
}
]
const FormSumbit = (values: any) => { const FormSumbit = (values: any) => {
setTimeout(() => { setTimeout(() => {
...@@ -249,6 +309,28 @@ const Detail: React.FC<{}> = () => { ...@@ -249,6 +309,28 @@ const Detail: React.FC<{}> = () => {
align: 'center' align: 'center'
} }
] ]
const formSearch: ISchema = {
type: 'object',
properties: {
name: {
type: 'string',
"x-component": 'Search',
"x-component-props": {
placeholder: '请输入会员名称'
}
}
}
}
const handleCancelAddMember = () => {
setVisibleChannelMember(false)
}
// 会员添加弹窗控制
const handleOkAddMember = () => {
setVisibleChannelMember(false)
setproductSource(memberRowCtl.selectRow)
console.log('memberRowCtl.selectRow',memberRowCtl.selectRow)
}
const [pagination, setPagination] = useState({ const [pagination, setPagination] = useState({
current: 1, current: 1,
...@@ -262,7 +344,7 @@ const Detail: React.FC<{}> = () => { ...@@ -262,7 +344,7 @@ const Detail: React.FC<{}> = () => {
) )
/** /**
* @description: 操作 * @description: 操作
* @param {type} 1添加商品 * @param {type} 1添加商品 2选择会员
* @return {type} * @return {type}
*/ */
const handleOptionBtn = (type: any) => { const handleOptionBtn = (type: any) => {
...@@ -270,9 +352,14 @@ const Detail: React.FC<{}> = () => { ...@@ -270,9 +352,14 @@ const Detail: React.FC<{}> = () => {
case 1: case 1:
setdialogVisible(true) setdialogVisible(true)
break; break;
case 2:
setVisibleChannelMember(true)
break;
} }
} }
useEffect(() => { useEffect(() => {
setmenberList2(menberList)
PublicApi.getProductPlatformGetCategoryTree({rootNodeId:null}).then(res => { PublicApi.getProductPlatformGetCategoryTree({rootNodeId:null}).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
let { data } = res let { data } = res
...@@ -327,6 +414,7 @@ const Detail: React.FC<{}> = () => { ...@@ -327,6 +414,7 @@ const Detail: React.FC<{}> = () => {
if(res.code === 1000){ if(res.code === 1000){
let data = res.data let data = res.data
let areaCodeList = [] let areaCodeList = []
setplatType(data.type)
if(data.requisitionFormAddress){ if(data.requisitionFormAddress){
data.requisitionFormAddress.forEach((v)=> { data.requisitionFormAddress.forEach((v)=> {
areaCodeList.push([v.provinceCode,v.cityCode]) areaCodeList.push([v.provinceCode,v.cityCode])
...@@ -969,8 +1057,25 @@ const Detail: React.FC<{}> = () => { ...@@ -969,8 +1057,25 @@ const Detail: React.FC<{}> = () => {
onOK={(values: any) => handleSubmit(values)} onOK={(values: any) => handleSubmit(values)}
onCancel={() => setdialogVisible(false)} onCancel={() => setdialogVisible(false)}
> >
</RroductModal> </RroductModal>
<ModalTable
modalTitle='选择会员'
confirm={handleOkAddMember}
cancel={handleCancelAddMember}
visible={visibleChannelMember}
columns={columnsSetMember}
rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberList(params)}
formilyProps={
{
ctx: { schema: formSearch }
}
}
tableProps={{
rowKey: 'memberId'
}}
/>
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:11 * @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com * @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-31 19:49:09 * @LastEditTime: 2020-09-02 14:40:39
*/ */
import React, { ReactNode, useRef, useState,useEffect } from 'react'; import React, { ReactNode, useRef, useState,useEffect } from 'react';
import { history } from 'umi'; import { history } from 'umi';
......
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