addorders.js 108 KB

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