Commit cd9bda39 authored by XieZhiXiong's avatar XieZhiXiong
parents b6ec048a 25a5f615
......@@ -78,7 +78,7 @@ const memberCenterRoute = {
// MemberRoute,
// HandlingRoute,
marketingRoute,
...asyncRoutes,
// ...asyncRoutes,
{
path: '/memberCenter/noAuth',
auth: false,
......
......@@ -18,7 +18,7 @@ export const paltformSignRoute = [
},
// 平台营销活动详情
{
path: '/memberCenter/marketingAbility/paltformSign/search/detail',
path: '/memberCenter/marketingAbility/paltformSign/search/preview',
name: '平台营销活动详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
......@@ -48,7 +48,7 @@ export const paltformSignRoute = [
},
// 待提交审核报名资料详情
{
path: '/memberCenter/marketingAbility/paltformSign/readySubmitExamine/detail',
path: '/memberCenter/marketingAbility/paltformSign/readySubmitExamine/preview',
name: '待提交审核报名资料详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
......@@ -62,7 +62,7 @@ export const paltformSignRoute = [
},
// 待审核报名资料 (一级)详情
{
path: '/memberCenter/marketingAbility/paltformSign/readyExamineOne/detail',
path: '/memberCenter/marketingAbility/paltformSign/readyExamineOne/preview',
name: '待审核报名资料 (一级)详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
......@@ -76,7 +76,7 @@ export const paltformSignRoute = [
},
// 待审核报名资料 (二级)详情
{
path: '/memberCenter/marketingAbility/paltformSign/readyExamineTwo/detail',
path: '/memberCenter/marketingAbility/paltformSign/readyExamineTwo/preview',
name: '待审核报名资料 (二级)详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
......@@ -90,7 +90,7 @@ export const paltformSignRoute = [
},
// 待提交报名资料详情
{
path: '/memberCenter/marketingAbility/paltformSign/readySubmit/detail',
path: '/memberCenter/marketingAbility/paltformSign/readySubmit/preview',
name: '待提交报名资料详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
......
This diff is collapsed.
......@@ -166,22 +166,22 @@ export enum OrderModalType {
/**
* 询价报价下单
*/
INQUIRY_QUOTATION_ORDER = 7,
INQUIRY_QUOTATION_ORDER = 3,
/**
* 采购询价合同下单
*/
PURCHASE_ENQUIRY_CONTRACT_ORDER = 32,
PURCHASE_ENQUIRY_CONTRACT_ORDER = 12,
/**
* 采购招标合同下单
*/
PURCHASE_TENDER_CONTRACT_ORDER = 34,
PURCHASE_TENDER_CONTRACT_ORDER = 13,
/**
* 采购竞价合同下单
*/
PURCHASE_BIDDING_CONTRACT_ORDER = 33,
PURCHASE_BIDDING_CONTRACT_ORDER = 14,
}
......
......@@ -129,6 +129,11 @@ const OtherForm: React.FC<Iprops> = (props) => {
</Tooltip>
</span>
}
rules={[
{
validator: (r, v, c) => validatorByte(r, v, c, 100)
}
]}
>
<Input placeholder="最长50个汉字" />
</Form.Item>
......@@ -142,6 +147,11 @@ const OtherForm: React.FC<Iprops> = (props) => {
</Tooltip>
</span>
}
rules={[
{
validator: (r, v, c) => validatorByte(r, v, c, 400)
}
]}
>
<TextArea rows={4} placeholder="最长200个汉字" />
</Form.Item>
......@@ -155,6 +165,11 @@ const OtherForm: React.FC<Iprops> = (props) => {
</Tooltip>
</span>
}
rules={[
{
validator: (r, v, c) => validatorByte(r, v, c, 200)
}
]}
>
<Input placeholder="最长100个汉字" />
</Form.Item>
......
......@@ -136,8 +136,8 @@ const FormList = (props: any) => {
bidCount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 : item.purchaseCount,
bidAmount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 * item.taxUnitPrice : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 * item.price : item.price,
// productBrand
associatedType: _filter(sourceType, item, ['', '', '', '']),
associatedBrand: _filter(sourceType, item, ['', 'productAttributeJson', '', '']),
associatedType: _filter(sourceType, item, ['', 'productAttributeJson', '', '']).split('-')[1],
associatedBrand: _filter(sourceType, item, ['', 'productBrand', '', '']),
associatedDataId: _filter(sourceType, item, ['', 'productId', 'commoditySkuId']), // 关联商品id
associatedMaterielNo: _filter(sourceType, item, ['', 'number', 'commodityAttribute']), // 关联物料编号
associatedMaterielName: _filter(sourceType, item, ['', 'productName', 'commodityName']), // 关联商品名称
......@@ -147,6 +147,7 @@ const FormList = (props: any) => {
rowId: index,
}
})
console.log(data)
setData(data)
}
}).catch(err => {
......
......@@ -30,6 +30,8 @@ const Information = (props: any) => {
const rangePicker = [];
let startTime = moment(basic.startTime)
let endTime = moment(basic.endTime);
setstartTime(basic.startTime)
setendTime(basic.endTime)
rangePicker.push(startTime, endTime);
basic.rangePicker = rangePicker;
attrValueForm.setFieldsValue(basic)
......@@ -40,6 +42,8 @@ const Information = (props: any) => {
const rangePicker = [];
let startTime = moment(basic.startTime)
let endTime = moment(basic.endTime);
setstartTime(basic.startTime)
setendTime(basic.endTime)
rangePicker.push(startTime, endTime);
basic.rangePicker = rangePicker;
attrValueForm.setFieldsValue(basic)
......
......@@ -284,6 +284,7 @@ const AddNewBid:React.FC<AddNewBidProps> = (props) => {
}
if(pageStatus === PageStatus.EDIT) {
ctx.setFieldState('isOnlineEvaluation', state => state.props['x-component-props'].disabled = true)
ctx.setFieldState('*(memberName, inviteTenderInStatus, inviteTenderOutStatus, createTime)', state => state.visible = true)
}
......
......@@ -61,7 +61,7 @@ const readySubmitReportDetail: React.FC = () => {
offlineData.map(item => ({
memberId: item.memberId,
correctScore: item.modifyTotal,
evaluationTenderOfflineList: Object.keys(item).filter(ele => /^\d+$/.test(ele)).map(_ele => ({ templateContent: { id: _ele }, score: item[_ele] }))
evaluationTenderOfflineList: Object.keys(item).filter(ele => /^\d+$/.test(ele)).map(_ele => ({ templateContent: { id: _ele }, score: item[_ele] || 0 }))
}))
:
[]
......
......@@ -23,13 +23,13 @@ export interface ProgressProps {
const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
const { logstate } = props;
const context = useContext(Context);
console.log(context)
const [logStatesStatus, setLogStatesStatus] = useState<number>(1);
const [data, setData] = useState<any>({})
useEffect(() => {
if (!isEmpty(context)) {
setLogStatesStatus(context.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES)
console.log(context)
setLogStatesStatus(context.externalLogStates ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES)
setData(context)
}
}, [context])
......@@ -43,7 +43,7 @@ const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
{!isEmpty(data) && (
<Radio.Group
onChange={(e) => setLogStatesStatus(e.target.value)}
defaultValue={data.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES}
defaultValue={data.externalLogStates ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES}
>
{data.externalLogStates && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>}
{data.interiorLogStates && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>}
......
......@@ -108,7 +108,7 @@ const ActivityUserLayout: React.FC<ActivityUserLayoutProps> = (props: any) => {
}
ActivityUserLayout.defaultProps = {
title: "参与用户"
title: "参与活动用户"
}
export default ActivityUserLayout
import React, { useState } from 'react';
import { Row, Col, Avatar } from 'antd';
import Card from '@/pages/transaction/components/card';
import { isEmpty } from 'lodash';
const ColStyle = {
display: 'flex',
......@@ -15,34 +16,28 @@ const TextStyle = {
}
export interface DemandLayoutIProps {
// storeList?: any,
/** 商城列表 */
storeList?: any,
/** 标题 */
title?: string
}
const DemandLayout: React.FC<DemandLayoutIProps> = (props: any) => {
// const { storeList } = props;
const [storeList] = useState([
{ id: 1, logoUrl: '', name: 'WEB-渠道商城' },
{ id: 2, logoUrl: '', name: 'H5-渠道商城' },
{ id: 3, logoUrl: '', name: '小程序-渠道商城' },
{ id: 4, logoUrl: '', name: 'APP-渠道商城' },
{ id: 5, logoUrl: '', name: 'WEB-渠道自有商品商城' },
])
const { storeList } = props;
return (
<Card
id='demandLayout'
title='适用商城'
>
<Row gutter={[16, 16]}>
{storeList.map(item => (
{!isEmpty(storeList) && storeList.map(item => (
<Col
span={6}
key={item.id}
>
<div style={ColStyle}>
<Avatar size={32} src={item.logoUrl} style={{ color: '#FFFFFF', backgroundColor: '#00A98F' }}>logo</Avatar>
<span style={TextStyle}>{item.name}</span>
<Avatar size={32} src={item.logo} style={{ color: '#FFFFFF', backgroundColor: '#00A98F' }} />
<span style={TextStyle}>{item.shopName}</span>
</div>
</Col>
))}
......
/**
* 活动类型
*/
export enum ACTIVITYTYPE {
/** 特价促销 */
SALE = 1,
/** 直降促销 */
DOWNSALE,
/** 折扣促销 */
DISCOUNT,
/** 满量促销 */
FULLCAPACITY,
/** 满额促销 */
FULFILTHEQUOTA,
/** 赠送促销 */
PRESENTED,
/** 多件促销 */
EXCESSIVEPARTS,
/** 组合促销 */
GROUPS,
/** 拼团 */
TOURDIY,
/** 抽奖 */
LOTTERY,
/** 砍价 */
BARGAIN,
/** 秒杀 */
SECKILL,
/** 换购 */
GIFT,
/** 预售 */
PRESELL,
/** 套餐 */
SETMEAL,
/** 试用 */
TRYOUT,
}
/**
* 活动类型文字
*/
export const ACTIVITYTYPENAME = {
1: "特价促销",
2: "直降促销",
3: "折扣促销",
4: "满量促销",
5: "满额促销",
6: "赠送促销",
7: "多件促销",
8: "组合促销",
9: "拼团",
10: "抽奖",
11: "砍价",
12: "秒杀",
13: "换购",
14: "预售",
15: "套餐",
16: "试用",
}
......@@ -10,7 +10,7 @@ import RecordLyout from '@/pages/transaction/components/detailLayout/components/
import BasicLayout from '@/pages/transaction/components/detailLayout/components/basicLayout';
import moment from 'moment';
import { useEffect } from 'react';
import { ACTIVITYTYPE, ACTIVITYTYPENAME } from './constants';
import { ACTIVITYTYPENAME, GeneralEffect } from './constants';
import StatusTag from '@/components/StatusTag';
import ActivityUserLayout from '../../components/activityUserLayout';
import DemandLayout from '../../components/demandLayout';
......@@ -18,6 +18,7 @@ import ListLayout from '@/pages/transaction/components/detailLayout/components/l
import { ColumnType } from 'antd/lib/table/interface';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import { isEmpty } from 'lodash';
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
......@@ -36,7 +37,7 @@ const DetialLayout = () => {
const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
}
const [dataSource] = useState<any>(_data);
const [dataSource, setDataSource] = useState<any>({});
const [basicEffect, setBasicEffect] = useState<any>([]);
const [generalEffect, setGeneralEffect] = useState<any>([]);
......@@ -67,47 +68,10 @@ const DetialLayout = () => {
])
}
const handleGeneralEffect = (data: any) => {
setGeneralEffect([
{
col: [
{ label: '满量促销类型', extra: '' },
{ label: '满量减', extra: '' },
{ label: '赠送促销类型', extra: '' },
{ label: '优惠规则', extra: '' },
{ label: '换购类型', extra: '' },
{ label: '叠加活动类型', extra: <Space><StatusTag type="default" title='满量促销' /><StatusTag type="default" title='满额促销' /></Space> },
{ label: '成团人数', extra: '' },
{ label: '抽奖类型', extra: '' },
{ label: '抽奖次数', extra: '' },
{ label: '每次砍价金额', extra: '' },
{ label: '用户限制次数', extra: '' },
{ label: '每日秒杀时间段', extra: '' },
{ label: '定金支付时间', extra: '' },
{ label: '抽取用户时间', extra: '' },
{ label: '活动描述', extra: '活动期内仅允许用户以活动价格购买一件,超过一件用户须以原价购买' },
],
},
{
col: [
{ label: '赠品类型', extra: '' },
{ label: '叠加优惠券', extra: '允许叠加' },
{ label: '成团时间', extra: '' },
{ label: '每次砍价金额', extra: '' },
{ label: '尾款支付时间', extra: '' },
{ label: '试用结束时间', extra: '' },
],
},
{
col: [
{ label: '满量促销类型', extra: '' },
{ label: '满量折', extra: '' },
{ label: '超限规则', extra: '原价购买' },
{ label: '用户参团限制', extra: '' },
{ label: '开始发货时间', extra: '' },
],
},
])
const handleGeneralEffect = (data: any, int?: number) => {
if (!isEmpty(data)) {
setGeneralEffect(GeneralEffect(int, data))
}
}
const columns: ColumnType<any>[] = [
......@@ -166,17 +130,31 @@ const DetialLayout = () => {
]
const fetchDataSource = useCallback(async () => {
await PublicApi.getMarketingPlatformActivitySignupDetail({ activityId }).then(res => {
await PublicApi.getMarketingPlatformActivitySignupDetail({ activityId }).then((res: any) => {
if (res.code !== 1000) {
return
}
handleBasicEffect(res.data)
}).catch(() => {})
let { data } = res;
let externalLogStates: any = []
data.outerTaskStepList.forEach((item: any) => {
externalLogStates.push({
state: item.step,
stateName: null,
isExecute: item.isExecute,
operationalProcess: item.taskName,
roleName: item.roleName,
})
})
data.externalLogStates = externalLogStates;
setDataSource(data);
handleBasicEffect(data)
handleGeneralEffect(data.activityDefinedBO, data.activityType)
}).catch(() => { })
}, [])
useEffect(() => {
fetchDataSource();
handleGeneralEffect(_data);
// handleGeneralEffect(_data);
}, [])
return (
......@@ -202,7 +180,7 @@ const DetialLayout = () => {
columns={columns}
/>
<ActivityUserLayout />
<DemandLayout />
<DemandLayout storeList={dataSource.shopList} />
<RecordLyout />
</Fragment>
}
......
import React from 'react';
import React, { Fragment, useCallback, useState } from 'react';
import { Space, Tooltip } from 'antd';
import { history } from 'umi';
import { Context } from '@/pages/transaction/components/detailLayout/components/context';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
import ProgressLayout from '@/pages/transaction/components/detailLayout/components/progressLayout';
import GeneralLayout from '@/pages/transaction/components/detailLayout/components/generalLayout';
import RecordLyout from '@/pages/transaction/components/detailLayout/components/recordLyout';
import BasicLayout from '@/pages/transaction/components/detailLayout/components/basicLayout';
import moment from 'moment';
import { useEffect } from 'react';
import { ACTIVITYTYPENAME, GeneralEffect } from './constants';
import StatusTag from '@/components/StatusTag';
import ActivityUserLayout from '../../components/activityUserLayout';
import DemandLayout from '../../components/demandLayout';
import ListLayout from '@/pages/transaction/components/detailLayout/components/listLayout';
import { ColumnType } from 'antd/lib/table/interface';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import { isEmpty } from 'lodash';
import ProductListLayout from './components/productListLayout';
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
{ id: 'basicLayout', title: '基本信息' },
{ id: 'activityRuleLayout', title: '活动规则' },
{ id: 'activityProductLayout', title: '活动商品' },
{ id: 'activityUserLayout', title: '活动用户' },
{ id: 'applyMallLayout', title: '适用商城' },
{ id: 'recordLyout', title: '流转记录' },
]
const DetialLayout = () => {
const { query: { activityId }, pathname } = history.location;
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
}
const [dataSource, setDataSource] = useState<any>({});
const [basicEffect, setBasicEffect] = useState<any>([]);
const [generalEffect, setGeneralEffect] = useState<any>([]);
const handleBasicEffect = (data: any) => {
setBasicEffect([
{
col: [
{ label: '活动ID', extra: data.id },
{ label: '活动名称', extra: data.activityName },
{ label: '外部状态', extra: data.outerStatusName },
{ label: '内部状态', extra: data.innerStatusName },
]
},
{
col: [
{ label: '活动类型', extra: data.activityTypeName },
{ label: '活动参与类型', extra: data.activitySignUpTypeName },
{ label: '活动开始时间', extra: format(data.startTime) },
{ label: '活动结束时间', extra: format(data.endTime) },
]
},
{
col: [
{ label: '要求报名时间', extra: <>{format(data.signUpStartTime)}~{format(data.signUpEndTime)}</> },
]
},
])
}
const handleGeneralEffect = (data: any, int?: number) => {
if (!isEmpty(data)) {
setGeneralEffect(GeneralEffect(int, data))
}
}
const columns: ColumnType<any>[] = [
{
title: '商品图片',
key: '',
dataIndex: '',
},
{
title: '商品ID',
key: '',
dataIndex: '',
},
{
title: '商品名称',
key: '',
dataIndex: '',
},
{
title: '品类',
key: '',
dataIndex: '',
},
{
title: '品牌',
key: '',
dataIndex: '',
},
{
title: '单位',
key: '',
dataIndex: '',
},
{
title: '商品价格',
key: '',
dataIndex: '',
},
{
title: <Tooltip placement="top" title="活动价格表示商城直接以该商品的活动价格进行销售">
活动价格 <QuestionCircleOutlined />
</Tooltip>,
key: '',
dataIndex: '',
},
{
title: '个人限购数量',
key: '',
dataIndex: '',
},
{
title: '活动限购总数量',
key: '',
dataIndex: '',
},
]
const fetchDataSource = useCallback(async () => {
await PublicApi.getMarketingPlatformActivitySignupDetail({ activityId }).then((res: any) => {
if (res.code !== 1000) {
return
}
let { data } = res;
let externalLogStates: any = []
data.outerTaskStepList.forEach((item: any) => {
externalLogStates.push({
state: item.step,
stateName: null,
isExecute: item.isExecute,
operationalProcess: item.taskName,
roleName: item.roleName,
})
})
data.externalLogStates = externalLogStates;
setDataSource(data);
handleBasicEffect(data)
handleGeneralEffect(data.activityDefinedBO, data.activityType)
}).catch(() => { })
}, [])
useEffect(() => {
fetchDataSource();
// handleGeneralEffect(_data);
}, [])
function Add() {
return (
<div>
Add
</div>
);
<Context.Provider value={dataSource}>
<PeripheralLayout
no={dataSource.activityId}
detail={dataSource.activityName}
tabLink={TABLINK}
components={
<Fragment>
<ProgressLayout />
<BasicLayout effect={basicEffect} />
<GeneralLayout
visible
title={`活动规则-${ACTIVITYTYPENAME[dataSource.activityType]}`}
anchor="activityRuleLayout"
effect={generalEffect}
/>
<ProductListLayout data={dataSource} />
<ActivityUserLayout />
<DemandLayout storeList={dataSource.shopList} />
<RecordLyout />
</Fragment>
}
/>
</Context.Provider>
)
}
export default Add;
export default DetialLayout;
import React, { useState, useMemo, useEffect } from 'react';
import { Table } from 'antd';
import Card from '@/pages/transaction/components/card';
import { Columns } from '../columns';
import { isEmpty } from 'lodash';
interface ProductListLayoutProps {
/** 详情数据 */
data?: any,
}
const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
const { data } = props;
const [type, setType] = useState<number>(0);
const [dataSource, setDataSource] = useState<any>([{
productId: 1,
productName: '商品名称',
category: '品类',
brand: '品牌',
unit: '',
price: '',
}])
const columns = useMemo(() => {
return Columns(type || 1)
}, [type])
useEffect(() => {
if (!isEmpty(data)) {
setType(data.activityType)
}
}, [data])
return (
<Card
id="productListLayout"
title="活动商品"
>
<Table
columns={columns}
dataSource={dataSource}
/>
</Card>
)
}
export default ProductListLayout;
import React from 'react';
import { history } from 'umi';
import TableLayout from '../../../components/TableLayout';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
......@@ -23,7 +24,7 @@ const ReadySubmitExamine = () => {
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text) => <EyePreview>{text}</EyePreview>
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/preview?activityId=${record.activityId}`}>{text}</EyePreview>
},
{
title: '活动类型',
......@@ -78,7 +79,7 @@ const ReadySubmitExamine = () => {
render: (text, record) => (
<>
<Button type='link'>提交审核</Button>
<Button type='link'>填写报名资料</Button>
<Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/add?activityId=${record.activityId}`)}>填写报名资料</Button>
</>
)
},
......
......@@ -21,7 +21,7 @@ const Search = () => {
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/search/detail?activityId=${record.activityId}`}>{text}</EyePreview>
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/search/preview?activityId=${record.activityId}`}>{text}</EyePreview>
},
{
title: '活动类型',
......
......@@ -39,7 +39,8 @@ const Add = () => {
const _handleSave = async () => {
const basicRef = await basicForm.current.get();
console.log(basicRef)
const rulesRef = await rulesForm.current.get()
console.log(basicRef, rulesRef)
}
return (
......
......@@ -948,6 +948,22 @@ const AddFormRule: React.FC<AddFormRuleProps> = (props: any) => {
const [form] = Form.useForm();
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
form.validateFields().then(res => {
resolve({
state: true,
name: 'rules',
data: { ...res },
})
}).catch(err => {
console.log(err)
})
})
}
})
useEffect(() => {
form.resetFields();
}, [ruleType])
......
......@@ -42,7 +42,7 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
memberId: data[0].memberId,
memberRoleId: data[0].memberRoleId,
productIds: data.map(item => item.productId),
orderModel: schemaAction.getFieldValue('orderModel')
orderMode: schemaAction.getFieldValue('orderMode')
}, { ctlType: 'none' })
// 将询价报价单的id字段 冗余给商品列表
......
......@@ -51,7 +51,7 @@ const MemberModalTable:React.FC<MemberModalTableProps> = (props) => {
visible={visible}
confirm={handleConfirm}
cancel={() => setVisible(false)}
fetchTableData={(params) => fetchOrderApi.getMemberListByModelType({...params, orderType: schemaAction.getFieldValue('orderModel')})}
fetchTableData={(params) => fetchOrderApi.getMemberListByModelType({...params, orderType: schemaAction.getFieldValue('orderMode')})}
rowSelection={rowSelection}
modalType='memberByDefault'
tableProps={{
......
......@@ -140,7 +140,7 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
memberId: rowSelectionCtl.selectRow[0].memberId,
memberRoleId: rowSelectionCtl.selectRow[0].memberRoleId,
productIds: rowSelectionCtl.selectedRowKeys,
orderModel: schemaAction.getFieldValue('orderModel')
orderMode: schemaAction.getFieldValue('orderMode')
}, { ctlType: 'none' })
if (res.code === 1000) {
......@@ -155,7 +155,7 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
}
const fetchProductList = (values) => {
const modelType = schemaAction.getFieldValue('orderModel')
const modelType = schemaAction.getFieldValue('orderMode')
const supplyMembersId = schemaAction.getFieldValue('supplyMembersId')
const params = {
...values,
......
......@@ -50,7 +50,7 @@ export const createEffects = context => () => {
export const useModelTypeChange = (callback) => {
const utils = useLinkageUtils()
// 下单模式发生改变时
FormEffectHooks.onFieldValueChange$('orderModel').subscribe(state => {
FormEffectHooks.onFieldValueChange$('orderMode').subscribe(state => {
callback(state)
})
}
......@@ -72,7 +72,7 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
const { value } = state
// 强制渲染一次, 用于触发金额总数
update()
const orderModel = ctx.getFieldValue('orderModel')
const orderMode = ctx.getFieldValue('orderMode')
if (value && value.length > 0 && !state.loading){ // 添加loading判断避免二次调用
// 请求一次并复制给支付信息
const productItem = value[0]
......@@ -83,7 +83,7 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
productId: productItem.productId,
memberId: productItem?.memberId || ctx.getFieldValue('supplyMembersId'),
memberRoleId: productItem?.memberRoleId || ctx.getFieldValue('supplyMembersRoleId'),
orderModel: orderModel,
orderMode: orderMode,
shopId: ctx.getFieldValue('shopId')
}).then(data => {
ctx.setFieldValue('paymentInformationResponses', data)
......
......@@ -116,7 +116,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
let resultState = {}
if (modelType) {
resultState = {
orderModel: parseInt(modelType)
orderMode: parseInt(modelType)
}
}
return resultState
......@@ -153,7 +153,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
if (modelType) {
shopDataRef.current.orderModel = parseInt(modelType)
shopDataRef.current.orderMode = parseInt(modelType)
}
return () => {
......@@ -378,7 +378,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
effects={($, ctx) => {
$('onFormMount').subscribe(() => {
if (id || modelType) {
ctx.setFieldState('orderModel', state => {
ctx.setFieldState('orderMode', state => {
state.editable = false
// state.props["x-component-props"] = {
// disabled: true
......@@ -399,7 +399,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
productSumPriceRef.current = payload
})
$('onFieldInputChange', 'orderModel').subscribe(state => {
$('onFieldInputChange', 'orderMode').subscribe(state => {
const { editable, value } = state
// 处理商城类型选项 报价单文案 支付信息栏隐藏
if(value) {
......@@ -446,7 +446,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
useOrderUpdateChangeOther(ctx)
$('onFieldValueChange', 'quotationNo').subscribe(state => {
const modelType = ctx.getFieldValue('orderModel')
const modelType = ctx.getFieldValue('orderMode')
if(state.value && modelType === OrderModalType["CONSOLIDATED_ORDER"]) {
addSchemaAction.setFieldState('orderProductRequests', productState => {
productState.props["x-component-props"] = {
......
......@@ -49,7 +49,7 @@ export const useDetailOrder = (options: DetailOptionsProps) => {
useEffect(() => {
// 页面中有传入下单模式, 需要手动回显数据
if (modelType) {
addSchemaAction.setFieldValue('orderModel', parseInt(modelType))
addSchemaAction.setFieldValue('orderMode', parseInt(modelType))
}
// 在有传入商品列表时 需手动回显
if (proList.length > 0) {
......
......@@ -9,7 +9,7 @@ import { OrderModalType } from '@/constants/order';
const { pageStatus } = usePageStatus()
let orderModel = null;
let orderMode = null;
// 对象按key排序(运用于商城传过来的阶梯价格排序)
export const sortByKey = (params) => {
......@@ -72,7 +72,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const productRef = useRef<any>({})
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'})
orderModel = ctx.getFieldValue('orderModel')
orderMode = ctx.getFieldValue('orderMode')
const handleDelete = (record) => {
const newData = [...ctx.getFieldValue('orderProductRequests')]
......@@ -98,7 +98,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
// 渲染单价
productInfoColumns[5].render = (t, r) => {
if(orderModel === OrderModalType["HAND_ORDER"]) {
if(orderMode === OrderModalType["HAND_ORDER"]) {
return <PriceComp priceSection={r.unitPrice}/>
} else {
return r.price ? <span style={{color: 'red'}}>{r.price}</span> : <PriceComp priceSection={r.unitPrice}/>
......@@ -106,7 +106,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
}
// 渲染商品ID
productInfoColumns[0].render = (t, r) => {
if(orderModel === OrderModalType["HAND_ORDER"]) {
if(orderMode === OrderModalType["HAND_ORDER"]) {
return r.id
} else {
return r.productId || r.id
......@@ -154,7 +154,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const item = newData[index];
row['money'] = getUnitPriceTotal(row)
// 通过下单模式判断 是否是手工或者渠道手工下单
let addModel = ctx.getFieldValue("orderModel")
let addModel = ctx.getFieldValue("orderMode")
row['productId'] = (pageStatus === PageStatus.ADD) ? row.id : row.productId
newData.splice(index, 1, {
...item,
......
......@@ -32,7 +32,7 @@ const basicInfo: ISchema = {
wrapperCol: 10
},
properties: {
orderModel: {
orderMode: {
type: 'string',
required: true,
enum: GlobalConfig.web.orderMode.map(v => { delete v.platformType; return v}),
......
......@@ -35,7 +35,7 @@ const ContractModalTable:React.FC<ContractModalTableProps> = (props) => {
if(visible) {
/** 这里分 询价 竞价 招标 三种采购合同类型 */
let sourceType = null;
switch (schemaAction.getFieldValue('orderModel')) {
switch (schemaAction.getFieldValue('orderMode')) {
case OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER:
sourceType = 3;
break;
......@@ -53,10 +53,11 @@ const ContractModalTable:React.FC<ContractModalTableProps> = (props) => {
const handleConfirm = async () => {
const item = rowSelectionCtl.selectRow[0]
if (item) {
schemaAction.setFieldValue('quotationNo', item.contractNo)
schemaAction.setFieldValue('contractNo', item.sourceNo)
schemaAction.setFieldValue('sourceType', item.sourceType)
schemaAction.setFieldValue('purchaseType', 1)
// schemaAction.setFieldValue('quotationNo', item.sourceNo)
schemaAction.setFieldValue('contractNo', item.contractNo)
schemaAction.setFieldValue('contract', item)
// schemaAction.setFieldValue('sourceType', item.sourceType)
// schemaAction.setFieldValue('purchaseType', 1)
const { data } = await fetchOrderApi.getContractPurchaseMaterielList({
contractId: item.id,
current: 1,
......@@ -69,7 +70,7 @@ const ContractModalTable:React.FC<ContractModalTableProps> = (props) => {
// memberId: data[0].memberId,
// memberRoleId: data[0].memberRoleId,
// productIds: data.map(item => item.productId),
// orderModel: schemaAction.getFieldValue('orderModel')
// orderMode: schemaAction.getFieldValue('orderMode')
// }, { ctlType: 'none' })
// 字段转换
......@@ -100,13 +101,13 @@ const ContractModalTable:React.FC<ContractModalTableProps> = (props) => {
temp.memberRoleId = item.partyBRoleId
return temp
})
// 把地址信息冗余给商品字段render
schemaAction.setFieldValue('products', newData)
schemaAction.setFieldValue('vendorMemberName', item.partyBName)
schemaAction.setFieldValue('vendorMemberId', item.partyBMemberId)
schemaAction.setFieldValue('vendorRoleId', item.partyBRoleId)
schemaAction.setFieldValue('digest', item.contractAbstract)
schemaAction.setFieldValue('contractId', item.id)
// schemaAction.setFieldValue('contractId', item.id)
}
confirmModal && confirmModal()
setVisible(false)
......
......@@ -128,7 +128,7 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
memberId: schemaAction.getFieldValue('vendorMemberId'),
memberRoleId: schemaAction.getFieldValue('vendorRoleId'),
productIds: rowSelectionCtl.selectRow.map(item => item.associatedDataId),
orderModel: schemaAction.getFieldValue('orderModel')
orderMode: schemaAction.getFieldValue('orderMode')
}, { ctlType: 'none' })
if (res.code === 1000) {
......
......@@ -93,7 +93,7 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
const reload = () => {
fetchOrderApi.getInvoicesList().then(data => {
if(!data.length) {
form.setFieldValue("needTheInvoice", 0)
form.setFieldValue("hasInvoice", true)
}
// 订单新增 重载全部置为第一个
let _data = data.sort((a, b) => b.id - a.id)
......
......@@ -51,21 +51,19 @@ export const procurementProcessField = (value) => {
value.products = value.products.map(item => {
return {
...item,
productId: item.quotedSkuId,
productName: item.quotedName,
brand: item.quotedBrand,
category: item.quotedCategory,
unit: item.unit,
price: item.price,
deliveryType: item.logistics.deliveryType,
// 物料信息
materialId: item.productId,
materialCode: item.productNo,
materialName: item.name,
materialSpec: item.spec,
materialType: item.type,
materialCategory: item.category,
materialBrand: item.brand,
productId: item.id,
productNo: item.code,
// brand: item.quotedBrand,
// category: item.quotedCategory,
// unit: item.unit,
// price: item.price,
// deliveryType: item.logistics.deliveryType,
// 关联商品信息
quotedSkuId: item.relevanceProductId,
quotedName: item.relevanceProductName,
quotedSpec: item.relevanceProductType,
materialCategory: item.relevanceProductCategory,
materialBrand: item.relevanceProductBrand,
}
})
return value
......@@ -107,12 +105,19 @@ export const orderTypeLabel = ['',
'渠道现货',
]
export const orderTypeLabelMap = () => {
let tempObject: { [key: number]: string } = {}
GlobalConfig['web']['orderMode'].map(item => {
tempObject[item['value']] = item['label']
})
return tempObject;
// export const orderTypeLabelMap = () => {
// let tempObject: { [key: number]: string } = {}
// GlobalConfig['web']['orderMode'].map(item => {
// tempObject[item['value']] = item['label']
// })
// return tempObject;
// }
export const orderTypeLabelMap = {
'3': '询价采购',
'12': '采购询价合同',
'13': '采购竞价合同',
'14': '采购招标合同',
}
// 支付方式
......@@ -274,13 +279,13 @@ export const materialInfoColumns: any[] = [
key: 'id',
className: 'commonHide'
},
{
title: '物料ID',
dataIndex: 'materialId',
align: 'center',
key: 'materialId',
className: 'commonHide'
},
// {
// title: '物料ID',
// dataIndex: 'materialId',
// align: 'center',
// key: 'materialId',
// className: 'commonHide'
// },
{
title: '物料编号',
dataIndex: 'code',
......
......@@ -8,7 +8,7 @@ import moment from 'moment';
export const useModelTypeChange = (callback) => {
const utils = useLinkageUtils()
// 下单模式发生改变时
FormEffectHooks.onFieldValueChange$('orderModel').subscribe(state => {
FormEffectHooks.onFieldValueChange$('orderMode').subscribe(state => {
callback(state)
})
}
......@@ -31,7 +31,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
useProductAddress(ctx)
})
FormEffectHooks.onFieldValueChange$('needTheInvoice').subscribe(state => {
FormEffectHooks.onFieldValueChange$('hasInvoice').subscribe(state => {
if (state.value) {
useInvoiceList(ctx)
}
......@@ -90,7 +90,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
...values,
deliveryTime: moment(values.deliveryTime).valueOf(),
theInvoiceId: value?.id || null,
needTheInvoice: Number(values.needTheInvoice),
hasInvoice: Number(values.hasInvoice),
deliveryAddresId: values.deliveryAddresId,
id,
}, { ctlType: "none" })
......@@ -115,7 +115,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
...values,
deliveryTime: moment(values.deliveryTime).valueOf(),
theInvoiceId: values.theInvoiceId,
needTheInvoice: Number(values.needTheInvoice),
hasInvoice: Number(values.hasInvoice),
deliveryAddresId: value?.id ? value.id : value,
id,
}, { ctlType: "none" })
......
......@@ -25,6 +25,8 @@ import styles from './index.less'
import { useMaterialTable } from './model/useMaterialTable'
import ContractModalTable from './components/contractModalTable'
import MaterialModalTable from './components/materialModalTable'
import { PATTERN_MAPS } from '@/constants/regExp'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
export interface PurchaseOrderDetailProps {}
......@@ -41,6 +43,13 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
const addSchemaAction = createFormActions()
// 获取下单模式
const fetchOrderMode = async () => {
const { data } = await PublicApi.getOrderBuyerCreatePageItems()
const { orderModes } = data
return orderModes
}
// 总计金额联动框
export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
const { form } = useFormSpy({ selector: [['onFieldValueChange', 'products']], reducer: v => v })
......@@ -73,14 +82,13 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const [formLoading, setFormLoading] = useState(false)
const [btnLoading, setBtnLoading] = useState(false)
const update = useUpdate()
const productSumPriceRef = useRef<any>(0)
const { pageStatus, id, page_type = '0', modelType } = usePageStatus()
const [initFormSchema, setInitFormSchema] = useState<any>(() => ({...mergeAllSchemas[page_type]}))
const [initFormValue, setInitFormValue] = useState<any>(() => {
let resultState = {}
if (modelType) {
resultState = {
orderModel: parseInt(modelType)
orderMode: parseInt(modelType)
}
}
return resultState
......@@ -110,7 +118,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
})
}
if (modelType) {
shopDataRef.current.orderModel = parseInt(modelType)
shopDataRef.current.orderMode = parseInt(modelType)
}
return () => {
clearInterval(timerSignature)
......@@ -124,6 +132,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
let fnResult = null
// 新增订单/编辑订单
const params = { ...value }
console.log(value)
// 校验采购数量
const judgementByCount = params.products?.length && params.products.map(item => {
......@@ -137,16 +146,92 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
throw new Error('请填写商品采购数量')
}
// 使用发票即校验发票id
if(params.needInvoice && !params.theInvoiceId) {
if(params.hasInvoice && !params.theInvoiceId) {
throw new Error('请新增或选择需要使用的发票')
}
setBtnLoading(true)
/** 字段转换 */
// 合同下单 取供应商默认的发货地址
const { data: deliveryAddress} = await PublicApi.getLogisticsSelectListMemberShipperAddress({
memberId: params.vendorMemberId,
roleId: params.vendorRoleId
})
console.log(deliveryAddress)
params.products = params.products.map(item => {
// const address = deliveryAddress.filter(item => item.isDefault)[0]
const address = deliveryAddress[0]
return {
...item,
deliveryType: item.logistics,
addressId: address.id,
address: address.fullAddress,
receiver: address.shipperName,
phone: address.phone,
}
})
// 发票数据字段转换
if(params.hasInvoice) {
params.invoice = {
invoiceId: params.theInvoiceId.id,
invoiceKind: params.theInvoiceId.kind,
invoiceType: params.theInvoiceId.type,
title: params.theInvoiceId.invoiceTitle,
taxNo: params.theInvoiceId.taxNo,
bank: params.theInvoiceId.bankOfDeposit,
account: params.theInvoiceId.account,
address: params.theInvoiceId.address,
phone: params.theInvoiceId.tel,
defaultInvoice: params.theInvoiceId.isDefault,
}
}
// 合同数据字段转换
params.contract = {
contractId: params.contract.id,
contractNo: params.contract.contractNo,
digest: params.contract.contractAbstract,
effectDate: params.contract.startTime,
expireDate: params.contract.endTime,
partB: params.contract.partyBName,
contractType: params.contract.sourceType,
leftAmount: params.contract.freeAmount,
receiptNo: params.contract.sourceNo,
}
// 交付地址数据字段转换拼接 查询省市区冗余
const { data: addressDetail} = await PublicApi.getLogisticsReceiverAddressGet({
id: params.deliveryAddresId.id
})
const { data: countryCode } = await PublicApi.getManageCountryAreaGetTelCode({})
params.consignee = {
deliverDate: params.deliveryTime,
consigneeId: params.deliveryAddresId.id,
consignee: params.deliveryAddresId.receiverName,
provinceCode: addressDetail.provinceCode,
cityCode: addressDetail.cityCode,
districtCode: addressDetail.districtCode,
address: addressDetail.address,
postalCode: addressDetail.postalCode,
countryCode: countryCode[0],
phone: addressDetail.phone,
telephone: addressDetail.tel,
defaultConsignee: addressDetail.isDefault,
}
// 其他需求
params.requirement = {
pageRequire: params.pageRequire,
restsRequire: params.restsRequire,
}
if(id) {
fnResult = await PublicApi.postOrderProcurementOrderUpdate({...params, id})
fnResult = await PublicApi.postOrderBuyerCreateSrmUpdate({...params, id})
} else {
const _params = procurementProcessField(params)
fnResult = await PublicApi.postOrderPurchaseContractAdd(_params)
console.log(_params)
fnResult = await PublicApi.postOrderBuyerCreateSrm(_params)
}
if (fnResult.code === 1000) {
setTimeout(() => {
......@@ -225,9 +310,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
TheInvoiceList,
}}
effects={($, ctx) => {
useAsyncSelect('orderMode', fetchOrderMode, ['text', 'id'])
$('onFormMount').subscribe(() => {
if (id || modelType) {
ctx.setFieldState('orderModel', state => {
ctx.setFieldState('orderMode', state => {
state.editable = false
})
}
......@@ -236,7 +322,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
useModelTypeChange(state => {
const { value } = state
// 选择某种类型时, 需显示对应的订单类型
ctx.setFieldValue('type', orderTypeLabelMap()[value])
ctx.setFieldValue('type', orderTypeLabelMap[value])
})
useEditHideField()
......
......@@ -49,7 +49,7 @@ export const useDetailOrder = (options: DetailOptionsProps) => {
useEffect(() => {
// 页面中有传入下单模式, 需要手动回显数据
if (modelType) {
addSchemaAction.setFieldValue('orderModel', parseInt(modelType))
addSchemaAction.setFieldValue('orderMode', parseInt(modelType))
}
// 在有传入商品列表时 需手动回显
if (proList.length > 0) {
......
......@@ -9,7 +9,7 @@ import { OrderModalType } from '@/constants/order';
const { pageStatus } = usePageStatus()
let orderModel = null;
let orderMode = null;
// 对象按key排序(运用于商城传过来的阶梯价格排序)
export const sortByKey = (params) => {
......@@ -33,7 +33,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
const materialRef = useRef<any>({})
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'})
orderModel = ctx.getFieldValue('orderModel')
orderMode = ctx.getFieldValue('orderMode')
const handleDelete = (record) => {
const newData = [...ctx.getFieldValue('products')]
......
......@@ -32,7 +32,7 @@ const basicInfo: ISchema = {
wrapperCol: 10
},
properties: {
orderModel: {
orderMode: {
type: 'string',
required: true,
enum: GlobalConfig.web.orderMode.map(v => { delete v.platformType; return v}),
......@@ -41,13 +41,13 @@ const basicInfo: ISchema = {
// 联动显示合同编号字段
{
type: 'value:visible',
"target": "quotationNo",
"target": "contractNo",
"condition": `{{orderCombination.showPurchaseContractField.includes($value)}}`
},
// 联动显示选择合同按钮
{
type: "value:schema",
"target": "quotationNo",
"target": "contractNo",
condition: `{{!!$value && orderCombination.showPurchaseContractBtn.includes($value)}}`,
schema: {
"x-component-props": {
......@@ -79,7 +79,7 @@ const basicInfo: ISchema = {
}
]
},
quotationNo: {
contractNo: {
type: 'string',
title: '对应合同编号',
visible: false,
......@@ -151,26 +151,31 @@ const basicInfo: ISchema = {
title: '外部状态',
visible: false
},
contractId: {
type: 'number',
title: '采购合同ID',
visible: false
},
contractNo: {
type: 'string',
title: '合同下单的合同编号',
visible: false
},
sourceType: {
type: 'number',
title: '合同下单的寻源类型',
visible: false
},
purchaseType: {
type: 'number',
title: '合同下单的是否有限制下单金额',
contract: {
type: 'object',
title: '采购合同信息',
visible: false
},
}
// contractId: {
// type: 'number',
// title: '采购合同ID',
// visible: false
// },
// quotationNo: {
// type: 'string',
// title: '对应单据',
// visible: false
// },
// sourceType: {
// type: 'number',
// title: '合同下单的寻源类型',
// visible: false
// },
// purchaseType: {
// type: 'number',
// title: '合同下单的是否有限制下单金额',
// visible: false
// },
}
},
......@@ -261,10 +266,10 @@ const submitInfo: ISchema = {
"x-rules": [
{
required: true,
message: '请选择收货方式'
message: '请选择交付地址'
}
],
title: '收货方式'
title: '交付地址'
}
}
}
......@@ -289,8 +294,8 @@ const ortherInfo: ISchema = {
wrapperCol: 10
},
properties: {
needTheInvoice: {
type: 'number',
hasInvoice: {
type: 'boolean',
"x-component": 'CheckboxSingle',
"x-component-props": {
children: '需要发票',
......@@ -299,12 +304,12 @@ const ortherInfo: ISchema = {
}
},
title: '发票',
default: 0,
default: false,
"x-linkages": [
{
type: 'value:visible',
target: 'theInvoiceId',
condition: "{{!!$value}}"
condition: "{{$value}}"
}
]
},
......
......@@ -18,6 +18,7 @@ import '../index.less'
import ModalForm from '@/components/ModalForm'
import { createFormActions } from '@formily/antd'
import { GlobalConfig } from '@/global/config'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
// 待新增订单
const approvedActions = createFormActions()
......@@ -26,10 +27,16 @@ export interface ReadyAddOrderProps {}
const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderBuyerCreatePage(params)
// const { data } = await PublicApi.getOrderProcurementStayAddList(params)
return data
}
// 获取下单模式
const fetchOrderMode = async () => {
const { data } = await PublicApi.getOrderBuyerCreatePageItems()
const { orderModes } = data
return orderModes
}
const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
const { run: deleteRun } = useHttpRequest(PublicApi.postOrderProcurementOrderDeleteAll)
const { loading: submitLoading, run: submitRun } = useHttpRequest(PublicApi.postOrderProcurementOrderSubmitExamineAll)
......@@ -72,10 +79,10 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
approvedActions.submit().then(async ({values}) => {
console.log(values)
currentRef.current.setVisible(false)
if(values.orderModel === OrderModalType.INQUIRY_QUOTATION_ORDER) {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/b2b/add?modelType=${values.orderModel}`)
if(values.orderMode === OrderModalType.INQUIRY_QUOTATION_ORDER) {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/b2b/add?modelType=${values.orderMode}`)
} else {
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/srm/add?modelType=${values.orderModel}`)
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/srm/add?modelType=${values.orderMode}`)
}
})
}
......@@ -156,11 +163,12 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
labelAlign: 'top',
},
properties: {
orderModel: {
orderMode: {
type: 'string',
title: '选择下单模式',
required: true,
enum: GlobalConfig.web.orderMode.map(v => { delete v.platformType; return v}),
// enum: GlobalConfig.web.orderMode.map(v => { delete v.platformType; return v}),
enum: [],
"x-component-props": {
placeholder: '请选择下单模式'
}
......@@ -170,9 +178,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
}
}}
effects={($, ctx) => {
$('onFormInit').subscribe(() => {
})
useAsyncSelect('orderMode', fetchOrderMode, ['text', 'id'])
}}
/>
</PageHeaderWrapper>
......
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