Explorar o código

8.4项目日志:数据备份下载

gubai %!s(int64=3) %!d(string=hai) anos
pai
achega
4a9ee5d71d

+ 5 - 3
src/layout/components/Sidebar/SidebarItem.vue

xqd
@@ -97,11 +97,13 @@ export default {
 </script>
 <style lang="scss">
 .svg-icon{
-  margin-left: 4px;
+  width: 1.8em !important;
+  margin-left: -3px;
+  margin-right: 10px !important;
 }
-.el-tooltip{
+.el-tooltip:nth-child(3){
   position: absolute !important;
-  left: 0px !important;
+  left: 10px !important;
   top: 0px;
   height: 100%;
   width: 100%;

+ 1 - 1
src/utils/request.js

xqd
@@ -101,7 +101,7 @@ service.interceptors.response.use(
     //   return res
     // }
 		if(res.type==="application/x-zip-compressed" ||
-       res.type==="application/vnd.ms-excel"){
+       res.type==="application/vnd.ms-excel"||res.type === 'application/json'){
 			return response
 		}else if(res.code != 200){
 			Message({

+ 3 - 1
src/views/contracts/detail.vue

xqd xqd
@@ -313,7 +313,7 @@ export default {
       contract: {},
       currentPage: 1,
       multipleSelection: [],
-      pagesize: 11,
+      pagesize: 100,
       form: "",
       invoicePicList: [],
       picList: [],
@@ -448,6 +448,8 @@ export default {
       this.temporaryList = this.srcList;
     },
 
+
+
     /* 批量导出 */
     handleAll(data) {
       this.exportExcelData1.push(data);

+ 8 - 5
src/views/contracts/index.vue

xqd xqd xqd xqd
@@ -350,7 +350,7 @@ export default {
       },
       value2: "",
       exportExcelData1: [], //导出列表缓存数据整页
-      exportExcelData2:[],//导出列表缓存数据单选
+      exportExcelData2: [], //导出列表缓存数据单选
     };
   },
   mounted() {
@@ -667,8 +667,9 @@ export default {
     /* 批量导出数据 */
     handleSelectionChange(data) {
       this.exportExcelData1.push(data);
-            this.exportExcelData2 = [...new Set( this.exportExcelData1.flat(Infinity))];
-
+      this.exportExcelData2 = [
+        ...new Set(this.exportExcelData1.flat(Infinity)),
+      ];
     },
     handleAll(data) {
       this.exportExcelData1.push(data);
@@ -676,7 +677,9 @@ export default {
 
     /* 批量导出合同列表 */
     batchExports() {
-      this.exportExcel =[...new Set(this.exportExcelData1.flat(Infinity))]||this.exportExcelData2;
+      this.exportExcel =
+        [...new Set(this.exportExcelData1.flat(Infinity))] ||
+        this.exportExcelData2;
       if (this.exportExcel == "") {
         this.$message({
           type: "warning",
@@ -728,7 +731,7 @@ export default {
         draftStatus: "",
         supplierId: "",
       };
-      contractsPageApi({ data }).then((res) => {
+      contractsPageApi({ ...data }).then((res) => {
         const { result } = res.data;
         this.exportExcel = result;
       });

+ 76 - 64
src/views/databackup/index.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -51,7 +51,7 @@
       >
         <el-button type="primary" @click="Exports">全部导出</el-button>
         <el-button type="primary" @click="batchExports">批量导出</el-button>
-        <el-button type="primary">下载</el-button>
+        <el-button type="primary" @click="downLoadSql">下载</el-button>
         <el-button type="danger" @click="moreDelete">删除</el-button>
       </div>
     </el-row>
@@ -138,15 +138,18 @@
       </el-button>
     </div>
 
-    <!--修改出票人弹窗 -->
-    <el-dialog title="修改出票人" :visible.sync="dialogVisible" width="500px">
-      <el-form ref="form"  label-width="80px">
-        <el-form-item label="备注" >
-          <el-input  style="width: 100%"></el-input>
+    <!--修改备注弹窗 -->
+    <el-dialog title="修改备注" :visible.sync="dialogVisible" width="500px">
+      <el-form ref="form" :model="tableData" label-width="80px">      
+        <el-form-item label="文件名称">
+          <el-input v-model="tableData.fileName" style="width: 100%"></el-input>
+        </el-form-item>
+        <el-form-item label="备注">
+          <el-input v-model="tableData.remark" style="width: 100%"></el-input>
         </el-form-item>
         <el-form-item>
           <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" >提交修改</el-button>
+          <el-button type="primary" @click="submitDelete(tableData.fileName)">提交修改</el-button>
         </el-form-item>
       </el-form>
     </el-dialog>
@@ -228,6 +231,7 @@ export default {
       value2: "",
       exportExcelData1: [], //导出列表缓存数据整页
       exportExcelData2:[],//导出列表缓存数据单选
+      multipleSelection:[],//下载sql文件数据
     };
   },
 
@@ -243,7 +247,6 @@ export default {
       };
       getDatabase({ ...params, ...searchForm }).then((res) => {
         const { data } = res;
-        console.log(data);
         this.temporaryList = data.result;
         this.srcList = data.result;
         this.total = res.data.total;
@@ -312,67 +315,73 @@ export default {
 
     /* 下载数据备份 */
     download(fileName) {
-      window.open(
-        "https://ht.9026.com/api/Database/export?fileName=" + fileName
-      );
-      // this.$request({
-      // 	url:'/api/Database/export',
-      // 	method:'post',
-      // 	data:{
-      // 		fileName:fileName
-      // 	}
-      // }).then((res)=>{
-      // 	console.log(res)
-      // })
+      this.$request({
+      	url:'/api/Database/download',
+      	method:'post',
+      	data:{
+      		fileNameList:[fileName]
+      	}
+      }).then((res)=>{
+        window.open(res.data)
+      })
+    },
+
+    /* 下载多条数据备份 */
+    downLoadSql(){
+      let fileNameList = this.multipleSelection.map((item,value)=>{
+        return item.fileName
+      })
+      this.$request({
+      	url:'/api/Database/download',
+      	method:'post',
+      	data:{
+      		fileNameList
+      	}
+      }).then((res)=>{
+        window.open(res.data)
+      })
+      
+
     },
-    // recover(fileName) {
-    //   this.$request({
-    //     url: "/api/Database/restore",
-    //     method: "post",
-    //     headers: {
-    //       "Content-Type": "application/json",
-    //     },
-    //     data: {
-    //       fileName: fileName,
-    //     },
-    //   }).then((res) => {
-    //     console.log(res);
-    //     if (res.code == 200) {
-    //       this.$message({
-    //         type: "success",
-    //         message: "恢复成功",
-    //       });
-    //     } else {
-    //       this.$message({
-    //         type: "danger",
-    //         message: "恢复失败",
-    //       });
-    //     }
-    //   });
-    // },
 
     /* 修改备注 */
     modifyRemarks(fileName){
-      console.log(fileName);
-      // this.dialogVisible = true;
-      // let params ={
-      //   fileNameList:fileName
-      // }
-      // deletDatabase({...params}).then(res=>{
-      //   console.log(res);
-      // })
+      this.dialogVisible = true;
+      this.$request({
+        url:'/api/Database/backups',
+        method:'post',
+        data:{
+          fileName
+        }
+      }).then(res=>{
+        this.tableData = res.data.result[0]
+      })   
     },
-    // // 修改信息弹窗
-    // modify(id) {
+
+    /* 提交修改 */
+    submitDelete(){
+      this.$request({
+        url:'/api/Database/update',
+        method:'post',
+        data:this.tableData
+      }).then(res=>{
+        if(res.code === 200){
+          this.$message({
+            type:'success',
+            message:'修改成功'
+          })
+          this.getAllList()
+        }else{
+          this.$message({
+            type:'danger',
+            message:'修改失败'
+          })
+        }
+        
+      }) 
      
-    //   this.$request({
-    //     url: "/api/Drawer/" + id,
-    //     method: "get",
-    //   }).then((res) => {
-    //     this.tableData = res.data;
-    //     this.talbeData = this.$route.query.id;
-    //   });
-    // },
+    },
+   
 
     deleted(fileName) {
       this.$request({
@@ -423,11 +432,14 @@ export default {
 
     /* 批量导出 */
     handleSelectionChange(data) {
+      this.multipleSelection = data
+      console.log(this.multipleSelection);
        this.exportExcelData1.push(data);
       this.exportExcelData2 = [...new Set( this.exportExcelData1.flat(Infinity))];
       
     },
     handleAll(data) {
+      this.multipleSelection = data
       this.exportExcelData1.push(data);
     },
     /* 批量导出数据 */
@@ -476,7 +488,7 @@ export default {
         fileName: "",
         
       };
-      getDatabase({ data }).then((res) => {
+      getDatabase({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });

+ 1 - 1
src/views/delivery/index.vue

xqd
@@ -500,7 +500,7 @@ export default {
         legalPerson: "",
         isDeleted: "",
       };
-      getSupplierSearch({ data }).then((res) => {
+      getSupplierSearch({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });

+ 2 - 3
src/views/form/index.vue

xqd xqd xqd
@@ -169,7 +169,6 @@
 </template>
 
 <script>
-import { getList } from "@/api/table";
 import { dataConversionUtil } from "../../utils/Excel.js";
 import { getDrawerSearch } from "@/api/drawer";
 export default {
@@ -357,7 +356,7 @@ export default {
         method: "get",
       }).then((res) => {
         this.tableData = res.data;
-        this.talbeData = this.$route.query.id;
+        this.tableData = this.$route.query.id;
       });
     },
     // 修改信息弹窗提交
@@ -495,7 +494,7 @@ export default {
         name: "",
         status: "",
       };
-      getDrawerSearch({ data }).then((res) => {
+      getDrawerSearch({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });

+ 1 - 1
src/views/management/index.vue

xqd
@@ -524,7 +524,7 @@ export default {
         isDeleted: "",
         status: "",
       };
-      getAccountSearch({ data }).then((res) => {
+      getAccountSearch({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });

+ 1 - 1
src/views/sucuirtyaudit/annexList.vue

xqd
@@ -449,7 +449,7 @@ export default {
         operateUser: "",
         content: "",
       };
-      getAuditLogAttachmentsSearch({ data }).then((res) => {
+      getAuditLogAttachmentsSearch({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });

+ 2 - 2
src/views/sucuirtyaudit/index.vue

xqd xqd
@@ -238,7 +238,7 @@ export default {
         this.total = res.data.total;
       });
     },
-
+    /* 汇票附件查询 */
     todetail(id) {
       this.$router.push({ path: "/logdetail", query: { id: id } });
     },
@@ -349,7 +349,7 @@ export default {
         operateUser: "",
         content: "",
       };
-      getAuditLogSearch({ data }).then((res) => {
+      getAuditLogSearch({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });

+ 1 - 1
src/views/table/index.vue

xqd
@@ -598,7 +598,7 @@ export default {
         draftStatus: "",
         supplierId: "",
       };
-      getAcceptorSearch({ data }).then((res) => {
+      getAcceptorSearch({ ...data }).then((res) => {
         const { result } = res.data;
         this.multipleSelection = result;
       });