addService.jsx 104 KB

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