reject.jsx 95 KB

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