Browse Source

项目暂停&重启功能

dev01 2 years ago
parent
commit
a42ec9bd3c

+ 20 - 2
js/component/common/mysuspend/index.jsx

@@ -84,8 +84,14 @@ class MySuspend extends Component {
   }
 
   componentDidMount() {
-    const { rowData } = this.props
-    !!rowData && !!rowData.id && this.getLog(rowData.id)
+    const { rowData, type, again = false } = this.props
+    type == "details" && !!rowData && !!rowData.id && this.getLog(rowData.id)
+    if (again) {
+      this.setState({
+        reason: rowData.reason,
+        orgCodeUrl: splitUrl(rowData.annexUrl, ",", globalConfig.avatarHost + "/upload"),
+      })
+    }
   }
 
 
@@ -143,6 +149,10 @@ class MySuspend extends Component {
       message.warning("请填写原因!");
       return
     }
+    if (!this.state.reason.replace(/\s+/g, '')) {
+      message.warning("请填写原因!");
+      return;
+    }
     this.setState({
       loading: true,
     });
@@ -197,6 +207,10 @@ class MySuspend extends Component {
       message.warning("请填写原因!");
       return
     }
+    if (!this.state.reason.replace(/\s+/g, '')) {
+      message.warning("请填写原因!");
+      return;
+    }
     this.setState({
       loading: true,
     });
@@ -246,6 +260,10 @@ class MySuspend extends Component {
       message.warning("请填写审核说明~");
       return;
     }
+    if (!this.state.emReason.replace(/\s+/g, '')) {
+      message.warning("请填写审核说明~");
+      return;
+    }
     this.setState({
       loading: true,
     });

+ 1 - 1
js/component/common/mysuspend/selectList.jsx

@@ -30,7 +30,7 @@ class SelectList extends Component {
     if (type == "suspend") {
       // 项目暂停
       arr = list.filter(v => {
-        return (v.projectStopStatus == 0 && v.projectStatus != 29)
+        return (v.stopType != 0 && v.projectStatus != 29)
       });
     } else if (type == "restart") {
       // 项目重启

+ 5 - 1
js/component/manageCenter/financialManage/distribute/shouKuang.jsx

@@ -2459,7 +2459,11 @@ const ShouKuang = React.createClass({
     });
   },
   checkOk() {
-    if (this.state.checkData == "" || this.state.checkData == undefined) {
+    if (!this.state.checkData) {
+      message.warning("请填写审核内容");
+      return;
+    }
+    if (!this.state.checkData.replace(/\s+/g, '')) {
       message.warning("请填写审核内容");
       return;
     }

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

@@ -380,6 +380,7 @@ const NewService = Form.create()(
             title: "项目状态",
             dataIndex: "projectStatus",
             key: "projectStatus",
+            width: 80,
             render: (text) => {
               return getProjectName(text);
             },
@@ -3869,7 +3870,7 @@ const NewService = Form.create()(
       });
     },
 
-    componentWillMount(){
+    componentWillMount() {
       const nextProps = this.props
       this.state.visible = nextProps.showDesc;
       this.state.signBillVisible = nextProps.signBillVisible;
@@ -7133,6 +7134,10 @@ const NewService = Form.create()(
                                   marginBottom: "15px",
                                 }}
                                 onClick={() => {
+                                  if (this.state.deleteSign == 2 || this.state.deleteSign == 3) {
+                                    message.warning("项目变更中,无法发起项目重启");
+                                    return
+                                  }
                                   this.setState({
                                     selectVisible: true,
                                     sType: "restart",
@@ -7152,6 +7157,10 @@ const NewService = Form.create()(
                                   marginBottom: "15px",
                                 }}
                                 onClick={() => {
+                                  if (this.state.deleteSign == 2 || this.state.deleteSign == 3) {
+                                    message.warning("项目变更中,无法发起项目暂停");
+                                    return
+                                  }
                                   this.setState({
                                     selectVisible: true,
                                     sType: "suspend",

+ 5 - 1
js/component/manageCenter/order/orderNew/examine.jsx

@@ -992,7 +992,11 @@ const IntentionCustomer = Form.create()(
     },
     //审核通过
     examOk() {
-      if (this.state.remarks == "") {
+      if (!this.state.reason) {
+        message.warning("请填写备注信息");
+        return;
+      }
+      if (!this.state.reason.replace(/\s+/g, '')) {
         message.warning("请填写备注信息");
         return;
       }

+ 2 - 1
js/component/manageCenter/order/orderNew/mysuspend.jsx

@@ -127,7 +127,8 @@ const MySuspendList = React.createClass({
               {getStopStatus(record.stopType, value)}
               <div>
                 {
-                  record.stopType == 0 && value == 1 && record.projectStopStatus == 0 &&
+                  record.stopType == 0 && record.stopStatus == 1 &&
+                  record.projectStopType == 0 && record.projectStopStatus == 1 &&
                   <Button
                     type="primary"
                     onClick={() => {

+ 1 - 1
js/component/manageCenter/order/orderNew/suspendexamine.jsx

@@ -513,7 +513,7 @@ const SuspendExamine = React.createClass({
             reason={rowData.reason}
             annexUrl={rowData.annexUrl}
             rowData={rowData}
-            selectedRows={[{ "commodityName": rowData.projectName, "id": rowData.id }]}
+            selectedRows={[{ "commodityName": rowData.projectName, "id": rowData.tid }]}
             visible={this.state.visible}
             subClose={() => {
               this.loadData(this.state.pageNo);

+ 8 - 0
js/component/manageCenter/project/project/projectAssignment.jsx

@@ -442,6 +442,14 @@ const PaiDan = React.createClass({
   //审核不通过
   examOks() {
     if (this.state.flag) return;
+    if (!this.state.reason) {
+      message.warning("请填写拒绝理由");
+      return;
+    }
+    if (!this.state.reason.replace(/\s+/g, '')) {
+      message.warning("请填写拒绝理由~");
+      return;
+    }
     this.setState({
       flag: true
     });

+ 5 - 1
js/component/manageCenter/publicComponent/assign.jsx

@@ -191,10 +191,14 @@ const Assign = React.createClass({
     },
     //选定对象
     confirmSelect(record) {
-        if (this.state.remarks == "") {
+        if (!this.state.remarks) {
             message.warning("请填写备注信息")
             return
         }
+        if (!this.state.remarks.replace(/\s+/g, '')) {
+            message.warning("请填写备注信息");
+            return;
+          }
         this.setState({
             loading: true
         });