|
| xqd
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
- <!-- <view class="listitem">
|
|
|
+ <!-- <view class="listitem">
|
|
|
<text class="lys">合同名称</text>
|
|
|
<view class="inbox">
|
|
|
<input type="text" v-model="form.name" placeholder="请输入合同的名称" placeholder-style="color:#BEBDBB" />
|
|
| xqd
@@ -16,7 +16,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view> -->
|
|
|
-<!-- <view class="listitem">
|
|
|
+ <!-- <view class="listitem">
|
|
|
<view class="" style="display: flex;align-content: center;">
|
|
|
<text class="lys">合同附件</text>
|
|
|
<text
|
|
| xqd
@@ -67,22 +67,23 @@
|
|
|
<text class="lys">汇票号码</text>
|
|
|
<view class="inbox">
|
|
|
<input type="text" v-model="item.draftNo" placeholder="请输入汇票的号码"
|
|
|
- placeholder-style="color:#BEBDBB"/>
|
|
|
+ placeholder-style="color:#BEBDBB" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="listitem">
|
|
|
<text class="lys">承兑人</text>
|
|
|
- <view class="chosbox" @click="checkacptIndex(index)">
|
|
|
+ <view class="chosbox">
|
|
|
<uni-data-select v-model="item.acceptor" :localdata="range1" @change="changeacPerson"
|
|
|
- :showas="false" :plname="'搜索兑换人名称'" @search="searchAcceptor"></uni-data-select>
|
|
|
+ :showas="false" :plname="'搜索兑换人名称'" @search="searchAcceptor" :checklistIn="index"
|
|
|
+ @checkin="checkacptIndex" @clearall="clearValac"></uni-data-select>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
<view class="listitem">
|
|
|
<text class="lys">出票人</text>
|
|
|
- <view class="chosbox" @click="checkldrwIndex(index)">
|
|
|
+ <view class="chosbox">
|
|
|
<uni-data-select v-model="item.drawers" :localdata="range2" @change="changedrPerson"
|
|
|
- :plname="'搜索出票人名称'" @search="searchDrawers"></uni-data-select>
|
|
|
+ :plname="'搜索出票人名称'" @search="searchDrawers" :checklistIn="index" @checkin="checkldrwIndex"
|
|
|
+ @clearall="clearValdr"></uni-data-select>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="listitem">
|
|
| xqd
@@ -141,8 +142,8 @@
|
|
|
<text class="lys">服务费率</text>
|
|
|
<view class="inbox">
|
|
|
<input type="digit" v-model="item.serviceRate+'%'" placeholder="显示对于费率"
|
|
|
- placeholder-style="color:#BEBDBB" @blur="getserviceRate"
|
|
|
- @input="getserviceRateIndex(index)" disabled="true"/>
|
|
|
+ placeholder-style="color:#BEBDBB" @blur="getserviceRate" @input="getserviceRateIndex(index)"
|
|
|
+ disabled="true" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="listitem">
|
|
| xqd
@@ -160,7 +161,7 @@
|
|
|
<view class="inbox">
|
|
|
<input type="digit" v-model="item.interestRate+'%'" placeholder="显示对于利率"
|
|
|
placeholder-style="color:#BEBDBB" @blur="getinterestRate"
|
|
|
- @input="getinterestRateIndex(index)" disabled="true"/>
|
|
|
+ @input="getinterestRateIndex(index)" disabled="true" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="listitem">
|
|
| xqd
@@ -178,9 +179,9 @@
|
|
|
style="font-size: 24rpx; color:#D05C39;padding-top: 45rpx;padding-left: 20rpx;">*支持上传pdf、jpg/jpeg、png格式</text>
|
|
|
</view>
|
|
|
|
|
|
- <view class="inbox" style="border: none;padding-bottom: 0;" @click="checkIndex(index)">
|
|
|
+ <view class="inbox" style="border: none;padding-bottom: 0;" @click="checkIndex(index)">
|
|
|
<u-upload :fileList="item.picUrling" @afterRead="afterRead" @delete="deletePic" :name="index+4"
|
|
|
- :checkedindex=index multiple :maxCount="10" width="100" height="100"></u-upload>
|
|
|
+ :checkedindex="index" multiple :maxCount="10" width="100" height="100"></u-upload>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
| xqd
@@ -193,7 +194,6 @@
|
|
|
<view class="newbillbtn">
|
|
|
<text>确认上传</text>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
<u-datetime-picker :show="dateshow" mode="date" @confirm="confirm" @cancel="closeDate" v-model="start">
|
|
|
</u-datetime-picker>
|
|
| xqd
@@ -225,14 +225,15 @@
|
|
|
fileList3: [],
|
|
|
fileList4: [],
|
|
|
allindex: 0,
|
|
|
- seacept:'',
|
|
|
- seadra:'',
|
|
|
+ seacept: '',
|
|
|
+ seadra: '',
|
|
|
form: {
|
|
|
- id:'',
|
|
|
+
|
|
|
contractDrafts: [{
|
|
|
+ contractId: '',
|
|
|
name: '',
|
|
|
draftNo: '',
|
|
|
- acceptor:'',
|
|
|
+ acceptor: '',
|
|
|
acceptorId: '',
|
|
|
drawersId: '',
|
|
|
drawers: '',
|
|
| xqd
@@ -243,7 +244,7 @@
|
|
|
loanLimit: '',
|
|
|
expectDiscountDate: '',
|
|
|
picUrls: [],
|
|
|
- picUrling:[],
|
|
|
+ picUrling: [],
|
|
|
serviceRate: '',
|
|
|
interestRate: '',
|
|
|
interest: '',
|
|
| xqd
@@ -251,68 +252,84 @@
|
|
|
limitTime: 0,
|
|
|
expectDiscountDateTime: 0,
|
|
|
acceptDateTime: 0
|
|
|
- }, ],
|
|
|
+ }],
|
|
|
},
|
|
|
-
|
|
|
+ contractId: '',
|
|
|
range1: [],
|
|
|
range2: [],
|
|
|
myindex: 0,
|
|
|
sindex: 0,
|
|
|
rindex: 0,
|
|
|
- acptIndex:0,
|
|
|
- drwIndex:0,
|
|
|
- again:false
|
|
|
+ acptIndex: 0,
|
|
|
+ drwIndex: 0,
|
|
|
+ again: false
|
|
|
}
|
|
|
},
|
|
|
onLoad(o) {
|
|
|
that = this
|
|
|
-
|
|
|
- this.form.supplierId = uni.getStorageSync('supplierId')
|
|
|
+
|
|
|
+ // this.form.supplierId = uni.getStorageSync('supplierId')
|
|
|
this.loadTime()
|
|
|
- if(o.obj){
|
|
|
- this.again=true
|
|
|
- let obj=JSON.parse((o.obj))
|
|
|
- let form=obj.contractDrafts
|
|
|
- console.log(obj,9996)
|
|
|
- this.form.id=obj.id
|
|
|
- console.log(form,778)
|
|
|
- let inform=this.form.contractDrafts[0]
|
|
|
- inform.name=form[0].name
|
|
|
- inform.id=form[0].id
|
|
|
- inform.acceptorId=form[0].acceptorId
|
|
|
- inform.drawersId=form[0].drawersId
|
|
|
- inform.money=form[0].money
|
|
|
- inform.draftNo=form[0].draftNo
|
|
|
- inform.loanLimit=form[0].loanLimit
|
|
|
- inform.serviceRate=form[0].serviceRate
|
|
|
- inform.interestRate=form[0].interestRate
|
|
|
- inform.interest=form[0].interest
|
|
|
- inform.serviceMoney=form[0].serviceMoney
|
|
|
- inform.expectDiscountDate=form[0].expectDiscountDate
|
|
|
- inform.acceptDate=form[0].acceptDate
|
|
|
- inform.issueDate=form[0].issueDate
|
|
|
- inform.expireDate=form[0].expireDate
|
|
|
- form.forEach(item=>{
|
|
|
- item.picList.forEach(i=>{
|
|
|
- item.picUrling=[]
|
|
|
- item.picUrling.push({"url":i})
|
|
|
+ if (o.obj) {
|
|
|
+ this.again = true
|
|
|
+ let obj = JSON.parse(o.obj)
|
|
|
+ console.log(obj, 7897489)
|
|
|
+ this.contractId = obj.contractId
|
|
|
+ let form = obj.contractDrafts
|
|
|
+ let inform = this.form.contractDrafts[0]
|
|
|
+ inform.contractId = obj.contractId
|
|
|
+ if (obj.contractDrafts) {
|
|
|
+ let form = obj.contractDrafts
|
|
|
+ let inform = this.form.contractDrafts[0]
|
|
|
+ inform.name = form[0].name
|
|
|
+ inform.id = form[0].id
|
|
|
+ inform.contractId = obj.contractId
|
|
|
+ inform.acceptorId = form[0].acceptorId
|
|
|
+ inform.drawersId = form[0].drawersId
|
|
|
+ inform.money = form[0].money
|
|
|
+ inform.draftNo = form[0].draftNo
|
|
|
+ inform.loanLimit = form[0].loanLimit
|
|
|
+ inform.serviceRate = form[0].serviceRate
|
|
|
+ inform.interestRate = form[0].interestRate
|
|
|
+ inform.interest = form[0].interest
|
|
|
+ inform.serviceMoney = form[0].serviceMoney
|
|
|
+ inform.expectDiscountDate = form[0].expectDiscountDate
|
|
|
+ inform.acceptDate = form[0].acceptDate
|
|
|
+ inform.issueDate = form[0].issueDate
|
|
|
+ inform.expireDate = form[0].expireDate
|
|
|
+ form.forEach(item => {
|
|
|
+ item.picList.forEach(i => {
|
|
|
+ item.picUrling = []
|
|
|
+ item.picUrling.push({
|
|
|
+ "url": i
|
|
|
+ })
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- inform.picUrling=form[0].picUrling
|
|
|
+ inform.picUrling = form[0].picUrling
|
|
|
+ console.log((new Date('form[0].expectDiscountDate').getTime() / 100000).toFixed(0) * 100000, 556)
|
|
|
+ console.log((new Date(form[0].expectDiscountDate).getTime() / 100000).toFixed(0) * 100000, 556)
|
|
|
+ inform.expectDiscountDateTime = (new Date(form[0].expectDiscountDate).getTime() / 100000).toFixed(0) *
|
|
|
+ 100000
|
|
|
+ inform.acceptDateTime = (new Date(form[0].acceptDate).getTime() / 100000).toFixed(0) * 100000
|
|
|
+ let nTime = inform.acceptDateTime - inform.expectDiscountDateTime
|
|
|
+ inform.limitTime = Math.floor(nTime / 86400000)
|
|
|
+ }
|
|
|
+ console.log(this.form.contractDrafts[0], 778)
|
|
|
+
|
|
|
}
|
|
|
// this.initAcceptor()
|
|
|
// this.initDrawers()
|
|
|
},
|
|
|
- onShow(){
|
|
|
+ onShow() {
|
|
|
this.initAcceptor()
|
|
|
this.initDrawers()
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
loadTime() {
|
|
|
let myDate = new Date()
|
|
|
- let wk =parseInt(Date.now()/100000).toFixed(0)*100000
|
|
|
+ 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)
|
|
| xqd
@@ -325,17 +342,17 @@
|
|
|
item.expectDiscountDate = nowDate
|
|
|
item.expectDiscountDateTime = wk
|
|
|
item.acceptDateTime = wk
|
|
|
- let nTime = item.acceptDateTime-item.expectDiscountDateTime
|
|
|
+ let nTime = item.acceptDateTime - item.expectDiscountDateTime
|
|
|
item.limitTime = Math.floor(nTime / 86400000);
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- initAcceptor(){
|
|
|
+
|
|
|
+ initAcceptor() {
|
|
|
// 承兑人列表
|
|
|
- uni.$u.http.post('/api/Acceptor/search',{
|
|
|
- name:this.seacept
|
|
|
- },{
|
|
|
-
|
|
|
+ uni.$u.http.post('/api/Acceptor/search', {
|
|
|
+ name: this.seacept
|
|
|
+ }, {
|
|
|
+
|
|
|
}, {
|
|
|
custom: {
|
|
|
auth: true
|
|
| xqd
@@ -347,24 +364,22 @@
|
|
|
this.range1[index].value = index
|
|
|
this.range1[index].text = item.name
|
|
|
})
|
|
|
- if(this.again){
|
|
|
-
|
|
|
- that.range1.forEach((item,index)=>{
|
|
|
- console.log(that.form.contractDrafts[0],item)
|
|
|
- if(item.id==that.form.contractDrafts[0].acceptorId){
|
|
|
- console.log(555555555555555555555555)
|
|
|
- that.form.contractDrafts[0].acceptor=index
|
|
|
- console.log(that.form.contractDrafts[0].acceptor)
|
|
|
+ if (this.again) {
|
|
|
+
|
|
|
+ that.range1.forEach((item, index) => {
|
|
|
+ console.log(that.form.contractDrafts[0], item)
|
|
|
+ if (item.id == that.form.contractDrafts[0].acceptorId) {
|
|
|
+ that.form.contractDrafts[0].acceptor = index
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}).catch((err) => {})
|
|
|
},
|
|
|
- initDrawers(){
|
|
|
+ initDrawers() {
|
|
|
// 出票人列表
|
|
|
uni.$u.http.post('/api/Drawer/search', {
|
|
|
- name:this.seadra
|
|
|
+ name: this.seadra
|
|
|
}, {
|
|
|
custom: {
|
|
|
auth: true
|
|
| xqd
@@ -376,42 +391,42 @@
|
|
|
this.range2[index].value = index
|
|
|
this.range2[index].text = item.name
|
|
|
})
|
|
|
- if(this.again){
|
|
|
-
|
|
|
- that.range2.forEach((item,index)=>{
|
|
|
- if(item.id==that.form.contractDrafts[0].drawersId){
|
|
|
- that.form.contractDrafts[0].drawers=index
|
|
|
+ if (this.again) {
|
|
|
+
|
|
|
+ that.range2.forEach((item, index) => {
|
|
|
+ if (item.id == that.form.contractDrafts[0].drawersId) {
|
|
|
+ that.form.contractDrafts[0].drawers = index
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}).catch((err) => {})
|
|
|
},
|
|
|
- searchAcceptor(e){
|
|
|
- this.seacept=e
|
|
|
+ searchAcceptor(e) {
|
|
|
+ this.seacept = e
|
|
|
this.initAcceptor()
|
|
|
},
|
|
|
- searchDrawers(e){
|
|
|
- this.seadra=e
|
|
|
+ searchDrawers(e) {
|
|
|
+ this.seadra = e
|
|
|
this.initDrawers()
|
|
|
},
|
|
|
- checkacptIndex(index){
|
|
|
- this.acptIndex=index
|
|
|
+ checkacptIndex(index) {
|
|
|
+ this.acptIndex = index
|
|
|
},
|
|
|
- checkldrwIndex(index){
|
|
|
- this.drwIndex=index
|
|
|
+ checkldrwIndex(index) {
|
|
|
+ this.drwIndex = index
|
|
|
},
|
|
|
- deleBill(index){
|
|
|
+ deleBill(index) {
|
|
|
uni.showModal({
|
|
|
- title:"提示",
|
|
|
- content:"是否确认删除?",
|
|
|
- success:(res)=>{
|
|
|
- if(res.confirm){
|
|
|
- that.form.contractDrafts.splice(index,1)
|
|
|
+ title: "提示",
|
|
|
+ content: "是否确认删除?",
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ that.form.contractDrafts.splice(index)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
getinterestRateIndex(index) {
|
|
|
this.rindex = index
|
|
| xqd
@@ -443,18 +458,21 @@
|
|
|
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)
|
|
|
+ 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
|
|
|
+ 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)
|
|
|
}
|
|
|
|
|
| xqd
@@ -462,9 +480,11 @@
|
|
|
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
|
|
|
+ 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)
|
|
|
}
|
|
|
|
|
| xqd
@@ -518,7 +538,7 @@
|
|
|
that.$toast('请输入服务费率')
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (i.interestRate.length == 0) {
|
|
|
that.$toast('请输入利率')
|
|
|
return
|
|
| xqd
@@ -552,38 +572,44 @@
|
|
|
// that.fileList3.forEach(item => {
|
|
|
// form.tradePics.push(item.url)
|
|
|
// })
|
|
|
- form.contractDrafts.forEach(item=>{
|
|
|
- item.picUrling.forEach(i=>{
|
|
|
+ form.contractDrafts.forEach(item => {
|
|
|
+ // that.$delete(item,'expectDiscountDateTime')
|
|
|
+ // that.$delete(item,'acceptDateTime')
|
|
|
+ item.picUrling.forEach(i => {
|
|
|
item.picUrls.push(i.url)
|
|
|
})
|
|
|
})
|
|
|
+ let copyform = Object.assign([], form.contractDrafts);
|
|
|
+ that.$delete(copyform, 'expectDiscountDateTime')
|
|
|
+ that.$delete(copyform, 'acceptDateTime')
|
|
|
+ console.log(copyform, 999)
|
|
|
uni.showLoading()
|
|
|
- uni.$u.http.post('/api/Contract/addContractDraft', form, {
|
|
|
+ uni.$u.http.post('/api/Contract/addContractDraft', copyform, {
|
|
|
custom: {
|
|
|
auth: true
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
uni.hideLoading()
|
|
|
that.$toast("汇票上传成功")
|
|
|
- that.form.invoicePics = []
|
|
|
- that.form.pics = []
|
|
|
- that.form.tradePics = []
|
|
|
+ // that.form.invoicePics = []
|
|
|
+ // that.form.pics = []
|
|
|
+ // that.form.tradePics = []
|
|
|
that.form.contractDrafts.forEach(item => {
|
|
|
item.picUrls = []
|
|
|
})
|
|
|
- setTimeout(()=>{
|
|
|
+ setTimeout(() => {
|
|
|
uni.navigateBack({
|
|
|
- delta:1
|
|
|
+ delta: 1
|
|
|
})
|
|
|
- },500)
|
|
|
+ }, 500)
|
|
|
}).catch((err) => {
|
|
|
uni.hideLoading()
|
|
|
that.$toast(err.msg)
|
|
|
- that.form.invoicePics=[]
|
|
|
- that.form.pics=[]
|
|
|
- that.form.tradePics=[]
|
|
|
- that.form.contractDrafts.forEach(item=>{
|
|
|
- item.picUrls=[]
|
|
|
+ // that.form.invoicePics=[]
|
|
|
+ // that.form.pics=[]
|
|
|
+ // that.form.tradePics=[]
|
|
|
+ that.form.contractDrafts.forEach(item => {
|
|
|
+ item.picUrls = []
|
|
|
})
|
|
|
console.log(err)
|
|
|
})
|
|
| xqd
@@ -594,6 +620,7 @@
|
|
|
},
|
|
|
addNewBill() {
|
|
|
let form = [{
|
|
|
+ contractId: that.contractId,
|
|
|
name: '',
|
|
|
draftNo: '',
|
|
|
acceptor: '',
|
|
| xqd
@@ -607,7 +634,7 @@
|
|
|
loanLimit: '',
|
|
|
expectDiscountDate: '',
|
|
|
picUrls: [],
|
|
|
- picUrling:[],
|
|
|
+ picUrling: [],
|
|
|
serviceRate: '',
|
|
|
interestRate: '',
|
|
|
interest: '',
|
|
| xqd
@@ -631,50 +658,60 @@
|
|
|
item.expectDiscountDate = nowDate
|
|
|
item.expectDiscountDateTime = wk
|
|
|
item.acceptDateTime = wk
|
|
|
- let nTime =item.acceptDateTime- item.expectDiscountDateTime
|
|
|
- item.limitTime = Math.floor(nTime / 86400000) ;
|
|
|
+ let nTime = item.acceptDateTime - item.expectDiscountDateTime
|
|
|
+ item.limitTime = Math.floor(nTime / 86400000);
|
|
|
})
|
|
|
this.form.contractDrafts.push(form[0])
|
|
|
},
|
|
|
+ clearValac(e) {
|
|
|
+ this.form.contractDrafts[this.acptIndex].acceptorId = ''
|
|
|
+ this.form.contractDrafts[this.acptIndex].serviceRate = ''
|
|
|
+ this.form.contractDrafts[this.acptIndex].interestRate = ''
|
|
|
+ this.form.contractDrafts[this.acptIndex].acceptor = ''
|
|
|
+ },
|
|
|
+ clearValdr(e) {
|
|
|
+ this.form.contractDrafts[this.acptIndex].drawersId = ''
|
|
|
+ this.form.contractDrafts[this.acptIndex].drawers = ''
|
|
|
+ },
|
|
|
changeacPerson(e) {
|
|
|
this.acceptor = e
|
|
|
- for(let i in this.range1){
|
|
|
- if(i==e){
|
|
|
- this.form.contractDrafts[this.acptIndex].acceptorId=this.range1[i].id
|
|
|
- this.form.contractDrafts[this.acptIndex].serviceRate=this.range1[i].serviceRate
|
|
|
- this.form.contractDrafts[this.acptIndex].interestRate=this.range1[i].interest
|
|
|
- this.form.contractDrafts[this.acptIndex].acceptor=this.range1[i].name
|
|
|
+ if (e == "clearall") {
|
|
|
+ this.form.contractDrafts[this.acptIndex].acceptorId = ''
|
|
|
+ this.form.contractDrafts[this.acptIndex].serviceRate = ''
|
|
|
+ this.form.contractDrafts[this.acptIndex].interestRate = ''
|
|
|
+ this.form.contractDrafts[this.acptIndex].acceptor = ''
|
|
|
+ } else {
|
|
|
+ for (let i in this.range1) {
|
|
|
+ if (i == e) {
|
|
|
+ this.form.contractDrafts[this.acptIndex].acceptorId = this.range1[i].id
|
|
|
+ this.form.contractDrafts[this.acptIndex].serviceRate = this.range1[i].serviceRate
|
|
|
+ this.form.contractDrafts[this.acptIndex].interestRate = this.range1[i].interest
|
|
|
+ this.form.contractDrafts[this.acptIndex].acceptor = this.range1[i].name
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- this.range1.forEach(item=>{
|
|
|
- if(item.id==e.id){
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- // console.log(e)
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
changedrPerson(e) {
|
|
|
this.drawers = e
|
|
|
- for(let i in this.range2){
|
|
|
- if(i==e){
|
|
|
- this.form.contractDrafts[this.acptIndex].drawersId=this.range2[i].id
|
|
|
- this.form.contractDrafts[this.acptIndex].drawers=this.range2[i].name
|
|
|
+ if (e == "clearall") {
|
|
|
+ this.form.contractDrafts[this.acptIndex].drawersId = ''
|
|
|
+ this.form.contractDrafts[this.acptIndex].drawers = ''
|
|
|
+ } else {
|
|
|
+ for (let i in this.range2) {
|
|
|
+ if (i == e) {
|
|
|
+ this.form.contractDrafts[this.acptIndex].drawersId = this.range2[i].id
|
|
|
+ this.form.contractDrafts[this.acptIndex].drawers = this.range2[i].name
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- // this.range2.forEach(item=>{
|
|
|
- // if(item.id==e.id){
|
|
|
- // this.form.contractDrafts[this.drwIndex].drawersId=e.id
|
|
|
- // this.form.contractDrafts[this.drwIndex].drawers=e.name
|
|
|
- // }
|
|
|
- // })
|
|
|
+
|
|
|
},
|
|
|
openTime(index, value) {
|
|
|
this.dateshow = true
|
|
|
this.index = index
|
|
|
this.opdanum = value
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
closeDate() {
|
|
|
this.dateshow = false
|
|
| xqd
@@ -683,18 +720,18 @@
|
|
|
const timeFormat = uni.$u.timeFormat
|
|
|
let form = this.form.contractDrafts
|
|
|
if (this.opdanum == 1) {
|
|
|
- let ino =parseInt(e.value/10000).toFixed(0)*10000
|
|
|
+ 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)
|
|
|
- console.log(form[this.index].acceptDateTime,88)
|
|
|
- console.log(form[this.index].expectDiscountDateTime,88)
|
|
|
- console.log(limitTime,88)
|
|
|
- if(limitTime<=-1){
|
|
|
+ let nTime = form[this.index].acceptDateTime - form[this.index].expectDiscountDateTime
|
|
|
+ let limitTime = Math.floor(nTime / 86400000)
|
|
|
+ console.log(form[this.index].acceptDateTime, 88)
|
|
|
+ console.log(form[this.index].expectDiscountDateTime, 88)
|
|
|
+ console.log(limitTime, 88)
|
|
|
+ if (limitTime <= -1) {
|
|
|
this.$toast('承兑日期应该大于预计贴现日')
|
|
|
return
|
|
|
}
|
|
|
- form[this.index].limitTime =limitTime
|
|
|
+ form[this.index].limitTime = limitTime
|
|
|
form[this.index].acceptDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
|
this.getloanLimt(this.index)
|
|
|
this.getSerMoney(this.index)
|
|
| xqd
@@ -706,13 +743,13 @@
|
|
|
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){
|
|
|
+ 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].limitTime = limitTime
|
|
|
form[this.index].expectDiscountDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
|
this.getloanLimt(this.index)
|
|
|
this.getSerMoney(this.index)
|
|
| xqd
@@ -735,14 +772,13 @@
|
|
|
},
|
|
|
checkIndex(index) {
|
|
|
this.allindex = index
|
|
|
- console.log(index)
|
|
|
},
|
|
|
// 删除图片
|
|
|
async deletePic(event) {
|
|
|
// this.checkIndex(index)
|
|
|
- console.log(this.allindex,789)
|
|
|
+ console.log(this.allindex, 789)
|
|
|
if (event.name >= 4) {
|
|
|
- this.form.contractDrafts[this.allindex].picUrling.splice(event.index, 1)
|
|
|
+ this.form.contractDrafts[this.allindex].picUrling.splice(event.index, 1)
|
|
|
} else {
|
|
|
this[`fileList${event.name}`].splice(event.index, 1)
|
|
|
}
|
|
| xqd
@@ -754,7 +790,7 @@
|
|
|
|
|
|
if (event.name >= 4) {
|
|
|
let lists = [].concat(event.file)
|
|
|
- let icurls= this.form.contractDrafts[this.allindex].picUrling
|
|
|
+ let icurls = this.form.contractDrafts[this.allindex].picUrling
|
|
|
let fileListLen = icurls.length
|
|
|
lists.map((item) => {
|
|
|
icurls.push({
|
|
| xqd
@@ -772,59 +808,59 @@
|
|
|
message: '',
|
|
|
url: result
|
|
|
}))
|
|
|
-
|
|
|
- fileListLen++
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }else {
|
|
|
- console.log(2222222222)
|
|
|
- let lists = [].concat(event.file)
|
|
|
- let fileListLen = this[`fileList${event.name}`].length
|
|
|
- lists.map((item) => {
|
|
|
- this[`fileList${event.name}`].push({
|
|
|
- ...item,
|
|
|
- status: 'uploading',
|
|
|
- message: '上传中'
|
|
|
- })
|
|
|
- })
|
|
|
- for (let i = 0; i < lists.length; i++) {
|
|
|
- const result = await this.uploadFilePromise(lists[i].url)
|
|
|
- let item = this[`fileList${event.name}`][fileListLen]
|
|
|
- this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
|
|
- status: 'success',
|
|
|
- message: '',
|
|
|
- url: result
|
|
|
- }))
|
|
|
- fileListLen++
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
+ fileListLen++
|
|
|
}
|
|
|
- },
|
|
|
- uploadFilePromise(url) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- let a = uni.uploadFile({
|
|
|
- url: mainUrl + '/api/File', // 仅为示例,非真实的接口地址
|
|
|
- filePath: url,
|
|
|
- name: 'File',
|
|
|
- header: {
|
|
|
- "User-Agent": "apifox/1.0.0 (https://www.apifox.cn)"
|
|
|
- },
|
|
|
- formData: {
|
|
|
- File: JSON.stringify(url),
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- let request = JSON.parse(res.data)
|
|
|
- setTimeout(() => {
|
|
|
- resolve(request.data.file)
|
|
|
- }, 1000)
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ let lists = [].concat(event.file)
|
|
|
+ let fileListLen = this[`fileList${event.name}`].length
|
|
|
+ lists.map((item) => {
|
|
|
+ this[`fileList${event.name}`].push({
|
|
|
+ ...item,
|
|
|
+ status: 'uploading',
|
|
|
+ message: '上传中'
|
|
|
+ })
|
|
|
})
|
|
|
- },
|
|
|
- }
|
|
|
+ for (let i = 0; i < lists.length; i++) {
|
|
|
+ const result = await this.uploadFilePromise(lists[i].url)
|
|
|
+ let item = this[`fileList${event.name}`][fileListLen]
|
|
|
+ this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
|
|
+ status: 'success',
|
|
|
+ message: '',
|
|
|
+ url: result
|
|
|
+ }))
|
|
|
+ fileListLen++
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ uploadFilePromise(url) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ let a = uni.uploadFile({
|
|
|
+ url: mainUrl + '/api/File', // 仅为示例,非真实的接口地址
|
|
|
+ filePath: url,
|
|
|
+ name: 'File',
|
|
|
+ header: {
|
|
|
+ "User-Agent": "apifox/1.0.0 (https://www.apifox.cn)"
|
|
|
+ },
|
|
|
+ formData: {
|
|
|
+ File: JSON.stringify(url),
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ let request = JSON.parse(res.data)
|
|
|
+ setTimeout(() => {
|
|
|
+ resolve(request.data.file)
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|