projecCount.jsx 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071
  1. import React, { Component } from "react";
  2. import {
  3. AutoComplete,
  4. Button,
  5. DatePicker,
  6. Input,
  7. message,
  8. Modal,
  9. Select,
  10. Spin,
  11. Table,
  12. Tabs,
  13. } from "antd";
  14. import { ShowModal, getNewDiccityArr } from "@/tools";
  15. import { citySelect } from "../../../NewDicProvinceList";
  16. import { ChooseList } from "../../order/orderNew/chooseList";
  17. import $ from "jquery/src/ajax";
  18. import moment from "moment";
  19. import {
  20. highTechColumns,
  21. invention,
  22. utilityModel,
  23. softWriting,
  24. otherTrademarks,
  25. currency,
  26. } from "./projecCountConfig";
  27. import HighTech from "./highTech";
  28. import "./index.less";
  29. const { TabPane } = Tabs;
  30. const { RangePicker } = DatePicker;
  31. const { Option } = Select;
  32. class ProjecCount extends Component {
  33. constructor(props) {
  34. super(props);
  35. this.state = {
  36. loading: false,
  37. changeList: [],
  38. columns: currency((v, screen) => {
  39. this.openProjectSummary(v, screen);
  40. }),
  41. pagination: {
  42. defaultCurrent: 1,
  43. defaultPageSize: 10,
  44. showQuickJumper: true,
  45. pageSize: 10,
  46. onChange: function (page) {
  47. this.loadData(page);
  48. }.bind(this),
  49. showTotal: function (total) {
  50. return "共" + total + "条数据";
  51. },
  52. },
  53. dataSource: [],
  54. taberReleaseDate: [],
  55. taberProjectType: "",
  56. taberCommodityName: "",
  57. releaseDate: [],
  58. searchOrderNo: "",
  59. searchContractNo: "",
  60. searchEnterpriseName: "",
  61. declarationBatch: "",
  62. projectType: "",
  63. projectStatus: "",
  64. province: "",
  65. depId: "",
  66. departmentArr: [],
  67. contactsOption: [],
  68. contactsOptionData: [],
  69. customerArr: [],
  70. commodityName: "",
  71. kid: "",
  72. status: 0,
  73. searchValues: this.props.searchConfig || {},
  74. };
  75. this.loadData = this.loadData.bind(this);
  76. this.resetAll = this.resetAll.bind(this);
  77. this.changeList = this.changeList.bind(this);
  78. this.departmentList = this.departmentList.bind(this);
  79. this.exportPending = this.exportPending.bind(this);
  80. this.exportExcel = this.exportExcel.bind(this);
  81. this.selectSuperId = this.selectSuperId.bind(this);
  82. this.supervisorCui = this.supervisorCui.bind(this);
  83. this.httpChangeCui = this.httpChangeCui.bind(this);
  84. this.selectAuto = this.selectAuto.bind(this);
  85. this.openProjectSummary = this.openProjectSummary.bind(this);
  86. }
  87. changeList(arr) {
  88. const newArr = [];
  89. this.state.columns.forEach((item) => {
  90. arr.forEach((val) => {
  91. if (val === item.title) {
  92. newArr.push(item);
  93. }
  94. });
  95. });
  96. this.setState({
  97. changeList: newArr,
  98. });
  99. }
  100. loadData(pageNo) {
  101. this.setState({
  102. page: pageNo,
  103. loading: true,
  104. taberReleaseDate: this.state.releaseDate,
  105. taberProjectType: this.state.projectType,
  106. taberCommodityName: this.state.commodityName,
  107. });
  108. $.ajax({
  109. method: "get",
  110. dataType: "json",
  111. crossDomain: false,
  112. url:
  113. globalConfig.context +
  114. "/api/admin/statistis/selectProvincialStatistics",
  115. data: {
  116. pageNo: pageNo || 1,
  117. pageSize: this.state.pagination.pageSize,
  118. startDate:
  119. this.state.releaseDate.length > 0
  120. ? this.state.releaseDate[0]
  121. : undefined, //开始时间
  122. endDate:
  123. this.state.releaseDate.length > 0
  124. ? this.state.releaseDate[1]
  125. : undefined, //结束时间
  126. province: this.state.province || undefined,
  127. projectStatus: this.state.projectStatus || undefined, //项目类别
  128. projectType:
  129. typeof this.state.projectType === "number"
  130. ? this.state.projectType
  131. : undefined, //项目分类
  132. status: this.state.status,
  133. thchDepId: this.state.depId || undefined,
  134. projectId: this.state.kid || undefined,
  135. },
  136. success: function (data) {
  137. ShowModal(this);
  138. let theArr = [];
  139. if (!data.data || !data.data.list) {
  140. if (data.error && data.error.length) {
  141. message.warning(data.error[0].message);
  142. }
  143. } else {
  144. for (let i = 0; i < data.data.list.length; i++) {
  145. let thisdata = data.data.list[i];
  146. thisdata.key = (data.data.pageNo - 1) * data.data.pageSize + i + 1;
  147. theArr.push(thisdata);
  148. }
  149. }
  150. this.state.pagination.current = data.data.pageNo;
  151. this.state.pagination.total = data.data.totalCount;
  152. if (data.data && data.data.list && !data.data.list.length) {
  153. this.state.pagination.current = 0;
  154. this.state.pagination.total = 0;
  155. }
  156. this.setState({
  157. dataSource: theArr,
  158. pagination: this.state.pagination,
  159. });
  160. }.bind(this),
  161. }).always(
  162. function () {
  163. this.setState({
  164. loading: false,
  165. });
  166. }.bind(this)
  167. );
  168. }
  169. //部门
  170. departmentList() {
  171. $.ajax({
  172. method: "get",
  173. dataType: "json",
  174. crossDomain: false,
  175. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  176. data: {},
  177. success: function (data) {
  178. let thedata = data.data;
  179. let theArr = [];
  180. if (!thedata) {
  181. if (data.error && data.error.length) {
  182. message.warning(data.error[0].message);
  183. }
  184. } else {
  185. thedata.map(function (item, index) {
  186. theArr.push({
  187. key: index,
  188. name: item.name,
  189. id: item.id,
  190. });
  191. });
  192. }
  193. this.setState({
  194. departmentArr: theArr,
  195. });
  196. }.bind(this),
  197. });
  198. }
  199. resetAll() {
  200. this.setState(
  201. {
  202. releaseDate: [],
  203. searchOrderNo: "",
  204. searchContractNo: "",
  205. searchEnterpriseName: "",
  206. declarationBatch: "",
  207. province: "",
  208. depId: "",
  209. projectType: "",
  210. projectStatus: "",
  211. columns: currency((v, screen) => {
  212. this.openProjectSummary(v, screen);
  213. }),
  214. commodityName: "",
  215. kid: "",
  216. status: 0,
  217. taberReleaseDate: [],
  218. taberProjectType: "",
  219. taberCommodityName: "",
  220. },
  221. () => {
  222. this.loadData();
  223. }
  224. );
  225. }
  226. exportPending() {
  227. message.config({
  228. duration: 20,
  229. });
  230. let loading = message.loading("下载中...");
  231. this.setState({
  232. exportPendingLoading: true,
  233. });
  234. let url = `/api/admin/statistis/exporProvincialList?status=${this.state.status}`;
  235. let dep = this.state.departmentArr.filter((e) => e.id === this.state.depId); //责任部门名称
  236. let option = this.state.contactsOptionData.filter(
  237. (e) => e.id === this.state.projectStatus
  238. ); //项目类别名称
  239. if (dep.length > 0) {
  240. url = url + `&thchDepName=${dep[0].name}`;
  241. }
  242. if (option.length > 0) {
  243. url = url + `&projectStatusName=${option[0].cname}`;
  244. }
  245. if (typeof this.state.projectType === "number") {
  246. url =
  247. url +
  248. `&projectTypeName=${
  249. this.state.projectType === 0
  250. ? "通用"
  251. : this.state.projectType === 1
  252. ? "专利"
  253. : this.state.projectType === 2
  254. ? "软著"
  255. : this.state.projectType === 3
  256. ? "审计"
  257. : this.state.projectType === 4
  258. ? "双软"
  259. : this.state.projectType === 5
  260. ? "高新"
  261. : this.state.projectType === 6
  262. ? "商标"
  263. : ""
  264. }`;
  265. }
  266. if (this.state.commodityName) {
  267. url = url + `&projectName=${this.state.commodityName}`;
  268. }
  269. if (this.state.province) {
  270. url = url + `&provinceName=${getNewDiccityArr(this.state.province)}`;
  271. }
  272. let data = {
  273. startDate:
  274. this.state.releaseDate.length > 0
  275. ? this.state.releaseDate[0]
  276. : undefined, //开始时间
  277. endDate:
  278. this.state.releaseDate.length > 0
  279. ? this.state.releaseDate[1]
  280. : undefined, //结束时间
  281. thchDepId: this.state.depId || undefined, //责任部门ID
  282. projectStatus: this.state.projectStatus || undefined, //项目类别
  283. projectType:
  284. typeof this.state.projectType === "number"
  285. ? this.state.projectType
  286. : undefined, //项目分类
  287. province: this.state.province || undefined,
  288. projectId: this.state.kid || undefined,
  289. };
  290. for (let key in data) {
  291. if (data[key]) {
  292. url = url + `&${key}=${data[key]}`;
  293. }
  294. }
  295. $.ajax({
  296. method: "get",
  297. dataType: "json",
  298. crossDomain: false,
  299. url: url,
  300. data: {},
  301. success: function (data) {
  302. if (data.error.length === 0) {
  303. this.download(data.data);
  304. } else {
  305. message.warning(data.error[0].message);
  306. }
  307. }.bind(this),
  308. }).always(
  309. function () {
  310. loading();
  311. this.setState({
  312. exportPendingLoading: false,
  313. });
  314. }.bind(this)
  315. );
  316. }
  317. exportExcel() {
  318. let dep = this.state.departmentArr.filter(
  319. (v) => v.id === this.state.taberdepId
  320. )[0].name; //责任部门名称
  321. let option = this.state.contactsOptionData.filter(
  322. (v) => v.id === this.state.taberProjectStatus
  323. )[0].cname; //项目类别名称
  324. let data = {
  325. pageNo: this.state.pageNo || 1,
  326. pageSize: 9999,
  327. startDate:
  328. this.state.releaseDate.length > 0
  329. ? this.state.releaseDate[0]
  330. : undefined, //开始时间
  331. endDate:
  332. this.state.releaseDate.length > 0
  333. ? this.state.releaseDate[1]
  334. : undefined, //结束时间
  335. projectType: this.state.projectType.toString(), //项目分类
  336. // typeof this.state.projectType === "number"
  337. // ? this.state.projectType
  338. // : undefined,
  339. thchDepName: dep || undefined, //咨询师部门名称
  340. projectTypeName:
  341. this.state.projectType === 0
  342. ? "通用"
  343. : this.state.projectType === 1
  344. ? "专利"
  345. : this.state.projectType === 2
  346. ? "软著"
  347. : this.state.projectType === 3
  348. ? "审计"
  349. : this.state.projectType === 4
  350. ? "双软"
  351. : this.state.projectType === 5
  352. ? "高新"
  353. : this.state.projectType === 6
  354. ? "商标"
  355. : "", //项目分类(中文)
  356. projectStatusName: option || undefined, //项目品类(中文)
  357. provinceName: getNewDiccityArr(this.state.taberProvince) || undefined, //省份(中文)
  358. projectId: this.state.kid || undefined,
  359. province: this.state.taberProvince || undefined,
  360. projectStatus: this.state.taberProjectStatus || undefined, //项目类别
  361. thchDepId: this.state.taberdepId || undefined,
  362. status:
  363. this.state.projectType === 4
  364. ? 2
  365. : this.state.projectType === 2
  366. ? 3
  367. : this.state.projectType === 1
  368. ? 4
  369. : this.state.projectType === 5
  370. ? 1
  371. : this.state.contactsOptionData.filter(
  372. (v) => v.id === this.state.taberProjectStatus
  373. ).length > 0
  374. ? this.state.contactsOptionData.filter(
  375. (v) => v.id === this.state.taberProjectStatus
  376. )[0].cname === "高新"
  377. ? 1
  378. : 0
  379. : 0,
  380. screen: this.state.screen.toString(), //筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 12公示数
  381. };
  382. for (let key in data) {
  383. if (!data[key]) {
  384. delete data[key];
  385. }
  386. }
  387. window.location.href =
  388. globalConfig.context +
  389. "/api/admin/statistis/exporTaskList?" +
  390. $.param(data);
  391. }
  392. download(fileName) {
  393. window.location.href =
  394. globalConfig.context + "/open/download?fileName=" + fileName;
  395. }
  396. //项目类别
  397. selectSuperId() {
  398. $.ajax({
  399. method: "get",
  400. dataType: "json",
  401. crossDomain: false,
  402. url: globalConfig.context + "/api/admin/ProjectSize/getAllCname",
  403. data: {
  404. flag: 0,
  405. },
  406. success: function (data) {
  407. let theArr = [];
  408. let thedata = data.data;
  409. if (!thedata) {
  410. if (data.error && data.error.length) {
  411. message.warning(data.error[0].message);
  412. }
  413. }
  414. for (let i = 0; i < data.data.length; i++) {
  415. let theData = data.data[i];
  416. theArr.push(
  417. <Select.Option value={theData.id} key={theData.cname}>
  418. {theData.cname}
  419. </Select.Option>
  420. );
  421. }
  422. this.setState({
  423. contactsOption: theArr,
  424. contactsOptionData: data.data,
  425. });
  426. }.bind(this),
  427. }).always();
  428. }
  429. supervisorCui(e) {
  430. //客户名称与服务名称自动补全
  431. let api = "/api/admin/order/getBusinessProjectByName";
  432. $.ajax({
  433. method: "get",
  434. dataType: "json",
  435. crossDomain: false,
  436. url: globalConfig.context + api,
  437. data: {
  438. businessName: e,
  439. },
  440. success: function (data) {
  441. let thedata = data.data;
  442. if (!thedata) {
  443. if (data.error && data.error.length) {
  444. message.warning(data.error[0].message);
  445. }
  446. thedata = {};
  447. }
  448. this.setState({
  449. customerArr: thedata,
  450. });
  451. }.bind(this),
  452. }).always(
  453. function () {
  454. this.setState({
  455. loading: false,
  456. });
  457. }.bind(this)
  458. );
  459. }
  460. httpChangeCui(e) {
  461. if (e.length >= 1) {
  462. this.supervisorCui(e, false);
  463. }
  464. this.setState({
  465. commodityName: e,
  466. });
  467. }
  468. //上级主管输入框失去焦点是判断客户是否存在
  469. selectAuto(value) {
  470. let kid = [];
  471. let fwList = this.state.customerArr;
  472. fwList.map(function (item) {
  473. if (value === item.bname) {
  474. kid = item.id;
  475. }
  476. });
  477. this.setState({
  478. kid: kid,
  479. commodityName: value,
  480. });
  481. }
  482. componentWillMount() {
  483. this.loadData();
  484. this.departmentList();
  485. this.selectSuperId();
  486. }
  487. openProjectSummary(record, screen) {
  488. this.setState({
  489. projectSummary: true,
  490. taberProvince: record.province,
  491. taberProjectStatus: record.bpId, //项目类别
  492. taberdepId: record.thchDepId,
  493. screen: screen,
  494. });
  495. }
  496. render() {
  497. const dataSources = this.state.customerArr || [];
  498. const options = dataSources.map((group, index) => (
  499. <Select.Option key={index} value={group.bname}>
  500. {group.bname}
  501. </Select.Option>
  502. ));
  503. return (
  504. <div className="user-content">
  505. <div className="content-title" style={{ marginBottom: 10 }}>
  506. <span style={{ fontWeight: 900, fontSize: 16 }}>
  507. 项目统计 (
  508. {this.state.status === 2
  509. ? "专利"
  510. : this.state.status === 4
  511. ? "软著"
  512. : this.state.status === 1
  513. ? "高新"
  514. : this.state.status === 5
  515. ? "商标"
  516. : "通用"}
  517. )
  518. </span>
  519. </div>
  520. <Tabs defaultActiveKey="1" className="test">
  521. <TabPane tab="搜索" key="1">
  522. <div
  523. className="user-search"
  524. style={{
  525. marginTop: "10px",
  526. marginLeft: "10px",
  527. marginRight: "10px",
  528. }}
  529. >
  530. <span
  531. style={{
  532. display: "inline-block",
  533. marginRight: "10px",
  534. marginBottom: "10px",
  535. }}
  536. >
  537. <span>项目名称:</span>
  538. <AutoComplete
  539. className="certain-category-search"
  540. dropdownClassName="certain-category-search-dropdown"
  541. dropdownMatchSelectWidth={false}
  542. dropdownStyle={{ width: 200 }}
  543. style={{ width: 100, marginLeft: "10px" }}
  544. dataSource={options}
  545. placeholder="输入服务名称"
  546. value={this.state.commodityName}
  547. onChange={this.httpChangeCui}
  548. filterOption={true}
  549. onSelect={this.selectAuto}
  550. >
  551. <Input />
  552. </AutoComplete>
  553. </span>
  554. <span style={{ display: "inline-block" }}>
  555. <span style={{ marginRight: "10px", marginBottom: "10px" }}>
  556. 项目类别 :
  557. </span>
  558. <Select
  559. value={this.state.projectStatus || undefined}
  560. placeholder="请选择项目类别"
  561. notFoundContent="未获取到上级品类列表"
  562. style={{
  563. width: 100,
  564. marginRight: "10px",
  565. marginBottom: "10px",
  566. }}
  567. onChange={(e) => {
  568. let infor = this.state.contactsOptionData.filter(
  569. (v) => v.id === e
  570. );
  571. this.setState(
  572. {
  573. projectStatus: e,
  574. }
  575. // () => {
  576. // if (
  577. // infor.length &&
  578. // infor[0].cname === "高新" &&
  579. // typeof this.state.projectType !== "number"
  580. // ) {
  581. // this.setState(
  582. // {
  583. // columns: highTechColumns((v, screen) => {
  584. // this.openProjectSummary(v, screen);
  585. // }),
  586. // changeList: [],
  587. // status: 1,
  588. // },
  589. // () => {
  590. // this.loadData();
  591. // }
  592. // );
  593. // } else if (typeof this.state.projectType !== "number") {
  594. // this.setState(
  595. // {
  596. // columns: currency((v, screen) => {
  597. // this.openProjectSummary(v, screen);
  598. // }),
  599. // changeList: [],
  600. // status: 0,
  601. // },
  602. // () => {
  603. // this.loadData();
  604. // }
  605. // );
  606. // } else {
  607. // this.loadData();
  608. // }
  609. // }
  610. );
  611. }}
  612. >
  613. {this.state.contactsOption}
  614. </Select>
  615. </span>
  616. <span style={{ display: "inline-block" }}>
  617. <span style={{ marginRight: "10px", marginBottom: "10px" }}>
  618. 项目分类 :
  619. </span>
  620. <Select
  621. value={
  622. typeof this.state.projectType === "number"
  623. ? this.state.projectType
  624. : undefined
  625. }
  626. placeholder="请选择项目分类"
  627. style={{
  628. width: 100,
  629. marginRight: "10px",
  630. marginBottom: "10px",
  631. }}
  632. onChange={(e) => {
  633. this.setState(
  634. {
  635. projectType: e,
  636. columns:
  637. e === 0
  638. ? currency((v, screen) => {
  639. this.openProjectSummary(v, screen);
  640. })
  641. : e === 1
  642. ? invention((v, screen) => {
  643. this.openProjectSummary(v, screen);
  644. })
  645. : e === 2
  646. ? softWriting((v, screen) => {
  647. this.openProjectSummary(v, screen);
  648. })
  649. : e === 3
  650. ? currency((v, screen) => {
  651. this.openProjectSummary(v, screen);
  652. })
  653. : e === 4
  654. ? currency((v, screen) => {
  655. this.openProjectSummary(v, screen);
  656. })
  657. : e === 5
  658. ? highTechColumns((v, screen) => {
  659. this.openProjectSummary(v, screen);
  660. })
  661. : e === 6
  662. ? otherTrademarks((v, screen) => {
  663. this.openProjectSummary(v, screen);
  664. })
  665. : [],
  666. changeList: [],
  667. status:
  668. e === 1
  669. ? 2
  670. : e === 2
  671. ? 4
  672. : e === 5
  673. ? 1
  674. : e === 6
  675. ? 5
  676. : 0, // 0通用 1高新 2发明专利 3实用新型 4软著 5商标
  677. }
  678. // () => {
  679. // this.loadData();
  680. // }
  681. );
  682. }}
  683. >
  684. <Option value={0}>通用</Option>
  685. <Option value={1}>专利</Option>
  686. <Option value={2}>软著</Option>
  687. <Option value={3}>审计</Option>
  688. <Option value={4}>双软</Option>
  689. <Option value={5}>高新</Option>
  690. <Option value={6}>商标</Option>
  691. </Select>
  692. </span>
  693. <span
  694. style={{
  695. display: "inline-block",
  696. marginRight: "10px",
  697. marginBottom: "10px",
  698. }}
  699. >
  700. <span>派单省份:</span>
  701. <Select
  702. placeholder="请选择省份"
  703. style={{
  704. width: 100,
  705. marginRight: "10px",
  706. marginLeft: "10px",
  707. marginBottom: "10px",
  708. }}
  709. value={getNewDiccityArr(this.state.province)}
  710. onChange={(e) => {
  711. this.setState({ province: e });
  712. }}
  713. >
  714. {citySelect().map(function (item) {
  715. return (
  716. <Select.Option key={item.value} value={item.value}>
  717. {item.label}
  718. </Select.Option>
  719. );
  720. })}
  721. </Select>
  722. </span>
  723. <span
  724. style={{
  725. display: "inline-block",
  726. marginRight: "10px",
  727. marginBottom: "10px",
  728. }}
  729. >
  730. <span>负责部门:</span>
  731. <Select
  732. placeholder="请选择部门"
  733. style={{
  734. width: 200,
  735. marginRight: "10px",
  736. marginLeft: "10px",
  737. marginBottom: "10px",
  738. }}
  739. value={this.state.depId || undefined}
  740. onChange={(e) => {
  741. this.setState({ depId: e });
  742. }}
  743. >
  744. {this.state.departmentArr.map(function (item) {
  745. return (
  746. <Select.Option key={item.id} value={item.id}>
  747. {item.name}
  748. </Select.Option>
  749. );
  750. })}
  751. </Select>
  752. </span>
  753. <span style={{ display: "inline-block" }}>
  754. <span style={{ marginRight: "10px", marginBottom: "10px" }}>
  755. 派单时间 :
  756. </span>
  757. <RangePicker
  758. style={{ marginRight: "10px", marginBottom: "10px" }}
  759. value={[
  760. this.state.releaseDate[0]
  761. ? moment(this.state.releaseDate[0])
  762. : null,
  763. this.state.releaseDate[1]
  764. ? moment(this.state.releaseDate[1])
  765. : null,
  766. ]}
  767. onChange={(data, dataString) => {
  768. this.setState({ releaseDate: dataString });
  769. }}
  770. />
  771. </span>
  772. <Button
  773. type="primary"
  774. onClick={() => {
  775. if (this.state.commodityName.length === 0) {
  776. this.setState(
  777. {
  778. kid: "",
  779. },
  780. () => {
  781. this.loadData();
  782. }
  783. );
  784. } else {
  785. this.loadData();
  786. }
  787. }}
  788. style={{ marginRight: "10px", marginBottom: "10px" }}
  789. >
  790. 搜索
  791. </Button>
  792. <Button
  793. onClick={this.resetAll}
  794. style={{ marginRight: "10px", marginBottom: "10px" }}
  795. >
  796. 重置
  797. </Button>
  798. </div>
  799. </TabPane>
  800. <TabPane tab="更改表格显示数据" key="2">
  801. <div style={{ marginLeft: 10 }}>
  802. <ChooseList
  803. columns={this.state.columns}
  804. changeFn={this.changeList}
  805. changeList={this.state.changeList}
  806. top={55}
  807. margin={11}
  808. />
  809. </div>
  810. </TabPane>
  811. <TabPane tab="导出EXCEL" key="3">
  812. <Button
  813. type="primary"
  814. style={{ margin: "10px" }}
  815. loading={this.state.exportPendingLoading}
  816. onClick={this.exportPending}
  817. >
  818. 导出
  819. </Button>
  820. </TabPane>
  821. </Tabs>
  822. <div className="patent-table">
  823. <Spin spinning={this.state.loading}>
  824. <Table
  825. bordered
  826. size="middle"
  827. scroll={{ x: 800, y: 0 }}
  828. columns={
  829. this.state.changeList.length > 0
  830. ? this.state.changeList
  831. : this.state.columns
  832. }
  833. dataSource={this.state.dataSource}
  834. pagination={this.state.pagination}
  835. />
  836. </Spin>
  837. </div>
  838. {this.state.projectSummary ? (
  839. <Modal
  840. maskClosable={false}
  841. className="customeDetails"
  842. footer=""
  843. title=""
  844. width="1800px"
  845. visible={this.state.projectSummary}
  846. onOk={() => {
  847. this.setState({
  848. projectSummary: false,
  849. });
  850. }}
  851. onCancel={() => {
  852. this.setState({
  853. projectSummary: false,
  854. });
  855. }}
  856. >
  857. <HighTech
  858. searchData={{
  859. startDate:
  860. this.state.releaseDate.length > 0
  861. ? this.state.releaseDate[0]
  862. : undefined, //开始时间
  863. endDate:
  864. this.state.releaseDate.length > 0
  865. ? this.state.releaseDate[1]
  866. : undefined, //结束时间
  867. projectType:
  868. typeof this.state.projectType === "number"
  869. ? this.state.projectType
  870. : undefined, //项目分类
  871. projectId: this.state.kid || undefined,
  872. province: this.state.taberProvince || undefined,
  873. projectStatus: this.state.taberProjectStatus || undefined, //项目类别
  874. thchDepId: this.state.taberdepId || undefined,
  875. status:
  876. this.state.projectType === 4
  877. ? 2
  878. : this.state.projectType === 2
  879. ? 3
  880. : this.state.projectType === 1
  881. ? 4
  882. : this.state.projectType === 5
  883. ? 1
  884. : this.state.contactsOptionData.filter(
  885. (v) => v.id === this.state.taberProjectStatus
  886. ).length > 0
  887. ? this.state.contactsOptionData.filter(
  888. (v) => v.id === this.state.taberProjectStatus
  889. )[0].cname === "高新"
  890. ? 1
  891. : 0
  892. : 0,
  893. screen: this.state.screen, //筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 12公示数
  894. }}
  895. introduce={() => (
  896. <div
  897. className="user-search"
  898. style={{
  899. marginTop: "10px",
  900. marginLeft: "10px",
  901. marginRight: "10px",
  902. }}
  903. >
  904. {this.state.taberProvince ? (
  905. <span
  906. style={{
  907. display: "inline-block",
  908. marginRight: "20px",
  909. marginBottom: "10px",
  910. }}
  911. >
  912. <span>派单省份:</span>
  913. <span style={{ width: 100, marginLeft: "10px" }}>
  914. {getNewDiccityArr(this.state.taberProvince)}
  915. </span>
  916. </span>
  917. ) : null}
  918. {this.state.taberProjectStatus ? (
  919. <span
  920. style={{
  921. display: "inline-block",
  922. marginRight: "20px",
  923. marginBottom: "10px",
  924. }}
  925. >
  926. <span>项目类别 :</span>
  927. <span style={{ width: 100, marginLeft: "10px" }}>
  928. {
  929. this.state.contactsOptionData.filter(
  930. (v) => v.id === this.state.taberProjectStatus
  931. )[0].cname
  932. }
  933. </span>
  934. </span>
  935. ) : null}
  936. {this.state.taberdepId ? (
  937. <span
  938. style={{
  939. display: "inline-block",
  940. marginRight: "20px",
  941. marginBottom: "10px",
  942. }}
  943. >
  944. <span>负责部门:</span>
  945. <span style={{ width: 200, marginLeft: "10px" }}>
  946. {
  947. this.state.departmentArr.filter(
  948. (v) => v.id === this.state.taberdepId
  949. )[0].name
  950. }
  951. </span>
  952. </span>
  953. ) : null}
  954. {this.state.taberCommodityName ? (
  955. <span
  956. style={{
  957. display: "inline-block",
  958. marginRight: "20px",
  959. marginBottom: "10px",
  960. }}
  961. >
  962. <span>项目名称:</span>
  963. <span style={{ width: 100, marginLeft: "10px" }}>
  964. {this.state.taberCommodityName}
  965. </span>
  966. </span>
  967. ) : null}
  968. {typeof this.state.taberProjectType === "number" ? (
  969. <span
  970. style={{
  971. display: "inline-block",
  972. marginRight: "20px",
  973. marginBottom: "10px",
  974. }}
  975. >
  976. <span>项目分类 :</span>
  977. <span style={{ width: 100, marginRight: "10px" }}>
  978. {this.state.taberProjectType === 0
  979. ? "通用"
  980. : this.state.taberProjectType === 1
  981. ? "专利"
  982. : this.state.taberProjectType === 2
  983. ? "软著"
  984. : this.state.taberProjectType === 3
  985. ? "审计"
  986. : this.state.taberProjectType === 4
  987. ? "双软"
  988. : this.state.taberProjectType === 5
  989. ? "高新"
  990. : this.state.taberProjectType === 6
  991. ? "商标"
  992. : ""}
  993. </span>
  994. </span>
  995. ) : null}
  996. {this.state.taberReleaseDate.length > 0 ? (
  997. <span
  998. style={{
  999. display: "inline-block",
  1000. marginRight: "20px",
  1001. marginBottom: "10px",
  1002. }}
  1003. >
  1004. <span>派单时间 :</span>
  1005. <span style={{ width: 100, marginRight: "10px" }}>
  1006. {this.state.taberReleaseDate[0] +
  1007. "~" +
  1008. this.state.taberReleaseDate[1]}
  1009. </span>
  1010. </span>
  1011. ) : null}
  1012. <Button type="primary" onClick={this.exportExcel}>
  1013. 导出EXCEL
  1014. </Button>
  1015. </div>
  1016. )}
  1017. />
  1018. </Modal>
  1019. ) : null}
  1020. </div>
  1021. );
  1022. }
  1023. }
  1024. export default ProjecCount;