addService.jsx 65 KB

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