addService.jsx 104 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864
  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. financeName: thisData.financeName, //财务名称
  606. financeMobile: thisData.financeMobile, //财务电话
  607. contractNo: thisData.contractNo, //合同编号
  608. approval:
  609. thisData.approval == 0
  610. ? thisData.approval.toString()
  611. : thisData.approval,
  612. organizationSearch: thisData.orderDep,
  613. depName: thisData.depName
  614. });
  615. }.bind(this)
  616. }).always(
  617. function() {
  618. this.setState({
  619. loading: false
  620. });
  621. }.bind(this)
  622. );
  623. },
  624. //查看催款节点
  625. loaduserss(record) {
  626. this.state.orderList = [];
  627. this.setState({
  628. orderNoss: record ? record.orderNo : this.props.datauser.orderNo
  629. });
  630. $.ajax({
  631. method: "get",
  632. dataType: "json",
  633. crossDomain: false,
  634. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  635. data: {
  636. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  637. },
  638. success: function(data) {
  639. let theArr = [];
  640. let thisData = [];
  641. if (!thisData) {
  642. if (data.error && data.error.length) {
  643. message.warning(data.error[0].message);
  644. }
  645. thisData = {};
  646. } else {
  647. for (let i = 0; i < data.data.length; i++) {
  648. thisData = data.data[i];
  649. theArr.push({
  650. key: i,
  651. dunSubject: thisData.dunSubject
  652. ? thisData.dunSubject.toString()
  653. : "", //催款科目
  654. id: thisData.id, //节点Id
  655. money: thisData.money, //催款金额
  656. dunStatus: thisData.dunStatus, //催款状态
  657. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  658. });
  659. }
  660. this.setState({
  661. contactList: theArr
  662. });
  663. }
  664. }.bind(this)
  665. }).always(
  666. function() {
  667. this.setState({
  668. loading: false
  669. });
  670. }.bind(this)
  671. );
  672. },
  673. //催款节点保存
  674. contactSave() {
  675. if (this.state.contactList) {
  676. let cuiData = this.state.contactList;
  677. for (var a = 0; a < cuiData.length; a++) {
  678. if (cuiData[a].money == "") {
  679. message.warning("催款金额不能为空");
  680. this.refs.signFirstPayment.focus();
  681. return false;
  682. } else if (!cuiData[a].dunSubject) {
  683. message.warning("催款科目不能为空");
  684. this.refs.signFirstPayment.focus();
  685. return false;
  686. }
  687. if (moneyVerify(cuiData[a].money)) {
  688. return;
  689. }
  690. }
  691. }
  692. this.setState({
  693. loading: true
  694. });
  695. $.ajax({
  696. url: globalConfig.context + "/api/admin/newOrder/createOrderDun",
  697. method: "post",
  698. data: {
  699. orderNo: this.state.orderNoss,
  700. orderDun: JSON.stringify(this.state.contactList)
  701. }
  702. }).done(
  703. function(data) {
  704. this.setState({
  705. loading: false
  706. });
  707. if (!data.error.length) {
  708. message.success("保存成功!");
  709. this.loaduserss();
  710. } else {
  711. message.warning(data.error[0].message);
  712. }
  713. }.bind(this)
  714. );
  715. },
  716. //点击新增催款节点
  717. addcontact() {
  718. this.state.contactList.push({
  719. key: this.state.contactList.length,
  720. money: "",
  721. dunSubject: undefined,
  722. orderNo: this.state.orderNoss,
  723. dunTarget: this.state.kehuId
  724. });
  725. this.setState({
  726. contactList: this.state.contactList
  727. });
  728. },
  729. //删除收款节点
  730. confirmDelet(index) {
  731. if (index.id) {
  732. this.state.contactList.splice(index.key, 1);
  733. this.setState({
  734. contactList: this.state.contactList
  735. });
  736. this.contactSave();
  737. } else {
  738. this.state.contactList.splice(index.key, 1);
  739. this.setState({
  740. contactList: this.state.contactList
  741. });
  742. }
  743. },
  744. handleOk() {
  745. this.setState({
  746. visible: false,
  747. mark: false
  748. });
  749. this.props.closeDesc(false, true);
  750. },
  751. handleCancel() {
  752. if (this.state.orderType == undefined) {
  753. return false;
  754. }
  755. if (!this.state.autoId) {
  756. return false;
  757. }
  758. this.setState({
  759. visible: false,
  760. mark: false
  761. });
  762. this.props.closeDesc(false);
  763. },
  764. handleCancelclose() {
  765. this.setState(
  766. {
  767. visible: false,
  768. mark: false
  769. },
  770. () => {
  771. this.setState({
  772. activeKey: "1"
  773. });
  774. }
  775. );
  776. this.props.closeDesc(false);
  777. this.reset();
  778. },
  779. //点击签单
  780. handleCancels() {
  781. this.setState({
  782. isSubmit: 1
  783. });
  784. },
  785. //点击签单
  786. handleCancelq() {
  787. this.setState({
  788. isSubmit: 0
  789. });
  790. },
  791. //删除
  792. delectRow(record) {
  793. this.setState({
  794. loading: true
  795. });
  796. $.ajax({
  797. method: "post",
  798. dataType: "json",
  799. crossDomain: false,
  800. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  801. data: {
  802. id: record.id
  803. }
  804. }).done(
  805. function(data) {
  806. if (!data.error.length) {
  807. message.success("删除成功!");
  808. this.setState({
  809. loading: false
  810. });
  811. //this.loaduser()
  812. this.loadData();
  813. } else {
  814. message.warning(data.error[0].message);
  815. }
  816. }.bind(this)
  817. );
  818. },
  819. nextCancel() {
  820. this.setState({
  821. addnextVisible: false
  822. });
  823. },
  824. rizhi() {
  825. this.setState({
  826. loading: true
  827. });
  828. $.ajax({
  829. method: "get",
  830. dataType: "json",
  831. crossDomain: false,
  832. url: "/api/admin/newOrder/selectOrderLog",
  833. data: {
  834. orderNo: this.props.datauser.orderNo
  835. },
  836. success: function(data) {
  837. let theArr = [];
  838. let thisData = data.data;
  839. if (!thisData.length) {
  840. if (data.error && data.error.length) {
  841. message.warning(data.error[0].message);
  842. }
  843. thisData = {};
  844. } else {
  845. for (let i = 0; i < data.data.length; i++) {
  846. let thisdata = data.data[i];
  847. theArr.push({
  848. processName: thisdata.processName,
  849. adminName: thisdata.adminName,
  850. createDate: thisdata.createDate
  851. });
  852. }
  853. }
  854. this.setState({
  855. dataSourcerizhi: theArr
  856. });
  857. }.bind(this)
  858. }).always(
  859. function() {
  860. this.setState({
  861. loading: false
  862. });
  863. }.bind(this)
  864. );
  865. },
  866. //查看订单日志
  867. getOrderLog() {
  868. this.setState({
  869. rizhivisible: true
  870. });
  871. this.rizhi();
  872. },
  873. closeOrderLog() {
  874. this.setState({
  875. rizhivisible: false
  876. });
  877. },
  878. callback(key) {
  879. this.setState({
  880. activeKey: key
  881. });
  882. if (key === "2") {
  883. let url = window.location.href.substring(7);
  884. $.ajax({
  885. method: "get",
  886. dataType: "json",
  887. crossDomain: false,
  888. url:
  889. globalConfig.context + "/api/admin/orderChange/orderChangeDetails",
  890. data: {
  891. orderNo: this.props.datauser.orderNo
  892. },
  893. success: function(data) {
  894. // console.log(data.data);
  895. if (data.data) {
  896. let thisdata = data.data;
  897. // console.log(this.state.userName);
  898. Object.assign(thisdata, {
  899. userName: this.state.userName,
  900. contractNo: this.state.contractNo,
  901. arrears: this.state.arrears
  902. });
  903. this.setState({
  904. mark: true,
  905. contractData: thisdata,
  906. voucherUrl: thisdata.voucherUrl
  907. ? splitUrl(
  908. thisdata.voucherUrl,
  909. ",",
  910. globalConfig.avatarHost + "/upload",
  911. url
  912. )
  913. : []
  914. });
  915. }
  916. }.bind(this)
  917. });
  918. }
  919. },
  920. getOrgCodeUrl(e) {
  921. this.setState({ orgCodeUrl: e });
  922. },
  923. getVoucherUrl(e) {
  924. this.setState({ voucherUrl: e });
  925. },
  926. //加载(自动补全)
  927. supervisor(e, state) {
  928. //客户名称与服务名称自动补全
  929. let api = state
  930. ? "/api/admin/customer/getCustomerByName"
  931. : "/api/admin/order/getBusinessProjectByName";
  932. $.ajax({
  933. method: "get",
  934. dataType: "json",
  935. crossDomain: false,
  936. url: globalConfig.context + api,
  937. data: state
  938. ? {
  939. name: e,
  940. type: this.state.customType
  941. }
  942. : {
  943. businessName: e
  944. },
  945. success: function(data) {
  946. let thedata = data.data;
  947. if (!thedata) {
  948. if (data.error && data.error.length) {
  949. message.warning(data.error[0].message);
  950. }
  951. thedata = {};
  952. }
  953. this.setState({
  954. states: state,
  955. customerArr: thedata
  956. });
  957. }.bind(this)
  958. }).always(
  959. function() {
  960. this.setState({
  961. loading: false
  962. });
  963. }.bind(this)
  964. );
  965. },
  966. //上级主管输入框失去焦点是判断客户是否存在
  967. selectAuto(value) {
  968. let kid = [];
  969. let fwList = this.state.customerArr;
  970. fwList.map(function(item) {
  971. if (value == item.bname) {
  972. kid = item;
  973. }
  974. });
  975. this.setState({
  976. commodityName: value,
  977. gid: kid.id,
  978. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  979. commodityFirstPayment:
  980. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  981. });
  982. },
  983. //客户
  984. selectAutoCUT(value) {
  985. let autoIds;
  986. let fwList = this.state.customerArr;
  987. fwList.map(function(item) {
  988. if (value == item.name) {
  989. autoIds = item.id;
  990. }
  991. });
  992. this.setState({
  993. customerName: value,
  994. autoId: autoIds
  995. });
  996. },
  997. //服务值改变时请求客户名称
  998. httpChange(e) {
  999. this.state.gid = "";
  1000. if (e.length >= 1) {
  1001. this.supervisor(e, false);
  1002. }
  1003. this.setState({
  1004. commodityName: e
  1005. });
  1006. },
  1007. //客户名称自动补全
  1008. customerChange(e) {
  1009. if (this.state.customType) {
  1010. this.state.autoId = "";
  1011. if (e.length >= 2) {
  1012. this.supervisor(e, true);
  1013. }
  1014. this.setState({
  1015. customerName: e
  1016. });
  1017. } else {
  1018. this.setState({
  1019. customerName: ""
  1020. });
  1021. message.warning("客户所属类型必须指定");
  1022. }
  1023. },
  1024. //点击添加项目明细
  1025. addDetailed() {
  1026. this.setState({
  1027. gid: "",
  1028. customerArr: [],
  1029. commodityName: "",
  1030. commodityQuantity: "",
  1031. commodityId: "",
  1032. taskComment: "",
  1033. main: undefined,
  1034. commodityPrice: "",
  1035. addState: 1,
  1036. addnextVisible: true
  1037. });
  1038. },
  1039. //新建项目明细保存
  1040. nextSubmit(e) {
  1041. e.preventDefault();
  1042. if (this.state.gid == undefined || !this.state.gid) {
  1043. message.warning("服务名称不匹配!");
  1044. return false;
  1045. }
  1046. if (!this.state.commodityPrice) {
  1047. message.warning("请输入金额!");
  1048. this.refs.commodityPrice.focus();
  1049. return false;
  1050. }
  1051. if (!this.state.commodityQuantity) {
  1052. message.warning("请输入商品数量!");
  1053. this.refs.commodityQuantity.focus();
  1054. return false;
  1055. }
  1056. if (!this.state.main) {
  1057. message.warning("请选择是否为主要项目!");
  1058. this.refs.commodityQuantity.focus();
  1059. return false;
  1060. }
  1061. this.setState({
  1062. loading: true
  1063. });
  1064. let api = this.state.addState
  1065. ? "/api/admin/newOrder/addOrderTask"
  1066. : "/api/bianji";
  1067. $.ajax({
  1068. method: "POST",
  1069. dataType: "json",
  1070. crossDomain: false,
  1071. url: globalConfig.context + api,
  1072. data: {
  1073. commodityId: this.state.gid, //商品ID
  1074. orderNo: this.props.datauser.orderNo, //订单编号
  1075. commodityName: this.state.commodityName, //商品名称
  1076. commodityQuantity: this.state.commodityQuantity, //商品数量
  1077. commodityPrice: this.state.commodityPrice, //签单总价
  1078. taskComment: this.state.taskComment, //服务说明
  1079. main: this.state.main //是否为主要项目
  1080. }
  1081. }).done(
  1082. function(data) {
  1083. this.setState({
  1084. loading: false
  1085. });
  1086. if (!data.error.length) {
  1087. message.success("保存成功!");
  1088. this.nextCancel();
  1089. //this.loaduser(this.props.datauser);
  1090. this.loadData();
  1091. } else {
  1092. message.warning(data.error[0].message);
  1093. }
  1094. }.bind(this)
  1095. );
  1096. },
  1097. //点击打卡项目详情
  1098. tableRowClick(record) {
  1099. this.setState({
  1100. jid: record.id, //项目ID
  1101. kid: record.commodityId, //商品ID
  1102. commodityName: record.commodityName, //金额
  1103. commodityPrice: record.commodityPrice, //金额
  1104. commodityQuantity: record.commodityQuantity, //数量
  1105. taskComment: record.taskComment, //备注
  1106. main: record.main.toString(), //是否为主要
  1107. addnextVisible: true,
  1108. addState: 0
  1109. });
  1110. },
  1111. //修改项目详情
  1112. tabRowSave(e) {
  1113. e.preventDefault();
  1114. if (!this.state.commodityPrice) {
  1115. message.warning("金额不能为空!");
  1116. return false;
  1117. }
  1118. if (!this.state.commodityQuantity) {
  1119. message.warning("数量不能为空!");
  1120. return false;
  1121. }
  1122. if (!this.state.main) {
  1123. message.warning("请选择是否为主要项目!");
  1124. this.refs.commodityQuantity.focus();
  1125. return false;
  1126. }
  1127. $.ajax({
  1128. method: "POST",
  1129. dataType: "json",
  1130. crossDomain: false,
  1131. url: globalConfig.context + "/api/admin/newOrder/updateOrderTask",
  1132. data: {
  1133. id: this.state.jid, //项目ID
  1134. commodityId: this.state.kid, //商品ID
  1135. orderNo: this.props.datauser.orderNo, //订单编号
  1136. main: this.state.main, //是否为主要
  1137. commodityPrice: this.state.commodityPrice, //金额
  1138. commodityQuantity: this.state.commodityQuantity, //数量
  1139. taskComment: this.state.taskComment //备注
  1140. }
  1141. }).done(
  1142. function(data) {
  1143. this.setState({
  1144. loading: false
  1145. });
  1146. if (!data.error.length) {
  1147. message.success("保存成功!");
  1148. this.nextCancel();
  1149. //this.loaduser(this.props.datauser);
  1150. this.loadData();
  1151. } else {
  1152. message.warning(data.error[0].message);
  1153. }
  1154. }.bind(this)
  1155. );
  1156. },
  1157. //签单时间选择
  1158. selTime(e, index) {
  1159. this.setState({
  1160. entryTime: e,
  1161. signDate: e,
  1162. selTime: index
  1163. });
  1164. },
  1165. //退单操作
  1166. //点击退单
  1167. tuikuan() {
  1168. this.setState({
  1169. lookVisible: true,
  1170. contractUrl: [],
  1171. applicationUrl: [],
  1172. reason: ""
  1173. });
  1174. },
  1175. //关闭退单
  1176. noCancel() {
  1177. this.setState({
  1178. lookVisible: false
  1179. });
  1180. },
  1181. //点击确认退单
  1182. tuidanOk() {
  1183. let contractUrls = [];
  1184. let applicationUrls = [];
  1185. if (this.state.contractUrl.length) {
  1186. let picArr = [];
  1187. this.state.contractUrl.map(function(item) {
  1188. if (
  1189. item.response &&
  1190. item.response.data &&
  1191. item.response.data.length
  1192. ) {
  1193. picArr.push(item.response.data);
  1194. }
  1195. });
  1196. contractUrls = picArr.join(",");
  1197. }
  1198. if (this.state.applicationUrl.length) {
  1199. let picArr = [];
  1200. this.state.applicationUrl.map(function(item) {
  1201. if (
  1202. item.response &&
  1203. item.response.data &&
  1204. item.response.data.length
  1205. ) {
  1206. picArr.push(item.response.data);
  1207. }
  1208. });
  1209. applicationUrls = picArr.join(",");
  1210. }
  1211. $.ajax({
  1212. method: "POST",
  1213. dataType: "json",
  1214. crossDomain: false,
  1215. url: globalConfig.context + "/api/admin/newOrder/addOrderRefund",
  1216. data: {
  1217. orderNo: this.state.orderNo, //订单编号
  1218. contractUrl: contractUrls.length ? contractUrls : "", //终止合同
  1219. applicationUrl: applicationUrls.length ? applicationUrls : "", //退单申请表
  1220. reason: this.state.reason //退单原因
  1221. }
  1222. }).done(
  1223. function(data) {
  1224. this.setState({
  1225. loading: false
  1226. });
  1227. if (!data.error.length) {
  1228. message.success("退单成功!");
  1229. this.noCancel();
  1230. this.handleCancelclose();
  1231. } else {
  1232. message.warning(data.error[0].message);
  1233. }
  1234. }.bind(this)
  1235. );
  1236. },
  1237. //开单选择订单类型骚操作
  1238. orderTypeFn(e) {
  1239. if (e == 0) {
  1240. this.setState({
  1241. bussStats: true,
  1242. orderType: e
  1243. });
  1244. this.category();
  1245. } else {
  1246. this.setState({
  1247. contractType: undefined,
  1248. bussStats: false,
  1249. orderType: e
  1250. });
  1251. }
  1252. },
  1253. //品类数据获取
  1254. category() {
  1255. $.ajax({
  1256. method: "get",
  1257. dataType: "json",
  1258. crossDomain: false,
  1259. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  1260. data: {},
  1261. success: function(data) {
  1262. let thedata = data.data;
  1263. let theArr = [];
  1264. if (!thedata) {
  1265. if (data.error && data.error.length) {
  1266. message.warning(data.error[0].message);
  1267. }
  1268. thedata = {};
  1269. } else {
  1270. thedata.map(function(item, index) {
  1271. theArr.push({
  1272. key: index,
  1273. name: item.cname,
  1274. id: item.id
  1275. });
  1276. });
  1277. }
  1278. this.setState({
  1279. contractType: undefined,
  1280. categoryArr: theArr
  1281. });
  1282. }.bind(this)
  1283. });
  1284. },
  1285. //变更申请
  1286. changeApply() {
  1287. if (this.state.processStatus <= 4) {
  1288. message.warning("当前订单流程不能发起变更!");
  1289. return false;
  1290. }
  1291. if(this.state.changeAmount == "" || this.state.changeAmount == undefined || this.state.changeAmount.trim() == "") {
  1292. message.warning("申请退款金额不能为空!");
  1293. return false;
  1294. }
  1295. let theorgCodeUrl = [];
  1296. if (this.state.voucherUrl.length) {
  1297. let picArr = [];
  1298. this.state.voucherUrl.map(function(item) {
  1299. if (
  1300. item.response &&
  1301. item.response.data &&
  1302. item.response.data.length
  1303. ) {
  1304. picArr.push(item.response.data);
  1305. }
  1306. });
  1307. theorgCodeUrl = picArr.join(",");
  1308. }
  1309. $.ajax({
  1310. method: "post",
  1311. dataType: "json",
  1312. crossDomain: false,
  1313. url: globalConfig.context + "/api/admin/orderChange/addOrderChange",
  1314. data: {
  1315. orderNo: this.state.orderNo, //订单编号
  1316. processState: 0,
  1317. status: 1,
  1318. startRemarks: this.state.startRemarks,
  1319. remarks: this.state.remarksC,
  1320. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  1321. totalAmount: this.state.totalAmount,
  1322. settlementAmount: this.state.settlementAmount,
  1323. changeAmount: this.state.changeAmount,
  1324. applicant: this.state.salesmanName,
  1325. depName: this.state.depName,
  1326. type: this.state.typeChange
  1327. }
  1328. }).done(
  1329. function(data) {
  1330. this.setState({
  1331. loading: false
  1332. });
  1333. if (!data.error.length) {
  1334. message.success("变更成功!");
  1335. this.noCancel();
  1336. this.handleCancelclose();
  1337. } else {
  1338. message.warning(data.error[0].message);
  1339. }
  1340. }.bind(this)
  1341. );
  1342. },
  1343. componentDidMount() {
  1344. window.setTimeout(() => {
  1345. // console.log("我看看", this.state);
  1346. },100)
  1347. },
  1348. reset() {
  1349. this.setState({
  1350. startRemarks: undefined,
  1351. remarksC: undefined,
  1352. voucherUrl: [],
  1353. totalAmount: undefined,
  1354. settlementAmount: undefined,
  1355. changeAmount: 0,
  1356. applicant: undefined,
  1357. depNameChange: undefined,
  1358. typeChange: 0
  1359. });
  1360. },
  1361. componentWillReceiveProps(nextProps) {
  1362. //props改变时触发
  1363. this.state.visible = nextProps.showDesc;
  1364. this.state.signBillVisible = nextProps.signBillVisible;
  1365. if (this.state.signBillVisible) {
  1366. this.loaduser(nextProps.uid);
  1367. }
  1368. if (nextProps.userDetaile && nextProps.showDesc) {
  1369. this.loaduser(nextProps.datauser);
  1370. this.loaduserss(nextProps.datauser);
  1371. this.loadData(nextProps.datauser);
  1372. } else {
  1373. this.setState({
  1374. orderType: undefined,
  1375. customerName: "",
  1376. autoId: "",
  1377. customerArr: [],
  1378. contractType: undefined,
  1379. bussStats: false,
  1380. customType: undefined
  1381. });
  1382. }
  1383. },
  1384. render() {
  1385. const FormItem = Form.Item;
  1386. const { TabPane } = Tabs;
  1387. const { TextArea } = Input;
  1388. const formItemLayout = {
  1389. labelCol: { span: 8 },
  1390. wrapperCol: { span: 14 }
  1391. };
  1392. const contractData = this.state.contractData;
  1393. const formItemList = [
  1394. {
  1395. label: "企业联系人",
  1396. content: <span>{this.state.contacts}</span>
  1397. },
  1398. {
  1399. label: "联系人电话",
  1400. content: <span>{this.state.contactMobile}</span>
  1401. },
  1402. {
  1403. label: "企业法人",
  1404. content: <span>{this.state.legalPerson}</span>
  1405. },
  1406. {
  1407. label: "法人电话",
  1408. content: <span>{this.state.legalPersonTel}</span>
  1409. },
  1410. // {
  1411. // label: "签单金额(万元)",
  1412. // content: <span>{this.state.totalAmount}</span>
  1413. // },
  1414. // {
  1415. // label: "首付金额(万元)",
  1416. // content: <span>{this.state.firstAmount}</span>
  1417. // },
  1418. {
  1419. label: "特批立项",
  1420. content: <span>{getApprovedState(this.state.approval)}</span>
  1421. },
  1422. {
  1423. label: "合同签订时间",
  1424. content: <span>{this.state.signDate}</span>
  1425. },
  1426. {
  1427. label: "订单部门",
  1428. content: <span>{this.state.depName}</span>
  1429. }
  1430. ];
  1431. const dataSources = this.state.customerArr || [];
  1432. let departmentArr = this.state.departmentArr || [];
  1433. const options = this.state.states
  1434. ? dataSources.map(group => (
  1435. <Select.Option key={group.id} value={group.name}>
  1436. {group.name}
  1437. </Select.Option>
  1438. ))
  1439. : dataSources.map((group, index) => (
  1440. <Select.Option key={index} value={group.bname}>
  1441. {group.bname}
  1442. </Select.Option>
  1443. ));
  1444. return (
  1445. <div>
  1446. <Modal
  1447. maskClosable={false}
  1448. visible={this.state.visible}
  1449. onOk={this.handleOk}
  1450. onCancel={this.handleCancelclose}
  1451. width={!this.props.userDetaile ? "600px" : "900px"}
  1452. title={!this.props.userDetaile ? "创建订单" : ""}
  1453. footer=""
  1454. className="admin-desc-content"
  1455. >
  1456. <Form
  1457. layout="horizontal"
  1458. onSubmit={this.handleSubmit}
  1459. id="demand-form"
  1460. style={{ paddingBottom: "40px" }}
  1461. >
  1462. <Spin spinning={this.state.loading}>
  1463. <div className="clearfix">
  1464. {!this.props.userDetaile ? (
  1465. <div className="clearfix">
  1466. <div className="clearfix">
  1467. <FormItem {...formItemLayout} label="订单类型">
  1468. <Select
  1469. placeholder="请选择订单类型"
  1470. style={{ width: "200px" }}
  1471. value={this.state.orderType}
  1472. onChange={e => {
  1473. this.setState({ orderType: e });
  1474. }}
  1475. >
  1476. {orderTypes.map(function(item) {
  1477. return (
  1478. <Select.Option key={item.value}>
  1479. {item.key}
  1480. </Select.Option>
  1481. );
  1482. })}
  1483. </Select>
  1484. <span className="mandatory">*</span>
  1485. </FormItem>
  1486. </div>
  1487. <FormItem {...formItemLayout} label="客户所属类型">
  1488. <Select
  1489. placeholder="请选择客户所属类型"
  1490. style={{ width: "200px" }}
  1491. value={this.state.customType}
  1492. onChange={e => {
  1493. this.setState({ customType: e });
  1494. }}
  1495. >
  1496. {customerType.map(function(item) {
  1497. return (
  1498. <Select.Option key={item.value}>
  1499. {item.key}
  1500. </Select.Option>
  1501. );
  1502. })}
  1503. </Select>
  1504. </FormItem>
  1505. <div className="clearfix">
  1506. <FormItem {...formItemLayout} label="客户名称">
  1507. <AutoComplete
  1508. className="certain-category-search"
  1509. dropdownClassName="certain-category-search-dropdown"
  1510. dropdownMatchSelectWidth={false}
  1511. dropdownStyle={{ width: 200 }}
  1512. size="large"
  1513. style={{ width: "200px" }}
  1514. dataSource={options}
  1515. placeholder="输入名称"
  1516. value={this.state.customerName}
  1517. onChange={this.customerChange}
  1518. filterOption={true}
  1519. onSelect={this.selectAutoCUT}
  1520. >
  1521. <Input />
  1522. </AutoComplete>
  1523. <span className="mandatory">*</span>
  1524. </FormItem>
  1525. </div>
  1526. <div className="addSave" style={{ marginTop: "15px" }}>
  1527. <Button
  1528. className="cancel"
  1529. type="primary"
  1530. onClick={this.handleCancel}
  1531. style={{ marginLeft: "150px" }}
  1532. htmlType="submit"
  1533. >
  1534. 开单
  1535. </Button>
  1536. <Button
  1537. className="cancel"
  1538. type="ghost"
  1539. onClick={this.handleCancelclose}
  1540. style={{ marginLeft: "50px" }}
  1541. >
  1542. 取消
  1543. </Button>
  1544. </div>
  1545. </div>
  1546. ) : (
  1547. <Tabs
  1548. onChange={this.callback}
  1549. activeKey={this.state.activeKey}
  1550. >
  1551. <TabPane tab={"编辑订单"} key="1">
  1552. <div className="clearfix">
  1553. <div className="clearfix">
  1554. <FormItem
  1555. className="half-item"
  1556. {...formItemLayout}
  1557. label="合同编号"
  1558. >
  1559. {<span>{this.state.contractNo}</span>}
  1560. </FormItem>
  1561. <FormItem
  1562. className="half-item"
  1563. {...formItemLayout}
  1564. label="订单编号"
  1565. >
  1566. <span>{this.state.orderNo}</span>
  1567. </FormItem>
  1568. <FormItem
  1569. className="half-item"
  1570. {...formItemLayout}
  1571. label="流程状态"
  1572. >
  1573. <span>
  1574. {getProcessStatus(this.state.processStatus)}
  1575. </span>
  1576. </FormItem>
  1577. <FormItem
  1578. className="half-item"
  1579. {...formItemLayout}
  1580. label="结算状态"
  1581. >
  1582. <span>
  1583. {getLiquidationStatus(
  1584. this.state.liquidationStatus
  1585. )}
  1586. </span>
  1587. </FormItem>
  1588. {this.state.processStatus === 0 ? (
  1589. <div className="clearfix">
  1590. <FormItem
  1591. className="half-item"
  1592. {...formItemLayout}
  1593. label="特批立项"
  1594. >
  1595. <Select
  1596. placeholder="请选择客户所属类型"
  1597. style={{ width: "240px" }}
  1598. value={this.state.approval}
  1599. onChange={e => {
  1600. this.setState({ approval: e });
  1601. }}
  1602. >
  1603. {tepi.map(function(item) {
  1604. return (
  1605. <Select.Option key={item.value}>
  1606. {item.key}
  1607. </Select.Option>
  1608. );
  1609. })}
  1610. </Select>
  1611. </FormItem>
  1612. <FormItem
  1613. className="half-item"
  1614. {...formItemLayout}
  1615. label="合同签订时间"
  1616. >
  1617. <DatePicker
  1618. style={{
  1619. marginTop: "2px",
  1620. width: "240px",
  1621. height: "32px"
  1622. }}
  1623. showTime
  1624. format="YYYY-MM-DD"
  1625. onOk={() => {}}
  1626. value={
  1627. this.state.signDate
  1628. ? moment(this.state.signDate)
  1629. : null
  1630. }
  1631. onChange={(data, dataString) => {
  1632. this.setState({ signDate: dataString });
  1633. }}
  1634. />
  1635. <span className="mandatory">*</span>
  1636. </FormItem>
  1637. <FormItem
  1638. className="half-item"
  1639. {...formItemLayout}
  1640. label="订单部门"
  1641. >
  1642. <Select
  1643. placeholder="请输入订单部门"
  1644. style={{ width: 240 }}
  1645. value={this.state.organizationSearch}
  1646. onChange={e => {
  1647. this.setState({ organizationSearch: e });
  1648. }}
  1649. >
  1650. {departmentArr.map(function(item) {
  1651. return (
  1652. <Select.Option key={item.id}>
  1653. {item.name}
  1654. </Select.Option>
  1655. );
  1656. })}
  1657. </Select>
  1658. </FormItem>
  1659. </div>
  1660. ) : (
  1661. <div className="clearfix">
  1662. <FormItem
  1663. className="half-item"
  1664. {...formItemLayout}
  1665. label="特批立项"
  1666. >
  1667. <span>
  1668. {getApprovedState(this.state.approval)}
  1669. </span>
  1670. </FormItem>
  1671. <FormItem
  1672. className="half-item"
  1673. {...formItemLayout}
  1674. label="合同签订时间"
  1675. >
  1676. <span>{this.state.signDate}</span>
  1677. </FormItem>
  1678. <FormItem
  1679. className="half-item"
  1680. {...formItemLayout}
  1681. label="订单部门"
  1682. >
  1683. <span>{this.state.depName}</span>
  1684. </FormItem>
  1685. </div>
  1686. )}
  1687. </div>
  1688. <h3
  1689. style={{
  1690. marginLeft: 10,
  1691. fontWeight: 800,
  1692. marginBottom: 10
  1693. }}
  1694. >
  1695. 收款项目
  1696. </h3>
  1697. {this.state.processStatus === 0 ? (
  1698. <div className="clearfix">
  1699. <FormItem
  1700. className="half-item"
  1701. {...formItemLayout}
  1702. label="签单金额(万元)"
  1703. >
  1704. <Input
  1705. placeholder="签单金额"
  1706. ref="signTotalAmount"
  1707. value={this.state.totalAmount}
  1708. onChange={e => {
  1709. this.setState({
  1710. totalAmount: e.target.value
  1711. });
  1712. }}
  1713. style={{ width: "240px" }}
  1714. />
  1715. {/* <span className="mandatory">*</span> */}
  1716. </FormItem>
  1717. <FormItem
  1718. className="half-item"
  1719. {...formItemLayout}
  1720. label="首付金额(万元)"
  1721. >
  1722. <Input
  1723. placeholder="请输入实签首款金额"
  1724. ref="signFirstPayment"
  1725. value={this.state.firstAmount}
  1726. onChange={e => {
  1727. this.setState({
  1728. firstAmount: e.target.value
  1729. });
  1730. }}
  1731. style={{ width: "240px" }}
  1732. />
  1733. {/* <span className="mandatory">*</span> */}
  1734. </FormItem>
  1735. <FormItem
  1736. className="half-item"
  1737. {...formItemLayout}
  1738. label="已收款项"
  1739. >
  1740. <span>
  1741. {this.state.settlementAmount + "万元"}
  1742. </span>
  1743. {/* {this.state.settlementAmount ? (
  1744. <Button
  1745. type="primary"
  1746. onClick={this.tuikuan}
  1747. style={{
  1748. float: "right",
  1749. marginRight: "50px",
  1750. marginBottom: "15px"
  1751. }}
  1752. >
  1753. 退单
  1754. </Button>
  1755. ) : (
  1756. ""
  1757. )} */}
  1758. </FormItem>
  1759. </div>
  1760. ) : (
  1761. <div className="clearfix">
  1762. <FormItem
  1763. className="half-item"
  1764. {...formItemLayout}
  1765. label="签单金额(万元)"
  1766. >
  1767. <span>{this.state.totalAmount}</span>
  1768. </FormItem>
  1769. <FormItem
  1770. className="half-item"
  1771. {...formItemLayout}
  1772. label="首付金额(万元)"
  1773. >
  1774. <span>{this.state.firstAmount}</span>
  1775. </FormItem>
  1776. <FormItem
  1777. className="half-item"
  1778. {...formItemLayout}
  1779. label="已收款项"
  1780. >
  1781. <span>
  1782. {this.state.settlementAmount + "万元"}
  1783. </span>
  1784. {/* {this.state.settlementAmount ? (
  1785. <Button
  1786. type="primary"
  1787. onClick={this.tuikuan}
  1788. style={{
  1789. float: "right",
  1790. marginRight: "50px",
  1791. marginBottom: "15px"
  1792. }}
  1793. >
  1794. 退单
  1795. </Button>
  1796. ) : (
  1797. ""
  1798. )} */}
  1799. </FormItem>
  1800. </div>
  1801. )}
  1802. <h3
  1803. style={{
  1804. marginLeft: 10,
  1805. fontWeight: 800,
  1806. marginBottom: 10
  1807. }}
  1808. >
  1809. 联系信息
  1810. </h3>
  1811. {this.state.processStatus == 0 ? (
  1812. <div className="clearfix">
  1813. <div className="clearfix">
  1814. <FormItem
  1815. className="half-item"
  1816. {...formItemLayout}
  1817. label="客户名称"
  1818. >
  1819. <span>{this.state.userName}</span>
  1820. </FormItem>
  1821. </div>
  1822. <FormItem
  1823. className="half-item"
  1824. {...formItemLayout}
  1825. label="企业联系人"
  1826. >
  1827. <Input
  1828. placeholder="请输入联系人"
  1829. ref="signTotalAmount"
  1830. value={this.state.contacts}
  1831. onChange={e => {
  1832. this.setState({ contacts: e.target.value });
  1833. }}
  1834. style={{ width: "240px" }}
  1835. />
  1836. </FormItem>
  1837. <FormItem
  1838. className="half-item"
  1839. {...formItemLayout}
  1840. label="联系人电话"
  1841. >
  1842. <Input
  1843. placeholder="请输入联系人电话"
  1844. ref="signTotalAmount"
  1845. value={this.state.contactMobile}
  1846. onChange={e => {
  1847. this.setState({
  1848. contactMobile: e.target.value
  1849. });
  1850. }}
  1851. style={{ width: "240px" }}
  1852. />
  1853. </FormItem>
  1854. <FormItem
  1855. className="half-item"
  1856. {...formItemLayout}
  1857. label="企业法人"
  1858. >
  1859. <Input
  1860. placeholder="请输入法人"
  1861. ref="signTotalAmount"
  1862. value={this.state.legalPerson}
  1863. onChange={e => {
  1864. this.setState({
  1865. legalPerson: e.target.value
  1866. });
  1867. }}
  1868. style={{ width: "240px" }}
  1869. />
  1870. </FormItem>
  1871. <FormItem
  1872. className="half-item"
  1873. {...formItemLayout}
  1874. label="法人电话"
  1875. >
  1876. <Input
  1877. placeholder="请输入法人电话"
  1878. ref="signTotalAmount"
  1879. value={this.state.legalPersonTel}
  1880. onChange={e => {
  1881. this.setState({
  1882. legalPersonTel: e.target.value
  1883. });
  1884. }}
  1885. style={{ width: "240px" }}
  1886. />
  1887. </FormItem>
  1888. </div>
  1889. ) : (
  1890. <div className="clearfix">
  1891. {formItemList.map((data, index) => {
  1892. return (
  1893. <FormItem
  1894. className="half-item"
  1895. {...formItemLayout}
  1896. key={index}
  1897. label={data.label}
  1898. >
  1899. {data.content}
  1900. </FormItem>
  1901. );
  1902. })}
  1903. </div>
  1904. )}
  1905. <div className="clearfix">
  1906. {this.state.processStatus == 0 ? (
  1907. <FormItem
  1908. labelCol={{ span: 4 }}
  1909. wrapperCol={{ span: 18 }}
  1910. label={
  1911. <span>
  1912. <strong style={{ color: "#f00" }}>*</strong>
  1913. 合同扫描件
  1914. </span>
  1915. }
  1916. >
  1917. <PicturesWall
  1918. fileList={this.getOrgCodeUrl}
  1919. pictureUrl={this.state.orgCodeUrl}
  1920. url="/api/admin/order/uploadOrderImg"
  1921. sign=""
  1922. />
  1923. <p>图片建议:要清晰。</p>
  1924. <Button
  1925. style={{
  1926. float: "right",
  1927. marginRight: "140px",
  1928. marginTop: "20px"
  1929. }}
  1930. onClick={this.getOrderLog}
  1931. >
  1932. 查看订单日志
  1933. </Button>
  1934. </FormItem>
  1935. ) : (
  1936. <FormItem
  1937. labelCol={{ span: 4 }}
  1938. wrapperCol={{ span: 18 }}
  1939. label="合同扫描件"
  1940. >
  1941. <Upload
  1942. className="demandDetailShow-upload"
  1943. listType="picture-card"
  1944. fileList={this.state.orgCodeUrl}
  1945. onPreview={file => {
  1946. this.setState({
  1947. previewImage: file.url || file.thumbUrl,
  1948. previewVisible: true
  1949. });
  1950. }}
  1951. ></Upload>
  1952. <Modal
  1953. maskClosable={false}
  1954. footer={null}
  1955. visible={this.state.previewVisible}
  1956. onCancel={() => {
  1957. this.setState({ previewVisible: false });
  1958. }}
  1959. >
  1960. <img
  1961. alt=""
  1962. style={{ width: "100%" }}
  1963. src={this.state.previewImage || ""}
  1964. />
  1965. </Modal>
  1966. <Button
  1967. style={{
  1968. float: "right",
  1969. marginRight: "140px",
  1970. marginTop: "20px"
  1971. }}
  1972. onClick={this.getOrderLog}
  1973. >
  1974. 查看订单日志
  1975. </Button>
  1976. </FormItem>
  1977. )}
  1978. </div>
  1979. <div className="clearfix">
  1980. {this.state.processStatus == 0 ? (
  1981. <div className="clearfix">
  1982. <FormItem
  1983. labelCol={{ span: 4 }}
  1984. wrapperCol={{ span: 16 }}
  1985. label="订单留言"
  1986. >
  1987. <Input
  1988. type="textarea"
  1989. placeholder="请输入订单留言"
  1990. rows={4}
  1991. value={this.state.orderRemarks}
  1992. onChange={e => {
  1993. this.setState({
  1994. orderRemarks: e.target.value
  1995. });
  1996. }}
  1997. style={{ width: "95%" }}
  1998. />
  1999. <span className="mandatory">*</span>
  2000. </FormItem>
  2001. </div>
  2002. ) : (
  2003. <FormItem
  2004. labelCol={{ span: 4 }}
  2005. wrapperCol={{ span: 16 }}
  2006. label="订单留言"
  2007. >
  2008. <p
  2009. style={{ width: 500, wordWrap: "break-word" }}
  2010. >
  2011. {this.state.orderRemarks}
  2012. </p>
  2013. </FormItem>
  2014. )}
  2015. </div>
  2016. <div className="clearfix">
  2017. <FormItem
  2018. className="half-item"
  2019. {...formItemLayout}
  2020. label="订单负责人"
  2021. >
  2022. <span>{this.state.salesmanName}</span>
  2023. </FormItem>
  2024. <FormItem
  2025. className="half-item"
  2026. {...formItemLayout}
  2027. label="订单负责人电话"
  2028. >
  2029. <span>{this.state.salesmanMobile}</span>
  2030. </FormItem>
  2031. </div>
  2032. <div className="clearfix">
  2033. <FormItem
  2034. className="half-item"
  2035. {...formItemLayout}
  2036. label="财务负责人"
  2037. >
  2038. <span>{this.state.financeName}</span>
  2039. </FormItem>
  2040. <FormItem
  2041. className="half-item"
  2042. {...formItemLayout}
  2043. label="财务负责人电话"
  2044. >
  2045. <span>{this.state.financeMobile}</span>
  2046. </FormItem>
  2047. </div>
  2048. <div>
  2049. <span
  2050. style={{ marginLeft: "50px", fontSize: "20px" }}
  2051. >
  2052. 催款节点
  2053. </span>
  2054. {this.state.processStatus == 0 ? (
  2055. <Button
  2056. type="primary"
  2057. onClick={this.addcontact}
  2058. style={{
  2059. float: "right",
  2060. marginRight: "50px",
  2061. marginBottom: "15px"
  2062. }}
  2063. >
  2064. 添加催款节点
  2065. </Button>
  2066. ) : (
  2067. ""
  2068. )}
  2069. </div>
  2070. <div className="clearfix">
  2071. <Spin spinning={this.state.loading}>
  2072. <Form layout="horizontal" id="demand-form">
  2073. <Table
  2074. pagination={false}
  2075. columns={this.state.ContactsLists}
  2076. dataSource={this.state.contactList}
  2077. />
  2078. <Col
  2079. span={24}
  2080. offset={9}
  2081. style={{ marginTop: "15px" }}
  2082. ></Col>
  2083. </Form>
  2084. </Spin>
  2085. </div>
  2086. <div>
  2087. <span
  2088. style={{ marginLeft: "50px", fontSize: "20px" }}
  2089. >
  2090. 项目业务
  2091. </span>
  2092. {this.state.processStatus == 0 ? (
  2093. <Button
  2094. type="primary"
  2095. onClick={this.addDetailed}
  2096. style={{
  2097. float: "right",
  2098. marginRight: "50px",
  2099. marginBottom: "15px"
  2100. }}
  2101. >
  2102. 添加项目明细
  2103. </Button>
  2104. ) : (
  2105. ""
  2106. )}
  2107. </div>
  2108. <div className="patent-table">
  2109. <Spin spinning={this.state.loading}>
  2110. <Table
  2111. columns={this.state.columns}
  2112. dataSource={this.state.dataSource}
  2113. pagination={this.state.pagination}
  2114. onRowClick={this.tableRowClick}
  2115. />
  2116. </Spin>
  2117. </div>
  2118. {this.state.processStatus == 0 ? (
  2119. <div
  2120. className="addSave"
  2121. style={{ marginTop: "15px" }}
  2122. >
  2123. <Button
  2124. className="cancel"
  2125. type="primary"
  2126. onClick={this.handleCancels}
  2127. style={{ marginLeft: "200px" }}
  2128. htmlType="submit"
  2129. >
  2130. 签单
  2131. </Button>
  2132. <Button
  2133. className="cancel"
  2134. type="primary"
  2135. onClick={this.handleCancelq}
  2136. style={{ marginLeft: "50px" }}
  2137. htmlType="submit"
  2138. >
  2139. 保存
  2140. </Button>
  2141. <Button
  2142. className="cancel"
  2143. type="ghost"
  2144. onClick={this.handleCancelclose}
  2145. style={{ marginLeft: "50px" }}
  2146. >
  2147. 取消
  2148. </Button>
  2149. </div>
  2150. ) : (
  2151. ""
  2152. )}
  2153. </div>
  2154. </TabPane>
  2155. <TabPane tab="合同变更记录" key="2">
  2156. {
  2157. <div>
  2158. <div className="clearfix">
  2159. <FormItem
  2160. className="half-item"
  2161. {...formItemLayout}
  2162. label="客户名称"
  2163. >
  2164. <span>{this.state.userName}</span>
  2165. </FormItem>
  2166. </div>
  2167. <div className="clearfix">
  2168. <FormItem
  2169. className="half-item"
  2170. {...formItemLayout}
  2171. label="合同编号"
  2172. >
  2173. <span>{this.state.contractNo}</span>
  2174. </FormItem>
  2175. </div>
  2176. <div className="clearfix">
  2177. <FormItem
  2178. className="half-item"
  2179. {...formItemLayout}
  2180. label="申请变更部门"
  2181. >
  2182. {!this.state.mark ? (
  2183. <Select
  2184. placeholder="请输入变更部门"
  2185. style={{ width: 240 }}
  2186. value={this.state.depName}
  2187. onChange={e => {
  2188. this.setState({ depName: e });
  2189. // console.log("5454", e);
  2190. }}
  2191. >
  2192. {departmentArr.map(function(item) {
  2193. return (
  2194. <Select.Option
  2195. key={item.id}
  2196. value={item.name}
  2197. >
  2198. {item.name}
  2199. </Select.Option>
  2200. );
  2201. })}
  2202. </Select>
  2203. ) : (
  2204. <span>{contractData.depName}</span>
  2205. )}
  2206. </FormItem>
  2207. <FormItem
  2208. className="half-item"
  2209. {...formItemLayout}
  2210. label="申请人"
  2211. >
  2212. {!this.state.mark ? (
  2213. <Input
  2214. placeholder="请输入申请人"
  2215. ref="signTotalAmount"
  2216. value={this.state.salesmanName}
  2217. onChange={e => {
  2218. this.setState({
  2219. salesmanName: e.target.value
  2220. });
  2221. }}
  2222. style={{ width: "240px" }}
  2223. />
  2224. ) : (
  2225. <span>{contractData.applicant}</span>
  2226. )}
  2227. </FormItem>
  2228. </div>
  2229. <div className="clearfix">
  2230. <FormItem
  2231. labelCol={{ span: 4 }}
  2232. wrapperCol={{ span: 18 }}
  2233. label="变更类型"
  2234. >
  2235. {!this.state.mark ? (
  2236. <Select
  2237. placeholder="选择合同变更类型"
  2238. style={{ width: 200 }}
  2239. onChange={e => {
  2240. this.setState({
  2241. typeChange: e
  2242. });
  2243. }}
  2244. value={this.state.typeChange}
  2245. >
  2246. <Option value={0}>退单退款</Option>
  2247. <Option value={1}>项目及金额变更</Option>
  2248. <Option value={2}>仅项目变更</Option>
  2249. <Option value={3}>仅金额变更</Option>
  2250. <Option value={4}>重报</Option>
  2251. <Option value={5}>赠送</Option>
  2252. </Select>
  2253. ) : (
  2254. <span>
  2255. {getChangeType(contractData.type)}
  2256. </span>
  2257. )}
  2258. </FormItem>
  2259. </div>
  2260. <div className="clearfix">
  2261. <FormItem
  2262. labelCol={{ span: 4 }}
  2263. wrapperCol={{ span: 18 }}
  2264. label="合同额(万元)"
  2265. >
  2266. {!this.state.mark ? (
  2267. <Input
  2268. placeholder="请输入合同额"
  2269. ref="signTotalAmount"
  2270. value={this.state.totalAmount}
  2271. onChange={e => {
  2272. this.setState({
  2273. totalAmount: e.target.value
  2274. });
  2275. }}
  2276. style={{ width: "240px" }}
  2277. />
  2278. ) : (
  2279. <span>{contractData.totalAmount}</span>
  2280. )}
  2281. </FormItem>
  2282. <FormItem
  2283. labelCol={{ span: 4 }}
  2284. wrapperCol={{ span: 18 }}
  2285. label="已收款(万元)"
  2286. >
  2287. {!this.state.mark ? (
  2288. <Input
  2289. placeholder="请输入已收款"
  2290. ref="signTotalAmount"
  2291. value={this.state.settlementAmount}
  2292. onChange={e => {
  2293. this.setState({
  2294. settlementAmount: e.target.value
  2295. });
  2296. }}
  2297. style={{ width: "240px" }}
  2298. />
  2299. ) : (
  2300. <span>{contractData.settlementAmount}</span>
  2301. )}
  2302. </FormItem>
  2303. <FormItem
  2304. labelCol={{ span: 4 }}
  2305. wrapperCol={{ span: 18 }}
  2306. label="申请退款(万元)"
  2307. >
  2308. {!this.state.mark ? (
  2309. <Input
  2310. placeholder="请输入申请退款"
  2311. ref="signTotalAmount"
  2312. value={this.state.changeAmount}
  2313. onChange={e => {
  2314. this.setState({
  2315. changeAmount: e.target.value
  2316. });
  2317. }}
  2318. style={{ width: "240px" }}
  2319. />
  2320. ) : (
  2321. <span>{contractData.changeAmount}</span>
  2322. )}
  2323. </FormItem>
  2324. </div>
  2325. <div className="clearfix">
  2326. <FormItem
  2327. style={{ height: "auto" }}
  2328. labelCol={{ span: 4 }}
  2329. wrapperCol={{ span: 18 }}
  2330. label="变更原因"
  2331. >
  2332. {!this.state.mark ? (
  2333. <TextArea
  2334. rows={4}
  2335. placeholder="请输入变更原因"
  2336. ref="signTotalAmount"
  2337. style={{ width: "95%" }}
  2338. value={this.state.remarksC}
  2339. onChange={e => {
  2340. this.setState({
  2341. remarksC: e.target.value
  2342. });
  2343. }}
  2344. />
  2345. ) : (
  2346. <span>{contractData.remarks}</span>
  2347. )}
  2348. </FormItem>
  2349. </div>
  2350. {/*----- */}
  2351. <div className="clearfix">
  2352. <FormItem
  2353. style={{ height: "auto" }}
  2354. labelCol={{ span: 4 }}
  2355. wrapperCol={{ span: 18 }}
  2356. label="备注"
  2357. >
  2358. {!this.state.mark ? (
  2359. <TextArea
  2360. rows={4}
  2361. placeholder="请输入备注"
  2362. ref="signTotalAmount"
  2363. style={{ width: "95%" }}
  2364. value={this.state.startRemarks}
  2365. onChange={e => {
  2366. this.setState({
  2367. startRemarks: e.target.value
  2368. });
  2369. }}
  2370. />
  2371. ) : (
  2372. <span>{contractData.startRemarks}</span>
  2373. )}
  2374. </FormItem>
  2375. </div>
  2376. {/* ---- */}
  2377. <div className="clearfix">
  2378. <FormItem
  2379. labelCol={{ span: 4 }}
  2380. wrapperCol={{ span: 18 }}
  2381. label="变更凭证"
  2382. >
  2383. {!this.state.mark ? (
  2384. <PicturesWall
  2385. fileList={this.getVoucherUrl}
  2386. pictureUrl={this.state.voucherUrl}
  2387. url="/api/admin/orderChange/uploadFile"
  2388. sign="order_change_file"
  2389. />
  2390. ) : (
  2391. <div>
  2392. <Upload
  2393. className="demandDetailShow-upload"
  2394. listType="picture-card"
  2395. fileList={this.state.voucherUrl}
  2396. onPreview={file => {
  2397. this.setState({
  2398. previewImage:
  2399. file.url || file.thumbUrl,
  2400. previewVisible: true
  2401. });
  2402. }}
  2403. />
  2404. <Modal
  2405. maskClosable={false}
  2406. footer={null}
  2407. visible={this.state.previewVisible}
  2408. onCancel={() => {
  2409. this.setState({
  2410. previewVisible: false
  2411. });
  2412. }}
  2413. >
  2414. <img
  2415. alt=""
  2416. style={{ width: "100%" }}
  2417. src={this.state.previewImage || ""}
  2418. />
  2419. </Modal>
  2420. </div>
  2421. )}
  2422. <p>图片建议:要清晰。</p>
  2423. </FormItem>
  2424. </div>
  2425. {!this.state.mark ? (
  2426. <div className="clearfix">
  2427. <Button
  2428. type="primary"
  2429. style={{ float: "right", marginRight: 40 }}
  2430. onClick={this.changeApply}
  2431. >
  2432. 发起变更申请
  2433. </Button>
  2434. </div>
  2435. ) : (
  2436. ""
  2437. )}
  2438. </div>
  2439. }
  2440. </TabPane>
  2441. </Tabs>
  2442. )}
  2443. </div>
  2444. </Spin>
  2445. </Form>
  2446. </Modal>
  2447. <Modal
  2448. maskClosable={false}
  2449. visible={this.state.addnextVisible}
  2450. onOk={this.nextCancel}
  2451. onCancel={this.nextCancel}
  2452. width="800px"
  2453. title={this.state.addState ? "添加项目任务" : "项目任务详情"}
  2454. footer=""
  2455. className="admin-desc-content"
  2456. >
  2457. <Form
  2458. layout="horizontal"
  2459. onSubmit={this.nextSubmit}
  2460. id="demand-form"
  2461. >
  2462. <Spin spinning={this.state.loading}>
  2463. {this.state.addState ? (
  2464. <div className="clearfix">
  2465. <FormItem
  2466. className="half-item"
  2467. {...formItemLayout}
  2468. label="服务名称"
  2469. >
  2470. <AutoComplete
  2471. className="certain-category-search"
  2472. dropdownClassName="certain-category-search-dropdown"
  2473. dropdownMatchSelectWidth={false}
  2474. dropdownStyle={{ width: 200 }}
  2475. style={{ width: "200px" }}
  2476. dataSource={options}
  2477. placeholder="输入服务名称"
  2478. value={this.state.commodityName}
  2479. onChange={this.httpChange}
  2480. filterOption={true}
  2481. onSelect={this.selectAuto}
  2482. >
  2483. <Input />
  2484. </AutoComplete>
  2485. <span className="mandatory">*</span>
  2486. </FormItem>
  2487. <FormItem
  2488. className="half-item"
  2489. {...formItemLayout}
  2490. label="服务数量"
  2491. >
  2492. <Input
  2493. placeholder="请输入服务数量"
  2494. value={this.state.commodityQuantity}
  2495. style={{ width: "200px" }}
  2496. onChange={e => {
  2497. this.setState({ commodityQuantity: e.target.value });
  2498. }}
  2499. ref="commodityQuantity"
  2500. />
  2501. <span className="mandatory">*</span>
  2502. </FormItem>
  2503. <FormItem
  2504. className="half-item"
  2505. {...formItemLayout}
  2506. label="实签价格(万元)"
  2507. >
  2508. <Input
  2509. placeholder="请输入实签价格"
  2510. value={this.state.commodityPrice}
  2511. style={{ width: "200px" }}
  2512. onChange={e => {
  2513. this.setState({ commodityPrice: e.target.value });
  2514. }}
  2515. ref="commodityPrice"
  2516. />
  2517. <span className="mandatory">*</span>
  2518. </FormItem>
  2519. <FormItem
  2520. className="half-item"
  2521. {...formItemLayout}
  2522. label="主要业务"
  2523. >
  2524. <Select
  2525. placeholder="选择是否为主要业务"
  2526. style={{ width: "200px" }}
  2527. value={this.state.main}
  2528. onChange={e => {
  2529. this.setState({ main: e });
  2530. }}
  2531. >
  2532. {boutique.map(function(item) {
  2533. return (
  2534. <Select.Option key={item.value}>
  2535. {item.key}
  2536. </Select.Option>
  2537. );
  2538. })}
  2539. </Select>
  2540. <span className="mandatory">*</span>
  2541. </FormItem>
  2542. <div className="clearfix">
  2543. <FormItem
  2544. labelCol={{ span: 4 }}
  2545. wrapperCol={{ span: 16 }}
  2546. label="服务说明"
  2547. >
  2548. <Input
  2549. type="textarea"
  2550. placeholder="请输入服务说明"
  2551. value={this.state.taskComment}
  2552. onChange={e => {
  2553. this.setState({ taskComment: e.target.value });
  2554. }}
  2555. />
  2556. </FormItem>
  2557. </div>
  2558. <FormItem
  2559. wrapperCol={{ span: 12, offset: 4 }}
  2560. className="half-middle"
  2561. >
  2562. <Button
  2563. className="submitSave"
  2564. type="primary"
  2565. htmlType="submit"
  2566. >
  2567. 保存
  2568. </Button>
  2569. <Button
  2570. className="submitSave"
  2571. type="ghost"
  2572. onClick={this.nextCancel}
  2573. >
  2574. 取消
  2575. </Button>
  2576. </FormItem>
  2577. </div>
  2578. ) : (
  2579. <div className="clearfix">
  2580. {this.state.processStatus == 0 ? (
  2581. <div className="clearfix">
  2582. <FormItem
  2583. className="half-item"
  2584. {...formItemLayout}
  2585. label="项目名称"
  2586. >
  2587. <span>{this.state.commodityName}</span>
  2588. </FormItem>
  2589. <FormItem
  2590. className="half-item"
  2591. {...formItemLayout}
  2592. label="项目数量"
  2593. >
  2594. <Input
  2595. placeholder="请输入数量"
  2596. value={this.state.commodityQuantity}
  2597. style={{ width: "200px" }}
  2598. onChange={e => {
  2599. this.setState({
  2600. commodityQuantity: e.target.value
  2601. });
  2602. }}
  2603. />
  2604. <span className="mandatory">*</span>
  2605. </FormItem>
  2606. <FormItem
  2607. className="half-item"
  2608. {...formItemLayout}
  2609. label="金额(万元)"
  2610. >
  2611. <Input
  2612. placeholder="请输入签单金额"
  2613. value={this.state.commodityPrice}
  2614. style={{ width: "200px" }}
  2615. onChange={e => {
  2616. this.setState({ commodityPrice: e.target.value });
  2617. }}
  2618. />
  2619. <span className="mandatory">*</span>
  2620. </FormItem>
  2621. <FormItem
  2622. className="half-item"
  2623. {...formItemLayout}
  2624. label="主要项目"
  2625. >
  2626. <Select
  2627. placeholder="选择是否为主要业务"
  2628. style={{ width: "200px" }}
  2629. value={this.state.main}
  2630. onChange={e => {
  2631. this.setState({ main: e });
  2632. }}
  2633. >
  2634. {boutique.map(function(item) {
  2635. return (
  2636. <Select.Option key={item.value}>
  2637. {item.key}
  2638. </Select.Option>
  2639. );
  2640. })}
  2641. </Select>
  2642. <span className="mandatory">*</span>
  2643. </FormItem>
  2644. <div className="clearfix">
  2645. <FormItem
  2646. labelCol={{ span: 4 }}
  2647. wrapperCol={{ span: 16 }}
  2648. label="服务说明"
  2649. >
  2650. <Input
  2651. type="textarea"
  2652. placeholder="请输入服务说明"
  2653. value={this.state.taskComment}
  2654. onChange={e => {
  2655. this.setState({ taskComment: e.target.value });
  2656. }}
  2657. />
  2658. </FormItem>
  2659. </div>
  2660. <FormItem
  2661. wrapperCol={{ span: 12, offset: 4 }}
  2662. className="half-middle"
  2663. >
  2664. <Button
  2665. className="submitSave"
  2666. type="primary"
  2667. onClick={this.tabRowSave}
  2668. >
  2669. 保存
  2670. </Button>
  2671. <Button
  2672. className="submitSave"
  2673. type="ghost"
  2674. onClick={this.nextCancel}
  2675. >
  2676. 取消
  2677. </Button>
  2678. </FormItem>
  2679. </div>
  2680. ) : (
  2681. <div className="clearfix">
  2682. <FormItem
  2683. className="half-item"
  2684. {...formItemLayout}
  2685. label="项目名称"
  2686. >
  2687. <span>{this.state.commodityName}</span>
  2688. </FormItem>
  2689. <FormItem
  2690. className="half-item"
  2691. {...formItemLayout}
  2692. label="项目数量"
  2693. >
  2694. <span>{this.state.commodityQuantity}</span>
  2695. </FormItem>
  2696. <FormItem
  2697. className="half-item"
  2698. {...formItemLayout}
  2699. label="金额(万元)"
  2700. >
  2701. <span>{this.state.commodityPrice}</span>
  2702. </FormItem>
  2703. <FormItem
  2704. className="half-item"
  2705. {...formItemLayout}
  2706. label="主要项目"
  2707. >
  2708. <span>{getboutique(this.state.main)}</span>
  2709. </FormItem>
  2710. <div className="clearfix">
  2711. <FormItem
  2712. labelCol={{ span: 4 }}
  2713. wrapperCol={{ span: 16 }}
  2714. label="服务说明"
  2715. >
  2716. <span>{this.state.taskComment}</span>
  2717. </FormItem>
  2718. </div>
  2719. </div>
  2720. )}
  2721. </div>
  2722. )}
  2723. </Spin>
  2724. </Form>
  2725. </Modal>
  2726. <Modal
  2727. maskClosable={false}
  2728. visible={this.state.lookVisible}
  2729. onOk={this.noCancel}
  2730. onCancel={this.noCancel}
  2731. width="800px"
  2732. title={"退单申请"}
  2733. footer=""
  2734. className="admin-desc-content"
  2735. >
  2736. <Form layout="horizontal" id="demand-form">
  2737. <Spin spinning={this.state.loading}>
  2738. <div className="clearfix">
  2739. <FormItem
  2740. labelCol={{ span: 4 }}
  2741. wrapperCol={{ span: 16 }}
  2742. label="终止合同"
  2743. >
  2744. <Picture
  2745. fileList={e => {
  2746. this.setState({ contractUrl: e });
  2747. }}
  2748. pictureUrl={this.state.contractUrl}
  2749. visible={this.props.visible}
  2750. data={{
  2751. sign: "order_refund_file",
  2752. url: "/api/admin/newOrder/uploadRefundOrderFile",
  2753. number: 8
  2754. }}
  2755. />
  2756. </FormItem>
  2757. </div>
  2758. <div className="clearfix">
  2759. <FormItem
  2760. labelCol={{ span: 4 }}
  2761. wrapperCol={{ span: 16 }}
  2762. label="退单申请表"
  2763. >
  2764. <Picture
  2765. fileList={e => {
  2766. this.setState({ applicationUrl: e });
  2767. }}
  2768. pictureUrl={this.state.applicationUrl}
  2769. visible={this.props.visible}
  2770. data={{
  2771. sign: "order_refund_file",
  2772. url: "/api/admin/newOrder/uploadRefundOrderFile",
  2773. number: 8
  2774. }}
  2775. />
  2776. </FormItem>
  2777. </div>
  2778. <div className="clearfix">
  2779. <FormItem
  2780. labelCol={{ span: 4 }}
  2781. wrapperCol={{ span: 16 }}
  2782. label="退单理由"
  2783. >
  2784. <Input
  2785. type="textarea"
  2786. placeholder="请输入退单理由"
  2787. rows={4}
  2788. value={this.state.reason}
  2789. onChange={e => {
  2790. this.setState({ reason: e.target.value });
  2791. }}
  2792. />
  2793. </FormItem>
  2794. </div>
  2795. <div className="clearfix">
  2796. <Button
  2797. className="cancel"
  2798. type="primary"
  2799. onClick={this.tuidanOk}
  2800. style={{ marginLeft: "50px" }}
  2801. htmlType="submit"
  2802. >
  2803. 确定退单
  2804. </Button>
  2805. <Button
  2806. className="cancel"
  2807. type="ghost"
  2808. onClick={this.noCancel}
  2809. style={{ marginLeft: "50px" }}
  2810. >
  2811. 取消
  2812. </Button>
  2813. </div>
  2814. </Spin>
  2815. </Form>
  2816. </Modal>
  2817. <Modal
  2818. visible={this.state.rizhivisible}
  2819. className="admin-desc-content"
  2820. width="800px"
  2821. maskClosable={false}
  2822. title="订单日志"
  2823. footer={null}
  2824. onCancel={this.closeOrderLog}
  2825. >
  2826. <div className="patent-table">
  2827. <Spin spinning={this.state.loading}>
  2828. <Table
  2829. columns={this.state.columnsrizhi}
  2830. dataSource={this.state.dataSourcerizhi}
  2831. pagination={false}
  2832. />
  2833. </Spin>
  2834. </div>
  2835. </Modal>
  2836. </div>
  2837. );
  2838. }
  2839. })
  2840. );
  2841. export default Form.create()(NewService);