Procházet zdrojové kódy

项目变更增加首付款

dev01 před 2 roky
rodič
revize
43abd63477

+ 5 - 5
js/component/common/cascaders/index.jsx

@@ -94,7 +94,7 @@ class Cascaders extends Component {
       if (its.checked) {
         list.push(its[id])
       }
-      if (its[children]) {
+      if (!!its[children] && its[children].length > 0) {
         its[children].forEach((itl) => {
           if (itl.checked) {
             list.push(itl[id])
@@ -127,13 +127,13 @@ class Cascaders extends Component {
     authTree.forEach((item1) => {
       if (item1[id] == iD) {
         item1.checked = checked;
-        if (item1[children]) {
+        if (!!item1[children] && item1[children].length > 0) {
           item1[children].forEach((item2) => {
             item2.checked = checked;
           });
         }
       } else {
-        if (!!item1[children]) {
+        if (!!item1[children] && item1[children].length > 0) {
           // 反向思路: 保存子选项框的个数, 子选项选中就-1, 等于0说明都选中了, 父选项就勾上
           let temp1 = item1[children].length;
           item1[children].forEach((item2) => {
@@ -164,11 +164,11 @@ class Cascaders extends Component {
   }
   // checked组件样式
   inde(item) {
-    const { children } = this.props
+    const { children = "list" } = this.props
     if (item.checked) {
       return false
     } else {
-      if (!!item[children]) {
+      if (!!item[children] && item[children].length > 0) {
         let clist = []
         for (var i = 0; i < item[children].length; i++) {
           if (item[children][i].checked == true) {

+ 1 - 0
js/component/common/enterpriseNameChange/index.jsx

@@ -166,6 +166,7 @@ class EnterpriseNameChange extends Component {
                             enterpriseId={this.props.enterpriseId}
                             type={this.props.type}
                             data={this.props.data}
+                            onCancel={this.props.onCancel}
                         /> : null
                 }
                 <Modal

+ 2 - 0
js/component/common/enterpriseNameChange/inforChange.jsx

@@ -157,6 +157,7 @@ class InforChange extends Component {
         }
         if (this.state.changeType === 3) {
             data.orgCode = dataArrar
+            this.props.onCancel();
         }
         $.ajax({
             url: globalConfig.context + "/api/admin/customer/updateUserDate",
@@ -192,6 +193,7 @@ class InforChange extends Component {
                         this.setState({
                             orgCode: dataArrar
                         })
+                        this.props.onCancel();
                     }
                     this.onCancel();
                 } else {

+ 1 - 1
js/component/manageCenter/customer/NEW/intentionCustomer/intentionCustomer.jsx

@@ -55,7 +55,7 @@ const IntentionCustomer = Form.create()(
             ? this.state.provinceSearch
             : this.state.addressSearch[0],
           city: !this.state.addressSearch.length
-            ? ""
+            ? undefined
             : this.state.addressSearch[1],
           startDate: this.state.releaseDate[0],
           endDate: this.state.releaseDate[1],

+ 1 - 0
js/component/manageCenter/customer/NEW/intentionCustomer/intentionDetail/detail/contactPerson.jsx

@@ -326,6 +326,7 @@ const ContactPerson = React.createClass({
                 enterpriseId={this.props.data.uid}
                 enterpriseName={this.props.name}
                 data={this.props.data}
+                onCancel={this.props.onCancel}
                 onChangeSuccess={(value)=>{
                   this.setState({
                     enterpriseName:value

+ 1 - 0
js/component/manageCenter/customer/NEW/intentionCustomer/intentionDetail/intentionDetail.jsx

@@ -140,6 +140,7 @@ const IntentionDetail = React.createClass({
 								name={this.props.name}
 								data={this.props.IntentionData}
 								contactState={this.state.contactState}
+								onCancel={this.detailsModal}
 							/>
 						</TabPane> : ""}
 						{/* {!this.props.isGuidanceLv ? <TabPane tab="账户信息" key="3">*/}

+ 1 - 0
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/detail/contactPerson.jsx

@@ -325,6 +325,7 @@ const ContactPerson = React.createClass({
                 enterpriseId={this.props.data.uid}
                 enterpriseName={this.props.name}
                 data={this.props.data}
+                onCancel={this.props.onCancel}
                 onChangeSuccess={(value)=>{
                   this.setState({
                     enterpriseName:value

+ 1 - 0
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/intentionDetail.jsx

@@ -145,6 +145,7 @@ const IntentionDetail = React.createClass({
 								name={this.props.name}
 								data={this.props.IntentionData}
 								contactState={this.state.contactState}
+								onCancel={this.detailsModal}
 							/>
 						</TabPane>
 						{/*<TabPane tab="账户信息" key="3">*/}

+ 47 - 1
js/component/manageCenter/order/orderNew/addService.jsx

@@ -2970,6 +2970,7 @@ const NewService = Form.create()(
                   changeId: thisdata.id,
                   typeChange: thisdata.type,
                   totalAmount: thisdata.totalAmount,
+                  firstAmount: thisdata.firstAmount,
                   settlementAmount: thisdata.settlementAmount,
                   changeAmount: thisdata.changeAmount,
                   remarksC: thisdata.remarks,
@@ -3648,6 +3649,18 @@ const NewService = Form.create()(
         message.warning("请选择变更类型");
         return false;
       }
+      if (this.state.totalAmount === "") {
+        message.warning("合同金额不能为空!");
+        return false;
+      }
+      if (this.state.firstAmount === "") {
+        message.warning("首付款金额不能为空!");
+        return false;
+      }
+      if (this.state.totalAmount < this.state.firstAmount) {
+        message.warning("首付款不能大于合同额!");
+        return;
+      }
       if (
         this.state.typeChange == 0 ||
         this.state.typeChange == 1 ||
@@ -3723,6 +3736,7 @@ const NewService = Form.create()(
             remarks: this.state.remarksC,
             voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
             totalAmount: this.state.totalAmount,
+            firstAmount: this.state.firstAmount,
             settlementAmount: this.state.settlementAmount,
             changeAmount: this.state.changeAmount,
             applicant: this.state.salesmanName,
@@ -3761,6 +3775,7 @@ const NewService = Form.create()(
             remarks: this.state.remarksC,
             voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
             totalAmount: this.state.totalAmount,
+            firstAmount: this.state.firstAmount,
             settlementAmount: this.state.settlementAmount,
             changeAmount: this.state.changeAmount,
             applicant: this.state.salesmanName,
@@ -4310,6 +4325,18 @@ const NewService = Form.create()(
         message.warning("请选择变更类型");
         return false;
       }
+      if (this.state.totalAmount === "") {
+        message.warning("合同金额不能为空!");
+        return false;
+      }
+      if (this.state.firstAmount === "") {
+        message.warning("首付款金额不能为空!");
+        return false;
+      }
+      if (this.state.totalAmount < this.state.firstAmount) {
+        message.warning("首付款不能大于合同额!");
+        return;
+      }
       if (
         this.state.typeChange == 0 ||
         this.state.typeChange == 1 ||
@@ -4382,7 +4409,8 @@ const NewService = Form.create()(
           startRemarks: this.state.startRemarks,
           remarks: this.state.remarksC,
           voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
-          totalAmount: this.state.totalAmount,
+          totalAmount: this.state.totalAmount,//合同额
+          firstAmount: this.state.firstAmount,//首付款
           settlementAmount: this.state.settlementAmount,
           changeAmount: this.state.changeAmount,
           applicant: this.state.salesmanName,
@@ -7487,6 +7515,24 @@ const NewService = Form.create()(
                               <FormItem
                                 labelCol={{ span: 4 }}
                                 wrapperCol={{ span: 18 }}
+                                label="首付款(万元)"
+                              >
+                                <Input
+                                  placeholder="请输入首付款"
+                                  disabled={this.state.hetongFlag}
+                                  ref="signTotalAmount"
+                                  value={this.state.firstAmount}
+                                  onChange={(e) => {
+                                    this.setState({
+                                      firstAmount: e.target.value,
+                                    });
+                                  }}
+                                  style={{ width: "240px" }}
+                                />
+                              </FormItem>
+                              <FormItem
+                                labelCol={{ span: 4 }}
+                                wrapperCol={{ span: 18 }}
                                 label="已收款(万元)"
                               >
                                 <span>

+ 41 - 5
js/component/manageCenter/order/orderNew/changeComponent/changeApply.js

@@ -978,6 +978,18 @@ class ChangeApply extends Component {
   }
   //变更申请
   changeApply() {
+    if (this.state.data.totalAmount === "") {
+      message.warning("合同金额不能为空!");
+      return false;
+    }
+    if (this.state.data.firstAmount === "") {
+      message.warning("首付款金额不能为空!");
+      return false;
+    }
+    if (this.state.data.totalAmount < this.state.data.firstAmount) {
+      message.warning("首付款不能大于合同额!");
+      return;
+    }
     if (moneyVerify(this.state.data.totalAmount)) {
       return false;
     }
@@ -1770,7 +1782,6 @@ class ChangeApply extends Component {
   }
   componentWillMount() {
     this.departmentList();
-
     this.state.data = this.props.orderData;
     this.state.data.oldPrice = this.props.orderData.totalAmount;
     this.setState({
@@ -2405,11 +2416,18 @@ class ChangeApply extends Component {
                   this.state.data.typeChange = undefined;
                   this.state.data.totalAmount = this.state.data.oldPrice;
                   this.setState({
-                    listFlag: false,
-                    hetongFlag: false,
-                    listCuiFlag: false,
-                    tuiKuanFlag: false,
+                    listFlag: true,
+                    listCuiFlag: true,
+                    hetongFlag: true,
+                    tuiKuanFlag: true,
                     displayList: false,
+                    isNew: false,
+
+                    // listFlag: false,
+                    // hetongFlag: false,
+                    // listCuiFlag: false,
+                    // tuiKuanFlag: false,
+                    // displayList: false,
                     startRemarks: "",
                     data: this.state.data,
                     changeFlag: false,
@@ -2470,6 +2488,24 @@ class ChangeApply extends Component {
             <FormItem
               labelCol={{ span: 4 }}
               wrapperCol={{ span: 18 }}
+              label="首付款(万元)"
+            >
+              <Input
+                placeholder="请输入首付款"
+                ref="signTotalAmount"
+                disabled={this.state.hetongFlag}
+                value={data.firstAmount}
+                onChange={(e) => {
+                  let data = this.state.data;
+                  data.firstAmount = e.target.value;
+                  this.setState({ data });
+                }}
+                style={{ width: "240px" }}
+              />
+            </FormItem>
+            <FormItem
+              labelCol={{ span: 4 }}
+              wrapperCol={{ span: 18 }}
               label="已收款(万元)"
             >
               {/* <Input

+ 7 - 2
js/component/manageCenter/order/orderNew/contractYxy.js

@@ -1155,7 +1155,8 @@ const contractChange = Form.create()(
         },
         () => {
           this.setState({
-            visible: false
+            visible: false,
+            contractData: {}
           });
         }
       );
@@ -1183,6 +1184,9 @@ const contractChange = Form.create()(
     },
 
     createTabs() {
+      this.setState({
+        loading: true
+      });
       $.ajax({
         url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
         method: "get",
@@ -1194,7 +1198,8 @@ const contractChange = Form.create()(
             message.warning(data.error[0].message)
           } else {
             this.setState({
-              tabList: data.data
+              tabList: data.data,
+              loading: false
             })
           }
         }

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.2.45",
+  "version": "1.2.47",
   "description": "",
   "main": "index.js",
   "scripts": {