Tang 2 éve
szülő
commit
1876eded6e

+ 9 - 0
src/newApi/examapply.js

@@ -125,6 +125,15 @@ export default {
             method: 'get',
         })
     },
+    //七大员题库商品导入开通
+    importorderquestionopen(data) {
+        return request({
+            url: '/order/question/open/import',
+            method: 'post',
+            data
+        })
+    },
+    
     //考前须知修改
     systemapplysaveorupbeforeknow(data) {
         return request({

+ 4 - 2
src/views/Marketing/goods/commodityManageMent/add/courseContent/playPhoto.vue

@@ -96,6 +96,7 @@
           <div>
             <el-radio-group
               v-model="photoVideoList.goodsPhotographExamConfig.photograph"
+              :disabled="disabledFunc()"
             >
               <el-radio :label="1">是</el-radio>
               <el-radio :label="0">否</el-radio>
@@ -143,7 +144,8 @@ export default {
   methods: {
     disabledFunc() {
       if (
-        this.listDataCopy.educationName === "考前培训" &&
+        (this.listDataCopy.educationName === "考前培训" ||
+          this.listDataCopy.educationName === "继续教育") &&
         this.listDataCopy.projectName === "施工现场专业人员" &&
         this.listDataCopy.businessName === "七大员"
       ) {
@@ -156,7 +158,7 @@ export default {
      * 初始进入
      */
     openBox(obj) {
-      this.listDataCopy = obj
+      this.listDataCopy = obj;
       if (obj.playConfig) {
         this.photoVideoList.playConfig = JSON.parse(
           JSON.stringify(obj.playConfig)

+ 10 - 2
src/views/Marketing/goods/commodityManageMent/add/productInformation.vue

@@ -139,7 +139,11 @@
             v-model="listData.goodsName"
           ></el-input>
         </el-form-item>
-        <el-form-item label="商品试卷限制终端学习" prop="examLimitClient" v-if="listData.goodsType == 9">
+        <el-form-item
+          label="商品试卷限制终端学习"
+          prop="examLimitClient"
+          v-if="listData.goodsType == 9"
+        >
           <el-select
             v-model="listData.examLimitClient"
             multiple
@@ -318,13 +322,15 @@ export default {
     setListDataBusinessName(val) {
       new Promise((resolve, reject) => {
         this.listData.photographConfig = {};
+        this.listData.goodsPhotographExamConfig = {};
         if (!val) {
           reject();
           return;
         }
         let data = this.newCourTypeOptions.find((i) => i.id == val);
         if (
-          data.educationName === "考前培训" &&
+          (data.educationName === "继续教育" ||
+            data.educationName === "考前培训") &&
           data.projectName === "施工现场专业人员" &&
           data.businessName === "七大员"
         ) {
@@ -340,6 +346,7 @@ export default {
           this.$set(this.listData.photographConfig, "photograph", 1);
           this.$set(this.listData.photographConfig, "photoNum", 3);
           this.$set(this.listData.photographConfig, "livephotograph", 0);
+          this.$set(this.listData.goodsPhotographExamConfig, "photograph", 1);
         })
         .catch((err) => {
           this.$set(this.listData, "educationName", "");
@@ -347,6 +354,7 @@ export default {
           this.$set(this.listData, "businessName", "");
           this.$set(this.listData.photographConfig, "photograph", 0);
           this.$set(this.listData.photographConfig, "photoNum", "");
+          this.$set(this.listData.goodsPhotographExamConfig, "photograph", 0);
         });
     },
     //校验外链格式

+ 20 - 1
src/views/education/examManagement/applicationData/asPlanned.vue

@@ -77,6 +77,7 @@
             >
           </div>
           <el-button
+            v-if="false"
             :size="size"
             slot="reference"
             type="success"
@@ -84,6 +85,9 @@
             >更多</el-button
           >
         </el-popover>
+        <el-button size="small" type="primary" @click="openBank"
+          >开通题库</el-button
+        >
         <el-button :size="size" type="warning" @click="moreActive(2)"
           >取消预约</el-button
         >
@@ -402,10 +406,21 @@
       </span>
     </el-dialog>
     <goodsList ref="goodsList" @backMsg="search(3)" />
+    <batch-import-dialoga
+      :dialogVisible.sync="dialogVisible"
+      temUrl="/oss/images/file/20230908/1694137357751.xls"
+      apiKey="importorderquestionopen"
+      :isCheck="false"
+      :isShowTip="false"
+      :isSuccessBack="true"
+      @success="search"
+      type="Excel"
+    ></batch-import-dialoga>
   </div>
 </template>
 
 <script>
+import batchImportDialoga from "./batchImportDialog.vue";
 import goodsList from "./goodsListOpen";
 import * as baseUrls from "@/utils/request.js";
 import searchBoxNew from "@/components/searchBoxNew";
@@ -413,9 +428,10 @@ import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 export default {
   name: "AsPlanned",
-  components: { searchBoxNew, tableList, pagination, goodsList },
+  components: { batchImportDialoga,searchBoxNew, tableList, pagination, goodsList },
   data() {
     return {
+      dialogVisible:true,
       month: "",
       monthList: [
         { label: "一月", value: "01" },
@@ -806,6 +822,9 @@ export default {
         });
       });
     },
+    openBank() {
+      this.dialogVisible = true
+    },
     async controlsType(type) {
       if (type == 1) {
         await this.moRenBus();

+ 202 - 0
src/views/education/examManagement/applicationData/batchImportDialog.vue

@@ -0,0 +1,202 @@
+<template>
+  <div>
+    <Base-dialog
+      title="导入"
+      width="660px"
+      :isShow.sync="isShow"
+      :isShowFooter="false"
+    >
+      <div>
+        <div class="swq">
+          <img
+            style="width: 182px; height: 168px"
+            src="@/assets/images/dr.png"
+            alt=""
+          />
+        </div>
+        <div style="padding-left: 100px">
+          <p>第一步:下载导入模板</p>
+          <p style="padding-left: 50px">
+            <i class="el-icon-upload"></i
+            ><span class="dowmStys" @click="getDowm">下载模板</span>
+          </p>
+          <p>第二步:(批量新增):点击“上传{{ type }}”完成导入</p>
+          <div
+            v-loading="loading"
+            element-loading-text="正在处理中"
+            style="margin: 0 0 20px 50px; width: 130px; height: 60px"
+          >
+            <label
+              v-show="!loading"
+              for="mobles"
+              class="el-button el-button--primary"
+              >上传 {{ type }}</label
+            ><input
+              style="display: none"
+              type="file"
+              id="mobles"
+              ref="input1"
+              @change="importMobleadd"
+            />
+          </div>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="isShow = false">取消</el-button>
+        </span>
+      </div>
+    </Base-dialog>
+    <Base-dialog
+      title="提示"
+      width="660px"
+      :isShow.sync="isShowErr"
+      :isShowFooter="false"
+    >
+      <div>
+        <div>
+          <h4 style="margin-top: 0px; font-weight: bold; text-align: center">
+            导入失败原因
+          </h4>
+          <el-input
+            readonly
+            type="textarea"
+            :autosize="{ minRows: 6, maxRows: 24 }"
+            v-model="errorData"
+          >
+          </el-input>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="isShowErr = false">确定</el-button>
+        </span>
+      </div>
+    </Base-dialog>
+  </div>
+</template>
+
+<script>
+import * as baseUrls from "@/utils/request.js";
+export default {
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+    temUrl: {
+      type: String,
+    },
+    apiKey: {
+      type: String,
+    },
+    type: {
+      type: String,
+      default: "Excel",
+    },
+  },
+  data() {
+    return {
+      loading: false,
+      errorData: [],
+      isShowErr: false,
+    };
+  },
+  methods: {
+    getDowm() {
+      let url =
+        baseUrls.BASE_IMG_URL +
+        this.temUrl +
+        `?time=${this.$methodsTools.getNewTime()}`;
+      let link = document.createElement("a");
+      let fileName = "导入模板" + ".xlsx";
+      document.body.appendChild(link);
+      link.href = url;
+      link.dowmload = fileName;
+      link.click();
+      link.remove();
+    },
+    importMobleadd(e) {
+      var file = e.target.files[0];
+      if (file === undefined) {
+        e.target.value = "";
+        return;
+      }
+      var type = e.target.value.toLowerCase().split(".").splice(-1);
+      if (this.type == "Excel") {
+        if (type[0] != "xlsx" && type[0] != "xls") {
+          e.target.value = "";
+          this.$message.error("请上传excel文件,且上传格式需为:.xlsx、.xls");
+          return;
+        }
+      } else {
+        if (type[0] != "docx") {
+          e.target.value = "";
+          this.$message.error("请上传word文件,且上传格式需为:.docx");
+          return;
+        }
+      }
+      this.loading = true;
+      let formData = new FormData();
+      formData.append("file", file);
+      this.$api[this.apiKey](formData)
+        .then((res) => {
+          this.getErrorData(res.data);
+        })
+        .finally(() => {
+          e.target.value = "";
+          this.loading = false;
+        });
+    },
+    getErrorData(data) {
+      this.isShow = false;
+      this.$emit("success");
+      let { errorMsgList } = data;
+      if (errorMsgList) {
+        this.$message({
+          type: "error",
+          message: `导入出现错误`,
+          customClass: "myMessageClass",
+        });
+        this.errorData = errorMsgList.join("\r\n");
+        this.isShowErr = true;
+      } else {
+        this.$message({
+          type: "success",
+          message: `添加成功`,
+          customClass: "myMessageClass",
+        });
+      }
+    },
+  },
+  computed: {
+    isShow: {
+      get() {
+        return this.dialogVisible;
+      },
+      set(val) {
+        this.$emit("update:dialogVisible", false);
+      },
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.swq {
+  text-align: center;
+  border-bottom: 1px solid #eee;
+}
+.dowmStys {
+  color: blue;
+  cursor: pointer;
+}
+/deep/.el-dialog {
+  .el-dialog__body {
+    padding: 30px 20px 0;
+  }
+  .dialog-footer {
+    height: 80px;
+    border-top: 1px solid #e2e2e2;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+  }
+}
+</style>