projecCount.jsx 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070
  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: undefined,
  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=${this.state.projectType === 0
  249. ? "通用"
  250. : this.state.projectType === 1
  251. ? "专利"
  252. : this.state.projectType === 2
  253. ? "软著"
  254. : this.state.projectType === 3
  255. ? "审计"
  256. : this.state.projectType === 4
  257. ? "双软"
  258. : this.state.projectType === 5
  259. ? "高新"
  260. : this.state.projectType === 6
  261. ? "商标"
  262. : ""
  263. }`;
  264. }
  265. if (this.state.commodityName) {
  266. url = url + `&projectName=${this.state.commodityName}`;
  267. }
  268. if (this.state.province) {
  269. url = url + `&provinceName=${getNewDiccityArr(this.state.province)}`;
  270. }
  271. let data = {
  272. startDate:
  273. this.state.releaseDate.length > 0
  274. ? this.state.releaseDate[0]
  275. : undefined, //开始时间
  276. endDate:
  277. this.state.releaseDate.length > 0
  278. ? this.state.releaseDate[1]
  279. : undefined, //结束时间
  280. thchDepId: this.state.depId || undefined, //责任部门ID
  281. projectStatus: this.state.projectStatus || undefined, //项目类别
  282. projectType:
  283. typeof this.state.projectType === "number"
  284. ? this.state.projectType
  285. : undefined, //项目分类
  286. province: this.state.province || undefined,
  287. projectId: this.state.kid || undefined,
  288. };
  289. for (let key in data) {
  290. if (data[key]) {
  291. url = url + `&${key}=${data[key]}`;
  292. }
  293. }
  294. $.ajax({
  295. method: "get",
  296. dataType: "json",
  297. crossDomain: false,
  298. url: url,
  299. data: {},
  300. success: function (data) {
  301. if (data.error.length === 0) {
  302. this.download(data.data);
  303. } else {
  304. message.warning(data.error[0].message);
  305. }
  306. }.bind(this),
  307. }).always(
  308. function () {
  309. loading();
  310. this.setState({
  311. exportPendingLoading: false,
  312. });
  313. }.bind(this)
  314. );
  315. }
  316. exportExcel() {
  317. let dep = this.state.departmentArr.filter(
  318. (v) => v.id === this.state.taberdepId
  319. )[0].name; //责任部门名称
  320. let option = this.state.contactsOptionData.filter(
  321. (v) => v.id === this.state.taberProjectStatus
  322. )[0].cname; //项目类别名称
  323. let data = {
  324. pageNo: this.state.pageNo || 1,
  325. pageSize: 9999,
  326. startDate:
  327. this.state.releaseDate.length > 0
  328. ? this.state.releaseDate[0]
  329. : undefined, //开始时间
  330. endDate:
  331. this.state.releaseDate.length > 0
  332. ? this.state.releaseDate[1]
  333. : undefined, //结束时间
  334. projectType: this.state.projectType.toString(), //项目分类
  335. // typeof this.state.projectType === "number"
  336. // ? this.state.projectType
  337. // : undefined,
  338. thchDepName: dep || undefined, //咨询师部门名称
  339. projectTypeName:
  340. this.state.projectType === 0
  341. ? "通用"
  342. : this.state.projectType === 1
  343. ? "专利"
  344. : this.state.projectType === 2
  345. ? "软著"
  346. : this.state.projectType === 3
  347. ? "审计"
  348. : this.state.projectType === 4
  349. ? "双软"
  350. : this.state.projectType === 5
  351. ? "高新"
  352. : this.state.projectType === 6
  353. ? "商标"
  354. : "", //项目分类(中文)
  355. projectStatusName: option || undefined, //项目品类(中文)
  356. provinceName: getNewDiccityArr(this.state.taberProvince) || undefined, //省份(中文)
  357. projectId: this.state.kid || undefined,
  358. province: this.state.taberProvince || undefined,
  359. projectStatus: this.state.taberProjectStatus || undefined, //项目类别
  360. thchDepId: this.state.taberdepId || undefined,
  361. status:
  362. this.state.projectType === 4
  363. ? 2
  364. : this.state.projectType === 2
  365. ? 3
  366. : this.state.projectType === 1
  367. ? 4
  368. : this.state.projectType === 5
  369. ? 1
  370. : this.state.contactsOptionData.filter(
  371. (v) => v.id === this.state.taberProjectStatus
  372. ).length > 0
  373. ? this.state.contactsOptionData.filter(
  374. (v) => v.id === this.state.taberProjectStatus
  375. )[0].cname === "高新"
  376. ? 1
  377. : 0
  378. : 0,
  379. screen: this.state.screen.toString(), //筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 12公示数
  380. };
  381. for (let key in data) {
  382. if (!data[key]) {
  383. delete data[key];
  384. }
  385. }
  386. window.location.href =
  387. globalConfig.context +
  388. "/api/admin/statistis/exporTaskList?" +
  389. $.param(data);
  390. }
  391. download(fileName) {
  392. window.location.href =
  393. globalConfig.context + "/open/download?fileName=" + fileName;
  394. }
  395. //项目类别
  396. selectSuperId() {
  397. $.ajax({
  398. method: "get",
  399. dataType: "json",
  400. crossDomain: false,
  401. url: globalConfig.context + "/api/admin/ProjectSize/getAllCname",
  402. data: {
  403. flag: 0,
  404. },
  405. success: function (data) {
  406. let theArr = [];
  407. let thedata = data.data;
  408. if (!thedata) {
  409. if (data.error && data.error.length) {
  410. message.warning(data.error[0].message);
  411. }
  412. }
  413. for (let i = 0; i < data.data.length; i++) {
  414. let theData = data.data[i];
  415. theArr.push(
  416. <Select.Option value={theData.id} key={theData.cname}>
  417. {theData.cname}
  418. </Select.Option>
  419. );
  420. }
  421. this.setState({
  422. contactsOption: theArr,
  423. contactsOptionData: data.data,
  424. });
  425. }.bind(this),
  426. }).always();
  427. }
  428. supervisorCui(e) {
  429. //客户名称与服务名称自动补全
  430. let api = "/api/admin/order/getBusinessProjectByName";
  431. $.ajax({
  432. method: "get",
  433. dataType: "json",
  434. crossDomain: false,
  435. url: globalConfig.context + api,
  436. data: {
  437. businessName: e,
  438. },
  439. success: function (data) {
  440. let thedata = data.data;
  441. if (!thedata) {
  442. if (data.error && data.error.length) {
  443. message.warning(data.error[0].message);
  444. }
  445. thedata = {};
  446. }
  447. this.setState({
  448. customerArr: thedata,
  449. });
  450. }.bind(this),
  451. }).always(
  452. function () {
  453. this.setState({
  454. loading: false,
  455. });
  456. }.bind(this)
  457. );
  458. }
  459. httpChangeCui(e) {
  460. if (e.length >= 1) {
  461. this.supervisorCui(e, false);
  462. }
  463. this.setState({
  464. commodityName: e,
  465. });
  466. }
  467. //上级主管输入框失去焦点是判断客户是否存在
  468. selectAuto(value) {
  469. let kid = [];
  470. let fwList = this.state.customerArr;
  471. fwList.map(function (item) {
  472. if (value === item.bname) {
  473. kid = item.id;
  474. }
  475. });
  476. this.setState({
  477. kid: kid,
  478. commodityName: value,
  479. });
  480. }
  481. componentWillMount() {
  482. this.loadData();
  483. this.departmentList();
  484. this.selectSuperId();
  485. }
  486. openProjectSummary(record, screen) {
  487. this.setState({
  488. projectSummary: true,
  489. taberProvince: record.province,
  490. taberProjectStatus: record.bpId, //项目类别
  491. taberdepId: record.thchDepId,
  492. screen: screen,
  493. });
  494. }
  495. render() {
  496. const dataSources = this.state.customerArr || [];
  497. const options = dataSources.map((group, index) => (
  498. <Select.Option key={index} value={group.bname}>
  499. {group.bname}
  500. </Select.Option>
  501. ));
  502. return (
  503. <div className="user-content">
  504. <div className="content-title" style={{ marginBottom: 10 }}>
  505. <span style={{ fontWeight: 900, fontSize: 16 }}>
  506. 项目统计 (
  507. {this.state.status === 2
  508. ? "专利"
  509. : this.state.status === 4
  510. ? "软著"
  511. : this.state.status === 1
  512. ? "高新"
  513. : this.state.status === 5
  514. ? "商标"
  515. : "通用"}
  516. )
  517. </span>
  518. </div>
  519. <Tabs defaultActiveKey="1" className="test">
  520. <TabPane tab="搜索" key="1">
  521. <div
  522. className="user-search"
  523. style={{
  524. marginTop: "10px",
  525. marginLeft: "10px",
  526. marginRight: "10px",
  527. }}
  528. >
  529. <span
  530. style={{
  531. display: "inline-block",
  532. marginRight: "10px",
  533. marginBottom: "10px",
  534. }}
  535. >
  536. <span>项目名称:</span>
  537. <AutoComplete
  538. className="certain-category-search"
  539. dropdownClassName="certain-category-search-dropdown"
  540. dropdownMatchSelectWidth={false}
  541. dropdownStyle={{ width: 200 }}
  542. style={{ width: 100, marginLeft: "10px" }}
  543. dataSource={options}
  544. placeholder="输入服务名称"
  545. value={this.state.commodityName}
  546. onChange={this.httpChangeCui}
  547. filterOption={true}
  548. onSelect={this.selectAuto}
  549. >
  550. <Input />
  551. </AutoComplete>
  552. </span>
  553. <span style={{ display: "inline-block" }}>
  554. <span style={{ marginRight: "10px", marginBottom: "10px" }}>
  555. 项目类别 :
  556. </span>
  557. <Select
  558. value={this.state.projectStatus || undefined}
  559. placeholder="请选择项目类别"
  560. notFoundContent="未获取到上级品类列表"
  561. style={{
  562. width: 100,
  563. marginRight: "10px",
  564. marginBottom: "10px",
  565. }}
  566. onChange={(e) => {
  567. let infor = this.state.contactsOptionData.filter(
  568. (v) => v.id === e
  569. );
  570. this.setState(
  571. {
  572. projectStatus: e,
  573. }
  574. // () => {
  575. // if (
  576. // infor.length &&
  577. // infor[0].cname === "高新" &&
  578. // typeof this.state.projectType !== "number"
  579. // ) {
  580. // this.setState(
  581. // {
  582. // columns: highTechColumns((v, screen) => {
  583. // this.openProjectSummary(v, screen);
  584. // }),
  585. // changeList: [],
  586. // status: 1,
  587. // },
  588. // () => {
  589. // this.loadData();
  590. // }
  591. // );
  592. // } else if (typeof this.state.projectType !== "number") {
  593. // this.setState(
  594. // {
  595. // columns: currency((v, screen) => {
  596. // this.openProjectSummary(v, screen);
  597. // }),
  598. // changeList: [],
  599. // status: 0,
  600. // },
  601. // () => {
  602. // this.loadData();
  603. // }
  604. // );
  605. // } else {
  606. // this.loadData();
  607. // }
  608. // }
  609. );
  610. }}
  611. >
  612. {this.state.contactsOption}
  613. </Select>
  614. </span>
  615. <span style={{ display: "inline-block" }}>
  616. <span style={{ marginRight: "10px", marginBottom: "10px" }}>
  617. 项目分类 :
  618. </span>
  619. <Select
  620. value={
  621. typeof this.state.projectType === "number"
  622. ? this.state.projectType
  623. : undefined
  624. }
  625. placeholder="请选择项目分类"
  626. style={{
  627. width: 100,
  628. marginRight: "10px",
  629. marginBottom: "10px",
  630. }}
  631. onChange={(e) => {
  632. this.setState(
  633. {
  634. projectType: e,
  635. columns:
  636. e === 0
  637. ? currency((v, screen) => {
  638. this.openProjectSummary(v, screen);
  639. })
  640. : e === 1
  641. ? invention((v, screen) => {
  642. this.openProjectSummary(v, screen);
  643. })
  644. : e === 2
  645. ? softWriting((v, screen) => {
  646. this.openProjectSummary(v, screen);
  647. })
  648. : e === 3
  649. ? currency((v, screen) => {
  650. this.openProjectSummary(v, screen);
  651. })
  652. : e === 4
  653. ? currency((v, screen) => {
  654. this.openProjectSummary(v, screen);
  655. })
  656. : e === 5
  657. ? highTechColumns((v, screen) => {
  658. this.openProjectSummary(v, screen);
  659. })
  660. : e === 6
  661. ? otherTrademarks((v, screen) => {
  662. this.openProjectSummary(v, screen);
  663. })
  664. : [],
  665. changeList: [],
  666. status:
  667. e === 1
  668. ? 2
  669. : e === 2
  670. ? 4
  671. : e === 5
  672. ? 1
  673. : e === 6
  674. ? 5
  675. : 0, // 0通用 1高新 2发明专利 3实用新型 4软著 5商标
  676. }
  677. // () => {
  678. // this.loadData();
  679. // }
  680. );
  681. }}
  682. >
  683. <Option value={0}>通用</Option>
  684. <Option value={1}>专利</Option>
  685. <Option value={2}>软著</Option>
  686. <Option value={3}>审计</Option>
  687. <Option value={4}>双软</Option>
  688. <Option value={5}>高新</Option>
  689. <Option value={6}>商标</Option>
  690. </Select>
  691. </span>
  692. <span
  693. style={{
  694. display: "inline-block",
  695. marginRight: "10px",
  696. marginBottom: "10px",
  697. }}
  698. >
  699. <span>派单省份:</span>
  700. <Select
  701. placeholder="请选择省份"
  702. style={{
  703. width: 100,
  704. marginRight: "10px",
  705. marginLeft: "10px",
  706. marginBottom: "10px",
  707. }}
  708. value={getNewDiccityArr(this.state.province)}
  709. onChange={(e) => {
  710. this.setState({ province: e });
  711. }}
  712. >
  713. {citySelect().map(function (item) {
  714. return (
  715. <Select.Option key={item.value} value={item.value}>
  716. {item.label}
  717. </Select.Option>
  718. );
  719. })}
  720. </Select>
  721. </span>
  722. <span
  723. style={{
  724. display: "inline-block",
  725. marginRight: "10px",
  726. marginBottom: "10px",
  727. }}
  728. >
  729. <span>负责部门:</span>
  730. <Select
  731. placeholder="请选择部门"
  732. style={{
  733. width: 200,
  734. marginRight: "10px",
  735. marginLeft: "10px",
  736. marginBottom: "10px",
  737. }}
  738. value={this.state.depId || undefined}
  739. onChange={(e) => {
  740. this.setState({ depId: e });
  741. }}
  742. >
  743. {this.state.departmentArr.map(function (item) {
  744. return (
  745. <Select.Option key={item.id} value={item.id}>
  746. {item.name}
  747. </Select.Option>
  748. );
  749. })}
  750. </Select>
  751. </span>
  752. <span style={{ display: "inline-block" }}>
  753. <span style={{ marginRight: "10px", marginBottom: "10px" }}>
  754. 派单时间 :
  755. </span>
  756. <RangePicker
  757. style={{ marginRight: "10px", marginBottom: "10px" }}
  758. value={[
  759. this.state.releaseDate[0]
  760. ? moment(this.state.releaseDate[0])
  761. : null,
  762. this.state.releaseDate[1]
  763. ? moment(this.state.releaseDate[1])
  764. : null,
  765. ]}
  766. onChange={(data, dataString) => {
  767. this.setState({ releaseDate: dataString });
  768. }}
  769. />
  770. </span>
  771. <Button
  772. type="primary"
  773. onClick={() => {
  774. if (this.state.commodityName.length === 0) {
  775. this.setState(
  776. {
  777. kid: "",
  778. },
  779. () => {
  780. this.loadData();
  781. }
  782. );
  783. } else {
  784. this.loadData();
  785. }
  786. }}
  787. style={{ marginRight: "10px", marginBottom: "10px" }}
  788. >
  789. 搜索
  790. </Button>
  791. <Button
  792. onClick={this.resetAll}
  793. style={{ marginRight: "10px", marginBottom: "10px" }}
  794. >
  795. 重置
  796. </Button>
  797. </div>
  798. </TabPane>
  799. <TabPane tab="更改表格显示数据" key="2">
  800. <div style={{ marginLeft: 10 }}>
  801. <ChooseList
  802. columns={this.state.columns}
  803. changeFn={this.changeList}
  804. changeList={this.state.changeList}
  805. top={55}
  806. margin={11}
  807. />
  808. </div>
  809. </TabPane>
  810. <TabPane tab="导出EXCEL" key="3">
  811. <Button
  812. type="primary"
  813. style={{ margin: "10px" }}
  814. loading={this.state.exportPendingLoading}
  815. onClick={this.exportPending}
  816. >
  817. 导出
  818. </Button>
  819. </TabPane>
  820. </Tabs>
  821. <div className="patent-table">
  822. <Spin spinning={this.state.loading}>
  823. <Table
  824. bordered
  825. size="middle"
  826. scroll={{ x: 800, y: 0 }}
  827. columns={
  828. this.state.changeList
  829. ? this.state.changeList
  830. : this.state.columns
  831. }
  832. dataSource={this.state.dataSource}
  833. pagination={this.state.pagination}
  834. />
  835. </Spin>
  836. </div>
  837. {this.state.projectSummary ? (
  838. <Modal
  839. maskClosable={false}
  840. className="customeDetails"
  841. footer=""
  842. title=""
  843. width="1800px"
  844. visible={this.state.projectSummary}
  845. onOk={() => {
  846. this.setState({
  847. projectSummary: false,
  848. });
  849. }}
  850. onCancel={() => {
  851. this.setState({
  852. projectSummary: false,
  853. });
  854. }}
  855. >
  856. <HighTech
  857. searchData={{
  858. startDate:
  859. this.state.releaseDate.length > 0
  860. ? this.state.releaseDate[0]
  861. : undefined, //开始时间
  862. endDate:
  863. this.state.releaseDate.length > 0
  864. ? this.state.releaseDate[1]
  865. : undefined, //结束时间
  866. projectType:
  867. typeof this.state.projectType === "number"
  868. ? this.state.projectType
  869. : undefined, //项目分类
  870. projectId: this.state.kid || undefined,
  871. province: this.state.taberProvince || undefined,
  872. projectStatus: this.state.taberProjectStatus || undefined, //项目类别
  873. thchDepId: this.state.taberdepId || undefined,
  874. status:
  875. this.state.projectType === 4
  876. ? 2
  877. : this.state.projectType === 2
  878. ? 3
  879. : this.state.projectType === 1
  880. ? 4
  881. : this.state.projectType === 5
  882. ? 1
  883. : this.state.contactsOptionData.filter(
  884. (v) => v.id === this.state.taberProjectStatus
  885. ).length > 0
  886. ? this.state.contactsOptionData.filter(
  887. (v) => v.id === this.state.taberProjectStatus
  888. )[0].cname === "高新"
  889. ? 1
  890. : 0
  891. : 0,
  892. screen: this.state.screen, //筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 12公示数
  893. }}
  894. introduce={() => (
  895. <div
  896. className="user-search"
  897. style={{
  898. marginTop: "10px",
  899. marginLeft: "10px",
  900. marginRight: "10px",
  901. }}
  902. >
  903. {this.state.taberProvince ? (
  904. <span
  905. style={{
  906. display: "inline-block",
  907. marginRight: "20px",
  908. marginBottom: "10px",
  909. }}
  910. >
  911. <span>派单省份:</span>
  912. <span style={{ width: 100, marginLeft: "10px" }}>
  913. {getNewDiccityArr(this.state.taberProvince)}
  914. </span>
  915. </span>
  916. ) : null}
  917. {this.state.taberProjectStatus ? (
  918. <span
  919. style={{
  920. display: "inline-block",
  921. marginRight: "20px",
  922. marginBottom: "10px",
  923. }}
  924. >
  925. <span>项目类别 :</span>
  926. <span style={{ width: 100, marginLeft: "10px" }}>
  927. {
  928. this.state.contactsOptionData.filter(
  929. (v) => v.id === this.state.taberProjectStatus
  930. )[0].cname
  931. }
  932. </span>
  933. </span>
  934. ) : null}
  935. {this.state.taberdepId ? (
  936. <span
  937. style={{
  938. display: "inline-block",
  939. marginRight: "20px",
  940. marginBottom: "10px",
  941. }}
  942. >
  943. <span>负责部门:</span>
  944. <span style={{ width: 200, marginLeft: "10px" }}>
  945. {
  946. this.state.departmentArr.filter(
  947. (v) => v.id === this.state.taberdepId
  948. )[0].name
  949. }
  950. </span>
  951. </span>
  952. ) : null}
  953. {this.state.taberCommodityName ? (
  954. <span
  955. style={{
  956. display: "inline-block",
  957. marginRight: "20px",
  958. marginBottom: "10px",
  959. }}
  960. >
  961. <span>项目名称:</span>
  962. <span style={{ width: 100, marginLeft: "10px" }}>
  963. {this.state.taberCommodityName}
  964. </span>
  965. </span>
  966. ) : null}
  967. {typeof this.state.taberProjectType === "number" ? (
  968. <span
  969. style={{
  970. display: "inline-block",
  971. marginRight: "20px",
  972. marginBottom: "10px",
  973. }}
  974. >
  975. <span>项目分类 :</span>
  976. <span style={{ width: 100, marginRight: "10px" }}>
  977. {this.state.taberProjectType === 0
  978. ? "通用"
  979. : this.state.taberProjectType === 1
  980. ? "专利"
  981. : this.state.taberProjectType === 2
  982. ? "软著"
  983. : this.state.taberProjectType === 3
  984. ? "审计"
  985. : this.state.taberProjectType === 4
  986. ? "双软"
  987. : this.state.taberProjectType === 5
  988. ? "高新"
  989. : this.state.taberProjectType === 6
  990. ? "商标"
  991. : ""}
  992. </span>
  993. </span>
  994. ) : null}
  995. {this.state.taberReleaseDate.length > 0 ? (
  996. <span
  997. style={{
  998. display: "inline-block",
  999. marginRight: "20px",
  1000. marginBottom: "10px",
  1001. }}
  1002. >
  1003. <span>派单时间 :</span>
  1004. <span style={{ width: 100, marginRight: "10px" }}>
  1005. {this.state.taberReleaseDate[0] +
  1006. "~" +
  1007. this.state.taberReleaseDate[1]}
  1008. </span>
  1009. </span>
  1010. ) : null}
  1011. <Button type="primary" onClick={this.exportExcel}>
  1012. 导出EXCEL
  1013. </Button>
  1014. </div>
  1015. )}
  1016. />
  1017. </Modal>
  1018. ) : null}
  1019. </div>
  1020. );
  1021. }
  1022. }
  1023. export default ProjecCount;