Commit 311517b2 authored by GuanHua's avatar GuanHua
parents ca9a72ee 50d9b8de
...@@ -261,11 +261,11 @@ const ExchangeForm: React.FC<BillsFormProps> = ({ ...@@ -261,11 +261,11 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
}, },
{ {
title: '品类', title: '品类',
dataIndex: !isMateriel ? 'category' : 'quotedCategory', dataIndex: 'category',
}, },
{ {
title: '品牌', title: '品牌',
dataIndex: !isMateriel ? 'brand' : 'quotedBrand', dataIndex: 'brand',
}, },
{ {
title: '单位', title: '单位',
......
...@@ -192,11 +192,11 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -192,11 +192,11 @@ const RepairForm: React.FC<BillsFormProps> = ({
}, },
{ {
title: '品类', title: '品类',
dataIndex: !isMateriel ? 'category' : 'quotedCategory', dataIndex: 'category',
}, },
{ {
title: '品牌', title: '品牌',
dataIndex: !isMateriel ? 'brand' : 'quotedBrand', dataIndex: 'brand',
}, },
{ {
title: '单位', title: '单位',
......
...@@ -267,11 +267,11 @@ const ReturnForm: React.FC<BillsFormProps> = ({ ...@@ -267,11 +267,11 @@ const ReturnForm: React.FC<BillsFormProps> = ({
}, },
{ {
title: '品类', title: '品类',
dataIndex: !isMateriel ? 'category' : 'quotedCategory', dataIndex: 'category',
}, },
{ {
title: '品牌', title: '品牌',
dataIndex: !isMateriel ? 'brand' : 'quotedBrand', dataIndex: 'brand',
}, },
{ {
title: '单位', title: '单位',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-07-02 17:53:48 * @Date: 2021-07-02 17:53:48
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-24 11:52:11 * @LastEditTime: 2021-11-15 14:22:03
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
...@@ -39,8 +39,8 @@ const schema: ISchema = { ...@@ -39,8 +39,8 @@ const schema: ISchema = {
width: '100%', width: '100%',
}, },
disabledDate: (current) => current && current < moment().startOf('day'), disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (_, type) => { disabledTime: (current, type) => {
if (type === 'start') { if (type === 'start' && moment().isSame(current, 'day')) {
return { return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')), disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')), disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-06-24 14:05:57 * @Date: 2021-06-24 14:05:57
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-26 15:09:11 * @LastEditTime: 2021-11-15 14:20:08
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
...@@ -105,8 +105,8 @@ const schema: ISchema = { ...@@ -105,8 +105,8 @@ const schema: ISchema = {
placeholder: ['领(发)劵起始时间', '领(发)劵截止时间'], placeholder: ['领(发)劵起始时间', '领(发)劵截止时间'],
showTime: true, showTime: true,
disabledDate: (current) => current && current < moment().startOf('day'), disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (_, type) => { disabledTime: (current, type) => {
if (type === 'start') { if (type === 'start' && moment().isSame(current, 'day')) {
return { return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')), disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')), disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
...@@ -302,8 +302,8 @@ const schema: ISchema = { ...@@ -302,8 +302,8 @@ const schema: ISchema = {
placeholder: ['劵有效期起始时间', '劵有效期截止时间'], placeholder: ['劵有效期起始时间', '劵有效期截止时间'],
showTime: true, showTime: true,
disabledDate: (current) => current && current < moment().startOf('day'), disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (_, type) => { disabledTime: (current, type) => {
if (type === 'start') { if (type === 'start' && moment().isSame(current, 'day')) {
return { return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')), disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')), disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
......
import React, { useRef, useState, useImperativeHandle } from 'react'; import React, { useRef, useState, useImperativeHandle, useEffect } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd'; import { Card } from 'antd';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
...@@ -43,10 +43,11 @@ import { ...@@ -43,10 +43,11 @@ import {
ONLINEBIDREADYBID_SCHEMA, ONLINEBIDREADYBID_SCHEMA,
ONLINEBIDREADYSIGN_SCHEMA, ONLINEBIDREADYSIGN_SCHEMA,
} from '../../schema/onlineBid'; } from '../../schema/onlineBid';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
interface Iprops { interface Iprops {
fetch?: () => Promise<unknown>, fetch?: () => Promise<unknown>,
fetchRowkeys?(e: any), fetchRowkeys?(e: number[]),
controllerBtns?: React.ReactNode, controllerBtns?: React.ReactNode,
schemaType?: schemaType?:
'PurchaseDemand' | 'PurchaseDemand' |
...@@ -76,6 +77,10 @@ interface Iprops { ...@@ -76,6 +77,10 @@ interface Iprops {
reload?: any, reload?: any,
externalStatusFetch?: () => Promise<unknown>, externalStatusFetch?: () => Promise<unknown>,
interiorStatusFetch?: () => Promise<unknown>, interiorStatusFetch?: () => Promise<unknown>,
/** rowKey */
rowKey?: string,
/** 禁用 */
getCheckboxProps?: (record: any) => void,
} }
const formActions = createFormActions(); const formActions = createFormActions();
const Table: React.FC<Iprops> = (props: any) => { const Table: React.FC<Iprops> = (props: any) => {
...@@ -88,6 +93,8 @@ const Table: React.FC<Iprops> = (props: any) => { ...@@ -88,6 +93,8 @@ const Table: React.FC<Iprops> = (props: any) => {
selectedRow, selectedRow,
reload, reload,
fetchRowkeys, fetchRowkeys,
rowKey,
getCheckboxProps,
externalStatusFetch, externalStatusFetch,
interiorStatusFetch interiorStatusFetch
} = props; } = props;
...@@ -151,14 +158,16 @@ const Table: React.FC<Iprops> = (props: any) => { ...@@ -151,14 +158,16 @@ const Table: React.FC<Iprops> = (props: any) => {
} }
/**多选 */ /**多选 */
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([]); const [selectRow, selectRowFns] = useRowSelectionTable({
const rowSelection = { customKey: rowKey || 'id',
selectedRowKeys: selectedRowKeys, extendsSelection: {
onChange: (selectedRowKeys: any, selectedRows: any) => { getCheckboxProps: (record) => getCheckboxProps && getCheckboxProps(record),
fetchRowkeys(selectedRowKeys) }
setSelectedRowKeys(selectedRowKeys); });
},
} useEffect(() => {
fetchRowkeys && fetchRowkeys(selectRowFns.selectedRowKeys)
}, [selectRowFns])
useImperativeHandle(reload, () => ({ useImperativeHandle(reload, () => ({
reload: () => { reload: () => {
...@@ -176,17 +185,17 @@ const Table: React.FC<Iprops> = (props: any) => { ...@@ -176,17 +185,17 @@ const Table: React.FC<Iprops> = (props: any) => {
onFormMount$().subscribe(() => { onFormMount$().subscribe(() => {
externalStatusFetch && externalStatusFetch().then(res => { externalStatusFetch && externalStatusFetch().then(res => {
if (res.code !== 1000) return if (res.code !== 1000) return
const _enum = res.data.map((item) => {return { label: item.name || item.message, value: item.satatus || item.code }}) const _enum = res.data.map((item) => { return { label: item.name || item.message, value: item.satatus || item.code } })
linkage.enum('externalState',_enum) linkage.enum('externalState', _enum)
linkage.enum('externalStatusList',_enum) linkage.enum('externalStatusList', _enum)
}).catch(error => { }).catch(error => {
console.warn(error) console.warn(error)
}) })
interiorStatusFetch && interiorStatusFetch().then(res => { interiorStatusFetch && interiorStatusFetch().then(res => {
if (res.code !== 1000) return if (res.code !== 1000) return
const _enum = res.data.map((item) => {return { label: item.name || item.message, value: item.satatus || item.code }}) const _enum = res.data.map((item) => { return { label: item.name || item.message, value: item.satatus || item.code } })
linkage.enum('interiorState',_enum) linkage.enum('interiorState', _enum)
linkage.enum('innerStatusList',_enum) linkage.enum('innerStatusList', _enum)
}).catch(error => { }).catch(error => {
console.warn(error) console.warn(error)
}) })
...@@ -200,13 +209,15 @@ const Table: React.FC<Iprops> = (props: any) => { ...@@ -200,13 +209,15 @@ const Table: React.FC<Iprops> = (props: any) => {
<StandardTable <StandardTable
currentRef={tableRef} currentRef={tableRef}
columns={columns} columns={columns}
tableProps={{ rowKew: 'id' }} tableProps={{ rowKey: rowKey ? rowKey : 'id' }}
rowSelection={selectedRow && rowSelection} rowSelection={selectedRow && selectRow}
fetchTableData={(params: any) => fetchData(params)} fetchTableData={(params: any) => fetchData(params)}
controlRender={ controlRender={
<NiceForm <NiceForm
actions={formActions} actions={formActions}
expressionScope={{ controllerBtns }} components={{
controllerBtns: () => controllerBtns,
}}
onSubmit={values => search(values)} onSubmit={values => search(values)}
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, effects, FORM_FILTER_PATH) useStateFilterSearchLinkageEffect($, actions, effects, FORM_FILTER_PATH)
......
...@@ -57,8 +57,24 @@ const BasicInfo: React.FC<BasicInfoprops> = (props: any) => { ...@@ -57,8 +57,24 @@ const BasicInfo: React.FC<BasicInfoprops> = (props: any) => {
return ( return (
<Form {...layout} form={form}> <Form {...layout} form={form}>
<Form.Item label="需求计划摘要" rules={[{ required: true, message: '请输入需求计划摘要' }]} name="summary"> <Form.Item noStyle shouldUpdate={(prevValues, curValues) => (prevValues.startTime && prevValues.endTime) !== (curValues.startTime && curValues.endTime)}>
<Input /> {({ getFieldValue }) => {
if (getFieldValue('startTime') && getFieldValue('endTime')) {
form.setFieldsValue({'summary': `${getFieldValue('startTime').format('YYYY-MM-DD')}-${getFieldValue('endTime').format('YYYY-MM-DD')}需求计划`})
}
return (getFieldValue('startTime') && getFieldValue('endTime')) && (
<Form.Item
label="需求计划摘要"
name="summary"
rules={[{
required: true,
message: '请输入需求计划摘要'
}]}
>
<Input />
</Form.Item>
)
}}
</Form.Item> </Form.Item>
<Form.Item required label="需求计划周期" style={{ marginBottom: 0 }}> <Form.Item required label="需求计划周期" style={{ marginBottom: 0 }}>
<DatePicker <DatePicker
......
...@@ -251,7 +251,7 @@ const BasicInfo: React.FC<Iprops> = (props: any) => { ...@@ -251,7 +251,7 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
name='details' name='details'
rules={[{ required: true, message: '请输入需求单摘要' }]} rules={[{ required: true, message: '请输入需求单摘要' }]}
> >
<Input /> <Input maxLength={30} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={ label={
......
...@@ -159,37 +159,37 @@ const Condition: React.FC<Iprops> = (props: any) => { ...@@ -159,37 +159,37 @@ const Condition: React.FC<Iprops> = (props: any) => {
label="报价要求" label="报价要求"
name="offer" name="offer"
> >
<TextArea rows={3} /> <TextArea rows={3} maxLength={50} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="付款要求" label="付款要求"
name="paymentType" name="paymentType"
> >
<TextArea rows={3} /> <TextArea rows={3} maxLength={50} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="税费要求" label="税费要求"
name="taxes" name="taxes"
> >
<TextArea rows={3} /> <TextArea rows={3} maxLength={50} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="物流要求" label="物流要求"
name="logistics" name="logistics"
> >
<TextArea rows={3} /> <TextArea rows={3} maxLength={50} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="包装要求" label="包装要求"
name="packRequire" name="packRequire"
> >
<TextArea rows={3} /> <TextArea rows={3} maxLength={50} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="其他要求" label="其他要求"
name="otherRequire" name="otherRequire"
> >
<TextArea rows={3} /> <TextArea rows={3} maxLength={50} />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
......
...@@ -146,7 +146,6 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => { ...@@ -146,7 +146,6 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
if (data.customerCategory) { if (data.customerCategory) {
const fullId = data.customerCategory.fullId; const fullId = data.customerCategory.fullId;
const ids = fullId.replace(/\b(0+)/gi, '').split('.'); const ids = fullId.replace(/\b(0+)/gi, '').split('.');
console.log(ids, fullId)
form.setFieldsValue({ form.setFieldsValue({
ids: ids.join(',').split(','), ids: ids.join(',').split(','),
}) })
...@@ -189,6 +188,7 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => { ...@@ -189,6 +188,7 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
urls: files urls: files
} }
onConfirm(data) onConfirm(data)
setProduct([])
form.resetFields(); form.resetFields();
setFiles([]) setFiles([])
}).catch(error => { }).catch(error => {
...@@ -197,6 +197,7 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => { ...@@ -197,6 +197,7 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
} }
/** 取消提交 */ /** 取消提交 */
const handleClose = () => { const handleClose = () => {
setProduct([])
form.resetFields(); form.resetFields();
setFiles([]) setFiles([])
onClose() onClose()
......
...@@ -96,11 +96,8 @@ export const DEMANDPLANADDED_SECHEMA: ISchema = { ...@@ -96,11 +96,8 @@ export const DEMANDPLANADDED_SECHEMA: ISchema = {
}, },
properties: { properties: {
ctl: { ctl: {
type: 'object', type: "object",
"x-component": "Children", "x-component": "controllerBtns",
"x-component-props": {
children: "{{controllerBtns}}"
}
}, },
needPlanNo: { needPlanNo: {
type: 'string', type: 'string',
......
...@@ -108,11 +108,8 @@ export const INQUIRYWAITORDER_SCHEMA: ISchema = { ...@@ -108,11 +108,8 @@ export const INQUIRYWAITORDER_SCHEMA: ISchema = {
}, },
properties: { properties: {
ctl: { ctl: {
type: 'object', type: "object",
"x-component": "Children", "x-component": "controllerBtns",
"x-component-props": {
children: "{{controllerBtns}}"
}
}, },
purchaseInquiryNo: { purchaseInquiryNo: {
type: 'string', type: 'string',
...@@ -277,11 +274,8 @@ export const PurchaseDemandPublicSchema: ISchema = { ...@@ -277,11 +274,8 @@ export const PurchaseDemandPublicSchema: ISchema = {
}, },
properties: { properties: {
ctl: { ctl: {
type: 'object', type: "object",
"x-component": "Children", "x-component": "controllerBtns",
"x-component-props": {
children: "{{controllerBtns}}"
}
}, },
requisitionFormNo: { requisitionFormNo: {
type: 'string', type: 'string',
...@@ -729,11 +723,8 @@ export const CONFIRMOFFERAUDIT_SCHEMA: ISchema = { ...@@ -729,11 +723,8 @@ export const CONFIRMOFFERAUDIT_SCHEMA: ISchema = {
}, },
properties: { properties: {
ctl: { ctl: {
type: 'object', type: "object",
"x-component": "Children", "x-component": "controllerBtns",
"x-component-props": {
children: "{{controllerBtns}}"
}
}, },
purchaseInquiryNo: { purchaseInquiryNo: {
type: 'string', type: 'string',
...@@ -996,11 +987,8 @@ export const OFFERSERAHAUDIT_SCHEMA: ISchema = { ...@@ -996,11 +987,8 @@ export const OFFERSERAHAUDIT_SCHEMA: ISchema = {
}, },
properties: { properties: {
ctl: { ctl: {
type: 'object', type: "object",
"x-component": "Children", "x-component": "controllerBtns",
"x-component-props": {
children: "{{controllerBtns}}"
}
}, },
quotedPriceNo: { quotedPriceNo: {
type: 'string', type: 'string',
......
...@@ -108,11 +108,8 @@ export const PURCHASEBIDREADYADD_SCHEMA: ISchema = { ...@@ -108,11 +108,8 @@ export const PURCHASEBIDREADYADD_SCHEMA: ISchema = {
}, },
properties: { properties: {
ctl: { ctl: {
type: 'object', type: "object",
"x-component": "Children", "x-component": "controllerBtns",
"x-component-props": {
children: "{{controllerBtns}}"
}
}, },
biddingNo: { biddingNo: {
type: 'string', type: 'string',
...@@ -251,4 +248,4 @@ export const PURCHASEBIDOSIGNUP_SCHEMA: ISchema = { ...@@ -251,4 +248,4 @@ export const PURCHASEBIDOSIGNUP_SCHEMA: ISchema = {
} }
} }
} }
} }
\ No newline at end of file
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