From a9b7dfa18432bdaca6ac66cedbbeef9b02c2d077 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 18 五月 2023 14:05:53 +0800
Subject: [PATCH] 1.质检方案修改优化

---
 src/components/ImportPicker/index.vue |  156 ++++++++++++++++++++++++++++-----------------------
 1 files changed, 86 insertions(+), 70 deletions(-)

diff --git a/src/components/ImportPicker/index.vue b/src/components/ImportPicker/index.vue
index c85c1b3..b25ef50 100644
--- a/src/components/ImportPicker/index.vue
+++ b/src/components/ImportPicker/index.vue
@@ -1,8 +1,10 @@
 <template>
   <el-dialog
+    v-el-drag-dialog
     :visible.sync="visible"
     :title="title"
     :code="code"
+    :close-on-click-modal="false"
     @close="$emit('update:shows', false)"
   >
     <div>
@@ -13,51 +15,53 @@
         <el-step title="瀹屾垚" />
       </el-steps>
 
-      <div v-if="div1" class="mb40">
+      <div v-if="div1" style="margin-left: 85px;margin-top: 35px" class="mb40">
         <h3>瀵煎叆鎻愮ず</h3>
         <p>1. 瀵煎叆鏂囦欢鏀寔绫诲瀷锛�.xlsx,鏈�澶т笉鑳借秴10M</p>
         <p>2. 璇峰嬁璋冩暣瀵煎叆妯$増涓瓧娈电殑宸﹀彸椤哄簭鎴栨柊澧瀞heet椤�</p>
       </div>
 
-      <div v-if="div2 && div2_state === &quot;300&quot;">
+      <div v-if="div2 && div2_state === '301'" style="margin-left: 85px;margin-right: 85px">
         <p><span class="gth_icon">!</span>鏂囦欢涓湁<span style="color:red">{{ error_list.length }}</span>鏉¢敊璇暟鎹紝璇蜂慨鏀瑰悗閲嶆柊瀵煎叆</p>
         <el-table class="table" :data="error_list" :header-cell-style="{background:'#f5f5f5'}">
-          <el-table-column label="搴忓彿" prop="Seq" />
-          <el-table-column label="琛屽彿" prop="RoeNumber" />
-          <el-table-column label="閿欒瀛楁" prop="ErrorField" />
-          <el-table-column label="閿欒璇︽儏" prop="ErrorCont" />
+          <el-table-column label="搴忓彿" prop="Seq" width="50" />
+          <!--          <el-table-column label="琛屽彿" prop="RoeNumber" />-->
+          <el-table-column label="閿欒瀛楁" prop="ErrorField" min-width="150" />
+          <el-table-column label="閿欒璇︽儏" prop="ErrorCont" min-width="300" />
         </el-table>
       </div>
-      <div v-if="div2 && div2_state === '200'" style="position:relative;margin-top:100px;">
+      <div v-if="div2 && div2_state === '200'" style="position:relative;margin:100px 85px;">
         <div class="progress_bar bar-color-a" />
         <div :class="{'progress_bar':true, 'bar-color-b':true,'position_div':true,'cg':cg4,}" />
         <div class="mt"><img src="@/assets/images/succ.png" class="img_position"> 鏍¢獙鏁版嵁 (鎴愬姛)</div>
         <div class="mt">鍗冲皢瀵煎叆{{ total_num }}鏉℃暟鎹�</div>
       </div>
-      <div v-if="div1" class="mb40">
+      <div v-if="div1" style="margin-left:85px" class="mb40">
         <h3>涓婁紶鏂囦欢</h3>
         <el-upload
           style="display: inline-block;"
-          action="/apis/importexcel/ExcelModelCheck"
+          :action="baseUrl==='/api/'?'/api/importexcel/ExcelModelCheck':'/apis/importexcel/ExcelModelCheck'"
           :show-file-list="false"
           :on-success="handleAvatarSuccess"
           :before-upload="beforeUpload"
           :data="{FileCode:code}"
         >
-          <el-button class="but_style" icon="el-icon-upload2" size="small">{{ button_name }}</el-button>
+          <el-button v-waves class="but_style" icon="el-icon-upload2" size="small" :style="{color:$store.state.settings.theme}">{{ button_name }}</el-button>
         </el-upload>
         璇风偣鍑�
-        <el-button type="text" style="font-size: 14px;cursor: pointer" icon="el-icon-download" @click="clickDown(code)">涓嬭浇鏁版嵁妯$増</el-button>
+        <el-button v-waves type="text" style="font-size: 14px;cursor: pointer" icon="el-icon-download" @click="clickDown(code)">涓嬭浇鏁版嵁妯$増</el-button>
         , 骞舵寜鐓фā鐗堢紪杈戝鍏ユ暟鎹�
       </div>
-      <p v-if="div1">{{ file_name }}</p>
-      <div v-show="div1 && getDataing" class="yz">
+      <p v-if="div1" style="margin:0 85px 5px">{{ file_name }}</p>
+      <div v-show="div1 && getDataing" style="margin: 0 85px" class="yz">
         <ul>
           <li>
             <div class="progress_bar bar-color-a" />
             <div :class="{'progress_bar':true, 'bar-color-b':true,'position_div':true,'cg':cg1,'sb':sb1}" />
-            <div v-if="json1 === 200" class="mt"><img src="@/assets/images/succ.png" class="img_position">鏂囦欢涓婁紶 (鎴愬姛)</div>
-            <div v-if="json1 === 300" class="mt"><img src="@/assets/images/sbbbb_icon.png" class="img_position">鏂囦欢涓婁紶 (澶辫触)</div>
+            <!--            <div v-if="json1 === '200'" class="mt"><img src="@/assets/images/succ.png" class="img_position">鏂囦欢涓婁紶 (鎴愬姛)</div>-->
+            <div v-if="json1 === '200'" class="mt"><img src="@/assets/images/succ.png" class="img_position">{{ message1 }}</div>
+            <!--            <div v-if="json1 === '300'" class="mt"><img src="@/assets/images/sbbbb_icon.png" class="img_position">鏂囦欢涓婁紶 (澶辫触)</div>-->
+            <div v-if="json1 === '300'" class="mt"><img src="@/assets/images/sbbbb_icon.png" class="img_position">{{ message1 }}</div>
             <div v-if="json1=== null" class="mt">鏂囦欢涓婁紶锛堝緟鏍¢獙锛�</div>
           </li>
           <!-- <li >
@@ -69,8 +73,8 @@
           <li>
             <div class="progress_bar bar-color-a" />
             <div :class="{'progress_bar':true, 'bar-color-b':true,'position_div':true,'cg':cg2,'sb':sb2}" />
-            <div v-if="json2 === 200" class="mt"><img src="@/assets/images/succ.png" class="img_position">妯$増鏍¢獙 (鎴愬姛)</div>
-            <div v-if="json2 === 300" class="mt"><img src="@/assets/images/sbbbb_icon.png" class="img_position">妯$増鏍¢獙 (澶辫触)</div>
+            <div v-if="json2 === '200'" class="mt"><img src="@/assets/images/succ.png" class="img_position">{{ message2 }}</div>
+            <div v-if="json2 === '300'" class="mt"><img src="@/assets/images/sbbbb_icon.png" class="img_position">{{ message2 }}</div>
             <div v-if="json2 === null" class="mt">妯$増鏍¢獙锛堝緟鏍¢獙锛�</div>
           </li>
           <!-- <li v-if="json2 === 300">
@@ -87,8 +91,8 @@
           <li>
             <div class="progress_bar bar-color-a" />
             <div :class="{'progress_bar':true, 'bar-color-b':true,'position_div':true,'cg':cg3,'sb':sb3}" />
-            <div v-if="json3 === 200" class="mt"><img src="@/assets/images/succ.png" class="img_position">鏁版嵁閲忔牎楠� (鎴愬姛)</div>
-            <div v-if="json3 === 300" class="mt"><img src="@/assets/images/sbbbb_icon.png" class="img_position">鏁版嵁閲忔牎楠� (澶辫触)</div>
+            <div v-if="json3 === '200'" class="mt"><img src="@/assets/images/succ.png" class="img_position">{{ message3 }}</div>
+            <div v-if="json3 === '300'" class="mt"><img src="@/assets/images/sbbbb_icon.png" class="img_position">{{ message3 }}</div>
             <div v-if="json3 === null" class="mt">鏁版嵁閲忔牎楠岋紙寰呮牎楠岋級</div>
           </li>
           <!-- <li v-if="json3 === 300">
@@ -113,8 +117,9 @@
       </div>
     </div>
     <span slot="footer" class="dialog-footer" style="display: flex;">
-      <el-button v-if="button_text !=&quot;瀹屾垚&quot;" @click="colos()">鍙� 娑�</el-button>
+      <el-button v-if="button_text !=&quot;瀹屾垚&quot;" v-waves @click="colos()">鍙� 娑�</el-button>
       <el-button
+        v-waves
         type="primary"
         class="button_style"
         :disabled="disState"
@@ -125,9 +130,12 @@
 </template>
 <script>
 
-import { DownLoadExcel, ExcelModelCheck } from '@/api/Excel'
+import { DownLoadExcel, ExcelCheckData, ExcelImportSubmit, ExcelModelCheck } from '@/api/Excel'
+import elDragDialog from '@/directive/el-drag-dialog'
+import waves from '@/directive/waves'
 
 export default {
+  directives: { elDragDialog, waves },
   props: {
     code: {
       type: String,
@@ -160,6 +168,10 @@
   },
   data() {
     return {
+      message1: '',
+      message2: '',
+      message3: '',
+      getDataing: false,
       cg1: false,
       sb1: false,
       cg2: false,
@@ -188,7 +200,8 @@
       json3: '',
       mnList: [],
       error_list: [],
-      button_text: '涓嬩竴姝�'
+      button_text: '涓嬩竴姝�',
+      baseUrl: ''
 
     }
   },
@@ -196,6 +209,9 @@
     shows() {
       this.visible = this.shows
     }
+  },
+  mounted() {
+    this.baseUrl = process.env.VUE_APP_BASE_API
   },
   methods: {
     newDataFunc() {
@@ -218,6 +234,7 @@
         FileCode: code,
         FileName: this.file_name
       }
+
       if (this.num === 0) {
         this.div1 = false
         this.div2 = true
@@ -232,40 +249,31 @@
       }
     },
     ExcelImportSubmit(data) {
-      // all.ExcelImportSubmit(data).then((res) => {
-      //   if (res.statusCode === '200') {
-      //     this.div3 = true
-      //     this.num += 2
-      //     this.button_text = '瀹屾垚'
-      //     this.disState = false
-      //   } else {
-      //     this.num += 1
-      //     this.div3_sb = true
-      //     this.disState = true
-      //     this.error_message = res.message
-      //   }
-      // })
+      ExcelImportSubmit(data).then((res) => {
+        if (res.code === '200') {
+          this.div3 = true
+          this.num += 2
+          this.button_text = '瀹屾垚'
+          this.disState = false
+        } else {
+          this.num += 1
+          this.div3_sb = true
+          this.disState = true
+          this.error_message = res.Message
+        }
+      })
     },
     ExcelCheckData(data) {
-      // all.ExcelCheckData(data).then((res) => {
-      //   this.div2_state = res.StuCode
-      //   setTimeout(() => {
-      //     this.cg4 = true
-      //   }, 2000)
-      //   this.error_list = res.list
-      //   this.total_num = res.Count
-      //   if (res.StuCode === '200') {
-      //     this.disState = false
-      //   }
-      // })
-      ExcelModelCheck(data).then(res => {
-        this.div2_state = res.StuCode
+      ExcelCheckData(data).then((res) => {
+        this.div2_state = res.code
         setTimeout(() => {
           this.cg4 = true
         }, 2000)
+
         this.error_list = res.list
+
         this.total_num = res.Count
-        if (res.StuCode === '200') {
+        if (res.code === '200') {
           this.disState = false
         }
       })
@@ -287,7 +295,7 @@
       this.cg3 = false
       this.sb3 = false
       setTimeout(() => {
-        if (res.json1.statusCode === 200) {
+        if (res.json1.code === '200') {
           this.cg1 = true
         } else {
           this.sb1 = true
@@ -297,10 +305,11 @@
         }
       }, 500)
       setTimeout(() => {
-        this.json1 = res.json1.statusCode
+        this.json1 = res.json1.code
+        this.message1 = res.json1.Message
         this.json2 = null
         this.json3 = null
-        if (res.json2.statusCode === 200) {
+        if (res.json2.code === '200') {
           this.cg2 = true
         } else {
           this.sb2 = true
@@ -309,35 +318,41 @@
         }
       }, 2000)
       setTimeout(() => {
-        this.json2 = res.json2.statusCode
+        this.json2 = res.json2.code
+        this.message2 = res.json2.Message
         this.json3 = null
-        if (res.json3.statusCode === 200) {
-          this.cg3 = true
-        } else {
-          this.sb3 = true
-          this.json3 = null
-          this.button_name = '鏇存柊鏂囦欢'
+        if (res.json3 !== null) {
+          if (res.json3.code === '200') {
+            this.cg3 = true
+          } else {
+            this.sb3 = true
+            this.json3 = null
+            this.button_name = '鏇存柊鏂囦欢'
+          }
         }
       }, 4000)
       setTimeout(() => {
-        this.json3 = res.json3.statusCode
+        if (res.json3 !== null) {
+          this.json3 = res.json3.code
+          this.message3 = res.json3.Message
+        }
       }, 6000)
-      // if(res.json1.statusCode === 300){
+      // if(res.json1.code === 300){
       //     this.json2 = null
       //     this.json3 =null
       //     this.button_name = '鏇存柊鏂囦欢'
       // }else{
-      //     this.json2 = res.json2.statusCode
+      //     this.json2 = res.json2.code
 
       // }
-      // if(res.json2.statusCode === 300){
+      // if(res.json2.code === 300){
       //     this.json3 =null
       //     this.button_name = '鏇存柊鏂囦欢'
       // }else{
-      //     this.json3 = res.json3.statusCode
+      //     this.json3 = res.json3.code
       // }
       setTimeout(() => {
-        if (this.json1 === 200 && this.json2 === 200 && this.json3 === 200) {
+        if (this.json1 === '200' && this.json2 === '200' && this.json3 === '200') {
           this.disState = false
         }
       }, 7000)
@@ -350,11 +365,12 @@
       //   window.location.href = res
       // })
       DownLoadExcel(data).then(res => {
-        console.log(res.data)
-        console.log(process.env.VUE_APP_BASE_API)
-        console.log(process.env.VUE_APP_BASE_API_FILE)
-        console.log(window.location.origin + res.data)
-        window.location.href = process.env.VUE_APP_BASE_API_FILE + res.data
+        // console.log(res.data)
+        // console.log(process.env.VUE_APP_BASE_API, 8989899)
+        // console.log(process.env.VUE_APP_BASE_API_FILE)
+        // console.log(window.location.origin + res.data)
+        // window.location.href = process.env.VUE_APP_BASE_API_FILE + res.data
+        window.location.href = res.data
       })
     }
   }

--
Gitblit v1.9.3