addService.jsx 106 KB

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