| xqd
@@ -100,10 +100,7 @@
|
|
|
v-model="item.expectDiscountDate"
|
|
|
type="date"
|
|
|
placeholder="选择日期"
|
|
|
- @change="
|
|
|
- changeE;
|
|
|
- xpectDiscountDate($event, index);
|
|
|
- "
|
|
|
+ @change="change(index,4)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<!-- 出票日期 -->
|
| xqd
@@ -113,6 +110,7 @@
|
|
|
type="date"
|
|
|
placeholder="选择日期"
|
|
|
class="ipwidth"
|
|
|
+ @change="change(index,2)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<!-- 承兑日期 -->
|
| xqd
@@ -131,6 +129,7 @@
|
|
|
v-model="item.expireDate"
|
|
|
type="date"
|
|
|
placeholder="选择日期"
|
|
|
+ @change="change(index,3)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
| xqd
@@ -151,7 +150,7 @@
|
|
|
class="ipwidth"
|
|
|
placeholder="请填写金额"
|
|
|
style="width: 220px"
|
|
|
- @input="getMoney" @blur="getMoneyIndex(index)"
|
|
|
+ @blur="getMoney(index)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<!-- 服务费 -->
|
| xqd
@@ -219,7 +218,6 @@
|
|
|
class="ipwidth"
|
|
|
placeholder="服务费率"
|
|
|
style="width: 220px"
|
|
|
- @input="inputServiceRate($event, index)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<!-- 利率 -->
|
| xqd
@@ -229,7 +227,6 @@
|
|
|
class="ipwidth"
|
|
|
placeholder="利率"
|
|
|
style="width: 220px"
|
|
|
- @input="inputInterestRate($event, index)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
| xqd
@@ -317,22 +314,22 @@ export default {
|
|
|
/* 汇票的数据 */
|
|
|
contractDrafts: [
|
|
|
{
|
|
|
- name: "",
|
|
|
- draftNo: "",
|
|
|
- acceptorId: "",
|
|
|
- drawersId: "",
|
|
|
- money: "",
|
|
|
- acceptDate: "",
|
|
|
- loanLimit: "",
|
|
|
- serviceRate: "",
|
|
|
- serviceMoney: "",
|
|
|
- interestRate: "",
|
|
|
- interest: "",
|
|
|
+ name: "1",
|
|
|
+ draftNo: "1",
|
|
|
+ acceptorId: "1",
|
|
|
+ drawersId: "1",
|
|
|
+ money: "1",
|
|
|
+ acceptDate: "1",
|
|
|
+ loanLimit: "1",
|
|
|
+ serviceRate: "1",
|
|
|
+ serviceMoney: "1",
|
|
|
+ interestRate: "1",
|
|
|
+ interest: "1",
|
|
|
picUrls: [],
|
|
|
- expectDiscountDate: "",
|
|
|
- issueDate: "",
|
|
|
- expireDate: "",
|
|
|
- limitTime: "",
|
|
|
+ expectDiscountDate: "1",
|
|
|
+ issueDate: "1",
|
|
|
+ expireDate: "1",
|
|
|
+ limitTime: "1",
|
|
|
},
|
|
|
],
|
|
|
},
|
| xqd
@@ -413,6 +410,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ /* 调用获取当前的时间 */
|
|
|
+ this.loadTime()
|
|
|
},
|
|
|
methods: {
|
|
|
/* 确实上传按钮 */
|
| xqd
@@ -429,6 +429,29 @@ 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);
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
/* 合同附件上传 */
|
|
|
handlepics(res) {
|
|
|
// 解构
|
| xqd
@@ -450,7 +473,6 @@ export default {
|
|
|
},
|
|
|
|
|
|
/* 上传图片到浏览器成功回调 */
|
|
|
-
|
|
|
handlepicUrls(res) {
|
|
|
// 解构
|
|
|
const { file } = res.data;
|
| xqd
@@ -511,38 +533,51 @@ export default {
|
|
|
this.$message.error("至少一个");
|
|
|
}
|
|
|
},
|
|
|
- // 服务费率
|
|
|
- inputServiceRate(val, index) {
|
|
|
- console.log(val, index);
|
|
|
- },
|
|
|
- // 利率
|
|
|
- inputInterestRate(val, index) {
|
|
|
- console.log(val, index);
|
|
|
- },
|
|
|
- // 预计贴现日
|
|
|
- changeExpectDiscountDate(val, index) {
|
|
|
- console.log(val, index);
|
|
|
- },
|
|
|
- // 承兑日期
|
|
|
- changeIssueDate(val, index) {
|
|
|
- console.log(val, index);
|
|
|
- },
|
|
|
+
|
|
|
+ /* 计算时间段 */
|
|
|
+ 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)
|
|
|
+ // }
|
|
|
|
|
|
- /* 汇票的索引 */
|
|
|
- getMoneyIndex(index){
|
|
|
- this.myindex = index
|
|
|
- },
|
|
|
- change(index,number){
|
|
|
- console.log(index);
|
|
|
},
|
|
|
+
|
|
|
/* 获取金额 */
|
|
|
- getMoney(event,index) {
|
|
|
- this.form.contractDrafts[this.myindex].money = event
|
|
|
- this.getloanLimt(this.myindex)
|
|
|
- this.getSerMoney(this.myindex)
|
|
|
- this.getInterMoney(this.myindex)
|
|
|
+ getMoney(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
|