소스 검색

fixed bugs in search

maqingyang 11 달 전
부모
커밋
a0bb7b1caf
4개의 변경된 파일740개의 추가작업 그리고 9개의 파일을 삭제
  1. 21 1
      src/router/index.js
  2. 1 1
      src/views/index.vue
  3. 9 7
      src/views/system/business.vue
  4. 709 0
      src/views/system/businessInfo.vue

+ 21 - 1
src/router/index.js

@@ -346,10 +346,30 @@ var routes = [{
                     menu: 'cooperatorInfo'
                 }
             },
+            {
+                path: '/business',
+                name: '业务',
+                component: () => import('../views/system/business.vue'),
+                meta: {
+                    keepAlive: false,
+                    show: true,
+                    menu: 'business'
+                }
+            },
+            {
+                path: '/businessInfo',
+                name: '业务详情',
+                component: () => import('../views/system/businessInfo.vue'),
+                meta: {
+                    keepAlive: false,
+                    show: true,
+                    menu: 'businessInfo'
+                }
+            },
             {
                 path: '/businesstodo',
                 name: '待办业务',
-                component: () => import('../views/system/business.vue'),
+                component: () => import('../views/system/businesstodo.vue'),
                 meta: {
                     keepAlive: false,
                     show: true,

+ 1 - 1
src/views/index.vue

@@ -44,7 +44,7 @@
             @select="handleSelect"
           >
             <el-menu-item index="homepage">首页</el-menu-item>
-            <el-menu-item index="businesstodo">业务</el-menu-item>
+            <el-menu-item index="business">业务</el-menu-item>
             <el-menu-item index="cooperatorInfo">合作方</el-menu-item>
             <el-menu-item index="fieldInfo">字段列表</el-menu-item>
             <el-menu-item index="userinfo">模型列表</el-menu-item>

+ 9 - 7
src/views/system/business.vue

@@ -151,7 +151,9 @@ export default {
   watch: {},
   computed: {},
   beforeCreate() {},
-  created() {},
+  created() {
+    
+  },
   beforeMount() {},
   mounted()
   {
@@ -195,7 +197,7 @@ export default {
     },
     gotolinkbusiness()
     {
-      this.$router.replace('/businesstodo');
+      this.$router.replace('/business');
     },
     gotolinkCooperator()
     {
@@ -221,7 +223,7 @@ export default {
         selectBusiness(this.currentPage,this.pagesize,this.input,this.businessType).then(
               res=>
               {
-                this.selectBusinessData=res.data.select_business.list;
+                this.selectBusinessData=res.data.select_business_list.list;
                 this.businessShowData = this.selectBusinessData
               }
           )
@@ -242,7 +244,7 @@ export default {
           selectBusiness(this.currentPage,this.pagesize,this.input,this.businessType).then(
               res=>
               {
-                this.selectBusinessData=res.data.select_business.list;
+                this.selectBusinessData=res.data.select_business_list.list;
                 this.businessShowData = this.selectBusinessData
               }
           )
@@ -315,7 +317,7 @@ export default {
     },
     onButtonClick (row){
       this.$router.push({
-        path: '/businessInfoToDo',
+        path: '/businessInfo',
         query: {
           businessNum : row.businessNum,
           headInfId:row.headInfId,
@@ -343,9 +345,9 @@ export default {
         selectBusiness(this.currentPage,this.pagesize,this.input,this.businessType).then(
               res=>
               {
-                this.selectBusinessData=res.data.select_business.list;
+                this.selectBusinessData=res.data.select_business_list.list;
                 this.businessShowData = this.selectBusinessData
-                var j = parseInt(res.data.select_business.total)
+                var j = parseInt(res.data.select_business_list.total)
                 this.totalSize = j
                 this.showSize = this.totalSize
   

+ 709 - 0
src/views/system/businessInfo.vue

@@ -0,0 +1,709 @@
+<template>
+    <div class="container" style="min-height: 100%; padding-bottom: 100px;">
+      <el-container>
+  
+              <el-aside :width="isCollapse?'65px':'150px'">
+          <el-button   @click = "toggleCollapse" type="primary"
+                       style="display:block;margin:0 auto"
+                       size="medium"
+                       class="el-icon-s-fold">
+          </el-button>
+          <el-menu
+              default-active="1"
+              class="el-menu-vertical-demo"
+  
+          >
+            <el-menu-item  @click="gotolink1" class="vertical-center" index="1">
+              <i class="el-icon-location"></i>
+              <span slot="title">待办业务</span>
+            </el-menu-item>
+            <el-menu-item @click="gotolink2" class="vertical-center" index="2">
+              <i class="el-icon-menu"></i>
+              <span slot="title">解析业务</span>
+            </el-menu-item>
+            <el-menu-item  @click="gotolink3" class="vertical-center" index="3">
+              <i class="el-icon-setting"></i>
+              <span slot="title">失败业务</span>
+            </el-menu-item>
+          </el-menu>
+  
+        </el-aside>
+        <el-divider direction="vertical"></el-divider>
+  
+        <!--      <div class="line" />-->
+  
+        <el-main>
+  
+          <el-tabs v-model="activeName" @tab-click="handleClick" >
+            <el-tab-pane label="业务信息" name="first">
+              <el-descriptions style="margin-top: 20px"  :column="1" border>
+                <el-descriptions-item label="业务编号">
+                  <p>
+                    {{this.businessInfoData.businessNum }}
+                  </p>
+                </el-descriptions-item>
+                <el-descriptions-item label="产品编号">
+                  <p>
+                    {{this.businessInfoData.productNum }}
+                  </p>
+                </el-descriptions-item>
+                <el-descriptions-item label="产品名称">
+                  <p>
+                    {{this.businessInfoData.productName }}
+                  </p>
+                </el-descriptions-item>
+                <el-descriptions-item label="合作方名称">
+                  <p>
+                    {{this.$route.query.cooperatorName }}
+                  </p>
+                </el-descriptions-item>
+  
+              </el-descriptions>
+            </el-tab-pane>
+  
+            <el-tab-pane label="客户信息" name="second">
+              <el-descriptions style="margin-top: 20px"  :column="1" border>
+                <el-descriptions-item label="客户编号">
+                  <p>
+                    {{this.customInfoData.customerNum }}
+                  </p>
+                </el-descriptions-item>
+                <el-descriptions-item label="客户名称">
+                  <p>
+                    {{this.customInfoData.name }}
+                  </p>
+                </el-descriptions-item>
+                <el-descriptions-item label="证件类型">
+                  <p>
+                    {{this.customInfoData.idTypeCode }}
+                  </p>
+                </el-descriptions-item>
+                <el-descriptions-item label="证件号码">
+                  <p>
+                    {{this.customInfoData.idNum }}
+                  </p>
+                </el-descriptions-item>
+                <el-descriptions-item label="客户性别">
+                  <p>
+                    {{this.customInfoData.sexDesc }}
+                  </p>
+                </el-descriptions-item>
+                <el-descriptions-item label="手机号码">
+                  <p>
+                    {{this.customInfoData.telephone }}
+                  </p>
+                </el-descriptions-item>
+                <el-descriptions-item label="居住地址">
+                  <p>
+                    {{this.customInfoData.address }}
+                  </p>
+                </el-descriptions-item>
+  
+              </el-descriptions>
+  
+            </el-tab-pane>
+  
+  
+            <!--            yuan-->
+  
+            <el-tab-pane label="文件" name="third"  >
+  
+  <!--            <el-divider></el-divider>-->
+  
+              <div class="top_show" style="margin-top: 20px">
+                <span> 解析文件:</span>
+                <el-button size="small" class="el-icon-upload" type="primary" round style="position: absolute; right: 10%;" @click="add_file_show=true">上传</el-button>
+                <el-button size="small" class="el-icon-download" type="primary" round style="position: absolute; right: 1%;" @click="fileDown()">下载</el-button>
+  
+              </div>
+  
+              <el-table :data="reportFileData1" style="width: 100%; margin-top: 20px"
+                        @select-all="selectAll"
+  
+                        @select="handleSelectionChange" :row-key="rowKey" stripe>
+                <el-table-column type="selection" :reserve-selection=true  width="55" />
+  
+                <el-table-column align="center" label="文件id" width="230">
+                  <template v-slot="{row}">
+                  <span
+                  >{{ row.id }}</span>
+                    <!-- <span>{{ row.name }}</span> -->
+                  </template>
+                </el-table-column>
+  
+                <el-table-column align="center" label="文件名" width="230">
+                  <template v-slot="{row}">
+                  <span
+                  >{{ row.fileNameXml }}</span>
+                    <!-- <span>{{ row.name }}</span> -->
+                  </template>
+                </el-table-column>
+  
+                <el-table-column align="center" label="上传时间" width="330">
+                  <template v-slot="{row}">
+                    <span>{{ row.updateTime}}</span>
+                  </template>
+                </el-table-column>
+  
+                <el-table-column label="操作" width="250">
+                  <template  v-slot="{row}" >
+                    <el-button size="mini" type="primary" @click="fileDelete(row,1)">删除</el-button>
+                  </template>
+                </el-table-column>
+  
+              </el-table>
+              <el-divider></el-divider>
+  
+              <div class="top_show">
+                <span> 模型文件:</span>
+              </div>
+              <el-table :data="reportFileData2" style="width: 100%;"
+                        @select-all="selectAll2"
+  
+                        @select="handleSelectionChange2" :row-key="rowKey" stripe>
+                <el-table-column type="selection" :reserve-selection=true  width="55" />
+                <el-table-column align="center" label="文件id" width="230">
+                  <template v-slot="{row}">
+                  <span
+                  >{{ row.id }}</span>
+                    <!-- <span>{{ row.name }}</span> -->
+                  </template>
+                </el-table-column>
+                <el-table-column align="center" label="文件名" width="230">
+                  <template v-slot="{row}">
+                  <span
+                  >{{ row.fileNameXml }}</span>
+                    <!-- <span>{{ row.name }}</span> -->
+                  </template>
+                </el-table-column>
+                <el-table-column align="center" label="上传时间" width="330">
+                  <template v-slot="{row}">
+                    <span>{{ row.updateTime}}</span>
+                  </template>
+                </el-table-column>
+  
+                <el-table-column label="操作" width="350">
+                  <template  v-slot="{row}">
+                    <el-button size="mini" type="primary" @click="fileDelete(row,2)">删除</el-button>
+                  </template>
+                </el-table-column>
+  
+              </el-table>
+  
+            </el-tab-pane>
+            <!--            yuan-->
+  
+          </el-tabs>
+          <el-button type="primary" round @click="onButtonClickReturn" size="small" style="margin-left: 350px">返回</el-button>
+  
+  
+  
+        </el-main>
+  
+      </el-container>
+  
+  
+      <el-dialog title="添加文件" :visible.sync="add_file_show" width="30%">
+        <div class="result_view" >
+          <div style="margin-top:10px">
+            <span> 文件类型:</span>
+            <el-select v-model="model_type" placeholder="请选择文件类型">
+  
+              <el-option v-for='model_item in file_model' :key="model_item" :label="model_item"
+                         :value="model_item"
+              />
+            </el-select>
+          </div>
+        </div>
+        <div style="margin-top:20px">
+  
+          <el-form>
+            <el-form-item>
+              <el-upload ref="upfile"
+                         style="display: inline"
+                         :auto-upload="false"
+                         :on-change="handleChange"
+                         :file-list="fileList"
+                         action="#">
+                <el-button  type="primary">选择文件</el-button>
+              </el-upload>
+            </el-form-item>
+            <el-form-item>
+              <el-button  type="primary" @click="upload">点击上传</el-button>
+            </el-form-item>
+  
+          </el-form>
+        </div>
+  
+      </el-dialog>
+    </div>
+  </template>
+  
+  <script>
+  import {
+    cooperatorEdit,
+    reportFileDelete,
+    fileDownload,
+    findBusinessInfoByNum,
+    findCustomInfoByHead,
+    reportFileList,
+    templateDel,
+    fieldTemplateEdit,
+    findCooperatorFieldByNum,
+    downloadMod
+  } from '@/api/index.js'
+  import store from "@/store";
+  import request from '@/utils/request.js'
+  import { fieldInfo, modelInfo } from '../../api';
+  import {
+    cooperatorList
+  } from '@/api/index.js'
+  export default {
+  
+    name: "cooperatorInfo",
+    props: [],
+    components: {},
+    data() {
+      return {
+        activeKey: 0,
+        activeName: "first",
+        currentPage1: 1,
+        pagesize1:5,
+        currentPage2: 1,
+        pagesize2:5,
+        businessInfoData : [],
+        customInfoData : [],
+        downSelected:[],
+        downSelected2:[],
+  
+        selectedAll:false,
+        selectedAll2:false,
+  
+  
+        reportFileData : [],
+        reportFileData1 : [],
+        reportFileData2 : [],
+        file_model:["解析文件","模型文件"],
+        model_type:"",
+        file_name:"",
+        fileNameModel:"",
+        fileNameXml:"",
+        fileNameTxt:"",
+  
+  
+        isCollapse: false,
+  
+        add_file_show:false,
+  
+        selected1: true,
+        selected2: false,
+        selected3: true,
+        selected4: false,
+        selected5: false,
+        selected6: true,
+        input:'',
+        parseLen:"",
+        modelLen:"",
+  
+        businessNum : this.$route.query.businessNum,
+        headInfId : this.$route.query.headInfId,
+        rptNo : this.$route.query.rptNo,
+        businessId : this.$route.query.businessId,
+        cooperatorName : this.$route.query.cooperatorName,
+  
+      }
+    },
+    watch: {},
+    computed: {},
+    beforeCreate() {},
+    created() {},
+    beforeMount() {},
+    mounted()
+    {
+      findBusinessInfoByNum(this.businessNum).then(
+          res=>
+          {
+            this.businessInfoData=res.data.business_info;
+            console.log(this.businessInfoData)
+          }
+      )
+  
+      findCustomInfoByHead(this.headInfId).then(
+              res=>
+              {
+                this.customInfoData=res.data.custom_info;
+              }
+          )
+      reportFileList(this.businessNum).then(
+          res=>
+          {
+            this.reportFileData=res.data.report_file_list;
+            console.log(this.reportFileData)
+            for (let item of this.reportFileData){
+              if(item.fileNameXml){
+                this.reportFileData1.push(item)
+                if(item.fileNameTxt) {
+                  let litem = {
+                    id:item.id,
+                    fileNameXml:item.fileNameTxt,
+                    updateTime:item.updateTime
+                  }
+                  this.reportFileData1.push(litem)
+                }
+              }if(item.fileNameModel){
+                let aitem = {
+                  id:item.id,
+                  fileNameXml:item.fileNameModel,
+                  updateTime:item.updateTime
+                }
+                this.reportFileData2.push(aitem)
+              }
+            }
+            this.parseLen = this.reportFileData1.length
+            this.modelLen = this.reportFileData2.length
+  
+          }
+      )
+      let name = sessionStorage.getItem('currentTab')
+      // 判断是否存在currentTab,即tab页之前是否被点击切换到别的页面
+      if(name){
+        this.activeName = name
+      }
+    },
+    beforeUpdate() {},
+    beforeRouteLeave(to, from, next){
+      // 在离开此路由之后清除保存的状态(我的需求是只需要在当前tab页操作刷新保存状态,路由切换之后不需要保存)
+      // 根据个人需求决定清除的时间
+      sessionStorage.removeItem('currentTab')
+      next()
+    },
+    updated() {},
+    destroyed() {},
+    methods: {
+      request() {},
+      toggleCollapse(){
+        this.isCollapse = !this.isCollapse;
+      },
+      handleSelectionChange(selection) {
+        this.downSelected = selection.map(item => item.fileNameXml)
+        console.log(this.downSelected)
+        if(this.downSelected.length!=this.parseLen){
+          this.selectedAll = false
+        }
+      },
+      selectAll() {
+        if(this.downSelected.length!=this.parseLen){
+          this.selectedAll = true
+        }
+        else this.selectedAll = false
+        if(this.selectedAll) {
+          for (let i = 0; i < this.reportFileData1.length; i++) {
+            if (!this.downSelected.includes(this.reportFileData1[i].fileNameXml)) {
+              // 回显数据里没有本条,把这条加进来(选中)
+              this.downSelected.push(this.reportFileData1[i].fileNameXml);
+            }
+          }}
+        else {
+           this.reportFileData1.forEach((item, index) => {
+                this.downSelected.splice(index.fileNameXml, 1);
+                });
+      }
+      },
+  
+      handleSelectionChange2(selection) {
+        this.downSelected2 = selection.map(item => item.fileNameXml)
+        if(this.downSelected2.length!=this.modelLen){
+          this.selectedAll2 = false
+        }
+      },
+      selectAll2() {
+        if(this.downSelected2.length!=this.modelLen){
+          this.selectedAll2 = true
+        }
+        else this.selectedAll2 = false
+        if(this.selectedAll2) {
+          for (let i = 0; i < this.reportFileData2.length; i++) {
+            if (!this.downSelected2.includes(this.reportFileData2[i].fileNameXml)) {
+              // 回显数据里没有本条,把这条加进来(选中)
+              this.downSelected2.push(this.reportFileData2[i].fileNameXml);
+            }
+          }}
+        else {
+          this.reportFileData2.forEach((item, index) => {
+            this.downSelected2.splice(index.fileNameXml, 1);
+          });
+        }
+      },
+  
+      handleClick(tab, event) {
+        // 点击tab后触发事件,修改显示页面,将状态保存在sessionStorage里面
+        sessionStorage.setItem('currentTab', tab.name)
+  
+      },
+      add_condition()
+      {
+        this.add_file_show=false;
+        location.reload();
+  
+      },
+      gotolink1()
+      {
+        this.$router.replace('/business');
+        this.selected1 = false;
+        this.selected2 = true;
+        this.selected3 = true;
+        this.selected4 = false;
+        this.selected5 = true;
+        this.selected6 = false;
+      },
+  
+      gotolink2()
+      {
+        //指定跳转地址
+        this.$router.replace('/business');
+        this.selected1 = true;
+        this.selected2 = false;
+        this.selected3 = false;
+        this.selected4 = true;
+        this.selected5 = true;
+        this.selected6 = false;
+      },
+      gotolink3()
+      {
+        //指定跳转地址
+        this.$router.replace('/business');
+        this.selected1 = true;
+        this.selected2 = false;
+        this.selected3 = true;
+        this.selected4 = false;
+        this.selected5 = false;
+        this.selected6 = true;
+      },
+      onButtonClickReturn()
+      {
+        this.$router.replace('/business');
+      },
+  
+      //yuan
+      //通过onchanne触发方法获得文件列表
+      handleChange(file, fileList) {
+        this.fileList = fileList;
+        // console.log(fileList)
+      },
+  
+  
+      // 文件下载
+      fileDown: function (){
+        for (let i = 0; i < this.downSelected2.length; i++) {
+          const modname = this.downSelected2[i]; // 要下载的文件名
+          request.get(`/report/downloadMod/${modname}`).then(res => {
+            console.log("success");
+            const base64Data = res.data.file;
+            const byteCharacters = atob(base64Data); // 使用atob解码Base64字符串
+            const byteNumbers = new Array(byteCharacters.length);
+            for (let i = 0; i < byteCharacters.length; i++) {
+              byteNumbers[i] = byteCharacters.charCodeAt(i);
+            }
+            const byteArray = new Uint8Array(byteNumbers)
+            const blob = new Blob([byteArray], {type: 'application/octet-stream'});
+            const downloadUrl = URL.createObjectURL(blob);
+            const link = document.createElement('a');
+            link.href = downloadUrl;
+            link.download = modname; // 替换为你的文件名及扩展名
+            link.click();
+          })
+              .catch(error => {
+                console.error('Error downloading file:', error);
+              });      }
+        for (let i = 0; i < this.downSelected.length; i++) {
+          const filename = this.downSelected[i]; // 要下载的文件名
+          request.get(`/report/download/${filename}`).then(res => {
+            console.log("success");
+            const base64Data = res.data.file;
+            const byteCharacters = atob(base64Data); // 使用atob解码Base64字符串
+            const byteNumbers = new Array(byteCharacters.length);
+            for (let i = 0; i < byteCharacters.length; i++) {
+              byteNumbers[i] = byteCharacters.charCodeAt(i);
+            }
+            const byteArray = new Uint8Array(byteNumbers)
+            const blob = new Blob([byteArray], {type: 'application/octet-stream'});
+            const downloadUrl = URL.createObjectURL(blob);
+            const link = document.createElement('a');
+            link.href = downloadUrl;
+            link.download = filename; // 替换为你的文件名及扩展名
+            link.click();
+          })
+              .catch(error => {
+                console.error('Error downloading file:', error);
+              });}
+        setTimeout(() => {
+          setTimeout(this.$message({
+            message: '下载成功',
+            type: 'success'
+          }, 100));
+        }, 100)
+      },
+  
+      //1.2 上传方法具体实现重写
+      upload(){
+        let fd = new FormData();
+  
+        this.fileList.forEach(item=>{
+          //文件信息中raw才是真的文件
+          fd.append("files",item.raw);
+          if(this.model_type == "模型文件"){
+            this.fileNameModel = "1"
+          }else if(item.raw.name.toString().endsWith("txt")){
+            this.fileNameTxt = "1"
+          }
+          else {
+            this.fileNameXml = "1"
+          }
+          request.post('/report/fileReportAdd',{
+            file_name : item.raw.name,
+            fileModel:this.fileNameModel,
+            fileNameTxt:this.fileNameTxt,
+            fileNameXml:this.fileNameXml,
+            headInfId:this.headInfId,
+            rptNo:this.rptNo,
+            businessId:this.businessId,
+            businessNum:this.businessNum,
+          })
+          console.log("模型类")
+  
+          console.log(this.fileNameModel)
+        })
+        if(this.model_type == "模型文件") {
+          request.post('/up/uploadMod', fd).then(res => {
+          })
+              .catch(err => {
+                this.$message.error(err.message)
+                // console.log(err)
+              })
+        }
+        else {
+          request.post('/up/uploadUi', fd).then(res => {
+          })
+              .catch(err => {
+                this.$message.error(err.message)
+                // console.log(err)
+              })
+        }
+        this.add_file_show=false;
+        setTimeout(() => {
+          this.$message({
+            message: '文件上传成功',
+            type: 'success'
+          });
+          setTimeout(() => {
+            location.reload();
+          }, 1000);
+        }, 100);
+      },
+      fileDelete: function (row,type){
+        console.log("asssssdfas")
+  
+        console.log(type)
+        // console.log(row.fileNameXml)
+  
+        request.post('/report/del',{
+          file_name : row.fileNameXml,
+          id:row.id,
+          type:type
+        })
+        this.$message({
+            message: '删除成功',
+            type: 'success'
+          });
+          location.reload();
+  
+          // this.roleList();
+  
+  
+      },
+      // fileDelete(scope,row) {
+      //   //删除文件
+      //   reportFileDelete(row.id).then(
+      //       res=>
+      //       {
+      //         this.$router.push({
+      //           path: '/businessinfoFail',
+      //           query: {
+      //
+      //           }
+      //         })
+      //       },
+      //   ),
+      //       this.$message("已删除")
+      //
+      //
+      //   // location.reload();
+      // },
+  
+    },
+  
+  }
+  </script>
+  
+  <style scoped>
+  /* 竖线 */
+  .line{
+    float: left;
+    width: 0.1em;
+    height: 19.5em;
+    margin-right: 1em;
+    margin-left: 0em;
+    background:#000000;
+  }
+  
+  .button {
+    background-color: white;
+    border: none;
+    color: black;
+    padding: 15px 32px;
+    text-align: center;
+    text-decoration: none;
+    display: inline-block;
+    font-size: 16px;
+    width:180px;
+    height:50px;
+    font-weight: normal
+  }
+  
+  .buttonselected {
+    background-color: white;
+    border: none;
+    color: black;
+    padding: 15px 32px;
+    text-align: center;
+    text-decoration: none;
+    display: inline-block;
+    font-size: 18px;
+    width:180px;
+    height:50px;
+    font-weight: 900
+  }
+  .top_show {
+    font-size: 16px;
+  }
+  .el-menu-vertical-demo{
+    font-weight: bold;
+  }
+  .el-icon-s-fold
+  {
+    background: rgb(255,255,255);
+    /*font-size: 10px;*/
+    /*Tine-height: 24px;*/
+    color: black;
+    border: none;
+    text-align: center;
+    letter-spacing: 0.2rem;
+    cursor: pointer;
+  }
+  .el-divider--vertical {
+    height: 47em;
+    margin-left: 20px;
+  }
+  .container {  }
+  </style>
+