Bladeren bron

会员,审计,高新,字段添加,部门勾选显示优化

dev01 2 jaren geleden
bovenliggende
commit
48577f4cf1

+ 35 - 7
js/component/common/cascaders/index.jsx

@@ -149,6 +149,31 @@ class Cascaders extends Component {
     })
   }
 
+  // checked组件样式
+  inde(item) {
+    const { children } = this.props
+    if (item.checked) {
+      return false
+    } else {
+      if (!!item[children]) {
+        let clist = []
+        for (var i = 0; i < item[children].length; i++) {
+          if (item[children][i].checked == true) {
+            clist.push(item[children][i])
+          }
+        }
+        if (!!clist.length && (clist.length < item[children].length)) {
+          return true
+        } else {
+          return false
+        }
+      } else {
+        return false
+      }
+    }
+  }
+
+
   render() {
     const { Panel } = Collapse;
     const { visible, authTree, checkedList } = this.state
@@ -168,6 +193,7 @@ class Cascaders extends Component {
           <div className="item">
             {/* 一级复选框(向下操控二级三级) */}
             <Checkbox
+              indeterminate={this.inde(item1)}
               name={item1[id]}
               checked={item1.checked}
               onClick={(e) => {
@@ -198,12 +224,7 @@ class Cascaders extends Component {
     ));
     return (
       <div className="cascaders"
-        // tabIndex={0}
-        // onBlur={(e) => {
-        //   this.setState({
-        //     visible: false
-        //   })
-        // }}
+
       >
         <div
           className="cinput"
@@ -220,7 +241,14 @@ class Cascaders extends Component {
             {checkedList.length > 0 ? `已选择${checkedList.length}项` : placeholder}
           </div>
         </div>
-        <div data-reactroot>
+        <div data-reactroot
+          tabIndex={0}
+          // onBlur={(e) => {
+          //   this.setState({
+          //     visible: false
+          //   })
+          // }}
+        >
           {
             visible &&
             <div className="cpop" style={{ width: 260, }}>

+ 210 - 22
js/component/common/projectOperation/index.jsx

@@ -1,6 +1,6 @@
 // 开单
 import React, { Component } from "react";
-import { AutoComplete, Button, Upload, Form, Input, message, Modal, Radio, Select, Spin } from "antd";
+import { AutoComplete, Button, Upload, Form, Input, message, Modal, Radio, Select, Spin, Tag, } from "antd";
 import { boutique } from "../../dataDic";
 import $ from "jquery";
 import { getboutique, splitUrl } from "../../tools";
@@ -9,6 +9,7 @@ import ImgList from "../imgList";
 
 const FormItem = Form.Item;
 const Option = Select.Option;
+const RadioGroup = Radio.Group;
 
 const formItemLayout = {
     labelCol: { span: 8 },
@@ -38,6 +39,9 @@ class ProjectOperation extends Component {
             serviceLife: [],
             isVip: undefined,
             histYear: [],
+
+            addyear: undefined,//
+            isGive: 0,//是否赠送
         }
         this.onSubmit = this.onSubmit.bind(this);
         this.httpChange = this.httpChange.bind(this);
@@ -105,7 +109,7 @@ class ProjectOperation extends Component {
             !this.state.commodityQuantity ||
             !reg.test(this.state.commodityQuantity)
         ) {
-            message.warning("请输入正确商品数量!");
+            message.warning("请输入正确服务数量!");
             return false;
         }
         if (this.state.displayFees === 'block') {
@@ -126,13 +130,29 @@ class ProjectOperation extends Component {
             message.warning("请输入正确的金额!");
             return false;
         }
+        if (this.state.addProjectType == "3") {// 3审计
+            if (this.state.serviceLife.length === 0) {
+                message.warning("请选择服务年限!");
+                return
+            }
+            if (this.state.serviceLife.length != this.state.commodityQuantity) {
+                message.warning("服务数量与服务年限不符!");
+                return
+            }
+        }
         if (!this.state.main) {
             message.warning("请选择是否为主要项目!");
             return false;
         }
-        if (this.state.addProjectType === 5 && !this.state.declarationBatch) {
-            message.warning("请选择企业要求申报批次!");
-            return false;
+        if (this.state.addProjectType === 5) {// 5高新
+            if (!this.state.declarationBatch) {
+                message.warning("请选择企业要求申报批次!");
+                return
+            }
+            if (!this.state.serviceYear) {
+                message.warning("请选择申报年份!");
+                return
+            }
         }
         if (this.state.isIso && !this.state.ifCertificationFee) {
             message.warning("请选择是否包含认证费用!");
@@ -178,6 +198,12 @@ class ProjectOperation extends Component {
         if (this.state.isIso) {
             infor.ifCertificationFee = this.state.ifCertificationFee || undefined;//是否包含认证费用
         }
+        if (this.state.addProjectType == "3") {//审计
+            infor.serviceLife = JSON.stringify(this.state.serviceLife) //服务年限
+        }
+        if (this.state.addProjectType == "5") {//高新
+            infor.serviceYear = this.state.serviceYear //申报年份
+        }
         if (this.state.isVip == 6) {//会员
             infor.yearSum = this.state.yearSum //会员总服务年限
             infor.serviceLife = JSON.stringify(this.state.serviceLife) //会员服务年限
@@ -217,10 +243,31 @@ class ProjectOperation extends Component {
             message.warning("请输入正确商品数量!");
             return false;
         }
+        // 审计
+        if (this.state.addProjectType == "3") {
+            if (this.state.serviceLife.length === 0) {
+                message.warning("请选择服务年限!");
+                return
+            }
+            if (this.state.serviceLife.length != this.state.commodityQuantity) {
+                message.warning("服务数量与服务年限不符!");
+                return
+            }
+        }
         if (!this.state.main) {
             message.warning("请选择是否为主要项目!");
             return false;
         }
+        if (this.state.addProjectType === 5) {// 5高新
+            if (!this.state.declarationBatch) {
+                message.warning("请选择企业要求申报批次!");
+                return
+            }
+            if (!this.state.serviceYear) {
+                message.warning("请选择申报年份!");
+                return
+            }
+        }
         if (this.state.isVip == 6) {
             if (this.state.yearSum === undefined) {
                 message.warning("请选择会员总服务年限!");
@@ -261,8 +308,10 @@ class ProjectOperation extends Component {
                 declarationBatch: this.state.declarationBatch || undefined,//申报批次
                 ifCertificationFee: isNaN(parseInt(this.state.ifCertificationFee)) ? undefined : this.state.ifCertificationFee,//是否包含认证费用
                 yearSum: this.state.isVip == 6 ? this.state.yearSum : undefined,
-                serviceLife: this.state.isVip == 6 ? JSON.stringify(this.state.serviceLife) : undefined,
-                serviceYear: this.state.isVip == 6 ? this.state.serviceYear : undefined,
+                serviceLife: this.state.isVip == 6 ? JSON.stringify(this.state.serviceLife) : undefined,//会员-服务年限
+                serviceYear: this.state.isVip == 6 ? this.state.serviceYear : undefined,// 会员-本次派单
+                serviceLife: this.state.addProjectType == "3" ? JSON.stringify(this.state.serviceLife) : undefined,//审计-服务年限
+                serviceYear: this.state.addProjectType == "5" ? this.state.serviceYear : undefined, //高新-申报年份
             },
         }).done(
             function (data) {
@@ -406,6 +455,11 @@ class ProjectOperation extends Component {
         });
     }
 
+    handleClose(removedTag) {
+        let serviceLife = this.state.serviceLife.filter(tag => { return tag !== removedTag });
+        this.setState({ serviceLife });
+    }
+
     render() {
         let options = this.state.states
             ? this.state.customerArr.map((group) => (
@@ -603,6 +657,34 @@ class ProjectOperation extends Component {
                                 />}
                                 {!readOnly && <span className="mandatory">*</span>}
                             </FormItem>
+                            {
+                                //审计
+                                this.state.addProjectType == "3" &&
+                                <FormItem
+                                    className="half-item"
+                                    {...formItemLayout}
+                                    label="服务年限"
+                                >
+                                    {
+                                        readOnly ?
+                                            !!this.state.serviceLife ? this.state.serviceLife.toString() : "" :
+                                            <Select
+                                                mode="multiple"
+                                                style={{ width: '200px' }}
+                                                placeholder="请选择服务年限"
+                                                value={this.state.serviceLife}
+                                                onChange={(e) => {
+                                                    this.setState({
+                                                        serviceLife: e,
+                                                    })
+                                                }}
+                                            >
+                                                {children}
+                                            </Select>
+                                    }
+                                    {!readOnly && <span className="mandatory">*</span>}
+                                </FormItem>
+                            }
                             <FormItem
                                 className="half-item"
                                 {...formItemLayout}
@@ -678,22 +760,46 @@ class ProjectOperation extends Component {
                                     {
                                         readOnly ?
                                             !!this.state.serviceLife ? this.state.serviceLife.toString() : "" :
-                                            <Select
-                                                mode="multiple"
-                                                style={{ width: '200px' }}
-                                                placeholder="请选择服务年限"
-                                                value={this.state.serviceLife}
-                                                onChange={e => {
-                                                    this.setState({
-                                                        serviceLife: e,
-                                                        serviceYear: undefined,
-                                                    })
-                                                }}
-                                            >
-                                                {children}
-                                            </Select>
+                                            <div>
+                                                {
+                                                    this.state.serviceLife.map((tag) =>
+                                                        <Tag closable key={tag} afterClose={() => this.handleClose(tag)}>
+                                                            {tag}
+                                                        </Tag>
+                                                    )
+                                                }
+                                                {
+                                                    this.state.serviceLife.length < this.state.yearSum &&
+                                                    <Button
+                                                        size="small"
+                                                        type="primary"
+                                                        onClick={() => {
+                                                            this.setState({
+                                                                addYears: true,
+                                                                addyear: undefined,
+                                                                isGive: 0,
+                                                            })
+                                                        }}>
+                                                        + 添加服务年限
+                                                    </Button>
+                                                }
+                                            </div>
+                                        // <Select
+                                        //     mode="multiple"
+                                        //     style={{ width: '200px' }}
+                                        //     placeholder="请选择服务年限"
+                                        //     value={this.state.serviceLife}
+                                        //     onChange={e => {
+                                        //         this.setState({
+                                        //             serviceLife: e,
+                                        //             serviceYear: undefined,
+                                        //         })
+                                        //     }}
+                                        // >
+                                        //     {children}
+                                        // </Select>
                                     }
-                                    {!readOnly && <span className="mandatory">*</span>}
+                                    {/* {!readOnly && <span className="mandatory">*</span>} */}
                                 </FormItem>
                             }
                             {
@@ -798,6 +904,32 @@ class ProjectOperation extends Component {
                                             </Select>}
                                         {!readOnly && <span className="mandatory">*</span>}
                                     </FormItem>
+                                    <FormItem
+                                        className="half-item"
+                                        {...formItemLayout}
+                                        label="申报年份"
+                                    >
+                                        {
+                                            readOnly ? this.state.serviceYear :
+                                                <Select
+                                                    style={{ width: '200px' }}
+                                                    placeholder="请选择申报年份"
+                                                    value={this.state.serviceYear}
+                                                    onChange={e => {
+                                                        this.setState({
+                                                            serviceYear: e,
+                                                        })
+                                                    }}
+                                                >
+                                                    {
+                                                        vipYear.map(its => (
+                                                            <Option key={its}>{its}</Option>
+                                                        ))
+                                                    }
+                                                </Select>
+                                        }
+                                        {!readOnly && <span className="mandatory">*</span>}
+                                    </FormItem>
                                 </div> : null
                             }
                             {
@@ -853,6 +985,62 @@ class ProjectOperation extends Component {
                         </div>
                     </Spin>
                 </Form>
+                {
+                    this.state.addYears &&
+                    <Modal
+                        title="添加服务年限"
+                        visible={this.state.addYears}
+                        okText="添加"
+                        onOk={() => {
+                            let slist = this.state.serviceLife
+                            if (this.state.isGive == 0) {
+                                slist.push(this.state.addyear)
+                            } else if (this.state.isGive == 1) {
+                                let newYear = this.state.addyear + "(赠送)"
+                                slist.push(newYear)
+                            }
+                            this.setState({
+                                serviceLife: slist,
+                                addYears: false
+                            })
+                        }}
+                        onCancel={() => {
+                            this.setState({
+                                addYears: false
+                            })
+                        }}
+                    >
+                        <Select
+                            style={{ width: '200px', marginRight: 50 }}
+                            placeholder="请选择年份"
+                            onChange={e => {
+                                this.setState({
+                                    addyear: e,
+                                })
+                            }}
+                        >
+                            {
+                                vipYear.map(its => (
+                                    <Option
+                                        key={its}
+                                        disabled={this.state.serviceLife.toString().includes(its)}
+                                    >{its}</Option>
+                                ))
+                            }
+                        </Select>
+                        <RadioGroup
+                            onChange={e => {
+                                this.setState({
+                                    isGive: e.target.value
+                                })
+                            }}
+                            value={this.state.isGive}
+                        >
+                            <Radio value={0}>非赠送</Radio>
+                            <Radio value={1}>赠送</Radio>
+                        </RadioGroup>
+                    </Modal>
+                }
             </Modal >
         )
     }

+ 143 - 11
js/component/common/projectOperation/vip.jsx

@@ -1,5 +1,5 @@
 import React, { Component } from "react";
-import { AutoComplete, Button, Form, Input, message, Modal, Select, Spin } from "antd";
+import { AutoComplete, Button, Form, Input, message, Modal, Select, Spin, Tag, Radio } from "antd";
 import $ from "jquery";
 import ImgList from "../../common/imgList";
 import { splitUrl } from "../../tools";
@@ -7,6 +7,7 @@ import { vipYear } from "../../dataDic";
 
 const FormItem = Form.Item;
 const Option = Select.Option;
+const RadioGroup = Radio.Group;
 
 const formItemLayout = {
   labelCol: { span: 8 },
@@ -86,7 +87,11 @@ class ProjectOperationVip extends Component {
       patentTransfer: props.dataInfor ? props.dataInfor.patentTransfer : 0, //收否为专利转让 0 否 1 是
       orgCodeUrl: [],
       serviceLife: [],
-      histYear: [],
+      histYear: [], //已派年份
+      isEdit: false,//是否可编辑
+
+      addyear: undefined,//
+      isGive: 0,//是否赠送
     }
     this.onSubmit = this.onSubmit.bind(this);
     this.httpChange = this.httpChange.bind(this);
@@ -115,6 +120,7 @@ class ProjectOperationVip extends Component {
         yearSum: dataInfor.yearSum,//会员总服务年限
         serviceLife: JSON.parse(dataInfor.serviceLife) || [],//会员服务年限
         serviceYear: dataInfor.serviceYear,//本次派单
+        contract_term: dataInfor.contract_term,//合同期
       });
     }
   }
@@ -172,6 +178,10 @@ class ProjectOperationVip extends Component {
       message.warning("请选择本次派单年份!");
       return
     }
+    if (this.state.contract_term.length === 0) {
+      message.warning("请添加合同期!");
+      return
+    }
     if (this.state.memberType == "1" || this.state.memberType == "2") {
       if (typeof pictureUrl !== "string") {
         message.warning("请上传附件!");
@@ -192,6 +202,7 @@ class ProjectOperationVip extends Component {
       yearSum: this.state.yearSum,//会员总服务年限
       serviceLife: JSON.stringify(this.state.serviceLife),//会员服务年限
       serviceYear: this.state.serviceYear,//本次派单
+      contract_term: JSON.stringify(this.state.contract_term),//合同期
       pictureUrl: pictureUrl.length ? pictureUrl : "",//附件
     }
     $.ajax({
@@ -272,6 +283,10 @@ class ProjectOperationVip extends Component {
       message.warning("请选择本次派单年份!");
       return
     }
+    if (this.state.contract_term.length === 0) {
+      message.warning("请添加合同期!");
+      return
+    }
     if (this.state.memberType == "1" || this.state.memberType == "2") {
       if (typeof pictureUrl !== "string") {
         message.warning("请上传附件!");
@@ -297,6 +312,7 @@ class ProjectOperationVip extends Component {
         yearSum: this.state.yearSum,//会员总服务年限
         serviceLife: JSON.stringify(this.state.serviceLife),//会员服务年限
         serviceYear: this.state.serviceYear,//本次派单
+        contract_term: JSON.stringify(this.state.contract_term),//合同期
         pictureUrl: pictureUrl.length ? pictureUrl : "",//附件
       },
     }).done(
@@ -379,11 +395,13 @@ class ProjectOperationVip extends Component {
           this.setState({
             yearSum: newData[i].yearSum.toString(), // 会员总服务年限
             serviceLife: JSON.parse(newData[i].serviceLife) || [], // 会员服务年限
+            isEdit: true, // 不可编辑
           })
         } else {
           this.setState({
             yearSum: undefined,
             serviceLife: [],
+            isEdit: false, // 可编辑
           })
         }
         return
@@ -391,18 +409,23 @@ class ProjectOperationVip extends Component {
     }
   }
 
+  handleClose(removedTag) {
+    let serviceLife = this.state.serviceLife.filter(tag => { return tag !== removedTag });
+    this.setState({ serviceLife });
+  }
+
+
   render() {
     let options = this.state.customerArr.map((group, index) => (
       <Select.Option key={index} value={group.bname}>
         {group.bname}
       </Select.Option>
     ));
-    let children = vipYear.map(its => (
+    let contList = vipYear.map(its => (
       <Option key={its}>{its}</Option>
     ));
-
     const { readOnly } = this.props;
-    const { histYear } = this.state
+    const { histYear, isEdit } = this.state
     return (
       <Modal
         maskClosable={false}
@@ -514,10 +537,14 @@ class ProjectOperationVip extends Component {
                     ][this.state.yearSum]["key"] :
                   <Select
                     placeholder="请选择会员总服务年限"
+                    disabled={isEdit}
                     style={{ width: "200px" }}
                     value={this.state.yearSum}
                     onChange={(e) => {
-                      this.setState({ yearSum: e });
+                      this.setState({
+                        yearSum: e,
+                        serviceLife: [],
+                      });
                     }}
                   >
                     {[
@@ -541,25 +568,50 @@ class ProjectOperationVip extends Component {
                 {...formItemLayout}
                 label="会员服务年限"
               >
-                {
+                <div>
+                  {
+                    this.state.serviceLife.map((tag) =>
+                      <Tag closable={!isEdit} key={tag} afterClose={() => this.handleClose(tag)}>
+                        {tag}
+                      </Tag>
+                    )
+                  }
+                  {
+                    !isEdit && (this.state.serviceLife.length < this.state.yearSum) &&
+                    <Button
+                      size="small"
+                      type="primary"
+                      onClick={() => {
+                        this.setState({
+                          addYears: true,
+                          addyear: undefined,
+                          isGive: 0,
+                        })
+                      }}>
+                      + 添加服务年限
+                    </Button>
+                  }
+                </div>
+                {/* {
                   readOnly ?
                     this.state.serviceLife.toString() :
                     <Select
+                      disabled={isEdit}
                       mode="multiple"
                       style={{ width: '200px' }}
                       placeholder="请选择服务年限"
                       value={this.state.serviceLife}
-                      onChange={e => {
+                      onChange={(e) => {
                         this.setState({
                           serviceLife: e,
                           serviceYear: undefined,
                         })
                       }}
                     >
-                      {children}
+                      {contList}
                     </Select>
-                }
-                {!readOnly && <span className="mandatory">*</span>}
+                } */}
+                {/* {!readOnly && <span className="mandatory">*</span>} */}
               </FormItem>
               <FormItem
                 className="half-item"
@@ -586,6 +638,30 @@ class ProjectOperationVip extends Component {
                   </Select>}
                 {!readOnly && <span className="mandatory">*</span>}
               </FormItem>
+              <FormItem
+                className="half-item"
+                {...formItemLayout}
+                label="合同期"
+              >
+                {
+                  readOnly ?
+                    this.state.contract_term.toString() :
+                    <Select
+                      mode="multiple"
+                      style={{ width: '200px' }}
+                      placeholder="请选择合同期"
+                      value={this.state.contract_term}
+                      onChange={e => {
+                        this.setState({
+                          contract_term: e,
+                        })
+                      }}
+                    >
+                      {contList}
+                    </Select>
+                }
+                {!readOnly && <span className="mandatory">*</span>}
+              </FormItem>
               {
                 (this.state.memberType == "1" || this.state.memberType == "2") &&
                 <div className="clearfix">
@@ -657,6 +733,62 @@ class ProjectOperationVip extends Component {
             </div>
           </Spin>
         </Form>
+        {
+          this.state.addYears &&
+          <Modal
+            title="添加服务年限"
+            visible={this.state.addYears}
+            okText="添加"
+            onOk={() => {
+              let slist = this.state.serviceLife
+              if (this.state.isGive == 0) {
+                slist.push(this.state.addyear)
+              } else if (this.state.isGive == 1) {
+                let newYear = this.state.addyear + "(赠送)"
+                slist.push(newYear)
+              }
+              this.setState({
+                serviceLife: slist,
+                addYears: false
+              })
+            }}
+            onCancel={() => {
+              this.setState({
+                addYears: false
+              })
+            }}
+          >
+            <Select
+              style={{ width: '200px', marginRight: 50 }}
+              placeholder="请选择年份"
+              onChange={e => {
+                this.setState({
+                  addyear: e,
+                })
+              }}
+            >
+              {
+                vipYear.map(its => (
+                  <Option
+                    key={its}
+                    disabled={this.state.serviceLife.toString().includes(its)}
+                  >{its}</Option>
+                ))
+              }
+            </Select>
+            <RadioGroup
+              onChange={e => {
+                this.setState({
+                  isGive: e.target.value
+                })
+              }}
+              value={this.state.isGive}
+            >
+              <Radio value={0}>非赠送</Radio>
+              <Radio value={1}>赠送</Radio>
+            </RadioGroup>
+          </Modal>
+        }
       </Modal>
     )
   }

+ 3 - 3
js/component/dataDic.js

@@ -4074,8 +4074,8 @@ module.exports = {
   ],
   //会员服务年限
   vipYear: [
-    '2017', '2018', '2019', '2020', '2021',
-    '2022', '2023', '2024', '2025', '2026',
-    '2027', '2028', '2029', '2030', '2031',
+    '2017', '2018', '2019', '2020', '2021',
+    '2022', '2023', '2024', '2025', '2026',
+    '2027', '2028', '2029', '2030', '2031',
   ]
 };

+ 2 - 3
js/component/manageCenter/financialManage/distribute/projectvip.jsx

@@ -196,11 +196,10 @@ const ProjectVip = React.createClass({
           title: "年限",
           dataIndex: "serviceLife",
           key: "serviceLife",
-          width: 60,
           render: (text, record) => {
             return (
               !!text && JSON.parse(text).map(item =>
-                <div>{item}</div>
+                <div>{item}</div>
               )
             );
           }
@@ -211,7 +210,7 @@ const ProjectVip = React.createClass({
           key: "serviceYear",
           render: (text, record) => {
             return (
-              <div>{!text ? "" : text + "年"}</div>
+              <div>{!text ? "" : text}</div>
             );
           }
         },

+ 2 - 3
js/component/manageCenter/financialManage/distribute/projectvipall.jsx

@@ -195,11 +195,10 @@ const ProjectVipAll = React.createClass({
           title: "年限",
           dataIndex: "serviceLife",
           key: "serviceLife",
-          width: 60,
           render: (text, record) => {
             return (
               !!text && JSON.parse(text).map(item =>
-                <div>{item}</div>
+                <div>{item}</div>
               )
             );
           }
@@ -210,7 +209,7 @@ const ProjectVipAll = React.createClass({
           key: "serviceYear",
           render: (text, record) => {
             return (
-              <div>{!text ? "" : text + "年"}</div>
+              <div>{!text ? "" : text}</div>
             );
           }
         },

+ 2 - 3
js/component/manageCenter/financialManage/orderDetail/orderDetail.jsx

@@ -179,11 +179,10 @@ const OrderDetail = Form.create()(
             title: "年限",
             dataIndex: "serviceLife",
             key: "serviceLife",
-            width: 60,
             render: (text, record) => {
               return (
                 !!text && JSON.parse(text).map(item =>
-                  <div>{item}</div>
+                  <div>{item}</div>
                 )
               );
             }
@@ -194,7 +193,7 @@ const OrderDetail = Form.create()(
             key: "serviceYear",
             render: (text, record) => {
               return (
-                <div>{!text ? "" : text + "年"}</div>
+                <div>{!text ? "" : text}</div>
               );
             }
           },

+ 2 - 3
js/component/manageCenter/order/orderNew/addService.jsx

@@ -405,11 +405,10 @@ const NewService = Form.create()(
             title: "年限",
             dataIndex: "serviceLife",
             key: "serviceLife",
-            width: 60,
             render: (text, record) => {
               return (
                 !!text && JSON.parse(text).map(item =>
-                  <div>{item}</div>
+                  <div>{item}</div>
                 )
               );
             }
@@ -420,7 +419,7 @@ const NewService = Form.create()(
             key: "serviceYear",
             render: (text, record) => {
               return (
-                <div>{!text ? "" : text + "年"}</div>
+                <div>{!text ? "" : text}</div>
               );
             }
           },

+ 2 - 0
js/component/manageCenter/order/orderNew/approveds.jsx

@@ -47,6 +47,8 @@ import EnterpriseNameChange from "../../../common/enterpriseNameChange";
 import OrderCoor from './changeComponent/orderCoor';
 import ContentUrl from './contentUrl';
 import LogPopup from "../../../common/logPopup";
+import Cascaders from "../../../common/cascaders";
+
 const { TabPane } = Tabs;
 const { TextArea } = Input;
 //图片组件

+ 2 - 3
js/component/manageCenter/order/orderNew/approvedvipproject.jsx

@@ -194,11 +194,10 @@ const ApprovedVipProject = React.createClass({
           title: "年限",
           dataIndex: "serviceLife",
           key: "serviceLife",
-          width: 60,
           render: (text, record) => {
             return (
               !!text && JSON.parse(text).map(item =>
-                <div>{item}</div>
+                <div>{item}</div>
               )
             );
           }
@@ -209,7 +208,7 @@ const ApprovedVipProject = React.createClass({
           key: "serviceYear",
           render: (text, record) => {
             return (
-              <div>{!text ? "" : text + "年"}</div>
+              <div>{!text ? "" : text}</div>
             );
           }
         },

+ 182 - 21
js/component/manageCenter/order/orderNew/changeComponent/changeApply.js

@@ -37,6 +37,7 @@ import ProjectOperation from "../../../../common/projectOperation";
 const FormItem = Form.Item;
 const confirm = Modal.confirm;
 const Option = AutoComplete.Option;
+const RadioGroup = Radio.Group;
 const formItemLayout = {
   labelCol: { span: 8 },
   wrapperCol: { span: 14 }
@@ -637,11 +638,10 @@ class ChangeApply extends Component {
           title: "年限",
           dataIndex: "serviceLife",
           key: "serviceLife",
-          width: 60,
           render: (text, record) => {
             return (
               !!text && JSON.parse(text).map(item =>
-                <div>{item}</div>
+                <div>{item}</div>
               )
             );
           }
@@ -652,7 +652,7 @@ class ChangeApply extends Component {
           key: "serviceYear",
           render: (text, record) => {
             return (
-              <div>{!text ? "" : text + "年"}</div>
+              <div>{!text ? "" : text}</div>
             );
           }
         },
@@ -698,6 +698,9 @@ class ChangeApply extends Component {
       displayFees: "none",
       serviceLife: [],
       isVip: undefined,
+
+      addyear: undefined,//
+      isGive: 0,//是否赠送
     };
     this.departmentList = this.departmentList.bind(this);
     this.changeApply = this.changeApply.bind(this);
@@ -1147,14 +1150,34 @@ class ChangeApply extends Component {
         return
       }
     }
-    if (!this.state.commodityPrice) {
-      message.warning("请输入金额!");
-      return
+    if (isNaN(parseFloat(this.state.commodityPrice))) {
+      message.warning("请输入正确的金额!");
+      return;
+    }
+    if (this.state.addProjectType == "3") {// 3审计
+      if (this.state.serviceLife.length === 0) {
+        message.warning("请选择服务年限!");
+        return
+      }
+      if (this.state.serviceLife.length != this.state.commodityQuantity) {
+        message.warning("服务数量与服务年限不符!");
+        return
+      }
     }
     if (!this.state.main) {
       message.warning("请选择是否为主要项目!");
       return
     }
+    if (this.state.addProjectType === 5) {// 5高新
+      if (!this.state.declarationBatch) {
+        message.warning("请选择企业要求申报批次!");
+        return
+      }
+      if (!this.state.serviceYear) {
+        message.warning("请选择申报年份!");
+        return
+      }
+    }
     if (this.state.isVip == 6) {
       if (this.state.yearSum === undefined) {
         message.warning("请选择会员总服务年限!");
@@ -1191,6 +1214,12 @@ class ChangeApply extends Component {
       cid: this.state.data.id, //变更ID
       type,
     }
+    if (this.state.addProjectType == "3") {//审计
+      infor.serviceLife = JSON.stringify(this.state.serviceLife) //服务年限
+    }
+    if (this.state.addProjectType == "5") {//高新
+      infor.serviceYear = JSON.stringify(this.state.serviceYear) //申报年份
+    }
     if (this.state.isVip == 6) {//会员
       infor.yearSum = this.state.yearSum //会员总服务年限
       infor.serviceLife = JSON.stringify(this.state.serviceLife) //会员服务年限
@@ -1765,6 +1794,11 @@ class ChangeApply extends Component {
     );
   }
 
+  handleClose(removedTag) {
+    let serviceLife = this.state.serviceLife.filter(tag => { return tag !== removedTag });
+    this.setState({ serviceLife });
+  }
+
   render() {
     const expandedRowRender = e => {
       const data = e.list;
@@ -2622,6 +2656,30 @@ class ChangeApply extends Component {
                   />
                   <span className="mandatory">*</span>
                 </FormItem>
+                {
+                  //审计
+                  this.state.addProjectType == "3" &&
+                  <FormItem
+                    className="half-item"
+                    {...formItemLayout}
+                    label="服务年限"
+                  >
+                    <Select
+                      mode="multiple"
+                      style={{ width: '200px' }}
+                      placeholder="请选择服务年限"
+                      value={this.state.serviceLife}
+                      onChange={(e) => {
+                        this.setState({
+                          serviceLife: e,
+                        })
+                      }}
+                    >
+                      {children}
+                    </Select>
+                    <span className="mandatory">*</span>
+                  </FormItem>
+                }
                 <FormItem
                   className="half-item"
                   {...formItemLayout}
@@ -2687,22 +2745,46 @@ class ChangeApply extends Component {
                     label="会员服务年限"
                   >
                     {
-                      <Select
-                        mode="multiple"
-                        style={{ width: '200px' }}
-                        placeholder="请选择服务年限"
-                        defaultValue={this.state.serviceLife}
-                        onChange={e => {
-                          this.setState({
-                            serviceLife: e,
-                            serviceYear: undefined,
-                          })
-                        }}
-                      >
-                        {children}
-                      </Select>
+                      <div>
+                        {
+                          this.state.serviceLife.map((tag) =>
+                            <Tag closable key={tag} afterClose={() => this.handleClose(tag)}>
+                              {tag}
+                            </Tag>
+                          )
+                        }
+                        {
+                          this.state.serviceLife.length < this.state.yearSum &&
+                          <Button
+                            size="small"
+                            type="primary"
+                            onClick={() => {
+                              this.setState({
+                                addYears: true,
+                                addyear: undefined,
+                                isGive: 0,
+                              })
+                            }}>
+                            + 添加服务年限
+                          </Button>
+                        }
+                      </div>
+                      // <Select
+                      //   mode="multiple"
+                      //   style={{ width: '200px' }}
+                      //   placeholder="请选择服务年限"
+                      //   defaultValue={this.state.serviceLife}
+                      //   onChange={e => {
+                      //     this.setState({
+                      //       serviceLife: e,
+                      //       serviceYear: undefined,
+                      //     })
+                      //   }}
+                      // >
+                      //   {children}
+                      // </Select>
                     }
-                    <span className="mandatory">*</span>
+                    {/* <span className="mandatory">*</span> */}
                   </FormItem>
                 }
                 {
@@ -2785,6 +2867,29 @@ class ChangeApply extends Component {
                       </Select>
                       <span className="mandatory">*</span>
                     </FormItem>
+                    <FormItem
+                      className="half-item"
+                      {...formItemLayout}
+                      label="申报年份"
+                    >
+                      <Select
+                        style={{ width: '200px' }}
+                        placeholder="请选择申报年份"
+                        value={this.state.serviceYear}
+                        onChange={e => {
+                          this.setState({
+                            serviceYear: e,
+                          })
+                        }}
+                      >
+                        {
+                          vipYear.map(its => (
+                            <Option key={its}>{its}</Option>
+                          ))
+                        }
+                      </Select>
+                      <span className="mandatory">*</span>
+                    </FormItem>
                   </div> : null
                 }
                 {
@@ -2837,6 +2942,62 @@ class ChangeApply extends Component {
             </Form>
           </Modal>
         </Spin>
+        {
+          this.state.addYears &&
+          <Modal
+            title="添加服务年限"
+            visible={this.state.addYears}
+            okText="添加"
+            onOk={() => {
+              let slist = this.state.serviceLife
+              if (this.state.isGive == 0) {
+                slist.push(this.state.addyear)
+              } else if (this.state.isGive == 1) {
+                let newYear = this.state.addyear + "(赠送)"
+                slist.push(newYear)
+              }
+              this.setState({
+                serviceLife: slist,
+                addYears: false
+              })
+            }}
+            onCancel={() => {
+              this.setState({
+                addYears: false
+              })
+            }}
+          >
+            <Select
+              style={{ width: '200px', marginRight: 50 }}
+              placeholder="请选择年份"
+              onChange={e => {
+                this.setState({
+                  addyear: e,
+                })
+              }}
+            >
+              {
+                vipYear.map(its => (
+                  <Option
+                    key={its}
+                    disabled={this.state.serviceLife.toString().includes(its)}
+                  >{its}</Option>
+                ))
+              }
+            </Select>
+            <RadioGroup
+              onChange={e => {
+                this.setState({
+                  isGive: e.target.value
+                })
+              }}
+              value={this.state.isGive}
+            >
+              <Radio value={0}>非赠送</Radio>
+              <Radio value={1}>赠送</Radio>
+            </RadioGroup>
+          </Modal>
+        }
       </div>
     );
   }

+ 2 - 3
js/component/manageCenter/order/orderNew/changeComponent/orderDetail.js

@@ -224,11 +224,10 @@ class OrderDetail extends Component {
           title: "年限",
           dataIndex: "serviceLife",
           key: "serviceLife",
-          width: 60,
           render: (text, record) => {
             return (
               !!text && JSON.parse(text).map(item =>
-                <div>{item}</div>
+                <div>{item}</div>
               )
             );
           }
@@ -239,7 +238,7 @@ class OrderDetail extends Component {
           key: "serviceYear",
           render: (text, record) => {
             return (
-              <div>{!text ? "" : text + "年"}</div>
+              <div>{!text ? "" : text}</div>
             );
           }
         },

+ 2 - 2
js/component/manageCenter/order/orderNew/myprojectvip.jsx

@@ -197,7 +197,7 @@ const MyProjectVip = React.createClass({
           render: (text, record) => {
             return (
               !!text && JSON.parse(text).map(item =>
-                <div>{item}</div>
+                <div>{item}</div>
               )
             );
           }
@@ -208,7 +208,7 @@ const MyProjectVip = React.createClass({
           key: "serviceYear",
           render: (text, record) => {
             return (
-              <div>{!text ? "" : text + "年"}</div>
+              <div>{!text ? "" : text}</div>
             );
           }
         },