Commit 566b7ab5 authored by LeeJiancong's avatar LeeJiancong

'对接选择需求弹窗,报价明细弹框等功能'

parent 8727a765
......@@ -3,7 +3,7 @@
* @Date: 2020-07-31 19:56:22
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-10 17:07:48
* @LastEditTime: 2020-09-11 10:17:58
*/
const TranactionRoute = {
......@@ -64,6 +64,12 @@ const TranactionRoute = {
},
]
},
/**
* @description: 需求发布
* @param {type}
* @return {type}
*/
{
path:'/memberCenter/tranactionAbility/enquirySubmit',
name:'enquirySubmit',
......@@ -119,6 +125,12 @@ const TranactionRoute = {
]
},
/**
* @description: 需求报价
* @param {type}
* @return {type}
*/
{
path:'/memberCenter/tranactionAbility/enquiryOffer',
name:'enquiryOffer',
......@@ -137,7 +149,23 @@ const TranactionRoute = {
key:'viewEnquiryDetail',
component: '@/pages/transaction/enquiryOffer/components/detail',
hideInMenu: true,
}
},
//需求新增列表
{
path:'/memberCenter/tranactionAbility/enquiryOffer/toAddSubmitList',
name:'toAddSubmitList',
key:'toAddSubmitList',
component: '@/pages/transaction/enquiryOffer/toAddSubmit'
},
//新增
{
path:'/memberCenter/tranactionAbility/enquiryOffer/addEnquiry',
name:'addEnquiry',
key:'addEnquiry',
component: '@/pages/transaction/enquiryOffer/toAddSubmit/detail',
hideInMenu: true,
},
]
},
......
......@@ -2,7 +2,7 @@ import React, { ReactText, useRef, useEffect } from 'react'
import {StandardTable} from 'god'
import { IStandardTableProps } from 'god/dist/src/standard-table'
import { Row, Col, Modal } from 'antd'
import { productModalSchema, productModalByMemberSchema, memberModalSchema, inquirySchema, demandSchema } from './schema'
import { productModalSchema, productModalByMemberSchema, memberModalSchema, inquirySchema, demandSchema,enquirySchema } from './schema'
import Search from '../NiceForm/components/Search'
import SearchSelect from '../NiceForm/components/SearchSelect'
import Submit from '../NiceForm/components/Submit'
......@@ -17,7 +17,7 @@ export interface ModalTableProps extends IStandardTableProps<any> {
cancel?(),
visible?: boolean,
resetModal?: object,
modalType?: 'productByDefault' | 'productByMember' | 'memberByDefault' | 'inquiryByDefault' | 'demandByDefault' | 'none'
modalType?: 'productByDefault' | 'productByMember' | 'memberByDefault' | 'inquiryByDefault' | 'demandByDefault' | 'enquiryModel' | 'none'
}
const ModalTable:React.FC<ModalTableProps> = (props) => {
......@@ -50,6 +50,10 @@ const ModalTable:React.FC<ModalTableProps> = (props) => {
return inquirySchema
}
case 'enquiryModel':{
return enquirySchema
}
case 'demandByDefault': {
return demandSchema
}
......
......@@ -200,6 +200,71 @@ export const inquirySchema: ISchema = {
}
}
/**
* @description: 新增报价单 需求单查询
* @param {type}
* @return {type}
*/
export const enquirySchema: ISchema = {
type: 'object',
properties: {
keywords: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '需求单号/需求单摘要',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
// @todo 需调整字段名
demandMembers: {
type: 'string',
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '需求会员(全部)',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
style: {
width: 160
}
}
},
"[startVoucherTime,endVoucherTime]": {
type: 'string',
"x-component": "dateSelect",
"x-component-props": {
placeholder: '单据时间(全部)',
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
export const demandSchema: ISchema = {
type: 'object',
properties: {
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-10 14:40:36
* @LastEditTime: 2020-09-11 11:21:27
*/
export default {
......@@ -129,6 +129,9 @@ export default {
//需求报价
'menu.tranactionAbility.enquiryOffer': '需求报价',
'menu.tranactionAbility.enquiryOffer.enquirySearch': '需求单查询',
'menu.tranactionAbility.enquiryOffer.toAddSubmitList': '待新增报价单',
'menu.tranactionAbility.enquiryOffer.addEnquiry': '新增报价',
'menu.tranactionAbility.enquiryOffer.viewEnquiryDetail': '报价单详情',
......
import React, { useEffect,useState } from 'react'
import ModalTable, { ModalTableProps } from '@/components/ModalTable'
import { PublicApi } from '@/services/api'
import moment from 'moment'
import { ColumnType } from 'antd/lib/table/interface'
import { useModalTable } from '../../model/useModalTable'
import { ISchemaFormActions } from '@formily/antd'
export interface InquiryModalTableProps extends ModalTableProps {
type?: 'radio' | 'checkbox',
schemaAction: ISchemaFormActions,
currentRef?: any,
confirmModal?: Function;
}
/**
* @description: 选择需求单
* @param {type}
* @return {type}
*/
const fetchEqData = async (params: any) => {
const res = await PublicApi.getOrderQuotationRequisitionFormList(params);
return res.data
}
const formTime = (text) => {
return <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
}
/**
* @description: 弹框选择需求单
* @param {type}
* @return {type}
*/
const dialogEqcolumns : ColumnType<any>[] = [
{
title:'需求单号',
key:'requisitionFormNo',
dataIndex:'requisitionFormNo',
align:'center'
},
{
title:'需求单摘要',
key:'details',
dataIndex:'details',
align:'left'
},
{
title:'需求会员',
key:'demandMembers',
dataIndex:'demandMembers',
align:'left'
},
{
title:'单据日期',
key:'voucherTime',
dataIndex:'voucherTime',
align:'center',
render:(text:any)=> formTime(text)
}
]
// 报价单弹窗
const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
const { type = 'radio', schemaAction, confirmModal, currentRef, ...restProps } = props
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type})
useEffect(() => {
if (currentRef) {
currentRef.current = {
setVisible,
visible,
rowSelectionCtl
}
}
}, [])
const handleConfirm = async () => {
const item = rowSelectionCtl.selectRow[0]
// if (item) {
// schemaAction.setFieldValue('quotationNo', item.quotationNo)
// const data = await fetchOrderApi.getProductListByQuotationOrderId({
// id: item.id
// })
// schemaAction.setFieldValue('orderProductRequests', data)
// schemaAction.setFieldValue('supplyMembersName', item.memberName || '后端没有返回会员名称')
// }
props.confirmModal(item)
setVisible(false)
}
return (
<ModalTable
modalTitle='选择需求单'
columns={dialogEqcolumns}
visible={visible}
confirm={handleConfirm}
cancel={() => setVisible(false)}
fetchTableData={(params) => fetchEqData(params)}
rowSelection={rowSelection}
modalType='enquiryModel'
tableProps={{
rowKey: 'id'
}}
{...restProps}
/>
)
}
InquiryModalTable.defaultProps = {}
export default InquiryModalTable
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-10 17:26:47
* @LastEditTime: 2020-09-12 14:20:26
*/
/**
* @description: 组件描述:
......@@ -46,7 +46,7 @@ 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 { enquierySearchSchema } from '../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
export interface listParams{
......@@ -131,17 +131,6 @@ const List:React.FC<{listParams}> = (props) => {
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)
}
......
import { useState } from 'react'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
export const useModalTable = (options?) => {
const [visible, setVisible] = useState(false)
const [rowSelection, rowSelectionCtl] = useRowSelectionTable(options)
return {
visible,
setVisible,
rowSelection,
rowSelectionCtl
}
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ import TranactionRoute from 'config/routes/tranactionRoute'
* @param {type}
* @return {type}
*/
export const enquierySchema: ISchema = {
export const commonEnquieryOfferSchema: ISchema = {
type:'object',
properties:{
megalayout:{
......@@ -25,14 +25,14 @@ export const enquierySchema: ISchema = {
children:"{{controllerBtns}}"
}
},
requisitionFormNo:{
quotationNo:{//报价单号
type:'string',
"x-component":"Search",
"x-mega-props":{
},
"x-component-props":{
placeholder:'搜索'
placeholder:'报价单搜索'
}
}
}
......@@ -59,31 +59,47 @@ export const enquierySchema: ISchema = {
inline: true
},
properties:{
requisitionFormNo:{//需求单号
type:'string',
"x-mega-props":{
},
"x-component-props":{
placeholder:'询价单'
}
},
details:{
type:'string',
"x-component-props":{
placeholder:'需求摘要'
placeholder:'报价摘要'
}
},
category:{
demandMembers:{
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:[]
"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,
......@@ -158,30 +174,29 @@ export const enquierySearchSchema: ISchema = {
properties:{
demandMembers:{
type:'string',
"x-component":'Search',
"x-component-props":{
placeholder:'需求会员'
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:'请选择品类'
// 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:[]
// },
// enum:[]
},
voucherTime:{
type:'string',
default: 0,
......@@ -206,4 +221,86 @@ export const enquierySearchSchema: ISchema = {
}
}
/**
* @description: 报价单新增编辑-需求单查询
* @param {type}
* @return {type}
*/
export const dialogEqformSearch: 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:{
details:{
type:'string',
"x-component-props":{
placeholder:'需求摘要'
}
},
demandMembers:{
type:'string',
"x-component-props":{
placeholder:'需求会员'
}
},
voucherTime:{
type:'string',
default: 0,
"x-component-props":{
placeholder:'请选择单据时间'
},
enum: TimeList
},
}
},
sumbit:{
"x-component":'Submit',
"x-mega-props":{
span: 1
},
"x-component-props":{
children:'查询'
}
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
/*
* @Author: LeeJiancong
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-11 16:59:50
*/
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 { commonEnquieryOfferSchema } from '../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
const formActions = createFormActions();
const fetchData = async (params: any) => {
const res = await PublicApi.getOrderQuotationInvoiceList(params);
return res.data
}
const List:React.FC<{}> = () => {
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:'quotationNo',
dataIndex:'quotationNo',
align:'center'
},
{
title:'需求单号',
key:'requisitionFormNo',
dataIndex:'requisitionFormNo',
align:'center'
},
{
title:'报价摘要',
key:'quotationSummary',
dataIndex:'quotationSummary',
align:'left'
},
{
title:'需求会员',
key:'demandMembers',
dataIndex:'demandMembers',
align:'left'
},
{
title:'报价截至时间',
key:'quotationAsTime',
dataIndex:'quotationAsTime',
align:'left',
render:(text:any)=> format(text)
},
{
title:'单据日期',
key:'documentsTime',
dataIndex:'documentsTime',
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 (
<>
{
(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.postOrderQuotationDelete({ ids: arr }).then(res => {
ref.current.reload()
})
}
//批量提交
const handleSubmitAll = (ids: number[]) => {
PublicApi.postOrderQuotationSubmitAuditAll({ ids: ids }).then(res => {
ref.current.reload()
})
}
//提交审核
const handleSubmit = (id) => {
PublicApi.postOrderQuotationSubmitAudit({ 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 type="primary" onClick={() => history.push('/memberCenter/tranactionAbility/enquiryOffer/addEnquiry')} icon={<PlusOutlined/>}>新建</Button>
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>批量提交审核</Button>
<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,'quotationNo',FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={commonEnquieryOfferSchema}
>
</NiceForm>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default List
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @Date: 2020-08-28 10:07:45
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-09 16:39:14
* @LastEditTime: 2020-09-11 16:51:28
*/
import React, { Component, useState, useEffect } from 'react';
import { Modal, Button, Form, Radio, AutoComplete,Tabs, Input, Select,Checkbox } from 'antd'
......@@ -24,11 +24,12 @@ export interface Params {
dontReceive?: boolean; //默认展示
}
const layout = {
layout: 'vertical',
labelCol: {
span: 4
},
wrapperCol: {
span: 20
span: 24
}
}
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:29
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-10 11:12:01
* @LastEditTime: 2020-09-11 11:43:16
*/
import React, { Component, useState, useEffect } from 'react'
import ReactDOM from 'react-dom'
......@@ -1047,7 +1047,7 @@ const Detail: React.FC<{}> = () => {
autoComplete="off"
> */}
<Form.Item
label="报价单摘要"
label="需求单摘要"
initialValue={initialValues.details}
rules={[
{
......@@ -1056,7 +1056,7 @@ const Detail: React.FC<{}> = () => {
]}
name="details"
>
<Input placeholder="请输入报价单摘要" maxLength={30} />
<Input placeholder="请输入需求单摘要" maxLength={30} />
</Form.Item>
<Form.Item
// initialValue={
......
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