Forráskód Böngészése

上传估价结果一览表表单、添加请求代理

wucl 8 hónapja
szülő
commit
90f18752c0

+ 1 - 1
.env.development

@@ -4,7 +4,7 @@ NODE_ENV = development
 VITE_NAME='全局环境'
 
 # 接口地址
-VITE_BASE_URL='http://127.0.0.1:9080/productivity-platform/'
+VITE_BASE_URL='http://127.0.0.1:8080/api/'
 
 # OA系统地址
 VITE_OA_URL='http://127.0.0.1:9518/'

+ 8 - 0
src/api/houseGuaranty.js

@@ -0,0 +1,8 @@
+import request from '@/utils/request'
+
+export function genConsignorLetter(params) {
+    return request({
+        url: '/house/guaranty/consignor/' + params,
+        method: 'get'
+    })
+}

BIN
src/assets/icons/form.png


+ 42 - 4
src/components/SheetView/index.vue

@@ -1,10 +1,16 @@
 <template>
     <div>
       <input type="file" @change="readExcel" />
-      <div v-if="excelData">
-        <div v-html="excelData"></div>
-         <div>{{ excelData }}</div>
+      <div v-if="excelData" style="height: 600px; text-align: center;">
+        <el-button type="primary" class="fsbtn" @click="fullScreenDialog = true">全屏预览</el-button>
+        <div style="float: left; height: 600px; margin-top: -60px;">
+          <h3>估价结果一览表(预览)</h3>
+          <div v-html="excelData"></div>
+        </div>
       </div>
+      <el-dialog v-model="fullScreenDialog"  title="估价结果一览表(预览)" width="80%" center align-center>
+        <div v-html="excelData"></div>
+      </el-dialog>
     </div>
   </template>
    
@@ -15,23 +21,49 @@
     data() {
       return {
         excelData: null,
+        fullScreenDialog:false
       };
     },
+
+    props:{
+      uploadUrl:{
+        type: String,
+        Required:true
+      }
+    },
     methods: {
       readExcel(event) {
+        this.excelData = null;
         const files = event.target.files;
         if (files && files[0]) {
           const fileReader = new FileReader();
           fileReader.onload = (e) => {
             const bufferArray = e.target.result;
             const wb = XLSX.read(bufferArray, { type: 'buffer' });
-            const wsname = wb.SheetNames[2];
+            const wsname = wb.SheetNames[0];
             const ws = wb.Sheets[wsname];
             this.excelData = XLSX.utils.sheet_to_html(ws);
+            this.sendExcelDate();
+            setTimeout(()=>{
+              this.removeActAddress();
+            },500)
           };
           fileReader.readAsArrayBuffer(files[0]);
         }
+        
+      },
+
+      removeActAddress(){
+        const trs = document.getElementsByTagName("tr");
+        for (var i = 0 ; i<trs.length;i++){
+          const tds = trs[i].childNodes;
+          tds[tds.length-1].remove();
+        }
       },
+
+      sendExcelDate() {
+        this.$emit('getExcelDate', this.excelData);
+      }
     },
   };
   </script>
@@ -59,4 +91,10 @@
             background-color: #FFFFFF;
         }
 
+        .fsbtn{
+          position:relative;
+          top: -30px;
+          right: -480px;
+        }
+
   </style>

+ 7 - 2
src/components/SwichButton/index.vue

@@ -9,7 +9,7 @@
             </el-button>
         </div>
         <div class="next">
-            <el-button v-if="nextPath" plain type="danger" @click="goNext()">
+            <el-button v-if="nextPath" plain type="danger" @click="parentDo()">
                 继续
                 <el-icon style="vertical-align: -20%;">
                     <ArrowRightBold />
@@ -34,6 +34,10 @@ export default {
         lastPath: {
             type: String,
             required: false
+        },
+        nextDo: {
+            type: Function,
+            required: true
         }
 
     },
@@ -48,7 +52,8 @@ export default {
         goLast(){
             this.$router.push(this.lastPath);
         },
-        goNext() {
+        parentDo() {
+            this.nextDo();
             this.$router.push(this.nextPath);
         }
     }

+ 1 - 1
src/router/index.js

@@ -106,7 +106,7 @@ const routes = [
             component: Consignor,
             name: 'consignor',
             meta: {
-              title: '委托人信息'
+              title: '委托人'
             },
           },
           {

+ 6 - 6
src/views/house/folder/parent.vue

@@ -4,22 +4,22 @@
           <div class="title-div">
             <span>房地产工作台</span>
           </div>
-          <div class="createNew-div" @click="createFolder" >
+        </div>
+        <!-- <div class="createNew-div" @click="createFolder" >
             <img src="../../../assets/icons/folder.png" style="width: 32px; height: 32px; float: left;margin-top: 22px;" />
             <span style="margin-left: 10px;">新的项目</span>
             <img src="../../../assets/icons/plus.png" style="width: 32px; height: 32px;float: right;margin-top: 22px;" />
-          </div>
-        </div>
+          </div> -->
         <div class="createNew-div" @click="createWord()">
             <img src="../../../assets/icons/word.png" style="width: 32px; height: 32px; float: left;margin-top: 22px;" />
-            <span style="margin-left: 10px;">新的报告</span>
+            <span style="margin-left: 10px;">抵押类报告</span>
             <img src="../../../assets/icons/plus.png" style="width: 32px; height: 32px;float: right;margin-top: 22px;" />
           </div>
-          <div class="createNew-div">
+          <!-- <div class="createNew-div">
             <img src="../../../assets/icons/excel.png" style="width: 32px; height: 32px; float: left;margin-top: 22px;" />
             <span style="margin-left: 10px;">新的测算表</span>
             <img src="../../../assets/icons/plus.png" style="width: 32px; height: 32px;float: right;margin-top: 22px;" />
-          </div>
+          </div> -->
         <el-tabs v-model="activeName" class="condtion-tabs" @tab-click="handleClick">
           <el-tab-pane label="全部项目" name="all">
             <div class="example-list">

+ 64 - 29
src/views/house/workbench/consignor.vue

@@ -1,25 +1,19 @@
 <template>
     <div class="contrl">
-        <el-form :model="consignor" label-width="auto" style="margin-top: 30px;">
-            <el-divider content-position="left"><span style="color:#ff6154;">委托人信息</span></el-divider>
-            <el-form-item label="名称:" class="form-item">
-                <el-input v-model="consignor.name" clearable />
-            </el-form-item>
-            <el-form-item label="类型:" class="form-item">
-                <el-input v-model="consignor.type" clearable />
-            </el-form-item>
-            <el-form-item label="住所:" class="form-item">
-                <el-input v-model="consignor.address" clearable />
-            </el-form-item>
-            <el-form-item label="法定代表人:" class="form-item">
-                <el-input v-model="consignor.legalPerson" clearable />
-            </el-form-item>
-            <el-form-item label="统一社会信用代码:" class="form-item">
-                <el-input v-model="consignor.legalCode" clearable />
-            </el-form-item>
-        </el-form>
-        <SwitchButton :nextPath="nextPath"></SwitchButton>
-        <SheetView></SheetView>
+        <div style="width: 95%;">
+          <div class="title-div">
+            <span>上传估价结果一览表-表单</span>
+          </div>
+        </div>
+        <div class="download-btn">
+            <img src="../../../assets/icons/form.png" style="width: 26px; height: 26px; float: left; margin-top: 27px;" />
+            <span class="form-name">估价结果一览表-表单.xlsx</span>
+        </div>
+        
+        <div class="target-windows">
+            <SheetView :uploadUrl="'/api/file/house/guaranty/target'" @getExcelDate="excelDate"></SheetView>
+        </div>
+         <SwitchButton :nextPath="nextPath" :nextDo="genConsignorLetter"></SwitchButton>
         
     </div>
 </template>
@@ -27,6 +21,7 @@
 <script>
 import  SwitchButton from '../../../components/SwichButton/index.vue'
 import  SheetView from '../../../components/SheetView/index.vue'
+ import { genConsignorLetter } from '@/api/houseGuaranty.js';
  export default {
     components:{
         SwitchButton,
@@ -34,19 +29,25 @@ import  SheetView from '../../../components/SheetView/index.vue'
     },
     data() {
         return {
-            consignor: {
-                name: null,
-                type: null,
-                address: null,
-                legalPerson: null,
-                legalCode: null
-            },
-            nextPath:'/home/houseWorkbench/certificate'
+            nextPath:'/home/houseWorkbench/certificate',
+            excelHtml:null
         }
     },
 
     methods:{
-       
+       genConsignorLetter(){
+            if (this.excelHtml){
+                genConsignorLetter(13).then(res=>{
+                    console.log(res)
+                })
+            }
+       },
+
+       excelDate(data){
+         this.excelHtml = data;
+       }
+
+
     }
  }
 
@@ -67,4 +68,38 @@ import  SheetView from '../../../components/SheetView/index.vue'
   --el-input-focus-border: #ff6154;
   --el-input-focus-border-color:#ff6154;
 }
+
+.target-windows{
+    margin-top: 80px;
+    overflow-y: scroll; 
+    padding: 5px;
+    border: 1.5px #dae1eb solid;
+    border-radius: 0.3em;
+}
+
+.download-btn{
+    height: 80px;
+    line-height: 80px;
+    float: right;
+    margin-left: 20px;
+}
+.form-name{
+    margin-left: 5px; 
+    font-size: 16px; 
+    text-decoration: underline;
+}
+
+.form-name:hover {
+    cursor: pointer;
+    color: #ff6154;
+}
+
+.title-div {
+  height: 80px;
+  line-height: 80px;
+  width: 300px;
+  float: left;
+  font-size: 20px;
+  font-weight: 900;
+}
 </style>

+ 13 - 0
vite.config.js

@@ -24,5 +24,18 @@ export default defineConfig({
     alias: {
       '@': fileURLToPath(new URL('./src', import.meta.url))
     }
+  },
+  server: {
+    host: '127.0.0.1',
+    port: 8080, // 端口
+    proxy: {
+        '/api': { // 请求接口中要替换的标识
+            target: 'http://localhost:9080', // 代理地址
+            changeOrigin: true, // 是否允许跨域
+            secure: true,
+            rewrite: (path) => path.replace(/^\/api/, '/api') // api标志替换为''
+        }
+    }
   }
+  
 })