Commit 4fb61718 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

'处理冲突'

parents 793fe144 64c7d643
import React, { useState, useEffect } from 'react';
import { Input, Space, Select, Button, Cascader } from 'antd';
import { useFieldState, FormPath, FormEffectHooks, useFormEffects } from '@formily/antd';
/**
* 筛选项 搜索和远程数据结合的 Cascader
* 属性Data数据暂存至schema的props下的dataOption
*/
const CustomCategorySearch = props => {
const justifyAlign = props.props['x-component-props'].align || 'flex-end'
const option = props.props['x-component-props'].dataoption
const [dataOption, setDataOption] = useState<any>([])
const [value, setValue] = useState<any>([])
useEffect(() => {
setDataOption(option)
}, [option])
useFormEffects(() => {
FormEffectHooks.onFormReset$().subscribe(() => {
setValue([])
})
})
const onChange = (value, selectedOptions) => {
props.mutators.change(value[value.length - 1])
setValue(value)
}
const displayRender = (label) => {
return label[label.length - 1];
}
return (
<Space size={20} style={{ justifyContent: justifyAlign, width: '100%' }}>
<Cascader
options={dataOption}
onChange={onChange}
value={value}
displayRender={displayRender}
{...props.props['x-component-props']}
/>
</Space>
);
};
CustomCategorySearch.defaultProps = {};
CustomCategorySearch.isFieldComponent = true;
export default CustomCategorySearch;
...@@ -8,7 +8,8 @@ import CustomStatus from './components/CustomStatus'; ...@@ -8,7 +8,8 @@ import CustomStatus from './components/CustomStatus';
import CustomAddArray from './components/CustomAddArray'; import CustomAddArray from './components/CustomAddArray';
import CustomSlider from './components/CustomSlider'; import CustomSlider from './components/CustomSlider';
import Search from './components/Search'; import Search from './components/Search';
import CustomInputSearch from './components/CustomInputSearch' import CustomInputSearch from './components/CustomInputSearch';
import CustomCategorySearch from './components/CustomCategorySearch';
import Submit from './components/Submit'; import Submit from './components/Submit';
import Text from './components/Text'; import Text from './components/Text';
import CardCheckBox from './components/CardCheckBox'; import CardCheckBox from './components/CardCheckBox';
...@@ -86,6 +87,7 @@ export const componentExport = { ...@@ -86,6 +87,7 @@ export const componentExport = {
CustomRadio, CustomRadio,
Search, Search,
CustomInputSearch, CustomInputSearch,
CustomCategorySearch,
Submit, Submit,
Text, Text,
CardCheckBox, CardCheckBox,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-09-29 15:04:46 * @Date: 2020-09-29 15:04:46
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-11 16:39:17 * @LastEditTime: 2020-12-24 10:55:51
* @Description: 外部流转记录 * @Description: 外部流转记录
*/ */
import React from 'react'; import React from 'react';
...@@ -43,9 +43,9 @@ const OuterCirculationRecord: React.FC<OuterCirculationRecordProps> = ({ ...@@ -43,9 +43,9 @@ const OuterCirculationRecord: React.FC<OuterCirculationRecordProps> = ({
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'statusName', dataIndex: 'status',
align: 'center', align: 'center',
render: (text, record) => <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.status]} title={text} /> render: (text, record) => <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.statusCode]} title={text} />
}, },
{ {
title: '操作', title: '操作',
......
...@@ -11,7 +11,7 @@ import { createFormActions, FormEffectHooks } from '@formily/antd'; ...@@ -11,7 +11,7 @@ import { createFormActions, FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetAsReplaceGoodsPageReturnedGoodsResponse } from '@/services/AfterServiceApi'; import { GetAsReplaceGoodsPageReturnedGoodsResponse } from '@/services/AfterServiceApi';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils'; import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import { PurchaseOrderInsideWorkStateTexts, ORDER_TYPE2 } from '@/constants'; import { PurchaseOrderOutWorkStateTexts, ORDER_TYPE2 } from '@/constants';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
...@@ -89,7 +89,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({ ...@@ -89,7 +89,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
title: '订单状态', title: '订单状态',
dataIndex: 'externalState', dataIndex: 'externalState',
align: 'center', align: 'center',
render: text => PurchaseOrderInsideWorkStateTexts[text], render: text => PurchaseOrderOutWorkStateTexts[text],
}, },
{ {
title: '订单类型', title: '订单类型',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-04 18:22:57 * @Date: 2020-11-04 18:22:57
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-11 17:15:08 * @LastEditTime: 2020-12-24 10:55:25
* @Description: 内、外部流转记录 * @Description: 内、外部流转记录
*/ */
import React from 'react'; import React from 'react';
...@@ -60,10 +60,10 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHisto ...@@ -60,10 +60,10 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHisto
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'statusName', dataIndex: 'status',
align: 'center', align: 'center',
render: (text, record) => ( render: (text, record) => (
<StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.status]} title={text} /> <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.statusCode]} title={text} />
), ),
}, },
{ {
......
...@@ -11,7 +11,7 @@ import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; ...@@ -11,7 +11,7 @@ import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetAsReturnGoodsPageReturnedGoodsResponse } from '@/services/AfterServiceApi'; import { GetAsReturnGoodsPageReturnedGoodsResponse } from '@/services/AfterServiceApi';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils'; import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import { PurchaseOrderInsideWorkStateTexts, ORDER_TYPE2 } from '@/constants'; import { PurchaseOrderOutWorkStateTexts, ORDER_TYPE2 } from '@/constants';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
...@@ -93,7 +93,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({ ...@@ -93,7 +93,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
title: '订单状态', title: '订单状态',
dataIndex: 'externalState', dataIndex: 'externalState',
align: 'center', align: 'center',
render: text => PurchaseOrderInsideWorkStateTexts[text], render: text => PurchaseOrderOutWorkStateTexts[text],
}, },
{ {
title: '订单类型', title: '订单类型',
......
...@@ -21,7 +21,12 @@ export const searchBrandOptionEffect = (context: any, fieldName: string) => { ...@@ -21,7 +21,12 @@ export const searchBrandOptionEffect = (context: any, fieldName: string) => {
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => { export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => { context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => { // PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// context.setFieldState(fieldName, state => {
// state.props['x-component-props'].dataoption = res.data
// })
// })
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
context.setFieldState(fieldName, state => { context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data state.props['x-component-props'].dataoption = res.data
}) })
......
...@@ -66,17 +66,14 @@ export const goodsSchema: ISchema = { ...@@ -66,17 +66,14 @@ export const goodsSchema: ISchema = {
}, },
customerCategoryId: { customerCategoryId: {
type: 'string', type: 'string',
'x-component': 'CustomInputSearch', 'x-component': 'CustomCategorySearch',
'x-component-props': { 'x-component-props': {
placeholder: '商品品类', placeholder: '商品品类',
showSearch: true, showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null, notFoundContent: null,
style: { width: '174px' }, style: { width: '174px' },
searchValue: null, dataoption: [],
dataoption: [] fieldNames: { label: 'title', value: 'id', children: 'children' },
}, },
}, },
batch: { batch: {
......
...@@ -21,7 +21,12 @@ export const searchBrandOptionEffect = (context: any, fieldName: string) => { ...@@ -21,7 +21,12 @@ export const searchBrandOptionEffect = (context: any, fieldName: string) => {
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => { export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => { context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => { // PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// context.setFieldState(fieldName, state => {
// state.props['x-component-props'].dataoption = res.data
// })
// })
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
context.setFieldState(fieldName, state => { context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data state.props['x-component-props'].dataoption = res.data
}) })
......
...@@ -75,17 +75,14 @@ export const channelSchema: ISchema = { ...@@ -75,17 +75,14 @@ export const channelSchema: ISchema = {
}, },
customerCategoryId: { customerCategoryId: {
type: 'string', type: 'string',
'x-component': 'CustomInputSearch', 'x-component': 'CustomCategorySearch',
'x-component-props': { 'x-component-props': {
placeholder: '商品品类', placeholder: '商品品类',
showSearch: true, showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null, notFoundContent: null,
style: { width: 100 }, style: { width: '174px' },
searchValue: null, dataoption: [],
dataoption: [] fieldNames: { label: 'title', value: 'id', children: 'children' },
}, },
}, },
source: { source: {
......
...@@ -82,17 +82,14 @@ export const productSchema: ISchema = { ...@@ -82,17 +82,14 @@ export const productSchema: ISchema = {
}, },
customerCategoryId: { customerCategoryId: {
type: 'string', type: 'string',
'x-component': 'CustomInputSearch', 'x-component': 'CustomCategorySearch',
'x-component-props': { 'x-component-props': {
placeholder: '商品品类', placeholder: '商品品类',
showSearch: true, showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null, notFoundContent: null,
style: { width: '174px' }, style: { width: '174px' },
searchValue: null, dataoption: [],
dataoption: [] fieldNames: { label: 'title', value: 'id', children: 'children' },
}, },
}, },
statusList: { statusList: {
...@@ -225,17 +222,14 @@ export const fastSchema: ISchema = { ...@@ -225,17 +222,14 @@ export const fastSchema: ISchema = {
}, },
customerCategoryId: { customerCategoryId: {
type: 'string', type: 'string',
'x-component': 'CustomInputSearch', 'x-component': 'CustomCategorySearch',
'x-component-props': { 'x-component-props': {
placeholder: '商品品类', placeholder: '商品品类',
showSearch: true, showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null, notFoundContent: null,
style: { width: '174px' }, style: { width: '174px' },
searchValue: null, dataoption: [],
dataoption: [] fieldNames: { label: 'title', value: 'id', children: 'children' },
}, },
}, },
"[min, max]": { "[min, max]": {
......
...@@ -65,7 +65,12 @@ export const searchBrandOptionEffect = (context: any, fieldName: string) => { ...@@ -65,7 +65,12 @@ export const searchBrandOptionEffect = (context: any, fieldName: string) => {
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => { export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => { context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => { // PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// context.setFieldState(fieldName, state => {
// state.props['x-component-props'].dataoption = res.data
// })
// })
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
context.setFieldState(fieldName, state => { context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data state.props['x-component-props'].dataoption = res.data
}) })
......
...@@ -36,16 +36,16 @@ import { repositSchema } from './schema'; ...@@ -36,16 +36,16 @@ import { repositSchema } from './schema';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect'; import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from './effects'; import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from './effects';
import { treeReduction } from '@/utils';
const formActions = createFormActions(); const formActions = createFormActions();
// 模拟请求 // 模拟请求
const fetchData = async (params: any) => { const fetchData = async (params: any) => {
console.log(params)
if(params?.category) { if(params?.category) {
formActions.getFieldState('category', state => { formActions.getFieldState('category', state => {
let categorys = state.props['x-component-props'].dataoption let categorys = treeReduction(state.props['x-component-props'].dataoption)
params.category = categorys.filter(i => i.id === params.category)[0].name params.category = categorys[params.category]['title']
}) })
} }
if(params?.brand) { if(params?.brand) {
......
...@@ -116,17 +116,14 @@ export const repositSchema: ISchema = padRequiredMessage({ ...@@ -116,17 +116,14 @@ export const repositSchema: ISchema = padRequiredMessage({
}, },
category: { category: {
type: 'string', type: 'string',
'x-component': 'CustomInputSearch', 'x-component': 'CustomCategorySearch',
'x-component-props': { 'x-component-props': {
placeholder: '商品品类', placeholder: '商品品类',
showSearch: true, showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null, notFoundContent: null,
style: { width: '160px' }, style: { width: '174px' },
searchValue: null, dataoption: [],
dataoption: [] fieldNames: { label: 'title', value: 'id', children: 'children' },
}, },
}, },
// category: { // category: {
......
...@@ -246,7 +246,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -246,7 +246,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
if(current === 1) { if(current === 1) {
const payOrderUrls = formRef.current.urlList const payOrderUrls = formRef.current.urlList
const checkedId = checked.id const checkedId = checked.id
if (!payOrderUrls || payOrderUrls.length === 0) { if (!payOrderUrls || payOrderUrls.length === 0 || payOrderUrls.includes('')) {
message.error('请先上传凭证') message.error('请先上传凭证')
return; return;
} }
......
...@@ -287,10 +287,9 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -287,10 +287,9 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 确认全部发货单已收到回单 // 确认全部发货单已收到回单
const handelReciveReturnOrder = async () => { const handelReciveReturnOrder = async () => {
const res = await PublicApi.getOrderIsDeliveryCompleted({id: data.id}) const res = await PublicApi.getOrderIsDeliveryCompleted({id: data.id}, {ctlType: "none"})
const { code } = res
let tip = '' let tip = ''
if(code === 1000) if(res.data)
tip = '是否确认本单全部发货单已收到回单?' tip = '是否确认本单全部发货单已收到回单?'
else else
tip = '您还有未发货的商品,是否确认全部发货都已完成?' tip = '您还有未发货的商品,是否确认全部发货都已完成?'
...@@ -306,10 +305,9 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -306,10 +305,9 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 继续发货 // 继续发货
const handleContinueDeliver = async () => { const handleContinueDeliver = async () => {
const res = await PublicApi.getOrderIsDeliveryCompleted({id: data.id}) const res = await PublicApi.getOrderIsDeliveryCompleted({id: data.id}, {ctlType: 'none'})
const { code } = res
let tip = '' let tip = ''
if(code === 1000) if(res.data)
tip = '您商品都已发货.是否确认还需要继续发货?' tip = '您商品都已发货.是否确认还需要继续发货?'
else else
tip = '是否继续发货?' tip = '是否继续发货?'
......
...@@ -97,12 +97,12 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => { ...@@ -97,12 +97,12 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
modelRef.current.setVisible(true) modelRef.current.setVisible(true)
} }
const [amountMoney, setAmountMoney] = useState<number>(sumPrice || sum + freePrice) const [amountMoney, setAmountMoney] = useState<number>((sumPrice*1000)/1000 || (sum*1000 + freePrice*1000)/1000)
// 总计金额 // 总计金额
useEffect(() => { useEffect(() => {
console.log(sumPrice || (sum*1000 + freePrice*1000)/1000, 'iiiiii') console.log((sumPrice*1000)/1000 || (sum*1000 + freePrice*1000)/1000, 'iiiiii')
setAmountMoney(() => sumPrice || (sum*1000 + freePrice*1000)/1000) setAmountMoney(() => (sumPrice*1000)/1000 || (sum*1000 + freePrice*1000)/1000)
}, [sum, freePrice, sumPrice]) }, [sum, freePrice, sumPrice])
const handleConfirm = () => { const handleConfirm = () => {
......
...@@ -16,17 +16,22 @@ const ReadyConfirmReturnOrderDetail: React.FC = () => { ...@@ -16,17 +16,22 @@ const ReadyConfirmReturnOrderDetail: React.FC = () => {
const { run, loading } = useHttpRequest(PublicApi.postOrderReceiptOrderConfirmedAll) const { run, loading } = useHttpRequest(PublicApi.postOrderReceiptOrderConfirmedAll)
// 提交表单 // 提交表单
const handleSubmit = useCallback(async () => { // const handleSubmit = useCallback(async () => {
const params = { // const params = {
id: Number(id), // id: Number(id),
state: 1 // state: 1
} // }
const result = await run(params) // const result = await run(params)
// if (result.code === 1000) {
// history.goBack()
// }
// }, [])
if (result.code === 1000) { const handleSubmit = () => {
history.goBack() const deleveBox = document.querySelector('#deleveBox') as any
window.scrollTo(0, deleveBox.offsetTop)
} }
}, [])
return ( return (
<div> <div>
...@@ -34,11 +39,11 @@ const ReadyConfirmReturnOrderDetail: React.FC = () => { ...@@ -34,11 +39,11 @@ const ReadyConfirmReturnOrderDetail: React.FC = () => {
<OrderDetailHeader <OrderDetailHeader
detailList={detailList} detailList={detailList}
detailData={formContext.data} detailData={formContext.data}
// extraRight={ extraRight={
// <Button type='primary' onClick={handleSubmit} loading={loading}> <Button type='primary' onClick={handleSubmit} loading={loading}>
// 确认全部已回单 确认全部已回单
// </Button> </Button>
// } }
/> />
<OrderDetailWrapper> <OrderDetailWrapper>
......
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-12-22 18:01:50 * @Date: 2020-12-22 18:01:50
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-22 18:01:51 * @LastEditTime: 2020-12-24 11:01:22
* @Description: 单据列表 弹窗表格列 * @Description: 单据列表 弹窗表格列
*/ */
import moment from 'moment';
import { import {
ORDER_TYPE2, ORDER_TYPE2,
PurchaseOrderInsideWorkStateTexts, PurchaseOrderInsideWorkStateTexts,
...@@ -109,6 +110,7 @@ export const machiningWarehousingColumns = [ ...@@ -109,6 +110,7 @@ export const machiningWarehousingColumns = [
title: '单据时间', title: '单据时间',
align: 'center', align: 'center',
dataIndex: 'createTime', dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
}, },
{ {
title: '申请单状态', title: '申请单状态',
...@@ -140,6 +142,7 @@ export const machiningDeliveryColumns = [ ...@@ -140,6 +142,7 @@ export const machiningDeliveryColumns = [
title: '单据时间', title: '单据时间',
align: 'center', align: 'center',
dataIndex: 'createTime', dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
}, },
{ {
title: '申请单状态', title: '申请单状态',
......
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