Modal.jsx 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040
  1. import {
  2. Form,
  3. Modal,
  4. Row,
  5. Col,
  6. Input,
  7. DatePicker,
  8. Icon,
  9. Button,
  10. Divider,
  11. Steps,
  12. Select,
  13. TreeSelect,
  14. InputNumber,
  15. Upload,
  16. Space,
  17. Radio,
  18. } from 'antd';
  19. import ModuleTitle from '../../../components/ModuleTitle/moduleTitle';
  20. import { useEffect, useMemo, useState } from 'react';
  21. import {
  22. queryCompany,
  23. queryDepList,
  24. querySupplierList,
  25. } from '@/services/contract';
  26. import { useModel, useRequest } from '@umijs/max';
  27. import { CloudUploadOutlined } from '@ant-design/icons';
  28. import styles from '../index.less';
  29. import dayjs from 'dayjs';
  30. import InputSelect from '../../../components/InputSelect';
  31. export const Type = {
  32. add: 0, //新增
  33. detail: 1, //详情
  34. cancel: 2, //作废
  35. check: 3, //审核
  36. };
  37. export const StatusText = [
  38. '',
  39. '待审核',
  40. '审核拒绝',
  41. '已存档',
  42. '作废待审核',
  43. '作废拒绝',
  44. '已作废',
  45. ];
  46. export const Status = {
  47. None: 0,
  48. Checking: 1,
  49. CheckReject: 2,
  50. CheckSuccess: 3,
  51. CalChecking: 4,
  52. CalCheckReject: 5,
  53. CalCheckSuccess: 6,
  54. };
  55. const ContractModal = (props) => {
  56. const [form] = Form.useForm();
  57. const {
  58. initialState: { user },
  59. } = useModel('@@initialState');
  60. const { userList, run: userListRun } = useModel('userList');
  61. const { depList, run: depListRun } = useModel('depList');
  62. const FORMAT = 'YYYY-MM-DD';
  63. const {
  64. detail: data,
  65. type,
  66. visible,
  67. projectList = [],
  68. handleOk,
  69. handleCancel,
  70. parent_id,
  71. } = props;
  72. const title =
  73. type == Type.add ? '新增' : type == Type.detail ? '详情' : '作废';
  74. //所属公司为总部时才能选择部门,为子公司时,部门不能操作 所属部门为子公司的需要填经办人
  75. const company = Form.useWatch('company_id', form);
  76. const [depDisable, setDepDisable] = useState(false);
  77. const [dealDisable, setDealDisable] = useState(false);
  78. //项目名称选择后,自动填入对应的项目编号
  79. const project_name = Form.useWatch('project_name', form);
  80. //是否补充协议,是的话需要填合同编号
  81. const is_supplement = Form.useWatch('is_supplement', form);
  82. const [isPass, setIsPass] = useState(1);
  83. const [fileList, setFileList] = useState([]);
  84. const [fileExtendList, setFileExtendList] = useState([]);
  85. const { data: companyData, run: runCompany } = useRequest(queryCompany);
  86. console.log(user);
  87. useEffect(() => {
  88. userListRun();
  89. depListRun();
  90. runCompany();
  91. }, []);
  92. useEffect(() => {
  93. form.resetFields();
  94. }, [data]);
  95. //供应商列表
  96. const { data: supplierList = [], loading } = useRequest(querySupplierList, {
  97. defaultParams: [
  98. {
  99. project_id: 1,
  100. is_super: user?.IsSuper,
  101. created_by: user?.CName,
  102. page_size: 99999,
  103. },
  104. ],
  105. formatResult: (res) => {
  106. return res?.data?.list
  107. ? res?.data.list.map((item) => {
  108. return { ...item, Name: item.name };
  109. })
  110. : [];
  111. },
  112. });
  113. const isSuper = useMemo(() => {
  114. if (user?.Permission['menu-001-audit']) return true;
  115. return false;
  116. }, [user]);
  117. useEffect(() => {
  118. const item = companyData?.find((item) => item.ID == company);
  119. if (item?.Flag == 1) {
  120. //公司为本部
  121. setDepDisable(false);
  122. form.setFieldsValue({
  123. dep_id: '',
  124. archives_dep: '',
  125. created_dep: '',
  126. deal_by: user?.CName,
  127. });
  128. // setDealDisable(false);
  129. } else {
  130. setDepDisable(true);
  131. form.setFieldsValue({
  132. dep_id: '综合管理部',
  133. archives_dep: '综合管理部',
  134. created_dep: '综合管理部',
  135. deal_by: '',
  136. });
  137. // setDealDisable(true);
  138. // form.setFieldsValue({ deal_by: user?.CName });
  139. }
  140. }, [company]);
  141. useEffect(() => {
  142. const project_code = projectList?.find(
  143. (item) => item.project_name == project_name,
  144. )?.project_full_code;
  145. if (project_code) {
  146. form.setFieldsValue({ project_code });
  147. } else {
  148. form.setFieldsValue({ project_code: '' });
  149. }
  150. }, [project_name]);
  151. // useEffect(() => {
  152. // console.log('==================', is_supplement);
  153. // }, [is_supplement]);
  154. const supplyList = useMemo(() => {
  155. return companyData ? [...companyData, ...supplierList] : supplierList;
  156. }, [companyData, supplierList]);
  157. const disableds = useMemo(() => {
  158. if (!visible) {
  159. setFileList([]);
  160. setFileExtendList([]);
  161. setIsPass(1);
  162. setDepDisable(false);
  163. setDealDisable(false);
  164. }
  165. if (type == Type.add) {
  166. return { contract: false, check: true };
  167. } else if (type == Type.detail) {
  168. return { contract: true, check: true };
  169. } else if (type == Type.cancel) {
  170. return { contract: true, check: true };
  171. }
  172. return { contract: true, check: false };
  173. }, [type, visible]);
  174. const UploadProps = {
  175. action: `/api/contract/v1/attach`,
  176. headers: {
  177. 'JWT-TOKEN': localStorage.getItem('JWT-TOKEN'),
  178. },
  179. onChange({ file, fileList }) {
  180. if (file.status !== 'uploading') {
  181. console.log(file, fileList);
  182. const list = fileList.map((item) => item.response?.data?.attach);
  183. form.setFieldsValue({ attach: list });
  184. setFileList(fileList.map((item) => item.response?.data?.attach));
  185. }
  186. },
  187. };
  188. const UploadPropsExtend = {
  189. action: `/api/contract/v1/attach`,
  190. headers: {
  191. 'JWT-TOKEN': localStorage.getItem('JWT-TOKEN'),
  192. },
  193. onChange({ file, fileList }) {
  194. if (file.status !== 'uploading') {
  195. console.log(file, fileList);
  196. setFileExtendList(fileList.map((item) => item.response?.data?.attach));
  197. }
  198. },
  199. };
  200. const handleSubmit = () => {
  201. form.validateFields().then((values) => {
  202. if (type == Type.add) {
  203. values.effect_on = dayjs(values.effect_on).format(FORMAT);
  204. values.created_on = values.created_on || dayjs().format(FORMAT);
  205. if (parent_id) values.parent_id = parent_id;
  206. if (values.amount || values.amount == 0)
  207. values.amount = values.amount + '';
  208. if (values.attach) values.attach = JSON.stringify(values.attach);
  209. if (fileExtendList.length > 0)
  210. values.attach_extend = JSON.stringify(fileList);
  211. // if (values.party_c && values.party_c.length > 0)
  212. values.party_c = values.party_c?.join(',');
  213. const companyItem = companyData?.find(
  214. (item) => item.ID == values.company_id,
  215. );
  216. //所属公司为本部
  217. if (companyItem.Flag == 1) {
  218. const item = getDepItemById(values.dep_id);
  219. if (item) {
  220. values.dep_name = item.Name;
  221. values.dep_code = item.Code;
  222. }
  223. values.company_name = companyItem.Name;
  224. } else {
  225. //为分子公司
  226. values.company_name = companyItem.Name;
  227. values.company_code = companyItem.Code;
  228. values.dep_name = '综合管理部';
  229. values.dep_code = '综合管理部';
  230. values.dep_id = 0;
  231. }
  232. values.created_by = user?.ID;
  233. handleOk(values);
  234. } else if (type == Type.cancel) {
  235. let result = {
  236. id: data?.id,
  237. cancel_desc: values.cancel_desc,
  238. };
  239. handleOk(result);
  240. } else if (data?.status == Status.Checking) {
  241. let result = {
  242. id: data?.id,
  243. check_by: user?.CName,
  244. check_result: values.check_result,
  245. is_pass: values.is_pass,
  246. check_desc: values?.check_desc,
  247. };
  248. handleOk(result);
  249. } else if (data?.status == Status.CalChecking) {
  250. let result = {
  251. id: data?.id,
  252. cancel_check_by: user?.CName,
  253. cancel_check_result: values.cancel_check_result,
  254. is_pass: values.is_pass,
  255. // check_desc: values?.check_desc,
  256. };
  257. handleOk(result);
  258. }
  259. });
  260. };
  261. const getDepItemById = (id) => {
  262. const fun = (list) => {
  263. for (let i = 0; i < list.length; i++) {
  264. let item = list[i];
  265. if (item.ID == id) {
  266. return item;
  267. } else if (item.children?.length > 0) {
  268. let res = fun(item.children);
  269. if (res) return res;
  270. }
  271. }
  272. };
  273. return fun(depList);
  274. };
  275. const projectNameList = useMemo(() => {
  276. let arr =
  277. projectList?.map((item) => {
  278. return {
  279. value: item.project_name,
  280. label: item.project_name,
  281. };
  282. }) || [];
  283. return [
  284. {
  285. label: '日常项目',
  286. value: '日常项目',
  287. },
  288. ...arr,
  289. ];
  290. }, [projectList]);
  291. return (
  292. <Modal
  293. width={'85%'}
  294. title={title}
  295. open={visible}
  296. okText="提交"
  297. cancelText="返回"
  298. onOk={handleSubmit}
  299. onCancel={handleCancel}
  300. // okButtonProps={type == Type.detail ? { disabled: true } : null}
  301. destroyOnClose
  302. >
  303. <Divider />
  304. <Form
  305. form={form}
  306. // initialValues={data}
  307. labelCol={{ span: 7 }}
  308. wrapperCol={{ span: 17 }}
  309. >
  310. <ModuleTitle title="存档人信息" />
  311. <Row>
  312. <Col span={10} offset={1}>
  313. <Form.Item
  314. name="created_name"
  315. initialValue={data?.created_name || user?.CName}
  316. label="存档人:"
  317. >
  318. <Input disabled />
  319. </Form.Item>
  320. <Form.Item
  321. name="company_id"
  322. label="所属公司:"
  323. tooltip="请选择该存档合同所属公司"
  324. initialValue={data?.company_id}
  325. rules={[
  326. {
  327. required: true,
  328. message: '请填写所属公司',
  329. },
  330. ]}
  331. >
  332. <Select
  333. showSearch
  334. style={{ width: '100%' }}
  335. placeholder="请选择"
  336. disabled={disableds.contract}
  337. filterOption={(input, option) =>
  338. (option?.label ?? '')
  339. .toLowerCase()
  340. .includes(input.toLowerCase())
  341. }
  342. options={companyData?.map((item) => {
  343. return {
  344. value: item.ID,
  345. label: item.Name,
  346. };
  347. })}
  348. />
  349. </Form.Item>
  350. </Col>
  351. <Col span={10}>
  352. <Form.Item
  353. name="created_on"
  354. initialValue={data?.created_on || dayjs().format(FORMAT)}
  355. label="存档时间:"
  356. >
  357. <Input disabled />
  358. </Form.Item>
  359. <Form.Item
  360. name="dep_id"
  361. label="所属部门:"
  362. initialValue={data?.dep_id}
  363. >
  364. <TreeSelect
  365. style={{ width: '100%' }}
  366. placeholder="请选择"
  367. showSearch
  368. allowClear
  369. fieldNames={{
  370. label: 'Name',
  371. value: 'ID',
  372. children: 'children',
  373. }}
  374. disabled={disableds.contract || depDisable}
  375. dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
  376. treeData={depList?.find((item) => item.Code == 'GT')?.children}
  377. />
  378. </Form.Item>
  379. </Col>
  380. </Row>
  381. <ModuleTitle title="经办人信息" />
  382. <Row>
  383. <Col span={10} offset={1}>
  384. <Form.Item
  385. name="deal_by"
  386. label="经办人:"
  387. tooltip="经办人应负责合同审批流程、签字盖章、合同原件存档和电子档案存档。母公司的经办人为OA审批提交人,也是存档人。子公司经办人由子公司合同专员填写,一般是合同审批时的提交人或者是合同实际执行的负责人"
  388. initialValue={data?.deal_by}
  389. rules={[
  390. {
  391. required: true,
  392. message: '请选择经办人',
  393. },
  394. ]}
  395. >
  396. <Input disabled={!depDisable} />
  397. {/* <Select
  398. showSearch
  399. style={{ width: '100%' }}
  400. placeholder="请选择"
  401. disabled={!depDisable}
  402. filterOption={(input, option) =>
  403. (option?.label ?? '')
  404. .toLowerCase()
  405. .includes(input.toLowerCase())
  406. }
  407. options={userList?.map((item) => {
  408. return {
  409. value: item.CName,
  410. label: item.CName,
  411. };
  412. })}
  413. /> */}
  414. </Form.Item>
  415. </Col>
  416. <Col span={10}>
  417. <Form.Item
  418. name="created_dep"
  419. label="签约承办部门:"
  420. tooltip="请选择该存档合同的实际履行部门,一般为经办人所在部门"
  421. initialValue={data?.created_dep}
  422. rules={[
  423. {
  424. required: true,
  425. message: '请选择签约承办部门',
  426. },
  427. ]}
  428. >
  429. <TreeSelect
  430. style={{ width: '100%' }}
  431. placeholder="请选择"
  432. showSearch
  433. allowClear
  434. disabled={disableds.contract || depDisable}
  435. fieldNames={{
  436. label: 'Name',
  437. value: 'Name',
  438. children: 'children',
  439. }}
  440. dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
  441. treeData={depList?.find((item) => item.Code == 'GT')?.children}
  442. />
  443. </Form.Item>
  444. </Col>
  445. </Row>
  446. <ModuleTitle title="合同信息" />
  447. <Row>
  448. <Col span={10} offset={1}>
  449. <Form.Item
  450. name="is_supplement"
  451. label="是否补充协议:"
  452. tooltip="合同名称"
  453. initialValue={0}
  454. rules={[
  455. {
  456. required: true,
  457. message: '请填写合同名称',
  458. },
  459. ]}
  460. >
  461. <Radio.Group>
  462. <Radio value={1}>是</Radio>
  463. <Radio value={0}>否</Radio>
  464. </Radio.Group>
  465. </Form.Item>
  466. <Form.Item
  467. name="name"
  468. label="合同名称:"
  469. tooltip="请与OA审批时填写的合同名称一致"
  470. initialValue={data?.name}
  471. rules={[
  472. {
  473. required: true,
  474. message: '请填写合同名称',
  475. },
  476. ]}
  477. >
  478. <Input disabled={disableds.contract} />
  479. </Form.Item>
  480. <Form.Item
  481. name="effect_on"
  482. label="合同签订日期:"
  483. initialValue={data?.effect_on}
  484. tooltip="合同主体各方签字盖章完成之日,以最后签字盖章的为准"
  485. rules={[
  486. {
  487. required: true,
  488. message: '请填写合同名称',
  489. },
  490. ]}
  491. >
  492. {type == Type.add ? (
  493. <DatePicker
  494. style={{ width: '100%' }}
  495. disabled={disableds.contract}
  496. />
  497. ) : (
  498. <Input disabled={disableds.contract} />
  499. )}
  500. </Form.Item>
  501. <Form.Item
  502. name="project_name"
  503. label="项目名称:"
  504. tooltip="不涉及项目请选“日常项目”"
  505. initialValue={data?.project_name}
  506. rules={[
  507. {
  508. required: true,
  509. message: '请填写项目名称',
  510. },
  511. ]}
  512. >
  513. {/* <InputSelect
  514. list={projectList?.map((item) => {
  515. return {
  516. key: item.id,
  517. value: item.project_name,
  518. };
  519. })}
  520. /> */}
  521. <Select
  522. style={{ width: '100%' }}
  523. placeholder="请选择"
  524. showSearch
  525. options={projectNameList}
  526. disabled={disableds.contract}
  527. />
  528. </Form.Item>
  529. <Form.Item
  530. name="party_a"
  531. label="甲方:"
  532. tooltip="合同主体可以下拉选择,可选项需要经办人在“主页--供应商管理”中创建。经办人可以维护和更新供应商信息。"
  533. initialValue={data?.party_a}
  534. rules={[
  535. {
  536. required: true,
  537. message: '请选择甲方',
  538. },
  539. ]}
  540. >
  541. <TreeSelect
  542. style={{ width: '100%' }}
  543. placeholder="请选择"
  544. showSearch
  545. allowClear
  546. fieldNames={{
  547. label: 'Name',
  548. value: 'Name',
  549. children: 'children',
  550. }}
  551. dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
  552. treeData={supplyList}
  553. disabled={disableds.contract}
  554. />
  555. </Form.Item>
  556. </Col>
  557. <Col span={10}>
  558. <Form.Item
  559. style={{ opacity: is_supplement ? 1 : 0 }}
  560. name="parent_code"
  561. tooltip="请先查询原合同编号,原合同未录入本系统的,需先录入存档。"
  562. initialValue={data?.parent_code}
  563. label="原合同编号:"
  564. rules={
  565. is_supplement
  566. ? [
  567. {
  568. required: true,
  569. message: '请填写原合同编号',
  570. },
  571. ]
  572. : []
  573. }
  574. >
  575. <Input placeholder="请填写" />
  576. </Form.Item>
  577. <Form.Item
  578. name="code"
  579. tooltip="合同编号按《合同管理办法》的合同编码规则编号。"
  580. initialValue={data?.code}
  581. label="合同编号:"
  582. // rules={[
  583. // {
  584. // required: true,
  585. // message: '请填写合同编号',
  586. // },
  587. // ]}
  588. >
  589. <Input placeholder="提交后自动生成" disabled />
  590. </Form.Item>
  591. <Form.Item
  592. label="合同总价款:"
  593. name="amount"
  594. tooltip="请与OA审批时填写的“合同金额”一致。不涉及金额填“0”"
  595. initialValue={data?.amount}
  596. rules={[
  597. {
  598. required: true,
  599. message: '请输入合同总价款',
  600. },
  601. ]}
  602. >
  603. <InputNumber
  604. style={{ width: '100%' }}
  605. precision={2}
  606. addonAfter="万元"
  607. disabled={disableds.contract}
  608. />
  609. </Form.Item>
  610. <Form.Item
  611. name="project_code"
  612. initialValue={data?.project_code}
  613. label="项目编号:"
  614. >
  615. <Input disabled />
  616. </Form.Item>
  617. <Form.Item
  618. name="party_b"
  619. label="乙方:"
  620. tooltip="合同主体可以下拉选择,可选项需要经办人在“主页--供应商管理”中创建。经办人可以维护和更新供应商信息。"
  621. initialValue={data?.party_b}
  622. rules={[
  623. {
  624. required: true,
  625. message: '请选择乙方',
  626. },
  627. ]}
  628. >
  629. <TreeSelect
  630. style={{ width: '100%' }}
  631. placeholder="请选择"
  632. showSearch
  633. allowClear
  634. disabled={disableds.contract}
  635. fieldNames={{
  636. label: 'Name',
  637. value: 'Name',
  638. children: 'children',
  639. }}
  640. dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
  641. treeData={supplyList}
  642. />
  643. </Form.Item>
  644. </Col>
  645. </Row>
  646. <Form.Item
  647. name="party_c"
  648. label="丙方(及其他):"
  649. tooltip="可多选。合同主体可以下拉选择,可选项需要经办人在“主页--供应商管理”中创建。经办人可以维护和更新供应商信息。"
  650. initialValue={data?.party_c ? data?.party_c.split(',') : []}
  651. labelCol={{ span: 4 }}
  652. >
  653. <TreeSelect
  654. style={{ width: '100%' }}
  655. placeholder="请选择"
  656. showSearch
  657. multiple
  658. allowClear
  659. fieldNames={{
  660. label: 'Name',
  661. value: 'Name',
  662. children: 'children',
  663. }}
  664. dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
  665. treeData={supplyList}
  666. disabled={disableds.contract}
  667. />
  668. </Form.Item>
  669. <Form.Item
  670. name="perform"
  671. initialValue={data?.perform}
  672. label="合同履行情况:"
  673. labelCol={{ span: 4 }}
  674. >
  675. <Input.TextArea disabled={disableds.contract} />
  676. </Form.Item>
  677. <Row>
  678. <Col span={10} offset={1}>
  679. <Form.Item
  680. label="合同及合同附件上传:"
  681. tooltip="请上传合同正式盖章文本的扫描件(含技术协议、质保承诺等附件),不得用照片、图片格式,不得遗漏附件"
  682. name="attach"
  683. rules={
  684. disableds.contract
  685. ? []
  686. : [
  687. {
  688. required: true,
  689. message: '请上传合同及合同相关附件',
  690. },
  691. ]
  692. }
  693. >
  694. {type == Type.add ? (
  695. <Upload {...UploadProps}>
  696. <Button icon={<CloudUploadOutlined />}>Upload</Button>
  697. </Upload>
  698. ) : (
  699. <ul>
  700. {data?.attach &&
  701. JSON.parse(data?.attach)?.map((item, idx) => (
  702. <li key={`${idx}_${item.name}`}>{item.name}</li>
  703. ))}
  704. </ul>
  705. )}
  706. </Form.Item>
  707. <Form.Item
  708. name="archives_dep"
  709. initialValue={data?.archives_dep}
  710. label="合同原件存档部门:"
  711. tooltip="母公司财务部和采购部门的合同请选择“财务部”,其他部门请选择“行政部”,子公司合同选择“综合管理部”"
  712. >
  713. <Select
  714. style={{ width: '100%' }}
  715. options={[
  716. {
  717. value: '财务部',
  718. label: '财务部',
  719. },
  720. {
  721. value: '行政部',
  722. label: '行政部',
  723. },
  724. ]}
  725. disabled={disableds.contract || depDisable}
  726. />
  727. </Form.Item>
  728. </Col>
  729. <Col span={10}>
  730. <Form.Item
  731. label="合同相关资料上传:"
  732. tooltip={
  733. <div>
  734. 依据《合同管理办法》,合同相关资料需要作为合同电子档案的一部分,包括:
  735. <br />
  736. 1)合同会审纪要或投资决策通知书(如有);
  737. <br />
  738. 2)合同相对方的营业执照等资质证的复印件(首次签约的须加盖公章)、个人身份证复印件(合同一方为自然人时提供);
  739. <br />
  740. 3)合同相对方经办人员的授权委托书原件及其身份证复印件(如有);
  741. <br />
  742. 4)
  743. 涉及房屋或场地租赁的,还应提供房屋及场地的权属证明资料,但如果续签租赁合同,且房屋所有权人没有发生变更的,在附具相关说明后可不再提供上述资料;
  744. <br />
  745. 5)其他资料。
  746. </div>
  747. }
  748. >
  749. {type == Type.add ? (
  750. <Upload {...UploadPropsExtend}>
  751. <Button icon={<CloudUploadOutlined />}>Upload</Button>
  752. </Upload>
  753. ) : (
  754. <ul>
  755. {data?.attach_extend &&
  756. JSON.parse(data?.attach_extend)?.map((item, idx) => (
  757. <li key={`${idx}_${item.name}`}>
  758. {/* <Space>
  759. {item.name} <span>预览</span>{' '}
  760. <a href={item.url}>下载</a>
  761. </Space> */}
  762. </li>
  763. ))}
  764. </ul>
  765. )}
  766. </Form.Item>
  767. </Col>
  768. </Row>
  769. {type != Type.add && (
  770. <>
  771. <ModuleTitle title="归档流程" />
  772. <div className={styles.modelItem}>
  773. <Steps
  774. current={data?.status == Status.Checking ? 1 : 2}
  775. status={
  776. data?.status == Status.CheckReject ? 'error' : 'process'
  777. }
  778. items={[
  779. {
  780. title: '发起',
  781. description: (
  782. <>
  783. <div className={styles.textNowarp}>
  784. 发起人:{data?.created_name}
  785. </div>
  786. <div className={styles.textNowarp}>
  787. 发起时间:{data?.created_on}
  788. </div>
  789. </>
  790. ),
  791. },
  792. {
  793. title: '审核',
  794. description: (
  795. <>
  796. <div className={styles.textNowarp}>
  797. 审核人:{data?.check_by}
  798. </div>
  799. <div className={styles.textNowarp}>
  800. 审核时间:{data?.check_on}
  801. </div>
  802. {data?.check_desc && (
  803. <div
  804. className={styles.textNowarp}
  805. style={{ color: 'red' }}
  806. >
  807. 拒绝原因:{data?.check_desc}
  808. </div>
  809. )}
  810. </>
  811. ),
  812. },
  813. {
  814. title:
  815. data?.status >= Status.CheckSuccess
  816. ? StatusText[Status.CheckSuccess]
  817. : StatusText[data?.status],
  818. },
  819. ]}
  820. />
  821. </div>
  822. </>
  823. )}
  824. {isSuper && data.status == Status.Checking && (
  825. <>
  826. <ModuleTitle title="审核情况" />
  827. <Row>
  828. <Col span={10} offset={1}>
  829. <Form.Item
  830. name="check_by"
  831. initialValue={user?.CName}
  832. label="审核人:"
  833. >
  834. <Input disabled />
  835. </Form.Item>
  836. <Form.Item name="is_pass" initialValue={1} label="审核意见:">
  837. <Select
  838. onChange={(e) => {
  839. setIsPass(e);
  840. }}
  841. style={{ width: '100%' }}
  842. options={[
  843. {
  844. value: 1,
  845. label: '同意',
  846. },
  847. {
  848. value: 0,
  849. label: '拒绝',
  850. },
  851. ]}
  852. />
  853. </Form.Item>
  854. </Col>
  855. <Col span={10}>
  856. <Form.Item
  857. name="check_date"
  858. initialValue={dayjs().format(FORMAT)}
  859. label="审核时间:"
  860. >
  861. <Input disabled />
  862. </Form.Item>
  863. </Col>
  864. </Row>
  865. {!isPass && (
  866. <Form.Item
  867. name="check_desc"
  868. label="拒绝原因:"
  869. labelCol={{ span: 4 }}
  870. >
  871. <Input.TextArea />
  872. </Form.Item>
  873. )}
  874. </>
  875. )}
  876. {(type == Type.cancel || data?.status >= Status.CalChecking) && (
  877. <>
  878. <ModuleTitle title="作废信息" />
  879. <Form.Item
  880. name="cancel_desc"
  881. label="作废原因:"
  882. initialValue={data?.cancel_desc}
  883. labelCol={{ span: 4 }}
  884. rules={[
  885. {
  886. required: true,
  887. message: '请填写作废原因',
  888. },
  889. ]}
  890. >
  891. <Input disabled={type != Type.cancel} />
  892. </Form.Item>
  893. </>
  894. )}
  895. {type == Type.cancel && (
  896. <Form.Item
  897. name="cancel_on"
  898. label="创建时间:"
  899. initialValue={dayjs().format(FORMAT)}
  900. labelCol={{ span: 4 }}
  901. >
  902. <Input
  903. style={{ width: '460px' }}
  904. defaultValue={dayjs().format('YYYY-MM-DD')}
  905. disabled
  906. />
  907. <span
  908. style={{ color: 'red', fontSize: '24px', marginLeft: '40px' }}
  909. >
  910. 确认作废该合同,作废提交后无法撤回
  911. </span>
  912. </Form.Item>
  913. )}
  914. {data?.status >= Status.CalChecking && (
  915. <>
  916. <ModuleTitle title="作废流程" />
  917. <div className={styles.modelItem}>
  918. <Steps
  919. current={data?.status == Status.CalChecking ? 1 : 2}
  920. status={
  921. data?.status == Status.CalCheckReject ? 'error' : 'process'
  922. }
  923. items={[
  924. {
  925. title: '发起',
  926. description: (
  927. <>
  928. <div className={styles.textNowarp}>
  929. 发起人:{data?.created_name}
  930. </div>
  931. <div className={styles.textNowarp}>
  932. 发起时间:{data?.created_on}
  933. </div>
  934. </>
  935. ),
  936. },
  937. {
  938. title: '审核',
  939. description: (
  940. <>
  941. <div className={styles.textNowarp}>
  942. 审核人:{data?.cancel_check_by}
  943. </div>
  944. <div className={styles.textNowarp}>
  945. 审核时间:{data?.cancel_check_on}
  946. </div>
  947. </>
  948. ),
  949. },
  950. {
  951. title: StatusText[data?.status],
  952. },
  953. ]}
  954. />
  955. </div>
  956. </>
  957. )}
  958. {isSuper && data.status == Status.CalChecking && (
  959. <>
  960. <ModuleTitle title="审核情况" />
  961. <Row>
  962. <Col span={10} offset={1}>
  963. <Form.Item
  964. name="cancel_check_by"
  965. initialValue={user?.CName}
  966. label="审核人:"
  967. >
  968. <Input disabled />
  969. </Form.Item>
  970. <Form.Item name="is_pass" initialValue={1} label="审核意见:">
  971. <Select
  972. onChange={(e) => {
  973. setIsPass(e);
  974. }}
  975. style={{ width: '100%' }}
  976. options={[
  977. {
  978. value: 1,
  979. label: '同意',
  980. },
  981. {
  982. value: 0,
  983. label: '拒绝',
  984. },
  985. ]}
  986. />
  987. </Form.Item>
  988. </Col>
  989. <Col span={10}>
  990. <Form.Item
  991. name="check_date"
  992. initialValue={dayjs().format(FORMAT)}
  993. label="审核时间:"
  994. >
  995. <Input disabled />
  996. </Form.Item>
  997. </Col>
  998. </Row>
  999. {!isPass && (
  1000. <Form.Item
  1001. name="cancel_check_result"
  1002. label="拒绝原因:"
  1003. labelCol={{ span: 4 }}
  1004. >
  1005. <Input.TextArea />
  1006. </Form.Item>
  1007. )}
  1008. </>
  1009. )}
  1010. </Form>
  1011. <Divider />
  1012. </Modal>
  1013. );
  1014. };
  1015. export default ContractModal;