|
@@ -1,8 +1,9 @@
|
|
|
import React from "react";
|
|
|
import $ from "jquery/src/ajax";
|
|
|
import "@/manageCenter/financialManage/distribute/public.less";
|
|
|
-import { Button, Form, Input, Select, Spin, Table, message, Modal,Tabs } from "antd";
|
|
|
+import { Button, Form, Input, Select, Spin, Table, message, Modal,Tabs, Tag } from "antd";
|
|
|
import Assign from "@/manageCenter/publicComponent/assign";
|
|
|
+import ResolutionDetail from "@/resolutionDetail";
|
|
|
import {
|
|
|
getProcessStatus,
|
|
|
getLiquidationStatus,
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
ShowModal
|
|
|
} from "@/tools";
|
|
|
import ShowModalDiv from "@/showModal.jsx";
|
|
|
+import ResolutionPro from "../task/resolutionPro";
|
|
|
const FormItem = Form.Item;
|
|
|
const {TabPane} = Tabs
|
|
|
const OutsourceTaskAssignment = React.createClass({
|
|
@@ -49,8 +51,13 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
} else {
|
|
|
for (let i = 0; i < data.data.list.length; i++) {
|
|
|
let thisdata = data.data.list[i];
|
|
|
+ if (thisdata.splitList) {
|
|
|
+ thisdata.splitList.forEach(item => {
|
|
|
+ item.key = item.id;
|
|
|
+ });
|
|
|
+ }
|
|
|
theArr.push({
|
|
|
- key: i,
|
|
|
+ key: thisdata.id,
|
|
|
orderNo: thisdata.orderNo, //订单编号
|
|
|
id: thisdata.id, //任务ID
|
|
|
taskName: thisdata.taskName, //名称
|
|
@@ -61,7 +68,9 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
taskDate: thisdata.taskDate, //分配时间
|
|
|
commodityQuantity: thisdata.commodityQuantity, //数量
|
|
|
userName: thisdata.userName, //用户名
|
|
|
- depName: thisdata.depName //部门名称
|
|
|
+ depName: thisdata.depName, //部门名称
|
|
|
+ splitStatus: thisdata.splitStatus, //拆分状态
|
|
|
+ splitList: thisdata.splitList
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -167,6 +176,7 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
<Button
|
|
|
type="primary"
|
|
|
style={{ margin: "0 10px" }}
|
|
|
+ disabled={record.splitStatus == 1 ? true : false}
|
|
|
onClick={e => {
|
|
|
e.stopPropagation(), this.evaluate(record, "咨询师经理");
|
|
|
}}
|
|
@@ -176,12 +186,32 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
<Button
|
|
|
type="primary"
|
|
|
style={{ margin: "0 10px" }}
|
|
|
+ disabled={record.splitStatus == 1 ? true : false}
|
|
|
onClick={e => {
|
|
|
e.stopPropagation(), this.evaluate(record, "咨询师");
|
|
|
}}
|
|
|
>
|
|
|
分配任务
|
|
|
</Button>
|
|
|
+ {record.splitStatus == 0 ? (
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ style={{ margin: "0 10px" }}
|
|
|
+ onClick={e => {
|
|
|
+ e.stopPropagation();
|
|
|
+ this.setState({
|
|
|
+ resolutionVisible: true,
|
|
|
+ resolutionName: record.taskName,
|
|
|
+ resolutionNumber: record.commodityQuantity,
|
|
|
+ resolutionId: record.id
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 拆分项目
|
|
|
+ </Button>
|
|
|
+ ) : (
|
|
|
+ ""
|
|
|
+ )}
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
@@ -203,7 +233,27 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
{
|
|
|
title: "项目数量",
|
|
|
dataIndex: "commodityQuantity",
|
|
|
- key: "commodityQuantity"
|
|
|
+ key: "commodityQuantity",
|
|
|
+ render: (text, record) => {
|
|
|
+ if (record.splitStatus == 1) {
|
|
|
+ return (
|
|
|
+ <span>
|
|
|
+ {text}{" "}
|
|
|
+ <Tag
|
|
|
+ color="#108ee9"
|
|
|
+ onClick={e => {
|
|
|
+ e.stopPropagation();
|
|
|
+ this.showRes(record);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 已拆
|
|
|
+ </Tag>
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return text;
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: "金额(万元)",
|
|
@@ -237,7 +287,8 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
- dataSourceX: []
|
|
|
+ dataSourceX: [],
|
|
|
+ resVisible: false
|
|
|
};
|
|
|
},
|
|
|
/* 分派 */
|
|
@@ -267,6 +318,18 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
this.xiangqing(record.orderNo);
|
|
|
this.xiangmu(record.orderNo);
|
|
|
},
|
|
|
+ // 拆分详细
|
|
|
+ showRes(record) {
|
|
|
+ this.setState({
|
|
|
+ resVisible: true,
|
|
|
+ resRecord: record
|
|
|
+ });
|
|
|
+ },
|
|
|
+ resCancel() {
|
|
|
+ this.setState({
|
|
|
+ resVisible: false
|
|
|
+ });
|
|
|
+ },
|
|
|
//订单详情
|
|
|
xiangqing(orderNos) {
|
|
|
$.ajax({
|
|
@@ -360,7 +423,8 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
taskComment: thisdata.taskComment, //任务说明
|
|
|
contacts: thisdata.contacts, //联系人
|
|
|
contactsMobile: thisdata.contactsMobile, //联系人电话
|
|
|
- taskStatus: thisdata.taskStatus //是否分配
|
|
|
+ taskStatus: thisdata.taskStatus, //是否分配
|
|
|
+ splitStatus: thisdata.splitStatus
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -381,7 +445,7 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
this.setState({
|
|
|
visible: false
|
|
|
});
|
|
|
- this.reset();
|
|
|
+ this.loadData();
|
|
|
},
|
|
|
visitOk() {
|
|
|
this.setState({
|
|
@@ -478,7 +542,124 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
}.bind(this)
|
|
|
);
|
|
|
},
|
|
|
+ resolutionCancel() {
|
|
|
+ this.setState({
|
|
|
+ resolutionVisible: false
|
|
|
+ });
|
|
|
+ },
|
|
|
render() {
|
|
|
+ const expandedRowRender = e => {
|
|
|
+ const data = e.splitList;
|
|
|
+ let columns = [];
|
|
|
+ if (e.splitList instanceof Array && e.splitList.length) {
|
|
|
+ columns = [
|
|
|
+ {
|
|
|
+ title: "任务编号",
|
|
|
+ dataIndex: "id",
|
|
|
+ key: "id"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "任务名称",
|
|
|
+ dataIndex: "taskName",
|
|
|
+ key: "taskName"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "订单编号",
|
|
|
+ dataIndex: "orderNo",
|
|
|
+ key: "orderNo"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "业务类别",
|
|
|
+ dataIndex: "cname",
|
|
|
+ key: "cname"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "客户名称",
|
|
|
+ dataIndex: "userName",
|
|
|
+ key: "userName"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "项目状态",
|
|
|
+ dataIndex: "projectStatus",
|
|
|
+ key: "projectStatus",
|
|
|
+ render: text => {
|
|
|
+ return getProjectStatus(text);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "分配时间",
|
|
|
+ dataIndex: "taskDate",
|
|
|
+ key: "taskDate"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "任务数量",
|
|
|
+ dataIndex: "commodityQuantity",
|
|
|
+ key: "commodityQuantity"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "订单部门",
|
|
|
+ dataIndex: "depName",
|
|
|
+ key: "depName"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "拆分操作人",
|
|
|
+ dataIndex: "splitAname",
|
|
|
+ key: "splitAname"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "拆分时间人",
|
|
|
+ dataIndex: "splitTimes",
|
|
|
+ key: "splitTimes"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "操作",
|
|
|
+ dataIndex: "caozuo",
|
|
|
+ key: "caouzo",
|
|
|
+ render: (text, record) => {
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ style={{ margin: "0 10px" }}
|
|
|
+ disabled={record.distributeSign == 1 ? true : false}
|
|
|
+ onClick={e => {
|
|
|
+ e.stopPropagation(), this.evaluate(record, "咨询师经理");
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 转交
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ style={{ margin: "0 10px" }}
|
|
|
+ disabled={record.distributeSign == 1 ? true : false}
|
|
|
+ onClick={e => {
|
|
|
+ e.stopPropagation(), this.evaluate(record, "咨询师");
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 分配任务
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ return (
|
|
|
+ <Table
|
|
|
+ columns={columns}
|
|
|
+ dataSource={data}
|
|
|
+ pagination={false}
|
|
|
+ onRowClick={this.tableRowClick.bind(this)}
|
|
|
+ />
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ columns = [];
|
|
|
+ return (
|
|
|
+ <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
|
|
|
+ 此项目暂未拆分
|
|
|
+ </p>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ };
|
|
|
const rowSelection = {
|
|
|
selectedRowKeys: this.state.selectedRowKeys,
|
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
@@ -495,56 +676,73 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
let departmentArr = this.state.departmentArr || [];
|
|
|
return (
|
|
|
<div className="user-content">
|
|
|
+ {this.state.resVisible ? (
|
|
|
+ <ResolutionDetail
|
|
|
+ cancel={this.resCancel}
|
|
|
+ detail={this.state.resRecord}
|
|
|
+ visible={this.state.resVisible}
|
|
|
+ id={this.state.resRecord.orderNo}
|
|
|
+ />
|
|
|
+ ) : (
|
|
|
+ ""
|
|
|
+ )}
|
|
|
+ <ResolutionPro
|
|
|
+ resolutionVisible={this.state.resolutionVisible}
|
|
|
+ number={this.state.resolutionNumber}
|
|
|
+ name={this.state.resolutionName}
|
|
|
+ cancel={this.resolutionCancel}
|
|
|
+ id={this.state.resolutionId}
|
|
|
+ loadData={this.loadData}
|
|
|
+ />
|
|
|
<ShowModalDiv ShowModal={this.state.showModal} />
|
|
|
<div className="content-title">
|
|
|
<span>外包任务派单</span>
|
|
|
</div>
|
|
|
- <Tabs
|
|
|
- defaultActiveKey="1"
|
|
|
- onChange={this.callback}
|
|
|
- className="test">
|
|
|
- <TabPane tab="搜索" key="1">
|
|
|
- <div className="user-search">
|
|
|
- <Input
|
|
|
- placeholder="客户名称"
|
|
|
- value={this.state.nameSearch}
|
|
|
- style={{marginLeft:10}}
|
|
|
- onChange={e => {
|
|
|
- this.setState({ nameSearch: e.target.value });
|
|
|
- }}
|
|
|
- />
|
|
|
- <Input
|
|
|
- placeholder="订单编号"
|
|
|
- value={this.state.orderNoSearch}
|
|
|
- onChange={e => {
|
|
|
- this.setState({ orderNoSearch: e.target.value });
|
|
|
- }}
|
|
|
- />
|
|
|
- <Input
|
|
|
- placeholder="任务编号"
|
|
|
- value={this.state.taskNoSearch}
|
|
|
- onChange={e => {
|
|
|
- this.setState({ taskNoSearch: e.target.value });
|
|
|
- }}
|
|
|
- />
|
|
|
- <Select
|
|
|
- placeholder="选择部门"
|
|
|
- style={{ width: 150, marginRight: "10px" }}
|
|
|
- value={this.state.departmenttSearch}
|
|
|
- onChange={e => {
|
|
|
- this.setState({ departmenttSearch: e });
|
|
|
- }}
|
|
|
- >
|
|
|
- {departmentArr.map(function(item) {
|
|
|
- return <Select.Option key={item.id}>{item.name}</Select.Option>;
|
|
|
- })}
|
|
|
- </Select>
|
|
|
- <Button type="primary" onClick={this.search}>
|
|
|
- 搜索
|
|
|
- </Button>
|
|
|
- <Button onClick={this.reset}>重置</Button>
|
|
|
+ <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
|
|
|
+ <TabPane tab="搜索" key="1">
|
|
|
+ <div className="user-search">
|
|
|
+ <Input
|
|
|
+ placeholder="客户名称"
|
|
|
+ value={this.state.nameSearch}
|
|
|
+ style={{ marginLeft: 10 }}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ nameSearch: e.target.value });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Input
|
|
|
+ placeholder="订单编号"
|
|
|
+ value={this.state.orderNoSearch}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ orderNoSearch: e.target.value });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Input
|
|
|
+ placeholder="任务编号"
|
|
|
+ value={this.state.taskNoSearch}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ taskNoSearch: e.target.value });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Select
|
|
|
+ placeholder="选择部门"
|
|
|
+ style={{ width: 150, marginRight: "10px" }}
|
|
|
+ value={this.state.departmenttSearch}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ departmenttSearch: e });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {departmentArr.map(function(item) {
|
|
|
+ return (
|
|
|
+ <Select.Option key={item.id}>{item.name}</Select.Option>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </Select>
|
|
|
+ <Button type="primary" onClick={this.search}>
|
|
|
+ 搜索
|
|
|
+ </Button>
|
|
|
+ <Button onClick={this.reset}>重置</Button>
|
|
|
|
|
|
- {/* <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch.bind(this)} /></span>
|
|
|
+ {/* <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch.bind(this)} /></span>
|
|
|
<div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
|
|
|
<span>订单时间 :</span>
|
|
|
<RangePicker
|
|
@@ -552,15 +750,16 @@ const OutsourceTaskAssignment = React.createClass({
|
|
|
this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
|
|
|
onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
|
|
|
</div> */}
|
|
|
- </div>
|
|
|
- </TabPane>
|
|
|
+ </div>
|
|
|
+ </TabPane>
|
|
|
</Tabs>
|
|
|
<div className="patent-table">
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
<Table
|
|
|
columns={this.state.columns}
|
|
|
dataSource={this.state.dataSource}
|
|
|
- rowSelection={rowSelection}
|
|
|
+ expandedRowRender={expandedRowRender}
|
|
|
+ // rowSelection={rowSelection}
|
|
|
pagination={this.state.pagination}
|
|
|
onRowClick={this.tableRowClick.bind(this)}
|
|
|
bordered
|