deason 6 年 前
コミット
d29564116c

+ 7 - 2
src/modules/print/view/Project.vue

@@ -40,7 +40,11 @@
           </el-form-item>
 
           <el-form-item label="考试">
-            <el-select v-model="formSearch.examId" placeholder="请选择">
+            <el-select
+              v-model="formSearch.examId"
+              @change="searchRecords"
+              placeholder="请选择"
+            >
               <el-option
                 v-for="item in examList"
                 :label="item.examName"
@@ -600,7 +604,8 @@ export default {
       /* 查询考试列表 */
       this.formSearch.examId = "";
       this.examList = [];
-
+      this.tableData = [];
+      //console.log("orgId:" + orgId);
       if (!this.isEmptyNumber(orgId)) {
         let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
         this.$http.post(url).then(response => {

+ 71 - 24
src/modules/print/view/ProjectStatistic.vue

@@ -44,6 +44,7 @@
             <el-select
               :disabled="showGoBack"
               v-model="formSearch.examId"
+              @change="searchRecords"
               placeholder="请选择"
             >
               <el-option
@@ -69,8 +70,9 @@
               type="primary"
               icon="el-icon-plus"
               :disabled="!hasPermit"
+              v-show="formSearch.examId != ''"
               @click="openOtherSettingDialog"
-              >新增其事项
+              >新增其事项
             </el-button>
 
             <el-button
@@ -172,19 +174,28 @@
                 <el-input
                   v-model="backupSettingForm.eachPkgPercent"
                   :disabled="!backupSettingForm.needEachPkg"
-                ></el-input>
+                  ><template slot="append"
+                    >%</template
+                  ></el-input
+                >
               </el-form-item>
               <el-form-item label="最大" prop="eachPkgMax">
                 <el-input
                   v-model="backupSettingForm.eachPkgMax"
                   :disabled="!backupSettingForm.needEachPkg"
-                ></el-input>
+                  ><template slot="append"
+                    >%</template
+                  ></el-input
+                >
               </el-form-item>
               <el-form-item label="最小" prop="eachPkgMin">
                 <el-input
                   v-model="backupSettingForm.eachPkgMin"
                   :disabled="!backupSettingForm.needEachPkg"
-                ></el-input>
+                  ><template slot="append"
+                    >%</template
+                  ></el-input
+                >
               </el-form-item>
             </el-tab-pane>
           </el-tabs>
@@ -213,19 +224,28 @@
                 <el-input
                   v-model="backupSettingForm.alonePkgPercent"
                   :disabled="!backupSettingForm.needAlonePkg"
-                ></el-input>
+                  ><template slot="append"
+                    >%</template
+                  >
+                </el-input>
               </el-form-item>
               <el-form-item label="最大" prop="alonePkgMax">
                 <el-input
                   v-model="backupSettingForm.alonePkgMax"
                   :disabled="!backupSettingForm.needAlonePkg"
-                ></el-input>
+                  ><template slot="append"
+                    >%</template
+                  ></el-input
+                >
               </el-form-item>
               <el-form-item label="最小" prop="alonePkgMin">
                 <el-input
                   v-model="backupSettingForm.alonePkgMin"
                   :disabled="!backupSettingForm.needAlonePkg"
-                ></el-input>
+                  ><template slot="append"
+                    >%</template
+                  ></el-input
+                >
               </el-form-item>
             </el-tab-pane>
           </el-tabs>
@@ -387,7 +407,7 @@ export default {
             type: "number",
             required: true,
             validator: validateEachPkgPercent,
-            trigger: "blur"
+            trigger: "change"
           }
         ],
         eachPkgMax: [
@@ -395,7 +415,7 @@ export default {
             type: "number",
             required: true,
             validator: validateEachPkgMax,
-            trigger: "blur"
+            trigger: "change"
           }
         ],
         eachPkgMin: [
@@ -403,7 +423,7 @@ export default {
             type: "number",
             required: true,
             validator: validateEachPkgMin,
-            trigger: "blur"
+            trigger: "change"
           }
         ],
         alonePkgPercent: [
@@ -411,7 +431,7 @@ export default {
             type: "number",
             required: true,
             validator: validateAlonePkgPercent,
-            trigger: "blur"
+            trigger: "change"
           }
         ],
         alonePkgMax: [
@@ -419,7 +439,7 @@ export default {
             type: "number",
             required: true,
             validator: validateAlonePkgMax,
-            trigger: "blur"
+            trigger: "change"
           }
         ],
         alonePkgMin: [
@@ -427,14 +447,14 @@ export default {
             type: "number",
             required: true,
             validator: validateAlonePkgMin,
-            trigger: "blur"
+            trigger: "change"
           }
         ],
         groupType: [
           { required: true, validator: validateGroupType, trigger: "change" }
         ],
         remark: [
-          { required: true, message: "请输入事项内容!", trigger: "blur" }
+          { required: true, message: "请输入事项内容!", trigger: "change" }
         ]
       }
     };
@@ -514,7 +534,9 @@ export default {
       /* 查询考试列表 */
       this.formSearch.examId = "";
       this.examList = [];
-
+      this.tableData = [];
+      this.projectId = "";
+      //console.log("orgId:" + orgId);
       if (!this.isEmptyNumber(orgId)) {
         let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
         this.$http.post(url).then(response => {
@@ -524,6 +546,24 @@ export default {
     },
     refreshStatistic() {
       /* 刷新当前统计信息 */
+      let orgId = this.formSearch.orgId;
+      if (this.isEmptyNumber(orgId)) {
+        this.$notify({
+          message: "请选择学校!",
+          type: "warning"
+        });
+        return;
+      }
+
+      let examId = this.formSearch.examId;
+      if (this.isEmptyNumber(examId)) {
+        this.$notify({
+          message: "请选择考试!",
+          type: "warning"
+        });
+        return;
+      }
+
       this.$confirm("刷新当前统计信息?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -533,9 +573,9 @@ export default {
           let url =
             PRINT_API +
             "/printing/project/statistic/refresh/" +
-            +this.formSearch.orgId +
+            orgId +
             "/" +
-            this.formSearch.examId;
+            examId;
           this.$http.post(url).then(
             () => {
               this.$notify({
@@ -568,7 +608,7 @@ export default {
           !this.backupSettingForm.needAlonePkg
         ) {
           this.$notify({
-            message: "请至少选择一种备份方式!",
+            message: "请至少设置一种备份方式!",
             type: "warning"
           });
           return;
@@ -599,7 +639,6 @@ export default {
       this.$http.post(url).then(
         response => {
           this.backupSettingForm = response.data;
-          this.$refs.backupSettingForm.validate();
         },
         () => {
           this.backupSettingForm = {
@@ -614,7 +653,6 @@ export default {
             alonePkgMin: "",
             groupType: ""
           };
-          this.$refs.backupSettingForm.validate();
         }
       );
       this.backupSettingDialog = true;
@@ -642,7 +680,6 @@ export default {
         },
         error => {
           console.log(error);
-          this.loading = false;
         }
       );
     },
@@ -698,18 +735,28 @@ export default {
           );
         })
         .catch(() => {
-          //ignore
+          /*ignore*/
         });
     },
     openOtherSettingDialog(row) {
       /* 打开其它事项弹窗 */
+      if (this.isEmptyNumber(this.projectId)) {
+        this.$notify({
+          message: "请选择学校和考试!",
+          type: "warning"
+        });
+        return;
+      }
       this.otherSettingDialog = true;
       this.otherSettingForm.projectId = this.projectId;
-      if (row) {
+      if (row.id) {
         this.otherSettingForm.id = row.id;
-        this.otherSettingForm.remark = row.remark;
       } else {
         this.otherSettingForm.id = "";
+      }
+      if (row.remark) {
+        this.otherSettingForm.remark = row.remark;
+      } else {
         this.otherSettingForm.remark = "";
       }
     },