|
@@ -1,10 +1,61 @@
|
|
<template>
|
|
<template>
|
|
<view class="content">
|
|
<view class="content">
|
|
|
|
+ <!-- <view class="listitem">
|
|
|
|
+ <text class="lys">合同名称</text>
|
|
|
|
+ <view class="inbox">
|
|
|
|
+ <input type="text" v-model="form.name" placeholder="请输入合同的名称" placeholder-style="color:#BEBDBB" />
|
|
|
|
+ </view>
|
|
|
|
+ </view> -->
|
|
|
|
+ <!-- <view class="listitem">
|
|
|
|
+ <text class="lys">合同编号</text>
|
|
|
|
+ <view class="inbox flex2">
|
|
|
|
+ <input type="text" v-model="form.tax_no" placeholder="请输入合同的编号" placeholder-style="color:#BEBDBB" />
|
|
|
|
+ <view class="flex7">
|
|
|
|
+ <text style="color: #E8E8E8;">|</text>
|
|
|
|
+ <text style="padding-left: 20rpx;display: block;">待确认</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view> -->
|
|
|
|
+<!-- <view class="listitem">
|
|
|
|
+ <view class="" style="display: flex;align-content: center;">
|
|
|
|
+ <text class="lys">合同附件</text>
|
|
|
|
+ <text
|
|
|
|
+ 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">
|
|
|
|
+ <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
|
|
|
+ :maxCount="10" width="100" height="100"></u-upload>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="listitem" style="border: none;">
|
|
|
|
+ <view class="" style="display: flex;align-content: center;">
|
|
|
|
+ <text class="lys">发票附件</text>
|
|
|
|
+ <text
|
|
|
|
+ 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">
|
|
|
|
+ <u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="2" multiple
|
|
|
|
+ :maxCount="10" width="100" height="100"></u-upload>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="listitem">
|
|
|
|
+ <view class="" style="display: flex;align-content: center;">
|
|
|
|
+ <text class="lys">贸易合同</text>
|
|
|
|
+ <text
|
|
|
|
+ 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">
|
|
|
|
+ <u-upload :fileList="fileList3" @afterRead="afterRead" @delete="deletePic" name="3" multiple
|
|
|
|
+ :maxCount="10" width="100" height="100"></u-upload>
|
|
|
|
+ </view>
|
|
|
|
+ </view> -->
|
|
<view v-for="(item,index) in form.contractDrafts" :key="index">
|
|
<view v-for="(item,index) in form.contractDrafts" :key="index">
|
|
<view class="addtitle flex6">
|
|
<view class="addtitle flex6">
|
|
<text class="ty">汇票{{index+1}}</text>
|
|
<text class="ty">汇票{{index+1}}</text>
|
|
- <text class="tde" @click="deleBill(index)">删除</text>
|
|
|
|
|
|
+ <text class="tde" @click="deleBill" v-if="index>0">删除</text>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
<text class="lys">汇票名称</text>
|
|
<text class="lys">汇票名称</text>
|
|
@@ -16,28 +67,28 @@
|
|
<text class="lys">汇票号码</text>
|
|
<text class="lys">汇票号码</text>
|
|
<view class="inbox">
|
|
<view class="inbox">
|
|
<input type="text" v-model="item.draftNo" placeholder="请输入汇票的号码"
|
|
<input type="text" v-model="item.draftNo" placeholder="请输入汇票的号码"
|
|
- placeholder-style="color:#BEBDBB" />
|
|
|
|
|
|
+ placeholder-style="color:#BEBDBB"/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
- <text class="lys">兑换人</text>
|
|
|
|
- <view class="chosbox">
|
|
|
|
|
|
+ <text class="lys">承兑人</text>
|
|
|
|
+ <view class="chosbox" @click="checkacptIndex(index)">
|
|
<uni-data-select v-model="item.acceptor" :localdata="range1" @change="changeacPerson"
|
|
<uni-data-select v-model="item.acceptor" :localdata="range1" @change="changeacPerson"
|
|
- :showas="false" :plname="'搜索兑换人名称'"></uni-data-select>
|
|
|
|
|
|
+ :showas="false" :plname="'搜索兑换人名称'" @search="searchAcceptor"></uni-data-select>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
<text class="lys">出票人</text>
|
|
<text class="lys">出票人</text>
|
|
- <view class="chosbox">
|
|
|
|
|
|
+ <view class="chosbox" @click="checkldrwIndex(index)">
|
|
<uni-data-select v-model="item.drawers" :localdata="range2" @change="changedrPerson"
|
|
<uni-data-select v-model="item.drawers" :localdata="range2" @change="changedrPerson"
|
|
- :plname="'搜索出票人名称'"></uni-data-select>
|
|
|
|
|
|
+ :plname="'搜索出票人名称'" @search="searchDrawers"></uni-data-select>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
<text class="lys">金额</text>
|
|
<text class="lys">金额</text>
|
|
<view class="inbox">
|
|
<view class="inbox">
|
|
<input type="digit" v-model="item.money" placeholder="请输入汇票的金额" placeholder-style="color:#BEBDBB"
|
|
<input type="digit" v-model="item.money" placeholder="请输入汇票的金额" placeholder-style="color:#BEBDBB"
|
|
- @blur="getMoney" @input="getMoneyIndex(index)" />
|
|
|
|
|
|
+ @input="getMoney" @blur="getMoneyIndex(index)" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
@@ -90,7 +141,7 @@
|
|
<view class="inbox">
|
|
<view class="inbox">
|
|
<input type="digit" v-model="item.serviceRate" placeholder="显示对于费率"
|
|
<input type="digit" v-model="item.serviceRate" placeholder="显示对于费率"
|
|
placeholder-style="color:#BEBDBB" @blur="getserviceRate"
|
|
placeholder-style="color:#BEBDBB" @blur="getserviceRate"
|
|
- @input="getserviceRateIndex(index)" />
|
|
|
|
|
|
+ @input="getserviceRateIndex(index)" disabled="true"/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
@@ -108,7 +159,7 @@
|
|
<view class="inbox">
|
|
<view class="inbox">
|
|
<input type="digit" v-model="item.interestRate" placeholder="显示对于利率"
|
|
<input type="digit" v-model="item.interestRate" placeholder="显示对于利率"
|
|
placeholder-style="color:#BEBDBB" @blur="getinterestRate"
|
|
placeholder-style="color:#BEBDBB" @blur="getinterestRate"
|
|
- @input="getinterestRateIndex(index)" />
|
|
|
|
|
|
+ @input="getinterestRateIndex(index)" disabled="true"/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
@@ -126,17 +177,18 @@
|
|
style="font-size: 24rpx; color:#D05C39;padding-top: 45rpx;padding-left: 20rpx;">*支持上传pdf、jpg/jpeg、png格式</text>
|
|
style="font-size: 24rpx; color:#D05C39;padding-top: 45rpx;padding-left: 20rpx;">*支持上传pdf、jpg/jpeg、png格式</text>
|
|
</view>
|
|
</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"
|
|
<u-upload :fileList="item.picUrling" @afterRead="afterRead" @delete="deletePic" :name="index+4"
|
|
- multiple :maxCount="10" width="100" height="100"></u-upload>
|
|
|
|
|
|
+ :checkedindex=index multiple :maxCount="10" width="100" height="100"></u-upload>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
<view class="addnewbill" @click="addNewBill">
|
|
<view class="addnewbill" @click="addNewBill">
|
|
+ 新增汇票
|
|
+ 新增汇票
|
|
</view>
|
|
</view>
|
|
<view class="safebt"></view>
|
|
<view class="safebt"></view>
|
|
- <view class="newbill flex1">
|
|
|
|
|
|
+ <view class="newbill flex1" @click="upAll">
|
|
<view class="newbillbtn">
|
|
<view class="newbillbtn">
|
|
<text>确认上传</text>
|
|
<text>确认上传</text>
|
|
</view>
|
|
</view>
|
|
@@ -172,6 +224,8 @@
|
|
fileList3: [],
|
|
fileList3: [],
|
|
fileList4: [],
|
|
fileList4: [],
|
|
allindex: 0,
|
|
allindex: 0,
|
|
|
|
+ seacept:'',
|
|
|
|
+ seadra:'',
|
|
form: {
|
|
form: {
|
|
name: '',
|
|
name: '',
|
|
supplierId: '',
|
|
supplierId: '',
|
|
@@ -192,14 +246,14 @@
|
|
loanLimit: '',
|
|
loanLimit: '',
|
|
expectDiscountDate: '',
|
|
expectDiscountDate: '',
|
|
picUrls: [],
|
|
picUrls: [],
|
|
- picUrling: [],
|
|
|
|
|
|
+ picUrling:[],
|
|
serviceRate: '',
|
|
serviceRate: '',
|
|
interestRate: '',
|
|
interestRate: '',
|
|
interest: '',
|
|
interest: '',
|
|
serviceMoney: '',
|
|
serviceMoney: '',
|
|
limitTime: 0,
|
|
limitTime: 0,
|
|
expectDiscountDateTime: 0,
|
|
expectDiscountDateTime: 0,
|
|
- expectDiscountDate: 0
|
|
|
|
|
|
+ acceptDateTime: 0
|
|
}, ],
|
|
}, ],
|
|
},
|
|
},
|
|
|
|
|
|
@@ -207,29 +261,27 @@
|
|
range2: [],
|
|
range2: [],
|
|
myindex: 0,
|
|
myindex: 0,
|
|
sindex: 0,
|
|
sindex: 0,
|
|
- rindex: 0
|
|
|
|
|
|
+ rindex: 0,
|
|
|
|
+ acptIndex:0,
|
|
|
|
+ drwIndex:0
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
that = this
|
|
that = this
|
|
- if(o.obj){
|
|
|
|
- this.form.contractDrafts=JSON.parse(o.obj)
|
|
|
|
- }
|
|
|
|
- this.init()
|
|
|
|
|
|
+
|
|
this.form.supplierId = uni.getStorageSync('supplierId')
|
|
this.form.supplierId = uni.getStorageSync('supplierId')
|
|
// console.log(this.form.supplierId,778)
|
|
// console.log(this.form.supplierId,778)
|
|
this.loadTime()
|
|
this.loadTime()
|
|
|
|
|
|
},
|
|
},
|
|
- onshow(){
|
|
|
|
-
|
|
|
|
|
|
+ onShow(){
|
|
|
|
+ this.initAcceptor()
|
|
|
|
+ this.initDrawers()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
loadTime() {
|
|
loadTime() {
|
|
let myDate = new Date()
|
|
let myDate = new Date()
|
|
- // let wk = Date.parse(new Date());
|
|
|
|
- let wk = myDate.getTime()
|
|
|
|
- console.log(wk)
|
|
|
|
|
|
+ let wk =parseInt(Date.now()/100000).toFixed(0)*100000
|
|
let yy = String(myDate.getFullYear())
|
|
let yy = String(myDate.getFullYear())
|
|
// let mm = myDate.getMonth() + 1
|
|
// let mm = myDate.getMonth() + 1
|
|
let mm = String(myDate.getMonth() + 1 < 10 ? '0' + (myDate.getMonth() + 1) : myDate.getMonth() + 1)
|
|
let mm = String(myDate.getMonth() + 1 < 10 ? '0' + (myDate.getMonth() + 1) : myDate.getMonth() + 1)
|
|
@@ -241,15 +293,19 @@
|
|
item.expireDate = nowDate
|
|
item.expireDate = nowDate
|
|
item.expectDiscountDate = nowDate
|
|
item.expectDiscountDate = nowDate
|
|
item.expectDiscountDateTime = wk
|
|
item.expectDiscountDateTime = wk
|
|
- item.issueDateTime = wk
|
|
|
|
- let nTime = item.expectDiscountDateTime - item.issueDateTime
|
|
|
|
- item.limitTime = Math.floor(nTime / 86400000) + 1;
|
|
|
|
|
|
+ item.acceptDateTime = wk
|
|
|
|
+ let nTime = item.acceptDateTime-item.expectDiscountDateTime
|
|
|
|
+ item.limitTime = Math.floor(nTime / 86400000);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- init() {
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ initAcceptor(){
|
|
// 承兑人列表
|
|
// 承兑人列表
|
|
- uni.$u.http.post('/api/Acceptor/search', {
|
|
|
|
-
|
|
|
|
|
|
+ uni.$u.http.post('/api/Acceptor/search',{
|
|
|
|
+ name:this.seacept
|
|
|
|
+ },{
|
|
|
|
+
|
|
}, {
|
|
}, {
|
|
custom: {
|
|
custom: {
|
|
auth: true
|
|
auth: true
|
|
@@ -258,16 +314,18 @@
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
this.range1 = res.result
|
|
this.range1 = res.result
|
|
// for(let i in this.range1){
|
|
// for(let i in this.range1){
|
|
-
|
|
|
|
|
|
+
|
|
// }
|
|
// }
|
|
this.range1.forEach((item, index) => {
|
|
this.range1.forEach((item, index) => {
|
|
this.range1[index].value = index
|
|
this.range1[index].value = index
|
|
this.range1[index].text = item.name
|
|
this.range1[index].text = item.name
|
|
})
|
|
})
|
|
}).catch((err) => {})
|
|
}).catch((err) => {})
|
|
|
|
+ },
|
|
|
|
+ initDrawers(){
|
|
// 出票人列表
|
|
// 出票人列表
|
|
uni.$u.http.post('/api/Drawer/search', {
|
|
uni.$u.http.post('/api/Drawer/search', {
|
|
-
|
|
|
|
|
|
+ name:this.seadra
|
|
}, {
|
|
}, {
|
|
custom: {
|
|
custom: {
|
|
auth: true
|
|
auth: true
|
|
@@ -281,12 +339,26 @@
|
|
})
|
|
})
|
|
}).catch((err) => {})
|
|
}).catch((err) => {})
|
|
},
|
|
},
|
|
|
|
+ searchAcceptor(e){
|
|
|
|
+ this.seacept=e
|
|
|
|
+ this.initAcceptor()
|
|
|
|
+ },
|
|
|
|
+ searchDrawers(e){
|
|
|
|
+ this.seadra=e
|
|
|
|
+ this.initDrawers()
|
|
|
|
+ },
|
|
|
|
+ checkacptIndex(index){
|
|
|
|
+ this.acptIndex=index
|
|
|
|
+ },
|
|
|
|
+ checkldrwIndex(index){
|
|
|
|
+ this.drwIndex=index
|
|
|
|
+ },
|
|
deleBill(index){
|
|
deleBill(index){
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title:"提示",
|
|
title:"提示",
|
|
content:"是否确认删除?",
|
|
content:"是否确认删除?",
|
|
success:(res)=>{
|
|
success:(res)=>{
|
|
- if (res.confirm) {
|
|
|
|
|
|
+ if(res.confirm){
|
|
that.form.contractDrafts.splice(index,1)
|
|
that.form.contractDrafts.splice(index,1)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -357,7 +429,22 @@
|
|
success: function(res) {
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
let form = that.form
|
|
let form = that.form
|
|
-
|
|
|
|
|
|
+ // if (form.name.length == 0) {
|
|
|
|
+ // that.$toast('请输入合同名称')
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // if (that.fileList1.length == 0) {
|
|
|
|
+ // that.$toast('请上传合同附件')
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // if (that.fileList2.length == 0) {
|
|
|
|
+ // that.$toast('请上传发票附件')
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // if (that.fileList3.length == 0) {
|
|
|
|
+ // that.$toast('请上贸易合同')
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
form.contractDrafts.forEach(i => {
|
|
form.contractDrafts.forEach(i => {
|
|
if (i.name.length == 0) {
|
|
if (i.name.length == 0) {
|
|
that.$toast('请输入汇票名称')
|
|
that.$toast('请输入汇票名称')
|
|
@@ -379,7 +466,7 @@
|
|
that.$toast('请输入金额')
|
|
that.$toast('请输入金额')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (i.serviceRate.length == 0) {
|
|
if (i.serviceRate.length == 0) {
|
|
that.$toast('请输入服务费率')
|
|
that.$toast('请输入服务费率')
|
|
return
|
|
return
|
|
@@ -394,20 +481,29 @@
|
|
}
|
|
}
|
|
|
|
|
|
})
|
|
})
|
|
- that.range2.forEach(item => {
|
|
|
|
- form.contractDrafts.forEach(i => {
|
|
|
|
- if (that.range2[i.drawers].name == item.name) {
|
|
|
|
- i.drawersId = item.id
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- that.range1.forEach(item => {
|
|
|
|
- form.contractDrafts.forEach(i => {
|
|
|
|
- if (that.range1[i.acceptor].name == item.name) {
|
|
|
|
- i.acceptorId = item.id
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ // that.range2.forEach(item => {
|
|
|
|
+ // form.contractDrafts.forEach(i => {
|
|
|
|
+ // if (that.range2[i.drawers].name == item.name) {
|
|
|
|
+ // i.drawersId = item.id
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // })
|
|
|
|
+ // that.range1.forEach(item => {
|
|
|
|
+ // form.contractDrafts.forEach(i => {
|
|
|
|
+ // if (that.range1[i.acceptor].name == item.name) {
|
|
|
|
+ // i.acceptorId = item.id
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // })
|
|
|
|
+ // that.fileList1.forEach(item => {
|
|
|
|
+ // form.invoicePics.push(item.url)
|
|
|
|
+ // })
|
|
|
|
+ // that.fileList2.forEach(item => {
|
|
|
|
+ // form.pics.push(item.url)
|
|
|
|
+ // })
|
|
|
|
+ // that.fileList3.forEach(item => {
|
|
|
|
+ // form.tradePics.push(item.url)
|
|
|
|
+ // })
|
|
form.contractDrafts.forEach(item=>{
|
|
form.contractDrafts.forEach(item=>{
|
|
item.picUrling.forEach(i=>{
|
|
item.picUrling.forEach(i=>{
|
|
item.picUrls.push(i.url)
|
|
item.picUrls.push(i.url)
|
|
@@ -420,10 +516,22 @@
|
|
}
|
|
}
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
- that.$toast("合同上传成功")
|
|
|
|
|
|
+ that.$toast("汇票上传成功")
|
|
|
|
+ that.form.invoicePics = []
|
|
|
|
+ that.form.pics = []
|
|
|
|
+ that.form.tradePics = []
|
|
|
|
+ that.form.contractDrafts.forEach(item => {
|
|
|
|
+ item.picUrls = []
|
|
|
|
+ })
|
|
}).catch((err) => {
|
|
}).catch((err) => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
that.$toast(err.msg)
|
|
that.$toast(err.msg)
|
|
|
|
+ that.form.invoicePics=[]
|
|
|
|
+ that.form.pics=[]
|
|
|
|
+ that.form.tradePics=[]
|
|
|
|
+ that.form.contractDrafts.forEach(item=>{
|
|
|
|
+ item.picUrls=[]
|
|
|
|
+ })
|
|
console.log(err)
|
|
console.log(err)
|
|
})
|
|
})
|
|
} else if (res.cancel) {}
|
|
} else if (res.cancel) {}
|
|
@@ -446,18 +554,18 @@
|
|
loanLimit: '',
|
|
loanLimit: '',
|
|
expectDiscountDate: '',
|
|
expectDiscountDate: '',
|
|
picUrls: [],
|
|
picUrls: [],
|
|
- picUrling: [],
|
|
|
|
|
|
+ picUrling:[],
|
|
serviceRate: '',
|
|
serviceRate: '',
|
|
interestRate: '',
|
|
interestRate: '',
|
|
interest: '',
|
|
interest: '',
|
|
serviceMoney: '',
|
|
serviceMoney: '',
|
|
limitTime: 0,
|
|
limitTime: 0,
|
|
expectDiscountDateTime: 0,
|
|
expectDiscountDateTime: 0,
|
|
- expectDiscountDate: 0
|
|
|
|
|
|
+ acceptDateTime: 0
|
|
}]
|
|
}]
|
|
let myDate = new Date()
|
|
let myDate = new Date()
|
|
// let wk = Date.parse(new Date());
|
|
// let wk = Date.parse(new Date());
|
|
- let wk = myDate.getTime()
|
|
|
|
|
|
+ let wk = Date.parse(new Date())
|
|
console.log(wk)
|
|
console.log(wk)
|
|
let yy = String(myDate.getFullYear())
|
|
let yy = String(myDate.getFullYear())
|
|
// let mm = myDate.getMonth() + 1
|
|
// let mm = myDate.getMonth() + 1
|
|
@@ -470,22 +578,52 @@
|
|
item.expireDate = nowDate
|
|
item.expireDate = nowDate
|
|
item.expectDiscountDate = nowDate
|
|
item.expectDiscountDate = nowDate
|
|
item.expectDiscountDateTime = wk
|
|
item.expectDiscountDateTime = wk
|
|
- item.issueDateTime = wk
|
|
|
|
- let nTime = item.expectDiscountDateTime - item.issueDateTime
|
|
|
|
- item.limitTime = Math.floor(nTime / 86400000) + 1;
|
|
|
|
|
|
+ item.acceptDateTime = wk
|
|
|
|
+ let nTime =item.acceptDateTime- item.expectDiscountDateTime
|
|
|
|
+ item.limitTime = Math.floor(nTime / 86400000) ;
|
|
})
|
|
})
|
|
this.form.contractDrafts.push(form[0])
|
|
this.form.contractDrafts.push(form[0])
|
|
},
|
|
},
|
|
changeacPerson(e) {
|
|
changeacPerson(e) {
|
|
|
|
+ console.log(e,88)
|
|
this.acceptor = 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
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.range1.forEach(item=>{
|
|
|
|
+ if(item.id==e.id){
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ // console.log(e)
|
|
|
|
+
|
|
},
|
|
},
|
|
changedrPerson(e) {
|
|
changedrPerson(e) {
|
|
this.drawers = 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
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 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) {
|
|
openTime(index, value) {
|
|
this.dateshow = true
|
|
this.dateshow = true
|
|
this.index = index
|
|
this.index = index
|
|
this.opdanum = value
|
|
this.opdanum = value
|
|
|
|
+
|
|
},
|
|
},
|
|
closeDate() {
|
|
closeDate() {
|
|
this.dateshow = false
|
|
this.dateshow = false
|
|
@@ -494,17 +632,40 @@
|
|
const timeFormat = uni.$u.timeFormat
|
|
const timeFormat = uni.$u.timeFormat
|
|
let form = this.form.contractDrafts
|
|
let form = this.form.contractDrafts
|
|
if (this.opdanum == 1) {
|
|
if (this.opdanum == 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)
|
|
|
|
+ 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].acceptDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
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) {
|
|
} else if (this.opdanum == 2) {
|
|
- form[this.index].issueDateTime = e.value
|
|
|
|
|
|
+
|
|
form[this.index].issueDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
form[this.index].issueDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
} else if (this.opdanum == 3) {
|
|
} else if (this.opdanum == 3) {
|
|
form[this.index].expireDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
form[this.index].expireDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
} else if (this.opdanum == 4) {
|
|
} else if (this.opdanum == 4) {
|
|
form[this.index].expectDiscountDateTime = e.value
|
|
form[this.index].expectDiscountDateTime = e.value
|
|
- let nTime = form[this.index].expectDiscountDateTime - form[this.index].issueDateTime
|
|
|
|
- form[this.index].limitTime = Math.floor(nTime / 86400000) + 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].expectDiscountDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
form[this.index].expectDiscountDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
|
|
+ this.getloanLimt(this.index)
|
|
|
|
+ this.getSerMoney(this.index)
|
|
|
|
+ this.getInterMoney(this.index)
|
|
}
|
|
}
|
|
// console.log(this.index, this.opdanum)
|
|
// console.log(this.index, this.opdanum)
|
|
this.dateshow = false
|
|
this.dateshow = false
|
|
@@ -526,9 +687,11 @@
|
|
console.log(index)
|
|
console.log(index)
|
|
},
|
|
},
|
|
// 删除图片
|
|
// 删除图片
|
|
- deletePic(event) {
|
|
|
|
- if (event.name == 4) {
|
|
|
|
- this.form.contractDrafts[this.allindex].picUrling.splice(event.index, 1)
|
|
|
|
|
|
+ async deletePic(event) {
|
|
|
|
+ // this.checkIndex(index)
|
|
|
|
+ console.log(this.allindex,789)
|
|
|
|
+ if (event.name >= 4) {
|
|
|
|
+ this.form.contractDrafts[this.allindex].picUrling.splice(event.index, 1)
|
|
} else {
|
|
} else {
|
|
this[`fileList${event.name}`].splice(event.index, 1)
|
|
this[`fileList${event.name}`].splice(event.index, 1)
|
|
}
|
|
}
|
|
@@ -539,8 +702,9 @@
|
|
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
|
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
|
|
|
|
|
if (event.name >= 4) {
|
|
if (event.name >= 4) {
|
|
|
|
+ console.log(2222222222999)
|
|
let lists = [].concat(event.file)
|
|
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
|
|
let fileListLen = icurls.length
|
|
lists.map((item) => {
|
|
lists.map((item) => {
|
|
icurls.push({
|
|
icurls.push({
|
|
@@ -551,72 +715,68 @@
|
|
})
|
|
})
|
|
for (let i = 0; i < lists.length; i++) {
|
|
for (let i = 0; i < lists.length; i++) {
|
|
const result = await this.uploadFilePromise(lists[i].url)
|
|
const result = await this.uploadFilePromise(lists[i].url)
|
|
- let obj = {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- console.log(result)
|
|
|
|
|
|
+ // this.form.contractDrafts[this.allindex].picUrls.push(result)
|
|
let item = icurls[fileListLen]
|
|
let item = icurls[fileListLen]
|
|
icurls.splice(fileListLen, 1, Object.assign(item, {
|
|
icurls.splice(fileListLen, 1, Object.assign(item, {
|
|
status: 'success',
|
|
status: 'success',
|
|
message: '',
|
|
message: '',
|
|
url: result
|
|
url: result
|
|
}))
|
|
}))
|
|
-
|
|
|
|
|
|
+
|
|
fileListLen++
|
|
fileListLen++
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- } 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: '上传中'
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }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++
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- 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) => {
|
|
|
|
- console.log(res)
|
|
|
|
- let request = JSON.parse(res.data)
|
|
|
|
- setTimeout(() => {
|
|
|
|
- resolve(request.data.file)
|
|
|
|
- }, 1000)
|
|
|
|
|
|
+ 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>
|
|
</script>
|
|
|
|
|
|
-
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.content {
|
|
.content {
|
|
padding: 0 30rpx;
|
|
padding: 0 30rpx;
|