deason 6 年之前
父节点
当前提交
278265d876
共有 2 个文件被更改,包括 124 次插入32 次删除
  1. 10 10
      src/modules/print/view/Project.vue
  2. 114 22
      src/modules/print/view/ProjectStatistic.vue

+ 10 - 10
src/modules/print/view/Project.vue

@@ -166,7 +166,7 @@
             <el-col :span="12">
               <el-form-item label="学校" prop="orgId">
                 <el-select
-                  v-model.number="projectSettingForm.orgId"
+                  v-model="projectSettingForm.orgId"
                   placeholder="请选择"
                   :disabled="true"
                 >
@@ -183,7 +183,7 @@
             <el-col :span="12">
               <el-form-item label="考试" prop="examId">
                 <el-select
-                  v-model.number="projectSettingForm.examId"
+                  v-model="projectSettingForm.examId"
                   placeholder="请选择"
                   :disabled="true"
                 >
@@ -202,7 +202,7 @@
             <el-col :span="12">
               <el-form-item label="项目经理" prop="pmId">
                 <el-select
-                  v-model.number="projectSettingForm.pmId"
+                  v-model="projectSettingForm.pmId"
                   placeholder="请选择"
                   @change="selectPmName"
                   clearable
@@ -220,7 +220,7 @@
             <el-col :span="12">
               <el-form-item label="供应商" prop="supplierId">
                 <el-select
-                  v-model.number="projectSettingForm.supplierId"
+                  v-model="projectSettingForm.supplierId"
                   placeholder="请选择"
                   @change="selectSupplierName"
                   clearable
@@ -240,7 +240,7 @@
             <el-col :span="12">
               <el-form-item label="准备开始时间" prop="prepareStartTime">
                 <el-date-picker
-                  v-model.number="projectSettingForm.prepareStartTime"
+                  v-model="projectSettingForm.prepareStartTime"
                   type="datetime"
                   format="yyyy-MM-dd HH:mm:ss"
                   placeholder="选择开始时间"
@@ -251,7 +251,7 @@
             <el-col :span="12">
               <el-form-item label="准备结束时间" prop="prepareEndTime">
                 <el-date-picker
-                  v-model.number="projectSettingForm.prepareEndTime"
+                  v-model="projectSettingForm.prepareEndTime"
                   type="datetime"
                   format="yyyy-MM-dd HH:mm:ss"
                   placeholder="选择结束时间"
@@ -265,7 +265,7 @@
             <el-col :span="12">
               <el-form-item label="印刷开始时间" prop="printStartTime">
                 <el-date-picker
-                  v-model.number="projectSettingForm.printStartTime"
+                  v-model="projectSettingForm.printStartTime"
                   type="datetime"
                   format="yyyy-MM-dd HH:mm:ss"
                   placeholder="选择开始时间"
@@ -276,7 +276,7 @@
             <el-col :span="12">
               <el-form-item label="印刷结束时间" prop="printEndTime">
                 <el-date-picker
-                  v-model.number="projectSettingForm.printEndTime"
+                  v-model="projectSettingForm.printEndTime"
                   type="datetime"
                   format="yyyy-MM-dd HH:mm:ss"
                   placeholder="选择结束时间"
@@ -290,7 +290,7 @@
             <el-col :span="12">
               <el-form-item label="邮寄开始时间" prop="mailStartTime">
                 <el-date-picker
-                  v-model.number="projectSettingForm.mailStartTime"
+                  v-model="projectSettingForm.mailStartTime"
                   type="datetime"
                   format="yyyy-MM-dd HH:mm:ss"
                   placeholder="选择开始时间"
@@ -301,7 +301,7 @@
             <el-col :span="12">
               <el-form-item label="邮寄结束时间" prop="mailEndTime">
                 <el-date-picker
-                  v-model.number="projectSettingForm.mailEndTime"
+                  v-model="projectSettingForm.mailEndTime"
                   type="datetime"
                   format="yyyy-MM-dd HH:mm:ss"
                   placeholder="选择结束时间"

+ 114 - 22
src/modules/print/view/ProjectStatistic.vue

@@ -69,7 +69,7 @@
               type="primary"
               icon="el-icon-plus"
               :disabled="!hasPermit"
-              @click="addOtherSetting"
+              @click="openOtherSettingDialog"
               >新增其他事项
             </el-button>
 
@@ -103,7 +103,7 @@
           border
         >
           <el-table-column width="60" label="类型" prop="type" />
-          <el-table-column width="100" label="人科次" prop="totalStudent" />
+          <el-table-column width="80" label="人科次" prop="totalStudent" />
           <el-table-column width="100" label="课程数量" prop="totalCourse" />
           <el-table-column width="100" label="试卷数量" prop="totalPaper" />
           <el-table-column width="100" label="印刷数量A3" prop="A3" />
@@ -111,8 +111,8 @@
           <el-table-column width="100" label="总数(A3)" prop="sumA3" />
           <el-table-column width="80" label="试卷袋数" prop="totalPkg" />
           <el-table-column label="事项说明" prop="remark" />
-          <el-table-column width="100" label="印刷供应商" prop="supplierName" />
-          <el-table-column width="100" label="项目经理" prop="pmName" />
+          <el-table-column width="120" label="印刷供应商" prop="supplierName" />
+          <el-table-column width="120" label="项目经理" prop="pmName" />
 
           <el-table-column width="180" label="操作" :context="_self">
             <template slot-scope="scope">
@@ -129,7 +129,7 @@
                 size="mini"
                 icon="el-icon-edit"
                 v-if="scope.row.btnType == 'OTHER'"
-                @click="editOtherSetting(scope.row);"
+                @click="openOtherSettingDialog(scope.row);"
                 :disabled="!hasPermit"
                 >修改
               </el-button>
@@ -147,6 +147,34 @@
           </el-table-column>
         </el-table>
       </div>
+
+      <!-- 其它事项弹窗 -->
+      <el-dialog
+        title="其它事项"
+        width="750px"
+        :visible.sync="otherSettingDialog"
+        @close="closeOtherSettingDialog"
+      >
+        <el-form
+          :model="otherSettingForm"
+          ref="otherSettingForm"
+          :rules="rules"
+          label-position="right"
+          label-width="110px"
+        >
+          <el-form-item label="事项内容" prop="remark">
+            <el-input
+              type="textarea"
+              :rows="8"
+              v-model="otherSettingForm.remark"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+        <div style="text-align: center">
+          <el-button type="primary" @click="editOtherSetting">确 定 </el-button>
+          <el-button @click="closeOtherSettingDialog">取 消</el-button>
+        </div>
+      </el-dialog>
     </div>
   </section>
 </template>
@@ -170,7 +198,16 @@ export default {
       projectId: "",
       orgList: [],
       examList: [],
-      rules: {}
+      backupSettingDialog: false,
+      otherSettingDialog: false,
+      otherSettingForm: {
+        id: "",
+        projectId: "",
+        remark: ""
+      },
+      rules: {
+        remark: [{ required: true, message: "请输入事项内容", trigger: "blur" }]
+      }
     };
   },
   methods: {
@@ -295,29 +332,73 @@ export default {
         }
       );
     },
-    addOtherSetting() {
-      /* 新增其它事项 */
-      this.$notify({
-        message: "Todo...",
-        type: "warning"
-      });
-    },
-    editOtherSetting(row) {
-      /* 修改某个其它事项 */
-      console.log(row);
-      this.$notify({
-        message: "Todo...",
-        type: "warning"
+    editOtherSetting() {
+      /* 保存其它事项 */
+      this.$refs.otherSettingForm.validate(valid => {
+        if (!valid) {
+          return false;
+        }
+        let url = print_api + "/project/other/setting/save";
+        this.$http.post(url, this.otherSettingForm).then(
+          () => {
+            this.$notify({
+              type: "success",
+              message: "保存其它事项成功!"
+            });
+            this.otherSettingDialog = false;
+            this.searchRecords();
+          },
+          error => {
+            console.log(error);
+            this.$notify({
+              message: "保存其它事项失败!",
+              type: "error"
+            });
+          }
+        );
       });
     },
     removeOtherSetting(row) {
       /* 删除某个其它事项 */
-      console.log(row);
-      this.$notify({
-        message: "Todo...",
+      this.$confirm("确定删除当前事项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
         type: "warning"
+      }).then(() => {
+        var url = print_api + "/project/other/setting/delete/" + row.id;
+        this.$http.post(url).then(
+          () => {
+            this.$notify({
+              type: "success",
+              message: "删除当前事项成功!"
+            });
+            this.searchRecords();
+          },
+          () => {
+            this.$notify({
+              type: "error",
+              message: "删除当前事项失败!"
+            });
+          }
+        );
       });
     },
+    openOtherSettingDialog(row) {
+      /* 打开其它事项弹窗 */
+      this.otherSettingDialog = true;
+      this.otherSettingForm.projectId = this.projectId;
+      if (row) {
+        this.otherSettingForm.id = row.id;
+        this.otherSettingForm.remark = row.remark;
+      } else {
+        this.otherSettingForm.id = "";
+        this.otherSettingForm.remark = "";
+      }
+    },
+    closeOtherSettingDialog() {
+      /* 关闭其它事项弹窗 */
+      this.otherSettingDialog = false;
+    },
     goBack() {
       /* 返回上级界面 */
       this.$router.push({ path: "/print/project/list" });
@@ -336,6 +417,17 @@ export default {
     } else {
       this.hasPermit = false;
     }
+
+    /* 加载默认数据 */
+    let orgId = this.$route.params.orgId;
+    let examId = this.$route.params.examId;
+    if (orgId != "0" || examId != "0") {
+      this.searchExamList(orgId);
+      this.showGoBack = true;
+      this.formSearch.orgId = parseInt(orgId);
+      this.formSearch.examId = parseInt(examId);
+      this.searchRecords();
+    }
   }
 };
 </script>