|
@@ -33,6 +33,8 @@ import { ChooseList } from "../../order/orderNew/chooseList";
|
|
|
import OrderRiZi from "@/orderRiZi.jsx";
|
|
|
import "./table.less";
|
|
|
import {
|
|
|
+ getMaterialStatus,
|
|
|
+ getUrgentStatus,
|
|
|
getProcessStatus,
|
|
|
getApproval,
|
|
|
getTaskStatus,
|
|
@@ -207,6 +209,8 @@ const Task = React.createClass({
|
|
|
},
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
+ thirdMaterial: 0,
|
|
|
+ thirdUrgent: 0,
|
|
|
thirdCompanyName: "",
|
|
|
thirdUnitPrice: "",
|
|
|
thirdQuantity: 1,
|
|
@@ -220,6 +224,7 @@ const Task = React.createClass({
|
|
|
jiedianNew: [],
|
|
|
timeVisible: false,
|
|
|
ThirdListVisible: false,
|
|
|
+ PayNodeVisible: false, //新增付款节点
|
|
|
searchMore: true,
|
|
|
assignVisible: false,
|
|
|
releaseDate: [],
|
|
@@ -660,6 +665,22 @@ const Task = React.createClass({
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ title: "材料",
|
|
|
+ dataIndex: "material",
|
|
|
+ key: "material",
|
|
|
+ render: (text, record) => {
|
|
|
+ return getMaterialStatus(text);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "加急",
|
|
|
+ dataIndex: "urgent",
|
|
|
+ key: "urgent",
|
|
|
+ render: (text, record) => {
|
|
|
+ return getUrgentStatus(text);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
title: "备注",
|
|
|
dataIndex: "remarks",
|
|
|
key: "remarks",
|
|
@@ -1514,7 +1535,8 @@ const Task = React.createClass({
|
|
|
message.warning("请选择类型");
|
|
|
return;
|
|
|
}
|
|
|
- if (this.state.type == 1) {//专利
|
|
|
+ if (this.state.type == 1) {
|
|
|
+ //专利
|
|
|
if (!this.state.patentType) {
|
|
|
message.warning("请选择专利类型");
|
|
|
return;
|
|
@@ -1523,7 +1545,7 @@ const Task = React.createClass({
|
|
|
message.warning("请选择专利类型名称");
|
|
|
return;
|
|
|
}
|
|
|
- if (this.state.patentNameType==3) {
|
|
|
+ if (this.state.patentNameType == 3) {
|
|
|
if (!this.state.patentName) {
|
|
|
message.warning("请填写专利名称");
|
|
|
return;
|
|
@@ -1944,6 +1966,13 @@ const Task = React.createClass({
|
|
|
ThirdListVisible: true,
|
|
|
});
|
|
|
},
|
|
|
+ // 新增支付节点
|
|
|
+ addPayNode() {
|
|
|
+ console.log('dianji')
|
|
|
+ this.setState({
|
|
|
+ PayNodeVisible: true,
|
|
|
+ });
|
|
|
+ },
|
|
|
// 自动计算总金额
|
|
|
calculatedAmount() {
|
|
|
let currentTotalPrice;
|
|
@@ -1992,11 +2021,13 @@ const Task = React.createClass({
|
|
|
},
|
|
|
// 保存供应商信息
|
|
|
handleCancelq() {
|
|
|
- let api
|
|
|
- if(this.state.ThirdId){//修改
|
|
|
- api='/api/admin/company/updateCompany'
|
|
|
- }else{//新增
|
|
|
- api='/api/admin/company/addCompany'
|
|
|
+ let api;
|
|
|
+ if (this.state.ThirdId) {
|
|
|
+ //修改
|
|
|
+ api = "/api/admin/company/updateCompany";
|
|
|
+ } else {
|
|
|
+ //新增
|
|
|
+ api = "/api/admin/company/addCompany";
|
|
|
}
|
|
|
this.setState({
|
|
|
loading: true,
|
|
@@ -2007,12 +2038,14 @@ const Task = React.createClass({
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
data: {
|
|
|
- id:this.state.ThirdId,//id
|
|
|
+ id: this.state.ThirdId, //id
|
|
|
tid: this.state.tid, //订单编号
|
|
|
companyName: this.state.thirdCompanyName, //第三方名称
|
|
|
unitPrice: this.state.thirdUnitPrice, //单价
|
|
|
quantity: this.state.thirdQuantity, //数量
|
|
|
totalAmount: this.state.currentTotalPrice, //总价
|
|
|
+ material: this.state.thirdMaterial, //材料
|
|
|
+ urgent: this.state.thirdUrgent, //加急
|
|
|
remarks: this.state.thirdRemarks,
|
|
|
},
|
|
|
}).done(
|
|
@@ -2023,7 +2056,7 @@ const Task = React.createClass({
|
|
|
if (!data.error.length) {
|
|
|
message.success("保存成功!");
|
|
|
this.setState({
|
|
|
- ThirdId:"",
|
|
|
+ ThirdId: "",
|
|
|
ThirdListVisible: false,
|
|
|
thirdCompanyName: "", //第三方名称
|
|
|
thirdUnitPrice: "", //单价
|
|
@@ -2042,53 +2075,56 @@ const Task = React.createClass({
|
|
|
// 取消
|
|
|
handleCancelclose() {
|
|
|
this.setState({
|
|
|
+ PayNodeVisible: false,
|
|
|
ThirdListVisible: false,
|
|
|
thirdCompanyName: "", //第三方名称
|
|
|
thirdUnitPrice: "", //单价
|
|
|
thirdQuantity: 1, //数量
|
|
|
currentTotalPrice: "", //总价
|
|
|
thirdRemarks: "",
|
|
|
- ThirdId:"",
|
|
|
+ ThirdId: "",
|
|
|
});
|
|
|
},
|
|
|
// 删除供应商信息
|
|
|
confirmDeletNew(index) {
|
|
|
- this.setState({
|
|
|
- loading: true,
|
|
|
- ThirdListVisible: false,
|
|
|
- });
|
|
|
- $.ajax({
|
|
|
- url: globalConfig.context + "/api/admin/company/deleteCompany",
|
|
|
- method: "post",
|
|
|
- data: {
|
|
|
- id: index.id,
|
|
|
- },
|
|
|
- }).done(
|
|
|
- function (data) {
|
|
|
- this.setState({
|
|
|
- loading: false,
|
|
|
- });
|
|
|
- if (!data.error.length) {
|
|
|
- message.success("删除成功!");
|
|
|
- this.thirdTable(this.state.tid);
|
|
|
- } else {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }
|
|
|
- }.bind(this)
|
|
|
- );
|
|
|
+ this.setState({
|
|
|
+ loading: true,
|
|
|
+ ThirdListVisible: false,
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ url: globalConfig.context + "/api/admin/company/deleteCompany",
|
|
|
+ method: "post",
|
|
|
+ data: {
|
|
|
+ id: index.id,
|
|
|
+ },
|
|
|
+ }).done(
|
|
|
+ function (data) {
|
|
|
+ this.setState({
|
|
|
+ loading: false,
|
|
|
+ });
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success("删除成功!");
|
|
|
+ this.thirdTable(this.state.tid);
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
},
|
|
|
//点击供应商详情
|
|
|
- tableRowClickOne(record) {
|
|
|
- this.setState({
|
|
|
- ThirdListVisible: true,
|
|
|
- ThirdId:record.id,//供应商id
|
|
|
- thirdCompanyName: record.companyName, //第三方名称
|
|
|
- thirdUnitPrice: record.unitPrice, //单价
|
|
|
- thirdQuantity: record.quantity, //数量
|
|
|
- currentTotalPrice:record.totalAmount, //总价
|
|
|
- thirdRemarks: record.remarks,
|
|
|
- });
|
|
|
- },
|
|
|
+ tableRowClickOne(record) {
|
|
|
+ this.setState({
|
|
|
+ ThirdListVisible: true,
|
|
|
+ ThirdId: record.id, //供应商id
|
|
|
+ thirdCompanyName: record.companyName, //第三方名称
|
|
|
+ thirdUnitPrice: record.unitPrice, //单价
|
|
|
+ thirdQuantity: record.quantity, //数量
|
|
|
+ currentTotalPrice: record.totalAmount, //总价
|
|
|
+ thirdMaterial: record.material, //有无材料
|
|
|
+ thirdUrgent: record.urgent, //加急情况
|
|
|
+ thirdRemarks: record.remarks,
|
|
|
+ });
|
|
|
+ },
|
|
|
render() {
|
|
|
const dataSources = this.state.customerArr || [];
|
|
|
console.log(dataSources);
|
|
@@ -3265,7 +3301,8 @@ const Task = React.createClass({
|
|
|
{/* 第三方信息专利 */}
|
|
|
<div
|
|
|
style={{
|
|
|
- display: this.state.type == 1 ? "block" : "none",
|
|
|
+ // display: this.state.type == 1 ? "block" : "none",
|
|
|
+ display: this.state.type == 1 ? "block" : "block",
|
|
|
}}
|
|
|
>
|
|
|
<span
|
|
@@ -3302,7 +3339,8 @@ const Task = React.createClass({
|
|
|
<div
|
|
|
className="clearfix"
|
|
|
style={{
|
|
|
- display: this.state.type == 1 ? "block" : "none",
|
|
|
+ // display: this.state.type == 1 ? "block" : "none",
|
|
|
+ display: this.state.type == 1 ? "block" : "block",
|
|
|
}}
|
|
|
>
|
|
|
<Spin spinning={this.state.loading}>
|
|
@@ -3324,6 +3362,41 @@ const Task = React.createClass({
|
|
|
</Form>
|
|
|
</Spin>
|
|
|
</div>
|
|
|
+ <div
|
|
|
+ style={{
|
|
|
+ // display: this.state.type == 1 ? "block" : "none",
|
|
|
+ display: this.state.type == 1 ? "block" : "block",
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ style={{
|
|
|
+ marginLeft: "50px",
|
|
|
+ fontSize: "18px",
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 付款节点
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ style={{
|
|
|
+ display: "inline-block",
|
|
|
+ marginLeft: 10,
|
|
|
+ color: "red",
|
|
|
+ }}
|
|
|
+ ></span>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={(e) => {
|
|
|
+ this.addPayNode();
|
|
|
+ }}
|
|
|
+ style={{
|
|
|
+ float: "right",
|
|
|
+ marginRight: "50px",
|
|
|
+ marginBottom: "15px",
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ +新增付款节点
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
<div className="clearfix">
|
|
|
<FormItem
|
|
|
className="half-item"
|
|
@@ -4757,6 +4830,60 @@ const Task = React.createClass({
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
+ <FormItem {...formItemLayout} label="材料">
|
|
|
+ <Select
|
|
|
+ value={getMaterialStatus(this.state.thirdMaterial)}
|
|
|
+ onChange={(val) => {
|
|
|
+ this.setState({
|
|
|
+ thirdMaterial: val,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ style={{ width: "220px" }}
|
|
|
+ defaultValue="0"
|
|
|
+ >
|
|
|
+ <Option value="1">有材料</Option>
|
|
|
+ <Option value="0">无材料</Option>
|
|
|
+ </Select>
|
|
|
+ <span className="mandatory">*</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem {...formItemLayout} label="加急">
|
|
|
+ {/* <Input
|
|
|
+ value={this.state.thirdQuantity}
|
|
|
+ placeholder="请输入数量(必填项)"
|
|
|
+ required="required"
|
|
|
+ onBlur={this.calculatedAmount}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ thirdQuantity: e.target.value,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ style={{ width: "220px" }}
|
|
|
+ /> */}
|
|
|
+ <Select
|
|
|
+ value={getUrgentStatus(this.state.thirdUrgent)}
|
|
|
+ onChange={(val) => {
|
|
|
+ this.setState({
|
|
|
+ thirdUrgent: val,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ style={{ width: "220px" }}
|
|
|
+ defaultValue="0"
|
|
|
+ >
|
|
|
+ <Option value="0">无加急</Option>
|
|
|
+ <Option value="1">加急3天</Option>
|
|
|
+ <Option value="2">加急4天</Option>
|
|
|
+ <Option value="3">加急5-10天</Option>
|
|
|
+ <Option value="4">加急11-15天</Option>
|
|
|
+ <Option value="5">加急16-20天</Option>
|
|
|
+ <Option value="6">加急21-25天</Option>
|
|
|
+ <Option value="7">加急26-30天</Option>
|
|
|
+ </Select>
|
|
|
+ <span className="mandatory">*</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
<FormItem
|
|
|
style={{ height: "auto" }}
|
|
|
labelCol={{ span: 4 }}
|
|
@@ -4783,7 +4910,126 @@ const Task = React.createClass({
|
|
|
className="cancel"
|
|
|
type="primary"
|
|
|
onClick={this.handleCancelq}
|
|
|
+ style={{ marginLeft: "300px" }}
|
|
|
+ htmlType="submit"
|
|
|
+ >
|
|
|
+ 保存
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ className="cancel"
|
|
|
+ type="ghost"
|
|
|
+ onClick={this.handleCancelclose}
|
|
|
style={{ marginLeft: "50px" }}
|
|
|
+ >
|
|
|
+ 取消
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Spin>
|
|
|
+ </Form>
|
|
|
+ </Modal>
|
|
|
+
|
|
|
+ <Modal
|
|
|
+ visible={this.state.PayNodeVisible}
|
|
|
+ onCancel={this.handleCancelclose}
|
|
|
+ width={800}
|
|
|
+ title="新增付款节点"
|
|
|
+ footer=""
|
|
|
+ // width={1300}
|
|
|
+ className="admin-desc-content"
|
|
|
+ >
|
|
|
+ <Form
|
|
|
+ layout="horizontal"
|
|
|
+ // onSubmit={this.handleSubmit1}
|
|
|
+ // id="demand-form"
|
|
|
+ style={{ paddingBottom: "40px" }}
|
|
|
+ >
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <div className="clearfix">
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem {...formItemLayout} label="供应商名称">
|
|
|
+ <AutoComplete
|
|
|
+ className="certain-category-search"
|
|
|
+ dropdownClassName="certain-category-search-dropdown"
|
|
|
+ dropdownMatchSelectWidth={false}
|
|
|
+ dropdownStyle={{ width: 220 }}
|
|
|
+ style={{ width: "220px" }}
|
|
|
+ dataSource={options}
|
|
|
+ placeholder="请输入供应商名称"
|
|
|
+ value={this.state.thirdCompanyName}
|
|
|
+ onChange={this.httpChange}
|
|
|
+ filterOption={true}
|
|
|
+ onBlur={this.blurChange}
|
|
|
+ onSelect={this.selectAuto}
|
|
|
+ required="required"
|
|
|
+ ></AutoComplete>
|
|
|
+ <span className="mandatory">*</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem {...formItemLayout} label="付款科目">
|
|
|
+ <Input
|
|
|
+ value={this.state.thirdUnitPrice}
|
|
|
+ placeholder="请选择付款科目(必填项)"
|
|
|
+ required="required"
|
|
|
+ onBlur={this.calculatedAmount}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ thirdUnitPrice: e.target.value,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ style={{ width: "220px" }}
|
|
|
+ />
|
|
|
+ <span className="mandatory">*</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem {...formItemLayout} label="付款时间">
|
|
|
+ <Input
|
|
|
+ value={this.state.thirdQuantity}
|
|
|
+ placeholder="请输入数量(必填项)"
|
|
|
+ required="required"
|
|
|
+ onBlur={this.calculatedAmount}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ thirdQuantity: e.target.value,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ style={{ width: "220px" }}
|
|
|
+ />
|
|
|
+ <span className="mandatory">*</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem {...formItemLayout} label="数量">
|
|
|
+ <Input
|
|
|
+ value={this.state.thirdQuantity}
|
|
|
+ placeholder="请输入数量(必填项)"
|
|
|
+ required="required"
|
|
|
+ onBlur={this.calculatedAmount}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ thirdQuantity: e.target.value,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ style={{ width: "220px" }}
|
|
|
+ />
|
|
|
+ <span className="mandatory">*</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem {...formItemLayout} label="总价(万元)">
|
|
|
+ <span>{this.state.currentTotalPrice}</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
+ <div className="addSave" style={{ marginTop: "15px" }}>
|
|
|
+ <Button
|
|
|
+ className="cancel"
|
|
|
+ type="primary"
|
|
|
+ onClick={this.handleCancelq}
|
|
|
+ style={{ marginLeft: "300px" }}
|
|
|
htmlType="submit"
|
|
|
>
|
|
|
保存
|