changeApply.js 87 KB

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