projectManageDetaile.jsx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import '../userMangagement.less';
  6. import {orderType,publishStatus} from '../../../../dataDic.js';
  7. import {getOrderType,getProjectState,getTaskStatus,getPublishStatus,getOrderChannel,getOrderState,getPaymentState,getApprovedState} from '../../../../tools.js';
  8. const MySettlementDetaile = Form.create()(React.createClass({
  9. getInitialState() {
  10. return {
  11. loading: false,
  12. visible: false,
  13. //派单
  14. contractList:[
  15. {
  16. title: '姓名',
  17. dataIndex: 'name',
  18. key: 'name'
  19. }, {
  20. title: '部门',
  21. dataIndex: 'depatrment',
  22. key: 'depatrment'
  23. },{
  24. title: '联系方式',
  25. dataIndex: 'mobile',
  26. key: 'mobile'
  27. },{
  28. title: '是否为主要联系人',
  29. dataIndex: 'major',
  30. key: 'major',
  31. render:(text) => {
  32. return text?'是':"否"
  33. }
  34. }, {
  35. title: '职务',
  36. dataIndex: 'position',
  37. key: 'position'
  38. },{
  39. title: '微信',
  40. dataIndex: 'wechat',
  41. key: 'wechat'
  42. },{
  43. title: 'QQ',
  44. dataIndex: 'qq',
  45. key: 'qq'
  46. },
  47. ],
  48. };
  49. },
  50. //查看基本详情基本信息
  51. loaduser(record){
  52. if(record){
  53. $.ajax({
  54. method: "get",
  55. dataType: "json",
  56. crossDomain: false,
  57. url: globalConfig.context + '/api/admin/techproject/getProjectTaskDetail',
  58. data: {
  59. taskId: record.taskId
  60. },
  61. success: function (data) {
  62. let thisData = data.data;
  63. if (!thisData) {
  64. if (data.error && data.error.length) {
  65. message.warning(data.error[0].message);
  66. };
  67. thisData = {};
  68. };
  69. this.setState({
  70. orderNo:thisData.orderNo,
  71. orderList:thisData,
  72. uid:thisData.uid,
  73. taskId:thisData.taskId,
  74. publishStatus:thisData.publishStatus,
  75. });
  76. }.bind(this),
  77. }).always(function () {
  78. this.setState({
  79. loading: false
  80. });
  81. }.bind(this));
  82. }
  83. },
  84. //查看订单
  85. seeOrder(){
  86. this.setState({
  87. seeOrderVisible:true
  88. })
  89. this.seeOrderList();
  90. },
  91. seeOrderCancel(){
  92. this.setState({
  93. seeOrderVisible:false
  94. })
  95. },
  96. seeOrderList(){
  97. this.state.lookOrderList=[];
  98. $.ajax({
  99. method: "get",
  100. dataType: "json",
  101. crossDomain: false,
  102. url: globalConfig.context + '/api/admin/order/getServiceOrderDetail',
  103. data: {
  104. orderNo: this.state.orderNo
  105. },
  106. success: function (data) {
  107. let thisData = data.data;
  108. if (!thisData) {
  109. if (data.error && data.error.length) {
  110. message.warning(data.error[0].message);
  111. };
  112. thisData = {};
  113. };
  114. this.setState({
  115. id:thisData.id,
  116. lookOrderList:thisData,
  117. });
  118. }.bind(this),
  119. }).always(function () {
  120. this.setState({
  121. loading: false
  122. });
  123. }.bind(this));
  124. },
  125. //点击查看联系人
  126. seeContract(){
  127. this.contract();
  128. this.setState({
  129. seeState:false,
  130. orderVisible:true
  131. })
  132. },
  133. orderCancel(){
  134. this.setState({
  135. orderVisible:false
  136. })
  137. },
  138. //查看联系人
  139. contract(){
  140. $.ajax({
  141. method: "get",
  142. dataType: "json",
  143. crossDomain: false,
  144. url: globalConfig.context + '/api/admin/customer/findAllContacts',
  145. data: {
  146. uid: this.state.uid
  147. },
  148. success: function (data) {
  149. let thisData = data.data;
  150. if (!thisData) {
  151. if (data.error && data.error.length) {
  152. message.warning(data.error[0].message);
  153. };
  154. thisData = {};
  155. };
  156. this.setState({
  157. contractArr:thisData,
  158. });
  159. }.bind(this),
  160. }).always(function () {
  161. this.setState({
  162. loading: false
  163. });
  164. }.bind(this));
  165. },
  166. //修改公示状态
  167. changePublishStatus(){
  168. $.ajax({
  169. method: "post",
  170. dataType: "json",
  171. crossDomain: false,
  172. url: globalConfig.context + '/api/admin/techproject/updatePublishStatus',
  173. data: {
  174. taskId:this.state.taskId,
  175. publishStatus:this.state.publishStatus,
  176. },
  177. success: function (data) {
  178. let thisData = data.data;
  179. if (!thisData) {
  180. if (data.error && data.error.length) {
  181. message.warning(data.error[0].message);
  182. };
  183. thisData = {};
  184. }
  185. message.success('修改成功');
  186. }.bind(this),
  187. })
  188. },
  189. componentWillMount() {
  190. },
  191. componentWillReceiveProps(nextProps) { //props改变时触发
  192. this.state.visible = nextProps.showDesc;
  193. if(nextProps.showDesc) {
  194. this.loaduser(nextProps.datauser);
  195. }
  196. },
  197. handleCancel(){
  198. this.setState({
  199. visible:false
  200. })
  201. this.props.closeShow(false)
  202. },
  203. render() {
  204. const FormItem = Form.Item
  205. const formItemLayout = {
  206. labelCol: { span: 8 },
  207. wrapperCol: { span: 14 },
  208. };
  209. const seeOrderDetaiel=this.state.lookOrderList || [];
  210. const orderDetaiel=this.state.orderList || [];
  211. return(
  212. <div>
  213. <Modal maskClosable={false} visible={this.state.visible}
  214. onOk={this.handleCancel} onCancel={this.handleCancel}
  215. width='1200px'
  216. title='查看任务'
  217. footer=''
  218. className="admin-desc-content">
  219. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  220. <Spin spinning={this.state.loading}>
  221. <div className="clearfix">
  222. <FormItem className="half-item"
  223. {...formItemLayout}
  224. label="客户名称" >
  225. <span>{orderDetaiel.buyerName}</span>
  226. {orderDetaiel.buyerName&&<Button onClick={this.seeContract} style={{float:'right',fontSize:'12px'}}>查看联系人</Button>}
  227. </FormItem>
  228. <FormItem className="half-item"
  229. {...formItemLayout}
  230. label="营销员名称" >
  231. <span>{orderDetaiel.salesmanName}</span>
  232. </FormItem>
  233. <FormItem className="half-item"
  234. {...formItemLayout}
  235. label="订单编号" >
  236. <span>{orderDetaiel.orderNo}</span>
  237. {/*<Button style={{float:'right'}} onClick={this.seeOrder}>查看订单</Button>*/}
  238. </FormItem>
  239. <FormItem className="half-item"
  240. {...formItemLayout}
  241. label="合同编号" >
  242. <span>{orderDetaiel.contractNo}</span>
  243. {/*<Button style={{float:'right'}} onClick={this.seeOrder}>查看订单</Button>*/}
  244. </FormItem>
  245. <FormItem className="half-item"
  246. {...formItemLayout}
  247. label="项目编号" >
  248. <span>{orderDetaiel.projectNo}</span>
  249. </FormItem>
  250. <FormItem className="half-item"
  251. {...formItemLayout}
  252. label="任务编号" >
  253. <span>{orderDetaiel.taskNo}</span>
  254. </FormItem>
  255. <FormItem className="half-item"
  256. {...formItemLayout}
  257. label="服务项目名称" >
  258. <span>{orderDetaiel.commodityName}</span>
  259. </FormItem>
  260. <FormItem className="half-item"
  261. {...formItemLayout}
  262. label="任务状态" >
  263. <span>{getTaskStatus(orderDetaiel.taskStatus)}</span>
  264. </FormItem>
  265. <FormItem className="half-item"
  266. {...formItemLayout}
  267. label="是否锁定" >
  268. <span>{orderDetaiel.deletedSign==2?'锁定':'未锁定'}</span>
  269. </FormItem>
  270. <FormItem className="half-item"
  271. {...formItemLayout}
  272. label="公示状态" >
  273. {orderDetaiel.taskStatus==3?<span><Select placeholder="请选择公示状态"
  274. style={{ width:'150px'}}
  275. value={getPublishStatus(this.state.publishStatus)}
  276. onChange={(e)=>{this.setState({publishStatus:e})}}>
  277. {
  278. publishStatus.map(function (item) {
  279. return <Select.Option key={item.value} >{item.key}</Select.Option>
  280. })
  281. }
  282. </Select>
  283. <Button onClick={this.changePublishStatus} style={{marginLeft:'10px',fontSize:'12px'}}>修改公示状态</Button></span>:<span>{getPublishStatus(orderDetaiel.publishStatus)}</span>
  284. }
  285. </FormItem>
  286. <div className='clearfix'>
  287. <FormItem
  288. labelCol={{ span: 4 }}
  289. wrapperCol={{ span: 16 }}
  290. label="任务说明" >
  291. <span>{orderDetaiel.taskComment}</span>
  292. </FormItem>
  293. </div>
  294. <div className='clearfix'>
  295. <FormItem className="half-item"
  296. {...formItemLayout}
  297. label="派单人" >
  298. <span>{orderDetaiel.taskAllocatorName}</span>
  299. </FormItem>
  300. <FormItem className="half-item"
  301. {...formItemLayout}
  302. label="派单时间" >
  303. <span>{orderDetaiel.taskDistributionTime}</span>
  304. </FormItem>
  305. <FormItem className="half-item"
  306. {...formItemLayout}
  307. label="资料负责人" >
  308. <span>{orderDetaiel.taskReceiverName}</span>
  309. </FormItem>
  310. <FormItem className="half-item"
  311. {...formItemLayout}
  312. label="订单部门" >
  313. <span>{orderDetaiel.departmentName}</span>
  314. </FormItem>
  315. </div>
  316. <div className='clearfix'>
  317. <FormItem
  318. labelCol={{ span: 4 }}
  319. wrapperCol={{ span: 16 }}
  320. label="订单留言" >
  321. <span>{orderDetaiel.orderRemarks}</span>
  322. </FormItem>
  323. </div>
  324. </div>
  325. </Spin>
  326. </Form >
  327. </Modal>
  328. <Modal maskClosable={false} visible={this.state.seeOrderVisible}
  329. onOk={this.seeOrderCancel} onCancel={this.seeOrderCancel}
  330. width='1200px'
  331. title= '查看订单'
  332. footer=''
  333. className="admin-desc-content">
  334. <Form layout="horizontal" id="demand-form">
  335. <Spin spinning={this.state.loading}>
  336. <div className="clearfix">
  337. <div className="clearfix">
  338. <FormItem className="half-item"
  339. {...formItemLayout}
  340. label="订单编号" >
  341. <span>{seeOrderDetaiel.orderNo}</span>
  342. </FormItem>
  343. <FormItem className="half-item"
  344. {...formItemLayout}
  345. label="下单时间" >
  346. <span>{seeOrderDetaiel.createTime}</span>
  347. </FormItem>
  348. <FormItem className="half-item"
  349. {...formItemLayout}
  350. label="客户名称" >
  351. <span>{seeOrderDetaiel.buyerName}</span>
  352. </FormItem>
  353. <FormItem className="half-item"
  354. {...formItemLayout}
  355. label="订单类型" >
  356. <span>{getOrderType(seeOrderDetaiel.orderType)}</span>
  357. </FormItem>
  358. <FormItem className="half-item"
  359. {...formItemLayout}
  360. label="订单外联" >
  361. <span>{getOrderChannel(seeOrderDetaiel.orderChannel)}</span>
  362. </FormItem>
  363. <FormItem className="half-item"
  364. {...formItemLayout}
  365. label="订单状态" >
  366. <span>{getOrderState(seeOrderDetaiel.orderStatus)}</span>
  367. </FormItem>
  368. <div className='clearfix'>
  369. <FormItem className="half-item"
  370. {...formItemLayout}
  371. label="特批立项" >
  372. <span>{getApprovedState(seeOrderDetaiel.approval)}</span>
  373. </FormItem>
  374. <div className='clearfix'>
  375. <FormItem
  376. labelCol={{ span: 4 }}
  377. wrapperCol={{ span: 16 }}
  378. label="订单留言" >
  379. <span>{seeOrderDetaiel.orderRemarks}</span>
  380. </FormItem>
  381. </div>
  382. </div>
  383. </div>
  384. <div className='clearfix'>
  385. <FormItem className="half-item"
  386. {...formItemLayout}
  387. label="订单负责人" >
  388. <span>{seeOrderDetaiel.salesmanName}</span>
  389. </FormItem>
  390. <FormItem className="half-item"
  391. {...formItemLayout}
  392. label="意向时间" >
  393. <span>{seeOrderDetaiel.createTime}</span>
  394. </FormItem>
  395. <FormItem className="half-item"
  396. {...formItemLayout}
  397. label="签单时间" >
  398. <span>{seeOrderDetaiel.signTime}</span>
  399. </FormItem>
  400. <FormItem className="half-item"
  401. {...formItemLayout}
  402. label="财务负责人" >
  403. <span>{seeOrderDetaiel.financeName}</span>
  404. </FormItem>
  405. <FormItem className="half-item"
  406. {...formItemLayout}
  407. label="项目负责人" >
  408. <span>{seeOrderDetaiel.technicianName}</span>
  409. </FormItem>
  410. <FormItem className="half-item"
  411. {...formItemLayout}
  412. label="立项时间" >
  413. <span>{seeOrderDetaiel.setUpTime}</span>
  414. </FormItem>
  415. <FormItem className="half-item"
  416. {...formItemLayout}
  417. label="项目状态" >
  418. <span>{getProjectState(seeOrderDetaiel.projectStage)}</span>
  419. </FormItem>
  420. </div>
  421. </div>
  422. </Spin>
  423. </Form >
  424. </Modal>
  425. <Modal maskClosable={false} visible={this.state.orderVisible}
  426. onOk={this.orderCancel} onCancel={this.orderCancel}
  427. width='800px'
  428. title={this.state.seeState?'查看订单':'查看联系人'}
  429. footer=''
  430. className="admin-desc-content">
  431. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  432. <Spin spinning={this.state.loading}>
  433. <div className="patent-table" style={{marginTop:'10px'}}>
  434. <Spin spinning={this.state.loading}>
  435. {this.state.seeState?
  436. <div className="clearfix">
  437. </div>:
  438. <Table columns={this.state.contractList}
  439. dataSource={this.state.contractArr}
  440. pagination={false}
  441. />}
  442. </Spin>
  443. </div>
  444. </Spin>
  445. </Form>
  446. </Modal>
  447. </div>
  448. )
  449. }
  450. }));
  451. export default MySettlementDetaile;