Commit 2ca0ea28 authored by LeeJiancong's avatar LeeJiancong

'page_type的判断,新增需求报价模块'

parent 5eef93d5
......@@ -3,13 +3,7 @@
* @Date: 2020-07-13 14:36:02
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-19 15:34:24
*/
/*
* @Author: Ljc
* @Date: 2020-07-10 16:15:28
* @Last Modified by: ljc
* @Last Modified time: 2020-07-10 16:15:28
* @LastEditTime: 2020-08-24 16:50:42
*/
const LogisticsRoute = {
path: '/memberCenter/logisticsAbility',
......
/*
* @Author: LeeJiancong
* @Date: 2020-07-31 19:56:22
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-24 15:21:43
*/
const TranactionRoute = {
path: '/memberCenter/tranactionAbility',
......@@ -56,6 +63,19 @@ const TranactionRoute = {
component: '@/pages/transaction/stockSellStorage/inventory/index',
},
]
},
{
path:'/memberCenter/tranactionAbility/enquirySubmit',
name:'enquirySubmit',
key:'enquirySubmit',
routes:[
{
path:'/memberCenter/tranactionAbility/enquirySubmit/SearchList',
name:'SearchList',
key:'SearchList',
component: '@/pages/transaction/enquirySubmit/toSubmit'
}
]
}
]
......
export interface MemberType {
id: number;
typeName: string;
}
export interface BusinessType {
id: number;
typeName: string;
}
export interface UseType {
memberType: MemberType[];
businessType: BusinessType[];
}
export interface UserRegister {
useType: UseType;
}
export interface ShopInfo {
id: number;
name: string;
type: number;
environment: number;
logoUrl: string;
describe: string;
state: number;
url: string;
}
export interface Web {
shopInfo: ShopInfo[];
}
export interface PayConfig {
paymemberConfig?: any;
}
export interface CountryList {
name: string;
key: string;
icon: string;
}
export interface Global {
siteId: number;
siteUrl: string;
logo: string;
countryList: CountryList[];
}
export interface RootObject {
userRegister: UserRegister;
web: Web;
payConfig: PayConfig;
global: Global;
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-20 10:22:52
* @LastEditTime: 2020-08-24 15:26:39
*/
export default {
......@@ -94,6 +94,8 @@ export default {
'menu.tranactionAbility.stockSellStorage.bills': '单据',
'menu.tranactionAbility.stockSellStorage.addBills': '新增单据',
'menu.tranactionAbility.stockSellStorage.inventory': '库存',
'menu.tranactionAbility.enquirySubmit': '需求发布',
'menu.tranactionAbility.enquirySubmit.SearchList': '需求发布',
//物流能力
'menu.logisticsAbility': '物流',
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-05 16:36:51
* @LastEditTime: 2020-08-24 20:13:06
*/
import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'
......@@ -61,7 +61,7 @@ for (let i = 10; i < 36; i++) {
}
const diaLogForm: React.FC<ListProps> = (props) => {
const type: string = history.location.query.type
const type: string = history.location.query.page_type
const [areaCode, setAreaCode] = useState<number>(null)
const [Options, setOptions] = useState([])
const [state, setState] = useState({ editable: true })
......@@ -89,7 +89,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
const formSubmit = (values) => {
console.log(values)
let id = history.location.query.id //0新建
let type = history.location.query.type //'1' 发货 '2'收货
let type = history.location.query.page_type //'1' 发货 '2'收货
let value = { ...values }
value.isDefault = values.isDefault ? 1 : 0
value.provinceCode = value.provinceCode.split('-').length > 1 ? value.provinceCode.split('-')[0] : value.provinceCode
......@@ -167,7 +167,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
const id = Number(history.location.query.id)
console.log(typeof(id))
let title = id === 0 ? '新建' : '编辑'
history.location.query.type == '1' ? setHeaderTitle(`${title}发货地址`) : setHeaderTitle(`${title}收货地址`)
history.location.query.page_type == '1' ? setHeaderTitle(`${title}发货地址`) : setHeaderTitle(`${title}收货地址`)
PublicApi.getManageGetTelCode().then(res => {
res.data.forEach((item,index) => {
TelCodeList.push({ label: item, value: (index).toString() })
......@@ -185,7 +185,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
})
},1000)
if (id != 0 && history.location.query.type == '1') {
if (id != 0 && history.location.query.page_type == '1') {
PublicApi.getLogisticsShipperAddressGet({ id: id.toString() }).then(res => {
if (res.code == 1000) {
let data = res.data
......@@ -209,7 +209,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
}
//收货
if (id != 0 && history.location.query.type == '2') {
if (id != 0 && history.location.query.page_type == '2') {
PublicApi.getLogisticsReceiverAddressGet({ id: id.toString() }).then(res => {
if (res.code == 1000) {
let data = res.data
......@@ -317,7 +317,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
>
<FormMegaLayout labelCol={4} labelAlign="left">
{
history.location.query.type == '1' ?
history.location.query.page_type == '1' ?
<Field
required
title="发货人"
......@@ -341,7 +341,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
/>
}
<FormMegaLayout label={history.location.query.type == '1' ? '发货地区' : '收货地区'} grid full autoRow required>
<FormMegaLayout label={history.location.query.page_type == '1' ? '发货地区' : '收货地区'} grid full autoRow required>
<Field
x-mega-props={{ span: 1 }}
x-component="Select"
......
/*
* @Author: LeeJiancong
* @Date: 2020-08-01 11:06:09
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-24 17:31:43
*/
export const TimeList = [
{
label: '单据时间(全部)', value: 0
},
{
label: '今天', value: 1
},
{
label: '一周内', value: 2
},
{
label: '一个月内', value: 3
},
{
label: '三个月内', value: 4
},
{
label: '六个月内', value: 5
},
{
label: '一年内', value: 6
},
{
label: '一年前', value: 7
}
]
import { ISchema} from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import {TimeList} from '../../common/statusList'
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-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:'查询'
}
}
}
}
}
}
import React, { ReactNode, useRef, useState } from 'react';
import { history } from 'umi';
import {
Button,
Card,
Space,
Row,
Col
} from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import {
PlusOutlined
} 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 NiceForm from '@/components/NiceForm';
import {timeRange} from '@/utils/index'
import { createFormActions, FormEffectHooks } from '@formily/antd';
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';
const formActions = createFormActions();
const fetchData = async (params: any) => {
const res = await PublicApi.getOrderRequisitionFormAwaitList(params);
return res.data
}
const List:React.FC<{}> = () => {
const ref = useRef<any>({})
const [more, setmore] = useState(false)
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'
},
{
title:'报价截至时间',
key:'quotationAsTime',
dataIndex:'quotationAsTime',
align:'center'
},
{
title:'单据时间',
key:'voucherTime',
dataIndex:'voucherTime',
align:'center'
},
{
title:'外部状态',
key:'externalState',
dataIndex:'externalState',
align:'center'
},
{
title:'内部状态',
key:'interiorState',
dataIndex:'interiorState',
align:'center'
},
{
title:'操作',
key:'options',
dataIndex:'options',
align:'center',
render:(text:any,record:any) => <></>
},
]
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 controllerBtns = <Row gutter={[0,16]}>
<Col span={24}>
<Space direction="horizontal" size={16}>
<Button type="primary" icon={<PlusOutlined/>}>新建</Button>
<Button >批量提交审核</Button>
<Button onClick={() => setmore(!more)}>更多</Button>
</Space>
</Col>
{
more &&
<Col >
<Space direction="horizontal" size={16}>
<Button>批量删除</Button>
</Space>
</Col>
}
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{rowKew:'id'}}
fetchTableData={(params: any) => fetchData(params)}
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
/*
* @Author: LeeJiancong
* @Date: 2020-07-22 09:54:50
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-24 16:09:13
*/
import { Config } from 'god-yapi2ts'
......@@ -10,6 +17,7 @@ const tokens = [
'7ec923520215c7e2f771867cb4d29cafbf823daf0fb2d3d9fa70b57a523c8bfb', // 店铺服务
'c789e0e56ee8a8cc2fbd85f930eb2928c58fc1014583c6643acf29cff954da49', // 支付服务
'ca19f532efba91f7773cbfbd526b798c6ac83df670071e97d72c50dca1d53a48', // 搜索服务
'5de0aaeaac12c8d911d86dada6cd128993e34cd6e13135fa79246aa5979a2bcd' //订单服务
]
const genMap = (tokens) => {
......
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