changeApply.js 93 KB

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