Commit 98052e66 authored by caimeng's avatar caimeng

沃日

parent 7e3a28fb
...@@ -87,10 +87,12 @@ ...@@ -87,10 +87,12 @@
<el-form-item label="还款凭证" prop="attach"> <el-form-item label="还款凭证" prop="attach">
<el-upload <el-upload
list-type="picture-card" list-type="picture-card"
:multiple="oss.multiple"
:action="oss.action" :action="oss.action"
:data="oss.data" :data="oss.data"
:limit="3"
:multiple="true"
accept=".jpeg,.jpg,.png" accept=".jpeg,.jpg,.png"
:on-exceed="masterFileMax"
:before-upload="handleBeforeApplyUpload" :before-upload="handleBeforeApplyUpload"
:on-success="handleLoanApplySuccess" :on-success="handleLoanApplySuccess"
:on-remove="handleLoanApplyRemove"> :on-remove="handleLoanApplyRemove">
...@@ -153,7 +155,7 @@ export default { ...@@ -153,7 +155,7 @@ export default {
userDay: '', userDay: '',
userMonth: '', userMonth: '',
memo: '', memo: '',
attach: '', attach: [],
bankAccount: '', bankAccount: '',
bankOwner: '', bankOwner: '',
raiseAmt:'' raiseAmt:''
...@@ -188,6 +190,7 @@ export default { ...@@ -188,6 +190,7 @@ export default {
this.handleClose(); this.handleClose();
} else { } else {
this.ruleForm = res.data.result; this.ruleForm = res.data.result;
this.ruleForm.attach = [];
} }
}).catch(error => { }).catch(error => {
...@@ -200,6 +203,10 @@ export default { ...@@ -200,6 +203,10 @@ export default {
}, },
methods: { methods: {
masterFileMax(files,fileList){
console.log(files, fileList);
this.$message.warning(`最多上传3个文件。`);
},
/** 提交点击 */ /** 提交点击 */
backedTransfer() { backedTransfer() {
...@@ -233,7 +240,8 @@ export default { ...@@ -233,7 +240,8 @@ export default {
tempOss.action = result.host; tempOss.action = result.host;
tempOss.data = data; tempOss.data = data;
this.oss = tempOss; this.oss = tempOss;
this.ruleForm.attach = result.dir const cacheImg = this.ruleForm.attach;
this.ruleForm.attach = cacheImg.concat(result.dir)
}); });
}, },
...@@ -242,7 +250,7 @@ export default { ...@@ -242,7 +250,7 @@ export default {
}, },
handleLoanApplyRemove(res, file, fileList) { handleLoanApplyRemove(res, file, fileList) {
this.ruleForm.attach = fileList
}, },
//参数 //参数
buildParam() { buildParam() {
......
<template> <template>
<el-dialog <el-dialog :append-to-body="true" class="client-data-dialog" title="创建转账还款单" width="60%" :visible.sync="visible"
:append-to-body="true"
class="client-data-dialog"
title="创建转账还款单"
width="60%"
:visible.sync="visible"
:before-close="handleClose"> :before-close="handleClose">
<div class="b-table"> <div class="b-table">
...@@ -32,13 +27,8 @@ ...@@ -32,13 +27,8 @@
</table> </table>
</div> </div>
<el-form <el-form size="small" label-suffix=":" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="140px"
size="small" class="demo-ruleForm">
label-suffix=":"
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="140px" class="demo-ruleForm">
<el-form-item label="还款银行账号" prop="bankAccount"> <el-form-item label="还款银行账号" prop="bankAccount">
<el-col :span="20"> <el-col :span="20">
<el-input v-model="ruleForm.bankAccount" placeholder="请输入还款银行账号"></el-input> <el-input v-model="ruleForm.bankAccount" placeholder="请输入还款银行账号"></el-input>
...@@ -55,14 +45,8 @@ ...@@ -55,14 +45,8 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="还款凭证" prop="attach"> <el-form-item label="还款凭证" prop="attach">
<el-upload <el-upload list-type="picture-card" :on-exceed="masterFileMax" :limit="3" :multiple="true" :action="oss.action" :data="oss.data"
list-type="picture-card" accept=".jpeg,.jpg,.png" :before-upload="handleBeforeApplyUpload" :on-success="handleLoanApplySuccess"
:multiple="oss.multiple"
:action="oss.action"
:data="oss.data"
accept=".jpeg,.jpg,.png"
:before-upload="handleBeforeApplyUpload"
:on-success="handleLoanApplySuccess"
:on-remove="handleLoanApplyRemove"> :on-remove="handleLoanApplyRemove">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
</el-upload> </el-upload>
...@@ -136,7 +120,7 @@ export default { ...@@ -136,7 +120,7 @@ export default {
planAmt: '', planAmt: '',
planBen: '', planBen: '',
planXi: '', planXi: '',
attach: '', attach: [],
planNo: '', planNo: '',
bankAccount: '', bankAccount: '',
bankOwner: '', bankOwner: '',
...@@ -144,16 +128,16 @@ export default { ...@@ -144,16 +128,16 @@ export default {
memo: '', memo: '',
}, },
rules: { rules: {
bankAccount: [{required: true, message: '请输入还款银行账号', trigger: 'blur'}], bankAccount: [{ required: true, message: '请输入还款银行账号', trigger: 'blur' }],
bankOwner: [{required: true, message: '请输入还款银行账户名称', trigger: 'blur'}], bankOwner: [{ required: true, message: '请输入还款银行账户名称', trigger: 'blur' }],
planAmt: [{required: true, message: '请输入还款金额', trigger: 'blur'}], planAmt: [{ required: true, message: '请输入还款金额', trigger: 'blur' }],
attach: [{required: true, message: '请添加还款凭证', trigger: 'blur'}], attach: [{ required: true, message: '请添加还款凭证', trigger: 'blur' }],
}, },
loginName: '', loginName: '',
oss: { oss: {
action: '', action: '',
data: {}, data: {},
multiple: false, multiple: true,
}, },
} }
}, },
...@@ -170,6 +154,7 @@ export default { ...@@ -170,6 +154,7 @@ export default {
planBen: this.planBen, planBen: this.planBen,
planXi: this.planXi, planXi: this.planXi,
accountAmt: this.accountAmt, accountAmt: this.accountAmt,
attach: []
} }
}, },
...@@ -178,6 +163,12 @@ export default { ...@@ -178,6 +163,12 @@ export default {
}, },
methods: { methods: {
masterFileMax(files,fileList){
console.log(files, fileList);
this.$message.warning(`最多上传3个文件。`);
},
/** 提交点击 */ /** 提交点击 */
backedTransfer() { backedTransfer() {
this.$refs['ruleForm'].validate((valid) => { this.$refs['ruleForm'].validate((valid) => {
...@@ -189,7 +180,7 @@ export default { ...@@ -189,7 +180,7 @@ export default {
this.$message.error(res.data.message); this.$message.error(res.data.message);
return return
} }
this.$message({message: '操作成功', type: 'success'}); this.$message({ message: '操作成功', type: 'success' });
this.handleClose(); this.handleClose();
this.$emit('callback') this.$emit('callback')
}) })
...@@ -200,6 +191,7 @@ export default { ...@@ -200,6 +191,7 @@ export default {
}, },
handleBeforeApplyUpload(file) { handleBeforeApplyUpload(file) {
try {
var attachType = 'LOESS_TRANSFER_APPLY' var attachType = 'LOESS_TRANSFER_APPLY'
return this.$$get(`/oss/signature/?fileType=` + attachType + "&fileName=" + file.name).then(res => { return this.$$get(`/oss/signature/?fileType=` + attachType + "&fileName=" + file.name).then(res => {
if (res.data.code != 200) { if (res.data.code != 200) {
...@@ -216,16 +208,22 @@ export default { ...@@ -216,16 +208,22 @@ export default {
tempOss.action = result.host; tempOss.action = result.host;
tempOss.data = data; tempOss.data = data;
this.oss = tempOss; this.oss = tempOss;
this.ruleForm.attach = result.dir const cacheImg = this.ruleForm.attach;
this.ruleForm.attach = cacheImg.concat(result.dir)
}); });
} catch (err) {
console.log('沃日')
this.$message.error(res.data.message);
}
}, },
handleLoanApplySuccess(res, file, fileList) { handleLoanApplySuccess(res, file, fileList) {
this.$notify({title: '成功', message: file.name + ",上传成功", type: 'success'}); this.$notify({ title: '成功', message: file.name + ",上传成功", type: 'success' });
}, },
handleLoanApplyRemove(res, file, fileList) { handleLoanApplyRemove(file, fileList) {
console.log(file,fileList,'=====删除')
this.ruleForm.attach = fileList
}, },
//参数 //参数
...@@ -256,6 +254,4 @@ export default { ...@@ -256,6 +254,4 @@ export default {
} }
</script> </script>
<style scoped> <style scoped></style>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment