Commit a8c3dbb2 authored by 前端-许佳敏's avatar 前端-许佳敏
parents 098c6206 279f76f5
/*
* @Author: LeeJiancong
* @Date: 2020-07-31 19:56:22
* @LastEditors: XieZhiXiong
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-23 17:02:26
* @LastEditTime: 2020-09-26 16:41:58
*/
const TranactionRoute = {
......@@ -167,19 +167,24 @@ const TranactionRoute = {
name:'enquiryOffer',
key:'enquiryOffer',
routes:[
//需求单查询
//需求单查询-列表
{
path:'/memberCenter/tranactionAbility/enquiryOffer/enquirySearch',
name:'enquirySearch',
component: '@/pages/transaction/enquiryOffer/enquirySearch'
},
{//需求单详情
{//报价单详情
path:'/memberCenter/tranactionAbility/enquiryOffer/viewEnquiryDetail',
name:'viewEnquiryDetail',
component: '@/pages/transaction/enquiryOffer/components/detail',
hideInMenu: true,
},
//报价单查询
{
path:'/memberCenter/tranactionAbility/enquiryOffer/enquiryOfferSearch',
name:'enquiryOfferSearch',
component: '@/pages/transaction/enquiryOffer/enquiryOfferSearch'
},
//需求新增列表
{
path:'/memberCenter/tranactionAbility/enquiryOffer/toAddSubmitList',
......@@ -214,6 +219,51 @@ const TranactionRoute = {
]
},
/**
* @description: 确认报价
* @param {type}
* @return {type}
*/
{
path:'/memberCenter/tranactionAbility/enquiryOfferConfirm',
name:'enquiryOfferConfirm',
key:'enquiryOfferConfirm',
routes:[
//报价单查询
{
path:'/memberCenter/tranactionAbility/enquiryOfferConfirm/enquiryOfferSearch',
name:'enquiryOfferSearch',
component: '@/pages/transaction/enquiryOfferConfirm/enquiryOfferSearch'
},
{//报价单详情
path:'/memberCenter/tranactionAbility/enquiryOfferConfirm/viewEnquiryDetail',
name:'viewEnquiryDetail',
component: '@/pages/transaction/enquiryOfferConfirm/components/detail',
hideInMenu: true,
},
//报价一级
{
path:'/memberCenter/tranactionAbility/enquiryOfferConfirm/enquiryOne',
name:'enquiryOne',
component: '@/pages/transaction/enquiryOfferConfirm/enquiryOne'
},
//报价二级
{
path:'/memberCenter/tranactionAbility/enquiryOfferConfirm/enquiryTwo',
name:'enquiryTwo',
component: '@/pages/transaction/enquiryOfferConfirm/enquiryTwo'
},
// //待提交报价单
// {
// path:'/memberCenter/tranactionAbility/enquiryOfferConfirm/toSubmit',
// name:'toSubmit',
// component: '@/pages/transaction/enquiryOfferConfirm/toSubmit'
// }
]
},
// 采购订单
{
path: '/memberCenter/tranactionAbility/purchaseOrder',
......
/*
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: jiaxin
* @LastEditTime: 2020-09-22 16:35:11
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-26 17:32:14
*/
export default {
......@@ -136,6 +136,7 @@ export default {
//需求发布
'menu.tranactionAbility.enquirySubmit': '需求发布',
'menu.tranactionAbility.enquirySubmit.enquirySearch': '需求单查询',
'menu.tranactionAbility.enquirySubmit.toAddSubmitList': '待新增需求单',
'menu.tranactionAbility.enquirySubmit.addEnquiry': '新增需求单',
'menu.tranactionAbility.enquirySubmit.viewEnquiryDetail': '需求单详情',
......@@ -178,6 +179,7 @@ export default {
//需求报价
'menu.tranactionAbility.enquiryOffer': '需求报价',
'menu.tranactionAbility.enquiryOffer.enquirySearch': '需求单查询',
'menu.tranactionAbility.enquiryOffer.enquiryOfferSearch': '报价单查询',
'menu.tranactionAbility.enquiryOffer.toAddSubmitList': '待新增报价单',
'menu.tranactionAbility.enquiryOffer.addEnquiry': '新增报价',
'menu.tranactionAbility.enquiryOffer.viewEnquiryDetail': '报价单详情',
......@@ -185,6 +187,13 @@ export default {
'menu.tranactionAbility.enquiryOffer.enquiryTwo': '待审核报价单(二级)',
'menu.tranactionAbility.enquiryOffer.toSubmit': '待提交报价单',
//确认报价
'menu.tranactionAbility.enquiryOfferConfirm': '确认需求报价',
'menu.tranactionAbility.enquiryOfferConfirm.enquiryOfferSearch': '报价单查询',
'menu.tranactionAbility.enquiryOfferConfirm.enquiryOne': '待审核报价单(一级)',
'menu.tranactionAbility.enquiryOfferConfirm.enquiryTwo': '待审核报价单(二级)',
'menu.tranactionAbility.enquiryOfferConfirm.viewEnquiryDetail':'报价单详情',
// 供应商评价
'menu.tranactionAbility.supplierEvaluation': '供应会员评价管理',
'menu.tranactionAbility.supplierEvaluation.unevaluated': '待评价订单',
......
......@@ -3,7 +3,7 @@
* @Date: 2020-07-28 11:25:30
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-26 15:14:49
* @LastEditTime: 2020-09-26 17:37:12
*/
import React, { Component, useEffect, useRef, useState, ReactNode } from 'react'
......@@ -303,11 +303,15 @@ const Deatail: React.FC<{}> = () => {
//发货单号
if(query.shipmentOrderCode){
setshipmentOrderCode(query.shipmentOrderCode)
// setinitOrderObj({...initOrderObj,shipmentOrderCode: query.shipmentOrderCode})
}
//设置地址 发货单id 逻辑有物流单的用物流单优先 无物流单用订单 二选一
setShipmentOrderID(query.orderDeliveryDetailsId ||null)//发货单id
setInvoicesId(query.invoicesId||null)//订单id
//订单号
if(query.invoicesNo){
setinvoicesNo(query.invoicesNo)
}
if(query.orderDeliveryDetailsId){//发货单
PublicApi.getWarehouseInvoicesList({current: '1',
pageSize: '100000'}).then(res => {
......@@ -319,6 +323,7 @@ const Deatail: React.FC<{}> = () => {
actions.setFieldValue('receiverFullAddress',fullAddress)
}
})
return
}else{//订单
PublicApi.getOrderLogisticsOrderList({current: '1',
pageSize: '100000'}).then(res => {
......@@ -333,11 +338,7 @@ const Deatail: React.FC<{}> = () => {
}
//订单号
if(query.invoicesNo){
setinvoicesNo(query.invoicesNo)
// setinitOrderObj({...initOrderObj,invoicesNo: query.invoicesNo})
}
}
return () => {
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-12 14:20:26
* @LastEditTime: 2020-09-26 16:21:45
*/
/**
* @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 { enquierySearchSchema } from '../schema';
import { enquieryOfferSearchSchema } from '../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
export interface listParams{
......@@ -63,51 +63,59 @@ const List:React.FC<{listParams}> = (props) => {
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const fetchData = async (params: any) => {
const res = await PublicApi.getOrderQuotationRequisitionFormList(params);
return res.data
}
/**
/**
* @description:
* @param {type} 可以根据props.type处理
* @param {type} type: 1 需求发布 2报价 可以根据props.type处理
* @return {type}
*/
const handleToDetail= (id) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?page_type=${6}&id=${id}`)
const handleToDetail= (type,id) => {
if(type === 1){
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?page_type=${4}&id=${id}`)
}else{
history.push(`/memberCenter/tranactionAbility/enquiryOffer/viewEnquiryDetail?page_type=${4}&id=${id}`)
}
}
const fetchData = async (params: any) => {
const res = await PublicApi.getOrderQuotationList(params);
return res.data
}
const columns : ColumnType<any>[] = [
{
title:'报价单号',
key:'quotationNo',
dataIndex:'quotationNo',
align:'center',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
handleToDetail(2,records.id)
}}>{text}</EyePreview>
},
{
title:'需求单号',
key:'requisitionFormNo',
dataIndex:'requisitionFormNo',
align:'center',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
handleToDetail(records.id)
handleToDetail(1,records.requisitionId)//需求单id
}}>{text}</EyePreview>
},
{
title:'需求摘要',
key:'details',
dataIndex:'details',
title:'报价单摘要',
key:'quotationSummary',
dataIndex:'quotationSummary',
align:'left'
},
{
title:'品类',
key:'category',
dataIndex:'category',
title:'需求会员',
key:'demandMembers',
dataIndex:'demandMembers',
align:'left'
},
{
title:'交付日期',
key:'deliveryTime',
dataIndex:'deliveryTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'报价截至时间',
key:'quotationAsTime',
dataIndex:'quotationAsTime',
......@@ -116,8 +124,8 @@ const List:React.FC<{listParams}> = (props) => {
},
{
title:'单据时间',
key:'voucherTime',
dataIndex:'voucherTime',
key:'documentsTime',
dataIndex:'documentsTime',
align:'center',
render:(text:any)=> format(text)
},
......@@ -126,11 +134,23 @@ const List:React.FC<{listParams}> = (props) => {
key:'externalState',
dataIndex:'externalState',
align:'center',
filters: filterExternalStateList,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: (text: any, reconds) =>
enquirySearchexternalState(text)
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) =>
enquirySearchInteriorState(text)
}
......@@ -199,12 +219,12 @@ const List:React.FC<{listParams}> = (props) => {
actions={formActions}
onSubmit={values => handleSumbit(values)}
effects={($,actions) => {
useStateFilterSearchLinkageEffect($,actions,'requisitionFormNo',FORM_FILTER_PATH)
useStateFilterSearchLinkageEffect($,actions,'quotationNo',FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
schema={enquierySearchSchema}
schema={enquieryOfferSearchSchema}
>
</NiceForm>
......
......@@ -125,7 +125,7 @@ export const commonEnquieryOfferSchema: ISchema = {
}
/**
* @description: 需求报价查询
* @description: 需求报价-需求单查询
* @param {type}
* @return {type}
*/
......@@ -221,6 +221,119 @@ export const enquierySearchSchema: ISchema = {
}
}
/**
* @description: 需求报价-报价查询
* @param {type}
* @return {type}
*/
export const enquieryOfferSearchSchema: ISchema = {
type:'object',
properties:{
megalayout:{
type:'object',
"x-component":'mega-layout',
properties:{
quotationNo:{
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:{
requisitionFormNo:{
type:'string',
"x-component-props":{
placeholder:'对应需求单号'
}
},
quotationSummary:{
type:'string',
"x-component-props":{
placeholder:'摘要'
}
},
demandMembers:{
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}
......
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.
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
/*
* @Author: LeeJiancong
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-26 16:39:15
*/
/**
* @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 { enquieryOfferSearchSchema } 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")}</>
}
/**
* @description:
* @param {type} type: 1 需求发布 2报价 可以根据props.type处理
* @return {type}
*/
const handleToDetail= (type,id) => {
if(type === 1){
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?page_type=${4}&id=${id}`)
}else{
history.push(`/memberCenter/tranactionAbility/enquiryOfferConfirm/viewEnquiryDetail?page_type=${4}&id=${id}`)
}
}
const fetchData = async (params: any) => {
const res = await PublicApi.getOrderConfirmationQuotationList(params);
return res.data
}
const columns : ColumnType<any>[] = [
{
title:'报价单号',
key:'quotationNo',
dataIndex:'quotationNo',
align:'center',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
handleToDetail(2,records.id)
}}>{text}</EyePreview>
},
{
title:'需求单号',
key:'requisitionFormNo',
dataIndex:'requisitionFormNo',
align:'center',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
handleToDetail(1,records.requisitionId)//需求单id
}}>{text}</EyePreview>
},
{
title:'报价单摘要',
key:'quotationSummary',
dataIndex:'quotationSummary',
align:'left'
},
{
title:'需求会员',
key:'demandMembers',
dataIndex:'demandMembers',
align:'left'
},
{
title:'报价截至时间',
key:'quotationAsTime',
dataIndex:'quotationAsTime',
align:'center',
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) =>
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,'quotationNo',FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
schema={enquieryOfferSearchSchema}
>
</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
This diff is collapsed.
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