reject.jsx 95 KB

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