Parcourir la source

会员模块和客户模块bug修改

dev01 il y a 7 mois
Parent
commit
6d91f0832f

+ 14 - 7
js/component/common/projectOperation/newAddProject.jsx

@@ -613,6 +613,15 @@ class NewAddProject extends Component {
       serviceYear: this.state.serviceYear,
       taskComment: this.state.taskComment,
     }
+    let vipAddInfo = {
+      tid: this.state.tid,
+      serviceYear: this.state.serviceYear,//本次派单
+      taskComment: this.state.taskComment,//服务说明
+      memberType: this.state.memberType,//会员付款状态
+      pictureUrl: pictureUrl.length ? pictureUrl : undefined,//附件
+    }
+
+    
     if (this.state.projectType == 1) {
       info.htMember = this.state.newCheck.includes(1) ? 1 : 0
       info.additionalDeduction = this.state.newCheck.includes(2) ? 1 : 0
@@ -621,14 +630,12 @@ class NewAddProject extends Component {
       changeInfo.htMember = this.state.newCheck.includes(1) ? 1 : 0
       changeInfo.additionalDeduction = this.state.newCheck.includes(2) ? 1 : 0
       changeInfo.rdAwardsubsidy = this.state.newCheck.includes(3) ? 1 : 0
+
+      vipAddInfo.htMember = this.state.newCheck.includes(1) ? 1 : 0
+      vipAddInfo.additionalDeduction = this.state.newCheck.includes(2) ? 1 : 0
+      vipAddInfo.rdAwardsubsidy = this.state.newCheck.includes(3) ? 1 : 0
     }
-    let vipAddInfo = {
-      tid: this.state.tid,
-      serviceYear: this.state.serviceYear,//本次派单
-      taskComment: this.state.taskComment,//服务说明
-      memberType: this.state.memberType,//会员付款状态
-      pictureUrl: pictureUrl.length ? pictureUrl : undefined,//附件
-    }
+    
     $.ajax({
       method: "POST",
       dataType: "json",

+ 107 - 51
js/component/common/projectOperation/newEditProject.jsx

@@ -5,7 +5,7 @@ import {
   Checkbox
 } from "antd";
 import { boutique } from "../../dataDic";
-import $ from "jquery";
+import $, { error } from "jquery";
 import { getboutique, splitUrl } from "../../tools";
 import moment from "moment";
 import { vipYear, YearList } from "../../dataDic";
@@ -78,32 +78,35 @@ class newEditProject extends Component {
    */
   getCheckTypeList(checkTypeList) {
     let newCheckType = [];
-    // 高新会员
-    let htMember = 0;
-    // 加计扣除
-    let additionalDeduction = 0;
-    // 研发补助
-    let rdAwardsubsidy = 0;
-    checkTypeList.map(item => {
-      if (item.htMember == 1) {
-        htMember = 1;
+    if (checkTypeList instanceof Array) {
+      // 高新会员
+      let htMember = 0;
+      // 加计扣除
+      let additionalDeduction = 0;
+      // 研发补助
+      let rdAwardsubsidy = 0;
+      checkTypeList.map(item => {
+        if (item.htMember == 1) {
+          htMember = 1;
+        }
+        if (item.additionalDeduction == 1) {
+          additionalDeduction = 1;
+        }
+        if (item.rdAwardsubsidy == 1) {
+          rdAwardsubsidy = 1;
+        }
+      });
+      if (htMember) {
+        newCheckType.push(1);
       }
-      if (item.additionalDeduction == 1) {
-        additionalDeduction = 1;
+      if (additionalDeduction) {
+        newCheckType.push(2);
       }
-      if (item.rdAwardsubsidy == 1) {
-        rdAwardsubsidy = 1;
+      if (rdAwardsubsidy) {
+        newCheckType.push(3);
       }
-    });
-    if (htMember) {
-      newCheckType.push(1);
-    }
-    if (additionalDeduction) {
-      newCheckType.push(2);
-    }
-    if (rdAwardsubsidy) {
-      newCheckType.push(3);
     }
+    
     return newCheckType;
   }
 
@@ -140,15 +143,21 @@ class newEditProject extends Component {
       }
     }
 
+    let splitList = [];
+    if (!!dataInfor.splitList) {
+      splitList = dataInfor.splitList.filter(item => item.type != 3);
+    }
+    if (!!dataInfor.list) {
+      splitList = dataInfor.list.filter(item => item.type != 3);;
+    }
+
     let llist = []
-    if (dataInfor[children] && dataInfor[children].length > 0) {
-      for (var i = 0; i < dataInfor[children].length; i++) {
-        // if (dataInfor.splitList[i].commodityId == dataInfor.commodityId) {
-        //   llist.push(dataInfor.splitList[i].serviceYear != dataInfor.serviceYear && dataInfor.splitList[i].serviceYear)
-        // }
-        if (dataInfor[children][i].type != 3) {
-          llist.push(dataInfor[children][i].serviceYear)
-        }
+    for (var i = 0; i < splitList.length; i++) {
+      // if (dataInfor.splitList[i].commodityId == dataInfor.commodityId) {
+      //   llist.push(dataInfor.splitList[i].serviceYear != dataInfor.serviceYear && dataInfor.splitList[i].serviceYear)
+      // }
+      if (splitList[i].type != 3) {
+        llist.push(splitList[i].serviceYear)
       }
     }
 
@@ -157,7 +166,7 @@ class newEditProject extends Component {
       // 单边会员和简单会员
       newCheckType = [1];
     } else {
-      newCheckType = this.getCheckTypeList(dataInfor.splitList);
+      newCheckType = this.getCheckTypeList(splitList);
     }
     // if (dataInfor.projectType == 1) {
     //   if (dataInfor.htMember == 1) {
@@ -196,8 +205,8 @@ class newEditProject extends Component {
       contractTerm: (!dataInfor.contractTerm || (dataInfor.contractTerm.indexOf("-") == -1)) ? [] : JSON.parse(dataInfor.contractTerm), // 合同期
       serviceYear: dataInfor.cSort == 6 ? undefined : dataInfor.serviceYear,//本次派单
       histYear: llist, // 本次已派单
-      oldSplitList: JSON.parse(JSON.stringify(dataInfor[children])),
-      splitList: dataInfor[children] || [],
+      oldSplitList: JSON.parse(JSON.stringify(splitList)),
+      splitList,
       tid: dataInfor.id, // 父级项目id
       isMedit: readOnly ? 3 : dataInfor.cSort == 6 ? 0 : 1,// 会员项目默认0不可编辑   普通项目默认1可编辑
       projectType: dataInfor.projectType, // 会员项目类型
@@ -211,6 +220,30 @@ class newEditProject extends Component {
   }
 
   onChange(text) {
+    const { flag, message } = this.validSunProTypeIsNull();
+    if (!flag) {
+      message.warning(message);
+      return;
+    }
+
+    const updatedList = this.getUpdatedSubProject();
+    let subLen = updatedList.length;
+    if (subLen === 0) {
+      this.saveParentProject();
+    }
+
+    updatedList.map((item) => this.handleUpdateSubProject(item, () => {
+      subLen -= 1;
+      if (subLen === 0) {
+        this.saveParentProject();
+      }
+    }, () => {
+      subLen -= 1;
+      this.saveParentProject();
+    }));
+  }
+
+  saveParentProject() {
     const { type = "", dataInfor } = this.props
     if (isNaN(parseFloat(this.state.commodityPrice))) {
       message.warning("请输入正确的金额!");
@@ -310,6 +343,8 @@ class newEditProject extends Component {
         return
       }
     }
+
+
     this.setState({
       loading: true,
     });
@@ -346,9 +381,10 @@ class newEditProject extends Component {
       // infor.serviceYear = this.state.serviceYear //本次派单年份
       infor.contractTerm = JSON.stringify(this.state.contractTerm)//合同期
       if (this.state.projectType == 1) {
-        infor.htMember = this.state.checkType.includes(1) ? 1 : 0
-        infor.additionalDeduction = this.state.checkType.includes(2) ? 1 : 0
-        infor.rdAwardsubsidy = this.state.checkType.includes(3) ? 1 : 0
+        const checkType = this.getCheckTypeList(this.state.oldSplitList);
+        infor.htMember = checkType.includes(1) ? 1 : 0
+        infor.additionalDeduction = checkType.includes(2) ? 1 : 0
+        infor.rdAwardsubsidy = checkType.includes(3) ? 1 : 0
       }
     }
     if (this.state.isVip == 3) { //科技项目
@@ -382,7 +418,7 @@ class newEditProject extends Component {
         });
         if (!data.error.length) {
           message.success("保存成功!");
-          this.loopPostUpdateSubProject();
+          
           if (this.state.isVip == 6) {
             text == "submit" &&
               this.setState({
@@ -396,9 +432,6 @@ class newEditProject extends Component {
         }
       }.bind(this)
     );
-
-    
-
   }
 
   getpatentTypeList() {
@@ -605,6 +638,7 @@ class newEditProject extends Component {
       this.updateMemberSonProject(this.state.recoveryId, this.state.taskComment)
       return
     }
+
     this.setState({
       loading: true,
     });
@@ -675,15 +709,30 @@ class newEditProject extends Component {
     return updatedList;
   }
 
-  loopPostUpdateSubProject() {
+  // 验证子项目是否有会员类型为空的情况
+  validSunProTypeIsNull() {
     const updatedList = this.getUpdatedSubProject();
-    updatedList.map((item) => {
-      this.handleUpdateSubProject(item)
-    });
+    let flag = true; // 判断是否有子项,会员类型都为空,如果存在,则不进行批量更新
+    let messageText = "";
+    
+    for (let i=0; i<updatedList.length; i++) {
+      let item = updatedList[i];
+      if (item.htMember != 1 && item.additionalDeduction != 1 && item.rdAwardsubsidy != 1) {
+        flag = false;
+        messageText = `${item.serviceYear}会员类型不能为空!`
+        break;
+      }
+    }
+
+    return { flag, message: messageText }
   }
 
+  // loopPostUpdateSubProject() {
+    
+  // }
+
   // 修改子项目
-  handleUpdateSubProject(item) {
+  handleUpdateSubProject(item, succCallback, errCallback) {
     const { type } = this.props;
     let prams = {
       [type === "change" ? "id" : "tid"]: item.id,
@@ -703,21 +752,28 @@ class newEditProject extends Component {
       success: res => {
         if (!res.error.length) {
           const { splitList, oldSplitList } = this.state;
-          // 更新项目的会员类型
-          let checkType = this.getCheckTypeList(splitList);
-          // 更新初始的子项目列表
+          // 更新原始的子项目列表,便于计算后续改动的会员类型
           let oldSplitIdx = oldSplitList.findIndex(oldItem => oldItem.id === item.id)
+          oldSplitIdx
           if (oldSplitIdx > -1) {
-            oldSplitList[oldSplitIdx] = item;
+            oldSplitList[oldSplitIdx] = JSON.parse(JSON.stringify(item));
           }
+
+          // 更新项目的会员类型
+          let checkType = this.getCheckTypeList(oldSplitList);
           this.setState({
             checkType,
             oldSplitList
+          }, () => {
+            succCallback && succCallback();
           });
         } else {
+          errCallback && errCallback();
           message.error(res.error[0].message);
         }
       }
+    }).catch(err => {
+      errCallback && errCallback();
     });
   }
 
@@ -1789,7 +1845,7 @@ class newEditProject extends Component {
             }}
           >
             <Select
-              mode="tags"
+              mode="multiple"
               style={{ width: '200px', marginRight: 50 }}
               placeholder="请选择年份"
               onChange={e => {

+ 123 - 34
js/component/manageCenter/customer/NEW/publicCustomer/publicCustomer.jsx

@@ -175,6 +175,76 @@ const QueryCustomer = React.createClass({
         }
       }
       ],
+      natureOptions: [{
+        value: 1,
+        label: "政府机构"
+      }, {
+        value: 2,
+        label: "科研院所"
+      }, {
+        value: 3,
+        label: "高等院校"
+      }, {
+        value: 4,
+        label: "社会团体"
+      }, {
+        value: 5,
+        label: "企业",
+        children: [{
+          value: 1,
+          label: "国企",
+          children: [{
+            value: 1,
+            label: "上市公司",
+          }, {
+            value: 0,
+            label: "非上市公司",
+          }]
+        }, {
+          value: 2,
+          label: "央企",
+          children: [{
+            value: 1,
+            label: "上市公司",
+          }, {
+            value: 0,
+            label: "非上市公司",
+          }]
+        }, {
+          value: 3,
+          label: "私企",
+          children: [{
+            value: 1,
+            label: "上市公司",
+          }, {
+            value: 0,
+            label: "非上市公司",
+          }]
+        }, {
+          value: 4,
+          label: "合资企业(含港澳台)",
+          children: [{
+            value: 1,
+            label: "上市公司",
+          }, {
+            value: 0,
+            label: "非上市公司",
+          }]
+        }, {
+          value: 5,
+          label: "外资控股",
+          children: [{
+            value: 1,
+            label: "上市公司",
+          }, {
+            value: 0,
+            label: "非上市公司",
+          }]
+        }]
+      }, {
+        value: 0,
+        label: "其他组织"
+      }]
     }
   },
   handleClose(removedTag) {
@@ -368,7 +438,7 @@ const QueryCustomer = React.createClass({
         message.success('领取成功!');
         this.setState({
           loading: false,
-        });
+        })
       } else {
         message.warning(data.error[0].message);
       };
@@ -426,14 +496,14 @@ const QueryCustomer = React.createClass({
     e.preventDefault();
     this.props.form.validateFields((err, values) => {
       let re = new RegExp("^[\u4e00-\u9fa5]");
-      if (!re.test(values.name)) {
-        message.warning('公司名称必须以汉字开头!')
-        return
-      }
-      if (!re.test(values.name.charAt(values.name.length - 1))) {
-        message.warning('公司名称必须以汉字结尾!')
-        return
-      }
+      // if (!re.test(values.name)) {
+      //   message.warning('公司名称必须以汉字开头!')
+      //   return
+      // }
+      // if (!re.test(values.name.charAt(values.name.length - 1))) {
+      //   message.warning('公司名称必须以汉字结尾!')
+      //   return
+      // }
       if (values.name.length > 64) {
         message.warning('公司名称字数不超过64个!')
         return false;
@@ -497,6 +567,16 @@ const QueryCustomer = React.createClass({
         this.setState({
           loading: true
         });
+
+        let enterpriseNature = undefined; // 企业性质 0=其他,1=国企,2=央企,3=私企,4=合资企业(含港澳台),5=外资控股
+        let listedNature = undefined; // 上市 0=否,1=是
+        if (this.state.nature.length >= 2) {
+          enterpriseNature = this.state.nature[1];
+        }
+        if (this.state.nature.length >= 3) {
+          listedNature = this.state.nature[2];
+        }
+
         $.ajax({
           method: "POST",
           dataType: "json",
@@ -517,8 +597,10 @@ const QueryCustomer = React.createClass({
             businessScope: this.state.businessScope.join(','),
             position: values.position,
             level: this.state.level,
-            nature: this.state.nature,
+            nature: this.state.nature[0],
             natureOther: this.state.natureOther,
+            enterpriseNature,
+            listedNature,
           }
         }).done(function (data) {
           this.setState({
@@ -526,10 +608,9 @@ const QueryCustomer = React.createClass({
           });
           if (!data.error.length) {
             message.success('领取成功!');
-            this.setState({
-              verification: false
-            })
             this.loadData(this.state.ispage);
+
+          this.handleModalClose();
           } else {
             message.warning(data.error[0].message);
           }
@@ -538,7 +619,24 @@ const QueryCustomer = React.createClass({
     });
   },
 
-
+  handleModalClose() {
+    this.setState({
+      verification: false,
+      id: undefined,
+      name: undefined,
+      orgCode: undefined,
+      ProvinceCity: [],
+      content: undefined,
+      position: undefined,
+      telnum: undefined,
+      businessScope: [],
+      selectCooperationProjects: [],
+      level: undefined,
+      nature: undefined,
+      natureOther: undefined,
+    })
+    this.props.form.resetFields();
+  },
 
   render() {
     const intentionState = this.props.intentionState;
@@ -643,24 +741,7 @@ const QueryCustomer = React.createClass({
         </div>
         <Modal maskClosable={false}
           visible={this.state.verification}
-          onCancel={() => {
-            this.setState({
-              verification: false,
-              id: undefined,
-              name: undefined,
-              orgCode: undefined,
-              ProvinceCity: [],
-              content: undefined,
-              position: undefined,
-              telnum: undefined,
-              businessScope: [],
-              selectCooperationProjects: [],
-              level: undefined,
-              nature: undefined,
-              natureOther: undefined,
-            })
-            this.props.form.resetFields();
-          }}
+          onCancel={this.handleModalClose}
           width='600px'
           title='客户信息'
           footer={null}
@@ -873,7 +954,7 @@ const QueryCustomer = React.createClass({
                         {...formItemLayout}
                         required
                         label="客户性质" >
-                        <Select
+                        {/* <Select
                           placeholder="请选择客户性质"
                           value={this.state.nature}
                           onChange={(e) => {
@@ -887,7 +968,15 @@ const QueryCustomer = React.createClass({
                           <Option value={5}>民营企业</Option>
                           <Option value={6}>社会团体</Option>
                           <Option value={0}>其他(请注明)</Option>
-                        </Select>
+                        </Select> */}
+
+                        <Cascader
+                          options={this.state.natureOptions}
+                          placeholder="请选择客户性质"
+                          value={this.state.nature}
+                          onChange={e => { this.setState({ nature: e }) }}
+                        />
+                        
                       </FormItem>
                     </div>
                     {

+ 161 - 70
js/component/manageCenter/customer/NEW/query/queryCutomer.jsx

@@ -283,6 +283,76 @@ const QueryCustomer = React.createClass({
           },
         },
       ],
+      natureOptions: [{
+        value: 1,
+        label: "政府机构"
+      }, {
+        value: 2,
+        label: "科研院所"
+      }, {
+        value: 3,
+        label: "高等院校"
+      }, {
+        value: 4,
+        label: "社会团体"
+      }, {
+        value: 5,
+        label: "企业",
+        children: [{
+          value: 1,
+          label: "国企",
+          children: [{
+            value: 1,
+            label: "上市公司",
+          }, {
+            value: 0,
+            label: "非上市公司",
+          }]
+        }, {
+          value: 2,
+          label: "央企",
+          children: [{
+            value: 1,
+            label: "上市公司",
+          }, {
+            value: 0,
+            label: "非上市公司",
+          }]
+        }, {
+          value: 3,
+          label: "私企",
+          children: [{
+            value: 1,
+            label: "上市公司",
+          }, {
+            value: 0,
+            label: "非上市公司",
+          }]
+        }, {
+          value: 4,
+          label: "合资企业(含港澳台)",
+          children: [{
+            value: 1,
+            label: "上市公司",
+          }, {
+            value: 0,
+            label: "非上市公司",
+          }]
+        }, {
+          value: 5,
+          label: "外资控股",
+          children: [{
+            value: 1,
+            label: "上市公司",
+          }, {
+            value: 0,
+            label: "非上市公司",
+          }]
+        }]
+      }, {
+        value: 0,
+        label: "其他组织"
+      }]
     };
   },
 
@@ -327,31 +397,33 @@ const QueryCustomer = React.createClass({
     }
   },
   //加载(自动补全)
-  supervisor(value) {
-    $.ajax({
-      method: "get",
-      dataType: "json",
-      crossDomain: false,
-      url: globalConfig.context + '/api/admin/order/getBusinessProjectByName',
-      data: {
-        businessName: value
-      },
-      success: function (data) {
-        let thedata = data.data;
-        if (data.error.length === 0) {
-          this.setState({
-            cooperationProjects: thedata,
-          });
-        } else {
-          message.warning(data.error[0].message);
-        }
-      }.bind(this),
-    }).always(
-      function () {
+  // supervisor(value) {
+  //   console.log(value)
+  //   $.ajax({
+  //     method: "get",
+  //     dataType: "json",
+  //     crossDomain: false,
+  //     url: globalConfig.context + '/api/admin/order/getBusinessProjectByName',
+  //     data: {
+  //       businessName: value
+  //     },
+  //     success: function (data) {
+  //       let thedata = data.data;
+  //       console.log(data)
+  //       if (data.error.length === 0) {
+  //         this.setState({
+  //           cooperationProjects: thedata,
+  //         });
+  //       } else {
+  //         message.warning(data.error[0].message);
+  //       }
+  //     }.bind(this),
+  //   }).always(
+  //     function () {
 
-      }.bind(this)
-    );
-  },
+  //     }.bind(this)
+  //   );
+  // },
   onSelect(value) {
     let arr = this.state.cooperationProjects.filter(v => v.id === value);
     let arr1 = this.state.selectCooperationProjects.filter(v => v.value === value);
@@ -420,14 +492,14 @@ const QueryCustomer = React.createClass({
     e.preventDefault();
     this.props.form.validateFields((err, values) => {
       let re = new RegExp("^[\u4e00-\u9fa5]");
-      if (!re.test(values.name)) {
-        message.warning('公司名称必须以汉字开头!')
-        return
-      }
-      if (!re.test(values.name.charAt(values.name.length - 1))) {
-        message.warning('公司名称必须以汉字结尾!')
-        return
-      }
+      // if (!re.test(values.name)) {
+      //   message.warning('公司名称必须以汉字开头!')
+      //   return
+      // }
+      // if (!re.test(values.name.charAt(values.name.length - 1))) {
+      //   message.warning('公司名称必须以汉字结尾!')
+      //   return
+      // }
       if (values.name.length > 64) {
         message.warning('公司名称字数不超过64个!')
         return false;
@@ -491,6 +563,16 @@ const QueryCustomer = React.createClass({
         this.setState({
           loading: true
         });
+
+        let enterpriseNature = undefined; // 企业性质 0=其他,1=国企,2=央企,3=私企,4=合资企业(含港澳台),5=外资控股
+        let listedNature = undefined; // 上市 0=否,1=是
+        if (this.state.nature.length >= 2) {
+          enterpriseNature = this.state.nature[1];
+        }
+        if (this.state.nature.length >= 3) {
+          listedNature = this.state.nature[2];
+        }
+
         $.ajax({
           method: "POST",
           dataType: "json",
@@ -511,8 +593,10 @@ const QueryCustomer = React.createClass({
             businessScope: this.state.businessScope.join(','),
             position: values.position,
             level: this.state.level,
-            nature: this.state.nature,
+            nature: this.state.nature[0],
             natureOther: this.state.natureOther,
+            enterpriseNature,
+            listedNature,
           }
         }).done(function (data) {
           this.setState({
@@ -520,10 +604,9 @@ const QueryCustomer = React.createClass({
           });
           if (!data.error.length) {
             message.success('领取成功!');
-            this.setState({
-              verification: false
-            })
             this.loadData(this.state.ispage);
+
+            this.handleModalClose();
           } else {
             message.warning(data.error[0].message);
           }
@@ -531,6 +614,24 @@ const QueryCustomer = React.createClass({
       }
     });
   },
+  handleModalClose() {
+    this.setState({
+      verification: false,
+      id: undefined,
+      name: undefined,
+      orgCode: undefined,
+      ProvinceCity: [],
+      content: undefined,
+      position: undefined,
+      telnum: undefined,
+      businessScope: [],
+      selectCooperationProjects: [],
+      level: undefined,
+      nature: undefined,
+      natureOther: undefined,
+    })
+    this.props.form.resetFields();
+  },
   receives(e) {
     this.setState({
       loading: true,
@@ -548,7 +649,7 @@ const QueryCustomer = React.createClass({
         loading: false,
       });
       if (data.error.length === 0) {
-        message.success(e.signBills == 1 ? '领取成功!客户为签单客户,请在【签单单位客户】列表中查询' : '领取成功!客户为私有客户,请在【私有单位客户】列表中查询');
+        message.success(e.signBills == 1 ? '领取成功,请在【私有客户列表】中查询!' : '领取成功,请在【签单客户列表】中查询!');
         this.loadData(this.state.ispage);
       } else {
         message.warning(data.error[0].message);
@@ -628,22 +729,22 @@ const QueryCustomer = React.createClass({
       method: "get",
       dataType: "json",
       crossDomain: false,
-      url: globalConfig.context + "/api/admin/customer/listAdminByName",
+      url: globalConfig.context + "/api/admin/order/getBusinessProjectByName",
       data: {
-        adminName: e,
+        businessName: e,
       },
-      success: function (data) {
-        let thedata = data.data;
-        if (!thedata) {
-          if (data.error && data.error.length) {
-            message.warning(data.error[0].message);
-          }
-          thedata = {};
+    }).done((data) => {
+      console.log(data)
+      let thedata = data.data || [];
+      if (!thedata) {
+        if (data.error && data.error.length) {
+          message.warning(data.error[0].message);
         }
-        this.setState({
-          customerArr: thedata,
-        });
-      }.bind(this),
+        thedata = {};
+      }
+      this.setState({
+        cooperationProjects: thedata,
+      });
     }).always(
       function () {
         this.setState({
@@ -817,24 +918,7 @@ const QueryCustomer = React.createClass({
         )}
         <Modal maskClosable={false}
           visible={this.state.verification}
-          onCancel={() => {
-            this.setState({
-              verification: false,
-              id: undefined,
-              name: undefined,
-              orgCode: undefined,
-              ProvinceCity: [],
-              content: undefined,
-              position: undefined,
-              telnum: undefined,
-              businessScope: [],
-              selectCooperationProjects: [],
-              level: undefined,
-              nature: undefined,
-              natureOther: undefined,
-            })
-            this.props.form.resetFields();
-          }}
+          onCancel={this.handleModalClose}
           width='600px'
           title='客户信息'
           footer={null}
@@ -996,6 +1080,7 @@ const QueryCustomer = React.createClass({
                         <div>
                           <div style={{ paddingBottom: this.state.selectCooperationProjects.length === 0 ? 0 : '10px' }}>
                             {this.state.selectCooperationProjects.map((tag, index) => {
+                              console.log(tag)
                               const isLongTag = tag.label.length > 20;
                               const tagElem = (
                                 <Tag closable key={tag.label} afterClose={() => this.handleCloseCooperation(tag)}>
@@ -1047,7 +1132,7 @@ const QueryCustomer = React.createClass({
                         {...formItemLayout}
                         required
                         label="客户性质" >
-                        <Select
+                        {/* <Select
                           placeholder="请选择客户性质"
                           value={this.state.nature}
                           onChange={(e) => {
@@ -1061,7 +1146,13 @@ const QueryCustomer = React.createClass({
                           <Option value={5}>民营企业</Option>
                           <Option value={6}>社会团体</Option>
                           <Option value={0}>其他(请注明)</Option>
-                        </Select>
+                        </Select> */}
+                        <Cascader
+                          options={this.state.natureOptions}
+                          placeholder="请选择客户性质"
+                          value={this.state.nature}
+                          onChange={e => { this.setState({ nature: e }) }}
+                        />
                       </FormItem>
                     </div>
                     {