addorders.js 93 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965
  1. import React from "react";
  2. import {
  3. Table,
  4. Modal,
  5. message,
  6. Spin,
  7. Input,
  8. Select,
  9. Button,
  10. Form,
  11. Popconfirm,
  12. AutoComplete,
  13. DatePicker,
  14. Col,
  15. Tag
  16. } from "antd";
  17. import $ from "jquery/src/ajax";
  18. import "../userMangagement.less";
  19. import moment from "moment";
  20. import { cuiJieDian } from "@/dataDic.js";
  21. import Picture from "@/manageCenter/publicComponent/picture";
  22. import { jiedian, tepi, boutique } from "../../../dataDic.js";
  23. import {
  24. splitUrl,
  25. getProcessStatus,
  26. getLiquidationStatus,
  27. getboutique,
  28. getApprovedState,
  29. getjiedian,
  30. getCuikuan,
  31. getProjectStatus, getProjectName
  32. } from "../../../tools.js";
  33. import PicturesWall from "./changeComponent/picturesWall.js";
  34. import ResolutionDetail from "@/resolutionDetail";
  35. import EnterpriseNameChange from "../../../common/enterpriseNameChange";
  36. import ProjectOperation from "../../../common/projectOperation";
  37. import ImgList from "../../../common/imgList";
  38. const Addorders = Form.create()(
  39. React.createClass({
  40. //查看项目列表
  41. loadData(orderNo) {
  42. this.state.data = [];
  43. this.setState({
  44. loading: true,
  45. });
  46. $.ajax({
  47. method: "get",
  48. dataType: "json",
  49. crossDomain: false,
  50. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  51. data: {
  52. orderNo: orderNo,
  53. },
  54. success: function (data) {
  55. let theArr = [];
  56. if (!data.data) {
  57. if (data.error && data.error.length) {
  58. message.warning(data.error[0].message);
  59. }
  60. } else {
  61. for (let i = 0; i < data.data.length; i++) {
  62. let thisdata = data.data[i];
  63. thisdata.key = i;
  64. thisdata.sort = thisdata.cSort;
  65. theArr.push(thisdata);
  66. }
  67. }
  68. this.departmentList();
  69. this.setState({
  70. dataSource: theArr,
  71. pagination: false,
  72. });
  73. }.bind(this),
  74. }).always(
  75. function () {
  76. this.setState({
  77. loading: false,
  78. });
  79. }.bind(this)
  80. );
  81. },
  82. //收款节点
  83. loadDatas(orderNo) {
  84. this.state.data = [];
  85. this.setState({
  86. loading: true,
  87. });
  88. $.ajax({
  89. method: "get",
  90. dataType: "json",
  91. crossDomain: false,
  92. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  93. data: {
  94. orderNo: orderNo,
  95. },
  96. success: function (data) {
  97. let theArr = [];
  98. if (!data.data) {
  99. if (data.error && data.error.length) {
  100. message.warning(data.error[0].message);
  101. }
  102. } else {
  103. for (let i = 0; i < data.data.length; i++) {
  104. let thisdata = data.data[i];
  105. theArr.push({
  106. key: i,
  107. id: thisdata.id,
  108. });
  109. }
  110. }
  111. this.setState({
  112. dataSource: theArr,
  113. pagination: false,
  114. });
  115. }.bind(this),
  116. }).always(
  117. function () {
  118. this.setState({
  119. loading: false,
  120. });
  121. }.bind(this)
  122. );
  123. },
  124. getInitialState() {
  125. return {
  126. rotateDeg: 0,
  127. loading: false,
  128. visible: false,
  129. resVisible: false,
  130. orgCodeUrl: [],
  131. replenishUrl: [],
  132. voucherUrl: [],
  133. customerArr: [],
  134. mark: false,
  135. activeKey: "1",
  136. buttonStatus: true,
  137. typeChange: 0,
  138. bussStats: false,
  139. checkedKeys: [],
  140. lookflowList: [],
  141. contractUrl: [],
  142. applicationUrl: [],
  143. active: {
  144. applySign: false,
  145. },
  146. lookState: false,
  147. signBillVisible: false,
  148. commod: "",
  149. columns: [
  150. {
  151. title: "业务项目名称",
  152. dataIndex: "commodityName",
  153. key: "commodityName",
  154. render: (text, record) => {
  155. return (
  156. <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span></span>
  157. )
  158. }
  159. },
  160. {
  161. title: "项目类别",
  162. dataIndex: "cname",
  163. key: "cname",
  164. },
  165. {
  166. title: "项目数量",
  167. dataIndex: "commodityQuantity",
  168. key: "commodityQuantity",
  169. render: (text, record) => {
  170. if (record.splitStatus == 1) {
  171. return (
  172. <span>
  173. {text}{" "}
  174. <Tag
  175. color="#108ee9"
  176. onClick={(e) => {
  177. e.stopPropagation();
  178. this.showRes(record);
  179. }}
  180. >
  181. 已拆
  182. </Tag>
  183. </span>
  184. );
  185. } else {
  186. return text;
  187. }
  188. },
  189. },
  190. {
  191. title: "金额(万元)",
  192. dataIndex: "commodityPrice",
  193. key: "commodityPrice",
  194. },
  195. {
  196. title: "负责人",
  197. dataIndex: "contacts",
  198. key: "contacts",
  199. },
  200. {
  201. title: "负责人电话",
  202. dataIndex: "contactsMobile",
  203. key: "contactsMobile",
  204. },
  205. {
  206. title: "项目状态",
  207. dataIndex: "projectStatus",
  208. key: "projectStatus",
  209. render: (text) => {
  210. return getProjectName(text);
  211. },
  212. },
  213. {
  214. title: "主要项目",
  215. dataIndex: "main",
  216. key: "main",
  217. render: (text) => {
  218. return text ? "是" : "否";
  219. },
  220. },
  221. {
  222. title: "项目说明",
  223. dataIndex: "taskComment",
  224. key: "taskComment",
  225. render: (text) => {
  226. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  227. },
  228. },
  229. {
  230. title: "操作",
  231. dataIndex: "ABC",
  232. key: "ABC",
  233. render: (_text, record) => {
  234. return (
  235. <div>
  236. {this.state.processStatus == 0 ? (
  237. <Popconfirm
  238. title="是否删除?"
  239. onConfirm={() => {
  240. this.delectRow(record);
  241. }}
  242. okText="是"
  243. cancelText="否"
  244. >
  245. <Button
  246. onClick={(e) => {
  247. e.stopPropagation();
  248. }}
  249. type="danger"
  250. >
  251. 删除
  252. </Button>
  253. </Popconfirm>
  254. ) : (
  255. ""
  256. )}
  257. </div>
  258. );
  259. },
  260. },
  261. ],
  262. columnsrizhi: [
  263. {
  264. title: "流程",
  265. dataIndex: "processName",
  266. key: "processName",
  267. },
  268. {
  269. title: "操作人",
  270. dataIndex: "adminName",
  271. key: "adminName",
  272. },
  273. {
  274. title: "时间",
  275. dataIndex: "createDate",
  276. key: "createDate",
  277. },
  278. ],
  279. contactList: [],
  280. loading: false,
  281. ContactsLists: [
  282. {
  283. title: "催款科目",
  284. dataIndex: "dunSubject",
  285. key: "dunSubject",
  286. render: (text, record) => {
  287. return (
  288. <Select
  289. placeholder="请选择催款科目"
  290. value={record.dunSubject}
  291. style={{ width: "150px" }}
  292. disabled
  293. onChange={(e) => {
  294. record.dunSubject = e;
  295. this.setState({ contactList: this.state.contactList });
  296. }}
  297. >
  298. {jiedian.map(function (item) {
  299. return (
  300. <Select.Option key={item.value}>{item.key}</Select.Option>
  301. );
  302. })}
  303. </Select>
  304. );
  305. },
  306. },
  307. {
  308. title: "金额(万元)",
  309. dataIndex: "money",
  310. key: "money",
  311. render: (text, record) => {
  312. return (
  313. <Input
  314. value={record.money}
  315. placeholder="请输入金额(必填项)"
  316. disabled
  317. key={record.id}
  318. required="required"
  319. onChange={(e) => {
  320. record.money = e.target.value;
  321. this.setState({ contactList: this.state.contactList });
  322. }}
  323. style={{ width: "120px" }}
  324. />
  325. );
  326. },
  327. },
  328. {
  329. title: "催款状态",
  330. dataIndex: "dunStatus",
  331. key: "dunStatus",
  332. render: (text) => {
  333. return getCuikuan(text);
  334. },
  335. },
  336. {
  337. title: "操作",
  338. dataIndex: "dels",
  339. key: "dels",
  340. render: (text, record) => {
  341. return (
  342. <div>
  343. {
  344. <Popconfirm
  345. title="是否删除?"
  346. onConfirm={() => {
  347. this.confirmDelet(record.key);
  348. }}
  349. okText="删除"
  350. cancelText="不删除"
  351. >
  352. <Button
  353. style={{
  354. marginRight: "10px",
  355. color: "#ffffff",
  356. background: "#f00",
  357. border: "none",
  358. display:
  359. this.state.processStatus == 0 ? "block" : "none",
  360. }}
  361. >
  362. 删除
  363. </Button>
  364. </Popconfirm>
  365. }
  366. {record.id ? (
  367. ""
  368. ) : (
  369. <Button type="primary" onClick={this.contactSave}>
  370. 保存
  371. </Button>
  372. )}
  373. </div>
  374. );
  375. },
  376. },
  377. ],
  378. ContactsListsNew: [
  379. {
  380. title: "项目名称",
  381. dataIndex: "commodityName",
  382. key: "commodityName",
  383. render: (text, record, index) => {
  384. let dataArr = this.state.dataSource || [];
  385. if (text) {
  386. return <span>{text}</span>;
  387. }
  388. return (
  389. <Select
  390. placeholder="请选择名称"
  391. style={{ width: "150px" }}
  392. disabled={
  393. this.state.getLoad && record.sortName ? true : false
  394. }
  395. onChange={(e) => {
  396. record.sortName = e;
  397. dataArr.forEach((item) => {
  398. if (item.commodityName == record.sortName) {
  399. record.cname = item.cname;
  400. record.tid = item.id;
  401. record.isSave = true;
  402. record.sort = item.sort;
  403. cuiJieDian.forEach((item) => {
  404. if (item.value == record.sort) {
  405. record.arr = item.children;
  406. let yearFlag = true;
  407. if (record.sort == 6) {
  408. yearFlag = false;
  409. }
  410. this.setState({
  411. getLoad: true,
  412. yearFlag,
  413. });
  414. }
  415. });
  416. }
  417. });
  418. }}
  419. >
  420. {dataArr.map((item) => {
  421. return (
  422. <Select.Option key={item.id} value={item.commodityName}>
  423. {item.commodityName}
  424. </Select.Option>
  425. );
  426. })}
  427. </Select>
  428. );
  429. },
  430. },
  431. {
  432. title: "项目分类",
  433. dataIndex: "projectType",
  434. key: "projectType",
  435. render: (text, record) => {
  436. if (text) {
  437. let arr = this.state.dataSource || [];
  438. let str = "";
  439. for (let i = 0; i < arr.length; i++) {
  440. if (this.state.dataSource[i].sort == text) {
  441. str = this.state.dataSource[i].cname;
  442. return <span>{str}</span>;
  443. }
  444. }
  445. }
  446. if (this.state.getLoad) {
  447. return (
  448. <Select
  449. style={{ width: "150px" }}
  450. placeholder="请选择分类"
  451. value={record.cname}
  452. >
  453. <Select.Option key={record.sort} value={record.cname}>
  454. {record.cname}
  455. </Select.Option>
  456. </Select>
  457. );
  458. } else {
  459. return (
  460. <Select style={{ width: "150px" }} placeholder="请选择分类">
  461. <Select.Option key={record.sort} value={record.cname}>
  462. {record.cname}
  463. </Select.Option>
  464. </Select>
  465. );
  466. }
  467. },
  468. },
  469. {
  470. title: "催款科目",
  471. dataIndex: "dunTypeName",
  472. key: "dunTypeName",
  473. render: (text, record) => {
  474. if (text) {
  475. if (record.customizeName) {
  476. return text + record.customizeName;
  477. }
  478. return <span>{text}</span>;
  479. }
  480. if (this.state.getLoad) {
  481. let arr = record.arr || [];
  482. return (
  483. <div>
  484. <Select
  485. style={{ width: "150px", marginRight: 5 }}
  486. placeholder="请选择分类"
  487. onChange={(e) => {
  488. record.dunType = e;
  489. if (record.dunType == 0) {
  490. record.customizeTimes = "";
  491. record.customizeName = "";
  492. }
  493. if (e != 1) {
  494. this.setState({
  495. timeFlag: true,
  496. });
  497. } else {
  498. this.setState({
  499. timeFlag: false,
  500. });
  501. }
  502. if (e == 1 && record.sort == 6) {
  503. this.setState({
  504. yearFlag: true,
  505. });
  506. } else if (e != 1 && record.sort == 6) {
  507. this.setState({
  508. yearFlag: false,
  509. });
  510. }
  511. if (record.sort == 3 && e == 3) {
  512. this.setState({
  513. boFlag: true,
  514. });
  515. } else {
  516. this.setState({
  517. boFlag: false,
  518. });
  519. }
  520. }}
  521. >
  522. {arr.map((item) => {
  523. record;
  524. return (
  525. <Select.Option key={item.value} value={item.value}>
  526. {item.key}
  527. </Select.Option>
  528. );
  529. })}
  530. <Select.Option key={0} value={0}>
  531. 自定义
  532. </Select.Option>
  533. </Select>
  534. {record.dunType == 0 ? (
  535. <Input
  536. value={record.customizeName}
  537. placeholder="请输入自定义名称"
  538. required="required"
  539. onChange={(e) => {
  540. record.customizeName = e.target.value;
  541. this.setState({
  542. contactList: this.state.contactList,
  543. });
  544. }}
  545. style={{ width: "120px" }}
  546. />
  547. ) : (
  548. ""
  549. )}
  550. </div>
  551. );
  552. } else {
  553. return (
  554. <Select style={{ width: "150px" }} placeholder="请选择分类">
  555. <Select.Option
  556. key={0}
  557. value={"请选择上一项"}
  558. ></Select.Option>
  559. </Select>
  560. );
  561. }
  562. },
  563. },
  564. {
  565. title: "收款时间(特批需选择时间)",
  566. dataIndex: "waitDay",
  567. key: "waitDay",
  568. render: (text, record) => {
  569. if (record.dunTypeName) {
  570. if (record.customizeTimes) {
  571. return record.customizeTimes;
  572. }
  573. if (text == 0) {
  574. var str = "当天";
  575. } else if (!text) {
  576. var str = "";
  577. } else {
  578. var str = text + "天";
  579. }
  580. return <span>{str}</span>;
  581. }
  582. return (
  583. <div>
  584. {record.dunType == 0 ? (
  585. <DatePicker
  586. style={{ width: 150 }}
  587. disabledDate={(e) => {
  588. let time = moment(e).valueOf();
  589. let today = Date.parse(new Date());
  590. if (time <= today) {
  591. return true;
  592. }
  593. }}
  594. onChange={(e, t) => {
  595. record.customizeTimes = t;
  596. }}
  597. />
  598. ) : (
  599. <Select
  600. placeholder="请选择时间"
  601. style={{ width: "160px" }}
  602. disabled={
  603. this.state.approval != 0 && !this.state.timeFlag
  604. ? false
  605. : true
  606. }
  607. onChange={(e) => {
  608. record.waitDay = e;
  609. }}
  610. >
  611. <Select.Option key={0}>当天</Select.Option>
  612. <Select.Option key={3}>3天</Select.Option>
  613. <Select.Option key={5}>5天</Select.Option>
  614. <Select.Option key={7}>7天</Select.Option>
  615. <Select.Option key={15}>15天</Select.Option>
  616. </Select>
  617. )}
  618. </div>
  619. );
  620. },
  621. },
  622. {
  623. title: "金额(万元)",
  624. dataIndex: "money",
  625. key: "money",
  626. render: (text, record) => {
  627. if (record.dunTypeName) {
  628. if (record.appropriationRatio) {
  629. return <span>{record.appropriationRatio}(拨款比例)</span>;
  630. } else {
  631. return <span>{text}</span>;
  632. }
  633. }
  634. if (this.state.boFlag) {
  635. return (
  636. <div>
  637. <div style={{ width: 70, float: "left", marginRight: 5 }}>
  638. <Select
  639. placeholder="选择"
  640. defaultValue={"金额"}
  641. onChange={(e) => {
  642. record.boStatus = e;
  643. }}
  644. >
  645. <Select.Option key={true}>比例</Select.Option>
  646. <Select.Option key={false}>金额</Select.Option>
  647. </Select>
  648. </div>
  649. <div style={{ float: "right" }}>
  650. <Input
  651. value={record.money}
  652. key={record.id}
  653. required="required"
  654. onChange={(e) => {
  655. record.money = e.target.value;
  656. this.setState({
  657. contactList: this.state.contactList,
  658. });
  659. }}
  660. style={{ width: "120px" }}
  661. />
  662. </div>
  663. </div>
  664. );
  665. } else {
  666. return (
  667. <div>
  668. <Input
  669. value={record.money}
  670. placeholder="请输入金额(必填项)"
  671. key={record.id}
  672. required="required"
  673. onChange={(e) => {
  674. record.money = e.target.value;
  675. this.setState({ contactList: this.state.contactList });
  676. }}
  677. style={{ width: "120px" }}
  678. />
  679. </div>
  680. );
  681. }
  682. },
  683. },
  684. {
  685. title: "服务年限",
  686. dataIndex: "startDate",
  687. key: "startDate",
  688. render: (text, record) => {
  689. if (record.dunTypeName) {
  690. return <span>{text}</span>;
  691. }
  692. return (
  693. <Select
  694. placeholder="请选择年限"
  695. style={{ width: "150px" }}
  696. disabled={this.state.yearFlag ? true : false}
  697. onChange={(e) => {
  698. record.effectiveCount = e;
  699. }}
  700. >
  701. {/* <Select.Option key={null}>无</Select.Option> */}
  702. <Select.Option key={1}>一年</Select.Option>
  703. <Select.Option key={3}>两年</Select.Option>
  704. <Select.Option key={5}>三年</Select.Option>
  705. <Select.Option key={7}>四年</Select.Option>
  706. <Select.Option key={9}>五年</Select.Option>
  707. </Select>
  708. );
  709. },
  710. },
  711. {
  712. title: "催款状态",
  713. dataIndex: "status",
  714. key: "status",
  715. render: (text) => {
  716. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  717. },
  718. },
  719. {
  720. title: "操作",
  721. dataIndex: "dels",
  722. key: "dels",
  723. render: (text, record, index) => {
  724. return (
  725. <div>
  726. {this.state.processStatus == 0 ? (
  727. <Popconfirm
  728. title="是否删除?"
  729. onConfirm={() => {
  730. this.confirmDeletNew(record);
  731. }}
  732. okText="删除"
  733. cancelText="不删除"
  734. >
  735. <Button
  736. style={{
  737. marginRight: "10px",
  738. color: "#ffffff",
  739. background: "#f00",
  740. border: "none",
  741. }}
  742. >
  743. 删除
  744. </Button>
  745. </Popconfirm>
  746. ) : (
  747. ""
  748. )}
  749. {record.isSave ? (
  750. <Button
  751. type="primary"
  752. onClick={(e) => {
  753. this.contactSaveNew(record);
  754. }}
  755. >
  756. 保存
  757. </Button>
  758. ) : (
  759. ""
  760. )}
  761. </div>
  762. );
  763. },
  764. },
  765. ],
  766. };
  767. },
  768. departmentList() {
  769. this.setState({
  770. loading: true,
  771. });
  772. $.ajax({
  773. method: "get",
  774. dataType: "json",
  775. crossDomain: false,
  776. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  777. data: {},
  778. success: function (data) {
  779. let thedata = data.data;
  780. let theArr = [];
  781. if (!thedata) {
  782. if (data.error && data.error.length) {
  783. message.warning(data.error[0].message);
  784. }
  785. thedata = {};
  786. } else {
  787. thedata.map(function (item, index) {
  788. theArr.push({
  789. key: index,
  790. name: item.name,
  791. id: item.id,
  792. depNo: item.depNo,
  793. });
  794. });
  795. }
  796. this.setState({
  797. departmentArr: theArr,
  798. });
  799. }.bind(this),
  800. }).always(
  801. function () {
  802. this.setState({
  803. loading: false,
  804. });
  805. }.bind(this)
  806. );
  807. },
  808. // 拆分详细
  809. showRes(record) {
  810. this.setState({
  811. resVisible: true,
  812. resRecord: record,
  813. });
  814. },
  815. resCancel() {
  816. this.setState({
  817. resVisible: false,
  818. });
  819. },
  820. //新建订单、编辑订单保存
  821. handleSubmit() {
  822. let theorgCodeUrl = [];
  823. if (this.state.orgCodeUrl.length) {
  824. let picArr = [];
  825. this.state.orgCodeUrl.map(function (item) {
  826. if (
  827. item.response &&
  828. item.response.data &&
  829. item.response.data.length
  830. ) {
  831. picArr.push(item.response.data);
  832. }
  833. });
  834. theorgCodeUrl = picArr.join(",");
  835. }
  836. let theReplenishUrl = [];
  837. if (this.state.replenishUrl.length) {
  838. let picArr = [];
  839. this.state.replenishUrl.map(function (item) {
  840. if (
  841. item.response &&
  842. item.response.data &&
  843. item.response.data.length
  844. ) {
  845. picArr.push(item.response.data);
  846. }
  847. });
  848. theReplenishUrl = picArr.join(",");
  849. }
  850. if (this.props.data) {
  851. if (!theorgCodeUrl) {
  852. message.warning("图片过大,上传失败");
  853. return false;
  854. }
  855. if (!this.state.signDate) {
  856. message.warning("签单日期不能为空");
  857. return false;
  858. }
  859. if (!this.state.orderRemarks) {
  860. message.warning("订单留言不能为空");
  861. return false;
  862. }
  863. } else {
  864. }
  865. const arr = this.state.contactListNew || [];
  866. for (let i = 0; i < arr.length; i++) {
  867. if (
  868. arr[i].dunType == 1 &&
  869. arr[i].waitDay != null &&
  870. this.state.approval == 0
  871. ) {
  872. message.warning(
  873. "非特批存在填写催款节点首付时间的情况,请删除后重新填写保存"
  874. );
  875. return false;
  876. } else if (
  877. arr[i].dunType == 1 &&
  878. arr[i].waitDay == null &&
  879. this.state.approval == 1
  880. ) {
  881. message.warning(
  882. "特批存在首付催款节点未填写时间的情况,请删除后重新填写保存"
  883. );
  884. return false;
  885. }
  886. if (!this.state.contactListNew[i].id && this.props.userDetaile) {
  887. message.warning("请保存催款节点");
  888. return false;
  889. }
  890. }
  891. this.setState({
  892. loading: true,
  893. });
  894. let api = "/api/admin/newOrder/updateServiceOrderNew";
  895. $.ajax({
  896. method: "POST",
  897. dataType: "json",
  898. crossDomain: false,
  899. url: globalConfig.context + api,
  900. data: {
  901. orderNo: this.state.orderNo, //订单编号
  902. totalAmount: this.state.totalAmount, //总金额
  903. firstAmount: this.state.firstAmount, //首付
  904. isSubmit: this.state.isSubmit, //保存草稿还是提交
  905. signDate: this.state.signDate, //签单日期
  906. contacts: this.state.contacts, //企业负责人
  907. contactMobile: this.state.contactMobile, //负责人联系方式
  908. legalPerson: this.state.legalPerson, //企业法人
  909. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  910. approval: this.state.approval, //特批状态
  911. orderRemarks: this.state.orderRemarks, //订单备注
  912. contractPictureUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  913. agreementUrl: theReplenishUrl.length ? theReplenishUrl : "",
  914. orderDep: this.state.organizationSearch,
  915. deleteSign: this.props.deleteSign === 3 ? 0 : undefined,
  916. },
  917. }).done(
  918. function (data) {
  919. this.setState({
  920. loading: false,
  921. });
  922. if (!data.error.length) {
  923. message.success("保存成功!");
  924. this.handleOk();
  925. if (this.state.autoId) {
  926. this.loadData(this.props.data);
  927. }
  928. } else {
  929. message.warning(data.error[0].message);
  930. }
  931. }.bind(this)
  932. );
  933. },
  934. //订单详情修改
  935. xiangqingClick(e) {
  936. e.preventDefault();
  937. this.setState({
  938. loading: true,
  939. });
  940. $.ajax({
  941. url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
  942. method: "post",
  943. data: {
  944. orderNo: this.state.orderNo, //订单编号
  945. totalAmount: this.state.totalAmount, //总金额
  946. firstAmount: this.state.firstAmount, //首付
  947. isSubmit: this.state.isSubmit, //保存草稿还是提交
  948. signDate: this.state.selTime, //签单日期
  949. contacts: this.state.contacts, //企业负责人
  950. contactMobile: this.state.contactMobile, //负责人联系方式
  951. legalPerson: this.state.legalPerson, //企业法人
  952. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  953. approval: this.state.approval, //特批状态
  954. orderRemarks: this.state.orderRemarks, //订单备注
  955. },
  956. }).done(
  957. function (data) {
  958. this.setState({
  959. loading: false,
  960. });
  961. if (!data.error.length) {
  962. message.success("保存成功!");
  963. this.loaduser(this.props.data);
  964. } else {
  965. message.warning(data.error[0].message);
  966. }
  967. }.bind(this)
  968. );
  969. },
  970. //查看基本详情基本信息
  971. loaduser(orderNo) {
  972. this.state.orderList = [];
  973. $.ajax({
  974. method: "get",
  975. dataType: "json",
  976. crossDomain: false,
  977. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  978. data: {
  979. orderNo: orderNo,
  980. },
  981. success: function (data) {
  982. let thisData = data.data;
  983. if (!thisData) {
  984. if (data.error && data.error.length) {
  985. message.warning(data.error[0].message);
  986. }
  987. thisData = {};
  988. }
  989. // this.props.getPrimaryOrder(thisData.primaryOrder);
  990. // this.props.getAdditionalOrder(thisData.additionalOrder);
  991. this.setState({
  992. id: thisData.id,
  993. kehuId: thisData.buyerId,
  994. orderNo: thisData.orderNo, //订单编号
  995. orderType: thisData.orderType, //订单类型
  996. firstAmount: thisData.firstAmount, //首付金额
  997. totalAmount: thisData.totalAmount, //总金额
  998. settlementAmount: thisData.settlementAmount, //结算金额
  999. liquidationStatus: thisData.liquidationStatus, //清算状态
  1000. processStatus: thisData.processStatus, //流程状态
  1001. approval: thisData.approval.toString(), //特批状态
  1002. orderRemarks: thisData.orderRemarks, //订单备注
  1003. contractNo: thisData.contractNo, //合同编号
  1004. contacts: thisData.contacts, //联系人
  1005. contactMobile: thisData.contactMobile, //联系人电话
  1006. legalPerson: thisData.legalPerson, //法人
  1007. legalPersonTel: thisData.legalPersonTel, //法人电话
  1008. contractNo: thisData.contractNo, //合同编号
  1009. orgCodeUrl: thisData.contractPictureUrl
  1010. ? splitUrl(
  1011. thisData.contractPictureUrl,
  1012. ",",
  1013. globalConfig.avatarHost + "/upload"
  1014. )
  1015. : [], //图片地址
  1016. replenishUrl: thisData.agreementUrl
  1017. ? splitUrl(
  1018. thisData.agreementUrl,
  1019. ",",
  1020. globalConfig.avatarHost + "/upload"
  1021. )
  1022. : [],
  1023. signDate: thisData.signDate, //签单时间
  1024. userName: thisData.userName, //客户名称
  1025. salesmanName: thisData.salesmanName, //营销员名称
  1026. salesmanMobile: thisData.salesmanMobile, //营销员电话
  1027. oldSalesmanName: thisData.oldSalesmanName, //营销员名称
  1028. oldSalesmanMobile: thisData.oldSalesmanMobile, //营销员电话
  1029. financeName: thisData.financeName, //财务名称
  1030. financeMobile: thisData.financeMobile, //财务电话
  1031. nowFinance: thisData.nowFinance,
  1032. nowFinanceMobile: thisData.nowFinanceMobile,
  1033. contractNo: thisData.contractNo, //合同编号
  1034. approval:
  1035. thisData.approval == 0
  1036. ? thisData.approval.toString()
  1037. : thisData.approval,
  1038. organizationSearch: thisData.orderDep,
  1039. depName: thisData.depName,
  1040. });
  1041. }.bind(this),
  1042. }).always(
  1043. function () {
  1044. this.setState({
  1045. loading: false,
  1046. });
  1047. }.bind(this)
  1048. );
  1049. },
  1050. //查看催款节点
  1051. jiedian(orderNos) {
  1052. $.ajax({
  1053. method: "get",
  1054. dataType: "json",
  1055. crossDomain: false,
  1056. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  1057. data: {
  1058. orderNo: orderNos,
  1059. },
  1060. success: function (data) {
  1061. let theArr = [];
  1062. let thisData = [];
  1063. if (data.error.length || data.data.list == "") {
  1064. if (data.error && data.error.length) {
  1065. message.warning(data.error[0].message);
  1066. }
  1067. } else {
  1068. for (let i = 0; i < data.data.length; i++) {
  1069. thisData = data.data[i];
  1070. theArr.push({
  1071. key: i,
  1072. dunSubject: thisData.dunSubject
  1073. ? thisData.dunSubject.toString()
  1074. : "", //催款科目
  1075. id: thisData.id, //节点Id
  1076. money: thisData.money, //催款金额
  1077. dunStatus: thisData.dunStatus, //催款状态
  1078. orderNo: thisData.orderNo,
  1079. });
  1080. }
  1081. this.setState({
  1082. contactList: theArr,
  1083. });
  1084. }
  1085. }.bind(this),
  1086. }).always(
  1087. function () {
  1088. this.setState({
  1089. loading: false,
  1090. });
  1091. }.bind(this)
  1092. );
  1093. },
  1094. //查看催款节点
  1095. jiedianNew(orderNos) {
  1096. $.ajax({
  1097. method: "get",
  1098. dataType: "json",
  1099. crossDomain: false,
  1100. url:
  1101. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  1102. data: {
  1103. orderNo: orderNos,
  1104. },
  1105. success: function (data) {
  1106. if (data.error && data.error.length) {
  1107. message.warning(data.error[0].message);
  1108. } else {
  1109. let theArr = [];
  1110. let thisData = [];
  1111. let arr = data.data || [];
  1112. let totalCui = 0;
  1113. for (let i = 0; i < arr.length; i++) {
  1114. thisData = arr[i];
  1115. totalCui += +thisData.money;
  1116. theArr.push({
  1117. key: i,
  1118. dunSubject: thisData.dunSubject
  1119. ? thisData.dunSubject.toString()
  1120. : "", //催款科目
  1121. id: thisData.id, //节点Id
  1122. money: thisData.money, //催款金额
  1123. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  1124. commodityName: thisData.commodityName,
  1125. projectType: thisData.projectType,
  1126. dunTypeName: thisData.dunTypeName,
  1127. status: thisData.status,
  1128. waitDay: thisData.waitDay,
  1129. effectiveCount: thisData.effectiveCount,
  1130. startDate: thisData.startDate,
  1131. dunType: thisData.dunType,
  1132. appropriationRatio: thisData.appropriationRatio,
  1133. customizeName: thisData.customizeName,
  1134. customizeTimes: thisData.customizeTimes,
  1135. });
  1136. }
  1137. if (!totalCui) {
  1138. totalCui = 0;
  1139. }
  1140. totalCui = (Math.round(totalCui * 1000000) / 1000000).toFixed(6);
  1141. this.setState({
  1142. contactListNew: theArr,
  1143. totalCui:parseFloat(totalCui),
  1144. });
  1145. }
  1146. }.bind(this),
  1147. }).always(
  1148. function () {
  1149. this.setState({
  1150. loading: false,
  1151. });
  1152. }.bind(this)
  1153. );
  1154. },
  1155. //催款节点保存
  1156. contactSave(record) {
  1157. for (let i = 0; i < this.state.contactList.length; i++) {
  1158. if (moneyVerify(this.state.contactList[i].money)) {
  1159. return;
  1160. }
  1161. }
  1162. this.setState({
  1163. loading: true,
  1164. });
  1165. $.ajax({
  1166. url: globalConfig.context + "/api/admin/newOrder/createOrderDun",
  1167. method: "post",
  1168. data: {
  1169. orderNo: this.state.orderNo,
  1170. orderDun: JSON.stringify(this.state.contactList),
  1171. },
  1172. }).done(
  1173. function (data) {
  1174. this.setState({
  1175. loading: false,
  1176. });
  1177. if (!data.error.length) {
  1178. message.success("保存成功!");
  1179. this.jiedian(record.orderNo);
  1180. } else {
  1181. message.warning(data.error[0].message);
  1182. }
  1183. }.bind(this)
  1184. );
  1185. },
  1186. //催款节点保存
  1187. contactSaveNew(record) {
  1188. if (record.dunType == 0) {
  1189. if (!record.customizeTimes) {
  1190. message.warning("请输入自定义时间");
  1191. return;
  1192. } else if (!record.customizeName) {
  1193. message.warning("请输入自定义科目");
  1194. return;
  1195. }
  1196. }
  1197. if (record.boStatus == "false") {
  1198. record.boStatus = false;
  1199. } else if (record.boStatus == "true") {
  1200. record.boStatus = true;
  1201. }
  1202. if (!this.state.yearFlag) {
  1203. if (!record.effectiveCount) {
  1204. message.warning("请选择服务年限");
  1205. return;
  1206. }
  1207. } else {
  1208. record.effectiveCount = "";
  1209. }
  1210. if (record.money == "") {
  1211. message.warning("请填写金额");
  1212. return;
  1213. }
  1214. if (record.boStatus) {
  1215. if (
  1216. typeof +record.money == "number" &&
  1217. +record.money >= 0 &&
  1218. +record.money <= 1
  1219. ) {
  1220. record.appropriationRatio = record.money;
  1221. } else {
  1222. message.warning("金额比例填写错误,比例范围0~1");
  1223. return;
  1224. }
  1225. }
  1226. if (!record.dunType && record.dunType != 0) {
  1227. message.warning("请选择对应科目");
  1228. return;
  1229. }
  1230. if (record.dunType != 1) {
  1231. record.waitDay = "";
  1232. }
  1233. this.setState({
  1234. loading: true,
  1235. });
  1236. if (record.boStatus) {
  1237. $.ajax({
  1238. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1239. method: "post",
  1240. data: {
  1241. orderNo: record.orderNo,
  1242. tid: record.tid,
  1243. projectType: record.sort,
  1244. dunType: record.dunType,
  1245. appropriationRatio: record.appropriationRatio,
  1246. waitDay: record.waitDay,
  1247. effectiveCount: record.effectiveCount,
  1248. customizeTimes:
  1249. record.dunType == 0 ? record.customizeTimes : undefined,
  1250. customizeName:
  1251. record.dunType == 0 ? record.customizeName : undefined,
  1252. },
  1253. }).done(
  1254. function (data) {
  1255. this.setState({
  1256. loading: false,
  1257. });
  1258. if (!data.error.length) {
  1259. message.success("保存成功!");
  1260. this.setState({
  1261. cuiFlag: false,
  1262. boFlag: false,
  1263. addFlag: false,
  1264. });
  1265. this.jiedianNew(record.orderNo);
  1266. } else {
  1267. message.warning(data.error[0].message);
  1268. }
  1269. }.bind(this)
  1270. );
  1271. } else {
  1272. $.ajax({
  1273. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1274. method: "post",
  1275. data: {
  1276. orderNo: record.orderNo,
  1277. tid: record.tid,
  1278. projectType: record.sort,
  1279. dunType: record.dunType,
  1280. money: record.money,
  1281. waitDay: record.waitDay,
  1282. effectiveCount: record.effectiveCount,
  1283. customizeTimes:
  1284. record.dunType == 0 ? record.customizeTimes : undefined,
  1285. customizeName:
  1286. record.dunType == 0 ? record.customizeName : undefined,
  1287. },
  1288. }).done(
  1289. function (data) {
  1290. this.setState({
  1291. loading: false,
  1292. });
  1293. if (!data.error.length) {
  1294. message.success("保存成功!");
  1295. this.setState({
  1296. cuiFlag: false,
  1297. boFlag: false,
  1298. addFlag: false,
  1299. });
  1300. this.jiedianNew(record.orderNo);
  1301. } else {
  1302. message.warning(data.error[0].message);
  1303. }
  1304. }.bind(this)
  1305. );
  1306. }
  1307. },
  1308. //点击新增催款节点
  1309. addcontact() {
  1310. this.state.contactList.push({
  1311. key: this.state.contactList.length,
  1312. money: "",
  1313. dunSubject: undefined,
  1314. orderNo: this.state.orderNo,
  1315. dunTarget: this.state.kehuId,
  1316. });
  1317. this.setState({
  1318. contactList: this.state.contactList,
  1319. });
  1320. },
  1321. //点击新增催款节点
  1322. addcontactNew() {
  1323. this.state.contactListNew.push({
  1324. key: this.state.contactListNew.length,
  1325. money: "",
  1326. dunSubject: undefined,
  1327. orderNo: this.state.orderNo,
  1328. dunTarget: this.state.kehuId,
  1329. });
  1330. this.setState({
  1331. contactListNew: this.state.contactListNew,
  1332. cuiFlag: true,
  1333. });
  1334. },
  1335. //删除收款节点
  1336. confirmDelet(index) {
  1337. this.state.contactList.splice(index, 1);
  1338. this.setState({
  1339. contactList: this.state.contactList,
  1340. });
  1341. this.contactSave();
  1342. },
  1343. //删除收款节点
  1344. confirmDeletNew(index) {
  1345. if (index.id) {
  1346. this.state.contactListNew.splice(index.key, 1);
  1347. this.setState({
  1348. contactListNew: this.state.contactListNew,
  1349. cuiFlag: false,
  1350. addFlag: false,
  1351. boFlag: false,
  1352. });
  1353. $.ajax({
  1354. url: globalConfig.context + "/api/admin/newOrderDun/deleteDun",
  1355. method: "post",
  1356. data: {
  1357. id: index.id,
  1358. },
  1359. }).done(
  1360. function (data) {
  1361. this.setState({
  1362. loading: false,
  1363. });
  1364. if (!data.error.length) {
  1365. message.success("删除成功!");
  1366. this.setState({
  1367. cuiFlag: false,
  1368. });
  1369. this.jiedianNew(this.state.orderNo);
  1370. } else {
  1371. message.warning(data.error[0].message);
  1372. }
  1373. }.bind(this)
  1374. );
  1375. } else {
  1376. this.state.contactListNew.splice(index.key, 1);
  1377. this.setState({
  1378. contactListNew: this.state.contactListNew,
  1379. cuiFlag: false,
  1380. addFlag: false,
  1381. boFlag: false,
  1382. });
  1383. }
  1384. },
  1385. handleOk() {
  1386. this.setState({
  1387. visible: false,
  1388. });
  1389. this.props.closeDesc(false, true);
  1390. },
  1391. handleCancel() {
  1392. if (this.state.orderType == undefined) {
  1393. return false;
  1394. }
  1395. if (!this.state.autoId) {
  1396. return false;
  1397. }
  1398. this.setState({
  1399. visible: false,
  1400. });
  1401. this.props.closeDesc(false);
  1402. },
  1403. handleCancelclose() {
  1404. this.setState(
  1405. {
  1406. visible: false,
  1407. },
  1408. () => {
  1409. this.setState({
  1410. activeKey: "1",
  1411. });
  1412. }
  1413. );
  1414. this.props.closeDesc(false);
  1415. this.reset();
  1416. },
  1417. //点击签单
  1418. handleCancels() {
  1419. this.setState(
  1420. {
  1421. isSubmit: 1,
  1422. },
  1423. () => {
  1424. this.handleSubmit();
  1425. }
  1426. );
  1427. },
  1428. //点击签单
  1429. handleCancelq() {
  1430. this.setState(
  1431. {
  1432. isSubmit: 0,
  1433. },
  1434. () => {
  1435. this.handleSubmit();
  1436. }
  1437. );
  1438. },
  1439. //删除
  1440. delectRow(record) {
  1441. this.setState({
  1442. loading: true,
  1443. });
  1444. $.ajax({
  1445. method: "post",
  1446. dataType: "json",
  1447. crossDomain: false,
  1448. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  1449. data: {
  1450. id: record.id,
  1451. },
  1452. }).done(
  1453. function (data) {
  1454. if (!data.error.length) {
  1455. message.success("删除成功!");
  1456. this.setState({
  1457. loading: false,
  1458. });
  1459. //this.loaduser()
  1460. this.loadData(this.props.data);
  1461. } else {
  1462. message.warning(data.error[0].message);
  1463. }
  1464. }.bind(this)
  1465. );
  1466. },
  1467. nextCancel() {
  1468. this.setState({
  1469. projectOperationVisible: false,
  1470. dataInfor:{},
  1471. },()=>{
  1472. this.loadData(this.props.data);
  1473. });
  1474. },
  1475. rizhi() {
  1476. this.setState({
  1477. loading: true,
  1478. });
  1479. $.ajax({
  1480. method: "get",
  1481. dataType: "json",
  1482. crossDomain: false,
  1483. url: "/api/admin/newOrder/selectOrderLog",
  1484. data: {
  1485. orderNo: this.props.data,
  1486. },
  1487. success: function (data) {
  1488. let theArr = [];
  1489. let thisData = data.data;
  1490. if (!thisData.length) {
  1491. if (data.error && data.error.length) {
  1492. message.warning(data.error[0].message);
  1493. }
  1494. thisData = {};
  1495. } else {
  1496. for (let i = 0; i < data.data.length; i++) {
  1497. let thisdata = data.data[i];
  1498. theArr.push({
  1499. processName: thisdata.processName,
  1500. adminName: thisdata.adminName,
  1501. createDate: thisdata.createDate,
  1502. remarks: thisdata.remarks,
  1503. });
  1504. }
  1505. }
  1506. this.setState({
  1507. dataSourcerizhi: theArr,
  1508. });
  1509. }.bind(this),
  1510. }).always(
  1511. function () {
  1512. this.setState({
  1513. loading: false,
  1514. });
  1515. }.bind(this)
  1516. );
  1517. },
  1518. //查看订单日志
  1519. getOrderLog() {
  1520. this.setState({
  1521. rizhivisible: true,
  1522. });
  1523. this.rizhi();
  1524. },
  1525. closeOrderLog() {
  1526. this.setState({
  1527. rizhivisible: false,
  1528. });
  1529. },
  1530. callback(key) {
  1531. this.setState({
  1532. activeKey: key,
  1533. });
  1534. },
  1535. getOrgCodeUrl(e) {
  1536. this.setState({ orgCodeUrl: e });
  1537. },
  1538. getReplenishUrl(e) {
  1539. this.setState({ replenishUrl: e });
  1540. },
  1541. getVoucherUrl(e) {
  1542. this.setState({ voucherUrl: e });
  1543. },
  1544. //加载(自动补全)
  1545. supervisor(e, state) {
  1546. //客户名称与服务名称自动补全
  1547. let api = state
  1548. ? "/api/admin/customer/getCustomerByName"
  1549. : "/api/admin/order/getBusinessProjectByName";
  1550. $.ajax({
  1551. method: "get",
  1552. dataType: "json",
  1553. crossDomain: false,
  1554. url: globalConfig.context + api,
  1555. data: state
  1556. ? {
  1557. name: e,
  1558. type: this.state.customType,
  1559. }
  1560. : {
  1561. businessName: e,
  1562. },
  1563. success: function (data) {
  1564. let thedata = data.data;
  1565. if (!thedata) {
  1566. if (data.error && data.error.length) {
  1567. message.warning(data.error[0].message);
  1568. }
  1569. thedata = {};
  1570. }
  1571. this.setState({
  1572. states: state,
  1573. customerArr: thedata,
  1574. });
  1575. }.bind(this),
  1576. }).always(
  1577. function () {
  1578. this.setState({
  1579. loading: false,
  1580. });
  1581. }.bind(this)
  1582. );
  1583. },
  1584. //上级主管输入框失去焦点是判断客户是否存在
  1585. selectAuto(value) {
  1586. let kid = [];
  1587. let fwList = this.state.customerArr;
  1588. fwList.map(function (item) {
  1589. if (value == item.bname) {
  1590. kid = item;
  1591. }
  1592. });
  1593. this.setState({
  1594. commodityName: value,
  1595. gid: kid.id,
  1596. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  1597. commodityFirstPayment:
  1598. kid.firstPayment == 0
  1599. ? kid.firstPayment.toString()
  1600. : kid.firstPayment,
  1601. });
  1602. },
  1603. //客户
  1604. selectAutoCUT(value) {
  1605. let autoIds;
  1606. let fwList = this.state.customerArr;
  1607. fwList.map(function (item) {
  1608. if (value == item.name) {
  1609. autoIds = item.id;
  1610. }
  1611. });
  1612. this.setState({
  1613. customerName: value,
  1614. autoId: autoIds,
  1615. });
  1616. },
  1617. //服务值改变时请求客户名称
  1618. httpChange(e) {
  1619. this.state.gid = "";
  1620. if (e.length >= 1) {
  1621. this.supervisor(e, false);
  1622. }
  1623. this.setState({
  1624. commodityName: e,
  1625. });
  1626. },
  1627. //客户名称自动补全
  1628. customerChange(e) {
  1629. if (this.state.customType) {
  1630. this.state.autoId = "";
  1631. if (e.length >= 2) {
  1632. this.supervisor(e, true);
  1633. }
  1634. this.setState({
  1635. customerName: e,
  1636. });
  1637. } else {
  1638. this.setState({
  1639. customerName: "",
  1640. });
  1641. message.warning("客户所属类型必须指定");
  1642. }
  1643. },
  1644. //点击添加项目明细
  1645. addDetailed() {
  1646. this.setState({
  1647. projectOperationVisible: true,
  1648. });
  1649. },
  1650. //点击打卡项目详情
  1651. tableRowClick(record) {
  1652. this.setState({
  1653. projectOperationVisible:true,
  1654. dataInfor:record,
  1655. });
  1656. },
  1657. //签单时间选择
  1658. selTime(e, index) {
  1659. this.setState({
  1660. entryTime: e,
  1661. signDate: e,
  1662. selTime: index,
  1663. });
  1664. },
  1665. //退单操作
  1666. //点击退单
  1667. tuikuan() {
  1668. this.setState({
  1669. lookVisible: true,
  1670. contractUrl: [],
  1671. applicationUrl: [],
  1672. reason: "",
  1673. });
  1674. },
  1675. //关闭退单
  1676. noCancel() {
  1677. this.setState({
  1678. lookVisible: false,
  1679. });
  1680. },
  1681. //点击确认退单
  1682. tuidanOk() {
  1683. let contractUrls = [];
  1684. let applicationUrls = [];
  1685. if (this.state.contractUrl.length) {
  1686. let picArr = [];
  1687. this.state.contractUrl.map(function (item) {
  1688. if (
  1689. item.response &&
  1690. item.response.data &&
  1691. item.response.data.length
  1692. ) {
  1693. picArr.push(item.response.data);
  1694. }
  1695. });
  1696. contractUrls = picArr.join(",");
  1697. }
  1698. if (this.state.applicationUrl.length) {
  1699. let picArr = [];
  1700. this.state.applicationUrl.map(function (item) {
  1701. if (
  1702. item.response &&
  1703. item.response.data &&
  1704. item.response.data.length
  1705. ) {
  1706. picArr.push(item.response.data);
  1707. }
  1708. });
  1709. applicationUrls = picArr.join(",");
  1710. }
  1711. $.ajax({
  1712. method: "POST",
  1713. dataType: "json",
  1714. crossDomain: false,
  1715. url: globalConfig.context + "/api/admin/newOrder/addOrderRefund",
  1716. data: {
  1717. orderNo: this.state.orderNo, //订单编号
  1718. contractUrl: contractUrls.length ? contractUrls : "", //终止合同
  1719. applicationUrl: applicationUrls.length ? applicationUrls : "", //退单申请表
  1720. reason: this.state.reason, //退单原因
  1721. },
  1722. }).done(
  1723. function (data) {
  1724. this.setState({
  1725. loading: false,
  1726. });
  1727. if (!data.error.length) {
  1728. message.success("退单成功!");
  1729. this.noCancel();
  1730. this.handleCancelclose();
  1731. } else {
  1732. message.warning(data.error[0].message);
  1733. }
  1734. }.bind(this)
  1735. );
  1736. },
  1737. //开单选择订单类型骚操作
  1738. orderTypeFn(e) {
  1739. if (e == 0) {
  1740. this.setState({
  1741. bussStats: true,
  1742. orderType: e,
  1743. });
  1744. this.category();
  1745. } else {
  1746. this.setState({
  1747. contractType: undefined,
  1748. bussStats: false,
  1749. orderType: e,
  1750. });
  1751. }
  1752. },
  1753. //品类数据获取
  1754. category() {
  1755. $.ajax({
  1756. method: "get",
  1757. dataType: "json",
  1758. crossDomain: false,
  1759. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  1760. data: {},
  1761. success: function (data) {
  1762. let thedata = data.data;
  1763. let theArr = [];
  1764. if (!thedata) {
  1765. if (data.error && data.error.length) {
  1766. message.warning(data.error[0].message);
  1767. }
  1768. thedata = {};
  1769. } else {
  1770. thedata.map(function (item, index) {
  1771. theArr.push({
  1772. key: index,
  1773. name: item.cname,
  1774. id: item.id,
  1775. });
  1776. });
  1777. }
  1778. this.setState({
  1779. contractType: undefined,
  1780. categoryArr: theArr,
  1781. });
  1782. }.bind(this),
  1783. });
  1784. },
  1785. //变更申请
  1786. changeApply() {
  1787. let theorgCodeUrl = [];
  1788. if (this.state.voucherUrl.length) {
  1789. let picArr = [];
  1790. this.state.voucherUrl.map(function (item) {
  1791. if (
  1792. item.response &&
  1793. item.response.data &&
  1794. item.response.data.length
  1795. ) {
  1796. picArr.push(item.response.data);
  1797. }
  1798. });
  1799. theorgCodeUrl = picArr.join(",");
  1800. }
  1801. $.ajax({
  1802. method: "post",
  1803. dataType: "json",
  1804. crossDomain: false,
  1805. url: globalConfig.context + "/api/admin/orderChange/addOrderChange",
  1806. data: {
  1807. orderNo: this.state.orderNo, //订单编号
  1808. processState: 0,
  1809. status: 1,
  1810. remarks: this.state.remarksC,
  1811. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  1812. totalAmount: this.state.totalAmountC,
  1813. settlementAmount: this.state.settlementAmountC,
  1814. changeAmount: this.state.changeAmount,
  1815. applicant: this.state.applicant,
  1816. depName: this.state.depNameChange,
  1817. type: this.state.typeChange,
  1818. },
  1819. }).done(
  1820. function (data) {
  1821. this.setState({
  1822. loading: false,
  1823. });
  1824. if (!data.error.length) {
  1825. message.success("变更成功!");
  1826. this.setState({
  1827. mark: true,
  1828. });
  1829. this.noCancel();
  1830. this.handleCancelclose();
  1831. } else {
  1832. message.warning(data.error[0].message);
  1833. }
  1834. }.bind(this)
  1835. );
  1836. },
  1837. reset() {
  1838. this.setState({
  1839. remarksC: undefined,
  1840. voucherUrl: [],
  1841. totalAmountC: undefined,
  1842. settlementAmountC: undefined,
  1843. changeAmount: undefined,
  1844. applicant: undefined,
  1845. depNameChange: undefined,
  1846. typeChange: 0,
  1847. });
  1848. },
  1849. componentDidMount() {
  1850. this.loaduser(this.props.data);
  1851. this.jiedian(this.props.data);
  1852. this.jiedianNew(this.props.data);
  1853. this.loadData(this.props.data);
  1854. },
  1855. componentWillReceiveProps(nextProps) {
  1856. if (nextProps.mark) {
  1857. this.setState({
  1858. buttonStatus: true,
  1859. });
  1860. } else {
  1861. this.setState({
  1862. buttonStatus: false,
  1863. });
  1864. }
  1865. if (nextProps.activeKey === "4") {
  1866. this.loaduser(this.props.data);
  1867. this.jiedian(this.props.data);
  1868. this.jiedianNew(this.props.data);
  1869. this.loadData(this.props.data);
  1870. }
  1871. },
  1872. downImg() {
  1873. let num = 0;
  1874. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  1875. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  1876. num = i;
  1877. }
  1878. }
  1879. if (num == this.state.orgCodeUrl.length - 1) {
  1880. return message.warning("已经是最后一张了哦");
  1881. }
  1882. this.state.previewImage = this.state.orgCodeUrl[num + 1].url;
  1883. this.setState({
  1884. previewImage: this.state.previewImage,
  1885. rotateDeg: 0,
  1886. });
  1887. },
  1888. upImg() {
  1889. let num = 0;
  1890. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  1891. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  1892. num = i;
  1893. }
  1894. }
  1895. if (num == 0) {
  1896. return message.warning("已经是第一张了哦");
  1897. }
  1898. this.state.previewImage = this.state.orgCodeUrl[num - 1].url;
  1899. this.setState({
  1900. previewImage: this.state.previewImage,
  1901. rotateDeg: 0,
  1902. });
  1903. },
  1904. rotate() {
  1905. let rotateDeg = this.state.rotateDeg + 90;
  1906. this.setState({
  1907. rotateDeg,
  1908. });
  1909. },
  1910. downImgs() {
  1911. let num = 0;
  1912. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  1913. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  1914. num = i;
  1915. }
  1916. }
  1917. if (num == this.state.replenishUrl.length - 1) {
  1918. return message.warning("已经是最后一张了哦");
  1919. }
  1920. this.state.previewImage = this.state.replenishUrl[num + 1].url;
  1921. this.setState({
  1922. previewImage: this.state.previewImage,
  1923. rotateDeg: 0,
  1924. });
  1925. },
  1926. upImgs() {
  1927. let num = 0;
  1928. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  1929. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  1930. num = i;
  1931. }
  1932. }
  1933. if (num == 0) {
  1934. return message.warning("已经是第一张了哦");
  1935. }
  1936. this.state.previewImage = this.state.replenishUrl[num - 1].url;
  1937. this.setState({
  1938. previewImage: this.state.previewImage,
  1939. rotateDeg: 0,
  1940. });
  1941. },
  1942. rotates() {
  1943. let rotateDeg = this.state.rotateDeg + 90;
  1944. this.setState({
  1945. rotateDeg,
  1946. });
  1947. },
  1948. render() {
  1949. const FormItem = Form.Item;
  1950. const formItemLayout = {
  1951. labelCol: { span: 8 },
  1952. wrapperCol: { span: 14 },
  1953. };
  1954. const formItemList = [
  1955. {
  1956. label: "企业联系人",
  1957. content: <span>{this.state.contacts}</span>,
  1958. },
  1959. {
  1960. label: "联系人电话",
  1961. content: <span>{this.state.contactMobile}</span>,
  1962. },
  1963. {
  1964. label: "企业法人",
  1965. content: <span>{this.state.legalPerson}</span>,
  1966. },
  1967. {
  1968. label: "法人电话",
  1969. content: <span>{this.state.legalPersonTel}</span>,
  1970. },
  1971. {
  1972. label: "签单金额(万元)",
  1973. content: <span>{this.state.totalAmount}</span>,
  1974. },
  1975. {
  1976. label: "首付金额(万元)",
  1977. content: <span>{this.state.firstAmount}</span>,
  1978. },
  1979. {
  1980. label: "特批立项",
  1981. content: <span>{getApprovedState(this.state.approval)}</span>,
  1982. },
  1983. {
  1984. label: "合同签订时间",
  1985. content: <span>{this.state.signDate}</span>,
  1986. },
  1987. {
  1988. label: "订单部门",
  1989. content: <span>{this.state.depName}</span>,
  1990. },
  1991. ];
  1992. const dataSources = this.state.customerArr || [];
  1993. let departmentArr = this.state.departmentArr || [];
  1994. const cuiDataList = this.state.contactList || [];
  1995. const options = this.state.states
  1996. ? dataSources.map((group) => (
  1997. <Select.Option key={group.id} value={group.name}>
  1998. {group.name}
  1999. </Select.Option>
  2000. ))
  2001. : dataSources.map((group, index) => (
  2002. <Select.Option key={index} value={group.bname}>
  2003. {group.bname}
  2004. </Select.Option>
  2005. ));
  2006. return (
  2007. <div>
  2008. {this.state.resVisible ? (
  2009. <ResolutionDetail
  2010. cancel={this.resCancel}
  2011. detail={this.state.resRecord}
  2012. visible={this.state.resVisible}
  2013. id={this.state.resRecord.orderNo}
  2014. />
  2015. ) : (
  2016. ""
  2017. )}
  2018. <Spin spinning={this.state.loading}>
  2019. <div className="clearfix">
  2020. <FormItem
  2021. className="half-item"
  2022. {...formItemLayout}
  2023. label="合同编号"
  2024. >
  2025. {<span>{this.state.contractNo}</span>}
  2026. </FormItem>
  2027. <FormItem
  2028. className="half-item"
  2029. {...formItemLayout}
  2030. label="订单编号"
  2031. >
  2032. <span>{this.state.orderNo}</span>
  2033. </FormItem>
  2034. <FormItem
  2035. className="half-item"
  2036. {...formItemLayout}
  2037. label="流程状态"
  2038. >
  2039. <span>{getProcessStatus(this.state.processStatus)}</span>
  2040. </FormItem>
  2041. <FormItem
  2042. className="half-item"
  2043. {...formItemLayout}
  2044. label="结算状态"
  2045. >
  2046. <span>
  2047. {getLiquidationStatus(this.state.liquidationStatus)}
  2048. </span>
  2049. </FormItem>
  2050. {this.props.deleteSign === 3 || this.state.processStatus === 0 ? (
  2051. <div className="clearfix">
  2052. <FormItem
  2053. className="half-item"
  2054. {...formItemLayout}
  2055. label="特批立项"
  2056. >
  2057. <Select
  2058. placeholder="请选择客户所属类型"
  2059. style={{ width: "240px" }}
  2060. value={this.state.approval}
  2061. onChange={(e) => {
  2062. this.setState({ approval: e });
  2063. }}
  2064. >
  2065. {tepi.map(function (item) {
  2066. return (
  2067. <Select.Option key={item.value}>
  2068. {item.key}
  2069. </Select.Option>
  2070. );
  2071. })}
  2072. </Select>
  2073. </FormItem>
  2074. <FormItem
  2075. className="half-item"
  2076. {...formItemLayout}
  2077. label="合同签订时间"
  2078. >
  2079. <DatePicker
  2080. style={{
  2081. marginTop: "2px",
  2082. width: "240px",
  2083. height: "27px",
  2084. }}
  2085. showTime
  2086. format="YYYY-MM-DD"
  2087. onOk={() => {}}
  2088. value={
  2089. this.state.signDate ? moment(this.state.signDate) : null
  2090. }
  2091. onChange={(_data, dataString) => {
  2092. this.setState({ signDate: dataString });
  2093. }}
  2094. />
  2095. <span className="mandatory">*</span>
  2096. </FormItem>
  2097. <FormItem
  2098. className="half-item"
  2099. {...formItemLayout}
  2100. label="订单部门"
  2101. >
  2102. <Select
  2103. placeholder="请输入订单部门"
  2104. style={{ width: 240 }}
  2105. value={this.state.organizationSearch}
  2106. onChange={(e) => {
  2107. this.setState({ organizationSearch: e });
  2108. }}
  2109. >
  2110. {departmentArr.map(function (item) {
  2111. return (
  2112. <Select.Option key={item.id}>
  2113. {item.name}
  2114. </Select.Option>
  2115. );
  2116. })}
  2117. </Select>
  2118. </FormItem>
  2119. </div>
  2120. ) : (
  2121. <div className="clearfix">
  2122. <FormItem
  2123. className="half-item"
  2124. {...formItemLayout}
  2125. label="特批立项"
  2126. >
  2127. <span>{getApprovedState(this.state.approval)}</span>
  2128. </FormItem>
  2129. <FormItem
  2130. className="half-item"
  2131. {...formItemLayout}
  2132. label="合同签订时间"
  2133. >
  2134. <span>{this.state.signDate}</span>
  2135. </FormItem>
  2136. <FormItem
  2137. className="half-item"
  2138. {...formItemLayout}
  2139. label="订单部门"
  2140. >
  2141. <span>{this.state.depName}</span>
  2142. </FormItem>
  2143. </div>
  2144. )}
  2145. </div>
  2146. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  2147. 收款项目
  2148. </h3>
  2149. {this.props.deleteSign === 3 || this.state.processStatus === 0 ? (
  2150. <div className="clearfix">
  2151. <FormItem
  2152. className="half-item"
  2153. {...formItemLayout}
  2154. label="签单金额(万元)"
  2155. >
  2156. <Input
  2157. placeholder="签单金额"
  2158. ref="signTotalAmount"
  2159. value={this.state.totalAmount}
  2160. onChange={(e) => {
  2161. this.setState({ totalAmount: e.target.value });
  2162. }}
  2163. style={{ width: "240px" }}
  2164. />
  2165. <span className="mandatory">*</span>
  2166. </FormItem>
  2167. <FormItem
  2168. className="half-item"
  2169. {...formItemLayout}
  2170. label="首付金额(万元)"
  2171. >
  2172. <Input
  2173. placeholder="请输入实签首款金额"
  2174. ref="signFirstPayment"
  2175. value={this.state.firstAmount}
  2176. onChange={(e) => {
  2177. this.setState({ firstAmount: e.target.value });
  2178. }}
  2179. style={{ width: "240px" }}
  2180. />
  2181. <span className="mandatory">*</span>
  2182. </FormItem>
  2183. <FormItem
  2184. className="half-item"
  2185. {...formItemLayout}
  2186. label="已收款项"
  2187. >
  2188. <span>{this.state.settlementAmount + "万元"}</span>
  2189. {/* {this.state.settlementAmount ? (
  2190. <Button
  2191. type="primary"
  2192. onClick={this.tuikuan}
  2193. style={{
  2194. float: "right",
  2195. marginRight: "50px",
  2196. marginBottom: "15px"
  2197. }}
  2198. >
  2199. 退单
  2200. </Button>
  2201. ) : (
  2202. ""
  2203. )} */}
  2204. </FormItem>
  2205. </div>
  2206. ) : (
  2207. <div className="clearfix">
  2208. <FormItem
  2209. className="half-item"
  2210. {...formItemLayout}
  2211. label="签单金额(万元)"
  2212. >
  2213. <span>{this.state.totalAmount}</span>
  2214. </FormItem>
  2215. <FormItem
  2216. className="half-item"
  2217. {...formItemLayout}
  2218. label="首付金额(万元)"
  2219. >
  2220. <span>{this.state.firstAmount}</span>
  2221. </FormItem>
  2222. <FormItem
  2223. className="half-item"
  2224. {...formItemLayout}
  2225. label="已收款项"
  2226. >
  2227. <span>{this.state.settlementAmount + "万元"}</span>
  2228. {/* {this.state.settlementAmount ? (
  2229. <Button
  2230. type="primary"
  2231. onClick={this.tuikuan}
  2232. style={{
  2233. float: "right",
  2234. marginRight: "50px",
  2235. marginBottom: "15px"
  2236. }}
  2237. >
  2238. 退单
  2239. </Button>
  2240. ) : (
  2241. ""
  2242. )} */}
  2243. </FormItem>
  2244. </div>
  2245. )}
  2246. <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>
  2247. 联系信息
  2248. </h3>
  2249. {this.props.deleteSign === 3 || this.state.processStatus == 0 ? (
  2250. <div className="clearfix">
  2251. <div className="clearfix">
  2252. <FormItem
  2253. className="half-item"
  2254. {...formItemLayout}
  2255. label="客户名称"
  2256. >
  2257. <span>{this.state.userName}</span>
  2258. <EnterpriseNameChange
  2259. type='journal'
  2260. style={{ marginLeft: 10 }}
  2261. enterpriseId={this.props.orderUid}/>
  2262. </FormItem>
  2263. </div>
  2264. <FormItem
  2265. className="half-item"
  2266. {...formItemLayout}
  2267. label="企业联系人"
  2268. >
  2269. <Input
  2270. placeholder="请输入联系人"
  2271. ref="signTotalAmount"
  2272. value={this.state.contacts}
  2273. onChange={(e) => {
  2274. this.setState({ contacts: e.target.value });
  2275. }}
  2276. style={{ width: "240px" }}
  2277. />
  2278. </FormItem>
  2279. <FormItem
  2280. className="half-item"
  2281. {...formItemLayout}
  2282. label="联系人电话"
  2283. >
  2284. <Input
  2285. placeholder="请输入联系人电话"
  2286. ref="signTotalAmount"
  2287. value={this.state.contactMobile}
  2288. onChange={(e) => {
  2289. this.setState({ contactMobile: e.target.value });
  2290. }}
  2291. style={{ width: "240px" }}
  2292. />
  2293. </FormItem>
  2294. <FormItem
  2295. className="half-item"
  2296. {...formItemLayout}
  2297. label="企业法人"
  2298. >
  2299. <Input
  2300. placeholder="请输入法人"
  2301. ref="signTotalAmount"
  2302. value={this.state.legalPerson}
  2303. onChange={(e) => {
  2304. this.setState({ legalPerson: e.target.value });
  2305. }}
  2306. style={{ width: "240px" }}
  2307. />
  2308. </FormItem>
  2309. <FormItem
  2310. className="half-item"
  2311. {...formItemLayout}
  2312. label="法人电话"
  2313. >
  2314. <Input
  2315. placeholder="请输入法人电话"
  2316. ref="signTotalAmount"
  2317. value={this.state.legalPersonTel}
  2318. onChange={(e) => {
  2319. this.setState({ legalPersonTel: e.target.value });
  2320. }}
  2321. style={{ width: "240px" }}
  2322. />
  2323. </FormItem>
  2324. </div>
  2325. ) : (
  2326. <div className="clearfix">
  2327. {formItemList.map((data, index) => {
  2328. return (
  2329. <FormItem
  2330. className="half-item"
  2331. {...formItemLayout}
  2332. key={index}
  2333. label={data.label}
  2334. >
  2335. {data.content}
  2336. </FormItem>
  2337. );
  2338. })}
  2339. </div>
  2340. )}
  2341. <div className="clearfix">
  2342. {this.props.deleteSign === 3 || this.state.processStatus == 0 ? (
  2343. <div>
  2344. <FormItem
  2345. labelCol={{ span: 4 }}
  2346. wrapperCol={{ span: 18 }}
  2347. label={
  2348. <span>
  2349. <strong style={{ color: "#f00" }}>*</strong>合同扫描件
  2350. </span>
  2351. }
  2352. >
  2353. <PicturesWall
  2354. domId={this.props.domId}
  2355. fileList={this.getOrgCodeUrl}
  2356. pictureUrl={this.state.orgCodeUrl}
  2357. url="/api/admin/order/uploadOrderImg"
  2358. sign=""
  2359. />
  2360. <p>图片建议:要清晰。</p>
  2361. <Button
  2362. style={{
  2363. float: "right",
  2364. marginRight: "140px",
  2365. marginTop: "20px",
  2366. }}
  2367. onClick={this.getOrderLog}
  2368. >
  2369. 查看订单日志
  2370. </Button>
  2371. </FormItem>
  2372. <FormItem
  2373. labelCol={{ span: 4 }}
  2374. wrapperCol={{ span: 18 }}
  2375. label={
  2376. <span>
  2377. 补充协议
  2378. </span>
  2379. }
  2380. >
  2381. <PicturesWall
  2382. domId={this.props.domId + '1'}
  2383. fileList={this.getReplenishUrl}
  2384. pictureUrl={this.state.replenishUrl}
  2385. url="/api/admin/order/uploadOrderImg"
  2386. sign=""
  2387. />
  2388. <p>图片建议:要清晰。</p>
  2389. </FormItem>
  2390. </div>
  2391. ) : (
  2392. <div>
  2393. <FormItem
  2394. labelCol={{ span: 4 }}
  2395. wrapperCol={{ span: 18 }}
  2396. label="合同扫描件"
  2397. >
  2398. <div style={{paddingTop:'10px',paddingBottom:'10px'}}>
  2399. <ImgList domId={'addorders'} fileList={this.state.orgCodeUrl} ItemWidth={'96px'}/>
  2400. </div>
  2401. {/*<Upload*/}
  2402. {/* className="demandDetailShow-upload"*/}
  2403. {/* listType="picture-card"*/}
  2404. {/* fileList={this.state.orgCodeUrl}*/}
  2405. {/* onPreview={(file) => {*/}
  2406. {/* this.setState({*/}
  2407. {/* previewImage: file.url || file.thumbUrl,*/}
  2408. {/* previewVisible: true,*/}
  2409. {/* });*/}
  2410. {/* }}*/}
  2411. {/*/>*/}
  2412. <Modal
  2413. maskClosable={false}
  2414. footer={null}
  2415. width={"50%"}
  2416. visible={this.state.previewVisible}
  2417. onCancel={() => {
  2418. this.setState({ previewVisible: false, rotateDeg: 0 });
  2419. }}
  2420. >
  2421. <img
  2422. alt=""
  2423. style={{
  2424. width: "100%",
  2425. transform: `rotate(${this.state.rotateDeg}deg)`,
  2426. }}
  2427. src={this.state.previewImage || ""}
  2428. />
  2429. <Button
  2430. onClick={this.rotate}
  2431. style={{
  2432. position: "relative",
  2433. left: "50%",
  2434. transform: "translateX(-50%)",
  2435. }}
  2436. >
  2437. 旋转
  2438. </Button>
  2439. <Button
  2440. onClick={this.upImg}
  2441. style={{
  2442. position: "absolute",
  2443. left: -81,
  2444. top: "50%",
  2445. transform: "translateY(-50%)",
  2446. }}
  2447. >
  2448. 上一张
  2449. </Button>
  2450. <Button
  2451. onClick={this.downImg}
  2452. style={{
  2453. position: "absolute",
  2454. right: -81,
  2455. top: "50%",
  2456. transform: "translateY(-50%)",
  2457. }}
  2458. >
  2459. 下一张
  2460. </Button>
  2461. </Modal>
  2462. <Button
  2463. style={{
  2464. float: "right",
  2465. marginRight: "140px",
  2466. marginTop: "20px",
  2467. }}
  2468. onClick={this.getOrderLog}
  2469. >
  2470. 查看订单日志
  2471. </Button>
  2472. </FormItem>
  2473. <FormItem
  2474. labelCol={{ span: 4 }}
  2475. wrapperCol={{ span: 18 }}
  2476. label="补充协议"
  2477. >
  2478. {/*<Upload*/}
  2479. {/* className="demandDetailShow-upload"*/}
  2480. {/* listType="picture-card"*/}
  2481. {/* fileList={this.state.replenishUrl}*/}
  2482. {/* onPreview={(file) => {*/}
  2483. {/* this.setState({*/}
  2484. {/* previewImage: file.url || file.thumbUrl,*/}
  2485. {/* previewVisibles: true,*/}
  2486. {/* });*/}
  2487. {/* }}*/}
  2488. {/*/>*/}
  2489. <div style={{paddingTop:'10px',paddingBottom:'10px'}}>
  2490. <ImgList domId='addorders1' fileList={this.state.replenishUrl} ItemWidth={'96px'}/>
  2491. </div>
  2492. <Modal
  2493. maskClosable={false}
  2494. footer={null}
  2495. width={"50%"}
  2496. visible={this.state.previewVisibles}
  2497. onCancel={() => {
  2498. this.setState({ previewVisibles: false, rotateDeg: 0 });
  2499. }}
  2500. >
  2501. <img
  2502. alt=""
  2503. style={{
  2504. width: "100%",
  2505. transform: `rotate(${this.state.rotateDeg}deg)`,
  2506. }}
  2507. src={this.state.previewImage || ""}
  2508. />
  2509. <Button
  2510. onClick={this.rotates}
  2511. style={{
  2512. position: "relative",
  2513. left: "50%",
  2514. transform: "translateX(-50%)",
  2515. }}
  2516. >
  2517. 旋转
  2518. </Button>
  2519. <Button
  2520. onClick={this.upImgs}
  2521. style={{
  2522. position: "absolute",
  2523. left: -81,
  2524. top: "50%",
  2525. transform: "translateY(-50%)",
  2526. }}
  2527. >
  2528. 上一张
  2529. </Button>
  2530. <Button
  2531. onClick={this.downImgs}
  2532. style={{
  2533. position: "absolute",
  2534. right: -81,
  2535. top: "50%",
  2536. transform: "translateY(-50%)",
  2537. }}
  2538. >
  2539. 下一张
  2540. </Button>
  2541. </Modal>
  2542. </FormItem>
  2543. </div>
  2544. )}
  2545. </div>
  2546. <div className="clearfix">
  2547. {this.props.deleteSign === 3 || this.state.processStatus == 0 ? (
  2548. <div className="clearfix">
  2549. <FormItem
  2550. labelCol={{ span: 4 }}
  2551. wrapperCol={{ span: 16 }}
  2552. label="订单留言"
  2553. >
  2554. <Input
  2555. type="textarea"
  2556. placeholder="请输入订单留言"
  2557. rows={4}
  2558. value={this.state.orderRemarks}
  2559. onChange={(e) => {
  2560. this.setState({ orderRemarks: e.target.value });
  2561. }}
  2562. style={{ width: "95%" }}
  2563. />
  2564. <span className="mandatory">*</span>
  2565. </FormItem>
  2566. </div>
  2567. ) : (
  2568. <FormItem
  2569. labelCol={{ span: 4 }}
  2570. wrapperCol={{ span: 16 }}
  2571. label="订单留言"
  2572. >
  2573. <p style={{ width: 500, wordWrap: "break-word" }}>
  2574. {this.state.orderRemarks}
  2575. </p>
  2576. </FormItem>
  2577. )}
  2578. </div>
  2579. <div className="clearfix">
  2580. <FormItem
  2581. className="half-item"
  2582. {...formItemLayout}
  2583. label="订单负责人"
  2584. >
  2585. <span>{this.state.salesmanName}</span>
  2586. </FormItem>
  2587. <FormItem
  2588. className="half-item"
  2589. {...formItemLayout}
  2590. label="订单负责人电话"
  2591. >
  2592. <span>{this.state.salesmanMobile}</span>
  2593. </FormItem>
  2594. </div>
  2595. <div className="clearfix">
  2596. <FormItem
  2597. className="half-item"
  2598. {...formItemLayout}
  2599. label="当前财务负责人"
  2600. >
  2601. <span>{this.state.nowFinance}</span>
  2602. </FormItem>
  2603. <FormItem
  2604. className="half-item"
  2605. {...formItemLayout}
  2606. label="当前财务负责人电话"
  2607. >
  2608. <span>{this.state.nowFinanceMobile}</span>
  2609. </FormItem>
  2610. </div>
  2611. <div className="clearfix">
  2612. <FormItem
  2613. className="half-item"
  2614. {...formItemLayout}
  2615. style={{ opacity: ".5" }}
  2616. label="原订单负责人"
  2617. >
  2618. <span>{this.state.oldSalesmanName}</span>
  2619. </FormItem>
  2620. <FormItem
  2621. className="half-item"
  2622. {...formItemLayout}
  2623. style={{ opacity: ".5" }}
  2624. label="原订单负责人电话"
  2625. >
  2626. <span>{this.state.oldSalesmanMobile}</span>
  2627. </FormItem>
  2628. </div>
  2629. <div className="clearfix">
  2630. <FormItem
  2631. className="half-item"
  2632. style={{ opacity: ".5" }}
  2633. {...formItemLayout}
  2634. label="实际财务操作人"
  2635. >
  2636. <span>{this.state.financeName}</span>
  2637. </FormItem>
  2638. <FormItem
  2639. className="half-item"
  2640. {...formItemLayout}
  2641. style={{ opacity: ".5" }}
  2642. label="实际财务操作人电话"
  2643. >
  2644. <span>{this.state.financeMobile}</span>
  2645. </FormItem>
  2646. </div>
  2647. <div>
  2648. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  2649. 项目业务
  2650. </span>
  2651. {this.props.deleteSign === 3 || this.state.processStatus == 0 ? (
  2652. <Button
  2653. type="primary"
  2654. onClick={this.addDetailed}
  2655. style={{
  2656. float: "right",
  2657. marginRight: "50px",
  2658. marginBottom: "15px",
  2659. }}
  2660. >
  2661. 添加项目明细
  2662. </Button>
  2663. ) : (
  2664. ""
  2665. )}
  2666. </div>
  2667. <div className="patent-table">
  2668. <Spin spinning={this.state.loading}>
  2669. <Table
  2670. columns={this.state.columns}
  2671. dataSource={this.state.dataSource}
  2672. pagination={this.state.pagination}
  2673. onRowClick={this.tableRowClick}
  2674. />
  2675. </Spin>
  2676. </div>{" "}
  2677. <div
  2678. style={{
  2679. display: cuiDataList.length ? "block" : "none",
  2680. }}
  2681. >
  2682. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  2683. 旧催款节点
  2684. </span>
  2685. <Button
  2686. type="primary"
  2687. // onClick={this.addcontact}
  2688. disabled
  2689. onClick={(e) => {
  2690. cuiDataList.length ? this.addcontact() : this.addcontactNew();
  2691. }}
  2692. style={{
  2693. float: "right",
  2694. marginRight: "50px",
  2695. marginBottom: "15px",
  2696. display: this.state.processStatus == 0 ? "block" : "none",
  2697. }}
  2698. >
  2699. 添加催款节点
  2700. </Button>
  2701. </div>
  2702. <div
  2703. className="clearfix"
  2704. style={{
  2705. display: cuiDataList.length ? "block" : "none",
  2706. }}
  2707. >
  2708. <Spin spinning={this.state.loading}>
  2709. <Form layout="horizontal">
  2710. <Table
  2711. pagination={false}
  2712. columns={this.state.ContactsLists}
  2713. dataSource={this.state.contactList}
  2714. scroll={{ x: "max-content", y: 0 }}
  2715. bordered
  2716. size="small"
  2717. />
  2718. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  2719. </Form>
  2720. </Spin>
  2721. </div>
  2722. <div
  2723. style={{
  2724. display: cuiDataList.length ? "none" : "block",
  2725. }}
  2726. >
  2727. <span
  2728. style={{
  2729. marginLeft: "50px",
  2730. fontSize: "20px",
  2731. }}
  2732. >
  2733. 新催款节点
  2734. </span>
  2735. <span
  2736. style={{
  2737. display: "inline-block",
  2738. marginLeft: 10,
  2739. color: "red",
  2740. }}
  2741. >
  2742. 金额总计(万元): {this.state.totalCui}
  2743. </span>
  2744. <Button
  2745. type="primary"
  2746. disabled={this.state.addFlag ? true : false}
  2747. // onClick={this.addcontact}
  2748. onClick={(e) => {
  2749. this.setState({ addFlag: true });
  2750. this.addcontactNew();
  2751. }}
  2752. style={{
  2753. float: "right",
  2754. marginRight: "50px",
  2755. marginBottom: "15px",
  2756. display: this.state.processStatus == 0 ? "block" : "none",
  2757. }}
  2758. >
  2759. 添加催款节点
  2760. </Button>
  2761. </div>
  2762. <div
  2763. className="clearfix"
  2764. style={{
  2765. display: cuiDataList.length ? "none" : "block",
  2766. }}
  2767. >
  2768. <Spin spinning={this.state.loading}>
  2769. <Form layout="horizontal">
  2770. <Table
  2771. pagination={false}
  2772. columns={this.state.ContactsListsNew}
  2773. dataSource={this.state.contactListNew}
  2774. scroll={{ x: "max-content", y: 0 }}
  2775. bordered
  2776. size="small"
  2777. />
  2778. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  2779. </Form>
  2780. </Spin>
  2781. </div>
  2782. {this.props.deleteSign === 3 || this.state.processStatus == 0 ? (
  2783. <div
  2784. className="addSave"
  2785. style={{
  2786. marginTop: "15px",
  2787. display: "flex",
  2788. justifyContent: "flex-end",
  2789. }}
  2790. >
  2791. {!this.state.buttonStatus ? (
  2792. <Button
  2793. className="cancel"
  2794. type="primary"
  2795. onClick={this.handleCancels}
  2796. style={{ marginRight: 20 }}
  2797. htmlType="submit"
  2798. >
  2799. 签单
  2800. </Button>
  2801. ) : (
  2802. ""
  2803. )}
  2804. <Button
  2805. className="cancel"
  2806. type="primary"
  2807. onClick={this.handleCancelq}
  2808. style={{ marginRight: 40 }}
  2809. htmlType="submit"
  2810. >
  2811. 保存
  2812. </Button>
  2813. </div>
  2814. ) : (
  2815. ""
  2816. )}
  2817. </Spin>
  2818. {this.state.lookVisible ? <Modal
  2819. maskClosable={false}
  2820. visible={this.state.lookVisible}
  2821. onOk={this.noCancel}
  2822. onCancel={this.noCancel}
  2823. width="800px"
  2824. title={"退单申请"}
  2825. footer=""
  2826. className="admin-desc-content"
  2827. >
  2828. <Form layout="horizontal" id="demand-form">
  2829. <Spin spinning={this.state.loading}>
  2830. <div className="clearfix">
  2831. <FormItem
  2832. labelCol={{ span: 4 }}
  2833. wrapperCol={{ span: 16 }}
  2834. label="终止合同"
  2835. >
  2836. <Picture
  2837. domId='zhongzhihetong'
  2838. fileList={(e) => {
  2839. this.setState({ contractUrl: e });
  2840. }}
  2841. pictureUrl={this.state.contractUrl}
  2842. visible={this.props.visible}
  2843. data={{
  2844. sign: "order_refund_file",
  2845. url: "/api/admin/newOrder/uploadRefundOrderFile",
  2846. number: 8,
  2847. }}
  2848. />
  2849. </FormItem>
  2850. </div>
  2851. <div className="clearfix">
  2852. <FormItem
  2853. labelCol={{ span: 4 }}
  2854. wrapperCol={{ span: 16 }}
  2855. label="退单申请表"
  2856. >
  2857. <Picture
  2858. domId={'addorders2'}
  2859. fileList={(e) => {
  2860. this.setState({ applicationUrl: e });
  2861. }}
  2862. pictureUrl={this.state.applicationUrl}
  2863. visible={this.props.visible}
  2864. data={{
  2865. sign: "order_refund_file",
  2866. url: "/api/admin/newOrder/uploadRefundOrderFile",
  2867. number: 8,
  2868. }}
  2869. />
  2870. </FormItem>
  2871. </div>
  2872. <div className="clearfix">
  2873. <FormItem
  2874. labelCol={{ span: 4 }}
  2875. wrapperCol={{ span: 16 }}
  2876. label="退单理由"
  2877. >
  2878. <Input
  2879. type="textarea"
  2880. placeholder="请输入退单理由"
  2881. rows={4}
  2882. value={this.state.reason}
  2883. onChange={(e) => {
  2884. this.setState({ reason: e.target.value });
  2885. }}
  2886. />
  2887. </FormItem>
  2888. </div>
  2889. <div className="clearfix">
  2890. <Button
  2891. className="cancel"
  2892. type="primary"
  2893. onClick={this.tuidanOk}
  2894. style={{ marginLeft: "50px" }}
  2895. htmlType="submit"
  2896. >
  2897. 确定退单
  2898. </Button>
  2899. <Button
  2900. className="cancel"
  2901. type="ghost"
  2902. onClick={this.noCancel}
  2903. style={{ marginLeft: "50px" }}
  2904. >
  2905. 取消
  2906. </Button>
  2907. </div>
  2908. </Spin>
  2909. </Form>
  2910. </Modal> : <div/>}
  2911. <Modal
  2912. visible={this.state.rizhivisible}
  2913. className="admin-desc-content"
  2914. width="800px"
  2915. maskClosable={false}
  2916. title="订单日志"
  2917. footer={null}
  2918. onCancel={this.closeOrderLog}
  2919. >
  2920. <div className="patent-table">
  2921. <Spin spinning={this.state.loading}>
  2922. <Table
  2923. columns={this.state.columnsrizhi}
  2924. dataSource={this.state.dataSourcerizhi}
  2925. pagination={false}
  2926. />
  2927. </Spin>
  2928. </div>
  2929. </Modal>
  2930. {this.state.projectOperationVisible ? <ProjectOperation
  2931. readOnly={this.state.dataInfor && Object.keys(this.state.dataInfor).length > 0 && this.state.processStatus !== 0}
  2932. orderNo={this.props.datauser.orderNo}
  2933. visible={this.state.projectOperationVisible}
  2934. dataInfor={this.state.dataInfor}
  2935. onCancel={this.nextCancel}
  2936. /> : null}
  2937. </div>
  2938. );
  2939. },
  2940. })
  2941. );
  2942. export default Addorders;