Commit 7f850eea authored by LeeJiancong's avatar LeeJiancong

'需求发布列表品类下拉,新增需求报价查询页面'

parent 808435e9
......@@ -3,7 +3,7 @@
* @Date: 2020-07-31 19:56:22
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-08 17:19:23
* @LastEditTime: 2020-09-10 14:38:35
*/
const TranactionRoute = {
......@@ -119,6 +119,22 @@ const TranactionRoute = {
]
},
{
path:'/memberCenter/tranactionAbility/enquiryOffer',
name:'enquiryOffer',
key:'enquiryOffer',
routes:[
//需求单查询
{
path:'/memberCenter/tranactionAbility/enquiryOffer/enquirySearch',
name:'enquirySearch',
key:'enquirySearch',
component: '@/pages/transaction/enquiryOffer/enquirySearch'
},
]
},
// 采购订单
{
path: '/memberCenter/tranactionAbility/purchaseOrder',
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-08 17:20:34
* @LastEditTime: 2020-09-10 14:40:36
*/
export default {
......@@ -107,6 +107,8 @@ export default {
'menu.tranactionAbility.stockSellStorage.bills': '单据',
'menu.tranactionAbility.stockSellStorage.addBills': '新增单据',
'menu.tranactionAbility.stockSellStorage.inventory': '库存',
//需求发布
'menu.tranactionAbility.enquirySubmit': '需求发布',
'menu.tranactionAbility.enquirySubmit.enquirySearch': '需求单查询',
'menu.tranactionAbility.enquirySubmit.toAddSubmitList': '待新增需求单',
......@@ -120,6 +122,12 @@ export default {
'menu.tranactionAbility.purchaseOrder.readyAddOrder': '待新增订单',
'menu.tranactionAbility.purchaseOrder.orderDetail': '订单详情',
//需求报价
'menu.tranactionAbility.enquiryOffer': '需求报价',
'menu.tranactionAbility.enquiryOffer.enquirySearch': '需求单查询',
//物流能力
'menu.logisticsAbility': '物流',
'menu.logisticsAbility.logistics': '物流管理',
......
import React, { useEffect } from 'react'
import { ISchemaFormActions, FormEffectHooks, IFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
const { onFieldValueChange$ } = FormEffectHooks
// 高级筛选schema中用于输入搜索需求发布品类的Effect
export const searchSelectGetSelectCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
})
})
}
\ No newline at end of file
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;
type: number|string;//1是一级 2是二级
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('value',value)
if(props.type == 1){
PublicApi.postOrderRequisitionFormAudit(value).then(res => {
if (res.code === 1000) {
console.log(123123)
props.onOK()
}
})
}else if(props.type == 2){
PublicApi.postOrderRequisitionFormAuditTwo(value).then(res => {
if (res.code === 1000) {
console.log(123123)
props.onOK()
}
})
}
}
useEffect(() => {
return () => {
}
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('state').subscribe(({ value }) => {
setFieldState('cause', state => {
if (value == 1) {
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={4}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
state: 1
}}
>
<Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='state'
required
x-component="Radio"
x-component-props={{
}}
/>
{props.dontReceive &&
<>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='审核不通过原因'
name="cause"
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
This diff is collapsed.
/*
* @Author: LeeJiancong
* @Date: 2020-08-28 10:07:45
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-09 16:39:14
*/
import React, { Component, useState, useEffect } from 'react';
import { Modal, Button, Form, Radio, AutoComplete,Tabs, Input, Select,Checkbox } from 'antd'
import { PublicApi } from '@/services/api'
const { TabPane } = Tabs
const { Option } = Select
const {TextArea} = Input
export interface Params {
sourceData: Array<any>[],
id?: any,
mode: number,
type?: number | string,
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
initialValues?: any;
dontReceive?: boolean; //默认展示
}
const layout = {
labelCol: {
span: 4
},
wrapperCol: {
span: 20
}
}
/**
* @description: 保存 提交表单
* @param {type}
* @return {type}
*/
const comfirmDialog: React.FC<Params> = (props) => {
// console.log('数据',props.sourceData)
const [form] = Form.useForm()
const [placeOfOriginList, setplaceOfOriginList] = useState([])//产地
const handleCancel = () => {
}
const handletOk = () => {
form.validateFields().then(v => {
console.log('表单', v)
props.onOK(v)
})
// if(props.type){
// value.type = props.type
// }
// console.log('列表',value)
}
useEffect(() => {
return () => {
}
}, [])
const onChange = (value, attrItem) => {
}
const renderTabPanchildren = (item: any) => {
return (
<>
{
item.attributeList.map((attrItem:any) => {
const options = attrItem.attributeValueList.map((item: any) => ({
value: item.value
}))
return (
<>
{
attrItem.type === 1 &&
<Form.Item
name={attrItem.name}
label={attrItem.name}
rules={attrItem.isEmpty && [{
required: true,
message: '此项为必填项'
}]}
>
<AutoComplete
style={{ width: 200 }}
options={options}
placeholder="选择或输入"
filterOption={(inputValue, option) =>
option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
}
/>
{/* <Select
placeholder="请选择"
allowClear
onChange={(v)=>onChange(v, attrItem)}
>
{
attrItem.attributeValueList && attrItem.attributeValueList.map((item: any) => (
<Option key={item.id} value={item.id}>{item.value}</Option>
))
}
</Select> */}
</Form.Item>
}
{
attrItem.type === 2 &&
<Form.Item
label={attrItem.name}
name={attrItem.id}
rules={attrItem.isEmpty && [{
required: true,
message: '此项为必填项'
}]}
>
{/* <Checkbox.Group onChange={(v)=>onChange(v, attrItem)}>
{
attrItem.customerAttributeValueList.length && attrItem.customerAttributeValueList.map((item: any, index: string) => (
<Checkbox key={item.id} value={item.id}>{item.value}</Checkbox>
))
}
</Checkbox.Group> */}
</Form.Item>
}
{
attrItem.type === 3 &&
<Form.Item
name={attrItem.id}
label={attrItem.name}
rules={attrItem.isEmpty && [{
required: true,
message: '此项为必填项'
}]}
>
{/* <TextArea onChange={(v)=>onChange(v, attrItem)} maxLength={100} placeholder="最多输入100个字符" rows={4} /> */}
</Form.Item>
}
</>
)
})
}
</>
)
}
return (
<>
<Modal
title={props.mode === 0 ? '新增商品' : '查看商品'}
width={800}
visible={props.dialogVisible}
onOk={() => handletOk()}
onCancel={() => props.onCancel()}
destroyOnClose
afterClose={() => { }}
okText={`确定`}
cancelText='取消'
>
<Form
{...layout}
colon={false}
labelAlign="left"
form={form}
autoComplete="off"
>
<Tabs defaultActiveKey='tab1'
tabPosition="left"
>
<Tabs.TabPane tab='基本信息' key="tab-1">
<Form.Item
label='规格型号'
name='model'
required
>
<Input placeholder='' />
</Form.Item>
<Form.Item
label='商品品牌'
name='brand'
required
>
<Input placeholder='' />
</Form.Item>
</Tabs.TabPane>
{
/**
* @description: 动态循环
* @param {type}
* @return {type}
*/
}
{
props.sourceData.length > 0 && props.sourceData.map((attributeItem:any) => <>
<TabPane tab={attributeItem.name} key={attributeItem.id}>
{
renderTabPanchildren(attributeItem)
}
</TabPane>
</>
)
}
<Tabs.TabPane tab='采购数量' key="tab-7">
<Form.Item
label='单位'
name='purchaseNuit'
required
>
<Input placeholder='' />
</Form.Item>
<Form.Item
label='采购数量'
name='purchaseQuantity'
required
>
<Input placeholder='' />
</Form.Item>
</Tabs.TabPane>
</Tabs>
</Form>
</Modal>
</>
)
}
comfirmDialog.defaultProps = {
dontReceive: true,
type: 1 //1.支付宝 2.支付宝转账到银行卡参数配置 3.微信
}
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-10 15:57:19
*/
/**
* @description: 组件描述:
* @param {type}
* @return {type}
*/
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,interiorStateTwo,
enquirySearchInteriorState,enquirySearchexternalState} from '../../common/tableStatusList'
import statuStyle from '../../common/colorTag'
import NiceForm from '@/components/NiceForm';
import {timeRange} from '@/utils/index'
import {filterInteriorStateList,filterExternalStateList} from './../../common/statusList'
import moment from 'moment'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import {PageStatus} from '@/hooks/usePageStatus'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {searchSelectGetSelectCategoryOptionEffect} from '../../effect/index'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { enquierySchema,enquierySearchSchema } from '../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
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) => {
const res = await PublicApi.getOrderRequisitionFormList(params);
return res.data
}
/**
* @description:
* @param {type} 可以根据props.type处理
* @return {type}
*/
const handleToDetail= (id) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?page_type=${4}&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',
filters: filterExternalStateList,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: (text: any, reconds) =>
enquirySearchexternalState(text)
},
{
title:'内部状态',
key:'interiorState',
dataIndex:'interiorState',
align:'left',
filters: filterInteriorStateList,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render:(text:any) =>
enquirySearchInteriorState(text)
}
]
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 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 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}>
</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)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
schema={enquierySearchSchema}
>
</NiceForm>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default List
\ No newline at end of file
import { ISchema} from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import {TimeList} from '../../common/statusList'
import TranactionRoute from 'config/routes/tranactionRoute'
/**
* @description: 公用
* @param {type}
* @return {type}
*/
export const enquierySchema: ISchema = {
type:'object',
properties:{
megalayout:{
type:'object',
"x-component":'mega-layout',
"x-component-props":{
grid:true
},
properties:{
ctl:{
type:'object',
"x-component":"Children",
"x-component-props":{
children:"{{controllerBtns}}"
}
},
requisitionFormNo:{
type:'string',
"x-component":"Search",
"x-mega-props":{
},
"x-component-props":{
placeholder:'搜索'
}
}
}
},
[FORM_FILTER_PATH]:{
type:'object',
"x-component":"flex-layout",
"x-component-props":{
rowStyle:{
flexWrap:'nowrap'
},
colStyle:{
marginLeft: 20
}
},
properties:{
PRO_LAYOUT:{
type:'object',
"x-component":'mega-layout',
"x-mega-props":{
span: 5
},
"x-component-props":{
inline: true
},
properties:{
details:{
type:'string',
"x-component-props":{
placeholder:'需求摘要'
}
},
category:{
type:'string',
'x-component': 'CustomInputSearch',
'x-component-props': {
placeholder: '商品品类',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px', lineHeight: '32px' },
searchValue: null,
dataoption: []
}
// "x-component-props":{
// placeholder:'请选择品类'
// },
// enum:[]
},
voucherTime:{
type:'string',
default: 0,
"x-component-props":{
placeholder:'请选择单据时间'
},
enum: TimeList
},
}
},
sumbit:{
"x-component":'Submit',
"x-mega-props":{
span:1
},
"x-component-props":{
children:'查询'
}
}
}
}
}
}
/**
* @description: 需求发布查询
* @param {type}
* @return {type}
*/
export const enquierySearchSchema: ISchema = {
type:'object',
properties:{
megalayout:{
type:'object',
"x-component":'mega-layout',
properties:{
requisitionFormNo:{
type:'string',
"x-component":"Search",
"x-mega-props":{
},
"x-component-props":{
placeholder:'搜索',
align: 'flex-left',
}
}
}
},
[FORM_FILTER_PATH]:{
type:'object',
"x-component":"flex-layout",
"x-component-props":{
rowStyle:{
justifyContent: 'flex-start',
flexWrap:'nowrap'
},
colStyle:{//改变间隔
marginRight: 20
}
},
properties:{
PRO_LAYOUT:{
type:'object',
"x-component":'mega-layout',
"x-mega-props":{
span: 5
},
"x-component-props":{
inline: true
},
properties:{
category:{
type:'string',
'x-component': 'CustomInputSearch',
'x-component-props': {
placeholder: '商品品类',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px', lineHeight: '32px' },
searchValue: null,
dataoption: []
}
// "x-component-props":{
// placeholder:'请选择品类'
// },
// enum:[]
},
voucherTime:{
type:'string',
default: 0,
"x-component-props":{
placeholder:'请选择单据时间'
},
enum: TimeList
},
}
},
sumbit:{
"x-component":'Submit',
"x-mega-props":{
span: 1
},
"x-component-props":{
children:'查询'
}
}
}
}
}
}
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:32:05
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-10 13:35:50
* @LastEditTime: 2020-09-10 14:35:02
*/
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'
......@@ -656,20 +656,6 @@ const detailInfo: React.FC<{}> = () => {
</div>
</div>
{/* <div className={style['mainCol-row']}>
{infoTem['base'].elem.map((item: any, index: number) => {
return (
<div className={style['mainCol-row-col']} key={index}>
<div className={style['mainCol-row-col-option']}>
{item.title}
</div>
<div className={style['mainCol-row-col-option']}>
185 2929 6547
</div>
</div>
);
})}
</div> */}
</Col>
<Col className={style['mainCol']} span={24}>
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-10 11:42:28
* @LastEditTime: 2020-09-10 15:47:17
*/
/**
* @description: 组件描述: 一级 二级 待提交需求单
......@@ -42,6 +42,7 @@ import moment from 'moment'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import {PageStatus} from '@/hooks/usePageStatus'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {searchSelectGetSelectCategoryOptionEffect} from '../../effect/index'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { enquierySchema } from '../schema';
import { PublicApi } from '@/services/api';
......@@ -314,6 +315,9 @@ const List:React.FC<listParams> = (props) => {
onSubmit={values => handleSumbit(values)}
effects={($,actions) => {
useStateFilterSearchLinkageEffect($,actions,'requisitionFormNo',FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
expressionScope={{
controllerBtns
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-09 14:48:31
* @LastEditTime: 2020-09-10 16:02:00
*/
/**
* @description: 组件描述: 一级 二级 待提交需求单
......@@ -44,6 +44,7 @@ import moment from 'moment'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import {PageStatus} from '@/hooks/usePageStatus'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {searchSelectGetSelectCategoryOptionEffect} from '../../effect/index'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { enquierySchema,enquierySearchSchema } from '../schema';
import { PublicApi } from '@/services/api';
......@@ -210,6 +211,9 @@ const List:React.FC<{listParams}> = (props) => {
onSubmit={values => handleSumbit(values)}
effects={($,actions) => {
useStateFilterSearchLinkageEffect($,actions,'requisitionFormNo',FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
schema={enquierySearchSchema}
>
......
......@@ -67,10 +67,22 @@ export const enquierySchema: ISchema = {
},
category:{
type:'string',
"x-component-props":{
placeholder:'请选择品类'
},
enum:[]
'x-component': 'CustomInputSearch',
'x-component-props': {
placeholder: '商品品类',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px', lineHeight: '32px' },
searchValue: null,
dataoption: []
}
// "x-component-props":{
// placeholder:'请选择品类'
// },
// enum:[]
},
voucherTime:{
type:'string',
......@@ -146,10 +158,22 @@ export const enquierySearchSchema: ISchema = {
properties:{
category:{
type:'string',
"x-component-props":{
placeholder:'请选择品类'
},
enum:[]
'x-component': 'CustomInputSearch',
'x-component-props': {
placeholder: '商品品类',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px', lineHeight: '32px' },
searchValue: null,
dataoption: []
}
// "x-component-props":{
// placeholder:'请选择品类'
// },
// enum:[]
},
voucherTime:{
type:'string',
......
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