projectManageDetaile.jsx 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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} 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. orderList:thisData,
  71. taskId:thisData.taskId,
  72. uid:thisData.uid,
  73. publishStatus:thisData.publishStatus,
  74. });
  75. }.bind(this),
  76. }).always(function () {
  77. this.setState({
  78. loading: false
  79. });
  80. }.bind(this));
  81. }
  82. },
  83. //修改公示状态
  84. changePublishStatus(){
  85. $.ajax({
  86. method: "post",
  87. dataType: "json",
  88. crossDomain: false,
  89. url: globalConfig.context + '/api/admin/techproject/updatePublishStatus',
  90. data: {
  91. taskId:this.state.taskId,
  92. publishStatus:this.state.publishStatus,
  93. },
  94. success: function (data) {
  95. let thisData = data.data;
  96. if (!thisData) {
  97. if (data.error && data.error.length) {
  98. message.warning(data.error[0].message);
  99. };
  100. thisData = {};
  101. }
  102. message.success('修改成功');
  103. }.bind(this),
  104. })
  105. },
  106. componentWillMount() {
  107. },
  108. componentWillReceiveProps(nextProps) { //props改变时触发
  109. this.state.visible = nextProps.showDesc;
  110. if(nextProps.showDesc) {
  111. this.loaduser(nextProps.datauser);
  112. }
  113. },
  114. //点击查看联系人
  115. seeContract(){
  116. this.contract();
  117. this.setState({
  118. seeState:false,
  119. orderVisible:true
  120. })
  121. },
  122. orderCancel(){
  123. this.setState({
  124. orderVisible:false
  125. })
  126. },
  127. //查看联系人
  128. contract(){
  129. $.ajax({
  130. method: "get",
  131. dataType: "json",
  132. crossDomain: false,
  133. url: globalConfig.context + '/api/admin/customer/findAllContacts',
  134. data: {
  135. uid: this.state.uid
  136. },
  137. success: function (data) {
  138. let thisData = data.data;
  139. if (!thisData) {
  140. if (data.error && data.error.length) {
  141. message.warning(data.error[0].message);
  142. };
  143. thisData = {};
  144. };
  145. this.setState({
  146. contractArr:thisData,
  147. });
  148. }.bind(this),
  149. }).always(function () {
  150. this.setState({
  151. loading: false
  152. });
  153. }.bind(this));
  154. },
  155. handleCancel(){
  156. this.setState({
  157. visible:false
  158. })
  159. this.props.closeShow(false)
  160. },
  161. render() {
  162. const FormItem = Form.Item
  163. const formItemLayout = {
  164. labelCol: { span: 8 },
  165. wrapperCol: { span: 14 },
  166. };
  167. const orderDetaiel=this.state.orderList || [];
  168. return(
  169. <div>
  170. <Modal maskClosable={false} visible={this.state.visible}
  171. onOk={this.handleCancel} onCancel={this.handleCancel}
  172. width='1200px'
  173. title='查看任务'
  174. footer=''
  175. className="admin-desc-content">
  176. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  177. <Spin spinning={this.state.loading}>
  178. <div className="clearfix">
  179. <FormItem className="half-item"
  180. {...formItemLayout}
  181. label="客户名称" >
  182. <span>{orderDetaiel.buyerName}</span>
  183. {orderDetaiel.buyerName&&<Button onClick={this.seeContract} style={{float:'right',fontSize:'12px'}}>查看联系人</Button>}
  184. </FormItem>
  185. <FormItem className="half-item"
  186. {...formItemLayout}
  187. label="营销员名称" >
  188. <span>{orderDetaiel.salesmanName}</span>
  189. </FormItem>
  190. <FormItem className="half-item"
  191. {...formItemLayout}
  192. label="订单编号" >
  193. <span>{orderDetaiel.orderNo}</span>
  194. {/*<Button style={{float:'right'}} onClick={this.seeOrder}>查看订单</Button>*/}
  195. </FormItem>
  196. <FormItem className="half-item"
  197. {...formItemLayout}
  198. label="合同编号" >
  199. <span>{orderDetaiel.contractNo}</span>
  200. {/*<Button style={{float:'right'}} onClick={this.seeOrder}>查看订单</Button>*/}
  201. </FormItem>
  202. <FormItem className="half-item"
  203. {...formItemLayout}
  204. label="项目编号" >
  205. <span>{orderDetaiel.projectNo}</span>
  206. </FormItem>
  207. <FormItem className="half-item"
  208. {...formItemLayout}
  209. label="任务编号" >
  210. <span>{orderDetaiel.taskNo}</span>
  211. </FormItem>
  212. <FormItem className="half-item"
  213. {...formItemLayout}
  214. label="服务项目名称" >
  215. <span>{orderDetaiel.commodityName}</span>
  216. </FormItem>
  217. <FormItem className="half-item"
  218. {...formItemLayout}
  219. label="任务状态" >
  220. <span>{getTaskStatus(orderDetaiel.taskStatus)}</span>
  221. </FormItem>
  222. <FormItem className="half-item"
  223. {...formItemLayout}
  224. label="是否锁定" >
  225. <span>{orderDetaiel.deletedSign==2?'锁定':'未锁定'}</span>
  226. </FormItem>
  227. <div className='clearfix'>
  228. <FormItem className="half-item"
  229. {...formItemLayout}
  230. label="公示状态" >
  231. {orderDetaiel.taskStatus==3?<span><Select placeholder="请选择公示状态"
  232. style={{ width:'150px'}}
  233. value={getPublishStatus(this.state.publishStatus)}
  234. onChange={(e)=>{this.setState({publishStatus:e})}}>
  235. {
  236. publishStatus.map(function (item) {
  237. return <Select.Option key={item.value} >{item.key}</Select.Option>
  238. })
  239. }
  240. </Select>
  241. <Button onClick={this.changePublishStatus} style={{marginLeft:'10px',fontSize:'12px'}}>修改公示状态</Button></span>:<span>{getPublishStatus(orderDetaiel.publishStatus)}</span>
  242. }
  243. </FormItem>
  244. <FormItem className="half-item"
  245. {...formItemLayout}
  246. label="资料负责人" >
  247. <span>{orderDetaiel.taskReceiverName}</span>
  248. </FormItem>
  249. <FormItem className="half-item"
  250. {...formItemLayout}
  251. label="派单人" >
  252. <span>{orderDetaiel.taskAllocatorName}</span>
  253. </FormItem>
  254. <FormItem className="half-item"
  255. {...formItemLayout}
  256. label="订单部门" >
  257. <span>{orderDetaiel.departmentName}</span>
  258. </FormItem>
  259. <FormItem className="half-item"
  260. {...formItemLayout}
  261. label="派单时间" >
  262. <span>{orderDetaiel.taskDistributionTime}</span>
  263. </FormItem>
  264. <FormItem className="half-item"
  265. {...formItemLayout}
  266. label="实际订单金额" >
  267. <span>{orderDetaiel.signTotalAmount}万</span>
  268. </FormItem>
  269. </div>
  270. <div className='clearfix'>
  271. <FormItem
  272. labelCol={{ span: 4 }}
  273. wrapperCol={{ span: 16 }}
  274. label="任务说明" >
  275. <span>{orderDetaiel.taskComment}</span>
  276. </FormItem>
  277. </div>
  278. <div className='clearfix'>
  279. <FormItem
  280. labelCol={{ span: 4 }}
  281. wrapperCol={{ span: 16 }}
  282. label="订单留言" >
  283. <span>{orderDetaiel.orderRemarks}</span>
  284. </FormItem>
  285. </div>
  286. </div>
  287. </Spin>
  288. </Form >
  289. </Modal>
  290. <Modal maskClosable={false} visible={this.state.orderVisible}
  291. onOk={this.orderCancel} onCancel={this.orderCancel}
  292. width='800px'
  293. title={this.state.seeState?'查看订单':'查看联系人'}
  294. footer=''
  295. className="admin-desc-content">
  296. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  297. <Spin spinning={this.state.loading}>
  298. <div className="patent-table" style={{marginTop:'10px'}}>
  299. <Spin spinning={this.state.loading}>
  300. {this.state.seeState?
  301. <div className="clearfix">
  302. </div>:
  303. <Table columns={this.state.contractList}
  304. dataSource={this.state.contractArr}
  305. pagination={false}
  306. />}
  307. </Spin>
  308. </div>
  309. </Spin>
  310. </Form>
  311. </Modal>
  312. </div>
  313. )
  314. }
  315. }));
  316. export default MySettlementDetaile;