You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
3.3 KiB
37 lines
3.3 KiB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; |
|
import { ModalForm, ProFormText, ProFormRadio, } from '@ant-design/pro-components'; |
|
import { Button } from 'antd'; |
|
import { extendPhoneReg } from '@component/utils'; |
|
import { useRequest } from 'ahooks'; |
|
export default function ({ onFinish, open, serviceType, setVisitble, data }) { |
|
return (_jsxs(ModalForm, Object.assign({ title: "\u786E\u8BA4\u4FE1\u606F", autoFocusFirstInput: true, layout: "horizontal", labelCol: { span: 5 }, wrapperCol: { span: 18 }, modalProps: { |
|
destroyOnClose: true, |
|
onCancel: () => setVisitble(false), |
|
}, open: open, submitTimeout: 2000, onFinish: onFinish, request: () => { |
|
var _a, _b, _c; |
|
const policyProject = {}; |
|
if (serviceType !== 'jizhongfuwu') { |
|
policyProject.projectStatusName = |
|
(_a = data === null || data === void 0 ? void 0 : data.policyProject[0]) === null || _a === void 0 ? void 0 : _a.projectStatusName; |
|
policyProject.projectTypeName = |
|
(_b = data === null || data === void 0 ? void 0 : data.policyProject[0]) === null || _b === void 0 ? void 0 : _b.projectTypeName; |
|
policyProject.isSubContract = (_c = data === null || data === void 0 ? void 0 : data.policyProject[0]) === null || _c === void 0 ? void 0 : _c.isSubContract; |
|
} |
|
return Object.assign({ contacts: data === null || data === void 0 ? void 0 : data.contacts, contactPhone: data === null || data === void 0 ? void 0 : data.contactPhone, address: data === null || data === void 0 ? void 0 : data.address }, policyProject); |
|
} }, { children: [_jsx(ProFormText, { required: true, name: "contacts", label: "\u8054\u7CFB\u4EBA", placeholder: "\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA", rules: [{ message: '请输入联系人', required: true }] }), _jsx(ProFormText, { required: true, name: "contactPhone", label: "\u8054\u7CFB\u7535\u8BDD", placeholder: "\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD", rules: [ |
|
{ message: '请输入联系电话', required: true }, |
|
{ |
|
message: '请输入正确的联系电话', |
|
pattern: extendPhoneReg, |
|
}, |
|
] }), _jsx(ProFormText, { required: true, name: "address", placeholder: "\u8BF7\u8F93\u5165\u670D\u52A1\u5730\u5740", label: "\u670D\u52A1\u5730\u5740", rules: [{ message: '请输入服务地址', required: true }] }), serviceType !== 'jizhongfuwu' && (_jsx(ProFormText, { name: "projectStatusName", label: "\u5DE5\u7A0B\u72B6\u6001", placeholder: "\u8BF7\u8F93\u5165\u5DE5\u7A0B\u72B6\u6001" })), serviceType !== 'jizhongfuwu' && (_jsx(ProFormText, { name: "projectTypeName", label: "\u5DE5\u7A0B\u7C7B\u578B", placeholder: "\u8BF7\u8F93\u5165\u5DE5\u7A0B\u7C7B\u578B" })), serviceType !== 'jizhongfuwu' && (_jsx(ProFormRadio.Group, { name: "isSubContract", label: "\u662F\u5426\u5206\u5305", placeholder: "\u8BF7\u9009\u62E9\u662F\u5426\u5206\u5305", options: [ |
|
{ |
|
label: '是', |
|
value: 'Y', |
|
}, |
|
{ |
|
label: '否', |
|
value: 'N', |
|
}, |
|
] }))] }))); |
|
}
|
|
|