|
@@ -6,7 +6,7 @@
|
|
<input type="text" v-model="form.name" placeholder="请输入合同的名称" placeholder-style="color:#BEBDBB" />
|
|
<input type="text" v-model="form.name" placeholder="请输入合同的名称" placeholder-style="color:#BEBDBB" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="listitem">
|
|
|
|
|
|
+ <!-- <view class="listitem">
|
|
<text class="lys">合同编号</text>
|
|
<text class="lys">合同编号</text>
|
|
<view class="inbox flex2">
|
|
<view class="inbox flex2">
|
|
<input type="text" v-model="form.tax_no" placeholder="请输入合同的编号" placeholder-style="color:#BEBDBB" />
|
|
<input type="text" v-model="form.tax_no" placeholder="请输入合同的编号" placeholder-style="color:#BEBDBB" />
|
|
@@ -15,14 +15,14 @@
|
|
<text style="padding-left: 20rpx;display: block;">待确认</text>
|
|
<text style="padding-left: 20rpx;display: block;">待确认</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view class="listitem" >
|
|
|
|
|
|
+ </view> -->
|
|
|
|
+ <view class="listitem">
|
|
<view class="" style="display: flex;align-content: center;">
|
|
<view class="" style="display: flex;align-content: center;">
|
|
<text class="lys">合同附件</text>
|
|
<text class="lys">合同附件</text>
|
|
<text
|
|
<text
|
|
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">
|
|
<view class="inbox" style="border: none;padding-bottom: 0">
|
|
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
|
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
|
:maxCount="10" width="100" height="100"></u-upload>
|
|
:maxCount="10" width="100" height="100"></u-upload>
|
|
@@ -34,25 +34,25 @@
|
|
<text
|
|
<text
|
|
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">
|
|
<view class="inbox" style="border: none;padding-bottom: 0">
|
|
- <u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
|
|
|
|
|
+ <u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="2" multiple
|
|
:maxCount="10" width="100" height="100"></u-upload>
|
|
:maxCount="10" width="100" height="100"></u-upload>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="listitem" >
|
|
|
|
|
|
+ <view class="listitem">
|
|
<view class="" style="display: flex;align-content: center;">
|
|
<view class="" style="display: flex;align-content: center;">
|
|
<text class="lys">贸易合同</text>
|
|
<text class="lys">贸易合同</text>
|
|
<text
|
|
<text
|
|
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">
|
|
<view class="inbox" style="border: none;padding-bottom: 0">
|
|
- <u-upload :fileList="fileList3" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
|
|
|
|
|
+ <u-upload :fileList="fileList3" @afterRead="afterRead" @delete="deletePic" name="3" multiple
|
|
:maxCount="10" width="100" height="100"></u-upload>
|
|
:maxCount="10" width="100" height="100"></u-upload>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view v-for="(item,index) in list" :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">删除</text> -->
|
|
<!-- <text class="tde">删除</text> -->
|
|
@@ -66,25 +66,28 @@
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
<text class="lys">汇票号码</text>
|
|
<text class="lys">汇票号码</text>
|
|
<view class="inbox">
|
|
<view class="inbox">
|
|
- <input type="text" v-model="item.tax_no" placeholder="请输入汇票的号码" placeholder-style="color:#BEBDBB" />
|
|
|
|
|
|
+ <input type="text" v-model="item.draftNo" placeholder="请输入汇票的号码"
|
|
|
|
+ placeholder-style="color:#BEBDBB" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
<text class="lys">兑换人</text>
|
|
<text class="lys">兑换人</text>
|
|
<view class="chosbox">
|
|
<view class="chosbox">
|
|
- <uni-data-select v-model="item.accepter" :localdata="range" @change="changeacPerson" :showas="false" :plname="'搜索兑换人名称'"></uni-data-select>
|
|
|
|
|
|
+ <uni-data-select v-model="item.acceptor" :localdata="range1" @change="changeacPerson"
|
|
|
|
+ :showas="false" :plname="'搜索兑换人名称'"></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">
|
|
- <uni-data-select v-model="item.drawer" :localdata="range" @change="changedrPerson" :plname="'搜索出票人名称'"></uni-data-select>
|
|
|
|
|
|
+ <uni-data-select v-model="item.drawers" :localdata="range2" @change="changedrPerson"
|
|
|
|
+ :plname="'搜索出票人名称'" ></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="text" v-model="item.amount" placeholder="请输入汇票的金额" placeholder-style="color:#BEBDBB" />
|
|
|
|
|
|
+ <input type="digit" v-model="item.money" placeholder="请输入汇票的金额" placeholder-style="color:#BEBDBB" @blur="getMoney" @input="getMoneyIndex(index)"/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
@@ -93,7 +96,7 @@
|
|
<view class="canicon">
|
|
<view class="canicon">
|
|
<image src="../../static/img/canlen.png" mode="aspectFill"></image>
|
|
<image src="../../static/img/canlen.png" mode="aspectFill"></image>
|
|
</view>
|
|
</view>
|
|
- <text>{{item.value1}}</text>
|
|
|
|
|
|
+ <text>{{item.acceptDate}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
@@ -102,7 +105,7 @@
|
|
<view class="canicon">
|
|
<view class="canicon">
|
|
<image src="../../static/img/canlen.png" mode="aspectFill"></image>
|
|
<image src="../../static/img/canlen.png" mode="aspectFill"></image>
|
|
</view>
|
|
</view>
|
|
- <text>{{item.value2}}</text>
|
|
|
|
|
|
+ <text>{{item.issueDate}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
@@ -111,7 +114,7 @@
|
|
<view class="canicon">
|
|
<view class="canicon">
|
|
<image src="../../static/img/canlen.png" mode="aspectFill"></image>
|
|
<image src="../../static/img/canlen.png" mode="aspectFill"></image>
|
|
</view>
|
|
</view>
|
|
- <text>{{item.value3}}</text>
|
|
|
|
|
|
+ <text>{{item.expireDate}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
@@ -120,13 +123,14 @@
|
|
<view class="canicon">
|
|
<view class="canicon">
|
|
<image src="../../static/img/canlen.png" mode="aspectFill"></image>
|
|
<image src="../../static/img/canlen.png" mode="aspectFill"></image>
|
|
</view>
|
|
</view>
|
|
- <text>{{item.value4}}</text>
|
|
|
|
|
|
+ <text>{{item.expectDiscountDate}}</text>
|
|
</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="text" v-model="form.name" placeholder="48542.00元" placeholder-style="color:#1F242A"
|
|
|
|
|
|
+
|
|
|
|
+ <input type="text" v-model="item.loanLimit" placeholder="自动计算得出" placeholder-style="color:#1F242A"
|
|
disabled="true" />
|
|
disabled="true" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -134,31 +138,32 @@
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
<text class="lys">服务费率</text>
|
|
<text class="lys">服务费率</text>
|
|
<view class="inbox">
|
|
<view class="inbox">
|
|
- <input type="text" v-model="form.name" placeholder="显示对于费率" placeholder-style="color:#BEBDBB"
|
|
|
|
- disabled="true" />
|
|
|
|
|
|
+ <input type="digit" v-model="item.serviceRate" placeholder="显示对于费率"
|
|
|
|
+ placeholder-style="color:#BEBDBB" @blur="getserviceRate" @input="getserviceRateIndex(index)"/>
|
|
</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="text" v-model="form.name" placeholder="自动计算得出" placeholder-style="color:#BEBDBB"
|
|
|
|
- disabled="true" />
|
|
|
|
|
|
+ <input type="text" v-model="item.serviceMoney"
|
|
|
|
+ placeholder="自动计算得出" placeholder-style="color:#BEBDBB" disabled="true" />
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="flex4">
|
|
<view class="flex4">
|
|
<view class="listitem">
|
|
<view class="listitem">
|
|
<text class="lys">利率</text>
|
|
<text class="lys">利率</text>
|
|
<view class="inbox">
|
|
<view class="inbox">
|
|
- <input type="text" v-model="form.name" placeholder="显示对于利率" placeholder-style="color:#BEBDBB"
|
|
|
|
- disabled="true" />
|
|
|
|
|
|
+ <input type="digit" v-model="item.interestRate" placeholder="显示对于利率"
|
|
|
|
+ placeholder-style="color:#BEBDBB" @blur="getinterestRate" @input="getinterestRateIndex(index)"/>
|
|
</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="text" v-model="form.name" placeholder="自动计算得出" placeholder-style="color:#BEBDBB"
|
|
|
|
- disabled="true" />
|
|
|
|
|
|
+ <input type="text" v-model="item.interest" placeholder="自动计算得出"
|
|
|
|
+ placeholder-style="color:#BEBDBB" disabled="true" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -168,14 +173,14 @@
|
|
<text
|
|
<text
|
|
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;">
|
|
|
|
- <u-upload :fileList="fileList4" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
|
|
|
- :maxCount="10" width="100" height="100"></u-upload>
|
|
|
|
|
|
+
|
|
|
|
+ <view class="inbox" style="border: none;padding-bottom: 0;" @click="checkIndex(index)">
|
|
|
|
+ <u-upload :fileList="item.picUrls" @afterRead="afterRead" @delete="deletePic" name="4" 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>
|
|
@@ -192,7 +197,10 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-
|
|
|
|
|
|
+ let that
|
|
|
|
+ import {
|
|
|
|
+ mainUrl
|
|
|
|
+ } from '@/http/baseUrl.js';
|
|
import calllips from "@/componet/calllips/calllips.vue"
|
|
import calllips from "@/componet/calllips/calllips.vue"
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -200,100 +208,321 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
-
|
|
|
|
|
|
+
|
|
editall: false,
|
|
editall: false,
|
|
quan: false,
|
|
quan: false,
|
|
dateshow: false,
|
|
dateshow: false,
|
|
opdanum: '',
|
|
opdanum: '',
|
|
state: '',
|
|
state: '',
|
|
- index:0,
|
|
|
|
|
|
+ index: 0,
|
|
start: Number(new Date()),
|
|
start: Number(new Date()),
|
|
fileList1: [],
|
|
fileList1: [],
|
|
fileList2: [],
|
|
fileList2: [],
|
|
fileList3: [],
|
|
fileList3: [],
|
|
fileList4: [],
|
|
fileList4: [],
|
|
- list:[
|
|
|
|
- {
|
|
|
|
|
|
+ allindex:0,
|
|
|
|
+ form: {
|
|
|
|
+ name: '',
|
|
|
|
+ supplierId: '',
|
|
|
|
+ invoicePics: [],
|
|
|
|
+ pics: [],
|
|
|
|
+ tradePics: [],
|
|
|
|
+ contractDrafts: [{
|
|
name: '',
|
|
name: '',
|
|
- tax_no: '',
|
|
|
|
- accepter:'',
|
|
|
|
- drawer:'',
|
|
|
|
- amount: '',
|
|
|
|
- value1: '',
|
|
|
|
- value2: '',
|
|
|
|
- value3: '',
|
|
|
|
- value4: '',
|
|
|
|
- fileList4: [],
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- range: [{
|
|
|
|
- value: 0,
|
|
|
|
- text: "篮球"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- value: 1,
|
|
|
|
- text: "足球"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- value: 2,
|
|
|
|
- text: "游泳"
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ draftNo: '',
|
|
|
|
+ acceptor:'',
|
|
|
|
+ acceptorId: '',
|
|
|
|
+ drawersId: '',
|
|
|
|
+ drawers:'',
|
|
|
|
+ money: '',
|
|
|
|
+ acceptDate: '',
|
|
|
|
+ issueDate: '',
|
|
|
|
+ expireDate: '',
|
|
|
|
+ loanLimit: '',
|
|
|
|
+ expectDiscountDate: '',
|
|
|
|
+ picUrls: [],
|
|
|
|
+ serviceRate: '',
|
|
|
|
+ interestRate:'',
|
|
|
|
+ interest: '',
|
|
|
|
+ serviceMoney: '',
|
|
|
|
+ limitTime:0,
|
|
|
|
+ expectDiscountDateTime:0,
|
|
|
|
+ expectDiscountDate:0
|
|
|
|
+ }, ],
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ range1: [],
|
|
|
|
+ range2: [],
|
|
|
|
+ myindex:0,
|
|
|
|
+ sindex:0,
|
|
|
|
+ rindex:0
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
- let myDate = new Date()
|
|
|
|
- let wk = myDate.getDay()
|
|
|
|
- let yy = String(myDate.getFullYear())
|
|
|
|
- let mm = myDate.getMonth() + 1
|
|
|
|
- let dd = String(myDate.getDate() < 10 ? '0' + myDate.getDate() : myDate.getDate())
|
|
|
|
- let nowDate = yy + '-' + mm + '-' + dd
|
|
|
|
-
|
|
|
|
- this.list.forEach(item=>{
|
|
|
|
- console.log(item)
|
|
|
|
- item.value1 = nowDate
|
|
|
|
- item.value2 = nowDate
|
|
|
|
- item.value3 = nowDate
|
|
|
|
- item.value4 = nowDate
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
|
|
+ that=this
|
|
|
|
+ this.init()
|
|
|
|
+ this.form.supplierId = uni.getStorageSync('supplierId')
|
|
|
|
+ // console.log(this.form.supplierId,778)
|
|
|
|
+ this.loadTime()
|
|
|
|
+
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- upAll(){
|
|
|
|
- console.log()
|
|
|
|
- uni.$u.http.post('/api/Contract', {
|
|
|
|
|
|
+ loadTime(){
|
|
|
|
+ let myDate = new Date()
|
|
|
|
+ // let wk = Date.parse(new Date());
|
|
|
|
+ let wk=myDate.getTime()
|
|
|
|
+ console.log(wk)
|
|
|
|
+ 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.issueDateTime=wk
|
|
|
|
+ let nTime = item.expectDiscountDateTime - item.issueDateTime
|
|
|
|
+ item.limitTime = Math.floor(nTime / 86400000)+1;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ init() {
|
|
|
|
+ // 承兑人列表
|
|
|
|
+ uni.$u.http.post('/api/Acceptor/search', {
|
|
|
|
+
|
|
|
|
+ }, {
|
|
custom: {
|
|
custom: {
|
|
auth: true
|
|
auth: true
|
|
}
|
|
}
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
-
|
|
|
|
- }).catch((err) => {
|
|
|
|
- console.log(err)
|
|
|
|
- })
|
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ this.range1 = res.result
|
|
|
|
+ // for(let i in this.range1){
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ this.range1.forEach((item, index) => {
|
|
|
|
+ this.range1[index].value = index
|
|
|
|
+ this.range1[index].text = item.name
|
|
|
|
+ })
|
|
|
|
+ }).catch((err) => {})
|
|
|
|
+ // 出票人列表
|
|
|
|
+ uni.$u.http.post('/api/Drawer/search', {
|
|
|
|
+
|
|
|
|
+ }, {
|
|
|
|
+ custom: {
|
|
|
|
+ auth: true
|
|
|
|
+ }
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ this.range2 = res.result
|
|
|
|
+ this.range2.forEach((item, index) => {
|
|
|
|
+ this.range2[index].value = index
|
|
|
|
+ this.range2[index].text = item.name
|
|
|
|
+ })
|
|
|
|
+ }).catch((err) => {})
|
|
},
|
|
},
|
|
- addNewBill(){
|
|
|
|
- let form={
|
|
|
|
- name: '',
|
|
|
|
- tax_no: '',
|
|
|
|
- accepter:'',
|
|
|
|
- drawer:'',
|
|
|
|
- amount: '',
|
|
|
|
- value1: '',
|
|
|
|
- value2: '',
|
|
|
|
- value3: '',
|
|
|
|
- value4: '',
|
|
|
|
|
|
+ getinterestRateIndex(index){
|
|
|
|
+ this.rindex=index
|
|
|
|
+ },
|
|
|
|
+ getinterestRate(event){
|
|
|
|
+ this.form.contractDrafts[this.rindex].interestRate=Number(event.detail.value)
|
|
|
|
+ this.getloanLimt(this.rindex)
|
|
|
|
+ this.getInterMoney(this.rindex)
|
|
|
|
+ this.getSerMoney(this.rindex)
|
|
|
|
+ },
|
|
|
|
+ getserviceRateIndex(index){
|
|
|
|
+ this.sindex=index
|
|
|
|
+ },
|
|
|
|
+ getserviceRate(event){
|
|
|
|
+ this.form.contractDrafts[this.sindex].serviceRate=Number(event.detail.value)
|
|
|
|
+ this.getloanLimt(this.sindex)
|
|
|
|
+ this.getInterMoney(this.sindex)
|
|
|
|
+ this.getSerMoney(this.sindex)
|
|
|
|
+ },
|
|
|
|
+ getMoneyIndex(index){
|
|
|
|
+ this.myindex=index
|
|
|
|
+ },
|
|
|
|
+ getMoney(event){
|
|
|
|
+ this.form.contractDrafts[this.myindex].money=Number(event.detail.value)
|
|
|
|
+ this.getloanLimt(this.myindex)
|
|
|
|
+ this.getSerMoney(this.myindex)
|
|
|
|
+ this.getInterMoney(this.myindex)
|
|
|
|
+ },
|
|
|
|
+ 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.list.push(form)
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
- changeacPerson(e){
|
|
|
|
- this.accepter=e
|
|
|
|
|
|
+ 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)
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
- changedrPerson(e){
|
|
|
|
- this.drawer=e
|
|
|
|
|
|
+ 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)
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
- openTime(index,value) {
|
|
|
|
|
|
+ upAll() {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '是否上传合同?',
|
|
|
|
+ success: function (res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ let form=that.form
|
|
|
|
+ if(form.name.length==0){
|
|
|
|
+ that.$toast('请输入合同名称')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(that.fileList1.length==0){
|
|
|
|
+ that.$toast('请上传合同附件')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(form.fileList2.length==0){
|
|
|
|
+ that.$toast('请上传发票附件')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(form.fileList3.length==0){
|
|
|
|
+ that.$toast('请上贸易合同')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ form.contractDrafts.forEach(i=>{
|
|
|
|
+ if(i.name.length==0){
|
|
|
|
+ that.$toast('请输入汇票名称')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(form.draftNo.length==0){
|
|
|
|
+ that.$toast('请输入汇票号码')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(form.acceptor.length==0){
|
|
|
|
+ that.$toast('请选择承兑人')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(form.drawers.length==0){
|
|
|
|
+ that.$toast('请选择出票人')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(form.money.length==0){
|
|
|
|
+ that.$toast('请输入金额')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(form.serviceRate.length==0){
|
|
|
|
+ that.$toast('请输入服务费率')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(form.interestRate.length==0){
|
|
|
|
+ that.$toast('请输入利率')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(form.picUrls.length==0){
|
|
|
|
+ that.$toast('请上传附件')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ 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)
|
|
|
|
+ })
|
|
|
|
+ uni.showLoading()
|
|
|
|
+ uni.$u.http.post('/api/Contract',that.form, {
|
|
|
|
+ custom: {
|
|
|
|
+ auth: true
|
|
|
|
+ }
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ that.$toast("合同上传成功")
|
|
|
|
+ }).catch((err) => {
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ that.$toast(err.msg)
|
|
|
|
+ console.log(err)
|
|
|
|
+ })
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ addNewBill() {
|
|
|
|
+ let form = [{
|
|
|
|
+ name: '',
|
|
|
|
+ draftNo: '',
|
|
|
|
+ acceptor:'',
|
|
|
|
+ acceptorId: '',
|
|
|
|
+ drawersId: '',
|
|
|
|
+ drawers:'',
|
|
|
|
+ money: '',
|
|
|
|
+ acceptDate: '',
|
|
|
|
+ issueDate: '',
|
|
|
|
+ expireDate: '',
|
|
|
|
+ loanLimit: '',
|
|
|
|
+ expectDiscountDate: '',
|
|
|
|
+ picUrls: [],
|
|
|
|
+ serviceRate: '',
|
|
|
|
+ interestRate:'',
|
|
|
|
+ interest: '',
|
|
|
|
+ serviceMoney: '',
|
|
|
|
+ limitTime:0,
|
|
|
|
+ expectDiscountDateTime:0,
|
|
|
|
+ expectDiscountDate:0
|
|
|
|
+ }]
|
|
|
|
+ let myDate = new Date()
|
|
|
|
+ // let wk = Date.parse(new Date());
|
|
|
|
+ let wk=myDate.getTime()
|
|
|
|
+ console.log(wk)
|
|
|
|
+ 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
|
|
|
|
+ form.forEach(item => {
|
|
|
|
+ item.acceptDate = nowDate
|
|
|
|
+ item.issueDate = nowDate
|
|
|
|
+ item.expireDate = nowDate
|
|
|
|
+ item.expectDiscountDate = nowDate
|
|
|
|
+ item.expectDiscountDateTime=wk
|
|
|
|
+ item.issueDateTime=wk
|
|
|
|
+ let nTime = item.expectDiscountDateTime - item.issueDateTime
|
|
|
|
+ item.limitTime = Math.floor(nTime / 86400000)+1;
|
|
|
|
+ })
|
|
|
|
+ this.form.contractDrafts.push(form[0])
|
|
|
|
+ },
|
|
|
|
+ changeacPerson(e) {
|
|
|
|
+ this.acceptor = e
|
|
|
|
+ },
|
|
|
|
+ changedrPerson(e) {
|
|
|
|
+ this.drawers = e
|
|
|
|
+ },
|
|
|
|
+ openTime(index, value) {
|
|
this.dateshow = true
|
|
this.dateshow = true
|
|
- this.index=index
|
|
|
|
|
|
+ this.index = index
|
|
this.opdanum = value
|
|
this.opdanum = value
|
|
},
|
|
},
|
|
closeDate() {
|
|
closeDate() {
|
|
@@ -301,21 +530,26 @@
|
|
},
|
|
},
|
|
confirm(e) {
|
|
confirm(e) {
|
|
const timeFormat = uni.$u.timeFormat
|
|
const timeFormat = uni.$u.timeFormat
|
|
|
|
+ let form = this.form.contractDrafts
|
|
if (this.opdanum == 1) {
|
|
if (this.opdanum == 1) {
|
|
- this.list[this.index].value1 = timeFormat(e.value, 'yyyy-mm-dd')
|
|
|
|
|
|
+ form[this.index].acceptDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
} else if (this.opdanum == 2) {
|
|
} else if (this.opdanum == 2) {
|
|
- this.list[this.index].value2 = timeFormat(e.value, 'yyyy-mm-dd')
|
|
|
|
|
|
+ form[this.index].issueDateTime = e.value
|
|
|
|
+ form[this.index].issueDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
} else if (this.opdanum == 3) {
|
|
} else if (this.opdanum == 3) {
|
|
- this.list[this.index].value3 = 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) {
|
|
- this.list[this.index].value4 = timeFormat(e.value, 'yyyy-mm-dd')
|
|
|
|
|
|
+ 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;
|
|
|
|
+ form[this.index].expectDiscountDate = timeFormat(e.value, 'yyyy-mm-dd')
|
|
}
|
|
}
|
|
- console.log(this.index,this.opdanum)
|
|
|
|
|
|
+ // console.log(this.index, this.opdanum)
|
|
this.dateshow = false
|
|
this.dateshow = false
|
|
},
|
|
},
|
|
- change(e) {
|
|
|
|
- console.log("e:", e);
|
|
|
|
- },
|
|
|
|
|
|
+ change(e) {
|
|
|
|
+ console.log("e:", e);
|
|
|
|
+ },
|
|
open(e) {
|
|
open(e) {
|
|
// console.log('open', e)
|
|
// console.log('open', e)
|
|
},
|
|
},
|
|
@@ -325,9 +559,18 @@
|
|
change(e) {
|
|
change(e) {
|
|
// console.log('change', e)
|
|
// console.log('change', e)
|
|
},
|
|
},
|
|
|
|
+ checkIndex(index){
|
|
|
|
+ this.allindex=index
|
|
|
|
+ console.log(index)
|
|
|
|
+ },
|
|
// 删除图片
|
|
// 删除图片
|
|
deletePic(event) {
|
|
deletePic(event) {
|
|
- this[`fileList${event.name}`].splice(event.index, 1)
|
|
|
|
|
|
+ if(event.name==4){
|
|
|
|
+ this.form.contractDrafts[this.allindex].picUrls.splice(event.index, 1)
|
|
|
|
+ }else{
|
|
|
|
+ this[`fileList${event.name}`].splice(event.index, 1)
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
// 新增图片
|
|
// 新增图片
|
|
async afterRead(event) {
|
|
async afterRead(event) {
|
|
@@ -349,21 +592,33 @@
|
|
message: '',
|
|
message: '',
|
|
url: result
|
|
url: result
|
|
}))
|
|
}))
|
|
|
|
+ if(event.name==4){
|
|
|
|
+ console.log(this.allindex,9999)
|
|
|
|
+ this[`fileList${event.name}`].forEach(item=>{
|
|
|
|
+ this.form.contractDrafts[this.allindex].picUrls.push(item.url)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
fileListLen++
|
|
fileListLen++
|
|
}
|
|
}
|
|
},
|
|
},
|
|
uploadFilePromise(url) {
|
|
uploadFilePromise(url) {
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
let a = uni.uploadFile({
|
|
let a = uni.uploadFile({
|
|
- url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
|
|
|
|
|
|
+ url: mainUrl + '/api/File', // 仅为示例,非真实的接口地址
|
|
filePath: url,
|
|
filePath: url,
|
|
- name: 'file',
|
|
|
|
|
|
+ name: 'File',
|
|
|
|
+ header: {
|
|
|
|
+ "User-Agent": "apifox/1.0.0 (https://www.apifox.cn)"
|
|
|
|
+ },
|
|
formData: {
|
|
formData: {
|
|
- user: 'test'
|
|
|
|
|
|
+ File: JSON.stringify(url),
|
|
},
|
|
},
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ let request=JSON.parse(res.data)
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- resolve(res.data.data)
|
|
|
|
|
|
+ resolve(request.data.file)
|
|
}, 1000)
|
|
}, 1000)
|
|
}
|
|
}
|
|
});
|
|
});
|