addService.jsx 59 KB

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