Browse Source

完成催款节点功能(含驳回)

mentoswzq 5 years ago
parent
commit
080fb16ce6

+ 2 - 2
js/component/dataDic.js

@@ -2449,7 +2449,7 @@ module.exports = {
     },
     {
       value: "1",
-      key: "特批待审核"
+      key: "特批"
     },
     {
       value: "2",
@@ -3457,7 +3457,7 @@ module.exports = {
         },
         {
           value: "3",
-          key: "知识产权-下证"
+          key: "知识产权-专利下证"
         }
       ]
     }

File diff suppressed because it is too large
+ 907 - 661
js/component/manageCenter/financialManage/orderDetail/orderDetail.jsx


+ 76 - 26
js/component/manageCenter/order/orderNew/addService.jsx

@@ -44,6 +44,7 @@ import PicturesWall from "./changeComponent/picturesWall.js";
 import { changeType, getChangeType } from "./changeComponent/changeDetailYxgly";
 // const Options = Select.Option;
 const Option = AutoComplete.Option;
+const confirm = Modal.confirm;
 
 const NewService = Form.create()(
   React.createClass({
@@ -233,23 +234,10 @@ const NewService = Form.create()(
               return (
                 <div>
                   {this.state.processStatus == 0 ? (
-                    <Popconfirm
-                      title="是否删除?"
-                      onConfirm={() => {
-                        this.delectRow(record);
-                      }}
-                      okText="是"
-                      cancelText="否"
-                    >
-                      <Button
-                        onClick={e => {
-                          e.stopPropagation();
-                        }}
-                        type="danger"
-                      >
-                        删除
-                      </Button>
-                    </Popconfirm>
+                    <Button onClick={e => {
+                      e.stopPropagation()
+                      this.showConfirm(this.delectRow,record)
+                    }}>删除</Button>
                   ) : (
                     ""
                   )}
@@ -487,6 +475,24 @@ const NewService = Form.create()(
                     placeholder="请选择分类"
                     onChange={e => {
                       record.dunType = e;
+                      if(e != 1) {
+                        this.setState({
+                          timeFlag: true
+                        })
+                      }else {
+                        this.setState({
+                          timeFlag: false
+                        })
+                      }
+                      if(e == 1 && record.sort == 6) {
+                        this.setState({
+                          yearFlag: true
+                        })
+                      }else if(e != 1 && record.sort == 6) {
+                        this.setState({
+                          yearFlag: false
+                        })
+                      }
                       console.log(e);
                     }}
                   >
@@ -518,13 +524,18 @@ const NewService = Form.create()(
             key: "waitDay",
             render: (text, record) => {
               if (record.dunTypeName) {
-                return <span>{text}</span>;
+                if(!text) {
+                  var str = ""
+                }else {
+                  var str = text + "天";
+                }
+                return <span>{str}</span>;
               }
               return (
                 <Select
                   placeholder="请选择时间"
                   style={{ width: "150px" }}
-                  disabled={this.state.approval == 0 ? true : false}
+                  disabled={this.state.approval != 0 && !this.state.timeFlag ? false : true}
                   onChange={e => {
                     console.log("ee", e);
                     record.waitDay = e;
@@ -651,6 +662,9 @@ const NewService = Form.create()(
                       type="primary"
                       onClick={e => {
                         this.contactSaveNew(record);
+                        this.setState({
+                          addFlag: false
+                        })
                       }}
                     >
                       保存
@@ -756,11 +770,25 @@ const NewService = Form.create()(
         }
       } else {
       }
-      for(let i = 0; i < this.state.contactListNew.length; i++) {
-        if(!this.state.contactListNew[i].id) {
-          message.warning("请保存催款节点")
+      const arr = this.state.contactListNew || []
+      for (let i = 0; i < arr.length; i++) {
+        if (
+          arr[i].dunType == 1 &&
+          arr[i].waitDay &&
+          this.state.approval == 0
+        ) {
+          message.warning(
+            "非特批存在填写催款节点首付时间的情况,请删除后重新填写保存"
+          );
+          return false;
+        }else if(arr[i] != 1 && !arr[i].waitDay && this.state.approval == 1) {
+          message.warning("特批存在首付催款节点未填写时间的情况,请删除后重新填写保存")
           return false
         }
+        if (!this.state.contactListNew[i].id) {
+          message.warning("请保存催款节点");
+          return false;
+        }
       }
       this.setState({
         loading: true
@@ -1189,7 +1217,8 @@ const NewService = Form.create()(
                 status: thisData.status,
                 waitDay: thisData.waitDay,
                 effectiveCount: thisData.effectiveCount,
-                startDate: thisData.startDate
+                startDate: thisData.startDate,
+                dunType: thisData.dunType
               });
             }
             this.setState({
@@ -1254,6 +1283,9 @@ const NewService = Form.create()(
         message.warning("请选择对应科目");
         return;
       }
+      if (record.dunType != 1) {
+        record.waitDay = ""
+      }
       this.setState({
         loading: true
       });
@@ -1386,7 +1418,8 @@ const NewService = Form.create()(
         {
           visible: false,
           mark: false,
-          cuiFlag: false
+          cuiFlag: false,
+          addFlag: false
         },
         () => {
           this.setState({
@@ -2080,6 +2113,17 @@ const NewService = Form.create()(
         });
       }
     },
+    showConfirm(fn,record) {
+      confirm({
+        title: '确定删除此项目吗?',
+        content: <span style={{ color: "red" }}>删除后会将该项目下的所有催款节点自动清除!!!</span>,
+        onOk() {
+          fn(record)
+        },
+        onCancel() {
+        },
+      });
+},
     render() {
       const FormItem = Form.Item;
       const { TabPane } = Tabs;
@@ -2152,6 +2196,7 @@ const NewService = Form.create()(
             width={!this.props.userDetaile ? "600px" : "900px"}
             title={!this.props.userDetaile ? "创建订单" : ""}
             footer=""
+            // width={1300}
             className="admin-desc-content"
           >
             <Form
@@ -2296,7 +2341,9 @@ const NewService = Form.create()(
                                   <Select
                                     placeholder="请选择客户所属类型"
                                     style={{ width: "240px" }}
-                                    value={this.state.approval}
+                                    value={getApprovedState(
+                                      this.state.approval
+                                    )}
                                     onChange={e => {
                                       this.setState({ approval: e });
                                     }}
@@ -2897,9 +2944,10 @@ const NewService = Form.create()(
                             </span>
                             <Button
                               type="primary"
-                              disabled={cuiDataList.length ? true : false}
+                              disabled={this.state.addFlag ? true : false}
                               // onClick={this.addcontact}
                               onClick={e => {
+                                this.setState({ addFlag: true });
                                 this.addcontactNew();
                               }}
                               style={{
@@ -2928,6 +2976,8 @@ const NewService = Form.create()(
                                   columns={this.state.ContactsListsNew}
                                   dataSource={this.state.contactListNew}
                                   scroll={{ x: "max-content", y: 0 }}
+                                  bordered
+                                  size="small"
                                 />
                                 <Col
                                   span={24}

+ 73 - 10
js/component/manageCenter/order/orderNew/reject.jsx

@@ -341,7 +341,7 @@ const IntentionCustomer = Form.create()(
                         record.isSave = true;
                         record.sort = item.sort;
                         console.log(record);
-                        
+
                         cuiJieDian.forEach(item => {
                           if (item.value == record.sort) {
                             record.arr = item.children;
@@ -376,8 +376,6 @@ const IntentionCustomer = Form.create()(
             dataIndex: "projectType",
             key: "projectType",
             render: (text, record) => {
-              console.log("看分类", record);
-              
               if (text) {
                 let arr = this.state.dataSourceX || [];
                 let str = "";
@@ -429,6 +427,24 @@ const IntentionCustomer = Form.create()(
                     placeholder="请选择分类"
                     onChange={e => {
                       record.dunType = e;
+                      if (e != 1) {
+                        this.setState({
+                          timeFlag: true
+                        });
+                      } else {
+                        this.setState({
+                          timeFlag: false
+                        });
+                      }
+                      if (e == 1 && record.sort == 6) {
+                        this.setState({
+                          yearFlag: true
+                        });
+                      } else if (e != 1 && record.sort == 6) {
+                        this.setState({
+                          yearFlag: false
+                        });
+                      }
                       console.log(e);
                     }}
                   >
@@ -460,13 +476,22 @@ const IntentionCustomer = Form.create()(
             key: "waitDay",
             render: (text, record) => {
               if (record.dunTypeName) {
-                return <span>{text}</span>;
+                if (!text) {
+                  var str = "";
+                } else {
+                  var str = text + "天";
+                }
+                return <span>{str}</span>;
               }
               return (
                 <Select
                   placeholder="请选择时间"
                   style={{ width: "150px" }}
-                  disabled={this.state.approval == 0 ? true : false}
+                  disabled={
+                    this.state.approval != 0 && !this.state.timeFlag
+                      ? false
+                      : true
+                  }
                   onChange={e => {
                     console.log("ee", e);
                     record.waitDay = e;
@@ -499,7 +524,7 @@ const IntentionCustomer = Form.create()(
                       required="required"
                       onChange={e => {
                         record.money = e.target.value;
-                        this.setState({ contactListNew: this.state.contactListNew });
+                        this.setState({ contactList: this.state.contactList });
                       }}
                       style={{ width: "120px" }}
                     />
@@ -593,6 +618,7 @@ const IntentionCustomer = Form.create()(
                       type="primary"
                       onClick={e => {
                         this.contactSaveNew(record);
+                        this.setState({ addFlag: false });
                       }}
                     >
                       保存
@@ -615,6 +641,7 @@ const IntentionCustomer = Form.create()(
                 <Select
                   placeholder="请选择催款科目"
                   value={record.dunSubject}
+                  disabled
                   style={{ width: "150px" }}
                   onChange={e => {
                     record.dunSubject = e;
@@ -638,6 +665,7 @@ const IntentionCustomer = Form.create()(
               return (
                 <Input
                   value={record.money}
+                  disabled
                   placeholder="请输入金额(必填项)"
                   key={record.id}
                   required="required"
@@ -689,7 +717,7 @@ const IntentionCustomer = Form.create()(
                   {record.id ? (
                     ""
                   ) : (
-                    <Button type="primary" onClick={this.contactSave}>
+                    <Button type="primary" onClick={this.contactSave} disabled>
                       保存
                     </Button>
                   )}
@@ -966,7 +994,8 @@ const IntentionCustomer = Form.create()(
                 status: thisData.status,
                 waitDay: thisData.waitDay,
                 effectiveCount: thisData.effectiveCount,
-                startDate: thisData.startDate
+                startDate: thisData.startDate,
+                dunType: thisData.dunType
               });
             }
             this.setState({
@@ -1031,6 +1060,9 @@ const IntentionCustomer = Form.create()(
         message.warning("请选择对应科目");
         return;
       }
+      if (record.dunType != 1) {
+        record.waitDay = "";
+      }
       this.setState({
         loading: true
       });
@@ -1204,6 +1236,33 @@ const IntentionCustomer = Form.create()(
         });
         return false;
       }
+      const arr = this.state.contactListNew || [];
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i].dunType == 1 && arr[i].waitDay && this.state.approval == 0) {
+          message.warning(
+            "非特批存在填写催款节点首付时间的情况,请删除后重新填写保存"
+          );
+          this.setState({
+            flag: false
+          });
+          return false;
+        } else if (arr[i] != 1 && !arr[i].waitDay && this.state.approval == 1) {
+          message.warning(
+            "特批存在首付催款节点未填写时间的情况,请删除后重新填写保存"
+          );
+          this.setState({
+            flag: false
+          });
+          return false;
+        }
+        if (!this.state.contactListNew[i].id) {
+          message.warning("请保存催款节点");
+          this.setState({
+            flag: false
+          });
+          return false;
+        }
+      }
       $.ajax({
         method: "post",
         dataType: "json",
@@ -1538,7 +1597,8 @@ const IntentionCustomer = Form.create()(
     //关闭详情
     visitCancel() {
       this.setState({
-        visible: false
+        visible: false,
+        addFlag: false
       });
       this.resets();
     },
@@ -2143,9 +2203,10 @@ const IntentionCustomer = Form.create()(
                       </span>
                       <Button
                         type="primary"
-                        disabled={cuiDataList.length ? true : false}
+                        disabled={cuiDataList.length || this.state.addFlag ? true : false}
                         // onClick={this.addcontact}
                         onClick={e => {
+                          this.setState({ addFlag: true });
                           this.addcontactNew();
                         }}
                         style={{
@@ -2165,6 +2226,8 @@ const IntentionCustomer = Form.create()(
                             columns={this.state.ContactsListsNew}
                             dataSource={this.state.contactListNew}
                             scroll={{ x: "max-content", y: 0 }}
+                            bordered
+                            size="small"
                           />
                           <Col
                             span={24}

+ 3 - 0
js/component/manageCenter/project/task/myTask.jsx

@@ -529,6 +529,9 @@ const Task = React.createClass({
       attachmentUrls = picArr.join(",");
     }
 
+    this.setState({
+      loading: true
+    })
     $.ajax({
       method: "POST",
       dataType: "json",

+ 86 - 30
js/component/manageCenter/set/business/businessProject.jsx

@@ -446,7 +446,8 @@ const BusinessProject=Form.create()(React.createClass({
 		            	activityPrice:this.state.editActivityPrice,//活动价
 		            	activityFlag:this.state.editActivityFlag,//活动生效标识
 		            	memberPrice:this.state.editMemberPrice,//项目ID
-		            	status:this.state.editStatus,//项目状态 
+						status:this.state.editStatus,//项目状态 
+						type: this.state.typeStatus,//项目分类
 		            	country:isCountry,//是否全国
 		            	province:pro?pro:'',//省
 		            	city:city?city:'',//市
@@ -524,7 +525,14 @@ const BusinessProject=Form.create()(React.createClass({
 	                	ProvinceCity.push(parseInt(thisdata.city));
 	                	ProvinceCity.push(parseInt(thisdata.district));
                 	}
-                	
+					let str = ""
+					if(thisdata.type == 0) {
+						str = "通用"
+					}else if(thisdata.type == 1) {
+						str = "专利"
+					}else if(thisdata.type == 2) {
+						str = "软著"
+					}
                     theArr.push({
                          editId: thisdata.id,//每一条记录的ID
                          editName:thisdata.bname,//项目名称
@@ -540,7 +548,9 @@ const BusinessProject=Form.create()(React.createClass({
                          editOffset: thisdata.offset,//最低折扣
                          editMemberPrice: thisdata.memberPrice,//会员价
                          editActivityFlag:thisdata.activityFlag,//活动生效标识
-                         editStatus:thisdata.status,//品类状态 
+						 editStatus:thisdata.status,//品类状态 
+						 typeStr: str,
+						 typeStatus: thisdata.type,
                          editCreateId:thisdata.createName,//创建人
                          editTime:thisdata.createTimeFormattedDate,//创建时间
                          editIntroduce:thisdata.introduce,//服务内容
@@ -551,34 +561,56 @@ const BusinessProject=Form.create()(React.createClass({
                          orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
 						 cditCompanyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
                     }); 
-                };
+				};
+				let str = ""
+					if(thisdata.type == 0) {
+						str = "通用"
+					}else if(thisdata.type == 1) {
+						str = "专利"
+					}else if(thisdata.type == 2) {
+						str = "软著"
+					}
                 this.setState({
-                	 editId: thisdata.id,//每一条记录的ID
-                     editName:thisdata.bname,//项目名称
-                     editCname: thisdata.cname,//项目分类
-                     editCid: thisdata.cid,//项目分类
-                     editCountry: thisdata.country,//是否全国
-                     editProvince: thisdata.province,//省
-                     editCity: thisdata.city,//市
-                     editDistrict: thisdata.district,//区
-                     editPrice: thisdata.price,//市场价
-                     firstPayment:thisdata.firstPayment,
-                     editActivityPrice: thisdata.activityPrice,//活动价
-                     editOffset: thisdata.offset,//最低折扣
-                     editMemberPrice: thisdata.memberPrice,//会员价
-                     editActivityFlag:thisdata.activityFlag,//活动生效标识
-                     editStatus:thisdata.status,//品类状态 
-                     editCreateId:thisdata.createName,//创建人
-                     editTime:thisdata.createTimeFormattedDate,//创建时间
-                     editIntroduce:thisdata.introduce,//服务内容
-                     editProjectUrl:thisdata.projectUrl,//项目地址
-                     editValueEffect:thisdata.valueEffect,//价值及作用
-                     editClientSize:thisdata.clientSize,//基本条件
-                     editBoutique:thisdata.boutique,//是否精品
-                     orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
-					 companyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
-					 editDataSource: theArr,
-                     ProvinceCity:ProvinceCity,
+                  editId: thisdata.id, //每一条记录的ID
+                  editName: thisdata.bname, //项目名称
+                  editCname: thisdata.cname, //项目分类
+                  editCid: thisdata.cid, //项目分类
+                  editCountry: thisdata.country, //是否全国
+                  editProvince: thisdata.province, //省
+                  editCity: thisdata.city, //市
+                  editDistrict: thisdata.district, //区
+                  editPrice: thisdata.price, //市场价
+                  firstPayment: thisdata.firstPayment,
+                  editActivityPrice: thisdata.activityPrice, //活动价
+                  editOffset: thisdata.offset, //最低折扣
+                  editMemberPrice: thisdata.memberPrice, //会员价
+                  editActivityFlag: thisdata.activityFlag, //活动生效标识
+                  editStatus: thisdata.status, //品类状态
+                  typeStr: str,
+                  typeStatus: thisdata.type,
+                  editCreateId: thisdata.createName, //创建人
+                  editTime: thisdata.createTimeFormattedDate, //创建时间
+                  editIntroduce: thisdata.introduce, //服务内容
+                  editProjectUrl: thisdata.projectUrl, //项目地址
+                  editValueEffect: thisdata.valueEffect, //价值及作用
+                  editClientSize: thisdata.clientSize, //基本条件
+                  editBoutique: thisdata.boutique, //是否精品
+                  orgCodeUrl: thisdata.minLogo
+                    ? splitUrl(
+                        thisdata.minLogo,
+                        ",",
+                        globalConfig.avatarHost + "/upload"
+                      )
+                    : [],
+                  companyLogoUrl: thisdata.maxLogo
+                    ? splitUrl(
+                        thisdata.maxLogo,
+                        ",",
+                        globalConfig.avatarHost + "/upload"
+                      )
+                    : [],
+                  editDataSource: theArr,
+                  ProvinceCity: ProvinceCity
                 });
             }.bind(this),
         }).always(function () {
@@ -1493,6 +1525,30 @@ const BusinessProject=Form.create()(React.createClass({
 				                                }
 				                              </Select>
 				                   		 </FormItem>
+				                   		  <FormItem  className="half-item"
+					                         	labelCol={{ span: 4 }}
+						                        wrapperCol={{ span: 12 }}
+					                           	label="项目分类"
+					                         > 
+					                          <Select placeholder="项目分类" value={this.state.typeStr} style={{width:'94%'}}
+				                                onChange={(e)=>{
+													let str = ""
+													if(e == 0) {
+														str = "通用"
+													}else if(e == 1) {
+														str = "专利"
+													}else if(e == 2) {
+														str = "软著"
+													}
+													this.setState({
+														  typeStatus: e,
+														  typeStr: str
+                                                        });}}> 
+													<Select.Option key={0} >通用</Select.Option>
+													<Select.Option key={1} >专利</Select.Option>
+													<Select.Option key={2} >软著</Select.Option>
+				                              </Select>
+				                   		 </FormItem>
 				                   		 <FormItem  className="half-item"
 						                    labelCol={{ span: 4 }}
 						                    wrapperCol={{ span: 12 }}