Explorar o código

考核评估2

RaoMeng %!s(int64=3) %!d(string=hai) anos
pai
achega
5e781bd577

+ 24 - 8
uas-office-web/uas-mobile/src/components/common/currencyDetail/CurrencyDetail.jsx

@@ -135,14 +135,30 @@ class CurrencyDetail extends Component {
         billGroupList: nextProps.formData,
       })
     }
-    // if (nextProps.isDetail != this.props.isDetail) {
-    //   const billGroupList = analysisFormData(response.data, isDetail)
-    //   this.props.onDataLoadComplete &&
-    //   this.props.onDataLoadComplete(billGroupList)
-    //   this.setState({
-    //     billGroupList: billGroupList,
-    //   })
-    // }
+    /*if (nextProps.isDetail != this.props.isDetail) {
+      const { billGroupList } = this.state
+      if (billGroupList) {
+        billGroupList.forEach(billGroup => {
+          let showBillFields = billGroup.showBillFields
+          let hideBillFields = billGroup.hideBillFields
+          if (showBillFields) {
+            showBillFields.forEach(showField => {
+              showField.readOnly = nextProps.isDetail
+              showField.allowBlank = nextProps.isDetail
+            })
+          }
+          if (hideBillFields) {
+            hideBillFields.forEach(hideField => {
+              hideField.readOnly = nextProps.isDetail
+              hideField.allowBlank = nextProps.isDetail
+            })
+          }
+        })
+      }
+      this.setState({
+        billGroupList: billGroupList,
+      })
+    }*/
     return true
   }
 

+ 21 - 1
uas-office-web/uas-mobile/src/pages/private/assess/AssessDetail.jsx

@@ -42,7 +42,7 @@ class AssessDetail extends Component {
         onRef={ref => this.cd = ref}
         caller={this.props.match.params.caller}
         id={this.props.match.params.id}
-        isDetail={false}
+        isDetail={!submitAble}
         promptAble={'F'}
         submitUrl={API.KPI_UPDATEANDSUBMITKPIBILL}
         submitSuccess={this.submitSuccess.bind(this)}
@@ -90,6 +90,26 @@ class AssessDetail extends Component {
           }
         }
       }
+      billGroupList.forEach(billGroup => {
+        let showBillFields = billGroup.showBillFields
+        let hideBillFields = billGroup.hideBillFields
+        if (showBillFields) {
+          showBillFields.forEach(showField => {
+            showField.readOnly = statusCode !== 'ENTERING'
+            showField.allowBlank = statusCode !== 'ENTERING'
+          })
+        }
+        if (hideBillFields) {
+          hideBillFields.forEach(hideField => {
+            hideField.readOnly = statusCode !== 'ENTERING'
+            hideField.allowBlank = statusCode !== 'ENTERING'
+          })
+        }
+      })
+      this.cd.setState({
+        billGroupList,
+      })
+
       this.setState({
         submitAble: statusCode === 'ENTERING',
       })