Commit 1cb2625b authored by 前端-许佳敏's avatar 前端-许佳敏
parents 96021593 4c11105e
......@@ -3,7 +3,7 @@
* @Date: 2020-07-28 11:25:30
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-26 12:47:56
* @LastEditTime: 2020-09-26 15:14:49
*/
import React, { Component, useEffect, useRef, useState, ReactNode } from 'react'
......@@ -306,11 +306,12 @@ const Deatail: React.FC<{}> = () => {
// setinitOrderObj({...initOrderObj,shipmentOrderCode: query.shipmentOrderCode})
}
//设置地址 发货单id 逻辑有物流单的用物流单优先 无物流单用订单 二选一
setShipmentOrderID(query.orderDeliveryDetailsId ||null)//发货单id
setInvoicesId(query.invoicesId||null)//订单id
if(query.orderDeliveryDetailsId){//发货单
PublicApi.getWarehouseInvoicesList({current: '1',
pageSize: '100000'}).then(res => {
if(res.code === 1000){
setShipmentOrderID(query.orderDeliveryDetailsId)//发货单id
let v = res.data.data.filter(v => v.id == query.orderDeliveryDetailsId).map(v => v)
let {memberName,fullAddress,deliveryAddresId} = v[0] || {}
actions.setFieldValue('receiverName',memberName)
......@@ -322,7 +323,6 @@ const Deatail: React.FC<{}> = () => {
PublicApi.getOrderLogisticsOrderList({current: '1',
pageSize: '100000'}).then(res => {
if(res.code === 1000){
setInvoicesId(query.invoicesId)//订单id
let v = res.data.data.filter(v => v.id == query.invoicesId).map(v => v)
let {memberName,fullAddress,deliveryAddresId} = v[0] || {}
actions.setFieldValue('receiverName',memberName)
......@@ -647,7 +647,7 @@ const Deatail: React.FC<{}> = () => {
]
/**
* @description: 选择商品 只是发货单的接口
* @description: 选择商品
* @param {type}
* @return {type}
*/
......@@ -656,8 +656,14 @@ const Deatail: React.FC<{}> = () => {
// message.error('请先选择发货单')
// return
// }
const res = await PublicApi.getOrderProcurementOrderProductPageList({...params,id: shipmentOrderID })
return res.data
if(shipmentOrderID){//发货单
const res = await PublicApi.getWarehouseInvoicesProductList({...params,invoicesId: shipmentOrderID })
return res.data
}else{//订单
const res = await PublicApi.getOrderProcurementOrderProductPageList({...params,id: invoicesId })
return res.data
}
// return new Promise((resolve, reject) => {
// const queryResult = data.find(v => v.key === params.keywords)
// setTimeout(() => {
......@@ -932,6 +938,7 @@ const Deatail: React.FC<{}> = () => {
visible={visibleObj.ModalSeletOrder3}
columns={columns3}
rowSelection={rowSelection}
rowKey={'id'}
fetchTableData={params => fetchProductList(params)}
formilyProps={
{
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-24 17:22:33
* @LastEditTime: 2020-09-26 14:10:04
*/
/**
* @description: 组件描述: 一级 二级 待提交报价单
......@@ -47,7 +47,7 @@ import { commonEnquieryOfferSchema } from '../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
/**
* @description: 按页面来 type一级为1 二级为2 待提交需求单3
* @description: 按页面来 type一级为1 二级为2 待提交报价单3
* @param {type}
* @return {type}
*/
......@@ -73,7 +73,7 @@ const List:React.FC<listParams> = (props) => {
const res = await PublicApi.getOrderQuotationToAuditTwoList(params);
return res.data
}
else if(props.type === 3){//待提交需求
else if(props.type === 3){//待提交报价
const res = await PublicApi.getOrderQuotationReviewedoList(params);
return res.data
}
......@@ -108,7 +108,7 @@ const List:React.FC<listParams> = (props) => {
dataIndex:'requisitionFormNo',
align:'center',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
// handleToDetail(1,records.id)//需求单id
handleToDetail(1,records.requisitionId)//需求单id
}}>{text}</EyePreview>
},
{
......
/*
* @Author: LeeJiancong
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-12 14:20:26
*/
/**
* @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 { 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.getOrderQuotationRequisitionFormList(params);
return res.data
}
/**
* @description:
* @param {type} 可以根据props.type处理
* @return {type}
*/
const handleToDetail= (id) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?page_type=${6}&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)
}
]
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
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