caichengyu 9 달 전
부모
커밋
6793f35092

+ 8 - 0
src/newApi/studentList.js

@@ -96,6 +96,14 @@ export default {
             params: data
         })
     },
+    //资料审核修改身份证照片
+    baseprofileeditcard(data) {
+        return request({
+            url: '/base/profile/edit/card ',
+            method: 'post',
+            data
+        })
+    },
     
 
 }

+ 2 - 2
src/utils/request.js

@@ -8,9 +8,9 @@ import { paramMate } from "@/utils/common";
 
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 // 创建axios实例
-// export const baseURL = process.env.VUE_APP_BASE_API
+export const baseURL = process.env.VUE_APP_BASE_API
 // export const baseURL = 'https://cloud.xyyxt.net/'
-export const baseURL = 'http://192.168.1.123:5030'
+// export const baseURL = 'http://192.168.1.123:5030'
 export const BASE_IMG_URL = process.env.VUE_APP_IMG_API
 // export const BASE_IMG_URL = 'https://file.xyyxt.net'
 const service = axios.create({

+ 2 - 2
src/views/Marketing/order/orderList/index.vue

@@ -432,8 +432,8 @@ export default {
           arr.orderSnList=ids
       }
       this.$api.orderexportNew(arr).then((res) => {
-        console.log(res)
-        return
+        // console.log(res)
+        // return
         this.$methodsTools.exportData(res.msg)
       });
     },

+ 129 - 49
src/views/education/dataReview/dataConfig/index.vue

@@ -82,7 +82,7 @@
             <div v-if="pdStatus(item.fieldKey)">
               <div
                 v-if="item.fieldKey === 'recent_photos'"
-                style="width: 145px; height: 160px;"
+                style="width: 145px; height: 160px"
               >
                 <el-image
                   v-if="item.value"
@@ -114,51 +114,92 @@
                 </div>
                 <p v-else>暂无上传图片</p>
               </div>
-              <div v-else style="width: 224px; height: 160px;position:relative;">
+              <div
+                v-else
+                style="width: 224px; height: 160px; position: relative"
+              >
                 <el-image
                   v-if="item.value"
                   style="width: 100%; height: 100%"
-                  :src="$methodsTools.splitImgHost(item.value)"
-                  :preview-src-list="[$methodsTools.splitImgHost(item.value)]"
+                  :src="
+                    $methodsTools.splitImgHost(
+                      item.value + '?r=' + Math.random()
+                    )
+                  "
+                  :preview-src-list="[
+                    $methodsTools.splitImgHost(
+                      item.value + '?r=' + Math.random()
+                    ),
+                  ]"
                 >
                 </el-image>
                 <p v-else>暂无上传图片</p>
-                  <div v-if="item.value" style="height: 26px;
-    bottom: 0px;
-    width: 100%;
-    background-color: rgb(141 141 141 / 50%);
-    text-align: center;
-    font-size: 28px;
-    color: #0cdb31;
-    position: absolute;"><i class="el-icon-refresh-left" style="margin-right: 20px;" title="向左旋转90度"></i><i class="el-icon-refresh-right" title="向右旋转90度"></i></div>
-              <div style="position: absolute;right: -100px;bottom: 0px;">
-                <el-button  v-if="item.fieldKey === 'idcard_face_photo'"
-                  size="mini"
-                  type="success"
-                  onclick="document.querySelector('#file1').click()"
-                >更换照片</el-button>
-            <input v-if="item.fieldKey === 'idcard_face_photo'"
-                  id="file1"
-                  type="file"
-                  ref="file1"
-                  style="display: none"
-                  @change="uploadImg(index)"
-                />
-                <el-button  v-if="item.fieldKey === 'idcard_national_photo'"
-                  type="success"
-                  size="mini"
-                  onclick="document.querySelector('#file2').click()"
-                >更换照片</el-button>
-                <input v-if="item.fieldKey === 'idcard_national_photo'"
-                  id="file2"
-                  type="file"
-                  ref="file2"
-                  style="display: none"
-                  @change="uploadImg(index)"
-                />
-              </div>
+                <div
+                  v-if="
+                    item.value &&
+                    (item.fieldKey === 'idcard_face_photo' ||
+                      item.fieldKey === 'idcard_national_photo')
+                  "
+                  style="
+                    height: 26px;
+                    bottom: 0px;
+                    width: 100%;
+                    background-color: rgb(141 141 141 / 50%);
+                    text-align: center;
+                    font-size: 28px;
+                    color: #0cdb31;
+                    position: absolute;
+                  "
+                >
+                  <i
+                    class="el-icon-refresh-left"
+                    style="margin-right: 20px"
+                    @click="transange(-90, index)"
+                    title="向左旋转90度"
+                  ></i>
+                  <i
+                    class="el-icon-refresh-right"
+                    @click="transange(90, index)"
+                    title="向右旋转90度"
+                  ></i>
+                </div>
+                <div style="position: absolute; right: -100px; bottom: 0px">
+                  <el-button
+                    v-if="item.value && item.fieldKey === 'idcard_face_photo'"
+                    size="mini"
+                    type="success"
+                    onclick="document.querySelector('#file1').click()"
+                    >更换照片</el-button
+                  >
+                  <input
+                    v-if="item.value && item.fieldKey === 'idcard_face_photo'"
+                    id="file1"
+                    type="file"
+                    ref="file1"
+                    style="display: none"
+                    @change="uploadImg(index)"
+                  />
+                  <el-button
+                    v-if="
+                      item.value && item.fieldKey === 'idcard_national_photo'
+                    "
+                    type="success"
+                    size="mini"
+                    onclick="document.querySelector('#file2').click()"
+                    >更换照片</el-button
+                  >
+                  <input
+                    v-if="
+                      item.value && item.fieldKey === 'idcard_national_photo'
+                    "
+                    id="file2"
+                    type="file"
+                    ref="file2"
+                    style="display: none"
+                    @change="uploadImg(index)"
+                  />
+                </div>
               </div>
-              
             </div>
             <div v-else>{{ item.value }}</div>
           </li>
@@ -299,7 +340,6 @@
                           ]"
                         >
                         </el-image>
-                        
                       </div>
                       <p v-else>暂无上传图片</p>
                     </div>
@@ -615,12 +655,12 @@ export default {
   methods: {
     uploadImg(int) {
       var self = this;
-      var file = self.$refs.file1.files[0];
-      if (int === "idcard_face_photo") {
-        
+      if (self.listInfos[int].fieldKey === "idcard_face_photo") {
+        console.log("file1", this.$refs.file1);
+        var file = this.$refs.file1[0].files[0];
       }
-      if (int === 3) {
-        var file = self.$refs.file3.files[0];
+      if (self.listInfos[int].fieldKey === "idcard_national_photo") {
+        var file = self.$refs.file2[0].files[0];
       }
 
       if (file === undefined) {
@@ -630,8 +670,18 @@ export default {
         self.$message.error("图片不得大于2MB");
         return;
       }
-      var type = self.$refs.file1.value.toLowerCase().split(".").splice(-1);
-      
+      if (self.listInfos[int].fieldKey === "idcard_face_photo") {
+        var type = self.$refs.file1[0].value
+          .toLowerCase()
+          .split(".")
+          .splice(-1);
+      }
+      if (self.listInfos[int].fieldKey === "idcard_national_photo") {
+        var type = self.$refs.file2[0].value
+          .toLowerCase()
+          .split(".")
+          .splice(-1);
+      }
       if (
         type[0] != "jpg" &&
         type[0] != "png" &&
@@ -640,13 +690,43 @@ export default {
       ) {
         self.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
 
-        self.$refs.file1.value = "";
+        self.$refs.file1[0].value = "";
+        self.$refs.file2[0].value = "";
         return;
       }
       this.$upload.upload(file, 0).then((res) => {
-          self.listInfos[int].value = res;
+        self.listInfos[int].value = res;
+        var data = { id: self.listData.id, idCard1: "", idCard2: "" };
+        if (self.listInfos[int].fieldKey === "idcard_face_photo") {
+          data.idCard1 = res;
+        }
+        if (self.listInfos[int].fieldKey === "idcard_national_photo") {
+          data.idCard2 = res;
+        }
+        self.baseprofileeditcard(data);
       });
     },
+    baseprofileeditcard(data) {
+      this.$api.baseprofileeditcard(data).then((res) => {
+        this.$message.success("保存成功");
+        this.addClick(data, 0);
+      });
+    },
+    transange(ange, int) {
+      var data = {
+        id: this.listData.id,
+        idCard1: "",
+        idCard2: "",
+        degree: ange,
+      };
+      if (this.listInfos[int].fieldKey === "idcard_face_photo") {
+        data.idCard1 = this.listInfos[int].value;
+      }
+      if (this.listInfos[int].fieldKey === "idcard_national_photo") {
+        data.idCard2 = this.listInfos[int].value;
+      }
+      this.baseprofileeditcard(data);
+    },
     exputs(data) {
       // if (!data.businessId) {
       //   this.$message.warning("请选择业务层次");

+ 150 - 8
src/views/education/dataReview/dataConfigSeven/index.vue

@@ -122,15 +122,83 @@
                 </div>
                 <p v-else>暂无上传图片</p>
               </div>
-              <div v-else style="width: 224px; height: 160px">
+              <div
+                v-else
+                style="width: 224px; height: 160px; position: relative"
+              >
                 <el-image
                   v-if="item.value"
                   style="width: 100%; height: 100%"
-                  :src="$methodsTools.splitImgHost(item.value)"
-                  :preview-src-list="[$methodsTools.splitImgHost(item.value)]"
+                  :src="$methodsTools.splitImgHost(item.value + '?r=' + Math.random())"
+                  :preview-src-list="[$methodsTools.splitImgHost(item.value + '?r=' + Math.random())]"
                 >
                 </el-image>
                 <p v-else>暂无上传图片</p>
+                <div
+                  v-if="
+                    item.value &&
+                    (item.fieldKey === 'idcard_face_photo' ||
+                      item.fieldKey === 'idcard_national_photo')
+                  "
+                  style="
+                    height: 26px;
+                    bottom: 0px;
+                    width: 100%;
+                    background-color: rgb(141 141 141 / 50%);
+                    text-align: center;
+                    font-size: 28px;
+                    color: #0cdb31;
+                    position: absolute;
+                  "
+                >
+                  <i
+                    class="el-icon-refresh-left"
+                    style="margin-right: 20px"
+                    @click="transange(-90, index)"
+                    title="向左旋转90度"
+                  ></i>
+                  <i
+                    class="el-icon-refresh-right"
+                    @click="transange(90, index)"
+                    title="向右旋转90度"
+                  ></i>
+                </div>
+                <div style="position: absolute; right: -100px; bottom: 0px">
+                  <el-button
+                    v-if="item.value && item.fieldKey === 'idcard_face_photo'"
+                    size="mini"
+                    type="success"
+                    onclick="document.querySelector('#file1').click()"
+                    >更换照片</el-button
+                  >
+                  <input
+                    v-if="item.value && item.fieldKey === 'idcard_face_photo'"
+                    id="file1"
+                    type="file"
+                    ref="file1"
+                    style="display: none"
+                    @change="uploadImg(index)"
+                  />
+                  <el-button
+                    v-if="
+                      item.value && item.fieldKey === 'idcard_national_photo'
+                    "
+                    type="success"
+                    size="mini"
+                    onclick="document.querySelector('#file2').click()"
+                    >更换照片</el-button
+                  >
+                  <input
+                    v-if="
+                      item.value && item.fieldKey === 'idcard_national_photo'
+                    "
+                    id="file2"
+                    type="file"
+                    ref="file2"
+                    style="display: none"
+                    @change="uploadImg(index)"
+                  />
+                </div>
               </div>
             </div>
             <div v-else>{{ item.value }}</div>
@@ -553,14 +621,88 @@ export default {
     };
   },
   async mounted() {
-    await this.moRenBus()
+    await this.moRenBus();
     this.search();
   },
   async activated() {
-    await this.moRenBus()
+    await this.moRenBus();
     this.search();
   },
   methods: {
+    uploadImg(int) {
+      var self = this;
+      if (self.listInfos[int].fieldKey === "idcard_face_photo") {
+        console.log("file1", this.$refs.file1);
+        var file = this.$refs.file1[0].files[0];
+      }
+      if (self.listInfos[int].fieldKey === "idcard_national_photo") {
+        var file = self.$refs.file2[0].files[0];
+      }
+
+      if (file === undefined) {
+        return;
+      }
+      if (file.size > 2 * 1024 * 1024) {
+        self.$message.error("图片不得大于2MB");
+        return;
+      }
+      if (self.listInfos[int].fieldKey === "idcard_face_photo") {
+        var type = self.$refs.file1[0].value
+          .toLowerCase()
+          .split(".")
+          .splice(-1);
+      }
+      if (self.listInfos[int].fieldKey === "idcard_national_photo") {
+        var type = self.$refs.file2[0].value
+          .toLowerCase()
+          .split(".")
+          .splice(-1);
+      }
+      if (
+        type[0] != "jpg" &&
+        type[0] != "png" &&
+        type[0] != "jpeg" &&
+        type[0] != "gif"
+      ) {
+        self.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
+
+        self.$refs.file1[0].value = "";
+        self.$refs.file2[0].value = "";
+        return;
+      }
+      this.$upload.upload(file, 0).then((res) => {
+        self.listInfos[int].value = res;
+        var data = { id: self.listData.id, idCard1: "", idCard2: "" };
+        if (self.listInfos[int].fieldKey === "idcard_face_photo") {
+          data.idCard1 = res;
+        }
+        if (self.listInfos[int].fieldKey === "idcard_national_photo") {
+          data.idCard2 = res;
+        }
+        self.baseprofileeditcard(data);
+      });
+    },
+    baseprofileeditcard(data) {
+      this.$api.baseprofileeditcard(data).then((res) => {
+        this.$message.success("保存成功");
+        this.addClick(data, 0);
+      });
+    },
+    transange(ange, int) {
+      var data = {
+        id: this.listData.id,
+        idCard1: "",
+        idCard2: "",
+        degree: ange,
+      };
+      if (this.listInfos[int].fieldKey === "idcard_face_photo") {
+        data.idCard1 = this.listInfos[int].value;
+      }
+      if (this.listInfos[int].fieldKey === "idcard_national_photo") {
+        data.idCard2 = this.listInfos[int].value;
+      }
+      this.baseprofileeditcard(data);
+    },
     /**
      * 默认选择考前培训-施工七大员
      */
@@ -774,12 +916,12 @@ export default {
           status: "",
           pageSize: 10,
           pageNum: 1,
-          educationTypeId:this.formData.educationTypeId,
-          businessId:this.formData.businessId,
+          educationTypeId: this.formData.educationTypeId,
+          businessId: this.formData.businessId,
         };
       }
       var data = JSON.parse(JSON.stringify(this.formData));
-      console.log(this.formData,'data')
+      console.log(this.formData, "data");
       if (this.formData.applyStartTime) {
         data.applyStartTime = data.applyStartTime / 1000;
       }