Commit e4d39f8a authored by Bill's avatar Bill

修改加工 回显加工企业bug

parent 792b81aa
......@@ -41,8 +41,8 @@ const Add: React.FC<{}> = () => {
const postData = list.map((item) => {
return {
productId: "fullId" in item ? item.commodityId : item.id,
memberId: item.memberId,
memberRoleId: item.memberRoleId,
memberId: item.memberId || authInfo.memberId,
memberRoleId: item.memberRoleId || authInfo.memberRoleId,
shopId: ENTERPRISE_MALL[authInfo.memberType],
type: 5,
}
......@@ -72,7 +72,7 @@ const Add: React.FC<{}> = () => {
disabled: record.purchaseCount - (record.processNum || 0) <= 0,
}),
});
const enterpriseTableRowSelection = useRowSelection({primaryKey: 'id', type: 'radio'});
const enterpriseTableRowSelection = useRowSelection({primaryKey: 'uniqueId', type: 'radio'});
// 选择加工企业 modal 层
const connectProduct = (
......@@ -128,20 +128,21 @@ const Add: React.FC<{}> = () => {
...orderData
}
})
const keys = someLists.map((item) => item.id);
if(isOrderProcess) {
orderTableRowSelection.setSelectedKeys(keys);
const orderDetailkeys = someLists.map((item) => item.fullId);
orderTableRowSelection.setSelectedKeys(orderDetailkeys);
orderTableRowSelection.setSelectedRows(someLists);
} else {
const keys = someLists.map((item) => item.id);
productTableRowSelection.setSelectedKeys(keys);
productTableRowSelection.setSelectedRows(someLists);
}
enterpriseTableRowSelection.setSelectedKeys([data.processMemberId]);
enterpriseTableRowSelection.setSelectedKeys([data.processMemberId + "_" + data.processRoleId]);
enterpriseTableRowSelection.setSelectedRows([{
id: data.processMemberId,
memberId: data.processMemberId,
name: data.processName,
roleId: data.processRoleId
roleId: data.processRoleId,
uniqueId: data.processMemberId + "_" + data.processRoleId
}])
setEditInfo({
...descValue,
......@@ -153,7 +154,8 @@ const Add: React.FC<{}> = () => {
orderList: isOrderProcess ? someLists : [],
productList: !isOrderProcess ? someLists : [],
outerWorkFlow: data.outerWorkflowRecordsList,
innerWorkFlow: data.innerWorkflowRecordsList
innerWorkFlow: data.innerWorkflowRecordsList,
controller: 1,
})
}
})
......@@ -165,7 +167,8 @@ const Add: React.FC<{}> = () => {
setEditInfo({
source: 1,
createTime: " ",
noticeNo: " "
noticeNo: " ",
controller: 1
})
}
}, [])
......@@ -265,9 +268,9 @@ const Add: React.FC<{}> = () => {
*/
const enterPriseOnOk = () => {
const row = enterpriseTableRowSelection.hasSelectedRows;
const { memberId, name, roleId, id } = row[0];
const { memberId, name, roleId } = row[0];
formActions.setFieldValue('Tabs.tab-1.layout.processName', name);
formActions.setFieldValue('Tabs.tab-1.layout.processMemberId', id);
formActions.setFieldValue('Tabs.tab-1.layout.processMemberId', memberId);
formActions.setFieldValue('Tabs.tab-1.layout.processRoleId', roleId);
}
......@@ -295,6 +298,9 @@ const Add: React.FC<{}> = () => {
const {
deliveryDate,
receivefullAddress,
controller,
outerStatus,
innerStatus,
// receiveAddressID,
enclosure = [],
deliveryDesc = '',
......
......@@ -82,14 +82,26 @@ const basicTab = {
],
"x-linkages": [
{
"type": "value:visible",
"target": "*(orderList, orderSource)",
"condition": "{{ $self.value === 1 }}"
"type": "value:state",
"target": "*(productList, productSource)",
"condition": "{{ $self.value === 1 }}",
state: {
display: false,
},
otherwise:{//条件不满足时控制bbb字段的编辑状态
display:true
}
},
{
"type": "value:visible",
"target": "*(productList, productSource)",
"condition": "{{ $self.value === 2 }}"
"type": "value:state",
"target": "*(orderList, orderSource)",
"condition": "{{ $self.value === 2 }}",
state: {
display: false,
},
otherwise:{//条件不满足时控制bbb字段的编辑状态
display:true
}
},
]
},
......
......@@ -13,7 +13,15 @@ const EnterPrise = ({visible, cancel, rowSelection, ...restProps}) => {
// const [selectRow, memberRowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio'});
const fetchData = useCallback(async (params: any) => {
let res = await PublicApi.getMemberManageLowerPageBynamerole(params);
return res;
console.log(res);
return {
...res,
code: res.code,
data: {
data: res.data.data.map((v) => ({...v, uniqueId: v.memberId + "_" + v.roleId})),
total: res.data.code
}
};
}, []);
const onOk = () => {
......
......@@ -132,7 +132,7 @@ export const schema = {
"x-component": "Table",
"x-component-props": {
"columns": columns,
"rowKey": "id",
"rowKey": "uniqueId",
"pagination":false,
"rowSelection": "{{rowSelection}}"
}
......
......@@ -111,8 +111,6 @@ const Content: React.FC<Iprops> = React.forwardRef((props, conftentRef) => {
props.formSubmit(value);
}
console.log(files);
return (
<div className={styles.container}>
<div className={styles.menu}>
......
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