Commit 37aad49b authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents e883398b 5858580a
......@@ -3,7 +3,7 @@
* @Date: 2020-07-31 19:56:22
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-07 14:59:52
* @LastEditTime: 2020-09-08 17:19:23
*/
const TranactionRoute = {
......@@ -69,6 +69,13 @@ const TranactionRoute = {
name:'enquirySubmit',
key:'enquirySubmit',
routes:[
//需求单查询
{
path:'/memberCenter/tranactionAbility/enquirySubmit/enquirySearch',
name:'enquirySearch',
key:'enquirySearch',
component: '@/pages/transaction/enquirySubmit/enquirySearch'
},
{
path:'/memberCenter/tranactionAbility/enquirySubmit/toAddSubmitList',
name:'toAddSubmitList',
......@@ -107,7 +114,9 @@ const TranactionRoute = {
name:'toSubmit',
key:'toSubmit',
component: '@/pages/transaction/enquirySubmit/toSubmit'
}
},
]
},
// 采购订单
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-07 15:02:47
* @LastEditTime: 2020-09-08 17:20:34
*/
export default {
......@@ -110,11 +110,11 @@ export default {
'menu.tranactionAbility.stockSellStorage.addBills': '新增单据',
'menu.tranactionAbility.stockSellStorage.inventory': '库存',
'menu.tranactionAbility.enquirySubmit': '需求发布',
'menu.tranactionAbility.enquirySubmit.enquirySearch': '需求单查询',
'menu.tranactionAbility.enquirySubmit.toAddSubmitList': '待新增需求单',
'menu.tranactionAbility.enquirySubmit.addEnquiry': '新增需求单',
'menu.tranactionAbility.enquirySubmit.viewEnquiryDetail': '需求单详情',
'menu.tranactionAbility.enquirySubmit.enquiryOne': '待审核报价单(一级)',
'menu.tranactionAbility.enquirySubmit.viewEnquiryDetail': '需求报价单',
'menu.tranactionAbility.enquirySubmit.enquiryTwo': '待审核报价单(二级)',
'menu.tranactionAbility.enquirySubmit.toSubmit': '待提交需求单',
'menu.tranactionAbility.purchaseOrder': '采购订单',
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:32:05
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-08 11:06:06
* @LastEditTime: 2020-09-08 16:53:26
*/
import React, { Component, useEffect, useState, ReactNode, useRef } from 'react';
import { Row, Col, Modal, Table, Tooltip, Input, Select, Button, Popconfirm, Card, Tag, Badge, Steps, Tabs, } from 'antd'
......@@ -55,6 +55,8 @@ const detailInfo: React.FC<{}> = () => {
const [pagetype, setpagetype] = useState(history.location.query.page_type)
let interiorStateList = []
let [isextraOption, setIsextraOption] = useState(false)
const [otherList, setotherList] = useState([])//动态tab循环
const [productSource, setproductSource] = useState([])//商品列表 新增
let [dataInfo, setdataInfo] = useState<any>({
status: '',
externalState: 0,
......@@ -238,7 +240,7 @@ const detailInfo: React.FC<{}> = () => {
key: 'brand',
align: 'center'
},
// ...otherList,
...otherList,
{
title: '单位',
dataIndex: 'purchaseNuit',
......@@ -345,8 +347,47 @@ const detailInfo: React.FC<{}> = () => {
}
})
})
})
//商品列表
PublicApi.getOrderRequisitionFormProductAll({ id: id }).then(res => {
if (res.code === 1000) {
let { data } = res
//商品
let source = []
let otherColumnkey = []//动态列的展示
data.forEach((v)=> {
let obj:any = {}
obj.model = v.model
obj.id = v.id
obj.brand = v.brand
obj.purchaseNuit = v.purchaseNuit
obj.purchaseQuantity = v.purchaseQuantity
if(v.productAttributeJson){
JSON.parse(v.productAttributeJson).forEach(child => {
Object.keys(child).forEach(key => {
//获取列头
otherColumnkey.push({
title: key,
dataIndex: key,
key: key,
align:'center'
})
// console.log('key',key,child,child[key])
obj[key] = child[key]
})
});
}
source.push(obj)
})
setotherList([...otherColumnkey])//生成列
setproductSource([...source])
}
})
}
/**
......@@ -354,9 +395,9 @@ const detailInfo: React.FC<{}> = () => {
* @param {type}
* @return {type}
*/
useEffect(() => {
init()
},[dataInfo.interiorState])
// useEffect(() => {
// init()
// },[dataInfo.interiorState])
const formTime = (text) => {
return <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
......@@ -595,7 +636,7 @@ const detailInfo: React.FC<{}> = () => {
<div className={style['mainCol-title']}>
采购商品
</div>
<Table dataSource={dataInfo.detailList} columns={equiryColumns} pagination={false} />
<Table rowKey={'id'} dataSource={productSource} columns={equiryColumns} pagination={false} />
</Col>
<Col className={style['mainCol']} span={24}>
<div className={style['mainCol-title']}>
......
......@@ -3,7 +3,12 @@
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-07 16:01:17
* @LastEditTime: 2020-09-08 17:14:00
*/
/**
* @description: 组件描述: 一级 二级 待提交需求单
* @param {type}
* @return {type}
*/
import React, { ReactNode, useRef, useState,useEffect } from 'react';
import { history } from 'umi';
......
/*
* @Author: LeeJiancong
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-08 17:37:24
*/
/**
* @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} 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 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=${props.type}&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'
}
]
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)
}}
expressionScope={{
controllerBtns
}}
schema={enquierySchema}
>
</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