reject.jsx 85 KB

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