瀏覽代碼

推送相关

zhangjie 2 年之前
父節點
當前提交
3e991c218f

+ 7 - 0
src/assets/styles/element-ui-costom.scss

@@ -465,6 +465,13 @@
       }
       }
     }
     }
   }
   }
+  &__sizes {
+    .el-input__inner {
+      height: 32px;
+      line-height: 32px;
+      border: 1px solid #e1e3eb;
+    }
+  }
 }
 }
 // el-message-box
 // el-message-box
 .el-message-box {
 .el-message-box {

+ 38 - 0
src/assets/styles/pages.scss

@@ -1244,3 +1244,41 @@
     }
     }
   }
   }
 }
 }
+// print-plan-batch-push-dialog
+.print-plan-batch-push-dialog {
+  .el-dialog {
+    margin-bottom: 0;
+    height: 100%;
+    overflow: hidden;
+  }
+  .el-dialog__header {
+    position: absolute;
+    width: 100%;
+    top: 0;
+    z-index: 9;
+  }
+  .el-dialog__body {
+    height: 100%;
+    padding-top: 70px !important;
+    display: flex;
+    justify-content: space-between;
+    flex-direction: column;
+
+    .part-box-filter {
+      flex-grow: 0;
+      flex-shrink: 0;
+
+      &:last-child {
+        margin-bottom: 0;
+      }
+    }
+    .part-box-pad {
+      flex-grow: 2;
+      overflow-x: hidden;
+      overflow-y: auto;
+    }
+  }
+  .el-dialog__footer {
+    display: none;
+  }
+}

+ 4 - 1
src/modules/base/api.js

@@ -360,7 +360,10 @@ export const printPlanMergePush = datas => {
 export const printPlanSyncExamList = () => {
 export const printPlanSyncExamList = () => {
   return $post("/api/admin/exam/print_sync/list_relate_ids", {});
   return $post("/api/admin/exam/print_sync/list_relate_ids", {});
 };
 };
-
+// new
+export const printPlanCourseRelateList = datas => {
+  return $post("/api/admin/exam/print_sync/list_relate_ids", datas);
+};
 // sms-manage
 // sms-manage
 export const smsListQuery = datas => {
 export const smsListQuery = datas => {
   return $postParam("/api/admin/basic/message/list", datas);
   return $postParam("/api/admin/basic/message/list", datas);

+ 296 - 0
src/modules/base/components/PrintPlanBatchPushDialog.vue

@@ -0,0 +1,296 @@
+<template>
+  <el-dialog
+    class="print-plan-batch-push-dialog page-dialog"
+    :visible.sync="modalIsShow"
+    title="批量推送"
+    top="0"
+    width="1000px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @open="visibleChange"
+  >
+    <div class="part-box part-box-filter part-box-flex">
+      <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
+        <el-form-item label="开课学院:">
+          <el-select
+            v-model.trim="filter.collegeId"
+            placeholder="开课学院"
+            clearable
+            filterable
+          >
+            <el-option
+              v-for="item in colleges"
+              :key="item.id"
+              :value="item.id"
+              :label="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="题卡:">
+          <el-select
+            v-model.trim="filter.cartType"
+            placeholder="开课学院"
+            clearable
+            filterable
+          >
+            <el-option
+              v-for="item in cartTypes"
+              :key="item.code"
+              :value="item.code"
+              :label="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="课程名称:">
+          <el-input
+            v-model="filter.courseName"
+            placeholder="课程名称"
+            clearable
+          ></el-input>
+        </el-form-item>
+
+        <el-form-item label-width="0px">
+          <el-button type="primary" @click="search">查询</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div class="part-box part-box-pad">
+      <el-table
+        ref="TableList"
+        :data="dataList"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="name"
+          label="课程名称(代码)"
+          min-width="140"
+        ></el-table-column>
+        <el-table-column
+          prop="createName"
+          label="序号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          prop="createName"
+          label="试卷编号"
+          min-width="100"
+        ></el-table-column>
+        <el-table-column
+          prop="createName"
+          label="卷型"
+          width="100"
+        ></el-table-column>
+        <el-table-column
+          prop="createName"
+          label="题卡类型"
+          width="120"
+        ></el-table-column>
+        <el-table-column
+          prop="createName"
+          label="科次"
+          width="100"
+        ></el-table-column>
+      </el-table>
+    </div>
+
+    <div class="part-box part-box-filter part-box-flex">
+      <el-form ref="modalFormComp" :model="modalForm" :rules="rules" inline>
+        <el-form-item label="选择考试:">
+          <el-select
+            v-model="examType"
+            placeholder="请选择"
+            filterable
+            style="width:100%"
+            @change="examTypeChange"
+          >
+            <el-option
+              v-for="item in examTypes"
+              :key="item.code"
+              :value="item.code"
+              :label="item.name"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="thirdRelateId" v-if="examType === 'list'">
+          <el-select
+            v-model="modalForm.thirdRelateId"
+            placeholder="请选择"
+            filterable
+          >
+            <el-option
+              v-for="(item, index) in thirdRelateExams"
+              :key="index"
+              :value="item.thirdRelateId"
+              :label="item.thirdRelateName"
+            >
+            </el-option>
+          </el-select>
+          <el-button type="primary" @click="toRefresh">刷新</el-button>
+        </el-form-item>
+        <el-form-item prop="thirdRelateName" v-if="examType === 'create'">
+          <el-input
+            v-model="modalForm.thirdRelateName"
+            placeholder="请输入云阅卷考试名称"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="examTime" v-if="examType === 'create'">
+          <el-date-picker
+            v-model="modalForm.examTime"
+            type="datetime"
+            value-format="timestamp"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" :loading="loading" @click="confirm"
+            >开始推送</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </div>
+    <div slot="footer"></div>
+  </el-dialog>
+</template>
+
+<script>
+import { printPlanMergePush, printPlanCourseRelateList } from "../api";
+
+const initModalForm = {
+  thirdRelateId: "",
+  thirdRelateName: "",
+  courseIds: [],
+  examTime: null
+};
+
+export default {
+  name: "print-plan-batch-push-dialog",
+  props: {
+    ids: {
+      type: Array,
+      default() {
+        return [];
+      }
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      filter: {
+        collegeId: "",
+        cartType: "",
+        courseName: ""
+      },
+      dataList: [],
+      colleges: [],
+      modalForm: { ...initModalForm },
+      examTypes: [
+        { code: "create", name: "云阅卷创建新的考试" },
+        { code: "list", name: "选择云阅卷存在考试" }
+      ],
+      examType: "list",
+      cartTypes: [
+        { code: null, name: "全部题卡" },
+        { code: "GENERIC", name: "通用题卡" },
+        { code: "CUSTOM", name: "电子题卡" }
+      ],
+      thirdRelateExams: [],
+      rules: {
+        thirdRelateId: [
+          {
+            required: true,
+            message: "请选择云阅卷考试",
+            trigger: "change"
+          }
+        ],
+        thirdRelateName: [
+          {
+            required: true,
+            message: "请输入云阅卷考试名称",
+            trigger: "change"
+          },
+          {
+            max: 200,
+            message: "云阅卷考试名称不得超过200字符",
+            trigger: "change"
+          }
+        ],
+        examTime: [
+          {
+            required: true,
+            message: "请选择考试时间",
+            trigger: "change"
+          }
+        ]
+      },
+      loading: false
+    };
+  },
+  methods: {
+    initData() {
+      this.filter = {
+        collegeId: "",
+        cartType: "",
+        courseName: ""
+      };
+      this.modalForm = { ...initModalForm };
+      this.modalForm.courseIds = [];
+      this.$nextTick(() => {
+        this.$refs.modalFormComp.clearValidate();
+      });
+    },
+    visibleChange() {
+      this.initData(this.instance);
+      // this.search();
+    },
+    async search() {
+      const data = await printPlanCourseRelateList({
+        planIds: this.ids,
+        ...this.filter
+      });
+      this.dataList = data || [];
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    handleSelectionChange(val) {
+      this.modalForm.courseIds = val.map(item => item.id);
+    },
+    examTypeChange() {
+      this.$nextTick(() => {
+        this.$refs.modalFormComp.clearValidate();
+      });
+    },
+    async toRefresh() {},
+    async confirm() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.loading) return;
+      this.loading = true;
+      const data = await printPlanMergePush({
+        ...this.modalForm,
+        planIds: this.ids
+      }).catch(() => {});
+      this.loading = false;
+
+      if (!data) return;
+
+      this.$message.success("提交成功!");
+      this.$emit("modified");
+      this.cancel();
+    }
+  }
+};
+</script>

+ 44 - 119
src/modules/base/views/PrintPlanPushManage.vue

@@ -35,16 +35,11 @@
         </el-form-item>
         </el-form-item>
       </el-form>
       </el-form>
       <div class="part-box-action">
       <div class="part-box-action">
-        <el-button
-          icon="el-icon-circle-plus-outline"
-          type="primary"
-          :disabled="loading"
-          @click="toBatchPush"
-        >
+        <el-button icon="el-icon-top-right" type="primary" @click="toBatchPush">
           批量推送
           批量推送
         </el-button>
         </el-button>
-        <el-button icon="el-icon-circle-plus-outline" @click="toMergePush">
-          合并推送印刷计划
+        <el-button type="primary" icon="el-icon-s-order" @click="toResult">
+          推送结果
         </el-button>
         </el-button>
       </div>
       </div>
     </div>
     </div>
@@ -66,52 +61,22 @@
           label="印刷计划"
           label="印刷计划"
           min-width="180"
           min-width="180"
         ></el-table-column>
         ></el-table-column>
-        <el-table-column prop="examStartTime" label="考试开始时间" width="170">
-          <span slot-scope="scope">{{
-            scope.row.examStartTime | timestampFilter
-          }}</span>
-        </el-table-column>
-        <el-table-column prop="examEndTime" label="考试结束时间" width="170">
-          <span slot-scope="scope">{{
-            scope.row.examEndTime | timestampFilter
-          }}</span>
-        </el-table-column>
-        <el-table-column prop="status" label="计划状态" width="100">
-          <span slot-scope="scope">
-            {{ scope.row.status | printPlanStatusFilter }}
-          </span>
-        </el-table-column>
-        <el-table-column prop="totalGates" label="总门次" width="70">
-        </el-table-column>
-        <el-table-column prop="totalSubjects" label="总科次" width="70">
-        </el-table-column>
-        <el-table-column prop="totalPackages" label="总卷袋数" width="80">
-        </el-table-column>
-        <el-table-column prop="createTime" label="创建时间" width="170">
-          <span slot-scope="scope">{{
-            scope.row.createTime | timestampFilter
-          }}</span>
-        </el-table-column>
         <el-table-column
         <el-table-column
           prop="createName"
           prop="createName"
-          label="创建人"
-          min-width="80"
+          label="推送人"
+          min-width="100"
         ></el-table-column>
         ></el-table-column>
-        <el-table-column
-          prop="thirdRelateName"
-          label="考试名称"
-          min-width="180"
-        >
+        <el-table-column prop="createTime" label="推送时间" width="170">
           <span slot-scope="scope">{{
           <span slot-scope="scope">{{
-            scope.row.thirdRelateName | defaultFieldFilter
+            scope.row.createTime | timestampFilter
           }}</span>
           }}</span>
         </el-table-column>
         </el-table-column>
-        <el-table-column prop="thirdRelateId" label="考试ID" min-width="80">
+        <el-table-column prop="thirdRelateId" label="考试ID" min-width="120">
           <span slot-scope="scope">{{
           <span slot-scope="scope">{{
             scope.row.thirdRelateId | defaultFieldFilter
             scope.row.thirdRelateId | defaultFieldFilter
           }}</span>
           }}</span>
         </el-table-column>
         </el-table-column>
-        <el-table-column prop="syncStatus" label="同步状态" width="100">
+        <el-table-column prop="syncStatus" label="同步结果" width="120">
           <span slot-scope="scope">{{
           <span slot-scope="scope">{{
             scope.row.syncStatus | syncPrintStatusFilter
             scope.row.syncStatus | syncPrintStatusFilter
           }}</span>
           }}</span>
@@ -123,17 +88,10 @@
           fixed="right"
           fixed="right"
         >
         >
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-button
-              class="btn-primary"
-              type="text"
-              @click="toPreview(scope.row)"
-              >查看</el-button
-            >
             <el-button
             <el-button
               v-if="scope.row.canPush"
               v-if="scope.row.canPush"
               class="btn-primary"
               class="btn-primary"
               type="text"
               type="text"
-              :disabled="loading"
               @click="toPush(scope.row)"
               @click="toPush(scope.row)"
               >推送</el-button
               >推送</el-button
             >
             >
@@ -143,44 +101,41 @@
       <div class="part-page">
       <div class="part-page">
         <el-pagination
         <el-pagination
           background
           background
-          layout="total,prev, pager, next"
+          layout="total,prev, pager, next,sizes"
           :current-page="current"
           :current-page="current"
           :total="total"
           :total="total"
           :page-size="size"
           :page-size="size"
           @current-change="toPage"
           @current-change="toPage"
+          @size-change="sizeChange"
         >
         >
         </el-pagination>
         </el-pagination>
       </div>
       </div>
     </div>
     </div>
+    <div class="tips-info">
+      <p>说明:</p>
+      <p>1、印刷计划下的印刷任务,印刷完成后才允许推送;</p>
+      <p>
+        2、同步状态说明:5/0,前面表示计划下未推送的命题任务数量,后面表示已推送的命题任务数量;
+      </p>
+    </div>
 
 
-    <!-- MergePushDialog -->
-    <merge-push-dialog
-      ref="MergePushDialog"
-      :ids="multipleSelection"
+    <!-- PrintPlanBatchPushDialog -->
+    <print-plan-batch-push-dialog
+      ref="PrintPlanBatchPushDialog"
+      :ids="curSelectedPlanIds"
       @modified="mergePushed"
       @modified="mergePushed"
-    ></merge-push-dialog>
-    <!-- ModifyPrintPlan -->
-    <modify-print-plan
-      ref="ModifyPrintPlan"
-      :instance="curPrintPlan"
-      edit-type="PREVIEW"
-    ></modify-print-plan>
+    ></print-plan-batch-push-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import {
-  printPlanPushListQuery,
-  printPlanBatchPush,
-  printPlanPush
-} from "../api";
+import { printPlanPushListQuery } from "../api";
 import { examSemesterList } from "../../base/api";
 import { examSemesterList } from "../../base/api";
-import MergePushDialog from "../components/MergePushDialog";
-import ModifyPrintPlan from "../../print/components/ModifyPrintPlan";
+import PrintPlanBatchPushDialog from "../components/PrintPlanBatchPushDialog.vue";
 
 
 export default {
 export default {
   name: "print-plan-push-manage",
   name: "print-plan-push-manage",
-  components: { MergePushDialog, ModifyPrintPlan },
+  components: { PrintPlanBatchPushDialog },
   data() {
   data() {
     return {
     return {
       filter: {
       filter: {
@@ -195,7 +150,8 @@ export default {
       semesters: [],
       semesters: [],
       dataList: [],
       dataList: [],
       curPrintPlan: {},
       curPrintPlan: {},
-      multipleSelection: []
+      multipleSelection: [],
+      curSelectedPlanIds: []
     };
     };
   },
   },
   mounted() {
   mounted() {
@@ -224,6 +180,10 @@ export default {
     search() {
     search() {
       this.toPage(1);
       this.toPage(1);
     },
     },
+    sizeChange(size) {
+      this.size = size;
+      this.toPage(1);
+    },
     async getSemesters() {
     async getSemesters() {
       const res = await examSemesterList({});
       const res = await examSemesterList({});
       this.semesters = res || [];
       this.semesters = res || [];
@@ -236,58 +196,23 @@ export default {
     handleSelectionChange(val) {
     handleSelectionChange(val) {
       this.multipleSelection = val.map(item => item.id);
       this.multipleSelection = val.map(item => item.id);
     },
     },
-    async toBatchPush() {
-      if (this.loading) return;
-      if (!this.multipleSelection.length) {
-        this.$message.error("请选择要批量推送的数据");
-        return;
-      }
-      const result = await this.$confirm("确定要推送选中的计划吗?", "提示", {
-        type: "warning"
-      }).catch(() => {});
-      if (result !== "confirm") return;
-
-      this.loading = true;
-      const data = await printPlanBatchPush(
-        this.multipleSelection
-      ).catch(() => {});
-      this.loading = false;
-      if (!data) return;
-
-      this.$message.success("提交成功!");
-      this.toPage(this.current);
+    toBatchPush() {
+      // if (!this.multipleSelection.length) {
+      //   this.$message.error("请选择要批量推送的印刷计划");
+      //   return;
+      // }
+      this.curSelectedPlanIds = [...this.multipleSelection];
+      this.$refs.PrintPlanBatchPushDialog.open();
     },
     },
-    toMergePush() {
-      if (!this.multipleSelection.length) {
-        this.$message.error("请选择要合并推送的数据");
-        return;
-      }
-      this.$refs.MergePushDialog.open();
+    toPush(row) {
+      this.curSelectedPlanIds = [row.id];
+      this.$refs.PrintPlanBatchPushDialog.open();
     },
     },
     mergePushed() {
     mergePushed() {
       this.toPage(this.current);
       this.toPage(this.current);
     },
     },
-    toPreview(row) {
-      this.curPrintPlan = row;
-      this.$refs.ModifyPrintPlan.open();
-    },
-    async toPush(row) {
-      if (this.loading) return;
-      const result = await this.$confirm("确定要推送当前计划吗?", "提示", {
-        type: "warning"
-      }).catch(() => {});
-      if (result !== "confirm") return;
-
-      this.loading = true;
-      const data = await printPlanPush({
-        printPlanId: row.id,
-        thirdRelateId: row.thirdRelateId
-      }).catch(() => {});
-      this.loading = false;
-      if (!data) return;
-
-      this.$message.success("提交成功!");
-      this.toPage(this.current);
+    toResult() {
+      // todo:
     }
     }
   }
   }
 };
 };