Commit 1b6e4219 authored by XieZhiXiong's avatar XieZhiXiong

对接加工相关单据中

parent a00f45dd
...@@ -511,9 +511,18 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState> ...@@ -511,9 +511,18 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
}); });
}); });
setFieldState('amountSlide', fileState => { setFieldState('amountSlide', fileState => {
fileState.props['x-component-props'].max = billInfo.residueRepayQuota;
fileState.value = billInfo.residueRepayQuota; fileState.value = billInfo.residueRepayQuota;
fileState.props['x-component-props'].max = billInfo.residueRepayQuota;
fileState.props['x-component-props'].marks = {
0: {
label: 0,
},
[billInfo.residueRepayQuota]: {
label: billInfo.residueRepayQuota,
},
};
}); });
}); });
createEffects($, actions); createEffects($, actions);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47 * @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-20 19:01:57 * @LastEditTime: 2020-11-23 16:39:11
* @Description: 联动逻辑相关 * @Description: 联动逻辑相关
*/ */
import { Modal } from 'antd'; import { Modal } from 'antd';
...@@ -34,7 +34,9 @@ import Submit from '@/components/NiceForm/components/Submit'; ...@@ -34,7 +34,9 @@ import Submit from '@/components/NiceForm/components/Submit';
import DateSelect from '@/components/NiceForm/components/DateSelect'; import DateSelect from '@/components/NiceForm/components/DateSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { orderBillSchema } from '../schema'; import {
purchaseOrderBillSchema,
} from '../schema';
const { const {
onFieldInputChange$, onFieldInputChange$,
...@@ -42,7 +44,8 @@ const { ...@@ -42,7 +44,8 @@ const {
} = FormEffectHooks; } = FormEffectHooks;
// 弹窗表格列-订单 // 弹窗表格列-订单
const orderColumns: any[] = [ // 采购订单-弹窗表格列
const purchaseOrderColumns: any[] = [
{ {
title: '订单号', title: '订单号',
align: 'center', align: 'center',
...@@ -77,37 +80,68 @@ const orderColumns: any[] = [ ...@@ -77,37 +80,68 @@ const orderColumns: any[] = [
}, },
]; ];
// 销售订单-弹窗表格列
const salesOrderColumns: any[] = [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
},
{
title: '订单摘要',
align: 'center',
dataIndex: 'orderThe',
},
{
title: '会员名称',
align: 'center',
dataIndex: 'createMemberName',
},
{
title: '下单时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '订单类型',
align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: '订单状态',
align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
},
];
// 生成通知单列表 // 生成通知单列表
const productionColumns = [ const productionColumns = [
{ {
title: '通知单号', title: '通知单号',
align: 'center', align: 'center',
dataIndex: 'orderNo', dataIndex: 'orderNo',
key: 'orderNo',
}, },
{ {
title: '通知单摘要', title: '通知单摘要',
align: 'center', align: 'center',
dataIndex: 'invoicesAbstract', dataIndex: 'invoicesAbstract',
key: 'invoicesAbstract',
}, },
{ {
title: '加工企业名称', title: '加工企业名称',
align: 'center', align: 'center',
dataIndex: 'memberName', dataIndex: 'memberName',
key: 'memberName',
}, },
{ {
title: '单据时间', title: '单据时间',
align: 'center', align: 'center',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTime',
}, },
{ {
title: '申请单状态', title: '申请单状态',
align: 'center', align: 'center',
dataIndex: 'state', dataIndex: 'state',
key: 'state',
}, },
]; ];
...@@ -117,31 +151,26 @@ const afterSaleColumns = [ ...@@ -117,31 +151,26 @@ const afterSaleColumns = [
title: '申请单号', title: '申请单号',
align: 'center', align: 'center',
dataIndex: 'orderNo', dataIndex: 'orderNo',
key: 'orderNo',
}, },
{ {
title: '申请单摘要', title: '申请单摘要',
align: 'center', align: 'center',
dataIndex: 'invoicesAbstract', dataIndex: 'invoicesAbstract',
key: 'invoicesAbstract',
}, },
{ {
title: '会员名称', title: '会员名称',
align: 'center', align: 'center',
dataIndex: 'memberName', dataIndex: 'memberName',
key: 'memberName',
}, },
{ {
title: '单据时间', title: '单据时间',
align: 'center', align: 'center',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTime',
}, },
{ {
title: '申请单状态', title: '申请单状态',
align: 'center', align: 'center',
dataIndex: 'state', dataIndex: 'state',
key: 'state',
}, },
]; ];
...@@ -169,7 +198,7 @@ const getOrderSalesInvoiceOrderList = async (params: any) => { ...@@ -169,7 +198,7 @@ const getOrderSalesInvoiceOrderList = async (params: any) => {
// 获取关联组件对应的 params // 获取关联组件对应的 params
const getParams = type => { const getParams = type => {
const params = { const basicParams = {
modalProps: { modalProps: {
title: '标题', title: '标题',
}, },
...@@ -203,21 +232,21 @@ const getParams = type => { ...@@ -203,21 +232,21 @@ const getParams = type => {
switch (type) { switch (type) {
// 采购入库单 // 采购入库单
case DOC_TYPE_PURCHASE_RECEIPT: { case DOC_TYPE_PURCHASE_RECEIPT: {
params.modalProps.title = '选择订单'; basicParams.modalProps.title = '选择订单';
params.columns = orderColumns; basicParams.columns = purchaseOrderColumns;
params.fetchTableData = fetchOrderPurchaseReceiptAddList; basicParams.fetchTableData = fetchOrderPurchaseReceiptAddList;
params.formilyProps.ctx.schema = orderBillSchema; basicParams.formilyProps.ctx.schema = purchaseOrderBillSchema;
params.tableProps.lableKey = 'orderNo'; basicParams.tableProps.lableKey = 'orderNo';
break; break;
} }
// 销售发货单 // 销售发货单
case DOC_TYPE_SALES_INVOICE: { case DOC_TYPE_SALES_INVOICE: {
params.modalProps.title = '选择订单'; basicParams.modalProps.title = '选择订单';
params.columns = orderColumns; basicParams.columns = salesOrderColumns;
params.fetchTableData = getOrderSalesInvoiceOrderList; basicParams.fetchTableData = getOrderSalesInvoiceOrderList;
params.formilyProps.ctx.schema = orderBillSchema; basicParams.formilyProps.ctx.schema = purchaseOrderBillSchema; // 这里用同一个 schema 是因为接口参数名是一样的,后台做了处理
params.tableProps.lableKey = 'orderNo'; basicParams.tableProps.lableKey = 'orderNo';
break; break;
} }
...@@ -225,7 +254,7 @@ const getParams = type => { ...@@ -225,7 +254,7 @@ const getParams = type => {
break; break;
} }
return params; return basicParams;
}; };
const freeEnumItem = (data: {[key: string]: any}[], keyName: string, value: any) => { const freeEnumItem = (data: {[key: string]: any}[], keyName: string, value: any) => {
...@@ -316,18 +345,65 @@ export const useBusinessEffects = (context, actions) => { ...@@ -316,18 +345,65 @@ export const useBusinessEffects = (context, actions) => {
// 关联单据改变 // 关联单据改变
onFieldValueChange$('orderNo').subscribe(fieldState => { onFieldValueChange$('orderNo').subscribe(fieldState => {
const relevanceInvoicesVal = getFieldValue('relevanceInvoices'); const relevanceInvoicesVal = getFieldValue('relevanceInvoices');
const invoicesTypeIdVal = getFieldValue('invoicesTypeId');
const first = fieldState.value && fieldState.value[0]; const first = fieldState.value && fieldState.value[0];
setFieldValue('supplyMembersName', first ? first.supplyMembersName : ''); switch (invoicesTypeIdVal) {
setFieldValue('relevanceInvoicesId', first ? first.id : null); // 采购入库单
setFieldValue('address', first ? `${first.fullAddress} ${first.receiverName}/${first.phone}` : ''); case DOC_TYPE_PURCHASE_RECEIPT: {
setFieldValue('supplyMembersName', first ? first.supplyMembersName : '');
}
// 以下数据只用于收集,不用于展示 // 销售发货单
setFieldValue('deliveryAddresId', first ? first.deliveryAddresId : null); case DOC_TYPE_SALES_INVOICE: {
setFieldValue('receiverName', first ? first.receiverName : ''); setFieldValue('supplyMembersName', first ? first.createMemberName : '');
setFieldValue('fullAddress', first ? first.fullAddress : ''); }
setFieldValue('phone', first ? first.phone : '');
setFieldValue('isDefault', first ? first.isDefault : false); // 采购入库单、销售发货单 共有逻辑
case DOC_TYPE_PURCHASE_RECEIPT:
case DOC_TYPE_SALES_INVOICE: {
setFieldValue('address', first ? `${first.fullAddress} ${first.receiverName}/${first.phone}` : '');
// 以下数据只用于收集,不用于展示
setFieldValue('deliveryAddresId', first ? first.deliveryAddresId : null);
setFieldValue('receiverName', first ? first.receiverName : '');
setFieldValue('fullAddress', first ? first.fullAddress : '');
setFieldValue('phone', first ? first.phone : '');
setFieldValue('isDefault', first ? first.isDefault : false);
break;
}
// 加工入库单
case DOC_TYPE_PROCESS_RECEIPT: {
break;
}
// 加工发货单
case DOC_TYPE_PROCESS_INVOICE: {
break;
}
// 退货发货单、退货入库单
case DOC_TYPE_RETURN_INVOICE:
case DOC_TYPE_RETURN_RECEIPT: {
break;
}
// 换货发货单、换货入库单
case DOC_TYPE_EXCHANGE_INVOICE:
case DOC_TYPE_EXCHANGE_RECEIPT: {
break;
}
default: {
break;
}
}
if (!first) { if (!first) {
return; return;
......
...@@ -274,26 +274,26 @@ export const addBillSchema: ISchema = { ...@@ -274,26 +274,26 @@ export const addBillSchema: ISchema = {
value: DEPENDENT_DOC_ORDER, value: DEPENDENT_DOC_ORDER,
disabled: true, disabled: true,
}, },
// { {
// label: '换货申请单', label: '换货申请单',
// value: DEPENDENT_DOC_EXCHANGE, value: DEPENDENT_DOC_EXCHANGE,
// disabled: true, disabled: true,
// }, },
// { {
// label: '退货申请单', label: '退货申请单',
// value: DEPENDENT_DOC_RETURN, value: DEPENDENT_DOC_RETURN,
// disabled: true, disabled: true,
// }, },
// { {
// label: '生产通知单', label: '生产通知单',
// value: DEPENDENT_DOC_PRODUCTION, value: DEPENDENT_DOC_PRODUCTION,
// disabled: true, disabled: true,
// }, },
// { {
// label: '内部单据', label: '内部单据',
// value: DEPENDENT_DOC_INTERNAL, value: DEPENDENT_DOC_INTERNAL,
// disabled: true, disabled: true,
// }, },
], ],
}, },
// 这是用 Mega-Layout 设置独立作用域,不然会被 Form 的布局影响到弹窗的布局 // 这是用 Mega-Layout 设置独立作用域,不然会被 Form 的布局影响到弹窗的布局
...@@ -342,32 +342,32 @@ export const addBillSchema: ISchema = { ...@@ -342,32 +342,32 @@ export const addBillSchema: ISchema = {
title: '物流方式', title: '物流方式',
// default: '', // 奇了怪了,initialValues 覆盖不了 default,就这个字段会 // default: '', // 奇了怪了,initialValues 覆盖不了 default,就这个字段会
}, },
// 不用于展示,只用于收集值 // 交付地址ID,不用于展示,只用于收集值
deliveryAddresId: { deliveryAddresId: {
type: 'string', type: 'string',
display: false, display: false,
}, },
// 不用于展示,只用于收集值 // 交付地址收货人名字,不用于展示,只用于收集值
receiverName: { receiverName: {
type: 'string', type: 'string',
display: false, display: false,
}, },
// 不用于展示,只用于收集值 // 交付地址详情,不用于展示,只用于收集值
fullAddress: { fullAddress: {
type: 'string', type: 'string',
display: false, display: false,
}, },
// 不用于展示,只用于收集值 // 交付地址联系电话,不用于展示,只用于收集值
phone: { phone: {
type: 'string', type: 'string',
display: false, display: false,
}, },
// 不用于展示,只用于收集值 // 物流方式,不用于展示,只用于收集值
deliveryType: { deliveryType: {
type: 'number', type: 'number',
display: false, display: false,
}, },
// 不用于展示,只用于收集值 // 交付地址收是否默认0.否1.是,不用于展示,只用于收集值
isDefault: { isDefault: {
type: 'boolean', type: 'boolean',
display: false, display: false,
...@@ -514,7 +514,7 @@ export const addBillSchema: ISchema = { ...@@ -514,7 +514,7 @@ export const addBillSchema: ISchema = {
}, },
}; };
export const orderBillSchema: ISchema = { export const purchaseOrderBillSchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
megaLayout: { megaLayout: {
......
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