Commit ae13c983 authored by XieZhiXiong's avatar XieZhiXiong

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

parents 115b4224 db6b77da
......@@ -122,7 +122,7 @@ const EvaluateAdd = (props) => {
}
})
if (totalScoreWeight > 100) {
message.error(`添加的评估项目的权重和为${totalScoreWeight}, 大于100, 请修改`);
message.error(`当前添加的评估项目的权重和为${totalScoreWeight}, 大于100, 请修改`);
return
}
......@@ -226,7 +226,6 @@ const EvaluateAdd = (props) => {
});
const scoreWeight = formActions.getFieldValue(`items.${numberIndex}.scoreWeight`) || 0
const grade = formActions.getFieldValue(`items.${numberIndex}.grade`) || 0;
console.log(scoreWeight)
formActions.setFieldValue(`items.${numberIndex}.score`, +scoreWeight !== 0 ? scoreWeight * grade / 100 : grade);
})
}
......@@ -274,7 +273,7 @@ const EvaluateAdd = (props) => {
return {
appraisalDayStart: moment(appraisalDayEnd, 'YYYY-MM-DD'),
appraisalDayEnd: moment(appraisalDayEnd, 'YYYY-MM-DD'),
selectedProject: selectedProject,
selectProject: selectedProject,
items: itmesList,
...rest,
}
......@@ -287,6 +286,7 @@ const EvaluateAdd = (props) => {
subMemberId: initialValue.subMemberId,
subRoleId: initialValue.subRoleId,
}])
console.log(initialValue);
}
}, [initialValue])
......
......@@ -81,6 +81,7 @@ const TobeEvaluateDetail = () => {
}, [projectColumns, isView])
const editScore = (record: any) => {
console.log(record);
setEditingScoreData(record);
toggle(true);
}
......@@ -206,12 +207,13 @@ const TobeEvaluateDetail = () => {
<div className={styles.form}>
<SchemaForm
onSubmit={onSubmit}
initialValues={editingScoreData}
value={editingScoreData}
schema={modifyEvaluateScore}
actions={formActions}
components={{
FormilyUploadFiles,
ArrayTable,
FormilyCheckbox
}}
/>
</div>
......
......@@ -28,7 +28,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
_record.submitOrUpdate && (
<Space>
<Link to={`/memberCenter/memberAbility/memberEvaluate/tobeSubmitSummary/detail?id=${_record.id}`}>提交</Link>
<Link to={`/memberCenter/memberAbility/memberEvaluate/tobeSubmitSummary/detail?id=${_record.id}`}>修改</Link>
{/* <Link to={`/memberCenter/memberAbility/memberEvaluate/tobeSubmitSummary/detail?id=${_record.id}`}>修改</Link> */}
</Space>
)
)
......
......@@ -38,14 +38,15 @@ export const modifyEvaluateScore: ISchema = {
sendAppraisal: {
title: '考评人打分',
type: 'string',
editable: false
editable: false,
"x-component": 'FormilyCheckbox'
},
scoreWeight: {
title: '权重',
type: 'string',
'x-rules': [
{
pattern: /^((\d+))$/,
pattern: /^\d+$/,
message: '请填写整数'
}
],
......
......@@ -133,7 +133,7 @@ const rectificationAddDetail = () => {
visible={visible}
onClose={() => toggle(false)}
width={540}
title="确认整改结果"
title="整改报告"
footer={
<div style={{ textAlign: 'right'}}>
<Button onClick={() => toggle(false)} style={{ marginRight: 8 }}>
......@@ -150,7 +150,7 @@ const rectificationAddDetail = () => {
actions={formActions}
onSubmit={handleSubmit}
components={{FormilyUploadFiles}}
initialValues={formValue}
value={formValue}
/>
</Drawer>
</AnchorPage>
......
......@@ -83,7 +83,7 @@ export const rectificationReportSchema: ISchema = {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelCol: 5,
labelAlign: 'left',
full: true,
},
......@@ -102,7 +102,7 @@ export const rectificationReportSchema: ISchema = {
}
},
reportAttachments: {
title: "件",
title: "整改报告文件",
type: 'array',
'x-component': 'FormilyUploadFiles',
'x-rules': [
......
......@@ -139,6 +139,11 @@ const AddNewBid:React.FC<AddNewBidProps> = (props) => {
if(id) {
params['id'] = id
}
// else {
// // 新增或复制 剔除id操作
// omitID(params)
// }
// console.log(params, 'after')
try {
addSchemaAction.getFieldState('deliverAddressId', state => {
if(params?.deliverAddressId) {
......@@ -174,6 +179,31 @@ const AddNewBid:React.FC<AddNewBidProps> = (props) => {
}
}
const omitID = (element) => {
// 数组 遍历剔除id
if(Array.isArray(element)) {
element.forEach((e, i) => {
if(Object.prototype.hasOwnProperty.call(e, 'id')) {
delete e.id
}
omitID(e)
})
}
// 对象遍历 移除外层id
else if (element && typeof element === 'object') {
for (const key in element) {
if (Object.prototype.hasOwnProperty.call(element, key)) {
if(key === 'id') delete element[key]
// 如果key值为数组
const item = element[key];
if(Array.isArray(item)) {
omitID(item)
}
}
}
}
}
const providerValue = {
// detailData: initFormValue,
schemaActions: addSchemaAction,
......
import React, { useCallback, useRef, useState } from 'react'
import { Card, message, Button} from 'antd'
import { Card, message, Button, Dropdown, Menu} from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { StandardTable } from 'god'
import { history } from 'umi'
......@@ -16,6 +16,7 @@ import { createAsyncFormActions } from '@formily/antd'
import moment from 'moment'
import { dataChangeUnix } from '../addNewBid/constant'
import '../../constants/index.less'
import { CaretDownOutlined } from '@ant-design/icons'
// import { BidInsideWorkState, BidOuterWorkState } from '@/constants/procurement'
const destroyActions = createAsyncFormActions()
......@@ -44,15 +45,58 @@ const callForBidsSearch: React.FC<{}> = () => {
key: 'ctl',
// width: 240,
// fixed: 'right',
render: (text, record) => <>
<Button type='link' onClick={() => handleCopy(record.id)}>复制</Button>
{ record.isOpenTenderTime && <Button type='link' onClick={() => handleChangeTime(record)}>修改开标时间</Button> }
{ record.isExpert && <Button type='link' onClick={() => handleWithdraw(record.id)}>抽取专家</Button> }
{ record.isDiscardTender && <Button type='link' onClick={() => handleDestory(record.id)}>废标</Button> }
</>
render: (text, record) => renderOptionButton(record)
// {
// return <>
// <Button type='link' onClick={() => handleCopy(record.id)}>复制</Button>
// { record.isOpenTenderTime && <Button type='link' onClick={() => handleChangeTime(record)}>修改开标时间</Button> }
// { record.isExpert && <Button type='link' onClick={() => handleWithdraw(record.id)}>抽取专家</Button> }
// { record.isDiscardTender && <Button type='link' onClick={() => handleDestory(record.id)}>废标</Button> }
// </>
// }
}
])
const renderOptionButton = (record: any) => {
const buttonGroup = { '复制': true, '修改开标时间': record.isOpenTenderTime, '抽取专家': record.isExpert, '废标': record.isDiscardTender }
const operationHandler = {
'复制': () => handleCopy(record.id),
'修改开标时间': () => handleChangeTime(record),
'抽取专家': () => handleWithdraw(record.id),
'废标': () => handleDestory(record.id),
}
const keyNames = Object.keys(buttonGroup)
return (<>
{
Object.values(buttonGroup).filter(Boolean).length > 2
?
<>
<Button type='link' onClick={operationHandler[keyNames[0]]}>{keyNames[0]}</Button>
<Dropdown overlay={
<Menu>
{
keyNames.slice(1, keyNames.length).map((e, i) => (
<Menu.Item key={`menuItem${i}`}>
<Button type='link' onClick={operationHandler[e]}>{ e }</Button>
</Menu.Item>
))
}
</Menu>
}>
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
更多 <CaretDownOutlined />
</a>
</Dropdown>
</>
:
keyNames.map((e, i) => (buttonGroup[e] ? <Button key={`btnItem${i}`} type='link' onClick={operationHandler[e]}>{ e }</Button> : null))
}
</>)
}
const fetchTableData = async (params) => {
let _params = params.inviteTenderInStatusList ? { ...params, inviteTenderInStatusList: [params.inviteTenderInStatusList] } : {...params}
let __params = _params.inviteTenderOutStatusList ? { ..._params, inviteTenderOutStatusList: [_params.inviteTenderOutStatusList] } : {..._params}
......
......@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => {
span: 8,
fieldList: [
{ title: '招标项目:', name: 'projectName' },
{ title: '项目预算:', name: 'budget', render: (t) => `¥${t}` },
{ title: '项目预算:', name: 'budget', render: (t) => t ? `¥${t}` : null },
{ title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] },
{ title: '招标会员:', name: 'memberName' },
]
......
......@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => {
span: 8,
fieldList: [
{ title: '招标项目:', name: 'projectName' },
{ title: '项目预算:', name: 'budget', render: (t) => `¥${t}` },
{ title: '项目预算:', name: 'budget', render: (t) => t ? `¥${t}` : null },
{ title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] },
{ title: '招标会员:', name: 'memberName' },
]
......
......@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => {
span: 8,
fieldList: [
{ title: '招标项目:', name: 'projectName' },
{ title: '项目预算:', name: 'budget', render: (t) => `¥${t}` },
{ title: '项目预算:', name: 'budget', render: (t) => t ? `¥${t}` : null },
{ title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] },
{ title: '招标会员:', name: 'memberName' },
]
......
......@@ -39,7 +39,7 @@ const BasicInfo: React.FC<IBasicInfo> = ({ title }) => {
span: 8,
fieldList: [
{ title: '招标项目:', name: 'projectName' },
{ title: '项目预算:', name: 'budget', render: (t) => `¥${t}` },
{ title: '项目预算:', name: 'budget', render: (t) => t ? `¥${t}` : null },
{ title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] },
{ title: '招标会员:', name: 'memberName' },
]
......
......@@ -49,7 +49,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
{ title: '招标会员:', name: 'memberName' },
{ title: '招标摘要:', name: 'remark' },
] : [{ title: '招标项目:', name: 'projectName' },
{ title: '项目预算:', name: 'budget', render: (t) => `¥${t}` },
{ title: '项目预算:', name: 'budget', render: (t) => t ? `¥${t}` : null },
{ title: '采购类型:', name: 'purchaseType', render: (text) => PURCHASE_TYPE[text] },
{ title: '招标会员:', name: 'memberName' },
{ title: '招标摘要:', name: 'remark' },
......
......@@ -5,132 +5,128 @@ import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons'
import { getAuth } from '@/utils/auth'
import { validatorByte } from '../../validator';
import styles from './index.less';
interface SubmitResultModalProps {
title: string,
visible: boolean,
onCancel: () => void,
onOk: (signUpIdea: string, urls: any) => void,
confirmLoading: boolean
title: string,
visible: boolean,
onCancel: () => void,
onOk: (signUpIdea: string, urls: any) => void,
confirmLoading: boolean
}
const SubmitResultModal: React.FC<SubmitResultModalProps> = (props: any) => {
const { title, visible, onCancel, onOk, confirmLoading } = props;
const [form] = Form.useForm();
const [files, setFiles] = useState([]);
const [loading, setloading] = useState(false);
const { token } = getAuth() || {}
const { title, visible, onCancel, onOk, confirmLoading } = props;
const [form] = Form.useForm();
const [files, setFiles] = useState([]);
const [loading, setloading] = useState(false);
const { token } = getAuth() || {}
/**判断文件类型和大小 */
const beforeDocUpload = (file: any) => {
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isLt20M) {
message.error('上传文件大小不超过 20M!');
}
return isLt20M;
}
// 上传回调
const handleChange = ({ file }) => {
const arr: any = files;
setloading(true);
if (file.response) {
if (file.response.code === 1000) {
arr.push({
name: file.name,
url: file.response.data
})
setloading(false);
}
}
setFiles([...arr])
form.setFieldsValue({ upload: 'ok' })
/**判断文件类型和大小 */
const beforeDocUpload = (file: any) => {
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isLt20M) {
message.error('上传文件大小不超过 20M!');
}
// 删除附件
const removeFiles = (index: any) => {
const arr = [...files];
arr.splice(index, 1);
setFiles(arr);
arr.length <= 0 && form.setFieldsValue({ upload: '' })
}
const formSubmit = () => {
form.validateFields().then(res => {
onOk && onOk(res.opinion, files);
return isLt20M;
}
// 上传回调
const handleChange = ({ file }) => {
const arr: any = files;
setloading(true);
if (file.response) {
if (file.response.code === 1000) {
arr.push({
name: file.name,
url: file.response.data
})
setloading(false);
}
}
setFiles([...arr])
form.setFieldsValue({ upload: 'ok' })
}
// 删除附件
const removeFiles = (index: any) => {
const arr = [...files];
arr.splice(index, 1);
setFiles(arr);
arr.length <= 0 && form.setFieldsValue({ upload: '' })
}
return (
<Modal
width={600}
title={title}
visible={visible}
onCancel={onCancel}
onOk={() => { formSubmit() }}
afterClose={() => {
form.resetFields()
setFiles([])
}}
confirmLoading={confirmLoading}
const formSubmit = () => {
form.validateFields().then(res => {
onOk && onOk(res.opinion, files);
})
}
return (
<Modal
width={600}
title={title}
visible={visible}
onCancel={onCancel}
onOk={() => { formSubmit() }}
afterClose={() => {
form.resetFields()
setFiles([])
}}
confirmLoading={confirmLoading}
>
<Form
form={form}
layout={'vertical'}
className={styles.revise_style}
>
<Form.Item
label='授标意见'
name='opinion'
rules={[
{ required: true, message: '请输入授标意见' },
{
validator: (r, v) => validatorByte(v, 200)
}
]}
>
<Form
form={form}
layout={'vertical'}
className={styles.revise_style}
>
<Form.Item
label='授标意见'
name='opinion'
rules={[
{ required: true, message: '请输入授标意见' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 200) {
return Promise.reject(new Error('最长200个字符,100个汉字'));
} else {
return Promise.resolve();
}
},
})
]}
>
<Input.TextArea rows={3} maxLength={200} placeholder="最长200个字符,100个汉字" />
</Form.Item>
<Form.Item
label='附件'
name='upload'
rules={[{ required: true, message: '请上传附件' }]}>
<div className={styles.upload_data}>
{files.length > 0 && files.map((v, index) => (
<div key={index} className={styles.upload_item}>
<div className={styles.upload_left}>
<LinkOutlined />
<span>{v.name}</span>
</div>
<div className={styles.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined />
</div>
</div>
))}
</div>
<Upload
action="/api/file/file/upload"
data={{ fileType: UPLOAD_TYPE }}
showUploadList={false}
accept='.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx'
beforeUpload={beforeDocUpload}
onChange={handleChange}
headers={{ token }}
>
<Button loading={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
</Upload>
</Form.Item>
</Form>
</Modal>
)
<Input.TextArea rows={3} maxLength={200} placeholder="最长200个字符,100个汉字" />
</Form.Item>
<Form.Item
label='附件'
name='upload'
rules={[{ required: true, message: '请上传附件' }]}>
<div className={styles.upload_data}>
{files.length > 0 && files.map((v, index) => (
<div key={index} className={styles.upload_item}>
<div className={styles.upload_left}>
<LinkOutlined />
<span>{v.name}</span>
</div>
<div className={styles.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined />
</div>
</div>
))}
</div>
<Upload
action="/api/file/file/upload"
data={{ fileType: UPLOAD_TYPE }}
showUploadList={false}
accept='.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx'
beforeUpload={beforeDocUpload}
onChange={handleChange}
headers={{ token }}
>
<Button loading={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
</Upload>
</Form.Item>
</Form>
</Modal>
)
}
export default SubmitResultModal;
\ No newline at end of file
export default SubmitResultModal;
import React, { useState, useEffect } from 'react';
import { Form, Row, Col, Input, DatePicker, Select } from 'antd';
import { Form, Input, DatePicker, Select } from 'antd';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { validatorByte } from '../../validator';
import style from './index.less';
const { TextArea } = Input;
......@@ -143,17 +145,10 @@ const Condition: React.FC<Iprops> = (props: any) => {
label="报价要求"
name="offer"
rules={[
{ required: true, message: '请输入报价要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
{ required: true, message: '请输入报价要求' },
{
validator: (r, v) => validatorByte(v, 100)
}
]}
>
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
......@@ -162,19 +157,11 @@ const Condition: React.FC<Iprops> = (props: any) => {
label="付款方式"
name="paymentType"
rules={[
{ required: true, message: '请输入付款方式' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
{ required: true, message: '请输入付款方式' },
{
validator: (r, v) => validatorByte(v, 100)
}
]}
>
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
......@@ -182,19 +169,11 @@ const Condition: React.FC<Iprops> = (props: any) => {
label="税费要求"
name="taxes"
rules={[
{ required: true, message: '请输入税费要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
{ required: true, message: '请输入税费要求' },
{
validator: (r, v) => validatorByte(v, 100)
}
]}
>
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
......@@ -202,19 +181,11 @@ const Condition: React.FC<Iprops> = (props: any) => {
label="物流要求"
name="logistics"
rules={[
{ required: true, message: '请输入物流要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
{ required: true, message: '请输入物流要求' },
{
validator: (r, v) => validatorByte(v, 100)
}
]}
>
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
......@@ -222,19 +193,11 @@ const Condition: React.FC<Iprops> = (props: any) => {
label="包装要求"
name="packRequire"
rules={[
{ required: true, message: '请输入包装要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
{ required: true, message: '请输入包装要求' },
{
validator: (r, v) => validatorByte(v, 100)
}
]}
>
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
......@@ -242,19 +205,11 @@ const Condition: React.FC<Iprops> = (props: any) => {
label="其他要求"
name="otherRequire"
rules={[
{ required: true, message: '请输入其他要求' }, () => ({
validator(_, value) {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 100) {
return Promise.reject(new Error('最长100个字符,50个汉字'));
} else {
return Promise.resolve();
}
},
})
{ required: true, message: '请输入其他要求' },
{
validator: (r, v) => validatorByte(v, 100)
}
]}
>
<TextArea rows={3} maxLength={100} placeholder="最长100个字符,50个汉字" />
</Form.Item>
......
export const validatorByte = (value: any, limitNumber: number) => {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > limitNumber) {
return Promise.reject(new Error(`最长${limitNumber}个字符,${limitNumber/2}个汉字`));
} else {
return Promise.resolve();
}
}
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