xuqiang 4 жил өмнө
parent
commit
bb52fcbf26

+ 20 - 20
src/main/h5/src/mixins/experts.js

@@ -4,54 +4,54 @@ export default {
       categories: [
         {
           label: "是否履行考前备案手续(此项为否,不再检查下面内容)",
-          value: "examOrganization",
-          score: "是"
+          type: "examOrganization",
+          img: []
         },
         {
           label: "是否在考场明显位置张贴《考级简章》",
-          value: "examSite",
-          score: "是"
+          type: "examSite",
+          img: []
         },
         {
           label: "考场服务设施是否完善(候考室、指示标记、安全设施等)",
-          value: "examRoom",
-          score: "是"
+          type: "examRoom",
+          img: []
         },
         {
           label: "考级时间与网上平台考前备案的考级时间是否一致",
-          value: "environment",
-          score: "是"
+          type: "environment",
+          img: []
         },
         {
           label: "考场内有无相关专业考官且佩戴考官证",
-          value: "safety",
-          score: "是"
+          type: "safetyq",
+          img: []
         },
         {
           label: "是否现场对考生艺术水平作出评定(美术专业除外)",
-          value: "safety",
-          score: "是"
+          type: "safetyw",
+          img: []
         },
         {
           label: "考级内容是否是所属考级机构教材确定的考级内容",
-          value: "safety",
-          score: "是"
+          type: "safetye",
+          img: []
         },
         {
           label:
             "是否在考场明显位置张贴《恢复开展社会艺术水平考级现场考级活动疫情防控措施指南》海报",
-          value: "safety",
-          score: "是"
+          type: "safetyr",
+          img: []
         },
         {
           label: "考点是否配备测量体温设施设备,并有专人值守",
-          value: "safety",
-          score: "是"
+          type: "safetyt",
+          img: []
         },
         {
           label: "考级现场是否实施预约限流措施",
-          value: "safety",
-          score: "是"
+          type: "safetys",
+          img: []
         }
       ]
     };

+ 80 - 73
src/main/h5/src/views/record/recordAdd.vue

@@ -5,23 +5,28 @@
       <!-- <div class="text2">选择分值对各项目进行打分</div> -->
     </div>
     <div class="score-list">
-      <div class="score-item" :key="index" v-for="(item, index) in categories">
+      <div class="score-item" :key="index" v-for="(item, index) in List">
         <div class="text1">{{ index + 1 }}.{{ item.label }}</div>
-        <div class="text1">{{ item.score }}</div>
         <template>
-          <van-uploader
-            :after-read="afterRead"
-            :before-read="beforeRead"
-            :before-delete="beforeDeletes"
-            v-model="submitList[item.value]"
-            class="miniImg"
-          >
-            <div class="upload-mini">
-              <img src="../../assets/icon_add.svg" alt="" />
-              <div class="text">添加佐证</div>
-            </div>
-          </van-uploader>
+          <el-radio v-model="item.value" :label="true">是</el-radio>
+          <el-radio v-model="item.value" :label="false">否</el-radio>
         </template>
+        <div>
+          <template>
+            <van-uploader
+              :after-read="afterReads"
+              :before-read="beforeRead"
+              :before-delete="beforeDeletes"
+              v-model="item.img"
+              class="miniImg"
+            >
+              <div class="upload-mini">
+                <img src="../../assets/icon_add.svg" alt="" />
+                <div class="text">添加佐证</div>
+              </div>
+            </van-uploader>
+          </template>
+        </div>
       </div>
     </div>
     <div class="score-card">
@@ -107,70 +112,34 @@ export default {
         imgs: []
       },
       img: [],
-      submitList: {}
+      submitList: {},
+      List: []
     };
   },
   computed: {
     canSubmit() {
       return !!this.form.content;
+    },
+    dataCon() {
+      return this.List.map(item => {
+        return {
+          recordId: this.$route.query.recordId,
+          type: item.type,
+          value: item.value,
+          img: this.img
+        };
+      });
     }
   },
-  mounted() {
-    let subList = {};
-    [...this.categories].forEach(i => {
-      subList[i.value] = {
-        rateId: this.$route.query.recordId,
-        type: i.value,
-        score: "是",
-        img: [],
-        imgs: []
-      };
+  created() {
+    this.categories.forEach(item => {
+      item.value = Boolean;
+      this.List.push(item);
     });
+    console.log(this.List);
   },
+  mounted() {},
   methods: {
-    // afterRead(file, detail) {
-    //   this.$toast.loading({
-    //     message: "加载中...",
-    //     forbidClick: true
-    //   });
-    //   this.$http
-    //     .post("/upload/base64", {
-    //       base64: file.content
-    //     })
-    //     .then(res => {
-    //       this.$toast.clear();
-    //       let imgs =
-    //         detail.name === "big"
-    //           ? [...this.form.img]
-    //           : [...this.submitList[detail.name].img];
-    //       imgs.push(res);
-    //       console.log(detail);
-    //       if (detail.name === "big") {
-    //         this.form.img = imgs;
-    //       } else {
-    //         this.submitList[detail.name].img = imgs;
-    //       }
-    //     });
-    // },
-    beforeDeletes(file, detail) {
-      let submitForm = {};
-      if (detail.name === "big") {
-        submitForm = { ...this.form };
-      } else {
-        submitForm = this.submitList[detail.name];
-      }
-      var imgs1 = [...submitForm.imgs];
-      imgs1.splice(detail.index, 1);
-      var imgs2 = [...submitForm.img];
-      imgs2.splice(detail.index, 1);
-      if (detail.name === "big") {
-        this.form.imgs = imgs1;
-        this.form.img = imgs2;
-      } else {
-        this.submitList[detail.name].imgs = imgs1;
-        this.submitList[detail.name].img = imgs2;
-      }
-    },
     afterRead(file, detail) {
       this.$toast.loading({
         message: "加载中...",
@@ -187,6 +156,22 @@ export default {
           this.form.file = imgs;
         });
     },
+    afterReads(file, detail) {
+      this.$toast.loading({
+        message: "加载中...",
+        forbidClick: true
+      });
+      this.$http
+        .post("/upload/base64", {
+          base64: file.content
+        })
+        .then(res => {
+          this.img.push(res);
+        });
+    },
+    beforeDeletes(file, detail) {
+      this.img.splice(detail.index, 1);
+    },
     beforeDelete(file, detail) {
       let submitForm = { ...this.form };
       var imgs1 = [...submitForm.file];
@@ -208,17 +193,39 @@ export default {
         });
       });
     },
+    save() {
+      // let form = { ...this.form };
+      // this.$toast.loading({
+      //   message: "加载中...",
+      //   forbidClick: true
+      // });
+      // delete form.imgs;
+      // form.userId = this.$store.state.userInfo.id;
+      // form.recordId = this.$route.query.recordId;
+      // this.$http
+      //   .post("/recordCheck/save", form, { body: "json" })
+      //   .then(() => {
+      //     this.saving = false;
+      //     this.$toast.success("成功");
+      //     // setTimeout(() => {
+      //     //   this.$router.go(-1);
+      //     // }, 1500);
+      //   })
+      //   .catch(e => {
+      //     console.log(e);
+      //     this.saving = false;
+      //     this.$message.error(e.error);
+      //   });
+    },
     submit() {
-      let form = { ...this.form };
+      // this.save();
       this.$toast.loading({
         message: "加载中...",
         forbidClick: true
       });
-      delete form.imgs;
-      form.userId = this.$store.state.userInfo.id;
-      form.recordId = this.$route.query.recordId;
+      console.log(this.dataCon);
       this.$http
-        .post("/recordCheck/save", form, { body: "json" })
+        .post("/recordExpertAudit/batchSave", this.dataCon, { body: "json" })
         .then(() => {
           this.saving = false;
           this.$toast.success("成功");