changeApply.js 85 KB

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