addService.jsx 106 KB

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