|
@@ -1,6 +1,6 @@
|
|
<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
|
|
<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
|
|
<div>
|
|
<div>
|
|
- <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="status === 'audit' || status === 'taskFormDetail'"
|
|
|
|
|
|
+ <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"
|
|
label-width="160px" @submit.native.prevent>
|
|
label-width="160px" @submit.native.prevent>
|
|
<el-divider content-position="left"><i class="el-icon-document"></i>
|
|
<el-divider content-position="left"><i class="el-icon-document"></i>
|
|
借款申请
|
|
借款申请
|
|
@@ -27,7 +27,7 @@
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="借款金额(小写)" prop="moneyLower"
|
|
<el-form-item label="借款金额(小写)" prop="moneyLower"
|
|
:rules="[{required: true, message:'请输入借款金额(小写)', trigger:'blur'}]">
|
|
:rules="[{required: true, message:'请输入借款金额(小写)', trigger:'blur'}]">
|
|
- <el-input v-on:input="inputForm.moneyLower=inputForm.moneyLower.replace(/[^\d.]/g,'')
|
|
|
|
|
|
+ <el-input v-on:input="inputForm.moneyLower=inputForm.moneyLower.replace(/[^\d.]/g,'')
|
|
.replace(/^\./g,'')
|
|
.replace(/^\./g,'')
|
|
.replace(/\.{2,}/g,'.')
|
|
.replace(/\.{2,}/g,'.')
|
|
.replace('.','$#$').replace(/\./g,'').replace('$#$','.')
|
|
.replace('.','$#$').replace(/\./g,'').replace('$#$','.')
|
|
@@ -47,6 +47,8 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <!-- 附件 -->
|
|
|
|
+ <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -56,6 +58,7 @@
|
|
import BorrowService from '@/api/jy/BorrowService'
|
|
import BorrowService from '@/api/jy/BorrowService'
|
|
import { ElDatePicker } from 'element-plus';
|
|
import { ElDatePicker } from 'element-plus';
|
|
import CommonApi from '@/api/cw/common/CommonApi'
|
|
import CommonApi from '@/api/cw/common/CommonApi'
|
|
|
|
+ import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
businessId: {
|
|
businessId: {
|
|
@@ -86,7 +89,8 @@
|
|
moneyLower:'', // 借款金额小写
|
|
moneyLower:'', // 借款金额小写
|
|
money:'', //借款金额大写
|
|
money:'', //借款金额大写
|
|
procInsId:'',
|
|
procInsId:'',
|
|
- status:''
|
|
|
|
|
|
+ status:'',
|
|
|
|
+ files:[]
|
|
},
|
|
},
|
|
baseKey: '',
|
|
baseKey: '',
|
|
keyWatch: '',
|
|
keyWatch: '',
|
|
@@ -105,11 +109,13 @@
|
|
activated () {
|
|
activated () {
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
- ElDatePicker
|
|
|
|
|
|
+ ElDatePicker,
|
|
|
|
+ UpLoadComponent,
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
bus: {
|
|
bus: {
|
|
get () {
|
|
get () {
|
|
|
|
+ this.$refs.uploadComponent.setDividerName('附件')
|
|
return this.businessId
|
|
return this.businessId
|
|
},
|
|
},
|
|
set (val) {
|
|
set (val) {
|
|
@@ -135,6 +141,7 @@
|
|
'loading': {
|
|
'loading': {
|
|
handler (newVal) {
|
|
handler (newVal) {
|
|
this.$emit('changeLoading', newVal)
|
|
this.$emit('changeLoading', newVal)
|
|
|
|
+ this.$refs.uploadComponent.changeLoading(newVal)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -153,7 +160,8 @@
|
|
reason: '',
|
|
reason: '',
|
|
moneyLower:'', // 借款金额小写
|
|
moneyLower:'', // 借款金额小写
|
|
money:'', //借款金额大写
|
|
money:'', //借款金额大写
|
|
- procInsId:''
|
|
|
|
|
|
+ procInsId:'',
|
|
|
|
+ files:[]
|
|
}
|
|
}
|
|
this.inputForm.id = id
|
|
this.inputForm.id = id
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -161,8 +169,8 @@
|
|
this.$refs.inputForm.resetFields()
|
|
this.$refs.inputForm.resetFields()
|
|
this.loading = true
|
|
this.loading = true
|
|
if (this.commonJS.isNotEmpty(this.inputForm.id)) {
|
|
if (this.commonJS.isNotEmpty(this.inputForm.id)) {
|
|
- console.log('this.inputForm.id', this.inputForm.id)
|
|
|
|
this.borrowService.queryById(this.inputForm.id).then((data)=>{
|
|
this.borrowService.queryById(this.inputForm.id).then((data)=>{
|
|
|
|
+ this.$refs.uploadComponent.clearUpload()
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
if (this.commonJS.isEmpty(this.inputForm.createName)){
|
|
if (this.commonJS.isEmpty(this.inputForm.createName)){
|
|
this.inputForm.createName=this.$store.state.user.name
|
|
this.inputForm.createName=this.$store.state.user.name
|
|
@@ -172,7 +180,16 @@
|
|
if (this.commonJS.isEmpty(this.inputForm.createTime)){
|
|
if (this.commonJS.isEmpty(this.inputForm.createTime)){
|
|
this.inputForm.createTime=this.moment(new Date()).format('YYYY-MM-DD')
|
|
this.inputForm.createTime=this.moment(new Date()).format('YYYY-MM-DD')
|
|
}
|
|
}
|
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.files)) {
|
|
|
|
+ this.inputForm.files = []
|
|
|
|
+ }
|
|
|
|
+ if (this.status === 'audit' || this.status === 'taskFormDetail') {
|
|
|
|
+ method = 'view'
|
|
|
|
+ }
|
|
|
|
+ this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'borrowMoney')
|
|
})
|
|
})
|
|
|
|
+ console.log('this.inputForm', this.inputForm)
|
|
|
|
+
|
|
this.loading = false
|
|
this.loading = false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -206,6 +223,11 @@
|
|
throw new Error()
|
|
throw new Error()
|
|
} else {
|
|
} else {
|
|
this.inputForm.status= '2'
|
|
this.inputForm.status= '2'
|
|
|
|
+ if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
|
+ this.loading = false
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.inputForm.files = this.$refs.uploadComponent.getDataList()
|
|
this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data)=>{
|
|
this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data)=>{
|
|
if (this.commonJS.isNotEmpty(data)) {
|
|
if (this.commonJS.isNotEmpty(data)) {
|
|
if (data === '总经理审核') {
|
|
if (data === '总经理审核') {
|
|
@@ -238,12 +260,20 @@
|
|
// 表单提交
|
|
// 表单提交
|
|
async doSubmit(status, callback) {
|
|
async doSubmit(status, callback) {
|
|
this.loading = true
|
|
this.loading = true
|
|
|
|
+ if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
|
+ this.loading = false
|
|
|
|
+ return
|
|
|
|
+ }
|
|
console.log('5',this.inputForm)
|
|
console.log('5',this.inputForm)
|
|
if (status === 'save') {
|
|
if (status === 'save') {
|
|
// 暂存
|
|
// 暂存
|
|
this.loading = true
|
|
this.loading = true
|
|
this.inputForm.status = '1'
|
|
this.inputForm.status = '1'
|
|
this.inputForm.createTime=''
|
|
this.inputForm.createTime=''
|
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.files)) {
|
|
|
|
+ this.inputForm.files = []
|
|
|
|
+ }
|
|
|
|
+ this.inputForm.files = this.$refs.uploadComponent.getDataList()
|
|
this.borrowService.saveForm(this.inputForm).then((data) => {
|
|
this.borrowService.saveForm(this.inputForm).then((data) => {
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -272,6 +302,10 @@
|
|
if (valid) {
|
|
if (valid) {
|
|
this.loading = true
|
|
this.loading = true
|
|
console.log('form',this.inputForm)
|
|
console.log('form',this.inputForm)
|
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.files)) {
|
|
|
|
+ this.inputForm.files = []
|
|
|
|
+ }
|
|
|
|
+ this.inputForm.files = this.$refs.uploadComponent.getDataList()
|
|
this.borrowService.saveForm(this.inputForm).then((data) => {
|
|
this.borrowService.saveForm(this.inputForm).then((data) => {
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
this.$refs.inputForm.resetFields()
|
|
this.$refs.inputForm.resetFields()
|
|
@@ -302,6 +336,7 @@
|
|
number:'', //用印份数
|
|
number:'', //用印份数
|
|
projectId:'',
|
|
projectId:'',
|
|
}
|
|
}
|
|
|
|
+ this.$refs.uploadComponent.clearUpload()
|
|
this.visible = false
|
|
this.visible = false
|
|
},
|
|
},
|
|
async updateStatusById(type, callback) {
|
|
async updateStatusById(type, callback) {
|