Commit f8b53bdb authored by GuanHua's avatar GuanHua
parents a1691abc 9b7432d2
......@@ -38,7 +38,7 @@ const HandlingRoute = {
icon: 'smile',
component: '@/pages/handling/components/Query'
},
// 指派生产通知单 -> 新增成产通知单(新建)
// 指派生产通知单 -> 新增成产通知单(新建)
{
path: '/memberCenter/handling/assign/tobeAddQuery/add',
name: 'assignProductionAdd',
......@@ -105,6 +105,13 @@ const HandlingRoute = {
component: '@/pages/handling/assign/processStock',
// hideInMenu: true
},
{
path: '/memberCenter/handling/assign/pendingAddProcessing/detail',
name: 'processStockDetail',
icon: 'smile',
component: '@/pages/handling/assign/detail',
hideInMenu: true
},
// 指派生产通知单 -> 待收货生产通知单
{
path: '/memberCenter/handling/assign/pendingReceive',
......@@ -120,7 +127,7 @@ const HandlingRoute = {
component: '@/pages/handling/assign/detail',
hideInMenu: true,
},
]
},
// 确认生产通知单
......@@ -253,9 +260,7 @@ const HandlingRoute = {
},
]
}
]
}
export default HandlingRoute
\ No newline at end of file
export default HandlingRoute
......@@ -3,7 +3,7 @@ import {StandardTable} from 'god';
import NestTable from '@/components/NestTable';
import { IStandardTableProps } from 'god/dist/src/standard-table';
import { Row, Col, Modal } from 'antd';
import { productModalSchema, productModalByMemberSchema, memberModalSchema, inquirySchema, demandSchema, enquirySchema, mergeOrderSchema, goodsModalSchema, demandNumberSchema, addOrderModalSchema } from './schema';
import { productModalSchema, productModalByMemberSchema, memberModalSchema, inquirySchema, demandSchema, enquirySchema, mergeOrderSchema, goodsModalSchema, demandNumberSchema, logisticsDeliverySearchSchema, addOrderModalSchema } from './schema';
import Search from '../NiceForm/components/Search';
import SearchSelect from '../NiceForm/components/SearchSelect';
import Submit from '../NiceForm/components/Submit';
......@@ -18,7 +18,7 @@ export interface ModalTableProps extends IStandardTableProps<any> {
cancel?(),
visible?: boolean,
resetModal?: object,
modalType?: 'productByDefault' | 'productByMember' | 'memberByDefault' | 'inquiryByDefault' | 'demandByDefault' | 'enquiryModel' | 'MergeOrderByDefault' | 'goodsModalSchema' | 'demandNumberSchema' | 'addOrderModalSchema' | 'none' ,
modalType?: 'productByDefault' | 'productByMember' | 'memberByDefault' | 'inquiryByDefault' | 'demandByDefault' | 'enquiryModel' | 'MergeOrderByDefault' | 'goodsModalSchema' | 'demandNumberSchema' | 'logisticsDelivery' | 'addOrderModalSchema' | 'none' ,
useNestTable?: boolean, // 是否使用嵌套表格
nestColumns?: any[],
nestTableProps?: any,
......@@ -76,6 +76,9 @@ const ModalTable:React.FC<ModalTableProps> = (props) => {
case 'demandNumberSchema': {
return demandNumberSchema
}
case 'logisticsDelivery': {
return logisticsDeliverySearchSchema
}
case 'addOrderModalSchema': {
return addOrderModalSchema
}
......
......@@ -596,3 +596,80 @@ export const demandNumberSchema: ISchema = {
}
}
}
/** 物流选择发货单 */
export const logisticsDeliverySearchSchema: ISchema = {
type: 'object',
properties: {
invoicesNo: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '发货单号',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
orderNo: {
type: 'string',
"x-component-props": {
placeholder: '对应订单号',
style: {
width: 160
}
}
},
invoicesAbstract: {
type: 'string',
"x-component-props": {
placeholder: '单据摘要',
style: {
width: 160
}
}
},
inventoryId: {
type: 'string',
"x-component": 'SearchSelect',
'x-component-props': {
placeholder: '单据类型',
fetchSearch: PublicApi.getWarehouseInvoicesTypeAll,
style: {
width: 160
}
},
},
"[startTransactionTime,endTransactionTime]": {
type: 'string',
"x-component": "dateSelect",
"x-component-props": {
placeholder: '单据时间(全部)',
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
import React, { useState, ReactText, useImperativeHandle, useEffect, useRef } from 'react'
import { Tree, Space, Tooltip, Button } from 'antd'
import { Tree, Space, Tooltip, Button, Input } from 'antd'
import { findItemAndDelete, findTreeKeys, treeReduction, getParentTreeTitles } from '@/utils'
import './index.less'
import deepClone from 'clone'
......@@ -8,6 +8,8 @@ import { PlusOutlined, DeleteOutlined, PlusCircleOutlined } from '@ant-design/ic
import cx from 'classnames'
import { useSelections } from '@umijs/hooks'
const { Search } = Input;
export interface TabTreeActions {
selected: ReactText[];
getExpandedKeys: () => ReactText[];
......@@ -40,6 +42,8 @@ export interface TabTreeProps extends TreeProps {
toolsRender?: toolsRenderProps;
getMenuSelectData?(): Promise<any>;
handleCheck?: (keys: any, nodes: any) => {};
customExpandkeys?: any[]; // props 传入自定义展开的key
enableSearch?: boolean; // 是否可搜索
}
export interface InnermostTreeNodeProps {}
......@@ -213,7 +217,9 @@ const TabTree: React.FC<TabTreeProps> = props => {
showSave,
getMenuSelectData,
handleSubmit,
handleCheck,
handleCheck,
customExpandkeys,
enableSearch = false,
} = props;
const selfActions = useTreeActions(actions)
......@@ -223,6 +229,8 @@ const TabTree: React.FC<TabTreeProps> = props => {
// 当前选中的node
const [selectKey, setSelectKey] = useState<string | number>('');
const [autoExpandParent, setAutoExpandParent] = useState<boolean>(false) // 自动展开父级
const data = transformSingleTitle(
deepClone(treeData),
selectKey,
......@@ -252,6 +260,13 @@ const TabTree: React.FC<TabTreeProps> = props => {
}
}, []);
useEffect(() => {
if(customExpandkeys?.length) {
setExpandkeys(customExpandkeys)
setAutoExpandParent(true)
}
}, [customExpandkeys])
const toggleSelectAll = () => {
if (allSelected) {
unSelectAll();
......@@ -295,6 +310,20 @@ const TabTree: React.FC<TabTreeProps> = props => {
}
};
// 展开/收起的回调
const onExpand = expandedKeys => {
setAutoExpandParent(false)
setExpandkeys(expandedKeys)
};
const onSearchChange = v => {
// todo 找到目标节点的父级key
const reductData = Object.values(treeReduction(treeData))
const expandedKeys = reductData.filter(item => item['title'].indexOf(v) > -1).map(_item => _item['parentId'])
setExpandkeys(expandedKeys)
setAutoExpandParent(true)
}
return (
<div>
{title && (
......@@ -312,7 +341,9 @@ const TabTree: React.FC<TabTreeProps> = props => {
)}
</div>
)}
{
enableSearch && data?.length > 0 && <Search style={{ marginBottom: 8 }} placeholder="搜索" onSearch={onSearchChange} />
}
<Tree
className="god-tabtree"
treeData={data}
......@@ -320,6 +351,8 @@ const TabTree: React.FC<TabTreeProps> = props => {
checkable={checkable}
checkedKeys={selected}
expandedKeys={expandkeys}
autoExpandParent={autoExpandParent}
onExpand={onExpand}
onCheck={(keys, nodes) => {
const { node, checked, checkedNodes } = nodes;
checked
......
......@@ -467,6 +467,7 @@ export default {
'menu.handling.assign.examineSecondDetail': '待审核生产通知单(二级)详情',
'menu.handling.assign.toBeSubmit': '待提交生产通知单',
'menu.handling.assign.processStock': '待新增加工入库单',
'menu.handling.assign.processStockDetail': '待新增加工入库单详情',
'menu.handling.assign.toBeRecieve': '待收货生产通知单',
'menu.handling.assign.createProcessStock': '新建加工入库单',
'menu.handling.assign.pendingSubmitDetail': '待提交生产通知单详情',
......@@ -592,7 +593,7 @@ export default {
'menu.afterService.repairManage.repairPrConfirm': '待确认维修申请单',
'menu.afterService.repairManage.repairPrConfirmDetail': '查看维修申请单',
'menu.afterService.repairManage.verifyRepairPrConfirm': '审核维修申请单',
// 结算能力
'menu.balance': '结算',
'menu.balance.settleRules': '结算规则配置',
......@@ -617,4 +618,4 @@ export default {
'menu.balance.accountsReceivable.logisticsDetail': '物流通知单结算明细',
'menu.balance.accountsReceivable.productNoticeSettlementDetail': '生产通知单结算明细',
'menu.balance.accountsReceivable.invoice': '开票管理',
};
\ No newline at end of file
};
import React, { useState, useEffect } from 'react'
import { Row, Col, Tooltip, Form, Input, Select, Popconfirm, Button, Card, Upload, message, Modal } from 'antd';
import {
LoadingOutlined,
PlusOutlined,
LinkOutlined,
import {
LoadingOutlined,
PlusOutlined,
LinkOutlined,
} from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import TabTree, { useTreeActions, createTreeActions } from '@/components/TabTree';
......@@ -42,6 +42,8 @@ const ClassProperty: React.FC<{}> = () => {
const [plateformSelectNode, setPlateformSelectNode] = useState<any>()
const plateformTreeActions = useTreeActions()
const [customPlateformExpandkeys, setCustomPlateformExpandkeys] = useState<any>()
/* 选择品类树 */
const {
treeStatus,
......@@ -66,16 +68,8 @@ const ClassProperty: React.FC<{}> = () => {
const formInitValue = (nodeRecord && treeStatus === FormState.EDIT) ? getTreeMaps(nodeRecord.key) : {}
// useEffect(() => {
// if(treeActions.setExpandedKeys){
// console.log(treeActions.setExpandedKeys)
// treeActions.setSelectKey(85)
// treeActions.setExpandedKeys([85])
// }
// }, [])
/* 关联平台后台品类树 */
const {
const {
treeData: plateformTreeData,
} = useTreeTabs({
fetchMenuData: fetchPlatformTreeData,
......@@ -89,7 +83,6 @@ const ClassProperty: React.FC<{}> = () => {
parentId: nodeRecord ? nodeRecord.parentId : 0,
id: null,
}
// delete params.category.name
PublicApi.postProductCustomerSaveOrUpdateCustomerCategory(params).then(res => {
resetMenu()
setTreeStatus(FormState.FREE)
......@@ -109,8 +102,6 @@ const ClassProperty: React.FC<{}> = () => {
const handleSelectCancel = () => {
setPlateformVisible(false)
// setSelectLinkKeys(undefined)
// setSelectLinkRow({})
plateformTreeActions.setExpandedKeys && plateformTreeActions.setExpandedKeys([])
}
......@@ -124,9 +115,10 @@ const ClassProperty: React.FC<{}> = () => {
const handleConnectCategroyBtn = () => {
setPlateformVisible(true)
if(formInitValue?.category?.id) {
let arr = [formInitValue.category.parentId + '', formInitValue.category.id + '']
plateformTreeActions.setExpandedKeys && plateformTreeActions.setExpandedKeys(arr)
plateformTreeActions.setSelectKey && plateformTreeActions.setSelectKey(formInitValue?.category?.id)
setCustomPlateformExpandkeys([formInitValue.category.id])
// let arr = [formInitValue.category.parentId + '', formInitValue.category.id + '']
// plateformTreeActions.setExpandedKeys && plateformTreeActions.setExpandedKeys(arr)
plateformTreeActions.setSelectKey && plateformTreeActions.setSelectKey(formInitValue.category.id)
}
}
......@@ -148,13 +140,14 @@ const ClassProperty: React.FC<{}> = () => {
<h3 className="mb-30">选择要编辑的项目</h3>
{
treeData && treeData.length > 0
? <TabTree
? <TabTree
fetchData = {params => fetchClassTreeData(params)}
treeData={treeData}
toolsRender={toolsRender}
actions={treeActions}
handleSelect={(key, node) => clickSelect(key, node)}
customKey="id"
// customExpandkeys={['8']}
/>
:
<Button block type='primary' onClick={() => handleSelect()}>暂无菜单, 开始新增</Button>
......@@ -179,7 +172,6 @@ const ClassProperty: React.FC<{}> = () => {
setIsEditForm(true)
})
$('onFieldValueChange', 'name, type, imageUrl, category').subscribe(state => {
console.log(flag,'flag')
if(flag){
setIsEditForm(true)
flag = false
......@@ -220,7 +212,6 @@ const ClassProperty: React.FC<{}> = () => {
cancelText="取消"
forceRender
getContainer='#root'
// destroyOnClose={true}
>
<TabTree
fetchData = {params => fetchPlatformTreeData(params)}
......@@ -228,9 +219,11 @@ const ClassProperty: React.FC<{}> = () => {
handleSelect={(key, node) => handlePlateformSelect(key, node)}
actions={plateformTreeActions}
customKey="id"
enableSearch={true}
customExpandkeys={customPlateformExpandkeys}
/>
</Modal>
</PageHeaderWrapper>
}
......
......@@ -4,12 +4,11 @@ import { LinkOutlined, QuestionCircleOutlined, } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle';
import { PropertyValueApi } from '@/services/classAndProperty/propertyValue/API'
import { PublicApi } from '@/services/api';
import TabTree, { useTreeActions, createTreeActions } from '@/components/TabTree';
import { useTreeTabs } from '@/hooks/useTreeTabs';
import { GetManageAreaAllResponse } from '@/services';
import { validatorByte } from '@/utils/regExp';
import { treeReduction } from '@/utils';
const layout = {
labelCol: {
......@@ -43,8 +42,9 @@ const AddPropertyValue: React.FC<{}> = () => {
const [attributeValueId, setAttributeValueId] = useState(null) // url传入 可判断是编辑/新增
const [isSee, setIsSee] = useState(false) // 判断查看依据
const [specialType, setSpecialType] = useState<any>() // 1-日期; 2-地区
const [proviceOptions, setProviceOptions] = useState<GetManageAreaAllResponse>()
const [proviceOptions, setProviceOptions] = useState<any>()
const [areaString, setAreaString] = useState<string>()
const [customPlateformExpandkeys, setCustomPlateformExpandkeys] = useState<any>()
/* 平台属性值列表树 */
const {
......@@ -60,8 +60,7 @@ const AddPropertyValue: React.FC<{}> = () => {
let arr = [...res.data] //裁去最后一级别
for (let index in arr) {
for (let _index in arr[index].areaResponses) {
let o = arr[index].areaResponses
//@ts-ignore
let o: any = arr[index].areaResponses
o[_index].areaResponses = null
}
}
......@@ -133,10 +132,14 @@ const AddPropertyValue: React.FC<{}> = () => {
let formData = attrValueForm.getFieldValue('attributeValue')
let chooseKey = formData && formData.id || undefined
setSelectKey(chooseKey)
// 树回显
console.log(selectRow, formData, 'select')
// plateformActions.setExpandedKeys && plateformActions.setExpandedKeys(arr)
// plateformActions.setSelectKey && plateformActions.setSelectKey(formInitValue?.category?.id)
if(formData?.id) {
const reductData = Object.values(treeReduction(treeData))
// 筛选同名称的id
let aimKey = reductData.filter(item => item['title'] === formData.value).map(_item => _item['id'])
setCustomPlateformExpandkeys(aimKey)
// todo 树回显 无法选中 可能是因为key为含字母字符串原因
plateformActions.setSelectKey && plateformActions.setSelectKey(aimKey[0])
}
}
const handlePlateformSelect = (key, node) => {
......@@ -326,6 +329,7 @@ const AddPropertyValue: React.FC<{}> = () => {
handleSelect={(key, node) => handlePlateformSelect(key, node)}
customKey="id"
actions={plateformActions}
customExpandkeys={customPlateformExpandkeys}
/>
</Modal>
</Card>
......
......@@ -17,7 +17,6 @@ import { PublicApi } from '@/services/api';
import { createFormActions } from '@formily/antd';
import { useTreeTabs } from '@/hooks/useTreeTabs';
import TabTree, { createTreeActions } from '@/components/TabTree';
import { GetProductCustomerGetCustomerAttributeResponse } from '@/services';
// const formActions = createFormActions()
const treeActions = createTreeActions()
......@@ -32,7 +31,7 @@ const PropertyValue: React.FC<{}> = () => {
const ref = useRef<any>({})
const [selectKey, setSelectKey] = useState(undefined)
const [selectNode, setSelectNode] = useState<any>()
const [innerExpandKeys, setInnerExpandKeys] = useState<any[]>([])
const [customExpandkeys, setCustomExpandkeys] = useState<any>()
const {
treeStatus,
......@@ -54,11 +53,13 @@ const PropertyValue: React.FC<{}> = () => {
let prefix = sessionStorage.getItem('beforeKeyPrefix')
let beforeKey = history.location.query.attrId
if(beforeKey){ // 展开之前的选择项
if(beforeKey){ // 展开之前的选择项 拼接含有字母字符串的key
setSelectKey(beforeKey)
setInnerExpandKeys([`${prefix}_${beforeKey}`])
treeActions.setExpandedKeys([`${prefix}_${beforeKey}`]) // 拼接不正常的key
console.log(`${prefix}_${beforeKey}`, '展开的key')
let evilKey = `${prefix}_${beforeKey}`
treeActions.setExpandedKeys([evilKey])
setCustomExpandkeys([evilKey])
treeActions.setSelectKeys([evilKey])
console.log(evilKey, '展开的key')
}
}, [])
......@@ -83,9 +84,9 @@ const PropertyValue: React.FC<{}> = () => {
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getProductCustomerGetCustomerAttributeValueList({
PublicApi.getProductCustomerGetCustomerAttributeValueList({
...params,
name: params.name || '',
name: params.name || '',
customerAttributeId: selectKey
}).then(res=>{
const { data } = res
......@@ -192,12 +193,13 @@ const PropertyValue: React.FC<{}> = () => {
<h3 className="mb-30">选择要编辑的项目</h3>
{
treeData && treeData.length > 0
? <TabTree
? <TabTree
fetchData = {params => fetchAttributeTreeData(params)}
treeData={treeData}
actions={treeActions}
handleSelect={(key, node) => onHandleSelect(key, node)}
customKey="id"
customExpandkeys={customExpandkeys}
/>
:
<>暂无菜单</>
......@@ -242,8 +244,8 @@ const PropertyValue: React.FC<{}> = () => {
<Button
type="primary"
icon={<PlusOutlined />}
onClick={() => {
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/add?attrId=${selectKey||history.location.query.attrId}&attrName=${selectNode?._title||history.location.query.attrName}&type=${selectNode?.type||history.location.query.type}`)
onClick={() => {
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/add?attrId=${selectKey||history.location.query.attrId}&attrName=${selectNode?._title||history.location.query.attrName}&type=${selectNode?.type||history.location.query.type}`)
}}
>
新建
......
......@@ -162,7 +162,7 @@ const Add: React.FC<{}> = () => {
})
// 当物流为 物流时,那么填充
onFieldMount$('receivefullAddress').subscribe((state) => {
PublicApi.getLogisticsReceiverAddressPage({current: '1', pageSize: '10'})
PublicApi.getLogisticsReceiverAddressPage({current: '1', pageSize: '99'})
.then((res) => {
let options = [];
if(res.code === 1000) {
......
......@@ -124,7 +124,7 @@ const basicTab = {
{
type: 'value:visible',
target: '*(receivefullAddress, receiveAddressID, receiveAddress,receiveUserName,receiveUserTel)',
condition: '{{$value == 1}}'
condition: '{{$value === 1}}'
},
],
},
......
This diff is collapsed.
......@@ -68,7 +68,7 @@ enum OuterAndInnerStatus {
/**
* 待新增加工入库单
*/
pending_add_process_in_warehouse = '6_18',
pending_add_process_in_warehouse = '6_19',
/**
* 待审核加工入库单
*/
......
......@@ -19,7 +19,7 @@ export const docTime = [{label: '单据时间(全部)', value: 0}].concat(co
/**
* 下单时间
*/
export const orderTime = [{label: '单据时间(全部)', value: 0}].concat(commonTimeList);
export const orderTime = [{label: '订单时间(全部)', value: 0}].concat(commonTimeList);
......@@ -70,7 +70,7 @@ export const CONFIRM_PENDING_CONFIRM_DETAIL = CONFIRM_PENDING_CONFIRM + DETAIL;
export const QUERY_SEARCH_NAME = "noticeNo";
/**
* 指派生产通知单-待新增生产通知单列表页
* 指派生产通知单-待新增生产通知单列表页
*/
export const TO_BE_ADD_QUERY_SEARCH_NAME = "noticeNo";
......@@ -142,6 +142,14 @@ export const ASSINGN_TITLE_MAPS = {
[ASSIGN_PENDING_SUBMIT]: PENDING_SUBMIT_TITLE,
}
export const COMFIRM_TITLE_MAPS = {
[CONFIRM_QUERY]: '生产通知单查询',
[CONFIRM_PENDING_SUBMIT]: '待提交生产通知单',
[CONFIRM_PENDING_FIRST]: '待审核生产通知单(一级)',
[CONFIRM_PENDING_SECOND]: '待审核生产通知单(二级)',
[CONFIRM_PENDING_CONFIRM]: '待确认生产通知单'
}
// export const DETAIL_PATH = {
......@@ -165,7 +173,7 @@ export const INNER_STATUS_BADGE_COLOR = {
/**
* 指派生产通知单-> 列表页 -> 内部状态: 只有四种装填:待审核, 待提交审核通知单- 审核不通过, 审核通过
*/
// supplierInnerStatus,
// supplierInnerStatus,
export const SUPPLIER_INNER_STATUS_COLOR = {
"1": "default",
"2": "warning",
......@@ -214,7 +222,7 @@ export const CONFIRM_DETAIL_INNER_STATUS_COLOR = [
"green", // 完成
]
type SUPPLIER_OUTER_STATUS_COLOR_TYPE = ("default" | "primary" | "danger"| "success" | "warning")[]
type SUPPLIER_OUTER_STATUS_COLOR_TYPE = ("default" | "primary" | "danger"| "success" | "warning")[]
/**
* 指派生产通知单 -> 列表页 -> 外部状态
*/
......@@ -236,10 +244,10 @@ export const PROCESS_OUTER_STATUS_COLOR: ("default" | "processing" | "error"| "s
"warning", // 待审核 processInnerStatus = 2,
"error", // 待审核(1级) processInnerStatus = 3 不通过
"success", // 待审核(2级) processInnerStatus = 4 审核通过
"processing", // 待新增加工发货单 processInnerStatus = 5
"warning", // 待审核加工发货单 processInnerStatus = 6
"processing", // 待新增加工发货单 processInnerStatus = 5
"warning", // 待审核加工发货单 processInnerStatus = 6
"default", // 待新增物流单 processInnerStatus = 7
"processing", // 待确认物流单 processInnerStatus = 8
"processing", // 待确认物流单 processInnerStatus = 8
"warning", // 待确认发货 processInnerStatus = 9
"success", // 已确认发货 processInnerStatus = 10
"default", // processInnerStatus = 11 待确认回单
......@@ -316,7 +324,7 @@ export const DELIEVER_AND_RECEIVE_INNER_STATUS = {
'5_1': 1,
'5_2': 2,
'7_1': 3,
'7_2': 4,
'8_1': 5,
'7_2': 4,
'8_1': 5,
'8_2': 6
}
import React, { useState } from 'react';
import React, { useState, useCallback } from 'react';
import { Modal} from 'antd';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
......@@ -7,14 +7,14 @@ import { createAsyncFormActions, FormEffectHooks } from '@formily/antd';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { schema } from './schema';
const actions = createAsyncFormActions();
const { onFieldInit$ } = FormEffectHooks
const { onFieldInit$, onFieldMount$ } = FormEffectHooks
const EnterPrise = ({visible, cancel, ...restProps}) => {
const [selectRow, memberRowCtl] = useRowSelectionTable({ customKey: 'memberId', type: 'radio' });
const fetchData = async (params: any) => {
const fetchData = useCallback(async (params: any) => {
let res = await PublicApi.getMemberManageLowerPageBynamerole(params);
return res;
};
}, []);
const onOk = () => {
restProps.onOk(memberRowCtl)
......@@ -22,6 +22,7 @@ const EnterPrise = ({visible, cancel, ...restProps}) => {
}
const effects = () => {
// 使用onFieldMount 会执行两次,暂时不知道为什么
onFieldInit$('roleId').subscribe((fieldState) => {
PublicApi.getMemberManageRoleSubList().then(res => {
let options = []
......@@ -35,7 +36,6 @@ const EnterPrise = ({visible, cancel, ...restProps}) => {
})
}
return (
<Modal
title="选择加工企业"
......@@ -44,14 +44,17 @@ const EnterPrise = ({visible, cancel, ...restProps}) => {
onCancel={cancel}
onOk={onOk}
>
<SearchForm
request={fetchData}
schema={schema}
actions={actions}
effects={effects}
expressionScope={{rowSelection: selectRow}}
></SearchForm>
{
visible
? <SearchForm
request={fetchData}
schema={schema}
actions={actions}
effects={effects}
expressionScope={{rowSelection: selectRow}}
></SearchForm>
: null
}
</Modal>
)
}
......
......@@ -19,7 +19,7 @@ const columns = [
title: '会员等级',
dataIndex: 'levelTag'
}
]
]
export const schema = {
type: 'object',
......@@ -98,7 +98,7 @@ export const schema = {
}
}
},
queryBtn: {
type: 'string',
'x-component': 'Submit',
......@@ -106,7 +106,7 @@ export const schema = {
"children": "查询",
}
}
}
}
}
}
},
......@@ -138,4 +138,4 @@ export const schema = {
}
},
}
}
\ No newline at end of file
}
......@@ -104,4 +104,4 @@ const SearchForm = (props) => {
)
}
export default SearchForm
\ No newline at end of file
export default SearchForm
......@@ -23,16 +23,6 @@ const expandRowColumn = [
const ProcessProducts = ({visible, cancel, rowSelection, ...restProps}) => {
// const [mainTableSelectRow, mainTableSelectRowCtl] = useRowSelectionTable({customKey: 'id'});
const [selectRow, selectRowCtl] = useRowSelectionTable({
customKey: 'fullId',
extendsSelection: {
getCheckboxProps: record => ({
disabled: record.purchaseCount - (record.processNum || 0) <= 0,
}),
}
});
const fetchData = useCallback(async (params: any) => {
const {orderTime, ...rest} = params
const {st, et} = timeRange(orderTime);
......@@ -85,12 +75,8 @@ const ProcessProducts = ({visible, cancel, rowSelection, ...restProps}) => {
},
// defaultExpandAllRows: true
}
// console.log("rowSelection",rowSelection);
const handleSubmit = () => {
// console.log(selectRowCtl, mainTableSelectRowCtl);
// console.log(selectRowCtl)
// restProps.onOk(selectRowCtl)
restProps.onOk()
cancel();
}
......@@ -117,16 +103,21 @@ const ProcessProducts = ({visible, cancel, rowSelection, ...restProps}) => {
</div>
}
>
<SearchForm
request={fetchData}
components={{Table}}
schema={schema}
actions={actions}
expressionScope={{
// rowSelection: tableSelectRow(),
expandable: expandable
}}
></SearchForm>
{
visible
? <SearchForm
request={fetchData}
components={{Table}}
schema={schema}
actions={actions}
expressionScope={{
// rowSelection: tableSelectRow(),
expandable: expandable
}}
></SearchForm>
: null
}
</Drawer>
)
}
......
......@@ -21,7 +21,7 @@ const columns = [
return ORDER_TYPE[text];
}
}
]
]
export const schema = {
type: 'object',
......@@ -96,11 +96,11 @@ export const schema = {
}
}
},
supplyMembersId: {
supplyMembersName: {
type: 'string',
'x-component': 'Select',
'x-component': 'Input',
'x-component-props': {
placeholder: '请选择采购会员',
placeholder: '请填写采购会员',
allowClear:true,
style: {
width: '150px',
......@@ -150,7 +150,7 @@ export const schema = {
"children": "查询",
}
}
}
}
}
}
},
......@@ -183,4 +183,4 @@ export const schema = {
}
},
}
}
\ No newline at end of file
}
......@@ -19,7 +19,8 @@ import {
CONFIRM_PENDING_SECOND,
CONFIRM_PENDING_CONFIRM,
SUPPLIER_OUTER_STATUS_COLOR,
PROCESS_OUTER_STATUS_COLOR
PROCESS_OUTER_STATUS_COLOR,
COMFIRM_TITLE_MAPS
} from '../../common'
import { timeRange } from '@/utils';
......@@ -214,7 +215,7 @@ const Query: React.FC<{}> = (props) => {
return (
<PageHeaderWrapper
title={'生产通知单查询'}
title={COMFIRM_TITLE_MAPS[pathname] || '生产通知单查询'}
>
<Card>
<StandardTable
......
......@@ -205,8 +205,8 @@ export const pendingFirstQuerySchema: ISchema = {
},
docTime: {
type: 'string',
default: undefined,
enum: [],
default: 0,
enum: docTime,
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
......
import React, { ReactText, useRef, useEffect, useLayoutEffect, useState } from 'react';
import { StandardTable } from 'god';
import { ISchema } from '@formily/antd';
import NestTable from '@/components/NestTable';
import { IStandardTableProps } from 'god/dist/src/standard-table';
import { Row, Col, Modal, Form, Radio } from 'antd';
import Search from '@/components//NiceForm/components/Search';
import SearchSelect from '@/components//NiceForm/components/SearchSelect';
import Submit from '@/components//NiceForm/components/Submit';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import DateSelect from '@/components//NiceForm/components/DateSelect';
import { PublicApi } from '@/services/api';
export interface ModalTableProps extends IStandardTableProps<any> {
width?: number,
confirm?: Function,
cancel?(),
visible?: boolean,
resetModal?: object,
modalType?: 'none',
useNestTable?: boolean, // 是否使用嵌套表格
nestColumns?: any[],
nestTableProps?: any,
// fix: 新增参数, 为true时每次开启弹窗都会重新reload接口
forceRender?: boolean,
searchName?: string
}
export const logisticsDeliverySearchSchema: ISchema = {
type: 'object',
properties: {
invoicesNo: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '单据号',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
orderNo: {
type: 'string',
"x-component-props": {
placeholder: '会员名称',
style: {
width: 160
}
}
},
invoicesAbstract: {
type: 'string',
"x-component-props": {
placeholder: '单据摘要',
style: {
width: 160
}
}
},
"[startTransactionTime,endTransactionTime]": {
type: 'string',
"x-component": "dateSelect",
"x-component-props": {
placeholder: '单据时间(全部)',
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
const ModalTableOrder: React.FC<ModalTableProps> = (props) => {
const { width = 704, confirm, cancel, visible, currentRef, resetModal, modalType = 'none', forceRender, useNestTable = false, nestColumns, nestTableProps, searchName, ...resetTable } = props
const selfRef = currentRef || useRef<any>({})
useEffect(() => {
if (visible && forceRender) {
// 重新开启时需reload接口
// fix: 去掉自动reload接口, 防止重复请求
// fix: 新增forceRender接口, 用于控制弹窗是否需要reload
selfRef.current.reload && selfRef.current.reload()
} else {
selfRef.current.resetField && selfRef.current.resetField({
validate: false
})
}
}, [visible])
const [form] = Form.useForm();
const [type, setType] = useState<number>(1);
const [modalTitle, setmodalTitle] = useState<string>('订单');
const modelSchemaRender = () => {
switch (modalType) {
case 'none': {
return logisticsDeliverySearchSchema
}
}
}
useEffect(() => {
form.setFieldsValue({
radio: type
})
fetchData()
}, [type])
const fetchData = (parmas?: any) => {
return new Promise(resolve => {
switch (type) {
case 1:
PublicApi.getOrderLogisticsOrderList({...parmas}).then(res => {
if(res.code === 1000) {
resolve(res.data)
}
})
break;
case 2:
break;
case 3:
break;
case 4:
break;
}
})
}
return (
<Modal
width={width}
title={modalTitle}
onOk={() => confirm(type)}
onCancel={cancel}
visible={visible}
{...resetModal}
>
{
useNestTable ? (
<NestTable
NestColumns={nestColumns}
className="common_tb"
rowClassName={(_, index) => (index % 2) === 0 && "tb_bg"}
{...nestTableProps}
/>
) : (
<StandardTable
tableType='small'
currentRef={selfRef}
fetchTableData={(params) => fetchData(params)}
formRender={(child, ps) => <Row justify='space-between' style={{ marginBottom: 16 }}>
<Col span={18} style={{ zIndex: 99 }}>
<Form form={form}>
<Form.Item name='radio' label='单据选择'>
<Radio.Group onChange={(e) => setType(e.target.value)}>
<Radio value={1}>订单</Radio>
<Radio value={2}>换货申请单(退货发货)</Radio>
<Radio value={3}>换货申请单(换货发货)</Radio>
<Radio value={4}>退货申请单</Radio>
</Radio.Group>
</Form.Item>
</Form>
</Col>
<Col style={{ marginTop: 4 }}>{ps}</Col>
<Col span={18} style={{ zIndex: 99 }}>{child}</Col>
</Row >}
formilyProps={
{
ctx: {
schema: modelSchemaRender(),
components: { ModalSearch: Search, SearchSelect, Submit, DateSelect },
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
searchName ? searchName : 'name',
FORM_FILTER_PATH,
);
}
}
}
}
{...resetTable}
/>
)
}
</Modal>
)
}
ModalTableOrder.defaultProps = {}
export default ModalTableOrder
......@@ -4,13 +4,14 @@
* @Author: HJX
*/
import React, { useState, useEffect } from 'react';
import { Form, Input, Button, Select } from 'antd';
import { Form, Input, Select } from 'antd';
import moment from 'moment';
import { ColumnType } from 'antd/lib/table/interface'
import { LinkOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import ShippingModal from '../../../components/sumbitOrderModal';
import InvoicesModal from '../../../components/sumbitOrderModal';
import ModalTable from '@/components/ModalTable';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import ModalTableOrder from './ModalTableOrder';
const { Search } = Input;
const { Option } = Select;
const layout: any = {
......@@ -22,15 +23,18 @@ const layout: any = {
export interface interfaceinfo {
set?: any,
currentRef?: any,
onGet?: Function
onGet?: Function,
onBadge?: Function,
}
const BasicInfo: React.FC<interfaceinfo> = (props) => {
const { set, currentRef, onGet } = props;
const { set, currentRef, onGet, onBadge } = props;
const [listcompany, setlistcompany] = useState<any>([]);//物流服务商
const [shipperaddress, setshipperaddress] = useState<any>([]);//发货地址
const [shippingvisible, setshippingvisible] = useState<boolean>(false);
const [invoicesvisible, setinvoicesvisible] = useState<boolean>(false);
const [shippingRowSelection, shippingRowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' });
const [invoicesRowSelection, invoicesRowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' });
const [form] = Form.useForm();
//获取物流服务商
const getListCompany = () => {
......@@ -109,18 +113,20 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
}
]
// 确定
const handleShipping = (type:any, values:any, param:any) => {
const handleShipping = () => {
const selectRow = shippingRowCtl.selectRow[0]
form.setFieldsValue({
shipmentOrderCode: values[0].invoicesNo
shipmentOrderCode: selectRow.invoicesNo
})
onGet(values[0], 2);
onGet(selectRow, 2);
setshippingvisible(false);
}
const handleInvoices = (type:any, values:any, param:any) => {
const handleInvoices = (type: number) => {
const selectRow = invoicesRowCtl.selectRow[0]
form.setFieldsValue({
invoicesNo: values[0].orderNo
invoicesNo: selectRow.orderNo
})
onGet(values[0], 3);
onGet(selectRow, 3, type);
setinvoicesvisible(false);
}
......@@ -154,6 +160,17 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
}
})
/** 选择发货单 列表数据 */
const fetchShippingData = (params:any) => {
return new Promise(resolve => {
PublicApi.getWarehouseInvoicesList({ ...params }).then(res => {
if(res.code === 1000) {
resolve(res.data)
}
})
})
}
return (
<>
<Form
......@@ -167,7 +184,7 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
<Select allowClear onChange={(value, option) => onGet(option, 1)}>
{
listcompany.map((item: any, index: number) => (
<Option key={item.id} value={item.id}>{item.name}</Option>
<Option roleid={item.roleId} memberid={item.memberId} key={item.id} value={item.id}>{item.name}</Option>
))
}
</Select>
......@@ -198,21 +215,33 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
<Form.Item label="单据时间" name='voucherTime'><span></span></Form.Item>
<Form.Item label="外部状态" name='externalState'><span></span></Form.Item>
</Form>
<ShippingModal
title='选择发货单'
{/* 选择发货单弹框 */}
<ModalTable
width={900}
modalTitle='选择发货单'
columns={shippingColumns}
type={2}
onOk={(type, values, param) => handleShipping(type, values, param)}
dialogVisible={shippingvisible}
onCancel={() => setshippingvisible(false)}
visible={shippingvisible}
rowSelection={shippingRowSelection}
cancel={() => setshippingvisible(false)}
confirm={handleShipping}
fetchTableData={params => fetchShippingData(params)}
resetModal={{destroyOnClose: true}}
tableProps={{rowKey: 'id'}}
modalType='logisticsDelivery'
searchName='invoicesNo'
/>
<InvoicesModal
title='选择订单'
{/* 选择订单/换货申请单(退货发货)/换货申请单(换货发货)/退货申请单 */}
<ModalTableOrder
width={900}
visible={invoicesvisible}
columns={invoicesColumns}
type={1}
onOk={(type, values, param) => handleInvoices(type, values, param)}
dialogVisible={invoicesvisible}
onCancel={() => setinvoicesvisible(false)}
resetModal={{destroyOnClose: true}}
tableProps={{rowKey: 'id'}}
modalType='none'
searchName='invoicesNo'
rowSelection={invoicesRowSelection}
cancel={() => setinvoicesvisible(false)}
confirm={handleInvoices}
/>
</>
)
......
import React from 'react';
import { Button, Input, Table, Row, Col, Statistic } from 'antd';
import React, { useState } from 'react';
import { Button, Input, Table, Row, Col, Statistic, message, Form } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { PlusOutlined } from '@ant-design/icons';
import ModalTable from '@/components/ModalTable'
import { PublicApi } from '@/services/api';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
interface goodsParamsProps {
currentRef?: any,
set?: any
set?: any,
onGet?: Function,
onBadge?: Function,
}
const AddGoods: React.FC<goodsParamsProps> = (props) => {
const { currentRef, set, onGet, onBadge } = props;
const [form] = Form.useForm();
const [visible, setvisible] = useState<boolean>(false);
const [rowSelection, SelectionRowCtl] = useRowSelectionTable({ customKey: 'productId' });
const [data, setdata] = useState<Array<any>>([]);
const columns: ColumnType<any>[] = [
{
title: 'ID',
......@@ -39,40 +48,61 @@ const AddGoods: React.FC<goodsParamsProps> = (props) => {
{
title: '数量',
key: 'amount',
width: 120,
dataIndex: 'amount',
render: (text: any, record: any) =>
<Input />
<Form.Item noStyle initialValue={record.amount} rules={[{ required: true, message: '请输入数量' }]}>
<Input type='number' min={1} onBlur={(e) => inputOnchange(record.productId, e, 'amount')} />
</Form.Item>
},
{
title: '箱数',
key: 'carton',
width: 120,
dataIndex: 'carton',
render: (text: any, record: any) =>
<Input />
<Form.Item noStyle initialValue={record.carton} rules={[{ required: true, message: '请输入箱数' }]}>
<Input type='number' min={1} onBlur={(e) => inputOnchange(record.productId, e, 'carton')} />
</Form.Item>
},
{
title: '重量 (KG)',
key: 'weight',
width: 120,
dataIndex: 'weight',
render: (text: any, record: any) =>
<Input />
<Form.Item noStyle initialValue={record.weight} rules={[{ required: true, message: '请输入重量 (KG)' }]}>
<Input type='number' min={1} onBlur={(e) => inputOnchange(record.productId, e, 'weight')} />
</Form.Item>
},
{
title: '体积 (M3)',
key: 'volume',
width: 120,
dataIndex: 'volume',
render: (text: any, record: any) =>
<Input />
<Form.Item noStyle initialValue={record.volume} rules={[{ required: true, message: '请输入体积 (M3)' }]}>
<Input type='number' min={1} onBlur={(e) => inputOnchange(record.productId, e, 'volume')} />
</Form.Item>
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) =>
<Input />
render: (text: any, record: any, index: number) => <Button type='link' onClick={() => onHandleDelect(index)}>删除</Button>
}
]
/** 删除 */
const onHandleDelect = (idx: number) => {
const list = [...data];
list.splice(idx, 1);
SelectionRowCtl.setSelectRow(list)
SelectionRowCtl.setSelectedRowKeys(list.map(v => v.productId));
setdata(list)
console.log(idx)
}
/**选择商品弹框表头 */
const columnsTable: ColumnType<any>[] = [
{
......@@ -98,27 +128,118 @@ const AddGoods: React.FC<goodsParamsProps> = (props) => {
]
/**获取商品列表 */
const fetchProductList = (params:any) => {
const fetchProductList = (params: any) => {
return new Promise(resolve => {
PublicApi.getOrderProcurementOrderProductPageList({ id: set.shipmentOrderId, ...params }).then(res => {
if (res.code === 1000) {
const arr: any = [];
res.data.data.forEach((item: any) => {
arr.push({
productId: item.productId,
productName: item.productName,
categoryName: item.category,
brandName: item.brand,
unitName: item.unit,
amount: item.amount,
carton: item.carton,
weight: item.weight,
volume: item.volume
})
})
res.data.data = arr
resolve(res.data)
}
})
})
}
/** 打开添加商品 */
const openModal = () => {
const dataInfo = { ...set };
if (Object.keys(dataInfo).length > 0 && dataInfo.shipmentOrderId) {
if (data.length > 0) {
SelectionRowCtl.setSelectRow([...data])
}
console.log(SelectionRowCtl.selectRow)
setvisible(true)
} else {
message.error('请先选择要操作的对应发货单号或对应订单号/售后单')
}
}
/** 确定添加商品 */
const onconfirm = () => {
const list = SelectionRowCtl.selectRow;
const arr: any[] = []
list.forEach((item: any) => {
arr.push({
productId: item.productId,
productName: item.productName,
categoryName: item.categoryName,
brandName: item.brandName,
unitName: item.unitName,
amount: item.amount,
carton: item.carton,
weight: item.weight,
volume: item.volume
})
})
setdata([...arr])
setvisible(false)
}
/**输入框输入 */
const inputOnchange = (id, e, name) => {
const { value } = e.target
data.forEach(v => {
if (v.productId === id) {
v[name] = value
}
})
onGet([...data]) // 返回给父级
setdata([...data])
countTotal(name)
}
/** 计算总数 */
const countTotal = (name?: string) => {
let num: any = 0
data.forEach((item: any, idx: number) => {
if (name === 'carton') {
num += item.carton ? Number(item.carton) : 0
} else if (name === 'weight') {
num += item.weight ? Number(item.weight) : 0
} else if (name === 'volume') {
num += item.volume ? Number(item.volume) : 0
}
})
return num
}
return (
<>
<Button block type='dashed' style={{ marginBottom: '24px' }}><PlusOutlined />添加商品</Button>
<Table columns={columns} />
<Button block type='dashed' style={{ marginBottom: '24px' }} onClick={openModal}><PlusOutlined />添加商品</Button>
<Form form={form}>
<Table columns={columns} dataSource={data} rowKey={'productId'} pagination={false} />
</Form>
<Row gutter={[24, 24]} style={{ margin: '0 0 0 65%', width: '35%' }}>
<Col span={8}><Statistic title="总箱数(箱)" value={112893} /></Col>
<Col span={8}><Statistic title="总重量(KG)" value={112893} /></Col>
<Col span={8}><Statistic title="总体积(M3)" value={112893} /></Col>
<Col span={8}><Statistic title="总箱数(箱)" value={countTotal('carton')} /></Col>
<Col span={8}><Statistic title="总重量(KG)" value={countTotal('weight')} /></Col>
<Col span={8}><Statistic title="总体积(M3)" value={countTotal('volume')} /></Col>
</Row>
{/* 选择商品弹框 */}
{/* <ModalTable
<ModalTable
width={900}
modalTitle='选择商品'
columns={columnsTable}
visible={visible}
rowSelection={rowSelection}
fetchTableData={params => fetchProductList(params)}
/> */}
resetModal={{ destroyOnClose: true }}
tableProps={{ rowKey: 'productId' }}
cancel={() => setvisible(false)}
confirm={() => onconfirm()}
/>
</>
)
}
......
......@@ -3,16 +3,24 @@
* @Date: 2020-11-06
* @Author: HJX
*/
import React, { useState, useRef } from 'react';
import { Button, Card, Tabs } from 'antd';
import React, { useState, useRef, useEffect } from 'react';
import { Button, Card, Tabs, Form, message, Badge } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ReturnEle from '@/components/ReturnEle';
import { history } from 'umi';
import Table from './components/table';//流转记录
import BasicInfo from './components/basicInfo';//基本信息
import Goods from './components/goods';//物流单明细
import { PublicApi } from '@/services/api';
const { TabPane } = Tabs
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 9 },
labelAlign: "left"
};
const AddEditLogistics: React.FC<{}> = () => {
const basic = useRef<any>();
// 用于提交的
......@@ -23,47 +31,92 @@ const AddEditLogistics: React.FC<{}> = () => {
shipmentOrderCode: '',//发货单号 1
relevanceOrderId: '',//对应订单id
invoicesNo: '',//对应单据编号 1
relevanceType: '',//对应单据类型 1-订单 2-换货申请单(退货发货) 3-换货申请单(换货发货) 4-退货申请单
relevanceType: 1,//对应单据类型 1-订单 2-换货申请单(退货发货) 3-换货申请单(换货发货) 4-退货申请单
receiverName: '',//收货方名称1
receiverAddressId: '',//收货方id 1
shipperAddressId: '',//发货方id
phone: '',
receiverFullAddress: '',
detailList: [],//物流单明细列表 ,LogisticsOrderDetailRequest
})
const [data, setData] = useState<any>({})
const [settlementMethod, setSettlementMethod] = useState<any>();
const [memberInfo, setmemberInfo] = useState<any>({});
const [badge, setbadge] = useState<any>([0,0,0])
// 提交数据
const handleSubmit = async () => {
const basicRef = await basic.current.get();
if (basicRef.state) {
console.log(basicRef.data);
if( parmas.detailList.length > 0) {
const data = { ...basicRef.data };
data.invoicesNo = parmas.invoicesNo;
data.receiverMemberId = parmas.receiverMemberId;
data.receiverMemberName = parmas.receiverMemberName;
data.relevanceType = parmas.relevanceType;
data.detailList = parmas.detailList;
console.log(data, '提交的数据源');
}
}
}
const getBasicInfo = (value: any, index: number) => {
const getBasicInfo = (value: any, index: number, type?: number) => {
const data = { ...parmas };
if (index === 1) {
data.companyName = value.children
setmemberInfo({memberId: value.memberid,roleId: value.roleid})
} else if (index === 2) {
data.shipmentOrderCode = value.invoicesNo;//发货单号
data.receiverPhone = value.phone;
data.receiverName = value.receiverName;//收货方名称
data.receiverFullAddress = value.fullAddress;
data.receiverMemberName = value.memberName;
data.invoicesId = value.id
} else if (index === 3 && !data.invoicesNo) {
data.shipmentOrderId = value.id
} else if (index === 3 && !data.shipmentOrderId) {
data.receiverPhone = value.phone;
data.receiverName = value.receiverName;//收货方名称
data.receiverFullAddress = value.fullAddress;
data.receiverMemberName = value.memberName;
data.invoicesId = value.id
data.shipmentOrderId = value.id
data.relevanceType = type;
} else {
data.shipperFullAddress = value.children
}
setParmas(data)
}
/**必填没填写出现角标 */
const getError = (num:number, idx:number) => {
const data = [...badge];
data[idx] = num;
setbadge(data);
console.log(num, idx)
}
const getGoodsList = (list:any) => {
const data = {...parmas}
data.detailList = list;
setParmas(data);
}
useEffect(() => {
if(Object.keys(memberInfo).length > 0) {
PublicApi.getSettleAccountsPlatformConfigGetSettlementWay({...memberInfo}).then(res => {
if(res.code === 1000) {
console.log(res.data)
}
}).catch(error => {
message.error(error.message)
})
}
}, [memberInfo])
const TabFormErrors = (props) => {
return (
<Badge count={props.dot} offset={[5, -5]}>
{props.children}
</Badge>
)
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
......@@ -72,19 +125,31 @@ const AddEditLogistics: React.FC<{}> = () => {
>
<Card>
<Tabs type="card">
<TabPane key='tab-1' tab='基本信息'>
<TabPane key='tab-1' tab={<TabFormErrors dot={badge[0]}>基本信息</TabFormErrors>}>
<BasicInfo
currentRef={basic}
set={parmas}
onBadge={getError}
onGet={getBasicInfo}
/>
</TabPane>
<TabPane key='tab-2' tab='物流单明细'>
<TabPane key='tab-2' tab={<TabFormErrors dot={badge[1]}>物流单明细</TabFormErrors>}>
<Goods
set={parmas}
onBadge={getError}
onGet={getGoodsList}
/>
</TabPane>
<TabPane key='tab-3' tab='运费'></TabPane>
<TabPane key='tab-3' tab='运费'>
<Form {...layout}>
<Form.Item label='运费'>
<span></span>
</Form.Item>
<Form.Item label='结算方式'>
<span></span>
</Form.Item>
</Form>
</TabPane>
<TabPane key='tab-4' tab='流转记录'>
<Table />
</TabPane>
......
......@@ -77,8 +77,8 @@ const AddBrand: React.FC<{}> = () => {
setFormValues(data)
form.setFieldsValue(data)
setlogoUrl(data.logoUrl)
if(data.status === 4)
setBanSomeField(true)
// if(data.status === 4)
// setBanSomeField(true)
// 多图回显
let proveImgs = Object.values(data.proveUrl)
let files = [];
......@@ -123,7 +123,7 @@ const AddBrand: React.FC<{}> = () => {
};
const handleChange = ({ fileList }) =>setFileList(fileList)
const handleSave = () => {
form.validateFields().then((values:any) => {
console.log(values,'vvv')
......
......@@ -43,6 +43,11 @@ const Trademark: React.FC<{}> = () => {
render: (text: any, record: any) => <span className="commonPickColor" onClick={() => handleSee(record)}>{text}&nbsp;<EyeOutlined /></span>
},
{
title: '原品牌',
dataIndex: ['sourceBrand', 'name'],
key: 'sourceBrand',
},
{
title: '申请审核时间',
dataIndex: 'applyTime',
key: 'applyTime',
......
......@@ -6,8 +6,8 @@ import { PublicApi } from '@/services/api'
/**
* @description: 公用
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const commonEnquieryOfferSchema: ISchema = {
type:'object',
......@@ -63,7 +63,7 @@ export const commonEnquieryOfferSchema: ISchema = {
inquiryListNo:{//需求单号
type:'string',
"x-mega-props":{
},
"x-component-props":{
placeholder:'询价单号'
......@@ -114,7 +114,7 @@ export const commonEnquieryOfferSchema: ISchema = {
sumbit:{
"x-component":'Submit',
"x-mega-props":{
span:1
span:1
},
"x-component-props":{
children:'查询'
......@@ -127,8 +127,8 @@ export const commonEnquieryOfferSchema: ISchema = {
/**
* @description: 需求报价-需求单查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const enquierySearchSchema: ISchema = {
type:'object',
......@@ -226,8 +226,8 @@ export const enquierySearchSchema: ISchema = {
/**
* @description: 需求报价-报价查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const enquieryOfferSearchSchema: ISchema = {
type:'object',
......@@ -323,8 +323,8 @@ export const enquieryOfferSearchSchema: ISchema = {
/**
* @description: 报价单新增编辑-需求单查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const dialogEqformSearch: ISchema = {
type:'object',
......@@ -406,7 +406,7 @@ export const dialogEqformSearch: ISchema = {
}
/**
* @description: 报价单查询-搜索
* @param {type}
* @param {type}
* @return {type}
*/
export const quoteFormSearch: ISchema = {
......@@ -515,4 +515,4 @@ export const quoteFormSearch: ISchema = {
}
}
}
}
\ No newline at end of file
}
......@@ -6,8 +6,8 @@ import { PublicApi } from '@/services/api'
/**
* @description: 待审核询价单
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const pendingReviewSchema: ISchema = {
type: 'object',
......@@ -98,8 +98,8 @@ export const pendingReviewSchema: ISchema = {
/**
* @description: 询价报价
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const inquiryQuoteSchema: ISchema = {
type: 'object',
......
......@@ -8,7 +8,6 @@ import { useUpdate } from '@umijs/hooks';
import { PublicApi } from '@/services/api';
import { filterProductDataById } from '../components/productModalTable'
import { getUnitPriceTotal } from '../model/useProductTable';
import { toPercent } from '@/utils/type';
// 异步填充表格字段
const asyncPadDataForProduct = async (ctx: ISchemaFormActions | ISchemaFormAsyncActions, productValue: any) => {
......@@ -86,7 +85,7 @@ export const useEditHideField = () => {
})
}
export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update, editData) => {
export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => {
const { pageStatus } = usePageStatus()
FormEffectHooks.onFieldValueChange$('orderProductRequests').subscribe(state => {
......@@ -157,7 +156,6 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
// }
return assign
}).sort((prev, next) => prev.disabled ? prev.value : next.value - prev.value)
console.log(state.props.enum)
})
......
......@@ -5,7 +5,7 @@ import ReutrnEle from '@/components/ReturnEle'
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'
import { Button, Card, Row, Col, Drawer, message } from 'antd'
import { createFormActions, registerVirtualBox, useFormSpy, createAsyncFormActions } from '@formily/antd'
import { SaveOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons'
import { SaveOutlined, LinkOutlined, PlusOutlined, CodeSandboxCircleFilled } from '@ant-design/icons'
import NiceForm from '@/components/NiceForm'
import { orderDetailSchema, orderAddSchema, mergeAllSchemas } from './schema'
import { useModelTypeChange, useEditHideField, useOrderFormInitEffect, useProductTableChangeForPay } from './effects'
......@@ -30,7 +30,6 @@ import { changeRouterTitleByStatus } from '../../_public/order/utils'
import { ReadyAddOrderDetailContext } from '../context'
import AuditProcess from '@/components/AuditProcess'
import styles from './index.less'
import { toPoint } from '@/utils/type'
export interface PurchaseOrderDetailProps {}
......@@ -208,7 +207,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// theInvoiceInfo: (value.typeof value.theInvoiceId === 'object' ? value.theInvoiceId : null
// theInvoiceInfo: value.theInvoiceInfo
}
console.log(params, 'params')
// 校验是否选择支付渠道
let judgementByPay = params.paymentInformationResponses.map(item => {
if(item.channel && item.payWay){
......@@ -244,7 +242,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
break;
}
}
console.log(fnResult, 'fnResult')
if (fnResult.code === 1000) {
// 跳转至待新增列表
window.sessionStorage.removeItem(spam_id)
......@@ -379,7 +376,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// }
})
}
console.log(initFormValue, 'init')
})
// 监听商品总价的变更, 此处逻辑需优化
$('sumPrice').subscribe(payload => {
......@@ -452,7 +448,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
})
useEditHideField()
// 商品信息的改动 驱动支付信息变化
useProductTableChangeForPay(ctx, update, initFormValue)
useProductTableChangeForPay(ctx, update)
}}
expressionScope={{
orderNoPrice,
......
......@@ -5,7 +5,6 @@ import { productInfoColumns } from '../constant';
import ProductTableCell, { ProductEditableRow } from '../components/productTableCell';
import { useModalTable } from './useModalTable';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { toPoint } from '@/utils/type';
// 对象按key排序(运用于商城传过来的阶梯价格排序)
export const sortByKey = (params) => {
......@@ -100,6 +99,9 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
}
const handleSave = row => {
// 商品采购数量变动 清空之前的支付信息
ctx.setFieldValue('paymentInformationResponses', [])
return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('orderProductRequests')];
const index = newData.findIndex(item => row.id === item.id);
......
......@@ -321,6 +321,9 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
visible={visibleChannelRroduct}
columns={columnsSetProduct}
rowSelection={productRowSelection}
resetModal={{
destroyOnClose: true
}}
fetchTableData={params => fetchProductList(params)}
formilyProps={
{
......
......@@ -96,12 +96,7 @@ export function timeRange(val: number) {
).valueOf();
break;
case 7:
st = moment(
moment()
.year(moment().year() - 1)
.startOf('year')
.format('YYYY-MM-DD HH:mm:ss'),
).valueOf();
st = moment('1971-01-01', 'YYYY-MM-DD').valueOf(); // 或者0
et = moment(
moment()
.year(moment().year() - 1)
......
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