addService.jsx 104 KB

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