123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739 |
- import React from 'react';
- import $ from 'jquery/src/ajax';
- import {
- Modal,
- message,
- Spin,
- Upload,
- Button,
- Form,
- Table
- } from 'antd';
- import {getjiedian,splitUrl,getNewOrderType,getProcessStatus,getApproval,getLiquidationStatus,getProjectStatus} from '@/tools';
- import OrderRiZi from "@/orderRiZi.jsx";
- const OrderDetail = Form.create()(React.createClass({
- loadXmu(record) {
- this.state.data = [];
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/newOrder/getOrderTask',
- data: {
- orderNo:record?record.orderNo:this.props.data.orderNo
- },
- success: function (data) {
- let theArr = [];
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- } else {
- for (let i = 0; i < data.data.length; i++) {
- let thisdata = data.data[i];
- theArr.push({
- key: i,
- id:thisdata.id,
- orderNo:thisdata.orderNo,
- commodityName:thisdata.commodityName,
- commodityPrice:thisdata.commodityPrice,
- commodityQuantity:thisdata.commodityQuantity,
- taskStatus:thisdata.taskStatus,
- taskComment:thisdata.taskComment,
- main:thisdata.main,
- contacts:thisdata.contacts,
- contactsMobile:thisdata.contactsMobile,
- cname:thisdata.cname,
- certificateNumber:thisdata.certificateNumber,
- projectStatus:thisdata.projectStatus
- });
- };
- }
- this.setState({
- dataSource: theArr,
- pagination: false,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- getInitialState() {
- return {
- rotateDeg: 0,
- visible: false,
- avisible: false,
- loading: false,
- jsDate: [],
- auditStatus: 0,
- textFileList: [],
- videoFileList: [],
- pictureUrl: [],
- pictureUrlMin: [],
- columns: [
- {
- title: "业务项目名称",
- dataIndex: "commodityName",
- key: "commodityName",
- render: text => {
- return text && text.length > 6 ? (
- <span title={text}>{text.substr(0, 8)}...</span>
- ) : (
- text
- );
- }
- },
- {
- title: "项目类别",
- dataIndex: "cname",
- key: "cname"
- },
- {
- title: "项目数量(个)",
- dataIndex: "commodityQuantity",
- key: "commodityQuantity"
- },
- {
- title: "服务市价(万元)",
- dataIndex: "commodityPrice",
- key: "commodityPrice"
- },
- {
- title: "项目状态",
- dataIndex: "projectStatus",
- key: "projectStatus",
- render: text => {
- return getProjectStatus(text);
- }
- },
- {
- title: "证书编号",
- dataIndex: "certificateNumber",
- key: "certificateNumber"
- },
- {
- title: "是否主要项目",
- dataIndex: "main",
- key: "main",
- render: text => {
- return text ? "是" : "否";
- }
- },
- {
- title: "项目说明",
- dataIndex: "taskComment",
- key: "taskComment",
- render: text => {
- return text && text.length > 8 ? (
- <span title={text}>{text.substr(0, 8)}...</span>
- ) : (
- text
- );
- }
- }
- ],
- columnsX: [
- {
- title: "流程",
- dataIndex: "processName",
- key: "processName"
- },
- {
- title: "操作人",
- dataIndex: "adminName",
- key: "adminName"
- },
- {
- title: "时间",
- dataIndex: "createDate",
- key: "createDate"
- }
- ]
- };
- },
- loadData(record){
- this.state.orderList=[];
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/newOrder/getOrderNewDetail',
- data: {
- orderNo:record?record.orderNo:this.props.data.orderNo
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- };
- this.setState({
- id: thisData.id,
- orderList: thisData,
- approval:
- thisData.approval == 0
- ? thisData.approval.toString()
- : thisData.approval,
- orderRemarks: thisData.orderRemarks,
- orgCodeUrl: thisData.contractPictureUrl
- ? splitUrl(
- thisData.contractPictureUrl,
- ",",
- globalConfig.avatarHost + "/upload"
- )
- : [],
- orderNo: thisData.orderNo, //订单编号
- buyerId: thisData.buyerId,
- depName: thisData.depName,
- outsource: thisData.outsource == 0 ? "否" : "是"
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- jdDate(record){
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/newOrder/selectOrderDun',
- data: {
- orderNo:record?record.orderNo:this.props.data.orderNo
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData.length) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- }else{
- this.setState({
- jsDate:thisData
- })
- };
-
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
-
- rizhi(){
- this.setState({
- loading:true
- })
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: '/api/admin/newOrder/selectOrderLog',
- data: {
- orderNo:this.props.data.orderNo
- },
- success: function (data) {
- let theArr = [];
- let thisData = data.data;
- if (!thisData.length) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- }else{
- for(let i = 0; i < data.data.length; i++) {
- let thisdata = data.data[i];
- theArr.push({
- processName:thisdata.processName,
- adminName:thisdata.adminName,
- createDate:thisdata.createDate,
- });
- };
- };
- this.setState({
- dataSourceX: theArr
- })
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
-
-
- getOrderLog(){
- this.setState({
- avisible:true
- })
- this.rizhi()
- },
- closeOrderLog(){
- this.setState({
- avisible:false
- })
- },
-
- getPictureUrl(e) {
- this.setState({ pictureUrl: e });
- },
- componentWillMount() {
- if (this.props.data.orderNo) {
- this.loadData();
- this.loadXmu();
- this.jdDate();
- } else {
- this.state.data = {};
- };
- },
- componentWillReceiveProps(nextProps) {
- if (!this.props.visible && nextProps.visible) {
- this.state.textFileList = [];
- this.state.videoFileList = [];
- if (nextProps.data.orderNo) {
- this.loadData(nextProps.data);
- this.loadXmu(nextProps.data);
- this.jdDate(nextProps.data);
- } else {
- this.state.data = {};
- this.state.pictureUrl = [];
- this.state.pictureUrlMin=[];
- };
- this.props.form.resetFields();
- };
- },
- downImg() {
- let num = 0;
- for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
- if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
- num = i;
- }
- }
- if (num == this.state.orgCodeUrl.length - 1) {
- return message.warning("已经是最后一张了哦");
- }
- this.state.previewImage = this.state.orgCodeUrl[num + 1].url;
- this.setState({
- previewImage: this.state.previewImage,
- rotateDeg: 0
- });
- },
- upImg() {
- let num = 0;
- for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
- if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
- num = i;
- }
- }
- if (num == 0) {
- return message.warning("已经是第一张了哦");
- }
- this.state.previewImage = this.state.orgCodeUrl[num - 1].url;
- this.setState({
- previewImage: this.state.previewImage,
- rotateDeg: 0
- });
- },
- rotate() {
- let rotateDeg = this.state.rotateDeg + 90;
- this.setState({
- rotateDeg
- });
- },
- render() {
- const theData = this.state.orderList || {};
- const FormItem = Form.Item
- const formItemLayout = {
- labelCol: { span: 10 },
- wrapperCol: { span: 12 },
- };
- const jsDate = this.state.jsDate || [];
- return (
- <div className="login">
- <Form layout="horizontal" id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="订单编号"
- >
- <span>{theData.orderNo}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="签单时间"
- >
- <span>{theData.signDate}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="客户名称"
- >
- <span>{theData.userName}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="流转状态"
- >
- <span>{getProcessStatus(theData.processStatus)}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="订单类型"
- >
- <span>{getNewOrderType(theData.orderType)}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="结算状态"
- >
- <span>
- {getLiquidationStatus(theData.liquidationStatus)}
- </span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="签单总金额(万元)"
- >
- <span>{theData.totalAmount}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="首付款(万元)"
- >
- <span>{theData.firstAmount}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="已收款(万元)"
- >
- <span>{theData.settlementAmount}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="是否特批"
- >
- <span>{getApproval(theData.approval)}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="是否外包"
- >
- <span>{this.state.outsource}</span>
- </FormItem>
- {this.props.data.orderStatus == "6" && (
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="已退(万元)"
- >
- <span>{this.props.data.refundAmount}</span>
- </FormItem>
- )}
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 5 }}
- wrapperCol={{ span: 18 }}
- label="合同扫描件"
- >
- <Upload
- className="demandDetailShow-upload"
- listType="picture-card"
- fileList={this.state.orgCodeUrl}
- onPreview={file => {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true
- });
- }}
- ></Upload>
- <Modal
- maskClosable={false}
- footer={null}
- visible={this.state.previewVisible}
- onCancel={() => {
- this.setState({ previewVisible: false, rotateDeg: 0 });
- }}
- >
- <div
- onClick={this.upImg}
- className="up-btn"
- style={{
- cursor: "pointer",
- transition: "all .5s",
- opacity: ".2",
- width: "41px",
- height: "69px",
- backgroundColor: "rgba(0,0,0,.5)",
- position: "absolute",
- top: "50%",
- left: 16,
- transform: "translateY(-50%)",
- zIndex: 1
- }}
- >
- <span
- style={{
- position: "absolute",
- border: "1px solid #fff",
- width: "20px",
- height: "20px",
- left: "60%",
- top: "50%",
- transform: "translate(-50%, -50%) rotate(45deg)",
- borderTop: "none",
- borderRight: "none"
- }}
- ></span>
- </div>
- <div
- onClick={this.rotate}
- style={{
- textAlign: "center",
- lineHeight: "30px",
- color: "#000",
- cursor: "pointer",
- transition: "all .5s",
- width: "50px",
- height: "30px",
- backgroundColor: "white",
- position: "absolute",
- bottom: "-30",
- left: "50%",
- transform: "translateX(-50%)",
- zIndex: 1,
- borderRadius: "5px",
- border: "1px solid #ccc"
- }}
- >
- 旋转
- </div>
- <div
- onClick={this.downImg}
- className="up-btn"
- style={{
- cursor: "pointer",
- transition: "all .5s",
- opacity: ".2",
- width: "41px",
- height: "69px",
- backgroundColor: "rgba(0,0,0,.5)",
- position: "absolute",
- top: "50%",
- right: 16,
- transform: "translateY(-50%)",
- zIndex: 1
- }}
- >
- <span
- style={{
- position: "absolute",
- border: "1px solid #fff",
- width: "20px",
- height: "20px",
- left: "40%",
- top: "50%",
- transform: "translate(-50%, -50%) rotate(225deg)",
- borderTop: "none",
- borderRight: "none"
- }}
- ></span>
- </div>
- <img
- alt=""
- style={{
- width: "100%",
- transform: `rotate(${this.state.rotateDeg}deg)`
- }}
- src={this.state.previewImage || ""}
- />
- </Modal>
- <Button
- style={{
- float: "right",
- marginRight: "140px",
- marginTop: "20px"
- }}
- onClick={this.getOrderLog}
- >
- 查看订单日志
- </Button>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="合同编号"
- >
- <span>{theData.contractNo}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="订单部门"
- >
- <span>{theData.depName}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 5 }}
- wrapperCol={{ span: 18 }}
- label="订单留言"
- >
- <p style={{ maxWidth: 500, wordWrap: "break-word" }}>
- {this.state.orderRemarks}
- </p>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 5 }}
- wrapperCol={{ span: 18 }}
- label="收款节点"
- >
- {jsDate.map(item => {
- return (
- <p>
- {getjiedian(item.dunSubject)} -- {item.money} 万元
- </p>
- );
- })}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="订单负责人"
- >
- <span>{theData.salesmanName}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="订单负责人电话"
- >
- <span>{theData.salesmanMobile}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="当前财务负责人"
- >
- <span>{theData.nowFinance}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- label="当前财务负责人电话"
- >
- <span>{theData.nowFinanceMobile}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- style={{ opacity: ".5" }}
- label="原订单负责人"
- >
- <span>{theData.oldSalesmanName}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- style={{ opacity: ".5" }}
- label="原订单负责人电话"
- >
- <span>{theData.oldSalesmanMobile}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- style={{ opacity: ".5" }}
- label="实际财务操作人"
- >
- <span>{theData.financeName}</span>
- </FormItem>
- <FormItem
- className="half-item"
- {...formItemLayout}
- style={{ opacity: ".5" }}
- label="实际财务操作人电话"
- >
- <span>{theData.financeMobile}</span>
- </FormItem>
- </div>
- {/* <Modal
- visible={this.state.avisible}
- className="admin-desc-content"
- width="800px"
- maskClosable={false}
- title="订单日志"
- footer={null}
- onCancel={this.closeOrderLog}
- >
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table
- columns={this.state.columnsX}
- dataSource={this.state.dataSourceX}
- pagination={false}
- />
- </Spin>
- </div>
- </Modal> */}
- <OrderRiZi
- dataSourcerizhi={this.state.dataSourceX}
- closeOrderLog={this.closeOrderLog}
- visible={this.state.avisible}
- loading={this.state.loading}
- />
- <div className="clearfix">
- <p style={{ fontSize: 18, marginLeft: 20 }}>项目业务</p>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table
- columns={this.state.columns}
- dataSource={this.state.dataSource}
- pagination={this.state.pagination}
- onRowClick={this.tableRowClick}
- />
- </Spin>
- </div>
- </div>
- </Spin>
- </Form>
- </div>
- );
- }
- }));
- export default OrderDetail;
|