Commit 3013c3bf authored by XieZhiXiong's avatar XieZhiXiong

fix: 添加内部单据处理逻辑

parent 72e12dba
...@@ -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: 2021-01-04 11:22:36 * @LastEditTime: 2021-01-06 16:18:59
* @Description: 联动逻辑相关 * @Description: 联动逻辑相关
*/ */
import { Modal } from 'antd'; import { Modal } from 'antd';
...@@ -257,6 +257,7 @@ export const useBusinessEffects = (context, actions) => { ...@@ -257,6 +257,7 @@ export const useBusinessEffects = (context, actions) => {
break; break;
} }
// 其他的走内部单据
default: { default: {
freeEnumItem(newEnum, 'value', DEPENDENT_DOC_INTERNAL); freeEnumItem(newEnum, 'value', DEPENDENT_DOC_INTERNAL);
break; break;
...@@ -285,6 +286,7 @@ export const useBusinessEffects = (context, actions) => { ...@@ -285,6 +286,7 @@ export const useBusinessEffects = (context, actions) => {
if (current) { if (current) {
linkage.value('invoicesTypeCode', current.number); linkage.value('invoicesTypeCode', current.number);
linkage.value('direction', current.direction);
} }
linkage.componentProps('orderNo', params); linkage.componentProps('orderNo', params);
}); });
...@@ -515,7 +517,6 @@ export const useBusinessEffects = (context, actions) => { ...@@ -515,7 +517,6 @@ export const useBusinessEffects = (context, actions) => {
const { name, originAsyncData, value } = fieldState; const { name, originAsyncData, value } = fieldState;
const current = originAsyncData.find(item => item.productId === value); const current = originAsyncData.find(item => item.productId === value);
const invoicesTypeIdVal = getFieldValue('invoicesTypeId'); const invoicesTypeIdVal = getFieldValue('invoicesTypeId');
const relevanceInvoicesVal = getFieldValue('relevanceInvoices');
// 取消选择 // 取消选择
if (!value) { if (!value) {
...@@ -760,7 +761,6 @@ export const useBusinessEffects = (context, actions) => { ...@@ -760,7 +761,6 @@ export const useBusinessEffects = (context, actions) => {
onFieldInputChange$('invoicesDetailsRequests.*.productCount').subscribe(fieldState => { onFieldInputChange$('invoicesDetailsRequests.*.productCount').subscribe(fieldState => {
const { name, value } = fieldState; const { name, value } = fieldState;
const invoicesTypeIdVal = getFieldValue('invoicesTypeId'); const invoicesTypeIdVal = getFieldValue('invoicesTypeId');
const relevanceInvoicesVal = getFieldValue('relevanceInvoices');
const originAsyncData = getFieldState( const originAsyncData = getFieldState(
FormPath.transform(name, /\d/, $1 => { FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.product` return `invoicesDetailsRequests.${$1}.product`
...@@ -876,4 +876,20 @@ export const useBusinessEffects = (context, actions) => { ...@@ -876,4 +876,20 @@ export const useBusinessEffects = (context, actions) => {
} }
); );
}); });
// 对应单据改变
onFieldValueChange$('relevanceInvoices').subscribe(fieldState => {
const { value } = fieldState;
// 对应单据等于内部单据
// formily 的 bug,设置了 display 为 false,该列还是会展示在页面中
// 所以把title设置
if (value === DEPENDENT_DOC_INTERNAL) {
linkage.display('*(orderNo,memberName,address,transport)', false);
linkage.display('invoicesDetailsRequests.*.*(product,productId,price,amount)', false);
} else {
linkage.display('*(orderNo,memberName,address,transport)');
linkage.display('invoicesDetailsRequests.*.*(product,productId,price,amount)');
}
});
} }
\ No newline at end of file
...@@ -379,12 +379,17 @@ export const addBillSchema: ISchema = { ...@@ -379,12 +379,17 @@ export const addBillSchema: ISchema = {
}, },
// 会员id,可以是采购会员id、销售会员id // 会员id,可以是采购会员id、销售会员id
membersId: { membersId: {
type: 'boolean', type: 'string',
display: false, display: false,
}, },
// 会员角色id,可以是采购会员角色id、销售会员角色id // 会员角色id,可以是采购会员角色id、销售会员角色id
membersRoleId: { membersRoleId: {
type: 'boolean', type: 'string',
display: false,
},
// 单据类型方向
direction: {
type: 'string',
display: false, display: false,
}, },
}, },
...@@ -481,16 +486,19 @@ export const addBillSchema: ISchema = { ...@@ -481,16 +486,19 @@ export const addBillSchema: ISchema = {
message: '请选择商品', message: '请选择商品',
}, },
], ],
display: true,
}, },
productId: { productId: {
type: 'string', type: 'string',
title: '商品ID', title: '商品ID',
'x-component': 'Text', 'x-component': 'Text',
display: true,
}, },
price: { price: {
type: 'string', type: 'string',
title: '单价', title: '单价',
'x-component': 'Text', 'x-component': 'Text',
display: true,
}, },
productCount: { productCount: {
type: 'string', type: 'string',
...@@ -513,6 +521,7 @@ export const addBillSchema: ISchema = { ...@@ -513,6 +521,7 @@ export const addBillSchema: ISchema = {
type: 'string', type: 'string',
title: '金额', title: '金额',
'x-component': 'Text', 'x-component': 'Text',
display: true,
}, },
// 额外的数据,用于收集不需要展示的数据 // 额外的数据,用于收集不需要展示的数据
extraData: { extraData: {
......
...@@ -19,6 +19,7 @@ export const useLinkageUtils = () => { ...@@ -19,6 +19,7 @@ export const useLinkageUtils = () => {
loading: linkage('loading', true), loading: linkage('loading', true),
loaded: linkage('loading', false), loaded: linkage('loading', false),
value: linkage('value'), value: linkage('value'),
componentProps: linkage('props.x-component-props', {}) componentProps: linkage('props.x-component-props', {}),
display: linkage('display', true),
} }
} }
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