reject.jsx 95 KB

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