Commit ef6a34a3 authored by GuanHua's avatar GuanHua
parents 1ecb20b3 b83be64f
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-05 10:28:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-03 19:17:17
* @LastEditTime: 2021-09-10 10:27:19
* @Description: 地址选择 FormItem
*/
import React, { useState, useEffect, useMemo, useRef } from 'react';
......@@ -489,8 +489,8 @@ const AddressSelect: React.FC<IProps> = (props) => {
label: `${item.name} ${item.fullAddress} ${item.phone}`,
}));
}, [list]);
if (!editable && value) {
if (!editable) {
const current = list.find((item) => item.id === value.id);
const full = current ? `${current.name} ${current.fullAddress} ${current.phone}` : null;
const isStr = typeof value === 'string';
......
......@@ -7,6 +7,7 @@ import { PublicApi } from '@/services/api';
interface MemberRole {
memberRoleId: number;
memberRoleName: string;
roleType: number,
};
const Roles: React.FC = () => {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-17 10:22:51
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-20 14:19:21
* @LastEditTime: 2021-09-10 16:40:02
* @Description: 退货发货抽屉
*/
......@@ -92,6 +92,10 @@ export type ValuesType = {
* 未退货发货数量
*/
noDeliveryCount: number,
/**
* 数据id
*/
returnDetailId: number,
}[],
/**
* 退货发货地址
......@@ -148,6 +152,10 @@ type ProductListItemType = {
* 退货数量
*/
count: number,
/**
* 数据id
*/
returnDetailId: number,
}
export type AfterType = 2 | 3
......
......@@ -295,7 +295,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
) : null}
{radioValue === '2' ? (
<>
<Tabs>
<Tabs defaultActiveKey={detailed ? `${detailed[detailed.length - 1].batch}` : ''}>
{detailed.map((item) => (
<TabPane
tab={`第 ${item.batch} 批次`}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-17 13:53:35
* @LastEditTime: 2021-09-10 16:58:46
* @Description:
*/
import React, { useState } from 'react';
......@@ -39,6 +39,7 @@ const ExchangePrDeliverVerify: React.FC = () => {
productList: productList.map((item) => ({
productId: item.productId,
returnCount: +item.count,
returnDetailId: item.returnDetailId,
})),
deliveryTime: moment(deliveryTime).valueOf(),
logisticsName: logisticsNameTxt,
......@@ -94,6 +95,7 @@ const ExchangePrDeliverVerify: React.FC = () => {
receiveCount: item.receiveCount,
subCount: item.subCount,
count: item.noDeliveryCount,
returnDetailId: item.detailId,
}))
),
}}
......
......@@ -39,6 +39,7 @@ const ReturnPrDeliverVerify: React.FC = () => {
productList: productList.map((item) => ({
productId: item.productId,
returnCount: +item.count,
returnDetailId: item.returnDetailId,
})),
deliveryTime: moment(deliveryTime).valueOf(),
logisticsName: logisticsNameTxt,
......@@ -95,6 +96,7 @@ const ReturnPrDeliverVerify: React.FC = () => {
receiveCount: item.receiveCount,
subCount: item.subCount,
count: item.noDeliveryCount,
returnDetailId: item.returnDetailId,
}))
),
}}
......
......@@ -254,7 +254,6 @@ const AddProducts: React.FC<{}> = (props) => {
return e
}
_params.unitPriceAndPicList = _productAttributeAndImageParams
console.log(_productAttributeAndImageParams, productAttributeAndImageParams, '001')
} else { // 编辑时没有点击商品图片(新增没有点击也就没有数据)
if(productInfoByEdit){
_params.unitPriceAndPicList = productInfoByEdit.unitPriceAndPicList
......@@ -271,7 +270,6 @@ const AddProducts: React.FC<{}> = (props) => {
}
})
}
console.log(_params.unitPriceAndPicList, priceAttributeParams, '001')
}
}
......
......@@ -415,7 +415,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
/* 生成传输数据 */
const constructedPrarams = () => {
let _paramsArray: any[] = [];
console.log(combineAttributeArray, 'combineAttributeArray')
Array.isArray(combineAttributeArray) ? combineAttributeArray.map((item, index)=>{ // 非数组情况下默认无组合 从table数据中获取 // 当属性减少的时候 这个combine数组还是之前的 /* code1 */
let _tempArr: any = []
Array.isArray(item) ? item.map((_item, _index) => { /* code2 */
......@@ -425,7 +424,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
id: attributeObjArr[_index].customerAttributeId,
name: attributeObjArr[_index].attributeName
}
console.log(attributeObjArr, attributeValObjArr, item, index, _item, _index, _tableDataSource, '调试属性')
// console.log(attributeObjArr, attributeValObjArr, item, index, _item, _index, _tableDataSource, '调试属性')
// @fixed bug: 属性名称相同的情况下 只找第一个元素 会出现id异常
let filterData = null
for(let i = 0; i < attributeValObjArr.length; i++) {
......@@ -435,7 +434,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
break;
}
}
console.log(filterData, 'fff')
_tempObject.customerAttributeValue = {
// @fixed bug: 属性名称相同的情况下 只找第一个元素 会出现id异常
id: filterData?.id ? filterData.id : null,
......
import React, { useRef } from 'react';
import React, { useRef, useState, useEffect } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import { history } from 'umi';
import { Tag, Button, Modal } from 'antd';
import { Tag, Button, Modal, Form, Select, Typography } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { INQUIRYSEARCHSCHEMA } from './schema';
import { EXTERNALSTATE_COLOR } from '@/pages/transaction/components/stateColor';
import { setAuth, setRouters } from '@/utils/auth';
import { setAuth, setRouters, getAuth } from '@/utils/auth';
import { isEmpty } from '@antv/util';
const InquirySearch = () => {
interface MemberRole {
memberRoleId: number;
memberRoleName: string;
roleType: number,
};
const InquirySearch = () => {
const reload = useRef<any>({});
const [form] = Form.useForm();
const [role, setRole] = useState<MemberRole[]>([]);
const [isModalVisible, setVisible] = useState<boolean>(false);
const [orderId, setOrderId] = useState<string>('');
const [isId, setIsId] = useState<number>()
const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
}
/** 二次询价 */
const secondInquiry = (id) => {
const handleFieldsAPI = (memberRoleId: number, id?) => {
PublicApi.postMemberLoginSwitchrole({
memberRoleId: 11,
}).then(res => {
memberRoleId,
}).then((res: any) => {
if (res.code !== 1000) {
return;
}
......@@ -34,6 +44,26 @@ const InquirySearch = () => {
}).catch(err => { })
}
/** 二次询价 */
const secondInquiry = (id, orderId) => {
const userInfo: any = getAuth() || {};
const roles = userInfo.roles.filter(_item => _item.roleType === 2);
setRole(roles);
setOrderId(orderId);
setIsId(id)
if (!isEmpty(roles)) {
if (roles.length === 1) {
handleFieldsAPI(roles[0].memberRoleId, id);
} else {
setVisible(true)
}
} else {
Modal.info({
content: '当前登录会员没有服务消费者角色,无法进行二次询价。'
})
}
}
const columns: ColumnType<any>[] = [
{
title: '询价单号',
......@@ -85,7 +115,7 @@ const InquirySearch = () => {
<Button disabled={record.isQuoted === 1} onClick={() => history.push(`/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer/offer?id=${record.id}`)} type='link'>报价</Button>
)}
{(record.isShowSecondInquiry === true) && (
<Button type='link' onClick={() => secondInquiry(record.id)}>二次询价</Button>
<Button type='link' onClick={() => secondInquiry(record.id, record.inquiryListNo)}>二次询价</Button>
)}
{(record.isShowSecondInquiry === false) && (
<Button
......@@ -101,15 +131,58 @@ const InquirySearch = () => {
}
];
useEffect(() => {
if (isModalVisible) {
form.setFieldsValue({ 'memberRoleId': role[0].memberRoleId })
}
}, [isModalVisible])
const handleSubmit = () => {
form.validateFields().then(res => {
handleFieldsAPI(res.memberRoleId, isId)
})
}
return (
<Table
schema={INQUIRYSEARCHSCHEMA}
columns={columns}
effects="inquiryListNo"
fetch={PublicApi.getTransactionProductInquiryList}
reload={reload}
externalStatusFetch={PublicApi.getTransactionQuotationtInquiryExternalStateEnum()}
/>
<>
<Table
schema={INQUIRYSEARCHSCHEMA}
columns={columns}
effects="inquiryListNo"
fetch={PublicApi.getTransactionProductInquiryList}
reload={reload}
externalStatusFetch={PublicApi.getTransactionQuotationtInquiryExternalStateEnum()}
/>
{!isEmpty(role) && (
<Modal
title='选择会员角色'
visible={isModalVisible}
onOk={handleSubmit}
onCancel={() => setVisible(false)}
>
<Form
form={form}
layout='vertical'
>
<Form.Item>
当前询价单<Typography.Text type='danger'>{orderId}</Typography.Text>二次询价生成的询价单可通过会员角色:<Typography.Text type='danger'>{role[0].memberRoleName}</Typography.Text>进行查看。
</Form.Item>
<Form.Item
label='会员角色'
tooltip='二次询价的会员角色'
name='memberRoleId'
rules={[{ required: true, message: '请选择会员角色' }]}
>
<Select>
{role.map((_item, _i) => (
<Select.Option key={`role${_i}`} value={_item.memberRoleId}>{_item.memberRoleName}</Select.Option>
))}
</Select>
</Form.Item>
</Form>
</Modal>
)}
</>
)
}
......
......@@ -121,6 +121,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const handleCancel = async (id) => {
destoryRef.current.setVisible(true)
destroyActions.reset()
destroyActions.setFieldValue('orderId', id)
}
......
......@@ -227,10 +227,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const address = deliveryAddress[0]
return {
...item,
addressId: address.id,
address: address.fullAddress,
receiver: address.shipperName,
phone: address.phone,
addressId: address.id || null,
address: address.fullAddress || null,
receiver: address.shipperName || null,
phone: address.phone || null,
}
})
......
......@@ -25,7 +25,7 @@ import ContractModalTable from './components/contractModalTable'
import MaterialModalTable from './components/materialModalTable'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
export interface PurchaseOrderDetailProps {}
export interface PurchaseOrderDetailProps { }
const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...props}>
{props.children}
......@@ -156,10 +156,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
spec: item.type,
quotedSpec: item.relevanceProductType,
deliveryType: item.logistics,
addressId: address.id,
address: address.fullAddress,
receiver: address.shipperName,
phone: address.phone,
addressId: address.id || null,
address: address.fullAddress || null,
receiver: address.shipperName || null,
phone: address.phone || null,
}
})
......
......@@ -83,7 +83,6 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
// 单个转单
const handelTransformOrder = (r) => {
console.log(r)
transformRef.current.setVisible(true)
transformActions.setFieldValue('orders', [
{ id: 1, orderNo: 'TYBHU', digest: '666', vendorMemberName: '999', createTime: '2015-12-20 20:15:12', amount: '123'},
......@@ -93,7 +92,7 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
// 批量转单
const handleSubmitTransform = () => {
alert('批量转单')
}
/** 参照后台数据生成 */
......@@ -136,7 +135,7 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
</Space>
registerVirtualBox("CustomTitle", ({ children, schema }) => {
return <p>当前勾运了3张订单进行转单,转单后生成的采购订单可通过账号“广州中石科技采购商角色”进行查看</p>
return <p>当前勾运了<b> 3 </b>张订单进行转单,转单后生成的采购订单可通过会员角色<b> 采购商角色 </b>进行查看</p>
})
return <PageHeaderWrapper>
......@@ -276,6 +275,23 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
schema={{
type: 'object',
properties: {
roleType: {
type: 'number',
title: '会员角色(转单采购)',
enum: [
{
label: '采购商(默认)',
value: 1
},
{
label: '渠道采购商',
value: 2
}
],
"x-component-props": {
require: true,
}
},
NOT_SUBMIT_TITLE: {
type: 'object',
"x-component": "CustomTitle",
......
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