浏览代码

卷袋贴修改

zhangjie 2 年之前
父节点
当前提交
279c3b85ad

+ 1 - 1
src/modules/admin/api.js

@@ -52,7 +52,7 @@ export const schoolList = () => {
   return $postParam("/api/admin/common/school/list", {});
 };
 export const schoolSync = () => {
-  return $postParam("/api/admin/common/school/sync", {});
+  return $postParam("/api/admin/auth/sync/org", {});
 };
 export const updateSchool = datas => {
   let formData = new FormData();

+ 15 - 5
src/modules/base/components/ModifyPrintTemplate.vue

@@ -70,7 +70,14 @@
         prop="fields"
       >
         <el-checkbox
-          v-for="field in packageDatas"
+          v-for="field in packageDatas.title"
+          :key="field.code"
+          v-model="field.enable"
+          >{{ field.name }}</el-checkbox
+        >
+        <el-divider></el-divider>
+        <el-checkbox
+          v-for="field in packageDatas.basic"
           :key="field.code"
           v-model="field.enable"
           >{{ field.name }}</el-checkbox
@@ -137,7 +144,7 @@ export default {
   data() {
     const fieldsValidator = (rule, value, callback) => {
       if (this.modalForm.classify === "PACKAGE") {
-        if (!this.packageDatas.some(item => item.enable)) {
+        if (!this.packageDatas.basic.some(item => item.enable)) {
           return callback(new Error("请选择显示字段"));
         }
         return callback();
@@ -195,7 +202,7 @@ export default {
           }
         ]
       },
-      packageDatas: [],
+      packageDatas: { title: [], basic: [] },
       signDatas: { basic: [], table: [] },
       // upload
       uploadUrl: "/api/admin/common/file/upload",
@@ -212,7 +219,7 @@ export default {
       const examRule = await examRuleDetail();
       this.PACKAGE_DATA = examRule.packageScope
         ? JSON.parse(examRule.packageScope)
-        : [];
+        : { title: [], basic: [] };
       this.SIGN_DATA = examRule.signScope
         ? JSON.parse(examRule.signScope)
         : { basic: [], table: [] };
@@ -234,7 +241,10 @@ export default {
       }
     },
     getDefaultFieldData() {
-      this.packageDatas = this.PACKAGE_DATA.map(item => {
+      this.packageDatas.title = this.PACKAGE_DATA.title.map(item => {
+        return { ...item, enable: false };
+      });
+      this.packageDatas.basic = this.PACKAGE_DATA.basic.map(item => {
         return { ...item, enable: false };
       });
       this.signDatas.basic = this.SIGN_DATA.basic.map(item => {

+ 14 - 3
src/modules/base/components/RulePackage.vue

@@ -81,9 +81,10 @@ export default {
           };
         });
 
-      this.modalForm.packageScope = examRule.packageScope
+      const packageScope = examRule.packageScope
         ? JSON.parse(examRule.packageScope)
-        : [];
+        : { basic: [] };
+      this.modalForm.packageScope = packageScope.basic;
     },
     validateField(field) {
       this.$refs.modalFormComp.validateField(field, () => {});
@@ -94,7 +95,17 @@ export default {
 
       if (this.isSubmit) return;
       this.isSubmit = true;
-      this.examRule.packageScope = JSON.stringify(this.modalForm.packageScope);
+      this.examRule.packageScope = JSON.stringify({
+        title: [
+          {
+            code: "semesterName",
+            name: "学期",
+            disabled: false,
+            enable: false
+          }
+        ],
+        basic: this.modalForm.packageScope
+      });
       const data = await saveExamRule(this.examRule).catch(() => {});
       this.isSubmit = false;
       if (!data) return;