changeApply.js 102 KB

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