changeApply.js 88 KB

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