cq 3 роки тому
батько
коміт
c668f1afa2

+ 4 - 2
ui/src/views/ehs/environapproval/index.vue

@@ -730,8 +730,10 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          this.form.validityBefore = this.chooseDate[0];
-          this.form.validityAfter = this.chooseDate[1];
+          if (this.form.isPermanent === 0) {
+            this.form.validityBefore = this.chooseDate[0];
+            this.form.validityAfter = this.chooseDate[1];
+          }
           if (this.form.id != null) {
             updateEnvironapproval(this.form).then(response => {
               this.msgSuccess(this.$t('修改成功'));

+ 4 - 2
ui/src/views/ehs/fireapproval/index.vue

@@ -717,8 +717,10 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          this.form.validityBefore = this.chooseDate[0];
-          this.form.validityAfter = this.chooseDate[1];
+          if (this.form.isPermanent === 0) {
+            this.form.validityBefore = this.chooseDate[0];
+            this.form.validityAfter = this.chooseDate[1];
+          }
           if (this.form.id != null) {
             updateFireapproval(this.form).then(response => {
               this.msgSuccess(this.$t('修改成功'));

+ 4 - 0
ui/src/views/ehs/healthapproval/index.vue

@@ -639,6 +639,10 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+          if (this.form.isPermanent === 0) {
+            this.form.validityBefore = this.chooseDate[0];
+            this.form.validityAfter = this.chooseDate[1];
+          }
           if (this.form.id != null) {
             updateHealthapproval(this.form).then(response => {
               this.msgSuccess(this.$t('修改成功'));

+ 4 - 4
ui/src/views/ehs/safetyapproval/index.vue

@@ -729,10 +729,10 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          this.form.validityBefore = this.chooseDate[0];
-          this.form.validityAfter = this.chooseDate[1];
-          console.info("validityBefore:" + this.form.validityBefore)
-          console.info("validityAfter:" + this.form.validityAfter)
+          if (this.form.isPermanent === 0) {
+            this.form.validityBefore = this.chooseDate[0];
+            this.form.validityAfter = this.chooseDate[1];
+          }
           if (this.form.id != null) {
             updateSafetyapproval(this.form).then(response => {
               this.msgSuccess(this.$t('修改成功'));