Commit e2a2f68c authored by GuanHua's avatar GuanHua

Merge branch 'dev-srm' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into dev-srm

parents c234445e fad1d835
......@@ -57,18 +57,6 @@ const logisticsDetail: React.FC = () => {
const { data } = await PublicApi.getSettleAccountsMemberSettlementPagePayableLogisticsSettlement(postData)
return data
}
// useEffect(() => {
// if(id) {
// // 获取详情
// async function fetchDetail() {
// const { data } = await PublicApi.getSettleAccountsMemberSettlementGetPayableDetail({id})
// setInfoDetail(data);
// }
// fetchDetail();
// }
// }, [id])
/**
* 搜索
*/
......
......@@ -18,6 +18,7 @@ interface Iprops {
formatData?: <T, P>(params: T) => P,
effects: ($: any, actions: any) => void,
expressionScope?: any,
components?: any,
tableProps?: {
rowKey: string | ((record: any) => any)
}
......@@ -32,7 +33,7 @@ interface Iprops {
const formActions = createFormActions();
const CustomizeQueryList: React.FC<Iprops> = React.forwardRef((props: Iprops, ref: any) => {
const { columns, schema, fetchListData, expressionScope, effects, rowSelection, tableProps, formatData } = props;
const { columns, schema, fetchListData, expressionScope, effects, rowSelection, tableProps, formatData, components } = props;
const tableRef = useRef<any>({});
useImperativeHandle(ref, () => ({
......@@ -68,6 +69,7 @@ const CustomizeQueryList: React.FC<Iprops> = React.forwardRef((props: Iprops, re
actions={formActions}
onSubmit={values => onRresh(values)}
expressionScope={expressionScope}
components={components}
effects={($, actions) => handleEffects($, actions)}
/>
}
......@@ -78,6 +80,7 @@ const CustomizeQueryList: React.FC<Iprops> = React.forwardRef((props: Iprops, re
CustomizeQueryList.defaultProps = {
expressionScope: {},
components: {},
effects: null,
tableProps: {
rowKey: 'id'
......
import React, { useRef, useState } from 'react';
import React, { useCallback, useMemo, useRef, useState } from 'react';
import { Card, Space, Button, Spin } from 'antd'
import { StandardTable } from 'god';
import NiceForm from '@/components/NiceForm';
......@@ -53,7 +53,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
}
])
const controllerBtns = (
const controllerBtns = () => (
<Space>
<Link to={"/memberCenter/memberAbility/memberEvaluate/createEvaluate/add"}>
<Button type="primary" icon={<PlusOutlined />}>新建</Button>
......@@ -68,24 +68,25 @@ const List: React.FC<Iprops> = (props: Iprops) => {
return result
}
const handlePublic = async (ids: number[]) => {
setSubmitLoading(true)
const handlePublic = useCallback(async (ids: number[]) => {
rowController.setSelectedRowKeys((prev: string[]) => prev.filter((_item) => !ids.includes(_item)));
setSubmitLoading(() => true)
const { code, data } = await PublicApi.postMemberAppraisalWaitPublishPublish({ids: ids});
setSubmitLoading(false)
setSubmitLoading(() => false)
if (code === 1000) {
ref.current?.submit();
}
}
}, [ref])
const handleBatchRemove = async (ids: number[]) => {
setSubmitLoading(true)
const handleBatchRemove = useCallback(async (ids: number[]) => {
setSubmitLoading(() => true)
const { code, data } = await PublicApi.postMemberAppraisalDelete({ids: ids});
setSubmitLoading(false)
setSubmitLoading(() => false)
if (code === 1000) {
ref.current?.submit();
}
}
}, [ref])
return (
<Card>
......@@ -95,9 +96,10 @@ const List: React.FC<Iprops> = (props: Iprops) => {
schema={evaluationListSchema}
rowSelection={rowSelection as any}
fetchListData={handleFetch}
expressionScope={{
controllerBtns,
components={{
controllerBtns: controllerBtns
}}
// expressionScope={{}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH);
useAsyncSelect('status', fetchStatusOptions);
......
......@@ -3,6 +3,7 @@ import { ColumnsType } from 'antd/es/table';
import { Link } from 'umi';
import StatusTag from '@/components/StatusTag';
import { PublicApi } from '@/services/api';
import moment from 'moment';
type OptionType = {
label: string,
......@@ -36,13 +37,13 @@ const commonColumns = [
{
title: '考评完成时间',
dataIndex: 'completeDay',
sorter: (_a, _b) => _a.date - _b.date,
sorter: (_a, _b) => moment(_a.completeDay).valueOf() - moment(_b.completeDay).valueOf(),
},
{
title: '内部状态',
dataIndex: 'status',
filters: [],
onFilter: (_value, record) => record.type === _value,
onFilter: (_value, record) => record.status === _value,
render: (text, record) => {
const offset = record.status % (TYPE.length)
return (
......
......@@ -22,10 +22,11 @@ export const evaluationListSchema: ISchema = {
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
// 'x-component': 'Children',
// 'x-component-props': {
// children: '{{controllerBtns}}',
// },
"x-component": 'controllerBtns'
},
name: {
type: 'string',
......
import React, { useRef, useState } from 'react';
import React, { useCallback, useRef, useState } from 'react';
import { Card, Space, Button } from 'antd'
import useEvaluateColumn,{ setColumnsByLinks } from '../hooks/useEvaluateColumn';
import { evaluationListSchema } from '../schema';
......@@ -34,28 +34,29 @@ const List: React.FC<Iprops> = (props: Iprops) => {
}
])
const controllerBtns = (
const controllerBtns = () => (
<Space>
<Button loading={submitLoading} onClick={() => handleBatchNotice(rowController.selectedRowKeys)} >批量通报</Button>
</Space>
)
const handleBatchNotice = async (ids: number[]) => {
const handleBatchNotice = useCallback(async (ids: number[]) => {
rowController.setSelectedRowKeys((prev: string[]) => prev.filter((_item) => !ids.includes(_item)));
setSubmitLoading(true)
const { code, data } = await PublicApi.postMemberAppraisalWaitNotificationNotification({ids: ids});
setSubmitLoading(false)
if (code === 1000) {
ref.current?.submit();
}
}
}, [ref])
const handleFetch = async (params: GetMemberAppraisalWaitNotificationPageRequest) => {
const handleFetch = useCallback(async (params: GetMemberAppraisalWaitNotificationPageRequest) => {
const result = fetchListData(PublicApi.getMemberAppraisalWaitNotificationPage, params);
return result
}
}, [])
return (
<Card>
......@@ -65,7 +66,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
rowSelection={rowSelection as any}
schema={evaluationListSchema}
fetchListData={handleFetch}
expressionScope={{controllerBtns}}
components={{controllerBtns}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH);
useAsyncSelect('status', fetchStatusOptions);
......
import React, { useRef, useState } from 'react';
import React, { useCallback, useRef, useState } from 'react';
import { Card, Space, Button } from 'antd'
import useEvaluateColumn,{ setColumnsByLinks } from '../hooks/useEvaluateColumn';
import { evaluationListSchema } from '../schema';
......@@ -34,25 +34,26 @@ const List: React.FC<Iprops> = (props: Iprops) => {
}
])
const controllerBtns = (
const controllerBtns = () => (
<Space>
<Button loading={submitLoading} onClick={() => handleBatchUpdate(rowController.selectedRowKeys)} type="ghost">批量审核通过</Button>
</Space>
)
const handleBatchUpdate = async (ids: number[]) => {
setSubmitLoading(true)
const handleBatchUpdate = useCallback(async (ids: number[]) => {
rowController.setSelectedRowKeys((prev: string[]) => prev.filter((_item) => !ids.includes(_item)));
setSubmitLoading(() => true)
const { code, data } = await PublicApi.postMemberAppraisalWaitAuditOneAuditBatch({ids: ids});
setSubmitLoading(false)
setSubmitLoading(() => false)
if (code === 1000) {
ref.current?.submit();
}
}
}, [ref])
const handleFetch = async (params: GetMemberAppraisalWaitAuditOnePageRequest) => {
const handleFetch = useCallback(async (params: GetMemberAppraisalWaitAuditOnePageRequest) => {
const result = fetchListData(PublicApi.getMemberAppraisalWaitAuditOnePage, params);
return result
}
}, [])
return (
<Card>
......@@ -62,7 +63,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
rowSelection={rowSelection as any}
schema={evaluationListSchema}
fetchListData={handleFetch}
expressionScope={{controllerBtns}}
components={{controllerBtns}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH);
useAsyncSelect('status', fetchStatusOptions);
......
......@@ -34,14 +34,14 @@ const List: React.FC<Iprops> = (props: Iprops) => {
}
])
const controllerBtns = (
const controllerBtns = () => (
<Space>
<Button loading={submitLoading} onClick={() => handleBatchUpdate(rowController.selectedRowKeys)} >批量审核通过</Button>
</Space>
)
const handleBatchUpdate = async (ids: number[]) => {
console.log(123);
const handleBatchUpdate = async (ids: string[]) => {
rowController.setSelectedRowKeys((prev: string[]) => prev.filter((_item) => !ids.includes(_item)));
setSubmitLoading(true)
const { code, data } = await PublicApi.postMemberAppraisalWaitAuditTwoAuditBatch({ids: ids});
setSubmitLoading(false)
......@@ -63,7 +63,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
rowSelection={rowSelection as any}
schema={evaluationListSchema}
fetchListData={handleFetch}
expressionScope={{controllerBtns}}
components={{controllerBtns}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH);
useAsyncSelect('status', fetchStatusOptions);
......
......@@ -131,13 +131,13 @@ export const useBidDetail = (options: OrderDetailHookProps) => {
setExternalProcurementOrderLogResponses(outRecordRes.data)
}
// // 流程状态(内/外)
// // 招投标
// const processRes = await PublicApi.getPurchaseInviteTenderGetInviteTenderProcess({ inviteTenderId: searchId })
// if(processRes.code === 1000 && processRes.data) {
// setInteriorWorkflowFlowRecordLogResponses(processRes.data.subProcess.userTaskList)
// setExternalWorkflowFlowRecordLogResponses(processRes.data.userTaskList)
// }
// 流程状态(内/外)
// 招投标
const processRes = await PublicApi.getPurchaseInviteTenderGetInviteTenderProcess({ inviteTenderId: searchId })
if(processRes.code === 1000 && processRes.data) {
setInteriorWorkflowFlowRecordLogResponses(processRes.data.subProcess.userTaskList)
setExternalWorkflowFlowRecordLogResponses(processRes.data.userTaskList)
}
}
}, [id])
......
......@@ -59,13 +59,13 @@ export const useConfirmDetail = (options: {}) => {
setExternalProcurementOrderLogResponses(outRecordRes.data)
}
// // 流程状态(内/外)
// // 招投标
// const processRes = await PublicApi.getPurchaseInviteTenderGetInviteTenderProcess({ inviteTenderId: searchId })
// if(processRes.code === 1000 && processRes.data) {
// setInteriorWorkflowFlowRecordLogResponses(processRes.data.subProcess.userTaskList)
// setExternalWorkflowFlowRecordLogResponses(processRes.data.userTaskList)
// }
// 流程状态(内/外)
// 招投标
const processRes = await PublicApi.getPurchaseInviteTenderGetInviteTenderProcess({ inviteTenderId: searchId })
if(processRes.code === 1000 && processRes.data) {
setInteriorWorkflowFlowRecordLogResponses(processRes.data.subProcess.userTaskList)
setExternalWorkflowFlowRecordLogResponses(processRes.data.userTaskList)
}
}
}, [id])
......
......@@ -51,13 +51,13 @@ export const useRemarkDetail = (options: DetailHookProps) => {
setExternalProcurementOrderLogResponses(outRecordRes.data)
}
// // 流程状态(内/外)
// // 招投标
// const processRes = await PublicApi.getPurchaseInviteTenderGetInviteTenderProcess({ inviteTenderId: searchId })
// if(processRes.code === 1000 && processRes.data) {
// setInteriorWorkflowFlowRecordLogResponses(processRes.data.subProcess.userTaskList)
// setExternalWorkflowFlowRecordLogResponses(processRes.data.userTaskList)
// }
// 流程状态(内/外)
// 招投标
const processRes = await PublicApi.getPurchaseInviteTenderGetInviteTenderProcess({ inviteTenderId: searchId })
if(processRes.code === 1000 && processRes.data) {
setInteriorWorkflowFlowRecordLogResponses(processRes.data.subProcess.userTaskList)
setExternalWorkflowFlowRecordLogResponses(processRes.data.userTaskList)
}
}
}, [id])
......
......@@ -53,13 +53,13 @@ export const useNoticeDetail = (options: DetailHookProps) => {
setExternalProcurementOrderLogResponses(outRecordRes.data)
}
// // 流程状态(内/外)
// // 招投标
// const processRes = await PublicApi.getPurchaseInviteTenderGetInviteTenderProcess({ inviteTenderId: searchId })
// if(processRes.code === 1000 && processRes.data) {
// setInteriorWorkflowFlowRecordLogResponses(processRes.data.subProcess.userTaskList)
// setExternalWorkflowFlowRecordLogResponses(processRes.data.userTaskList)
// }
// 流程状态(内/外)
// 招投标
const processRes = await PublicApi.getPurchaseInviteTenderGetInviteTenderProcess({ inviteTenderId: searchId })
if(processRes.code === 1000 && processRes.data) {
setInteriorWorkflowFlowRecordLogResponses(processRes.data.subProcess.userTaskList)
setExternalWorkflowFlowRecordLogResponses(processRes.data.userTaskList)
}
}
}, [id])
......
......@@ -55,13 +55,13 @@ export const useReportDetail = (options: DetailHookProps) => {
setExternalProcurementOrderLogResponses(outRecordRes.data)
}
// // 流程状态(内/外)
// // 招投标
// const processRes = await PublicApi.getPurchaseInviteTenderGetInviteTenderProcess({ inviteTenderId: searchId })
// if(processRes.code === 1000 && processRes.data) {
// setInteriorWorkflowFlowRecordLogResponses(processRes.data.subProcess.userTaskList)
// setExternalWorkflowFlowRecordLogResponses(processRes.data.userTaskList)
// }
// 流程状态(内/外)
// 招投标
const processRes = await PublicApi.getPurchaseInviteTenderGetInviteTenderProcess({ inviteTenderId: searchId })
if(processRes.code === 1000 && processRes.data) {
setInteriorWorkflowFlowRecordLogResponses(processRes.data.subProcess.userTaskList)
setExternalWorkflowFlowRecordLogResponses(processRes.data.userTaskList)
}
}
}, [id])
......
......@@ -333,9 +333,8 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
paymentInformationId: PayInfoObj.id,
// 大于100为账期月结 id固定为-1
payTypeId: checked.id >= 100 ? -1 : checked.id,
payType: checked.channel,
payType: checked.id >= 100 ? current : checked.channel,
}
if(payStep === 2) {
if(code.length != number.length){
return message.error('请输入支付密码')
......
......@@ -100,10 +100,10 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
<Col>{v.payNode}</Col>
</Row>
{
v.channel === -1 ?
v.payWay === -1 ?
<Row>
<Col className={style.fontGray} span={4}>支付方式: </Col>
<Col>{v.payWay === 5 ? '账期' : '月结'}</Col>
<Col>{v.channel === 100 ? '账期' : '月结'}</Col>
</Row>
:
<>
......
......@@ -185,9 +185,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
orderProductRequests: [],
deliveryTime: formatTimeString(data.deliveryTime)
})
// setTimeout(() => {
// addSchemaAction.setFieldValue('orderProductRequests', _orderProductRequests)
// }, 1000)
setTimeout(() => {
addSchemaAction.setFieldValue('orderProductRequests', _orderProductRequests)
}, 1000)
setFormLoading(false)
})
}
......
......@@ -27,12 +27,15 @@ const fetchTableData = async (params) => {
}
const formActions = createFormActions();
const destroyActions = createFormActions()
const destroyActions = createFormActions();
const pauseActions = createFormActions();
const SaleOrder: React.FC<SaleOrderProps> = (props) => {
const ref = useRef<any>({})
const destoryRef = useRef<any>({})
const pauseRef = useRef<any>({})
const { run, loading } = useHttpRequest(PublicApi.postOrderPurchaseOrderCancel)
const { run: runPause, loading: loadingEnd } = useHttpRequest(PublicApi.postOrderSuspension)
// 提交取消
const handleSubmit = useCallback(() => {
......@@ -47,6 +50,19 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
})
}, [])
// 提交中止
const handleSubmitPause = useCallback(() => {
pauseActions.submit().then(async ({values}: any) => {
const result = await runPause(values)
if (result.code === 1000) {
pauseRef.current.setVisible(false)
setTimeout(() => {
ref.current.reload()
}, 800)
}
})
}, [])
const handleEvaluate = (id) => {
history.push(`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated`)
}
......@@ -57,7 +73,9 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
}
const handleSuspend = (r) => {
console.log('TODO')
pauseRef.current.setVisible(true)
pauseActions.setFieldValue('id', r.id)
pauseActions.setFieldValue('state', 1)
}
// 1.(查看)2.(查看、取消订单)3.(查看售后),4.(评价查看售后)5.(提交审核修改删除查看)6.(修改查看),7.(查看中止)8.查看评价9.待新增采购入库单
......@@ -177,6 +195,55 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
}}
modalProps={{confirmLoading: loading}}
/>
<ModalForm
modalTitle='中止原因'
currentRef={pauseRef}
confirm={handleSubmitPause}
actions={pauseActions}
schema={{
type: 'object',
properties: {
NO_SUBMIT: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'top',
},
properties: {
id: {
type: 'number',
title: '当前id',
visible: false,
},
state: {
type: 'number',
title: '同意',
visible: false,
},
auditOpinion: {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多50个汉字'
},
title: '中止原因',
"x-rules": [
{
required: true,
message: '请输入取消原因'
},
{
limitByte: true,
maxByte: 100
}
]
}
}
}
}
}}
modalProps={{confirmLoading: loadingEnd}}
/>
</PageHeaderWrapper>
}
......
......@@ -11,9 +11,9 @@ export const useSelfTable = () => {
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const handleSubmit = async (record) => {
if (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.FILLING_ORDER) {
// if (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.FILLING_ORDER) {
history.push(`/memberCenter/tranactionAbility/saleOrder/readyReturnDocument/detail?id=${record.id}`)
}
// }
}
const secondColumns: any[] = baseOrderListColumns().concat([
{
......
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