orderDetail.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. import React, { Component } from "react";
  2. import { Form, Upload, Modal, Button, Table, Col } from "antd";
  3. import {
  4. splitUrl,
  5. getProcessStatus,
  6. getjiedian,
  7. getLiquidationStatus,
  8. getboutique,
  9. getCuikuan,
  10. getApprovedState,
  11. getProjectStatus
  12. } from "@/tools.js";
  13. const FormItem = Form.Item;
  14. class OrderDetail extends Component {
  15. constructor(props) {
  16. super(props);
  17. this.state = {
  18. ContactsLists: [
  19. {
  20. title: "催款科目",
  21. dataIndex: "dunSubject",
  22. key: "dunSubject",
  23. render: text => {
  24. return getjiedian(text);
  25. }
  26. },
  27. {
  28. title: "金额(万)",
  29. dataIndex: "money",
  30. key: "money",
  31. render: text => {
  32. return this.props.processState === 2 ? "***" : text;
  33. }
  34. },
  35. {
  36. title: "催款状态",
  37. dataIndex: "dunStatus",
  38. key: "dunStatus",
  39. render: text => {
  40. return getCuikuan(text);
  41. }
  42. }
  43. ],
  44. columnsX: [
  45. {
  46. title: "业务项目名称",
  47. dataIndex: "commodityName",
  48. key: "commodityName"
  49. },
  50. {
  51. title: "项目类别",
  52. dataIndex: "cname",
  53. key: "cname"
  54. },
  55. {
  56. title: "项目数量",
  57. dataIndex: "commodityQuantity",
  58. key: "commodityQuantity"
  59. },
  60. {
  61. title: "金额(万元)",
  62. dataIndex: "commodityPrice",
  63. key: "commodityPrice",
  64. render: text => {
  65. return this.props.processState === 2 ? "***" : text;
  66. }
  67. },
  68. {
  69. title: "负责人",
  70. dataIndex: "contacts",
  71. key: "contacts"
  72. },
  73. {
  74. title: "负责人电话",
  75. dataIndex: "contactsMobile",
  76. key: "contactsMobile"
  77. },
  78. {
  79. title: "项目状态",
  80. dataIndex: "projectStatus",
  81. key: "projectStatus",
  82. render: text => {
  83. return getProjectStatus(text);
  84. }
  85. },
  86. {
  87. title: "主要项目",
  88. dataIndex: "main",
  89. key: "main",
  90. render: text => {
  91. return text ? "是" : "否";
  92. }
  93. },
  94. {
  95. title: "项目说明",
  96. dataIndex: "taskComment",
  97. key: "taskComment",
  98. render: text => {
  99. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  100. }
  101. }
  102. ]
  103. };
  104. this.tableRowClickX = this.tableRowClickX.bind(this);
  105. this.nextCancel = this.nextCancel.bind(this);
  106. }
  107. //项目详情关闭
  108. nextCancel() {
  109. this.setState({
  110. visible: false
  111. });
  112. }
  113. //点击打卡项目详情
  114. tableRowClickX(record) {
  115. this.setState({
  116. jid: record.id, //项目ID
  117. kid: record.commodityId, //商品ID
  118. commodityName: record.commodityName, //金额
  119. commodityPrice: record.commodityPrice, //金额
  120. commodityQuantity: record.commodityQuantity, //数量
  121. taskComment: record.taskComment, //备注
  122. main: record.main.toString(), //是否为主要
  123. visible: true,
  124. addState: 0
  125. });
  126. }
  127. render() {
  128. const formItemLayout = {
  129. labelCol: { span: 8 },
  130. wrapperCol: { span: 14 }
  131. };
  132. const data = this.props.orderData;
  133. return (
  134. <div className="clearfix">
  135. <FormItem className="half-item" {...formItemLayout} label="订单编号">
  136. <span>{this.props.orderNo}</span>
  137. </FormItem>
  138. <FormItem className="half-item" {...formItemLayout} label="合同编号">
  139. <span>{data.contractNo}</span>
  140. </FormItem>
  141. <FormItem className="half-item" {...formItemLayout} label="客户名称">
  142. <span>{data.userName}</span>
  143. </FormItem>
  144. <FormItem
  145. className="half-item"
  146. {...formItemLayout}
  147. label="合同签订时间"
  148. >
  149. <span>{data.signDate}</span>
  150. </FormItem>
  151. <FormItem className="half-item" {...formItemLayout} label="流程状态">
  152. <span>{getProcessStatus(data.processStatus)}</span>
  153. </FormItem>
  154. <FormItem className="half-item" {...formItemLayout} label="结算状态">
  155. <span>{getLiquidationStatus(data.liquidationStatus)}</span>
  156. </FormItem>
  157. <FormItem className="half-item" {...formItemLayout} label="企业联系人">
  158. <span>{data.contacts}</span>
  159. </FormItem>
  160. <FormItem className="half-item" {...formItemLayout} label="联系人电话">
  161. <span>{data.contactMobile}</span>
  162. </FormItem>
  163. <FormItem className="half-item" {...formItemLayout} label="企业法人">
  164. <span>{data.legalPerson}</span>
  165. </FormItem>
  166. <FormItem className="half-item" {...formItemLayout} label="法人电话">
  167. <span>{data.legalPersonTel}</span>
  168. </FormItem>
  169. <FormItem
  170. className="half-item"
  171. {...formItemLayout}
  172. label="签单金额(万元)"
  173. >
  174. <span>
  175. {this.props.processState === 2 ? "***" : data.totalAmount}
  176. </span>
  177. </FormItem>
  178. <FormItem
  179. className="half-item"
  180. {...formItemLayout}
  181. label="首付金额(万元)"
  182. >
  183. <span>
  184. {this.props.processState === 2 ? "***" : data.firstAmount}
  185. </span>
  186. </FormItem>
  187. <FormItem className="half-item" {...formItemLayout} label="特批立项">
  188. <span>{getApprovedState(data.approval)}</span>
  189. </FormItem>
  190. <FormItem
  191. className="half-item"
  192. {...formItemLayout}
  193. label="已收款项(万元)"
  194. >
  195. <span>
  196. {this.props.processState === 2 ? "***" : data.settlementAmount}
  197. </span>
  198. </FormItem>
  199. <FormItem className="half-item" {...formItemLayout} label="订单部门">
  200. <span>{data.depName}</span>
  201. </FormItem>
  202. <div className="clearfix">
  203. <FormItem
  204. labelCol={{ span: 4 }}
  205. wrapperCol={{ span: 16 }}
  206. label="订单留言"
  207. >
  208. <span>{data.orderRemarks}</span>
  209. </FormItem>
  210. </div>
  211. <div className="clearfix">
  212. <FormItem
  213. labelCol={{ span: 4 }}
  214. wrapperCol={{ span: 18 }}
  215. label="合同扫描件"
  216. >
  217. <Upload
  218. className="demandDetailShow-upload"
  219. listType="picture-card"
  220. fileList={
  221. data.contractPictureUrl
  222. ? splitUrl(
  223. data.contractPictureUrl,
  224. ",",
  225. globalConfig.avatarHost + "/upload"
  226. )
  227. : []
  228. }
  229. onPreview={file => {
  230. this.setState({
  231. previewImage: file.url || file.thumbUrl,
  232. previewVisible: true
  233. });
  234. }}
  235. />
  236. <Modal
  237. maskClosable={false}
  238. footer={null}
  239. visible={this.state.previewVisible}
  240. onCancel={() => {
  241. this.setState({ previewVisible: false });
  242. }}
  243. >
  244. <img
  245. alt=""
  246. style={{ width: "100%" }}
  247. src={this.state.previewImage || ""}
  248. />
  249. </Modal>
  250. <Button
  251. style={{
  252. float: "right",
  253. marginRight: "140px",
  254. marginTop: "20px"
  255. }}
  256. onClick={() => {
  257. this.props.getOrderLog(data.orderNo);
  258. }}
  259. >
  260. 查看订单日志
  261. </Button>
  262. </FormItem>
  263. </div>
  264. <div className="clearfix">
  265. <FormItem
  266. className="half-item"
  267. {...formItemLayout}
  268. label="订单负责人"
  269. >
  270. <span>{data.salesmanName}</span>
  271. </FormItem>
  272. <FormItem
  273. className="half-item"
  274. {...formItemLayout}
  275. label="订单负责人电话"
  276. >
  277. <span>{data.salesmanMobile}</span>
  278. </FormItem>
  279. </div>
  280. <div className="clearfix">
  281. <FormItem
  282. className="half-item"
  283. {...formItemLayout}
  284. label="财务负责人"
  285. >
  286. <span>{data.financeName}</span>
  287. </FormItem>
  288. <FormItem
  289. className="half-item"
  290. {...formItemLayout}
  291. label="财务负责人电话"
  292. >
  293. <span>{data.financeMobile}</span>
  294. </FormItem>
  295. </div>
  296. <div>
  297. <span style={{ marginLeft: "50px", fontSize: "20px" }}>催款节点</span>
  298. </div>
  299. <div className="clearfix">
  300. <Form layout="horizontal" id="demand-form">
  301. <Table
  302. pagination={false}
  303. columns={this.state.ContactsLists}
  304. dataSource={this.props.contactList}
  305. />
  306. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  307. </Form>
  308. </div>
  309. <div>
  310. <span style={{ marginLeft: "50px", fontSize: "20px" }}>项目业务</span>
  311. </div>
  312. <div className="patent-table">
  313. <Table
  314. columns={this.state.columnsX}
  315. pagination={false}
  316. dataSource={this.props.dataSourceX}
  317. onRowClick={this.tableRowClickX}
  318. />
  319. </div>
  320. <Modal
  321. maskClosable={false}
  322. visible={this.state.visible}
  323. onOk={this.nextCancel}
  324. onCancel={this.nextCancel}
  325. width="800px"
  326. title={"项目任务详情"}
  327. footer=""
  328. className="admin-desc-content"
  329. >
  330. <Form layout="horizontal" id="demand-form">
  331. <div className="clearfix">
  332. <FormItem
  333. className="half-item"
  334. {...formItemLayout}
  335. label="项目名称"
  336. >
  337. <span>{this.state.commodityName}</span>
  338. </FormItem>
  339. <FormItem
  340. className="half-item"
  341. {...formItemLayout}
  342. label="项目数量"
  343. >
  344. <span>{this.state.commodityQuantity}</span>
  345. </FormItem>
  346. <FormItem
  347. className="half-item"
  348. {...formItemLayout}
  349. label="金额(万元)"
  350. >
  351. <span>{this.state.commodityPrice}</span>
  352. </FormItem>
  353. <FormItem
  354. className="half-item"
  355. {...formItemLayout}
  356. label="主要项目"
  357. >
  358. <span>{getboutique(this.state.main)}</span>
  359. </FormItem>
  360. <div className="clearfix">
  361. <FormItem
  362. labelCol={{ span: 4 }}
  363. wrapperCol={{ span: 16 }}
  364. label="服务说明"
  365. >
  366. <span>{this.state.taskComment}</span>
  367. </FormItem>
  368. </div>
  369. </div>
  370. </Form>
  371. </Modal>
  372. </div>
  373. );
  374. }
  375. }
  376. export default OrderDetail;