addService.jsx 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete,DatePicker,Radio,Col} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import '../userMangagement.less';
  6. import moment from 'moment';
  7. import Picture from '@/manageCenter/publicComponent/picture';
  8. import {orderTypes,customerType,jiedian,tepi,boutique} from '../../../dataDic.js';
  9. import {splitUrl,beforeUploadFile,getProcessStatus,getLiquidationStatus,getboutique,getApprovedState,getjiedian,getCuikuan,getProjectStatus} from '../../../tools.js';
  10. const Option = AutoComplete.Option;
  11. //图片组件
  12. const PicturesWall = React.createClass({
  13. getInitialState() {
  14. return {
  15. previewVisible: false,
  16. previewImage: '',
  17. fileList: [],
  18. }
  19. },
  20. getDefaultProps(){
  21. return{
  22. changeClick:this.modifyChange
  23. }
  24. },
  25. handleCancel() {
  26. this.setState({ previewVisible: false })
  27. },
  28. handlePreview(file) {
  29. this.setState({
  30. previewImage: file.url || file.thumbUrl,
  31. previewVisible: true,
  32. });
  33. },
  34. handleChange(info) {
  35. let fileList = info.fileList;
  36. this.setState({ fileList });
  37. this.props.fileList(fileList);
  38. },
  39. componentWillReceiveProps(nextProps) {
  40. this.state.fileList = nextProps.pictureUrl;
  41. },
  42. render() {
  43. const { previewVisible, previewImage, fileList } = this.state;
  44. const uploadButton = (
  45. <div>
  46. <Icon type="plus" />
  47. <div className="ant-upload-text">点击上传</div>
  48. </div>
  49. );
  50. return (
  51. <div style={{display:"inline-block"}}>
  52. <Upload
  53. beforeUpload={beforeUploadFile}
  54. action={globalConfig.context + "/api/admin/order/uploadOrderImg"}
  55. data={{ 'sign': '' }}
  56. listType="picture-card"
  57. fileList={fileList}
  58. onPreview={this.handlePreview}
  59. onChange={this.handleChange} >
  60. {fileList.length >= 18 ? null : uploadButton}
  61. </Upload>
  62. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  63. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  64. </Modal>
  65. </div>
  66. );
  67. }
  68. });
  69. const NewService = Form.create()(React.createClass({
  70. //查看项目列表
  71. loadData(record) {
  72. this.state.data = [];
  73. this.setState({
  74. loading: true
  75. });
  76. $.ajax({
  77. method: "get",
  78. dataType: "json",
  79. crossDomain: false,
  80. url: globalConfig.context + '/api/admin/newOrder/getOrderTask',
  81. data: {
  82. orderNo:record?record.orderNo:this.props.datauser.orderNo
  83. },
  84. success: function (data) {
  85. let theArr = [];
  86. if (!data.data) {
  87. if (data.error && data.error.length) {
  88. message.warning(data.error[0].message);
  89. };
  90. } else {
  91. for (let i = 0; i < data.data.length; i++) {
  92. let thisdata = data.data[i];
  93. theArr.push({
  94. key: i,
  95. id:thisdata.id,
  96. orderNo:thisdata.orderNo,//订单编号
  97. commodityId:thisdata.commodityId,//项目ID
  98. commodityName:thisdata.commodityName,//项目名称
  99. cname:thisdata.cname,//项目类别
  100. commodityPrice:thisdata.commodityPrice,//项目价格
  101. commodityQuantity:thisdata.commodityQuantity,//项目数量
  102. main:thisdata.main,//是否为主要任务
  103. taskComment:thisdata.taskComment,//任务说明
  104. contacts:thisdata.contacts,//联系人
  105. contactsMobile:thisdata.contactsMobile,//联系人电话
  106. projectStatus:thisdata.projectStatus,//项目状态
  107. });
  108. };
  109. }
  110. this.departmentList()
  111. this.setState({
  112. dataSource: theArr,
  113. pagination: false,
  114. });
  115. }.bind(this),
  116. }).always(function () {
  117. this.setState({
  118. loading: false
  119. });
  120. }.bind(this));
  121. },
  122. //收款节点
  123. loadDatas(record) {
  124. this.state.data = [];
  125. this.setState({
  126. loading: true
  127. });
  128. $.ajax({
  129. method: "get",
  130. dataType: "json",
  131. crossDomain: false,
  132. url: globalConfig.context + '/api/admin/newOrder/selectOrderDun',
  133. data: {
  134. orderNo:record?record.orderNo:this.props.datauser.orderNo
  135. },
  136. success: function (data) {
  137. let theArr = [];
  138. if (!data.data) {
  139. if (data.error && data.error.length) {
  140. message.warning(data.error[0].message);
  141. };
  142. } else {
  143. for (let i = 0; i < data.data.length; i++) {
  144. let thisdata = data.data[i];
  145. theArr.push({
  146. key: i,
  147. id:thisdata.id,
  148. });
  149. };
  150. }
  151. this.setState({
  152. dataSource: theArr,
  153. pagination: false,
  154. });
  155. }.bind(this),
  156. }).always(function () {
  157. this.setState({
  158. loading: false
  159. });
  160. }.bind(this));
  161. },
  162. getInitialState() {
  163. return {
  164. loading: false,
  165. visible: false,
  166. orgCodeUrl:[],
  167. customerArr:[],
  168. bussStats:false,
  169. checkedKeys: [],
  170. lookflowList:[],
  171. contractUrl:[],
  172. applicationUrl:[],
  173. active:{
  174. applySign:false
  175. },
  176. lookState:false,
  177. signBillVisible:false,
  178. commod:'',
  179. columns: [
  180. {
  181. title: '业务项目名称',
  182. dataIndex: 'commodityName',
  183. key: 'commodityName'
  184. }, {
  185. title: '项目类别',
  186. dataIndex: 'cname',
  187. key: 'cname',
  188. },{
  189. title: '项目数量',
  190. dataIndex: 'commodityQuantity',
  191. key: 'commodityQuantity'
  192. }, {
  193. title: '金额(万元)',
  194. dataIndex: 'commodityPrice',
  195. key: 'commodityPrice'
  196. }, {
  197. title: '负责人',
  198. dataIndex: 'contacts',
  199. key: 'contacts'
  200. }, {
  201. title: '负责人电话',
  202. dataIndex: 'contactsMobile',
  203. key: 'contactsMobile'
  204. }, {
  205. title:'项目状态',
  206. dataIndex:'projectStatus',
  207. key: 'projectStatus',
  208. render:text=>{return getProjectStatus(text)}
  209. },{
  210. title: '主要项目',
  211. dataIndex: 'main',
  212. key: 'main',
  213. render:(text)=>{
  214. return (text?'是':'否')
  215. }
  216. }, {
  217. title: '项目说明',
  218. dataIndex: 'taskComment',
  219. key: 'taskComment',
  220. render:(text)=>{
  221. return (text&&text.length>8?text.substr(0,8)+'…':text)
  222. }
  223. }, {
  224. title: '操作',
  225. dataIndex: 'ABC',
  226. key: 'ABC',
  227. render: (text, record, index) => {
  228. return <div>
  229. {this.state.processStatus==0?<Popconfirm title="是否删除?" onConfirm={(e)=>{this.delectRow(record)}} okText="是" cancelText="否">
  230. <Button onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
  231. </Popconfirm>:""}
  232. </div>
  233. }
  234. }
  235. ],
  236. columnsrizhi:[
  237. {
  238. title:'流程',
  239. dataIndex: 'processName',
  240. key: 'processName'
  241. },
  242. {
  243. title:'操作人',
  244. dataIndex: 'adminName',
  245. key: 'adminName'
  246. },{
  247. title:'时间',
  248. dataIndex: 'createDate',
  249. key: 'createDate'
  250. }
  251. ],
  252. contactList:[],
  253. loading:false,
  254. ContactsLists: [{
  255. title: '催款科目',
  256. dataIndex: 'dunSubject',
  257. key: 'dunSubject',
  258. render: (text, record, index) => {
  259. return <div>
  260. {this.state.processStatus==0?<Select placeholder="请选择催款科目" value={record.dunSubject} style={{width:'150px'}}
  261. onChange={(e) => { record.dunSubject = e; this.setState({ contactList: this.state.contactList }); }}>
  262. {
  263. jiedian.map(function (item) {
  264. return <Select.Option key={item.value} >{item.key}</Select.Option>
  265. })
  266. }
  267. </Select>:getjiedian(text)}
  268. </div>
  269. }
  270. },{
  271. title: '金额(万)',
  272. dataIndex: 'money',
  273. key: 'money',
  274. render: (text, record, index) => {
  275. return <div>
  276. {this.state.processStatus==0?<Input value={record.money} placeholder="请输入金额(必填项)" key={record.id} required="required"
  277. onChange={(e) => { record.money = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>:<span>{text}</span>}
  278. </div>
  279. }
  280. }, {
  281. title: '催款状态',
  282. dataIndex: 'dunStatus',
  283. key: 'dunStatus',
  284. render:text=>{return getCuikuan(text)}
  285. },
  286. {
  287. title: '操作',
  288. dataIndex: 'dels',
  289. key: 'dels',
  290. render: (text, record, index) => {
  291. return <div>
  292. {this.state.processStatus==0?<Popconfirm title="是否删除?" onConfirm={(e)=>{this.confirmDelet(record)}} okText="删除" cancelText="不删除">
  293. <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
  294. </Popconfirm>
  295. :''}
  296. {!record.id&&(index==(this.state.contactList.length-1))?<Button type="primary" onClick={this.contactSave}>保存</Button>:''}
  297. </div>
  298. }
  299. }
  300. ],
  301. };
  302. },
  303. departmentList() {
  304. this.setState({
  305. loading: true
  306. });
  307. $.ajax({
  308. method: "get",
  309. dataType: "json",
  310. crossDomain: false,
  311. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  312. data: {
  313. },
  314. success: function(data) {
  315. let thedata = data.data;
  316. let theArr = [];
  317. if(!thedata) {
  318. if(data.error && data.error.length) {
  319. message.warning(data.error[0].message);
  320. };
  321. thedata = {};
  322. } else {
  323. thedata.map(function(item, index) {
  324. theArr.push({
  325. key: index,
  326. name: item.name,
  327. id: item.id,
  328. depNo: item.depNo
  329. })
  330. })
  331. }
  332. this.setState({
  333. departmentArr: theArr,
  334. })
  335. }.bind(this),
  336. }).always(function() {
  337. this.setState({
  338. loading: false
  339. });
  340. }.bind(this));
  341. },
  342. //新建订单、编辑订单保存
  343. handleSubmit(e) {
  344. e.preventDefault();
  345. let theorgCodeUrl = [];
  346. if (this.state.orgCodeUrl.length) {
  347. let picArr = [];
  348. this.state.orgCodeUrl.map(function (item) {
  349. if ( item.response && item.response.data && item.response.data.length ){
  350. picArr.push(item.response.data);
  351. }
  352. });
  353. theorgCodeUrl = picArr.join(",");
  354. };
  355. if(this.props.userDetaile){
  356. if(!this.state.totalAmount){
  357. message.warning('签单金额不能为空');
  358. this.refs.signFirstPayment.focus()
  359. return false;
  360. };
  361. if(!this.state.firstAmount){
  362. message.warning('首付金额不能为空');
  363. this.refs.signFirstPayment.focus()
  364. return false;
  365. };
  366. if(!theorgCodeUrl){
  367. message.warning('图片过大,上传失败');
  368. this.refs.signFirstPayment.focus()
  369. return false;
  370. };
  371. if(!this.state.signDate){
  372. message.warning('签单日期不能为空');
  373. this.refs.signFirstPayment.focus()
  374. return false;
  375. };
  376. if(!this.state.orderRemarks){
  377. message.warning('订单留言不能为空');
  378. this.refs.signFirstPayment.focus()
  379. return false;
  380. };
  381. }else{
  382. }
  383. this.setState({
  384. loading: true
  385. });
  386. let api=this.props.userDetaile?'/api/admin/newOrder/updateServiceOrderNew':'/api/admin/newOrder/createOrder';
  387. $.ajax({
  388. method: "POST",
  389. dataType: "json",
  390. crossDomain: false,
  391. url: globalConfig.context + api,
  392. data: !this.props.userDetaile?{
  393. uid:this.state.autoId,
  394. orderType:this.state.orderType,
  395. }:{
  396. orderNo: this.state.orderNo,//订单编号
  397. totalAmount: this.state.totalAmount,//总金额
  398. firstAmount: this.state.firstAmount,//首付
  399. isSubmit: this.state.isSubmit,//保存草稿还是提交
  400. signDate: this.state.signDate,//签单日期
  401. contacts: this.state.contacts,//企业负责人
  402. contactMobile: this.state.contactMobile,//负责人联系方式
  403. legalPerson: this.state.legalPerson,//企业法人
  404. legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
  405. approval: this.state.approval,//特批状态
  406. orderRemarks: this.state.orderRemarks,//订单备注
  407. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  408. orderDep:this.state.organizationSearch
  409. }
  410. }).done(function(data) {
  411. this.setState({
  412. loading: false
  413. });
  414. if(!data.error.length) {
  415. message.success('保存成功!');
  416. this.handleOk();
  417. if(this.state.autoId){
  418. this.loadData()
  419. };
  420. } else {
  421. message.warning(data.error[0].message);
  422. }
  423. }.bind(this));
  424. },
  425. //订单详情修改
  426. xiangqingClick(e) {
  427. e.preventDefault();
  428. this.setState({
  429. loading: true
  430. });
  431. $.ajax({
  432. url: globalConfig.context + '/api/admin/newOrder/updateServiceOrderNew',
  433. method: 'post',
  434. data: {
  435. orderNo: this.state.orderNo,//订单编号
  436. totalAmount: this.state.totalAmount,//总金额
  437. firstAmount: this.state.firstAmount,//首付
  438. isSubmit: this.state.isSubmit,//保存草稿还是提交
  439. signDate: this.state.selTime,//签单日期
  440. contacts: this.state.contacts,//企业负责人
  441. contactMobile: this.state.contactMobile,//负责人联系方式
  442. legalPerson: this.state.legalPerson,//企业法人
  443. legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
  444. approval: this.state.approval,//特批状态
  445. orderRemarks: this.state.orderRemarks,//订单备注
  446. }
  447. }).done(function(data) {
  448. this.setState({
  449. loading: false
  450. });
  451. if(!data.error.length) {
  452. message.success('保存成功!');
  453. this.loaduser();
  454. } else {
  455. message.warning(data.error[0].message);
  456. }
  457. }.bind(this));
  458. },
  459. //查看基本详情基本信息
  460. loaduser(record){
  461. this.state.orderList=[]
  462. $.ajax({
  463. method: "get",
  464. dataType: "json",
  465. crossDomain: false,
  466. url: globalConfig.context + '/api/admin/newOrder/getOrderNewDetail',
  467. data: {
  468. orderNo:record?record.orderNo:this.props.datauser.orderNo
  469. },
  470. success: function (data) {
  471. let thisData = data.data;
  472. if (!thisData) {
  473. if (data.error && data.error.length) {
  474. message.warning(data.error[0].message);
  475. };
  476. thisData = {};
  477. };
  478. this.setState({
  479. id:thisData.id,
  480. kehuId:thisData.buyerId,
  481. orderNo:thisData.orderNo,//订单编号
  482. orderType:thisData.orderType,//订单类型
  483. firstAmount:thisData.firstAmount,//首付金额
  484. totalAmount:thisData.totalAmount,//总金额
  485. settlementAmount:thisData.settlementAmount,//结算金额
  486. liquidationStatus:thisData.liquidationStatus,//清算状态
  487. processStatus:thisData.processStatus,//流程状态
  488. approval:thisData.approval.toString(),//特批状态
  489. orderRemarks:thisData.orderRemarks,//订单备注
  490. contractNo:thisData.contractNo,//合同编号
  491. contacts:thisData.contacts,//联系人
  492. contactMobile:thisData.contactMobile,//联系人电话
  493. legalPerson:thisData.legalPerson,//法人
  494. legalPersonTel:thisData.legalPersonTel,//法人电话
  495. contractNo:thisData.contractNo,//合同编号
  496. orgCodeUrl: thisData.contractPictureUrl ? splitUrl(thisData.contractPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],//图片地址
  497. signDate:thisData.signDate,//签单时间
  498. userName:thisData.userName,//客户名称
  499. salesmanName:thisData.salesmanName,//营销员名称
  500. salesmanMobile:thisData.salesmanMobile,//营销员电话
  501. financeName:thisData.financeName,//财务名称
  502. financeMobile:thisData.financeMobile,//财务电话
  503. contractNo:thisData.contractNo,//合同编号
  504. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  505. organizationSearch:thisData.orderDep,
  506. depName:thisData.depName
  507. });
  508. }.bind(this),
  509. }).always(function () {
  510. this.setState({
  511. loading: false
  512. });
  513. }.bind(this));
  514. },
  515. //查看催款节点
  516. loaduserss(record){
  517. this.state.orderList=[]
  518. this.setState({
  519. orderNoss:record?record.orderNo:this.props.datauser.orderNo,
  520. })
  521. $.ajax({
  522. method: "get",
  523. dataType: "json",
  524. crossDomain: false,
  525. url: globalConfig.context + '/api/admin/newOrder/selectOrderDun',
  526. data: {
  527. orderNo:record?record.orderNo:this.props.datauser.orderNo
  528. },
  529. success: function (data) {
  530. let theArr=[];
  531. let thisData=[];
  532. if (!thisData) {
  533. if (data.error && data.error.length) {
  534. message.warning(data.error[0].message);
  535. };
  536. thisData = {};
  537. }else{
  538. for(let i = 0; i < data.data.length; i++) {
  539. thisData= data.data[i];
  540. theArr.push({
  541. key:i,
  542. dunSubject:thisData.dunSubject?thisData.dunSubject.toString():"",//催款科目
  543. id:thisData.id,//节点Id
  544. money:thisData.money,//催款金额
  545. dunStatus:thisData.dunStatus,//催款状态
  546. orderNo:record?record.orderNo:this.props.datauser.orderNo,
  547. })
  548. }
  549. this.setState({
  550. contactList:theArr
  551. })
  552. };
  553. }.bind(this),
  554. }).always(function () {
  555. this.setState({
  556. loading: false
  557. });
  558. }.bind(this));
  559. },
  560. //催款节点保存
  561. contactSave(e) {
  562. if(this.state.contactList){
  563. let cuiData=this.state.contactList;
  564. for(var a=0;a<cuiData.length;a++){
  565. if(cuiData[a].money==''){
  566. message.warning('催款金额不能为空');
  567. this.refs.signFirstPayment.focus()
  568. return false;
  569. }else if(!cuiData[a].dunSubject){
  570. message.warning('催款科目不能为空');
  571. this.refs.signFirstPayment.focus()
  572. return false;
  573. }
  574. }
  575. };
  576. this.setState({
  577. loading: true
  578. });
  579. $.ajax({
  580. url: globalConfig.context + '/api/admin/newOrder/createOrderDun',
  581. method: 'post',
  582. data: {
  583. orderNo: this.state.orderNoss,
  584. orderDun: JSON.stringify(this.state.contactList)
  585. }
  586. }).done(function(data) {
  587. this.setState({
  588. loading: false
  589. });
  590. if(!data.error.length) {
  591. message.success('保存成功!');
  592. this.loaduserss();
  593. } else {
  594. message.warning(data.error[0].message);
  595. }
  596. }.bind(this));
  597. },
  598. //点击新增催款节点
  599. addcontact(record) {
  600. this.state.contactList.push({
  601. key:this.state.contactList.length,
  602. money: '',
  603. dunSubject:undefined,
  604. orderNo: this.state.orderNoss,
  605. dunTarget:this.state.kehuId,
  606. });
  607. this.setState({
  608. contactList: this.state.contactList
  609. })
  610. },
  611. //删除收款节点
  612. confirmDelet(index) {
  613. if(index.id){
  614. this.state.contactList.splice(index.key,1);
  615. this.setState({
  616. contactList: this.state.contactList
  617. })
  618. this.contactSave();
  619. }else{
  620. this.state.contactList.splice(index.key,1);
  621. this.setState({
  622. contactList: this.state.contactList
  623. })
  624. }
  625. },
  626. handleOk(e) {
  627. this.setState({
  628. visible: false,
  629. });
  630. this.props.closeDesc(false, true);
  631. },
  632. handleCancel(e) {
  633. if(this.state.orderType==undefined){
  634. return false;
  635. };
  636. if(!this.state.autoId){
  637. return false;
  638. };
  639. this.setState({
  640. visible: false,
  641. });
  642. this.props.closeDesc(false);
  643. },
  644. handleCancelclose(e){
  645. this.setState({
  646. visible: false,
  647. });
  648. this.props.closeDesc(false);
  649. },
  650. //点击签单
  651. handleCancels(e) {
  652. this.setState({
  653. isSubmit:1
  654. })
  655. },
  656. //点击签单
  657. handleCancelq(e) {
  658. this.setState({
  659. isSubmit:0
  660. })
  661. },
  662. //删除
  663. delectRow(record) {
  664. this.setState({
  665. loading: true
  666. });
  667. $.ajax({
  668. method: "post",
  669. dataType: "json",
  670. crossDomain: false,
  671. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  672. data: {
  673. id:record.id
  674. }
  675. }).done(function (data) {
  676. if (!data.error.length) {
  677. message.success('删除成功!');
  678. this.setState({
  679. loading: false,
  680. });
  681. //this.loaduser()
  682. this.loadData();
  683. } else {
  684. message.warning(data.error[0].message);
  685. };
  686. }.bind(this));
  687. },
  688. nextCancel() {
  689. this.setState({
  690. addnextVisible: false
  691. })
  692. },
  693. rizhi(){
  694. this.setState({
  695. loading:true
  696. })
  697. $.ajax({
  698. method: "get",
  699. dataType: "json",
  700. crossDomain: false,
  701. url: '/api/admin/newOrder/selectOrderLog',
  702. data: {
  703. orderNo:this.props.datauser.orderNo
  704. },
  705. success: function (data) {
  706. let theArr = [];
  707. let thisData = data.data;
  708. if (!thisData.length) {
  709. if (data.error && data.error.length) {
  710. message.warning(data.error[0].message);
  711. };
  712. thisData = {};
  713. }else{
  714. for(let i = 0; i < data.data.length; i++) {
  715. let thisdata = data.data[i];
  716. theArr.push({
  717. processName:thisdata.processName,
  718. adminName:thisdata.adminName,
  719. createDate:thisdata.createDate,
  720. });
  721. };
  722. };
  723. this.setState({
  724. dataSourcerizhi: theArr
  725. })
  726. }.bind(this),
  727. }).always(function () {
  728. this.setState({
  729. loading: false
  730. });
  731. }.bind(this));
  732. },
  733. //查看订单日志
  734. getOrderLog(){
  735. this.setState({
  736. rizhivisible:true
  737. })
  738. this.rizhi()
  739. },
  740. closeOrderLog(){
  741. this.setState({
  742. rizhivisible:false
  743. })
  744. },
  745. getOrgCodeUrl(e) {
  746. this.setState({ orgCodeUrl: e });
  747. },
  748. componentWillMount() {
  749. },
  750. //加载(自动补全)
  751. supervisor(e,state){ //客户名称与服务名称自动补全
  752. let api=state?'/api/admin/customer/getCustomerByName':'/api/admin/order/getBusinessProjectByName';
  753. $.ajax({
  754. method: "get",
  755. dataType: "json",
  756. crossDomain: false,
  757. url: globalConfig.context + api,
  758. data:state?{
  759. name:e,
  760. type:this.state.customType
  761. }:{
  762. businessName:e
  763. },
  764. success: function (data) {
  765. let thedata=data.data;
  766. if (!thedata) {
  767. if (data.error && data.error.length) {
  768. message.warning(data.error[0].message);
  769. };
  770. thedata = {};
  771. };
  772. this.setState({
  773. states:state,
  774. customerArr:thedata,
  775. });
  776. }.bind(this),
  777. }).always(function () {
  778. this.setState({
  779. loading: false
  780. });
  781. }.bind(this));
  782. },
  783. //上级主管输入框失去焦点是判断客户是否存在
  784. selectAuto(value){
  785. let kid=[];
  786. let fwList=this.state.customerArr;
  787. fwList.map(function(item){
  788. if(value==item.bname){
  789. kid=item
  790. }
  791. })
  792. this.setState({
  793. commodityName:value,
  794. gid:kid.id,
  795. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  796. commodityFirstPayment:kid.firstPayment==0?kid.firstPayment.toString():kid.firstPayment
  797. })
  798. },
  799. //客户
  800. selectAutoCUT(value){
  801. let autoIds;
  802. let fwList=this.state.customerArr;
  803. fwList.map(function(item){
  804. if(value==item.name){
  805. autoIds=item.id
  806. }
  807. })
  808. this.setState({
  809. customerName:value,
  810. autoId:autoIds
  811. })
  812. },
  813. //服务值改变时请求客户名称
  814. httpChange(e){
  815. this.state.gid='';
  816. if(e.length>=1){
  817. this.supervisor(e,false);
  818. }
  819. this.setState({
  820. commodityName:e
  821. })
  822. },
  823. //客户名称自动补全
  824. customerChange(e){
  825. if(this.state.customType){
  826. console.log(this.state.customType)
  827. this.state.autoId='';
  828. if(e.length>=2){
  829. this.supervisor(e,true);
  830. }
  831. this.setState({
  832. customerName:e
  833. })
  834. }else{
  835. this.setState({
  836. customerName:''
  837. })
  838. message.warning('客户所属类型必须指定')
  839. }
  840. },
  841. //点击添加项目明细
  842. addDetailed(){
  843. this.setState({
  844. gid:'',
  845. customerArr:[],
  846. commodityName:'',
  847. commodityQuantity:'',
  848. commodityId:'',
  849. taskComment:'',
  850. main:undefined,
  851. commodityPrice:'',
  852. addState:1,
  853. addnextVisible: true
  854. })
  855. },
  856. //新建项目明细保存
  857. nextSubmit(e) {
  858. e.preventDefault();
  859. if(this.state.gid==undefined||!this.state.gid){
  860. message.warning('服务名称不匹配!');
  861. return false;
  862. };
  863. if(!this.state.commodityPrice){
  864. message.warning('请输入金额!');
  865. this.refs.commodityPrice.focus();
  866. return false;
  867. };
  868. if(!this.state.commodityQuantity){
  869. message.warning('请输入商品数量!');
  870. this.refs.commodityQuantity.focus();
  871. return false;
  872. };
  873. if(!this.state.main){
  874. message.warning('请选择是否为主要项目!');
  875. this.refs.commodityQuantity.focus();
  876. return false;
  877. };
  878. this.setState({
  879. loading: true
  880. });
  881. let api=this.state.addState?'/api/admin/newOrder/addOrderTask':'/api/bianji';
  882. $.ajax({
  883. method: "POST",
  884. dataType: "json",
  885. crossDomain: false,
  886. url: globalConfig.context +api ,
  887. data: {
  888. commodityId:this.state.gid,//商品ID
  889. orderNo:this.props.datauser.orderNo,//订单编号
  890. commodityName:this.state.commodityName,//商品名称
  891. commodityQuantity:this.state.commodityQuantity,//商品数量
  892. commodityPrice:this.state.commodityPrice,//签单总价
  893. taskComment:this.state.taskComment,//服务说明
  894. main:this.state.main,//是否为主要项目
  895. }
  896. }).done(function(data) {
  897. this.setState({
  898. loading: false
  899. });
  900. if(!data.error.length) {
  901. message.success('保存成功!');
  902. this.nextCancel()
  903. //this.loaduser(this.props.datauser);
  904. this.loadData();
  905. } else {
  906. message.warning(data.error[0].message);
  907. }
  908. }.bind(this));
  909. },
  910. //点击打卡项目详情
  911. tableRowClick(record, index) {
  912. this.setState({
  913. jid:record.id,//项目ID
  914. kid:record.commodityId,//商品ID
  915. commodityName:record.commodityName,//金额
  916. commodityPrice:record.commodityPrice,//金额
  917. commodityQuantity:record.commodityQuantity,//数量
  918. taskComment:record.taskComment,//备注
  919. main:record.main.toString(),//是否为主要
  920. addnextVisible:true,
  921. addState:0,
  922. });
  923. },
  924. //修改项目详情
  925. tabRowSave(e){
  926. e.preventDefault();
  927. if(!this.state.commodityPrice){
  928. message.warning('金额不能为空!');
  929. return false;
  930. };
  931. if(!this.state.commodityQuantity){
  932. message.warning('数量不能为空!');
  933. return false;
  934. };
  935. if(!this.state.main){
  936. message.warning('请选择是否为主要项目!');
  937. this.refs.commodityQuantity.focus();
  938. return false;
  939. };
  940. $.ajax({
  941. method: "POST",
  942. dataType: "json",
  943. crossDomain: false,
  944. url: globalConfig.context +'/api/admin/newOrder/updateOrderTask' ,
  945. data: {
  946. id:this.state.jid,//项目ID
  947. commodityId:this.state.kid,//商品ID
  948. orderNo:this.props.datauser.orderNo,//订单编号
  949. main:this.state.main,//是否为主要
  950. commodityPrice:this.state.commodityPrice,//金额
  951. commodityQuantity:this.state.commodityQuantity,//数量
  952. taskComment:this.state.taskComment//备注
  953. }
  954. }).done(function(data) {
  955. this.setState({
  956. loading: false
  957. });
  958. if(!data.error.length) {
  959. message.success('保存成功!');
  960. this.nextCancel()
  961. //this.loaduser(this.props.datauser);
  962. this.loadData();
  963. } else {
  964. message.warning(data.error[0].message);
  965. }
  966. }.bind(this));
  967. },
  968. //签单时间选择
  969. selTime(e,index){
  970. this.setState({
  971. entryTime:e,
  972. signDate:e,
  973. selTime:index
  974. })
  975. },
  976. //退单操作
  977. //点击退单
  978. tuikuan(){
  979. this.setState({
  980. lookVisible:true,
  981. contractUrl:[],
  982. applicationUrl:[],
  983. reason:''
  984. })
  985. },
  986. //关闭退单
  987. noCancel(){
  988. this.setState({
  989. lookVisible:false
  990. })
  991. },
  992. //点击确认退单
  993. tuidanOk(){
  994. let contractUrls = [];
  995. let applicationUrls = [];
  996. if (this.state.contractUrl.length) {
  997. let picArr = [];
  998. this.state.contractUrl.map(function (item) {
  999. if ( item.response && item.response.data && item.response.data.length ){
  1000. picArr.push(item.response.data);
  1001. }
  1002. });
  1003. contractUrls = picArr.join(",");
  1004. };
  1005. if (this.state.applicationUrl.length) {
  1006. let picArr = [];
  1007. this.state.applicationUrl.map(function (item) {
  1008. if ( item.response && item.response.data && item.response.data.length ){
  1009. picArr.push(item.response.data);
  1010. }
  1011. });
  1012. applicationUrls = picArr.join(",");
  1013. };
  1014. $.ajax({
  1015. method: "POST",
  1016. dataType: "json",
  1017. crossDomain: false,
  1018. url: globalConfig.context +'/api/admin/newOrder/addOrderRefund' ,
  1019. data: {
  1020. orderNo:this.state.orderNo,//订单编号
  1021. contractUrl:contractUrls.length?contractUrls:'',//终止合同
  1022. applicationUrl:applicationUrls.length?applicationUrls:'',//退单申请表
  1023. reason:this.state.reason,//退单原因
  1024. }
  1025. }).done(function(data) {
  1026. this.setState({
  1027. loading: false
  1028. });
  1029. if(!data.error.length) {
  1030. message.success('退单成功!');
  1031. this.noCancel();
  1032. this.handleCancelclose();
  1033. } else {
  1034. message.warning(data.error[0].message);
  1035. }
  1036. }.bind(this));
  1037. },
  1038. //开单选择订单类型骚操作
  1039. orderTypeFn(e){
  1040. if(e==0){
  1041. this.setState({
  1042. bussStats:true,
  1043. orderType:e
  1044. })
  1045. this.category();
  1046. }else{
  1047. this.setState({
  1048. contractType:undefined,
  1049. bussStats:false,
  1050. orderType:e
  1051. })
  1052. }
  1053. },
  1054. //品类数据获取
  1055. category(){
  1056. $.ajax({
  1057. method: "get",
  1058. dataType: "json",
  1059. crossDomain: false,
  1060. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  1061. data: {
  1062. },
  1063. success: function(data) {
  1064. let thedata = data.data;
  1065. let theArr=[];
  1066. if(!thedata) {
  1067. if(data.error && data.error.length) {
  1068. message.warning(data.error[0].message);
  1069. };
  1070. thedata = {};
  1071. }else{
  1072. thedata.map(function(item,index){
  1073. theArr.push({
  1074. key:index,
  1075. name:item.cname,
  1076. id:item.id,
  1077. })
  1078. })
  1079. }
  1080. this.setState({
  1081. contractType:undefined,
  1082. categoryArr:theArr,
  1083. })
  1084. }.bind(this),
  1085. });
  1086. },
  1087. componentWillReceiveProps(nextProps) { //props改变时触发
  1088. this.state.visible = nextProps.showDesc;
  1089. this.state.signBillVisible=nextProps.signBillVisible;
  1090. if(this.state.signBillVisible){
  1091. this.loaduser(nextProps.uid)
  1092. };
  1093. if(nextProps.userDetaile && nextProps.showDesc) {
  1094. this.loaduser(nextProps.datauser);
  1095. this.loaduserss(nextProps.datauser);
  1096. this.loadData(nextProps.datauser);
  1097. }else{
  1098. this.setState({
  1099. orderType:undefined,
  1100. customerName:'',
  1101. autoId:'',
  1102. customerArr:[],
  1103. contractType:undefined,
  1104. bussStats:false,
  1105. customType:undefined
  1106. })
  1107. }
  1108. },
  1109. render() {
  1110. const FormItem = Form.Item
  1111. const formItemLayout = {
  1112. labelCol: { span: 8 },
  1113. wrapperCol: { span: 14 },
  1114. };
  1115. const changeHtml=this.state.changeHtml ||[];
  1116. const categoryList=this.state.categoryArr ||[];
  1117. const orderDetaiel=this.state.orderList || [];
  1118. const dataSources=this.state.customerArr || [];
  1119. let departmentArr = this.state.departmentArr || [];
  1120. const options = this.state.states?dataSources.map((group,index) =>
  1121. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  1122. ):dataSources.map((group,index) =>
  1123. <Select.Option key={index} value={group.bname}>{group.bname}</Select.Option>
  1124. )
  1125. return(
  1126. <div>
  1127. <Modal maskClosable={false} visible={this.state.visible}
  1128. onOk={this.handleOk} onCancel={this.handleCancelclose}
  1129. width={!this.props.userDetaile?'600px':'900px'}
  1130. title={!this.props.userDetaile?'创建订单':'编辑订单'}
  1131. footer=''
  1132. className="admin-desc-content">
  1133. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form" style={{paddingBottom:'40px'}} >
  1134. <Spin spinning={this.state.loading}>
  1135. <div className="clearfix">
  1136. {!this.props.userDetaile?
  1137. <div className="clearfix">
  1138. <div className="clearfix">
  1139. <FormItem
  1140. {...formItemLayout}
  1141. label="订单类型" >
  1142. <Select placeholder="请选择订单类型"
  1143. style={{ width:'200px'}}
  1144. value={this.state.orderType}
  1145. onChange={(e)=>{this.setState({orderType:e})}}>
  1146. {
  1147. orderTypes.map(function (item) {
  1148. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1149. })
  1150. }
  1151. </Select>
  1152. <span className="mandatory">*</span>
  1153. </FormItem>
  1154. </div>
  1155. <FormItem
  1156. {...formItemLayout}
  1157. label="客户所属类型" >
  1158. <Select placeholder="请选择客户所属类型"
  1159. style={{ width:'200px'}}
  1160. value={this.state.customType}
  1161. onChange={(e)=>{this.setState({customType:e})}}>
  1162. {
  1163. customerType.map(function (item) {
  1164. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1165. })
  1166. }
  1167. </Select>
  1168. </FormItem>
  1169. <div className="clearfix">
  1170. <FormItem
  1171. {...formItemLayout}
  1172. label="客户名称" >
  1173. <AutoComplete
  1174. className="certain-category-search"
  1175. dropdownClassName="certain-category-search-dropdown"
  1176. dropdownMatchSelectWidth={false}
  1177. dropdownStyle={{ width: 200 }}
  1178. size="large"
  1179. style={{ width: '200px' }}
  1180. dataSource={options}
  1181. placeholder="输入名称"
  1182. value={this.state.customerName}
  1183. onChange={this.customerChange}
  1184. filterOption={true}
  1185. onSelect={this.selectAutoCUT}
  1186. >
  1187. <Input/>
  1188. </AutoComplete>
  1189. <span className="mandatory">*</span>
  1190. </FormItem>
  1191. </div>
  1192. <div className='addSave' style={{marginTop:'15px'}}>
  1193. <Button className="cancel" type="primary" onClick={this.handleCancel} style={{marginLeft:"150px"}} htmlType="submit">开单</Button>
  1194. <Button className="cancel" type="ghost" onClick={this.handleCancelclose} style={{marginLeft:"50px"}}>取消</Button>
  1195. </div>
  1196. </div>
  1197. :<div className="clearfix">
  1198. <FormItem className="half-item"
  1199. {...formItemLayout}
  1200. label="订单编号" >
  1201. <span>{this.state.orderNo}</span>
  1202. </FormItem>
  1203. <FormItem className="half-item"
  1204. {...formItemLayout}
  1205. label="合同编号" >
  1206. {<span>{this.state.contractNo}</span>}
  1207. </FormItem>
  1208. <FormItem className="half-item"
  1209. {...formItemLayout}
  1210. label="客户名称" >
  1211. <span>{this.state.userName}</span>
  1212. </FormItem>
  1213. <FormItem className="half-item"
  1214. {...formItemLayout}
  1215. label="流程状态" >
  1216. <span>{getProcessStatus(this.state.processStatus)}</span>
  1217. </FormItem>
  1218. <FormItem className="half-item"
  1219. {...formItemLayout}
  1220. label="结算状态" >
  1221. <span>{getLiquidationStatus(this.state.liquidationStatus)}</span>
  1222. </FormItem>
  1223. <FormItem className="half-item"
  1224. {...formItemLayout}
  1225. label="已收款项" >
  1226. <span>{this.state.settlementAmount+'万元'}</span>
  1227. {this.state.settlementAmount?<Button type='primary' onClick={this.tuikuan} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>退单</Button>:''}
  1228. </FormItem>
  1229. {this.state.processStatus==0?
  1230. <div className='clearfix'>
  1231. <FormItem className="half-item"
  1232. {...formItemLayout}
  1233. label="企业联系人" >
  1234. <Input placeholder="请输入联系人" ref='signTotalAmount' value={this.state.contacts} onChange={(e)=>{this.setState({contacts:e.target.value})}} style={{width:'240px'}} />
  1235. </FormItem>
  1236. <FormItem className="half-item"
  1237. {...formItemLayout}
  1238. label="联系人电话" >
  1239. <Input placeholder="请输入联系人电话" ref='signTotalAmount' value={this.state.contactMobile} onChange={(e)=>{this.setState({contactMobile:e.target.value})}} style={{width:'240px'}} />
  1240. </FormItem>
  1241. <FormItem className="half-item"
  1242. {...formItemLayout}
  1243. label="企业法人" >
  1244. <Input placeholder="请输入法人" ref='signTotalAmount' value={this.state.legalPerson} onChange={(e)=>{this.setState({legalPerson:e.target.value})}} style={{width:'240px'}} />
  1245. </FormItem>
  1246. <FormItem className="half-item"
  1247. {...formItemLayout}
  1248. label="法人电话" >
  1249. <Input placeholder="请输入法人电话" ref='signTotalAmount' value={this.state.legalPersonTel} onChange={(e)=>{this.setState({legalPersonTel:e.target.value})}} style={{width:'240px'}} />
  1250. </FormItem>
  1251. <FormItem className="half-item"
  1252. {...formItemLayout}
  1253. label="签单金额(万元)" >
  1254. <Input placeholder="签单金额" ref='signTotalAmount' value={this.state.totalAmount} onChange={(e)=>{this.setState({totalAmount:e.target.value})}} style={{width:'240px'}} />
  1255. <span className="mandatory">*</span>
  1256. </FormItem>
  1257. <FormItem className="half-item"
  1258. {...formItemLayout}
  1259. label="首付金额(万元)" >
  1260. <Input placeholder="请输入实签首款金额" ref='signFirstPayment' value={this.state.firstAmount} onChange={(e)=>{this.setState({firstAmount:e.target.value})}} style={{width:'240px'}} />
  1261. <span className="mandatory">*</span>
  1262. </FormItem>
  1263. <FormItem className="half-item"
  1264. {...formItemLayout}
  1265. label="特批立项" >
  1266. <Select placeholder="请选择客户所属类型"
  1267. style={{ width:'240px'}}
  1268. value={this.state.approval}
  1269. onChange={(e)=>{this.setState({approval:e})}}>
  1270. {
  1271. tepi.map(function (item) {
  1272. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1273. })
  1274. }
  1275. </Select>
  1276. </FormItem>
  1277. <FormItem className="half-item" {...formItemLayout} label="合同签订时间">
  1278. <DatePicker
  1279. style={{marginTop:"2px",width: '240px',height:"32px" }}
  1280. showTime
  1281. format="YYYY-MM-DD"
  1282. onOk={(e)=>{}}
  1283. value={this.state.signDate ? moment(this.state.signDate) : null}
  1284. onChange={(data, dataString) => { this.setState({ signDate: dataString }); }} />
  1285. <span className="mandatory">*</span>
  1286. </FormItem>
  1287. <FormItem className="half-item"
  1288. {...formItemLayout}
  1289. label="订单部门" >
  1290. <Select placeholder="请输入订单部门"
  1291. style={{ width: 240 }}
  1292. value={this.state.organizationSearch}
  1293. onChange={(e) => { this.setState({ organizationSearch: e }) ; console.log(this.state.organizationSearch)}}>
  1294. {
  1295. departmentArr.map(function (item) {
  1296. return <Select.Option key={item.id} >{item.name}</Select.Option>
  1297. })
  1298. }
  1299. </Select>
  1300. </FormItem>
  1301. </div>
  1302. :
  1303. <div className='clearfix'>
  1304. <FormItem className="half-item"
  1305. {...formItemLayout}
  1306. label="企业联系人" >
  1307. <span>{this.state.contacts}</span>
  1308. </FormItem>
  1309. <FormItem className="half-item"
  1310. {...formItemLayout}
  1311. label="联系人电话" >
  1312. <span>{this.state.contactMobile}</span>
  1313. </FormItem>
  1314. <FormItem className="half-item"
  1315. {...formItemLayout}
  1316. label="企业法人" >
  1317. <span>{this.state.legalPerson}</span>
  1318. </FormItem>
  1319. <FormItem className="half-item"
  1320. {...formItemLayout}
  1321. label="法人电话" >
  1322. <span>{this.state.legalPersonTel}</span>
  1323. </FormItem>
  1324. <FormItem className="half-item"
  1325. {...formItemLayout}
  1326. label="签单金额(万元)" >
  1327. <span>{this.state.totalAmount}</span>
  1328. </FormItem>
  1329. <FormItem className="half-item"
  1330. {...formItemLayout}
  1331. label="首付金额(万元)" >
  1332. <span>{this.state.firstAmount}</span>
  1333. </FormItem>
  1334. <FormItem className="half-item"
  1335. {...formItemLayout}
  1336. label="特批立项" >
  1337. <span>{getApprovedState(this.state.approval)}</span>
  1338. </FormItem>
  1339. <FormItem className="half-item"
  1340. {...formItemLayout}
  1341. label="合同签订时间" >
  1342. <span>{this.state.signDate}</span>
  1343. </FormItem>
  1344. <FormItem className="half-item"
  1345. {...formItemLayout}
  1346. label="订单部门" >
  1347. <span>{this.state.depName}</span>
  1348. </FormItem>
  1349. </div>}
  1350. <div className='clearfix'>
  1351. {this.state.processStatus==0?
  1352. <FormItem
  1353. labelCol={{ span: 4 }}
  1354. wrapperCol={{ span: 18 }}
  1355. label={
  1356. <span>
  1357. <strong style={{ color: '#f00' }}>*</strong>合同扫描件
  1358. </span>
  1359. }
  1360. >
  1361. <PicturesWall
  1362. fileList={this.getOrgCodeUrl}
  1363. pictureUrl={this.state.orgCodeUrl} />
  1364. <p>图片建议:要清晰。</p>
  1365. <Button style={{ float:"right" , marginRight:'140px' , marginTop:'20px'}}
  1366. onClick={this.getOrderLog}
  1367. >查看订单 日志</Button>
  1368. </FormItem>:
  1369. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 18 }} label="合同扫描件">
  1370. <Upload className="demandDetailShow-upload"
  1371. listType="picture-card"
  1372. fileList={this.state.orgCodeUrl}
  1373. onPreview={(file) => {
  1374. this.setState({
  1375. previewImage: file.url || file.thumbUrl,
  1376. previewVisible: true,
  1377. });
  1378. }} >
  1379. </Upload>
  1380. <Modal maskClosable={false} footer={null}
  1381. visible={this.state.previewVisible}
  1382. onCancel={() => { this.setState({ previewVisible: false }) }}>
  1383. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  1384. </Modal>
  1385. <Button style={{ float:"right" , marginRight:'140px' , marginTop:'20px'}}
  1386. onClick={this.getOrderLog}
  1387. >查看订单 日志</Button>
  1388. </FormItem>}
  1389. </div>
  1390. <div className='clearfix'>
  1391. {this.state.processStatus==0?
  1392. <div className='clearfix'>
  1393. <FormItem
  1394. labelCol={{ span: 4 }}
  1395. wrapperCol={{ span: 16 }}
  1396. label="订单留言" >
  1397. <Input type="textarea" placeholder="请输入订单留言" rows={4} value={this.state.orderRemarks}
  1398. onChange={(e)=>{this.setState({orderRemarks:e.target.value})}} style={{width:'95%'}}/>
  1399. <span className="mandatory">*</span>
  1400. </FormItem>
  1401. </div>
  1402. :
  1403. <FormItem
  1404. labelCol={{ span: 4 }}
  1405. wrapperCol={{ span: 16 }}
  1406. label="订单留言" >
  1407. <span>{this.state.orderRemarks}</span>
  1408. </FormItem>}
  1409. </div>
  1410. <div className='clearfix'>
  1411. <FormItem className="half-item"
  1412. {...formItemLayout}
  1413. label="订单负责人" >
  1414. <span>{this.state.salesmanName}</span>
  1415. </FormItem>
  1416. <FormItem className="half-item"
  1417. {...formItemLayout}
  1418. label="订单负责人电话" >
  1419. <span>{this.state.salesmanMobile}</span>
  1420. </FormItem>
  1421. </div>
  1422. <div className='clearfix'>
  1423. <FormItem className="half-item"
  1424. {...formItemLayout}
  1425. label="财务负责人" >
  1426. <span>{this.state.financeName}</span>
  1427. </FormItem>
  1428. <FormItem className="half-item"
  1429. {...formItemLayout}
  1430. label="财务负责人电话" >
  1431. <span>{this.state.financeMobile}</span>
  1432. </FormItem>
  1433. </div>
  1434. <div>
  1435. <span style={{marginLeft:'50px',fontSize:'20px'}}>催款节点</span>
  1436. {this.state.processStatus==0?<Button type='primary' onClick={this.addcontact} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加催款节点</Button>:""}
  1437. </div>
  1438. <div className="clearfix">
  1439. <Spin spinning={this.state.loading}>
  1440. <Form layout="horizontal" id="demand-form" >
  1441. <Table
  1442. pagination={false}
  1443. columns={this.state.ContactsLists}
  1444. dataSource={this.state.contactList}
  1445. />
  1446. <Col span={24} offset={9} style={{marginTop:'15px'}}>
  1447. </Col>
  1448. </Form>
  1449. </Spin>
  1450. </div>
  1451. <div>
  1452. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  1453. {this.state.processStatus==0?<Button type='primary' onClick={this.addDetailed} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加项目明细</Button>:""}
  1454. </div>
  1455. <div className="patent-table">
  1456. <Spin spinning={this.state.loading}>
  1457. <Table columns={this.state.columns}
  1458. dataSource={this.state.dataSource}
  1459. pagination={this.state.pagination}
  1460. onRowClick={this.tableRowClick}
  1461. />
  1462. </Spin>
  1463. </div>
  1464. {this.state.processStatus==0?
  1465. <div className='addSave' style={{marginTop:'15px'}}>
  1466. <Button className="cancel" type="primary" onClick={this.handleCancels} style={{marginLeft:"200px"}} htmlType="submit">签单</Button>
  1467. <Button className="cancel" type="primary" onClick={this.handleCancelq} style={{marginLeft:"50px"}} htmlType="submit">保存</Button>
  1468. <Button className="cancel" type="ghost" onClick={this.handleCancelclose} style={{marginLeft:"50px"}}>取消</Button>
  1469. </div>:""}
  1470. </div>}
  1471. </div>
  1472. </Spin>
  1473. </Form >
  1474. </Modal>
  1475. <Modal maskClosable={false} visible={this.state.addnextVisible}
  1476. onOk={this.nextCancel} onCancel={this.nextCancel}
  1477. width='800px'
  1478. title={this.state.addState?'添加项目任务':'项目任务详情'}
  1479. footer=''
  1480. className="admin-desc-content">
  1481. <Form layout="horizontal" onSubmit={this.nextSubmit} id="demand-form">
  1482. <Spin spinning={this.state.loading}>
  1483. {this.state.addState?<div className="clearfix">
  1484. <FormItem className="half-item"
  1485. {...formItemLayout}
  1486. label="服务名称" >
  1487. <AutoComplete
  1488. className="certain-category-search"
  1489. dropdownClassName="certain-category-search-dropdown"
  1490. dropdownMatchSelectWidth={false}
  1491. dropdownStyle={{ width: 200 }}
  1492. style={{ width: '200px' }}
  1493. dataSource={options}
  1494. placeholder="输入服务名称"
  1495. value={this.state.commodityName}
  1496. onChange={this.httpChange}
  1497. filterOption={true}
  1498. onSelect={this.selectAuto}
  1499. >
  1500. <Input/>
  1501. </AutoComplete>
  1502. <span className="mandatory">*</span>
  1503. </FormItem>
  1504. <FormItem className="half-item"
  1505. {...formItemLayout}
  1506. label="服务数量" >
  1507. <Input placeholder="请输入服务数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1508. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} ref="commodityQuantity"/>
  1509. <span className="mandatory">*</span>
  1510. </FormItem>
  1511. <FormItem className="half-item"
  1512. {...formItemLayout}
  1513. label="实签价格(万元)" >
  1514. <Input placeholder="请输入实签价格" value={this.state.commodityPrice} style={{width:'200px'}}
  1515. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} ref="commodityPrice"/>
  1516. <span className="mandatory">*</span>
  1517. </FormItem>
  1518. <FormItem className="half-item"
  1519. {...formItemLayout}
  1520. label="主要业务" >
  1521. <Select placeholder="选择是否为主要业务"
  1522. style={{ width:'200px'}}
  1523. value={this.state.main}
  1524. onChange={(e)=>{this.setState({main:e})}}>
  1525. {
  1526. boutique.map(function (item) {
  1527. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1528. })
  1529. }
  1530. </Select>
  1531. <span className="mandatory">*</span>
  1532. </FormItem>
  1533. <div className='clearfix'>
  1534. <FormItem
  1535. labelCol={{ span: 4 }}
  1536. wrapperCol={{ span: 16 }}
  1537. label="服务说明" >
  1538. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1539. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1540. </FormItem>
  1541. </div>
  1542. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1543. <Button className="submitSave" type="primary" htmlType="submit">保存</Button>
  1544. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1545. </FormItem>
  1546. </div>:
  1547. <div className="clearfix">
  1548. {this.state.processStatus==0?
  1549. <div className='clearfix'>
  1550. <FormItem className="half-item"
  1551. {...formItemLayout}
  1552. label="项目名称" >
  1553. <span>{this.state.commodityName}</span>
  1554. </FormItem>
  1555. <FormItem className="half-item"
  1556. {...formItemLayout}
  1557. label="项目数量" >
  1558. <Input placeholder="请输入数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1559. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} />
  1560. <span className="mandatory">*</span>
  1561. </FormItem>
  1562. <FormItem className="half-item"
  1563. {...formItemLayout}
  1564. label="金额(万元)" >
  1565. <Input placeholder="请输入签单金额" value={this.state.commodityPrice} style={{width:'200px'}}
  1566. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} />
  1567. <span className="mandatory">*</span>
  1568. </FormItem>
  1569. <FormItem className="half-item"
  1570. {...formItemLayout}
  1571. label="主要项目" >
  1572. <Select placeholder="选择是否为主要业务"
  1573. style={{ width:'200px'}}
  1574. value={this.state.main}
  1575. onChange={(e)=>{this.setState({main:e})}}>
  1576. {
  1577. boutique.map(function (item) {
  1578. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1579. })
  1580. }
  1581. </Select>
  1582. <span className="mandatory">*</span>
  1583. </FormItem>
  1584. <div className='clearfix'>
  1585. <FormItem
  1586. labelCol={{ span: 4 }}
  1587. wrapperCol={{ span: 16 }}
  1588. label="服务说明" >
  1589. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1590. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1591. </FormItem>
  1592. </div>
  1593. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1594. <Button className="submitSave" type="primary" onClick={this.tabRowSave}>保存</Button>
  1595. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1596. </FormItem>
  1597. </div>:<div className='clearfix'>
  1598. <FormItem className="half-item"
  1599. {...formItemLayout}
  1600. label="项目名称" >
  1601. <span>{this.state.commodityName}</span>
  1602. </FormItem>
  1603. <FormItem className="half-item"
  1604. {...formItemLayout}
  1605. label="项目数量" >
  1606. <span>{this.state.commodityQuantity}</span>
  1607. </FormItem>
  1608. <FormItem className="half-item"
  1609. {...formItemLayout}
  1610. label="金额(万元)" >
  1611. <span>{this.state.commodityPrice}</span>
  1612. </FormItem>
  1613. <FormItem className="half-item"
  1614. {...formItemLayout}
  1615. label="主要项目" >
  1616. <span>{getboutique(this.state.main)}</span>
  1617. </FormItem>
  1618. <div className='clearfix'>
  1619. <FormItem
  1620. labelCol={{ span: 4 }}
  1621. wrapperCol={{ span: 16 }}
  1622. label="服务说明" >
  1623. <span>{this.state.taskComment}</span>
  1624. </FormItem>
  1625. </div>
  1626. </div>
  1627. }
  1628. </div>
  1629. }
  1630. </Spin>
  1631. </Form >
  1632. </Modal>
  1633. <Modal maskClosable={false} visible={this.state.lookVisible}
  1634. onOk={this.noCancel} onCancel={this.noCancel}
  1635. width='800px'
  1636. title={'退单申请'}
  1637. footer=''
  1638. className="admin-desc-content">
  1639. <Form layout="horizontal" id="demand-form">
  1640. <Spin spinning={this.state.loading}>
  1641. <div className='clearfix'>
  1642. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 16 }} label="终止合同">
  1643. <Picture
  1644. fileList={(e)=>{this.setState({contractUrl:e})}}
  1645. pictureUrl={this.state.contractUrl}
  1646. visible={this.props.visible}
  1647. data={{'sign':'order_refund_file',url:'/api/admin/newOrder/uploadRefundOrderFile',number:8}}
  1648. />
  1649. </FormItem>
  1650. </div>
  1651. <div className='clearfix'>
  1652. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 16 }} label="退单申请表">
  1653. <Picture
  1654. fileList={(e)=>{this.setState({applicationUrl:e})}}
  1655. pictureUrl={this.state.applicationUrl}
  1656. visible={this.props.visible}
  1657. data={{'sign':'order_refund_file',url:'/api/admin/newOrder/uploadRefundOrderFile',number:8}}
  1658. />
  1659. </FormItem>
  1660. </div>
  1661. <div className='clearfix'>
  1662. <FormItem
  1663. labelCol={{ span: 4 }}
  1664. wrapperCol={{ span: 16 }}
  1665. label="退单理由" >
  1666. <Input type="textarea" placeholder="请输入退单理由" rows={4} value={this.state.reason}
  1667. onChange={(e)=>{this.setState({reason:e.target.value})}}/>
  1668. </FormItem>
  1669. </div>
  1670. <div className='clearfix'>
  1671. <Button className="cancel" type="primary" onClick={this.tuidanOk} style={{marginLeft:"50px"}} htmlType="submit">确定退单</Button>
  1672. <Button className="cancel" type="ghost" onClick={this.noCancel} style={{marginLeft:"50px"}}>取消</Button>
  1673. </div>
  1674. </Spin>
  1675. </Form >
  1676. </Modal>
  1677. <Modal visible={this.state.rizhivisible}
  1678. className="admin-desc-content"
  1679. width='800px'
  1680. maskClosable={false}
  1681. title='订单日志'
  1682. footer={null}
  1683. onCancel={this.closeOrderLog}>
  1684. <div className="patent-table">
  1685. <Spin spinning={this.state.loading}>
  1686. <Table columns={this.state.columnsrizhi}
  1687. dataSource={this.state.dataSourcerizhi}
  1688. pagination={false}
  1689. />
  1690. </Spin>
  1691. </div>
  1692. </Modal>
  1693. </div>
  1694. )
  1695. }
  1696. }));
  1697. export default Form.create()(NewService);