addService.jsx 107 KB

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