|
@@ -39,9 +39,10 @@ import {
|
|
|
getProjectStatus,
|
|
|
moneyVerify
|
|
|
} from "../../../tools.js";
|
|
|
+import {cuiJieDian} from "@/dataDic.js"
|
|
|
import PicturesWall from "./changeComponent/picturesWall.js";
|
|
|
import { changeType, getChangeType } from "./changeComponent/changeDetailYxgly";
|
|
|
-
|
|
|
+// const Options = Select.Option;
|
|
|
const Option = AutoComplete.Option;
|
|
|
|
|
|
const NewService = Form.create()(
|
|
@@ -82,7 +83,8 @@ const NewService = Form.create()(
|
|
|
taskComment: thisdata.taskComment, //任务说明
|
|
|
contacts: thisdata.contacts, //联系人
|
|
|
contactsMobile: thisdata.contactsMobile, //联系人电话
|
|
|
- projectStatus: thisdata.projectStatus //项目状态
|
|
|
+ projectStatus: thisdata.projectStatus, //项目状态
|
|
|
+ sort: thisdata.cSort
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -144,6 +146,7 @@ const NewService = Form.create()(
|
|
|
},
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
+ cuiFlag: false,
|
|
|
startRemarks: "",
|
|
|
remarksC: "",
|
|
|
loading: false,
|
|
@@ -277,6 +280,108 @@ const NewService = Form.create()(
|
|
|
loading: false,
|
|
|
ContactsLists: [
|
|
|
{
|
|
|
+ title: "项目名称",
|
|
|
+ dataIndex: "mingcheng",
|
|
|
+ key: "mingcheng",
|
|
|
+ render: (text, record) => {
|
|
|
+ return (
|
|
|
+ <Select
|
|
|
+ placeholder="请选择名称"
|
|
|
+ style={{ width: "150px" }}
|
|
|
+ // value={record.sortName}
|
|
|
+ onChange={(e) => {
|
|
|
+ record.sortName = e
|
|
|
+ // console.log(record);
|
|
|
+ this.state.dataSource.forEach(item => {
|
|
|
+ if(item.commodityName == record.sortName) {
|
|
|
+ record.cname = item.cname
|
|
|
+ record.id = item.id
|
|
|
+ record.sort = item.sort
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(e);
|
|
|
+
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {this.state.dataSource.map(item => {
|
|
|
+ return (
|
|
|
+ <Select.Option key={item.id} value={item.commodityName}>
|
|
|
+ {item.commodityName}
|
|
|
+ </Select.Option>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </Select>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "项目分类",
|
|
|
+ dataIndex: "fenlei",
|
|
|
+ key: "fenlei",
|
|
|
+ render: (text, record) => {
|
|
|
+ console.log(this.state.dataSource);
|
|
|
+ console.log(record);
|
|
|
+ // const arr = this.state.dataSource.filter(item => {
|
|
|
+ // return item.commodityName == record.sortName;
|
|
|
+ // })
|
|
|
+ // console.log("arr",arr);
|
|
|
+
|
|
|
+ return (
|
|
|
+ <Select
|
|
|
+ placeholder="请选择分类"
|
|
|
+ style={{ width: "150px" }}
|
|
|
+ // value={record.sortName}
|
|
|
+ onChange={e => {
|
|
|
+ record.cname = e;
|
|
|
+ console.log(record);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {this.state.dataSource.map(item => {
|
|
|
+ return (
|
|
|
+ <Select.Option key={item.id} value={item.cname}>
|
|
|
+ {item.cname}
|
|
|
+ </Select.Option>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </Select>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // title: "项目名称",
|
|
|
+ // dataIndex: "mingcheng",
|
|
|
+ // key: "mingcheng",
|
|
|
+ // render: (text, record) => {
|
|
|
+ // const dataSources = this.state.customerCuiArr || [];
|
|
|
+ // const optionsCui = dataSources.map(group => (
|
|
|
+ // <Select.Option key={group.id} value={group.bname}>
|
|
|
+ // {group.bname}
|
|
|
+ // </Select.Option>
|
|
|
+ // ));
|
|
|
+ // return (
|
|
|
+ // <div>
|
|
|
+ // <AutoComplete
|
|
|
+ // className="certain-category-search"
|
|
|
+ // dropdownClassName="certain-category-search-dropdown"
|
|
|
+ // dropdownMatchSelectWidth={false}
|
|
|
+ // dropdownStyle={{ width: 200 }}
|
|
|
+ // style={{ width: "200px" }}
|
|
|
+ // dataSource={optionsCui}
|
|
|
+ // placeholder="输入服务名称"
|
|
|
+ // value={this.state.commodityNameCui}
|
|
|
+ // onChange={this.httpChangeCui}
|
|
|
+ // filterOption={true}
|
|
|
+ // onSelect={this.selectAutoCui}
|
|
|
+ // >
|
|
|
+ //
|
|
|
+ // <Input />
|
|
|
+ //
|
|
|
+ // </AutoComplete>
|
|
|
+ // </div>
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ {
|
|
|
title: "催款科目",
|
|
|
dataIndex: "dunSubject",
|
|
|
key: "dunSubject",
|
|
@@ -309,6 +414,31 @@ const NewService = Form.create()(
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
+ title: "时间",
|
|
|
+ dataIndex: "time",
|
|
|
+ key: "time",
|
|
|
+ render: (text, record) => {
|
|
|
+ return (
|
|
|
+ <Select
|
|
|
+ placeholder="请选择时间"
|
|
|
+ style={{ width: "150px" }}
|
|
|
+ disabled={this.state.approval == 0 ? true : false}
|
|
|
+ onChange={e => {
|
|
|
+ console.log("ee", e);
|
|
|
+ record.waitDay = e;
|
|
|
+ console.log("time",record);
|
|
|
+
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Select.Option key={3}>3天</Select.Option>
|
|
|
+ <Select.Option key={5}>5天</Select.Option>
|
|
|
+ <Select.Option key={7}>7天</Select.Option>
|
|
|
+ <Select.Option key={15}>15天</Select.Option>
|
|
|
+ </Select>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
title: "金额(万)",
|
|
|
dataIndex: "money",
|
|
|
key: "money",
|
|
@@ -454,8 +584,8 @@ const NewService = Form.create()(
|
|
|
this.refs.signFirstPayment.focus();
|
|
|
return false;
|
|
|
}
|
|
|
- if(moneyVerify(this.state.firstAmount)) {
|
|
|
- return
|
|
|
+ if (moneyVerify(this.state.firstAmount)) {
|
|
|
+ return;
|
|
|
}
|
|
|
if (moneyVerify(this.state.totalAmount)) {
|
|
|
return;
|
|
@@ -532,12 +662,12 @@ const NewService = Form.create()(
|
|
|
loading: true
|
|
|
});
|
|
|
if (this.state.approval == 2 || this.state.approval == 3) {
|
|
|
- message.warning("特批状态不正确")
|
|
|
+ message.warning("特批状态不正确");
|
|
|
this.setState({
|
|
|
loading: false
|
|
|
});
|
|
|
- return
|
|
|
- }
|
|
|
+ return;
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
|
|
|
method: "post",
|
|
@@ -590,8 +720,8 @@ const NewService = Form.create()(
|
|
|
if (thisData.approval == 2) {
|
|
|
thisData.approval = "特批通过";
|
|
|
} else if (thisData.approval == 3) {
|
|
|
- thisData.approval = "特批驳回";
|
|
|
- }
|
|
|
+ thisData.approval = "特批驳回";
|
|
|
+ }
|
|
|
this.setState({
|
|
|
id: thisData.id,
|
|
|
kehuId: thisData.buyerId,
|
|
@@ -637,7 +767,6 @@ const NewService = Form.create()(
|
|
|
status: thisData.status
|
|
|
});
|
|
|
// console.log("kkkk",this.state.processStatus);
|
|
|
-
|
|
|
}.bind(this)
|
|
|
}).always(
|
|
|
function() {
|
|
@@ -701,7 +830,7 @@ const NewService = Form.create()(
|
|
|
contactSave() {
|
|
|
if (this.state.contactList) {
|
|
|
let cuiData = this.state.contactList;
|
|
|
- for (var a = 0; a < cuiData.length; a++) {
|
|
|
+ for (var a = 0; a < cuiData.length; a++) {
|
|
|
if (cuiData[a].money == "") {
|
|
|
message.warning("催款金额不能为空");
|
|
|
this.refs.signFirstPayment.focus();
|
|
@@ -733,6 +862,9 @@ const NewService = Form.create()(
|
|
|
});
|
|
|
if (!data.error.length) {
|
|
|
message.success("保存成功!");
|
|
|
+ this.setState({
|
|
|
+ cuiFlag: false
|
|
|
+ });
|
|
|
this.loaduserss();
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|
|
@@ -750,7 +882,8 @@ const NewService = Form.create()(
|
|
|
dunTarget: this.state.kehuId
|
|
|
});
|
|
|
this.setState({
|
|
|
- contactList: this.state.contactList
|
|
|
+ contactList: this.state.contactList,
|
|
|
+ cuiFlag: true
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -996,6 +1129,38 @@ const NewService = Form.create()(
|
|
|
}.bind(this)
|
|
|
);
|
|
|
},
|
|
|
+ supervisorCui(e) {
|
|
|
+ //客户名称与服务名称自动补全
|
|
|
+ let api = "/api/admin/order/getBusinessProjectByName";
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + api,
|
|
|
+ data: {
|
|
|
+ businessName: e
|
|
|
+ },
|
|
|
+ success: function(data) {
|
|
|
+ let thedata = data.data;
|
|
|
+ if (!thedata) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ thedata = {};
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ customerCuiArr: thedata
|
|
|
+ });
|
|
|
+ console.log(thedata);
|
|
|
+ }.bind(this)
|
|
|
+ }).always(
|
|
|
+ function() {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
+ },
|
|
|
//上级主管输入框失去焦点是判断客户是否存在
|
|
|
selectAuto(value) {
|
|
|
let kid = [];
|
|
@@ -1013,6 +1178,22 @@ const NewService = Form.create()(
|
|
|
kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
|
|
|
});
|
|
|
},
|
|
|
+ selectAutoCui(value) {
|
|
|
+ let kid = [];
|
|
|
+ let fwList = this.state.customerCuiArr;
|
|
|
+ fwList.map(function(item) {
|
|
|
+ if (value == item.bname) {
|
|
|
+ kid = item;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.setState({
|
|
|
+ commodityNameCui: value,
|
|
|
+ cid: kid.id,
|
|
|
+ //commodityPrice:kid.price==0?kid.price.toString():kid.price,
|
|
|
+ commodityFirstPayment:
|
|
|
+ kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
|
|
|
+ });
|
|
|
+ },
|
|
|
//客户
|
|
|
selectAutoCUT(value) {
|
|
|
let autoIds;
|
|
@@ -1037,6 +1218,14 @@ const NewService = Form.create()(
|
|
|
commodityName: e
|
|
|
});
|
|
|
},
|
|
|
+ httpChangeCui(e) {
|
|
|
+ if (e.length >= 1) {
|
|
|
+ this.supervisorCui(e, false);
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ commodityNameCui: e
|
|
|
+ });
|
|
|
+ },
|
|
|
//客户名称自动补全
|
|
|
customerChange(e) {
|
|
|
if (this.state.customType) {
|
|
@@ -1388,8 +1577,7 @@ const NewService = Form.create()(
|
|
|
componentDidMount() {
|
|
|
window.setTimeout(() => {
|
|
|
// console.log("我看看", this.state);
|
|
|
- },100)
|
|
|
-
|
|
|
+ }, 100);
|
|
|
},
|
|
|
|
|
|
reset() {
|
|
@@ -1489,6 +1677,7 @@ const NewService = Form.create()(
|
|
|
{group.bname}
|
|
|
</Select.Option>
|
|
|
));
|
|
|
+
|
|
|
|
|
|
return (
|
|
|
<div>
|
|
@@ -2141,74 +2330,84 @@ const NewService = Form.create()(
|
|
|
<span>{this.state.financeMobile}</span>
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
+
|
|
|
<div>
|
|
|
<span
|
|
|
style={{ marginLeft: "50px", fontSize: "20px" }}
|
|
|
>
|
|
|
- 催款节点
|
|
|
+ 项目业务
|
|
|
</span>
|
|
|
{this.state.processStatus == 0 ? (
|
|
|
<Button
|
|
|
type="primary"
|
|
|
- onClick={this.addcontact}
|
|
|
+ onClick={this.addDetailed}
|
|
|
style={{
|
|
|
float: "right",
|
|
|
marginRight: "50px",
|
|
|
marginBottom: "15px"
|
|
|
}}
|
|
|
>
|
|
|
- 添加催款节点
|
|
|
+ 添加项目明细
|
|
|
</Button>
|
|
|
) : (
|
|
|
""
|
|
|
)}
|
|
|
</div>
|
|
|
- <div className="clearfix">
|
|
|
+ <div
|
|
|
+ className="patent-table"
|
|
|
+ style={{ marginBottom: 10 }}
|
|
|
+ >
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
- <Form layout="horizontal" id="demand-form">
|
|
|
- <Table
|
|
|
- pagination={false}
|
|
|
- columns={this.state.ContactsLists}
|
|
|
- dataSource={this.state.contactList}
|
|
|
- />
|
|
|
- <Col
|
|
|
- span={24}
|
|
|
- offset={9}
|
|
|
- style={{ marginTop: "15px" }}
|
|
|
- ></Col>
|
|
|
- </Form>
|
|
|
+ <Table
|
|
|
+ columns={this.state.columns}
|
|
|
+ dataSource={this.state.dataSource}
|
|
|
+ pagination={this.state.pagination}
|
|
|
+ onRowClick={this.tableRowClick}
|
|
|
+ bordered
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
</Spin>
|
|
|
</div>
|
|
|
<div>
|
|
|
<span
|
|
|
style={{ marginLeft: "50px", fontSize: "20px" }}
|
|
|
>
|
|
|
- 项目业务
|
|
|
+ 催款节点
|
|
|
</span>
|
|
|
{this.state.processStatus == 0 ? (
|
|
|
<Button
|
|
|
type="primary"
|
|
|
- onClick={this.addDetailed}
|
|
|
+ onClick={this.addcontact}
|
|
|
style={{
|
|
|
float: "right",
|
|
|
marginRight: "50px",
|
|
|
marginBottom: "15px"
|
|
|
}}
|
|
|
+ disabled={this.state.cuiFlag ? true : false}
|
|
|
>
|
|
|
- 添加项目明细
|
|
|
+ 添加催款节点
|
|
|
</Button>
|
|
|
) : (
|
|
|
""
|
|
|
)}
|
|
|
</div>
|
|
|
- <div className="patent-table">
|
|
|
+ <div className="clearfix">
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
- <Table
|
|
|
- columns={this.state.columns}
|
|
|
- dataSource={this.state.dataSource}
|
|
|
- pagination={this.state.pagination}
|
|
|
- onRowClick={this.tableRowClick}
|
|
|
- />
|
|
|
+ <Form layout="horizontal" id="demand-form">
|
|
|
+ <Table
|
|
|
+ pagination={false}
|
|
|
+ columns={this.state.ContactsLists}
|
|
|
+ dataSource={this.state.contactList}
|
|
|
+ bordered
|
|
|
+ size="small"
|
|
|
+ scroll={{ x: "max-content", y: 0 }}
|
|
|
+ />
|
|
|
+ <Col
|
|
|
+ span={24}
|
|
|
+ offset={9}
|
|
|
+ style={{ marginTop: "15px" }}
|
|
|
+ ></Col>
|
|
|
+ </Form>
|
|
|
</Spin>
|
|
|
</div>
|
|
|
{this.state.processStatus == 0 ? (
|