orderDetail.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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. <p style={{ width: 500, wordWrap: "break-word" }}>
  209. {data.orderRemarks}
  210. </p>
  211. </FormItem>
  212. </div>
  213. <div className="clearfix">
  214. <FormItem
  215. labelCol={{ span: 4 }}
  216. wrapperCol={{ span: 18 }}
  217. label="合同扫描件"
  218. >
  219. <Upload
  220. className="demandDetailShow-upload"
  221. listType="picture-card"
  222. fileList={
  223. data.contractPictureUrl
  224. ? splitUrl(
  225. data.contractPictureUrl,
  226. ",",
  227. globalConfig.avatarHost + "/upload"
  228. )
  229. : []
  230. }
  231. onPreview={file => {
  232. this.setState({
  233. previewImage: file.url || file.thumbUrl,
  234. previewVisible: true
  235. });
  236. }}
  237. />
  238. <Modal
  239. maskClosable={false}
  240. footer={null}
  241. visible={this.state.previewVisible}
  242. onCancel={() => {
  243. this.setState({ previewVisible: false });
  244. }}
  245. >
  246. <img
  247. alt=""
  248. style={{ width: "100%" }}
  249. src={this.state.previewImage || ""}
  250. />
  251. </Modal>
  252. <Button
  253. style={{
  254. float: "right",
  255. marginRight: "140px",
  256. marginTop: "20px"
  257. }}
  258. onClick={() => {
  259. this.props.getOrderLog(data.orderNo);
  260. }}
  261. >
  262. 查看订单日志
  263. </Button>
  264. </FormItem>
  265. </div>
  266. <div className="clearfix">
  267. <FormItem
  268. className="half-item"
  269. {...formItemLayout}
  270. label="订单负责人"
  271. >
  272. <span>{data.salesmanName}</span>
  273. </FormItem>
  274. <FormItem
  275. className="half-item"
  276. {...formItemLayout}
  277. label="订单负责人电话"
  278. >
  279. <span>{data.salesmanMobile}</span>
  280. </FormItem>
  281. </div>
  282. <div className="clearfix">
  283. <FormItem
  284. className="half-item"
  285. {...formItemLayout}
  286. label="财务负责人"
  287. >
  288. <span>{data.financeName}</span>
  289. </FormItem>
  290. <FormItem
  291. className="half-item"
  292. {...formItemLayout}
  293. label="财务负责人电话"
  294. >
  295. <span>{data.financeMobile}</span>
  296. </FormItem>
  297. </div>
  298. <div>
  299. <span style={{ marginLeft: "50px", fontSize: "20px" }}>催款节点</span>
  300. </div>
  301. <div className="clearfix">
  302. <Form layout="horizontal" id="demand-form">
  303. <Table
  304. pagination={false}
  305. columns={this.state.ContactsLists}
  306. dataSource={this.props.contactList}
  307. />
  308. <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
  309. </Form>
  310. </div>
  311. <div>
  312. <span style={{ marginLeft: "50px", fontSize: "20px" }}>项目业务</span>
  313. </div>
  314. <div className="patent-table">
  315. <Table
  316. columns={this.state.columnsX}
  317. pagination={false}
  318. dataSource={this.props.dataSourceX}
  319. onRowClick={this.tableRowClickX}
  320. />
  321. </div>
  322. <Modal
  323. maskClosable={false}
  324. visible={this.state.visible}
  325. onOk={this.nextCancel}
  326. onCancel={this.nextCancel}
  327. width="800px"
  328. title={"项目任务详情"}
  329. footer=""
  330. className="admin-desc-content"
  331. >
  332. <Form layout="horizontal" id="demand-form">
  333. <div className="clearfix">
  334. <FormItem
  335. className="half-item"
  336. {...formItemLayout}
  337. label="项目名称"
  338. >
  339. <span>{this.state.commodityName}</span>
  340. </FormItem>
  341. <FormItem
  342. className="half-item"
  343. {...formItemLayout}
  344. label="项目数量"
  345. >
  346. <span>{this.state.commodityQuantity}</span>
  347. </FormItem>
  348. <FormItem
  349. className="half-item"
  350. {...formItemLayout}
  351. label="金额(万元)"
  352. >
  353. <span>{this.state.commodityPrice}</span>
  354. </FormItem>
  355. <FormItem
  356. className="half-item"
  357. {...formItemLayout}
  358. label="主要项目"
  359. >
  360. <span>{getboutique(this.state.main)}</span>
  361. </FormItem>
  362. <div className="clearfix">
  363. <FormItem
  364. labelCol={{ span: 4 }}
  365. wrapperCol={{ span: 16 }}
  366. label="服务说明"
  367. >
  368. <span>{this.state.taskComment}</span>
  369. </FormItem>
  370. </div>
  371. </div>
  372. </Form>
  373. </Modal>
  374. </div>
  375. );
  376. }
  377. }
  378. export default OrderDetail;