Prechádzať zdrojové kódy

项目日志:7.27

gubai 2 rokov pred
rodič
commit
18dfccdac7

+ 149 - 94
src/views/contracts/billDetail.vue

xqd xqd
@@ -1,28 +1,70 @@
 <template>
   <div>
     <el-descriptions title="汇票详情">
-      <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-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-item label="附件">
-        <el-image style="width: 100px; height: 100px" :src="list[0].picList" :preview-src-list="list[0].picList" />
+        <el-image
+          style="width: 100px; height: 100px"
+          :src="list[0].picList"
+          :preview-src-list="list[0].picList"
+        />
       </el-descriptions-item>
-      <el-descriptions-item label="审核状态">{{ list[0].statusText }}</el-descriptions-item>
-      <el-descriptions-item v-if="role===2" label="审核反馈">{{ list[0].feedback }}</el-descriptions-item>
-      <el-descriptions-item v-if="role===2" label="反馈截图">
-        <el-image  style="width: 100px; height: 100px" :src="list[0].feedbackPicList" :preview-src-list="list[0].picList" />
+      <el-descriptions-item label="审核状态">{{
+        list[0].statusText
+      }}</el-descriptions-item>
+      <el-descriptions-item  label="审核反馈">{{
+        list[0].feedback
+      }}</el-descriptions-item>
+      <el-descriptions-item  label="反馈截图">
+        <el-image
+          style="width: 100px; height: 100px"
+          :src="list[0].feedbackPicList"
+  
+        />
       </el-descriptions-item>
     </el-descriptions>
     <el-input
@@ -30,132 +72,145 @@
       v-model="feed.feedback"
       type="textarea"
       placeholder="请输入审核反馈内容"
-      style="width: 200px;"
+      style="width: 200px"
     />
+    
     <el-row v-permission="['admin']">
-      <el-col style="margin:0 auto;">
+      <el-col style="margin: 0 auto">
         <div class="titlesa">
           <span>上传反馈截图</span>
         </div>
         <div>
           <el-upload
-            accept=".pdf, .jpg, .jpeg, .png"
-            action="#"
-            :file-list="fileArr"
+            action="https://ht.9026.com/api/File"
             list-type="picture-card"
-            :show-file-list="true"
-            :auto-upload="false"
-            :before-upload="beforeUpload"
-            :on-success="upSuccess"
-            :on-error="upError"
-            :on-change="imgPreview"
+            :on-success="handleFeedbackPicList"
           >
-
             <i class="el-icon-plus" />
           </el-upload>
           <el-dialog :visible.sync="dialogVisible">
-            <img width="100%" :src="feed.feedbackPicList" alt="">
+            <img width="100%" :src="feed.feedbackPicList" />
           </el-dialog>
         </div>
       </el-col>
     </el-row>
     <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>
-
 </template>
 
 <script>
 export default {
   data() {
     return {
-	  role:'',
+      dialogVisible: false,
+      role: "",
       list: [],
-      checked: '',
+      checked: "",
+      /* 审核反馈和审核截图的数据 */
+      feedbackPicListArray: [],
       feed: {
-        feedback: '',
-        feedbackPicList: [
-          
-        ],
-        id: '',
-        approveStatus: ''
-      }
-
-    }
+        feedback: "",
+        feedbackPicList: [],
+        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: {
-		getData(){
-			const id = this.$route.query.id
-			this.$request({
-			  url: '/api/Contract/contractDraft/' + id,
-			  method: 'get'
-			}).then((res) => {
-			  this.list.push(res.data)
-			  console.log(this.list)
-			})
-		},
+
+    /* 反馈图片图片上传成功 */
+    handleFeedbackPicList(res){
+      //解构
+      const { file } = res.data;
+      this.feedbackPicListArray.push(file);
+      this.feed.feedbackPicList = this.feedbackPicListArray;
+    },
+    getData() {
+      const id = this.$route.query.id;
+      this.$request({
+        url: "/api/Contract/contractDraft/" + id,
+        method: "get",
+      }).then((res) => {
+        this.list.push(res.data);
+        console.log(this.list);
+      });
+    },
+
     success() {
-      this.feed.approveStatus = 1
+        /* 反馈图片赋值 */
+      this.feed.feedbackPicList = this.picList;
+      /* 合同id赋值 */
+      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.approveStatus = 2
+        /* 反馈图片赋值 */
+      this.feed.feedbackPicList = this.picList;
+      /* 合同id赋值 */
+      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">
-	.btn{
-		display: flex;
-		// justify-content: space-around;
-	}
+.btn {
+  display: flex;
+  // justify-content: space-around;
+}
 </style>

+ 391 - 309
src/views/contracts/detail.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -2,8 +2,8 @@
   <div>
     <el-card class="box-card">
       <el-col :xs="24" :sm="24" :md="10" :lg="10" :xl="12">
-        <div class="grid-content bg-purple ">
-          <span style="font-weight: 600;">合同基础信息</span>
+        <div class="grid-content bg-purple">
+          <span style="font-weight: 600">合同基础信息</span>
           <div class="titlein">
             <span class="titlename">合同名称</span>
             <span class="meatatitle">{{ contract.name }}</span>
@@ -14,29 +14,29 @@
           </div>
           <div class="titlein">
             <span class="titlename">合同附件</span>
-            <div style="display: flex;">
+            <div style="display: flex">
               <div class="imgbox">
                 <el-image
-                  v-for="(item,index) in picList"
+                  v-for="(item, index) in picList"
                   :key="index"
                   style="width: 100px; height: 100px"
                   :src="item"
                 />
                 <img
-                  v-for="(item,index) in picList"
+                  v-for="(item, index) in picList"
                   :key="index"
                   style="width: 100px; height: 100px"
                   :src="item"
-                >
+                />
               </div>
             </div>
           </div>
           <div class="titlein">
             <span class="titlename">发票附件</span>
-            <div style="display: flex;">
+            <div style="display: flex">
               <div class="imgbox">
                 <el-image
-                  v-for="(item,index) in invoicePicList"
+                  v-for="(item, index) in invoicePicList"
                   :key="index"
                   style="width: 100px; height: 100px"
                   :src="item"
@@ -44,17 +44,16 @@
               </div>
             </div>
           </div>
-
         </div>
       </el-col>
       <el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="12">
         <div class="jas">
           <div class="titlein jas">
             <span class="titlename">贸易合同</span>
-            <div style="display: flex;">
+            <div style="display: flex">
               <div class="imgbox">
                 <el-image
-                  v-for="(item,index) in tradePicList"
+                  v-for="(item, index) in tradePicList"
                   :key="index"
                   style="width: 100px; height: 100px"
                   :src="item"
@@ -64,11 +63,18 @@
           </div>
           <div class="yusa jas">
             <div class="boxas">
-              <span style="color: #fff;">合同状态:</span>
-              <span style="color: #D05C39;">{{ contract.contractStatusText }}</span>
+              <span style="color: #fff">合同状态:</span>
+              <span style="color: #d05c39">{{
+                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>
+
+          <!-- 审核反馈和审核截图框  -->
           <div class="yusa">
             <el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="10" class="jas">
               <el-form ref="form" :model="feed" label-width="0px">
@@ -76,43 +82,58 @@
                 <el-form-item label="">
                   <el-input v-model="feed.feedback" type="textarea" />
                 </el-form-item>
-
               </el-form>
             </el-col>
             <el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="14" class="jas">
               <span class="sah">审核截图:</span>
-              <div style="display: flex;justify-content: flex-end;">
+              <div style="display: flex; justify-content: flex-end">
                 <div class="imgbox">
-                  <el-image
-                    v-for="(item,index) in feed.feedbackPicList"
-                    :key="index"
-                    style="width: 100px; height: 100px"
-                    :src="item"
-                  />
+                  <el-upload
+                    action="https://ht.9026.com/api/File"
+                    list-type="picture-card"
+                    :on-success="handleFeedbackPicList"
+                  >
+                    <i class="el-icon-plus" />
+                  </el-upload>
+                  <el-dialog :visible.sync="dialogVisible">
+                    <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"
+              v-if="contract.contractStatus === 0"
               type="danger"
-              style="float: right; "
+              style="float: right"
               @click="deletedContract"
-            >删除</el-button>
+              >删除</el-button
+            >
 
             <el-button
-              v-if="contract.contractStatus===1"
+              v-if="contract.contractStatus === 1"
               type="primary"
-              style="float: right; "
+              style="float: right"
               @click="recoverContract"
-            >恢复
+              >恢复
             </el-button>
-            <el-button v-if="role===1" type="warning" style="float: right; " @click="failed">审核失败
+            <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
+              v-if="role === 1"
+              type="success"
+              style="float: right"
+              @click="success"
+              >审核成功
             </el-button>
           </div>
         </div>
@@ -144,49 +165,79 @@
             {{ scope.row.serviceMoney }}
           </template>
         </el-table-column>
-        <el-table-column label="汇票状态" align="center" prop="draftStatusText" />
+        <el-table-column
+          label="汇票状态"
+          align="center"
+          prop="draftStatusText"
+        />
         <el-table-column label="审核状态" align="center">
           <template slot-scope="scope">
             {{ scope.row.statusText }}
           </template>
         </el-table-column>
-        <el-table-column align="center" prop="created_at" label="操作" width="250">
+        <el-table-column
+          align="center"
+          prop="created_at"
+          label="操作"
+          width="250"
+        >
           <template slot-scope="scope">
             <el-tag
               type="primary"
-              style="cursor: pointer;margin-right: 15px;"
+              style="cursor: pointer; margin-right: 15px"
               @click="tapDetail(scope.row.id)"
-            >查看详情</el-tag>
+              >查看详情</el-tag
+            >
             <el-tag
-              v-if="(scope.row.draftStatus==1)"
+              v-if="scope.row.draftStatus == 1"
               type="success"
-              style="margin-right: 15px;cursor: pointer;"
+              style="margin-right: 15px; cursor: pointer"
               @click="recover(scope.row.id)"
-            >恢复</el-tag>
+              >恢复</el-tag
+            >
             <el-tag
-              v-if="(scope.row.draftStatus==0)"
+              v-if="scope.row.draftStatus == 0"
               type="danger"
-              style="margin-right: 15px;cursor: pointer;"
+              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 type="success" style="float: right; " @click="recoverContractDraft">恢复
+        <el-button v-if="role === 2" type="primary" @click="addNewBill">
+          新增汇票</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 type="primary" style="float: right; margin-left: 10px;" @click="ExportsContractDraft">导出
+        <el-button
+          type="danger"
+          style="float: right"
+          @click="deletedContractDraft"
+          >删除</el-button
+        >
+        <el-button
+          type="primary"
+          style="float: right; margin-left: 10px"
+          @click="ExportsContractDraft"
+          >导出
         </el-button>
         <el-button
           type="primary"
           size="small"
-          style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px"
+          style="
+            background-color: #d8ab5a;
+            border-color: #d8ab5a;
+            margin: 0 20px;
+          "
           @click="jumpFirstPage"
-        >首页
+          >首页
         </el-button>
         <el-pagination
           ref="pagination"
@@ -202,27 +253,27 @@
         <el-button
           type="primary"
           size="small"
-          style="background-color: #d8ab5a; border-color: #d8ab5a; margin: 0 20px"
+          style="
+            background-color: #d8ab5a;
+            border-color: #d8ab5a;
+            margin: 0 20px;
+          "
           @click="jumpLastPage"
-        >尾页
-        </el-button>
-        <el-button type="primary" size="small" @click="back">返回
+          >尾页
         </el-button>
+        <el-button type="primary" size="small" @click="back">返回 </el-button>
       </div>
-
     </el-card>
   </div>
-
 </template>
 
 <script>
-import {
-  dataConversionUtil
-} from '../../utils/Excel.js'
+import { dataConversionUtil } from "../../utils/Excel.js";
 export default {
   data() {
     return {
-      role: '',
+      dialogVisible: false,
+      role: "",
       srcList: [],
       temporaryList: [],
       list: [],
@@ -231,400 +282,431 @@ export default {
       currentPage: 1,
       multipleSelection: [],
       pagesize: 11,
-      form: '',
+      form: "",
       invoicePicList: [],
       picList: [],
       tradePicList: [],
+      feedbackPicListArray: [],
+
+      /* 审核反馈和审核截图的数据 */
       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();
+      });
     },
     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, item.name, item.draftNo, item.acceptorName, item.money, item
-            .serviceMoney, item
-            .draftStatusText, item.statusText
-          ])
-        })
-        dataConversionUtil.dataToExcel('汇票列表', tableHeader, dataList)
-        this.$message.success('导出成功!')
+          dataList.push([
+            index + 1,
+            item.name,
+            item.draftNo,
+            item.acceptorName,
+            item.money,
+            item.serviceMoney,
+            item.draftStatusText,
+            item.statusText,
+          ]);
+        });
+        dataConversionUtil.dataToExcel("汇票列表", tableHeader, dataList);
+        this.$message.success("导出成功!");
       }
     },
+
+    /* 反馈图片图片上传成功 */
+    handleFeedbackPicList(res){
+      //解构
+      const { file } = res.data;
+      this.feedbackPicListArray.push(file);
+      this.feed.feedbackPicList = this.feedbackPicListArray;
+    },
+
+    /*审核成功发送请求  */
     success() {
-      // this.feed.feedbackPicList=this.picList
-      // this.feed.id=this.$route.query.id
-      this.feed.approveStatus = 1
+      /* 反馈图片赋值 */
+      this.feed.feedbackPicList = this.picList;
+      /* 合同id赋值 */
+      this.feed.id = this.$route.query.id;
+      /* 反馈内容赋值 */
+      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.approveStatus = 2
+       /* 反馈图片赋值 */
+      this.feed.feedbackPicList = this.picList;
+      /* 合同id赋值 */
+      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">
-	.box-card {
-		width: 98%;
-		margin: 0 auto;
-		margin-top: 10px;
-	}
-
-	.el-textarea__inner {
-		padding: 30px 0;
-	}
-
-	.imgbox {
-		margin-left: 15px;
-	}
+.box-card {
+  width: 98%;
+  margin: 0 auto;
+  margin-top: 10px;
+}
 
-	.titlein {
-		display: flex;
-		justify-content: space-between;
-		margin: 20px 0;
+.el-textarea__inner {
+  padding: 30px 0;
+}
 
-		.titlename {
-			color: #BEBDBB;
-		}
+.imgbox {
+  margin-left: 15px;
+}
 
-		.meatatitle {
-			color: #1F242A;
-		}
-	}
+.titlein {
+  display: flex;
+  justify-content: space-between;
+  margin: 20px 0;
 
-	.yusa {
-		display: flex;
+  .titlename {
+    color: #bebdbb;
+  }
 
-	}
+  .meatatitle {
+    color: #1f242a;
+  }
+}
 
-	.jas {
-		margin: 20px 20px;
-		margin-bottom: 0;
-	}
+.yusa {
+  display: flex;
+}
 
-	.sah {
-		display: block;
-		color: #68625B;
-		padding-bottom: 10px;
-	}
+.jas {
+  margin: 20px 20px;
+  margin-bottom: 0;
+}
 
-	.el-tag {
-		// font-size: 18px;
-	}
+.sah {
+  display: block;
+  color: #68625b;
+  padding-bottom: 10px;
+}
 
-	.grid-content {
-		margin: 15px 20px;
-	}
+.el-tag {
+  // font-size: 18px;
+}
 
-	.bors {
+.grid-content {
+  margin: 15px 20px;
+}
 
-		height: 100%;
-	}
+.bors {
+  height: 100%;
+}
 
-	.aoiisp {
-		margin-left: 20px;
-		display: flex;
-		align-items: center;
-	}
+.aoiisp {
+  margin-left: 20px;
+  display: flex;
+  align-items: center;
+}
 
-	.pagesip {
-		width: 100%;
-		margin: 20px auto;
-		display: flex;
-		// align-items: center;
-		justify-content: flex-end;
-	}
+.pagesip {
+  width: 100%;
+  margin: 20px auto;
+  display: flex;
+  // align-items: center;
+  justify-content: flex-end;
+}
 
-	.el-pagination.is-background .el-pager li:not(.disabled).active {
-		background-color: #D8AB5A;
-	}
+.el-pagination.is-background .el-pager li:not(.disabled).active {
+  background-color: #d8ab5a;
+}
 
-	.el-col {
-		margin-bottom: 20px;
-	}
+.el-col {
+  margin-bottom: 20px;
+}
 
-	.boxas {
-		font-size: 18px;
-		width: 211px;
-		height: 40px;
-		background: linear-gradient(to right, #FFE1AD, #D8AB5A);
-		box-shadow: 0 10px 20px 1px rgba(179, 116, 5, 0.2000);
-		border-radius: 0 26px 26px 0;
-		line-height: 40px;
-		text-align: center;
-	}
+.boxas {
+  font-size: 18px;
+  width: 211px;
+  height: 40px;
+  background: linear-gradient(to right, #ffe1ad, #d8ab5a);
+  box-shadow: 0 10px 20px 1px rgba(179, 116, 5, 0.2);
+  border-radius: 0 26px 26px 0;
+  line-height: 40px;
+  text-align: center;
+}
 </style>

+ 112 - 117
src/views/contracts/new_file.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -100,7 +100,7 @@
             v-model="item.expectDiscountDate"
             type="date"
             placeholder="选择日期"
-             @change="change(index,4)"
+            @change="change(index, 4)"
           />
         </el-form-item>
         <!-- 出票日期 -->
@@ -110,7 +110,7 @@
             type="date"
             placeholder="选择日期"
             class="ipwidth"
-             @change="change(index,2)"
+            @change="change(index, 2)"
           />
         </el-form-item>
         <!-- 承兑日期 -->
@@ -119,8 +119,8 @@
             v-model="item.issueDate"
             type="date"
             placeholder="选择日期"
-           default-value
-            @change="change(index,1)"
+            default-value
+            @change="change(index, 1)"
           />
         </el-form-item>
         <!-- 到期日期 -->
@@ -129,7 +129,7 @@
             v-model="item.expireDate"
             type="date"
             placeholder="选择日期"
-             @change="change(index,3)"
+            @change="change(index, 3)"
           />
         </el-form-item>
       </el-form>
@@ -201,14 +201,15 @@
         </el-form-item>
         <!-- 承兑人 -->
         <el-form-item label="承兑人">
-          <el-select v-model="form.acceptorName" placeholder="请选择承兑人">
+          <el-select v-model="form.acceptorName" filterable placeholder="请选择承兑人">
             <el-option
               v-for="val in acceptorName"
               :label="val"
               :value="val"
+              :key="val"
               @click.native="getRate(index)"
-              :key="val.id"
-            />
+            >
+            </el-option>
           </el-select>
         </el-form-item>
         <!-- 服务费率 -->
@@ -314,22 +315,24 @@ export default {
         /* 汇票的数据 */
         contractDrafts: [
           {
-            name: "1",
-            draftNo: "1",
-            acceptorId: "1",
-            drawersId: "1",
-            money: "1",
-            acceptDate: "1",
-            loanLimit: "1",
-            serviceRate: "1",
-            serviceMoney: "1",
-            interestRate: "1",
-            interest: "1",
+            name: "",
+            draftNo: "",
+            acceptorId: "",
+            drawersId: "",
+            money: "",
+            acceptDate: "",
+            loanLimit: "",
+            serviceRate: "",
+            serviceMoney: "",
+            interestRate: "",
+            interest: "",
             picUrls: [],
-            expectDiscountDate: "1",
-            issueDate: "1",
-            expireDate: "1",
-            limitTime: "1",
+            expectDiscountDate: "",
+            issueDate: "",
+            expireDate: "",
+            limitTime: "",
+            acceptDateTime: "",
+            expectDiscountDateTime: "",
           },
         ],
       },
@@ -412,7 +415,7 @@ export default {
     });
 
     /* 调用获取当前的时间 */
-    this.loadTime()
+    this.loadTime();
   },
   methods: {
     /* 确实上传按钮 */
@@ -430,27 +433,32 @@ export default {
       });
     },
 
-
     /* 默认时间 */
     loadTime() {
-				let myDate = new Date()
-				let wk = parseInt(Date.now() / 100000).toFixed(0) * 100000
-				let yy = String(myDate.getFullYear())
-				// let mm = myDate.getMonth() + 1
-				let mm = String(myDate.getMonth() + 1 < 10 ? '0' + (myDate.getMonth() + 1) : myDate.getMonth() + 1)
-				let dd = String(myDate.getDate() < 10 ? '0' + myDate.getDate() : myDate.getDate())
-				let nowDate = yy + '-' + mm + '-' + dd
-				this.form.contractDrafts.forEach(item => {
-					item.acceptDate = nowDate
-					item.issueDate = nowDate
-					item.expireDate = nowDate
-					item.expectDiscountDate = nowDate
-					item.expectDiscountDateTime = wk
-					item.acceptDateTime = wk
-					let nTime = item.acceptDateTime - item.expectDiscountDateTime
-					item.limitTime = Math.floor(nTime / 86400000);
-				})
-			},
+      let myDate = new Date();
+      let wk = parseInt(Date.now() / 100000).toFixed(0) * 100000;
+      let yy = String(myDate.getFullYear());
+      // let mm = myDate.getMonth() + 1
+      let mm = String(
+        myDate.getMonth() + 1 < 10
+          ? "0" + (myDate.getMonth() + 1)
+          : myDate.getMonth() + 1
+      );
+      let dd = String(
+        myDate.getDate() < 10 ? "0" + myDate.getDate() : myDate.getDate()
+      );
+      let nowDate = yy + "-" + mm + "-" + dd;
+      this.form.contractDrafts.forEach((item) => {
+        item.acceptDate = nowDate;
+        item.issueDate = nowDate;
+        item.expireDate = nowDate;
+        item.expectDiscountDate = nowDate;
+        item.expectDiscountDateTime = wk;
+        item.acceptDateTime = wk;
+        let nTime = item.acceptDateTime - item.expectDiscountDateTime;
+        item.limitTime = Math.floor(nTime / 86400000);
+      });
+    },
 
     /* 合同附件上传 */
     handlepics(res) {
@@ -533,86 +541,73 @@ export default {
         this.$message.error("至少一个");
       }
     },
-   
-    /* 计算时间段 */
-    change(e,number){
-      // if (number == 1) {
-			// 		let ino = parseInt(e.value / 10000).toFixed(0) * 10000
-			// 		form[this.index].acceptDateTime = ino
-			// 		let nTime = form[this.index].acceptDateTime - form[this.index].expectDiscountDateTime
-			// 		let limitTime = Math.floor(nTime / 86400000)
-			// 		if (limitTime <= -1) {
-			// 			this.$toast('承兑日期应该大于预计贴现日')
-			// 			return
-			// 		}
-			// 		form[this.index].limitTime = limitTime
-			// 		form[this.index].acceptDate = timeFormat(e.value, 'yyyy-mm-dd')
-			// 		this.getloanLimt(this.index)
-			// 		this.getSerMoney(this.index)
-			// 		this.getInterMoney(this.index)
-			// 	} else if (this.opdanum == 2) {
 
-			// 		form[this.index].issueDate = timeFormat(e.value, 'yyyy-mm-dd')
-			// 	} else if (this.opdanum == 3) {
-			// 		form[this.index].expireDate = timeFormat(e.value, 'yyyy-mm-dd')
-			// 	} else if (this.opdanum == 4) {
-			// 		form[this.index].expectDiscountDateTime = e.value
-			// 		let nTime = form[this.index].acceptDateTime - form[this.index].expectDiscountDateTime
-			// 		let limitTime = Math.floor(nTime / 86400000)
-			// 		if (limitTime <= -1) {
-			// 			this.$toast('预计贴现日应该小于承兑日期')
-			// 			return
-			// 		}
-			// 		form[this.index].limitTime = limitTime
-			// 		form[this.index].expectDiscountDate = timeFormat(e.value, 'yyyy-mm-dd')
-			// 		this.getloanLimt(this.index)
-			// 		this.getSerMoney(this.index)
-			// 		this.getInterMoney(this.index)
-			// 	}
-
-    },
+    /* 计算时间段 */
+    change(e, number) {},
 
     /* 获取金额 */
     getMoney(index) {
-				this.getloanLimt(index)
-				this.getSerMoney(index)
-				this.getInterMoney(index)
+      this.getloanLimt(index);
+      this.getSerMoney(index);
+      this.getInterMoney(index);
     },
     /* 计算最高贷款额度 */
-   getloanLimt(i) {
-				if (this.form.contractDrafts[i].money && this.form.contractDrafts[i].serviceRate && this.form
-					.contractDrafts[i].interestRate) {
-					this.form.contractDrafts[i].loanLimit = ((this.form.contractDrafts[i].money / (this.form
-							.contractDrafts[
-								i].serviceRate + this.form.contractDrafts[i].interestRate) * this.form
-						.contractDrafts[i]
-						.limitTime / 360) + 1).toFixed(2)
-				}
-			},
-        /* 计算服务费 */
-			getSerMoney(i) {
-				if (this.form.contractDrafts[i].money && this.form.contractDrafts[i].serviceRate && this.form
-					.contractDrafts[i].interestRate) {
-					this.form.contractDrafts[i].serviceMoney = (((this.form.contractDrafts[i].money / (this.form
-								.contractDrafts[i].serviceRate + this.form.contractDrafts[i].interestRate) * this
-							.form
-							.contractDrafts[i].limitTime / 360) + 1) * this.form.contractDrafts[i].serviceRate * this
-						.form.contractDrafts[i].limitTime / 360).toFixed(2)
-				}
-			},
-        /*利息*/
-			getInterMoney(i) {
-				if (this.form.contractDrafts[i].money && this.form.contractDrafts[i].serviceRate && this.form
-					.contractDrafts[i].interestRate) {
-					this.form.contractDrafts[i].interest = (((this.form.contractDrafts[i].money / (this.form
-								.contractDrafts[
-									i].serviceRate + this.form.contractDrafts[i].interestRate) * this.form
-							.contractDrafts[
-								i].limitTime / 360) + 1) * this.form.contractDrafts[i].interestRate * this.form
-						.contractDrafts[i].limitTime / 360).toFixed(2)
-				}
-
-			},
+    getloanLimt(i) {
+      if (
+        this.form.contractDrafts[i].money &&
+        this.form.contractDrafts[i].serviceRate &&
+        this.form.contractDrafts[i].interestRate
+      ) {
+        this.form.contractDrafts[i].loanLimit = (
+          ((this.form.contractDrafts[i].money /
+            (this.form.contractDrafts[i].serviceRate +
+              this.form.contractDrafts[i].interestRate)) *
+            this.form.contractDrafts[i].limitTime) /
+            360 +
+          1
+        ).toFixed(2);
+      }
+    },
+    /* 计算服务费 */
+    getSerMoney(i) {
+      if (
+        this.form.contractDrafts[i].money &&
+        this.form.contractDrafts[i].serviceRate &&
+        this.form.contractDrafts[i].interestRate
+      ) {
+        this.form.contractDrafts[i].serviceMoney = (
+          ((((this.form.contractDrafts[i].money /
+            (this.form.contractDrafts[i].serviceRate +
+              this.form.contractDrafts[i].interestRate)) *
+            this.form.contractDrafts[i].limitTime) /
+            360 +
+            1) *
+            this.form.contractDrafts[i].serviceRate *
+            this.form.contractDrafts[i].limitTime) /
+          360
+        ).toFixed(2);
+      }
+    },
+    /*利息*/
+    getInterMoney(i) {
+      if (
+        this.form.contractDrafts[i].money &&
+        this.form.contractDrafts[i].serviceRate &&
+        this.form.contractDrafts[i].interestRate
+      ) {
+        this.form.contractDrafts[i].interest = (
+          ((((this.form.contractDrafts[i].money /
+            (this.form.contractDrafts[i].serviceRate +
+              this.form.contractDrafts[i].interestRate)) *
+            this.form.contractDrafts[i].limitTime) /
+            360 +
+            1) *
+            this.form.contractDrafts[i].interestRate *
+            this.form.contractDrafts[i].limitTime) /
+          360
+        ).toFixed(2);
+      }
+    },
   },
 };
 </script>