index.jsx 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. import React, {Component} from "react";
  2. import {Button, Col, Form, message, Radio, Spin, Table, Tag} from "antd";
  3. import PatentCheck from "../patentCheck";
  4. import CheckProject from "../../manageCenter/components/checkProject";
  5. class InitiateOrder extends Component {
  6. constructor(props) {
  7. super(props);
  8. }
  9. render() {
  10. return (
  11. <div>
  12. <Spin
  13. spinning={this.state.sureOutLoading || this.state.waiDetailLoading || this.state.payNodeLoading || this.state.thirdInfoLoading}>
  14. <div style={{marginTop: 10}}>
  15. <div className="clearfix">
  16. <FormItem
  17. className="half-item"
  18. labelCol={{span: 3}}
  19. wrapperCol={{span: 14}}
  20. label={
  21. <span>
  22. <strong style={{color: '#f00'}}>*</strong>
  23. 类型
  24. </span>
  25. }
  26. >
  27. <Radio.Group
  28. disabled={this.state.payNodeLoading || this.state.thirdInfoLoading}
  29. value={this.state.startType}
  30. onChange={(e) => {
  31. let _this = this;
  32. if (this.state.thirdInfoList.length > 0) {
  33. confirm({
  34. title: '确定要切换吗?',
  35. content: '切换将删除所有第三信息和付款节点',
  36. onOk() {
  37. return new Promise((resolve, reject) => {
  38. _this.setState({startType: e.target.value}, () => {
  39. _this.projectTypeTabContent(_this.state.projectType);
  40. })
  41. _this.confirmDeletNew(-1, resolve, reject)
  42. if (_this.state.payNodeList.length > 0) {
  43. _this.payNodeConfirmDeletNew(-1, resolve, reject);
  44. }
  45. }).catch(() => console.log('Oops errors!'));
  46. },
  47. onCancel() {
  48. },
  49. });
  50. } else {
  51. this.setState({startType: e.target.value}, () => {
  52. this.projectTypeTabContent(this.state.projectType);
  53. })
  54. }
  55. }}
  56. >
  57. <Radio value={0}>外包(不走总部)</Radio>
  58. <Radio value={1}>供应商信息</Radio>
  59. </Radio.Group>
  60. </FormItem>
  61. </div>
  62. {/* 专利类型 */}
  63. <div
  64. className="clearfix"
  65. style={{
  66. display: this.state.projectType === 1 ? 'block' : 'none',
  67. }}
  68. >
  69. <FormItem
  70. className="half-item"
  71. labelCol={{span: 4}}
  72. wrapperCol={{span: 14}}
  73. label={
  74. <span>
  75. <strong style={{color: '#f00'}}>*</strong>
  76. 专利类型
  77. </span>
  78. }
  79. >
  80. <Radio.Group
  81. disabled={this.state.payNodeLoading || this.state.thirdInfoLoading}
  82. value={this.state.patentType}
  83. onChange={(e) => {
  84. let _this = this;
  85. if (this.state.thirdInfoList.length > 0) {
  86. confirm({
  87. title: '确定要切换吗?',
  88. content: '切换将删除所有第三信息和付款节点',
  89. onOk() {
  90. return new Promise((resolve, reject) => {
  91. _this.setState({patentType: e.target.value}, () => {
  92. _this.projectTypeTabContent(_this.state.projectType);
  93. })
  94. _this.confirmDeletNew(-1, resolve, reject)
  95. if (_this.state.payNodeList.length > 0) {
  96. _this.payNodeConfirmDeletNew(-1, resolve, reject);
  97. }
  98. }).catch(() => console.log('Oops errors!'));
  99. },
  100. onCancel() {
  101. },
  102. });
  103. } else {
  104. this.setState({patentType: e.target.value}, () => {
  105. this.projectTypeTabContent(this.state.projectType);
  106. })
  107. }
  108. }}
  109. >
  110. <Radio value={0}>专利申请/变更/转让</Radio>
  111. <Radio value={1}>专利买卖</Radio>
  112. </Radio.Group>
  113. </FormItem>
  114. </div>
  115. <div
  116. className="clearfix"
  117. style={{
  118. display: this.state.projectType === 1 ? 'block' : 'none',
  119. }}
  120. >
  121. <FormItem
  122. className="half-item"
  123. labelCol={{span: 4}}
  124. wrapperCol={{span: 14}}
  125. label={
  126. <span>
  127. <strong style={{color: '#f00'}}>*</strong>
  128. 专利名称
  129. </span>
  130. }
  131. >
  132. <Radio.Group
  133. disabled={this.state.payNodeLoading || this.state.thirdInfoLoading}
  134. value={this.state.patentNameType}
  135. onChange={(e) => {
  136. let _this = this;
  137. if (this.state.thirdInfoList.length > 0) {
  138. confirm({
  139. title: '确定要切换吗?',
  140. content: '切换将删除所有第三信息和付款节点',
  141. onOk() {
  142. return new Promise((resolve, reject) => {
  143. _this.setState({patentNameType: e.target.value}, () => {
  144. _this.projectTypeTabContent(_this.state.projectType);
  145. })
  146. _this.confirmDeletNew(-1, resolve, reject)
  147. if (_this.state.payNodeList.length > 0) {
  148. _this.payNodeConfirmDeletNew(-1, resolve, reject);
  149. }
  150. }).catch(() => console.log('Oops errors!'));
  151. },
  152. onCancel() {
  153. },
  154. });
  155. } else {
  156. this.setState({patentNameType: e.target.value}, () => {
  157. this.projectTypeTabContent(this.state.projectType);
  158. })
  159. }
  160. }}
  161. >
  162. <Radio value={0}>实用新型专利</Radio>
  163. <Radio value={1}>发明专利</Radio>
  164. <Radio value={2}>外观专利</Radio>
  165. {/*<Radio value={3}>*/}
  166. {/* 其他*/}
  167. {/* <Input*/}
  168. {/* disabled={this.state.patentNameType !== 3}*/}
  169. {/* value={this.state.patentName}*/}
  170. {/* style={{ marginLeft: '15px' }}*/}
  171. {/* onChange={(e) => {*/}
  172. {/* this.setState({*/}
  173. {/* patentName: e.target.value,*/}
  174. {/* })*/}
  175. {/* }}*/}
  176. {/* placeholder="请填写专利名称"*/}
  177. {/* />*/}
  178. {/*</Radio>*/}
  179. </Radio.Group>
  180. </FormItem>
  181. </div>
  182. {/*外包类型无此选项*/}
  183. {this.state.startType !== 0 && this.state.projectType === 1 ? <div className="clearfix">
  184. <FormItem
  185. className="half-item"
  186. labelCol={{span: 3}}
  187. wrapperCol={{span: 15}}
  188. label={<span>官费</span>}>
  189. {
  190. this.state.patentType === 1 ?
  191. <Radio.Group
  192. value={this.state.containOfficialFees}
  193. onChange={(e) => {
  194. this.setState({containOfficialFees: e.target.value})
  195. }}
  196. >
  197. <Radio value={0}>实际已缴费</Radio>
  198. <Radio value={1}>实际未缴费</Radio>
  199. </Radio.Group> :
  200. <PatentCheck
  201. style={{
  202. display: 'flex',
  203. alignItems: 'center',
  204. }}
  205. id={this.state.id}
  206. patentTypeName={this.state.patentTypeName}
  207. checkStatus={this.state.checkStatus} //核对状态
  208. projectType={this.state.projectType} //项目类型
  209. patentType={this.state.patentType} //专利类型
  210. startType={this.state.startType} //1供应商 0外包
  211. orderTaskOfficialCost={this.state.orderTaskOfficialCost} //1含官费 0不含官费
  212. orderTaskCostReduction={this.state.orderTaskCostReduction} //1有费减 0无费减
  213. isPreviewPay={false}
  214. onRefresh={() => {
  215. this.xiangqing(this.state.tid);
  216. }}
  217. status={this.state.refundStatus}
  218. />
  219. }
  220. </FormItem>
  221. </div> : <div/>}
  222. {/* 第三方信息专利 */}
  223. <div>
  224. <span
  225. style={{
  226. fontSize: '18px',
  227. }}
  228. >
  229. 第三方信息
  230. </span>
  231. <span
  232. style={{
  233. display: 'inline-block',
  234. marginLeft: 10,
  235. color: 'red',
  236. }}
  237. >
  238. 金额总计(万元): {this.state.allTotalAmount}
  239. </span>
  240. <Button
  241. type="primary"
  242. onClick={(e) => {
  243. //this.state.startType 0外包 1供应商 类型为外包时,当普通单
  244. if (this.state.projectType === 1 && this.state.patentType === -1) {
  245. message.info('请先选择专利类型');
  246. } else if (this.state.projectType === 1 && this.state.patentNameType === -1) {
  247. message.info('请先选择专利名称');
  248. } else {
  249. this.addThirdList()
  250. }
  251. }}
  252. style={{
  253. float: 'right',
  254. marginRight: '50px',
  255. marginBottom: '15px',
  256. }}
  257. >
  258. +新增第三方信息
  259. </Button>
  260. </div>
  261. <div
  262. className="clearfix"
  263. style={{
  264. // display: this.state.type == 1 ? "block" : "none",
  265. display: this.state.type == 1 ? 'block' : 'block',
  266. }}
  267. >
  268. <Spin spinning={this.state.thirdInfoLoading}>
  269. <Form layout="horizontal">
  270. <Table
  271. pagination={false}
  272. columns={this.state.ContactsListsNew}
  273. dataSource={this.state.thirdInfoList}
  274. onRowClick={this.tableRowClickOne}
  275. scroll={{x: 'max-content', y: 0}}
  276. bordered
  277. size="small"
  278. />
  279. <Col
  280. span={24}
  281. offset={9}
  282. style={{marginTop: '15px'}}
  283. />
  284. </Form>
  285. </Spin>
  286. </div>
  287. {/*如果是软著类或者专利类的专利申请,隐藏付款节点 但当为外包类型时,无需隐藏*/}
  288. {/*this.state.startType 0外包 1供应商*/}
  289. <div
  290. style={{
  291. display: this.state.startType === 0 ? 'block' : ((this.state.projectType === 1 && this.state.patentType === 0) || this.state.projectType === 2 ? 'none' : 'block'), //0正常 1专利 2软著 3审计
  292. }}
  293. >
  294. <span
  295. style={{
  296. fontSize: '18px',
  297. }}
  298. >
  299. 付款节点
  300. </span>
  301. <span
  302. style={{
  303. display: 'inline-block',
  304. marginLeft: 10,
  305. color: 'red',
  306. }}
  307. />
  308. <Button
  309. type="primary"
  310. onClick={(e) => {
  311. this.addPayNode()
  312. }}
  313. style={{
  314. float: 'right',
  315. marginRight: '50px',
  316. marginBottom: '15px',
  317. }}
  318. >
  319. +新增付款节点
  320. </Button>
  321. </div>
  322. {/*如果是软著类或者专利类的专利申请,隐藏付款节点 但当为外包类型时,无需隐藏*/}
  323. <div
  324. className="clearfix"
  325. style={{
  326. display: this.state.startType === 0 ? 'block' : ((this.state.projectType === 1 && this.state.patentType === 0) || this.state.projectType === 2 ? 'none' : 'block'), //0正常 1专利 2软著 3审计
  327. }}
  328. >
  329. <Spin spinning={this.state.payNodeLoading}>
  330. <Form layout="horizontal">
  331. <Table
  332. pagination={false}
  333. columns={this.state.PayNodeTableColunms}
  334. dataSource={this.state.payNodeList}
  335. onRowClick={this.payNodeTableRowClickOne}
  336. scroll={{x: 'max-content', y: 0}}
  337. bordered
  338. size="small"
  339. />
  340. <Col
  341. span={24}
  342. offset={9}
  343. style={{marginTop: '15px'}}
  344. />
  345. </Form>
  346. </Spin>
  347. </div>
  348. <div className="clearfix">
  349. <FormItem
  350. className="half-item"
  351. {...formItemLayout}
  352. label={
  353. <span>
  354. <strong style={{color: '#f00'}}>*</strong>备注
  355. </span>
  356. }
  357. >
  358. <TextArea
  359. rows={4}
  360. value={this.state.outsourceRemarks}
  361. onChange={(e) => {
  362. this.setState({
  363. outsourceRemarks: e.target.value,
  364. })
  365. }}
  366. placeholder="请输入备注"
  367. />
  368. </FormItem>
  369. </div>
  370. <p
  371. className="tip"
  372. style={{
  373. paddingBottom: '12px',
  374. width: '240px',
  375. marginLeft: '145px',
  376. color: 'red',
  377. }}
  378. >
  379. 首次派单项目,需上传协议,第2次起,同项目,只需写外包公司
  380. </p>
  381. <div className="clearfix">
  382. <FormItem
  383. labelCol={{span: 4}}
  384. wrapperCol={{span: 18}}
  385. label={
  386. <span>
  387. 合同/协议扫描件
  388. </span>
  389. }
  390. >
  391. <PicturesWall
  392. domId={'myTask3'}
  393. fileList={this.getOrgCodeUrlWai}
  394. pictureUrl={this.state.pictureUrl}
  395. />
  396. <p style={{color: 'red'}}>图片建议:要清晰。</p>
  397. </FormItem>
  398. </div>
  399. {/*只有审核拒绝和第一次发起外包的时候才要填写发起原因 如果是类型为供应商则不需要发起原因*/}
  400. {/*this.state.startType 0外包 1供应商*/}
  401. {(typeof this.state.refundStatus === 'undefined' || this.state.refundStatus === 2) && this.state.startType !== 1 ?
  402. <div className="clearfix">
  403. <FormItem
  404. className="half-item"
  405. {...formItemLayout}
  406. label={
  407. <span>
  408. <strong style={{color: '#f00'}}>*</strong>发起原因
  409. </span>
  410. }
  411. >
  412. <TextArea
  413. rows={4}
  414. value={this.state.reason}
  415. onChange={(e) => {
  416. this.setState({
  417. reason: e.target.value,
  418. })
  419. }}
  420. placeholder="请输入发起原因"
  421. />
  422. </FormItem>
  423. </div> : <div/>}
  424. <div className="clearfix">
  425. <div
  426. style={{
  427. display: 'inline-black',
  428. textAlign: 'center',
  429. }}
  430. >
  431. <Button
  432. type="primary"
  433. loading={this.state.loading}
  434. onClick={() => {
  435. this.sureOut(this.state.startType);
  436. }}
  437. >
  438. {
  439. this.state.startType === 0 ? "确认发起外包,不通过总部1" : "提交供应商信息"
  440. }
  441. </Button>
  442. <p className="tip" style={{color: 'red'}}>
  443. {
  444. this.state.startType === 0 ? "提示:高于总部价格,费用个人承担" : "确定提交供应商信息,提交后,不可修改"
  445. }
  446. </p>
  447. </div>
  448. </div>
  449. </div>
  450. {(this.state.refundStatus == 1 ||
  451. this.state.refundStatus == 0 ||
  452. this.state.refundStatus == 2) &&
  453. this.state.startType !== 1
  454. ? (
  455. <div className="clearfix"
  456. style={{
  457. display: this.state.refundStatus == 0 ? 'none' : 'block',
  458. }}
  459. >
  460. <hr className="division"/>
  461. {parseInt(this.state.startType) !== 1 ? <div style={{
  462. color: '#F00',
  463. fontWeight: 'bolder',
  464. paddingBottom: '20px',
  465. }}>
  466. 审核结果: <span
  467. style={{paddingLeft: '20px'}}>{getRefundStatus(this.state.refundStatus)}</span>
  468. </div> : <div/>}
  469. <div className="outsourceLogList">
  470. {
  471. this.state.outsourceLogs && this.state.outsourceLogs.map((value, index) => (
  472. <div key={index} className="outsourceLogItem outsource">
  473. <div style={{
  474. display: 'flex',
  475. flexFlow: 'row nowrap',
  476. paddingBottom: '3px',
  477. paddingTop: '3px',
  478. }}>
  479. <div>
  480. {value.aname}
  481. </div>
  482. <div style={{paddingLeft: '5px'}}>
  483. {
  484. value.status === 0 ?
  485. <Tag color="#2db7f5">发起外包审核</Tag> :
  486. value.status === 1 ? <Tag color="#87d068">通过</Tag> :
  487. <Tag color="#f50">驳回</Tag>
  488. }
  489. </div>
  490. <div style={{
  491. wordBreak: 'break-all',
  492. maxWidth: '67%',
  493. }}>
  494. {value.remarks}
  495. </div>
  496. <div style={{paddingLeft: '10px'}}>
  497. {value.createTimes}
  498. </div>
  499. </div>
  500. </div>
  501. ))
  502. }
  503. </div>
  504. </div>
  505. ) : (
  506. ''
  507. )}
  508. </Spin>
  509. </div>
  510. )
  511. }
  512. }
  513. export default InitiateOrder;