Selaa lähdekoodia

印花计划同步修改

zhangjie 3 vuotta sitten
vanhempi
commit
b3dab83fc8

+ 1 - 1
src/assets/styles/base.scss

@@ -442,7 +442,7 @@ body {
 .tips-info {
   font-size: 12px;
   line-height: 20px;
-  color: $--color-text-gray-3;
+  color: $--color-text-gray-2;
 }
 .tips-dark {
   color: $--color-text-gray;

+ 14 - 3
src/modules/base/api.js

@@ -172,11 +172,22 @@ export const updateStudent = datas => {
 export const printPlanPushListQuery = datas => {
   return $postParam("/api/admin/exam/print_sync/list_sync", datas);
 };
-export const printPlanBatchPush = datas => {
-  return $postParam("/api/admin/exam/print_sync/sync_data_cloud", datas);
+export const printPlanBatchPush = list => {
+  return $post("/api/admin/exam/print_sync/sync_data_cloud_batch", {
+    list
+  });
+};
+export const printPlanPush = ({ printPlanId, thirdRelateId }) => {
+  return $postParam("/api/admin/exam/print_sync/sync_data_cloud", {
+    printPlanId,
+    thirdRelateId
+  });
 };
 export const printPlanMergePush = datas => {
-  return $postParam("/api/admin/exam/print_sync/sync_data_merge", datas);
+  return $post("/api/admin/exam/print_sync/sync_data_merge", datas);
+};
+export const printPlanSyncExamList = () => {
+  return $post("/api/admin/exam/print_sync/list_relate_ids", {});
 };
 
 // common

+ 88 - 16
src/modules/base/components/MergePushDialog.vue

@@ -4,7 +4,7 @@
     :visible.sync="modalIsShow"
     title="批量合并印刷任务"
     top="10vh"
-    width="500px"
+    width="448px"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     append-to-body
@@ -18,26 +18,61 @@
         2、如果确定需要合并,请填写合并后考试名称及对应考试ID,然后点击确定按钮。
       </p>
     </div>
+    <div class="mb-4 tab-btns">
+      <el-button
+        v-for="(val, key) in EXAM_TYPE"
+        :key="key"
+        :type="examType == key ? 'primary' : 'default'"
+        @click="selectMenu(key)"
+        >{{ val }}</el-button
+      >
+    </div>
     <el-form
+      v-if="examType === '0'"
       ref="modalFormComp"
       :model="modalForm"
       :rules="rules"
       label-position="top"
     >
-      <el-form-item prop="thirdRelateName" label="考试名称:">
+      <el-form-item label="考试ID:">
         <el-input
-          v-model.trim="modalForm.thirdRelateName"
-          placeholder="请输入考试名称"
+          v-model.trim="modalForm.thirdRelateId"
+          placeholder="请输入考试ID"
           clearable
         ></el-input>
       </el-form-item>
-      <el-form-item prop="thirdRelateId" label="考试ID:">
+      <el-form-item label="考试名称:">
         <el-input
-          v-model.trim="modalForm.thirdRelateId"
-          placeholder="请输入考试ID"
+          v-model.trim="modalForm.thirdRelateName"
+          placeholder="请输入考试名称"
           clearable
         ></el-input>
       </el-form-item>
+      <el-form-item prop="thirdRelate"></el-form-item>
+    </el-form>
+    <el-form
+      v-else
+      ref="modalFormComp"
+      :model="modalForm"
+      :rules="rules1"
+      label-position="top"
+    >
+      <el-form-item prop="thirdRelateId" label="考试ID:">
+        <el-select
+          v-model="modalForm.thirdRelateId"
+          placeholder="请选择"
+          filterable
+          style="width:100%"
+        >
+          <el-option
+            v-for="item in exams"
+            :key="item.thirdRelateId"
+            :value="item.thirdRelateId"
+            :label="item.thirdRelateName"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
     </el-form>
     <div slot="footer">
       <el-button type="primary" :disabled="isSubmit" @click="submit"
@@ -49,7 +84,7 @@
 </template>
 
 <script>
-import { printPlanMergePush } from "../api";
+import { printPlanMergePush, printPlanSyncExamList } from "../api";
 
 const initModalForm = {
   thirdRelateId: "",
@@ -67,30 +102,59 @@ export default {
     }
   },
   data() {
+    const thirdRelateValidator = (rule, value, callback) => {
+      if (!this.modalForm.thirdRelateId && !this.modalForm.thirdRelateName) {
+        return callback(new Error(`考试ID和名称至少填一项。`));
+      }
+
+      if (
+        this.modalForm.thirdRelateId &&
+        this.modalForm.thirdRelateId.length > 50
+      ) {
+        return callback(new Error("考试ID长度不能超过50"));
+      }
+      if (
+        this.modalForm.thirdRelateName &&
+        this.modalForm.thirdRelateName.length > 50
+      ) {
+        return callback(new Error("考试名称长度不能超过50"));
+      }
+
+      return callback();
+    };
     return {
       modalIsShow: false,
       isSubmit: false,
+      exams: [],
       modalForm: { ...initModalForm },
       rules: {
-        thirdRelateName: [
+        thirdRelate: [
           {
-            required: false,
-            message: "考试名称不能超过50个字",
-            max: 50,
+            required: true,
+            validator: thirdRelateValidator,
             trigger: "change"
           }
-        ],
+        ]
+      },
+      rules1: {
         thirdRelateId: [
           {
-            required: false,
-            pattern: /^[0-9a-zA-Z_-]{3,30}$/,
-            message: "考试ID只能由数字字母短横线组成,长度在3-30之间",
+            required: true,
+            message: "请选择考试ID",
             trigger: "change"
           }
         ]
+      },
+      examType: "0",
+      EXAM_TYPE: {
+        0: "未同步考试",
+        1: "已同步考试"
       }
     };
   },
+  created() {
+    this.getExamList();
+  },
   methods: {
     initData(val) {
       this.modalForm = { ...initModalForm };
@@ -101,6 +165,14 @@ export default {
     visibleChange() {
       this.initData(this.instance);
     },
+    async getExamList() {
+      const data = await printPlanSyncExamList();
+      this.exams = data || [];
+    },
+    selectMenu(val) {
+      this.examType = val;
+      this.modalForm = { ...initModalForm };
+    },
     cancel() {
       this.modalIsShow = false;
     },

+ 28 - 11
src/modules/base/views/PrintPlanPushManage.vue

@@ -68,12 +68,25 @@
           }}</span>
         </el-table-column>
         <el-table-column prop="createName" label="创建人"></el-table-column>
-        <el-table-column
-          prop="thirdRelateName"
-          label="考试名称"
-        ></el-table-column>
-        <el-table-column prop="thirdRelateId" label="考试ID"></el-table-column>
-        <el-table-column prop="syncStatus" label="同步状态"></el-table-column>
+        <el-table-column prop="thirdRelateName" label="考试名称">
+          <span slot-scope="scope">{{
+            scope.row.thirdRelateName | defaultFieldFilter
+          }}</span>
+        </el-table-column>
+        <el-table-column prop="thirdRelateId" label="考试ID">
+          <span slot-scope="scope">{{
+            scope.row.thirdRelateId | defaultFieldFilter
+          }}</span>
+        </el-table-column>
+        <el-table-column prop="syncStatus" label="同步状态">
+          <span slot-scope="scope">{{
+            scope.row.syncStatus === null
+              ? "--"
+              : scope.row.syncStatus
+              ? "成功"
+              : "失败"
+          }}</span>
+        </el-table-column>
         <el-table-column class-name="action-column" label="操作" width="120px">
           <template slot-scope="scope">
             <el-button
@@ -83,9 +96,6 @@
               >查看</el-button
             >
             <el-button
-              v-if="
-                scope.row.createId === curUserId && scope.row.status === 'NEW'
-              "
               class="btn-primary"
               type="text"
               :disabled="loading"
@@ -124,7 +134,11 @@
 </template>
 
 <script>
-import { printPlanPushListQuery, printPlanBatchPush } from "../api";
+import {
+  printPlanPushListQuery,
+  printPlanBatchPush,
+  printPlanPush
+} from "../api";
 import MergePushDialog from "../components/MergePushDialog";
 import ModifyPrintPlan from "../../print/components/ModifyPrintPlan";
 
@@ -214,7 +228,10 @@ export default {
       if (result !== "confirm") return;
 
       this.loading = true;
-      const data = await printPlanBatchPush([row.id]).catch(() => {});
+      const data = await printPlanPush({
+        printPlanId: row.id,
+        thirdRelateId: row.thirdRelateId
+      }).catch(() => {});
       this.loading = true;
       if (!data) return;
 

+ 5 - 1
src/modules/customer/views/CustomerCard.vue

@@ -98,7 +98,11 @@
         :data="taskList"
         @selection-change="handleSelectionChange"
       >
-        <el-table-column type="selection" width="55"></el-table-column>
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+        ></el-table-column>
         <el-table-column
           type="index"
           label="序号"

+ 7 - 0
src/modules/exam/components/ApplyContent.vue

@@ -517,6 +517,13 @@ export default {
       this.paperAttachments.forEach((item, itemIndex) => {
         item.name = this.abc[itemIndex];
       });
+
+      if (
+        this.examTaskDetail.drawCount &&
+        this.examTaskDetail.drawCount > this.paperAttachments.length
+      ) {
+        this.examTaskDetail.drawCount = this.paperAttachments.length;
+      }
     },
     toUpload(attachment) {
       this.curUploadType = "paper";

+ 7 - 0
src/modules/exam/components/CreateTaskApply.vue

@@ -433,6 +433,7 @@ export default {
       this.examTaskDetail.includePaper = this.examRule.includePaper;
       this.examTaskDetail.review = this.examRule.review;
       this.examTaskDetail.customCard = this.examRule.customCard;
+      this.paperAttachments = [];
     },
     visibleChange() {
       this.initData();
@@ -474,6 +475,12 @@ export default {
       this.paperAttachments.forEach((item, itemIndex) => {
         item.name = this.abc[itemIndex];
       });
+      if (
+        this.examTaskDetail.drawCount &&
+        this.examTaskDetail.drawCount > this.paperAttachments.length
+      ) {
+        this.examTaskDetail.drawCount = this.paperAttachments.length;
+      }
     },
     toUpload(attachment) {
       this.curUploadType = "paper";

+ 5 - 1
src/modules/print/views/PrintTaskManage.vue

@@ -151,7 +151,11 @@
         :data="dataList"
         @selection-change="handleSelectionChange"
       >
-        <el-table-column type="selection" width="50"></el-table-column>
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+        ></el-table-column>
         <el-table-column
           type="index"
           label="序号"