addService.jsx 107 KB

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