Selaa lähdekoodia

7.24 pdf文件处理

test 2 vuotta sitten
vanhempi
commit
75f9f2fc89
3 muutettua tiedostoa jossa 337 lisäystä ja 371 poistoa
  1. BIN
      src/assets/pdf.png
  2. 72 128
      src/views/contracts/billDetail.vue
  3. 265 243
      src/views/contracts/detail.vue

BIN
src/assets/pdf.png


+ 72 - 128
src/views/contracts/billDetail.vue

xqd xqd xqd xqd xqd
@@ -1,23 +1,5 @@
 <template>
   <div>
-<<<<<<< HEAD
-    <el-descriptions title="汇票详情" :column="3" :size="size" border style="margin: 10px;">
-      <el-descriptions-item label="汇票名">{{ list[0].name }}</el-descriptions-item>
-      <el-descriptions-item label="汇票编号">{{ list[0].draftNo }}</el-descriptions-item>
-	  <el-descriptions-item label="汇票状态">{{ list[0].draftStatusText }}</el-descriptions-item>
-      <el-descriptions-item label="承兑人">{{ list[0].acceptorName }}</el-descriptions-item>
-      <el-descriptions-item label="出票人">{{ list[0].drawersName }}</el-descriptions-item>
-      <el-descriptions-item label="金额">{{ list[0].money }}</el-descriptions-item>
-      <el-descriptions-item label="最高贷款额度">{{ list[0].loanLimit }}</el-descriptions-item>
-      <el-descriptions-item label="服务费率">{{ list[0].serviceRate }}</el-descriptions-item>
-      <el-descriptions-item label="服务费">{{ list[0].serviceMoney }}</el-descriptions-item>
-      <el-descriptions-item label="利率">{{ list[0].interestRate }}</el-descriptions-item>
-      <el-descriptions-item label="利息">{{ list[0].interest }}</el-descriptions-item>
-      <el-descriptions-item label="承兑日期">{{ list[0].acceptDate }}</el-descriptions-item>
-      <el-descriptions-item label="出票日期">{{ list[0].expireDate }}</el-descriptions-item>
-      <el-descriptions-item label="预计贴现日">{{ list[0].expectDiscountDate }}</el-descriptions-item>
-	  <el-descriptions-item label="到期日期">{{ list[0].issueDate }}</el-descriptions-item>
-=======
     <el-descriptions title="汇票详情">
       <el-descriptions-item label="汇票名">{{
         list[0].name
@@ -64,7 +46,6 @@
       <el-descriptions-item label="到期日期">{{
         list[0].issueDate
       }}</el-descriptions-item>
->>>>>>> 18dfccdac7c318704d3a5800a240bf145914718b
       <el-descriptions-item label="附件">
         <el-image
           style="width: 100px; height: 100px"
@@ -75,64 +56,24 @@
       <el-descriptions-item label="审核状态">{{
         list[0].statusText
       }}</el-descriptions-item>
-      <el-descriptions-item  label="审核反馈">{{
+      <el-descriptions-item label="审核反馈">{{
         list[0].feedback
       }}</el-descriptions-item>
-      <el-descriptions-item  label="反馈截图">
+      <el-descriptions-item label="反馈截图">
         <el-image
           style="width: 100px; height: 100px"
           :src="list[0].feedbackPicList"
-  
         />
       </el-descriptions-item>
     </el-descriptions>
-<<<<<<< HEAD
-	<div style="margin-left: 50px;">
-		<el-input
-		  v-permission="['admin']"
-		  v-model="feed.feedback"
-		  type="textarea"
-		  placeholder="请输入审核反馈内容"
-		  style="width: 200px;"
-		/>
-		<el-row v-permission="['admin']">
-		  <el-col style="margin:0 auto;">
-		    <div class="titlesa">
-		      <span>上传反馈截图</span>
-		    </div>
-		    <div>
-		      <el-upload
-		        accept=".pdf, .jpg, .jpeg, .png"
-		        action="#"
-		        :file-list="fileArr"
-		        list-type="picture-card"
-		        :show-file-list="true"
-		        :auto-upload="false"
-		        :before-upload="beforeUpload"
-		        :on-success="upSuccess"
-		        :on-error="upError"
-		        :on-change="imgPreview"
-		      >
-		
-		        <i class="el-icon-plus" />
-		      </el-upload>
-		      <el-dialog :visible.sync="dialogVisible">
-		        <img width="100%" :src="feed.feedbackPicList" alt="">
-		      </el-dialog>
-		    </div>
-		  </el-col>
-		</el-row>
-	</div>
-    
-=======
     <el-input
-      v-permission="['admin']"
       v-model="feed.feedback"
+      v-permission="['admin']"
       type="textarea"
       placeholder="请输入审核反馈内容"
       style="width: 200px"
     />
-    
+
     <el-row v-permission="['admin']">
       <el-col style="margin: 0 auto">
         <div class="titlesa">
@@ -147,19 +88,22 @@
             <i class="el-icon-plus" />
           </el-upload>
           <el-dialog :visible.sync="dialogVisible">
-            <img width="100%" :src="feed.feedbackPicList" />
+            <img width="100%" :src="feed.feedbackPicList">
           </el-dialog>
         </div>
       </el-col>
     </el-row>
->>>>>>> 18dfccdac7c318704d3a5800a240bf145914718b
     <div class="btn">
-      <el-button v-permission="['admin']" type="success" @click="success"
-        >审核成功</el-button
-      >
-      <el-button v-permission="['admin']" type="danger" @click="failed"
-        >审核失败</el-button
-      >
+      <el-button
+        v-permission="['admin']"
+        type="success"
+        @click="success"
+      >审核成功</el-button>
+      <el-button
+        v-permission="['admin']"
+        type="danger"
+        @click="failed"
+      >审核失败</el-button>
       <el-button type="primary" @click="back">返回</el-button>
     </div>
   </div>
@@ -170,101 +114,101 @@ export default {
   data() {
     return {
       dialogVisible: false,
-      role: "",
+      role: '',
       list: [],
-      checked: "",
+      checked: '',
       /* 审核反馈和审核截图的数据 */
       feedbackPicListArray: [],
       feed: {
-        feedback: "",
+        feedback: '',
         feedbackPicList: [],
-        id: "",
-        approveStatus: "",
-      },
-    };
+        id: '',
+        approveStatus: ''
+      }
+    }
   },
   mounted() {
-    this.feed.id = this.$route.query.id;
-    this.role = this.$store.state.user.userInfo.type;
-    this.getData();
+    this.feed.id = this.$route.query.id
+    this.role = this.$store.state.user.userInfo.type
+    this.getData()
   },
   methods: {
 
     /* 反馈图片图片上传成功 */
-    handleFeedbackPicList(res){
-      //解构
-      const { file } = res.data;
-      this.feedbackPicListArray.push(file);
-      this.feed.feedbackPicList = this.feedbackPicListArray;
+    handleFeedbackPicList(res) {
+      // 解构
+      const { file } = res.data
+      this.feedbackPicListArray.push(file)
+      this.feed.feedbackPicList = this.feedbackPicListArray
     },
     getData() {
-      const id = this.$route.query.id;
+      const id = this.$route.query.id
       this.$request({
-        url: "/api/Contract/contractDraft/" + id,
-        method: "get",
+        url: '/api/Contract/contractDraft/' + id,
+        method: 'get'
       }).then((res) => {
-        this.list.push(res.data);
-        console.log(this.list);
-      });
+        this.list.push(res.data)
+        console.log(this.list)
+      })
     },
 
     success() {
-        /* 反馈图片赋值 */
-      this.feed.feedbackPicList = this.picList;
+      /* 反馈图片赋值 */
+      this.feed.feedbackPicList = this.picList
       /* 合同id赋值 */
-      this.feed.id = this.$route.query.id;
-      this.feed.approveStatus = 1;
+      this.feed.id = this.$route.query.id
+      this.feed.approveStatus = 1
       this.$request({
-        url: "api/Contract/approveContractDraft",
-        method: "post",
-        data: this.feed,
+        url: 'api/Contract/approveContractDraft',
+        method: 'post',
+        data: this.feed
       }).then((res) => {
         if (res.code == 200) {
           this.$message({
-            type: "success",
-            message: "提交成功",
-          });
-          this.$router.go(0);
+            type: 'success',
+            message: '提交成功'
+          })
+          this.$router.go(0)
         } else {
           this.$message({
-            type: "success",
-            message: "提交失败",
-          });
-          this.$router.go(0);
+            type: 'success',
+            message: '提交失败'
+          })
+          this.$router.go(0)
         }
-      });
+      })
     },
     failed() {
-        /* 反馈图片赋值 */
-      this.feed.feedbackPicList = this.picList;
+      /* 反馈图片赋值 */
+      this.feed.feedbackPicList = this.picList
       /* 合同id赋值 */
-      this.feed.id = this.$route.query.id;
-      this.feed.approveStatus = 2;
+      this.feed.id = this.$route.query.id
+      this.feed.approveStatus = 2
       this.$request({
-        url: "api/Contract/approveContractDraft",
-        method: "post",
-        data: this.feed,
+        url: 'api/Contract/approveContractDraft',
+        method: 'post',
+        data: this.feed
       }).then((res) => {
         if (res.code == 200) {
           this.$message({
-            type: "success",
-            message: "提交成功",
-          });
-          this.$router.go(0);
+            type: 'success',
+            message: '提交成功'
+          })
+          this.$router.go(0)
         } else {
           this.$message({
-            type: "success",
-            message: "提交失败",
-          });
-          this.$router.go(0);
+            type: 'success',
+            message: '提交失败'
+          })
+          this.$router.go(0)
         }
-      });
+      })
     },
     back() {
-      this.$router.go(-1);
-    },
-  },
-};
+      this.$router.go(-1)
+    }
+  }
+}
 </script>
 
 <style lang="scss">

+ 265 - 243
src/views/contracts/detail.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -16,18 +16,21 @@
             <span class="titlename">合同附件</span>
             <div style="display: flex">
               <div class="imgbox">
-                <el-image
-                  v-for="(item, index) in picList"
-                  :key="index"
-                  style="width: 100px; height: 100px"
-                  :src="item"
-                />
-                <img
-                  v-for="(item, index) in picList"
-                  :key="index"
-                  style="width: 100px; height: 100px"
-                  :src="item"
-                />
+                <template v-for="(item, index) in picList">
+                  <el-image
+                    v-if="isPDF(item)"
+                    :key="index"
+                    style="width: 100px; height: 100px"
+                    :src="item"
+                    :preview-src-list="picList"
+                  />
+                  <a v-else :key="index" :href="item" target="_blank">
+                    <img
+                      style="width: 100px; height: 100px"
+                      :src="pdf"
+                    >
+                  </a>
+                </template>
               </div>
             </div>
           </div>
@@ -35,12 +38,21 @@
             <span class="titlename">发票附件</span>
             <div style="display: flex">
               <div class="imgbox">
-                <el-image
-                  v-for="(item, index) in invoicePicList"
-                  :key="index"
-                  style="width: 100px; height: 100px"
-                  :src="item"
-                />
+                <template v-for="(item, index) in invoicePicList">
+                  <el-image
+                    v-if="isPDF(item)"
+                    :key="index"
+                    style="width: 100px; height: 100px"
+                    :src="item"
+                    :preview-src-list="invoicePicList"
+                  />
+                  <a v-else :key="index" :href="item" target="_blank">
+                    <img
+                      style="width: 100px; height: 100px"
+                      :src="pdf"
+                    >
+                  </a>
+                </template>
               </div>
             </div>
           </div>
@@ -52,12 +64,21 @@
             <span class="titlename">贸易合同</span>
             <div style="display: flex">
               <div class="imgbox">
-                <el-image
-                  v-for="(item, index) in tradePicList"
-                  :key="index"
-                  style="width: 100px; height: 100px"
-                  :src="item"
-                />
+                <template v-for="(item, index) in tradePicList">
+                  <el-image
+                    v-if="isPDF(item)"
+                    :key="index"
+                    style="width: 100px; height: 100px"
+                    :src="item"
+                    :preview-src-list="tradePicList"
+                  />
+                  <a v-else :key="index" :href="item" target="_blank">
+                    <img
+                      style="width: 100px; height: 100px"
+                      :src="pdf"
+                    >
+                  </a>
+                </template>
               </div>
             </div>
           </div>
@@ -68,10 +89,8 @@
                 contract.contractStatusText
               }}</span>
             </div>
-            <span class="aoiisp"
-              >审核结果:
-              <p style="color: #d8ab5a">{{ contract.statusText }}</p></span
-            >
+            <span class="aoiisp">审核结果:
+              <p style="color: #d8ab5a">{{ contract.statusText }}</p></span>
           </div>
 
           <!-- 审核反馈和审核截图框  -->
@@ -96,44 +115,45 @@
                     <i class="el-icon-plus" />
                   </el-upload>
                   <el-dialog :visible.sync="dialogVisible">
-                    <img width="100%" :src="feed.feedbackPicList" />
+                    <img width="100%" :src="feed.feedbackPicList">
                   </el-dialog>
                 </div>
               </div>
             </el-col>
           </div>
           <div slot="" class="clearfix">
-            <el-button type="primary" style="float: right; margin-left: 10px"
-              >导出
+            <el-button
+              type="primary"
+              style="float: right; margin-left: 10px"
+            >导出
             </el-button>
             <el-button
               v-if="contract.contractStatus === 0"
               type="danger"
               style="float: right"
               @click="deletedContract"
-              >删除</el-button
-            >
+            >删除</el-button>
 
             <el-button
               v-if="contract.contractStatus === 1"
               type="primary"
               style="float: right"
               @click="recoverContract"
-              >恢复
+            >恢复
             </el-button>
             <el-button
               v-if="role === 1"
               type="warning"
               style="float: right"
               @click="failed"
-              >审核失败
+            >审核失败
             </el-button>
             <el-button
               v-if="role === 1"
               type="success"
               style="float: right"
               @click="success"
-              >审核成功
+            >审核成功
             </el-button>
           </div>
         </div>
@@ -186,47 +206,42 @@
               type="primary"
               style="cursor: pointer; margin-right: 15px"
               @click="tapDetail(scope.row.id)"
-              >查看详情</el-tag
-            >
+            >查看详情</el-tag>
             <el-tag
               v-if="scope.row.draftStatus == 1"
               type="success"
               style="margin-right: 15px; cursor: pointer"
               @click="recover(scope.row.id)"
-              >恢复</el-tag
-            >
+            >恢复</el-tag>
             <el-tag
               v-if="scope.row.draftStatus == 0"
               type="danger"
               style="margin-right: 15px; cursor: pointer"
               @click="deleted(scope.row.id)"
-              >删除</el-tag
-            >
+            >删除</el-tag>
           </template>
         </el-table-column>
       </el-table>
 
       <div class="pagesip">
         <el-button v-if="role === 2" type="primary" @click="addNewBill">
-          新增汇票</el-button
-        >
+          新增汇票</el-button>
         <el-button
           type="success"
           style="float: right"
           @click="recoverContractDraft"
-          >恢复
+        >恢复
         </el-button>
         <el-button
           type="danger"
           style="float: right"
           @click="deletedContractDraft"
-          >删除</el-button
-        >
+        >删除</el-button>
         <el-button
           type="primary"
           style="float: right; margin-left: 10px"
           @click="ExportsContractDraft"
-          >导出
+        >导出
         </el-button>
         <el-button
           type="primary"
@@ -237,7 +252,7 @@
             margin: 0 20px;
           "
           @click="jumpFirstPage"
-          >首页
+        >首页
         </el-button>
         <el-pagination
           ref="pagination"
@@ -259,7 +274,7 @@
             margin: 0 20px;
           "
           @click="jumpLastPage"
-          >尾页
+        >尾页
         </el-button>
         <el-button type="primary" size="small" @click="back">返回 </el-button>
       </div>
@@ -268,12 +283,13 @@
 </template>
 
 <script>
-import { dataConversionUtil } from "../../utils/Excel.js";
+import { dataConversionUtil } from '../../utils/Excel.js'
+import logo from '@/assets/pdf.png'
 export default {
   data() {
     return {
       dialogVisible: false,
-      role: "",
+      role: '',
       srcList: [],
       temporaryList: [],
       list: [],
@@ -282,109 +298,115 @@ export default {
       currentPage: 1,
       multipleSelection: [],
       pagesize: 11,
-      form: "",
+      form: '',
       invoicePicList: [],
       picList: [],
       tradePicList: [],
       feedbackPicListArray: [],
-
+      pdf: logo,
       /* 审核反馈和审核截图的数据 */
       feed: {
-        id: "",
-        feedback: "",
+        id: '',
+        feedback: '',
         feedbackPicList: [],
-        approveStatus: "",
-      },
-    };
+        approveStatus: ''
+      }
+    }
   },
 
   mounted() {
-    this.role = this.$store.state.user.userInfo.type;
-    console.log(this.$store.state.user.userInfo.type);
-    this.checked = this.$store.state.user.checked;
-    this.getData();
+    this.role = this.$store.state.user.userInfo.type
+    console.log(this.$store.state.user.userInfo.type)
+    this.checked = this.$store.state.user.checked
+    this.getData()
   },
   methods: {
     getData() {
-      const id = this.$route.query.id;
+      const id = this.$route.query.id
       this.$request({
-        url: "/api/Contract/" + id,
-        method: "get",
+        url: '/api/Contract/' + id,
+        method: 'get'
       }).then((res) => {
-        this.contract = res.data;
-        console.log(res);
-        console.log(this.contract.picList, "this.contract.picList");
+        this.contract = res.data
+        console.log(res)
+        console.log(this.contract.picList, 'this.contract.picList')
 
-        this.invoicePicList = this.contract.invoicePicList;
-        this.picList = this.contract.picList;
-        this.list = res.data.contractDraft.result;
-        this.feed.feedbackPicList = this.contract.feedbackPics;
-        this.tradePicList = this.contract.tradePicList;
-        this.feed.id = this.$route.query.id;
-        this.feed.feedback = this.contract.feedback;
-        this.getPageData();
-      });
+        this.invoicePicList = this.contract.invoicePicList
+        this.picList = this.contract.picList
+        this.list = res.data.contractDraft.result
+        this.feed.feedbackPicList = this.contract.feedbackPics
+        this.tradePicList = this.contract.tradePicList
+        this.feed.id = this.$route.query.id
+        this.feed.feedback = this.contract.feedback
+        this.getPageData()
+      })
+    },
+    isPDF(url) {
+      const fileType = ['pdf']
+      const index = url.lastIndexOf('.')
+      const type = url.substr(index + 1)
+      return fileType.indexOf(type) === -1
     },
     addNewBill() {
       this.$router.push({
-        name: "addnewbill",
-      });
+        name: 'addnewbill'
+      })
     },
     tapDetail(id) {
       this.$router.push({
-        name: "billDetail",
+        name: 'billDetail',
         query: {
-          id: id,
-        },
-      });
+          id: id
+        }
+      })
     },
     handleAll(data) {
-      this.multipleSelection = data;
-      console.log(this.multipleSelection);
+      this.multipleSelection = data
+      console.log(this.multipleSelection)
     },
     handleSelectionChange(data) {
-      this.multipleSelection = data;
-      console.log(this.multipleSelection);
+      this.multipleSelection = data
+      console.log(this.multipleSelection)
     },
     handleCurrentChange(val) {
-      this.currentPage = val;
-      this.getPageData();
+      this.currentPage = val
+      this.getPageData()
     },
     jumpFirstPage() {
-      this.$refs.pagination.handleCurrentChange(1);
-      this.$emit("handleCurrentChange", 1);
+      this.$refs.pagination.handleCurrentChange(1)
+      this.$emit('handleCurrentChange', 1)
     },
     jumpLastPage() {
-      const font = this.$refs.pagination;
-      const cpage = Math.ceil(font.total / font.pageSize);
-      font.handleCurrentChange(cpage);
+      const font = this.$refs.pagination
+      const cpage = Math.ceil(font.total / font.pageSize)
+      font.handleCurrentChange(cpage)
     },
     getPageData() {
-      const start = (this.currentPage - 1) * this.pagesize;
-      const end = start + this.pagesize;
-      this.srcList = this.list.slice(start, end);
-      this.temporaryList = this.srcList;
+      const start = (this.currentPage - 1) * this.pagesize
+      const end = start + this.pagesize
+      this.srcList = this.list.slice(start, end)
+      this.temporaryList = this.srcList
     },
     ExportsContractDraft() {
-      if (this.multipleSelection === "") {
+      if (this.multipleSelection === '') {
         this.$message({
-          type: "warning",
-          message: "请选择数据!",
-        });
+          type: 'warning',
+          message: '请选择数据!'
+        })
       } else {
         var tableHeader = [
           [
-            "序号",
-            "汇票名称",
-            "汇票编号",
-            "承兑人",
-            "金额",
-            "服务费",
-            "汇票状态",
-            "审核状态",
-          ],
-        ];
-        var dataList = [];
+            '序号',
+            '汇票名称',
+            '汇票编号',
+            '承兑人',
+            '金额',
+            '服务费',
+            '汇票状态',
+            '审核状态'
+          ]
+        ]
+        var dataList = []
         this.multipleSelection.forEach((item, index) => {
           dataList.push([
             index + 1,
@@ -394,231 +416,231 @@ export default {
             item.money,
             item.serviceMoney,
             item.draftStatusText,
-            item.statusText,
-          ]);
-        });
-        dataConversionUtil.dataToExcel("汇票列表", tableHeader, dataList);
-        this.$message.success("导出成功!");
+            item.statusText
+          ])
+        })
+        dataConversionUtil.dataToExcel('汇票列表', tableHeader, dataList)
+        this.$message.success('导出成功!')
       }
     },
 
     /* 反馈图片图片上传成功 */
-    handleFeedbackPicList(res){
-      //解构
-      const { file } = res.data;
-      this.feedbackPicListArray.push(file);
-      this.feed.feedbackPicList = this.feedbackPicListArray;
+    handleFeedbackPicList(res) {
+      // 解构
+      const { file } = res.data
+      this.feedbackPicListArray.push(file)
+      this.feed.feedbackPicList = this.feedbackPicListArray
     },
 
-    /*审核成功发送请求  */
+    /* 审核成功发送请求  */
     success() {
       /* 反馈图片赋值 */
-      this.feed.feedbackPicList = this.picList;
+      this.feed.feedbackPicList = this.picList
       /* 合同id赋值 */
-      this.feed.id = this.$route.query.id;
+      this.feed.id = this.$route.query.id
       /* 反馈内容赋值 */
-      this.feed.approveStatus = 1;
+      this.feed.approveStatus = 1
       this.$request({
-        url: "/api/Contract/approveContract",
-        method: "post",
-        data: this.feed,
+        url: '/api/Contract/approveContract',
+        method: 'post',
+        data: this.feed
       }).then((res) => {
         if (res.code === 200) {
           this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
+            type: 'success',
+            message: res.msg
+          })
+          this.getData()
         } else {
           this.$message({
-            type: "error",
-            message: "提交失败",
-          });
-          this.getData();
+            type: 'error',
+            message: '提交失败'
+          })
+          this.getData()
         }
-      });
+      })
     },
 
-    /*审核失败发送请求  */
+    /* 审核失败发送请求  */
     failed() {
-       /* 反馈图片赋值 */
-      this.feed.feedbackPicList = this.picList;
+      /* 反馈图片赋值 */
+      this.feed.feedbackPicList = this.picList
       /* 合同id赋值 */
-      this.feed.id = this.$route.query.id;
-      this.feed.approveStatus = 2;
+      this.feed.id = this.$route.query.id
+      this.feed.approveStatus = 2
       this.$request({
-        url: "/api/Contract/approveContract",
-        method: "post",
-        data: this.feed,
+        url: '/api/Contract/approveContract',
+        method: 'post',
+        data: this.feed
       }).then((res) => {
         if (res.code === 200) {
           this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
+            type: 'success',
+            message: res.msg
+          })
+          this.getData()
         } else {
           this.$message({
-            type: "error",
-            message: "提交失败",
-          });
-          this.getData();
+            type: 'error',
+            message: '提交失败'
+          })
+          this.getData()
         }
-      });
+      })
     },
     recoverContract() {
-      const id = this.$route.query.id;
+      const id = this.$route.query.id
       this.$request({
-        url: "/api/Contract/manage",
-        method: "post",
+        url: '/api/Contract/manage',
+        method: 'post',
         data: {
           ids: [id],
-          operateType: 2,
-        },
+          operateType: 2
+        }
       }).then((res) => {
         if (res.code === 200) {
           this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
+            type: 'success',
+            message: res.msg
+          })
+          this.getData()
         } else {
           this.$message({
-            type: "error",
-            message: "提交失败",
-          });
-          this.getData();
+            type: 'error',
+            message: '提交失败'
+          })
+          this.getData()
         }
-      });
+      })
     },
     deletedContract() {
-      const id = this.$route.query.id;
+      const id = this.$route.query.id
       this.$request({
-        url: "/api/Contract/manage",
-        method: "post",
+        url: '/api/Contract/manage',
+        method: 'post',
         data: {
           ids: [id],
-          operateType: 1,
-        },
+          operateType: 1
+        }
       }).then((res) => {
         if (res.code === 200) {
           this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
+            type: 'success',
+            message: res.msg
+          })
+          this.getData()
         } else {
           this.$message({
-            type: "error",
-            message: "提交失败",
-          });
-          this.getData();
+            type: 'error',
+            message: '提交失败'
+          })
+          this.getData()
         }
-      });
+      })
     },
     recoverContractDraft() {
-      const ids = Array.from(this.multipleSelection, ({ id }) => id);
+      const ids = Array.from(this.multipleSelection, ({ id }) => id)
       this.$request({
-        url: "/api/Contract/contractDraft/manager",
-        method: "post",
+        url: '/api/Contract/contractDraft/manager',
+        method: 'post',
         data: {
           ids: ids,
-          operateType: 2,
-        },
+          operateType: 2
+        }
       }).then((res) => {
         if (res.code === 200) {
           this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
+            type: 'success',
+            message: res.msg
+          })
+          this.getData()
         } else {
           this.$message({
-            type: "error",
-            message: "提交失败",
-          });
-          this.getData();
+            type: 'error',
+            message: '提交失败'
+          })
+          this.getData()
         }
-      });
+      })
     },
     deletedContractDraft() {
-      const ids = Array.from(this.multipleSelection, ({ id }) => id);
+      const ids = Array.from(this.multipleSelection, ({ id }) => id)
       this.$request({
-        url: "/api/Contract/contractDraft/manager",
-        method: "post",
+        url: '/api/Contract/contractDraft/manager',
+        method: 'post',
         data: {
           ids: ids,
-          operateType: 1,
-        },
+          operateType: 1
+        }
       }).then((res) => {
         if (res.code === 200) {
           this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
+            type: 'success',
+            message: res.msg
+          })
+          this.getData()
         } else {
           this.$message({
-            type: "error",
-            message: "提交失败",
-          });
-          this.getData();
+            type: 'error',
+            message: '提交失败'
+          })
+          this.getData()
         }
-      });
+      })
     },
     recover(id) {
       this.$request({
-        url: "/api/Contract/contractDraft/manager",
-        method: "post",
+        url: '/api/Contract/contractDraft/manager',
+        method: 'post',
         data: {
           ids: [id],
-          operateType: 2,
-        },
+          operateType: 2
+        }
       }).then((res) => {
         if (res.code === 200) {
           this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
+            type: 'success',
+            message: res.msg
+          })
+          this.getData()
         } else {
           this.$message({
-            type: "error",
-            message: "提交失败",
-          });
-          this.getData();
+            type: 'error',
+            message: '提交失败'
+          })
+          this.getData()
         }
-      });
+      })
     },
     deleted(id) {
       this.$request({
-        url: "/api/Contract/contractDraft/manager",
-        method: "post",
+        url: '/api/Contract/contractDraft/manager',
+        method: 'post',
         data: {
           ids: [id],
-          operateType: 1,
-        },
+          operateType: 1
+        }
       }).then((res) => {
         if (res.code === 200) {
           this.$message({
-            type: "success",
-            message: res.msg,
-          });
-          this.getData();
+            type: 'success',
+            message: res.msg
+          })
+          this.getData()
         } else {
           this.$message({
-            type: "error",
-            message: "提交失败",
-          });
-          this.getData();
+            type: 'error',
+            message: '提交失败'
+          })
+          this.getData()
         }
-      });
+      })
     },
     back() {
-      this.$router.go(-1);
-    },
-  },
-};
+      this.$router.go(-1)
+    }
+  }
+}
 </script>
 
 <style lang="scss">