文件
mashangyoujiu/Application/Retail/View/FranchiseDeal/reconciliation.html

179 行
6.8 KiB
HTML
可执行文件

<!DOCTYPE html>
<html>
<!--申请平账详情-->
<!--[1.5.37]-->
<style>
#reconciliation .title {
padding: 0 0 40px;
font-size: 15px;
color: #333;
}
#reconciliation .price-1 {
font-size: 20px !important;
font-weight: bold;
color: #f56c6c;
}
</style>
<div id="reconciliation" v-cloak style="padding: 20px">
<div class="title">{{data.store_name}} - {{data.franchisee_time}}</div>
<el-form label-width="136px" id="form">
<input type="hidden" name="id" v-model="data.id">
<el-form-item label="结算账户:" size="small" required>
<div v-if="clearing_form==1">银行卡</div>
<div v-if="clearing_form==2">支付宝</div>
</el-form-item>
<el-form-item label="账号:" size="small">{{bank_number}}</el-form-item>
<el-form-item label="开户行信息:" v-if="clearing_form==1">{{opening_bank}}</el-form-item>
<el-form-item label="姓名:" size="small">{{name}}</el-form-item>
<el-form-item label="打款金额:" size="small"><span class="price-1">{{data.money*-1}}</span></el-form-item>
<el-form-item label="打款凭证:" size="small" required>
<label class="file_label">
<input type="file"
name="image"
:disabled="disabled"
@change="chooseImg"
placeholder="选择图片"
accept="image/png,image/jpeg"/>
<img style="max-height: 300px;max-width: 100px;" :src='image'>
</label>
</el-form-item>
</el-form>
<div style="margin-left: 140px;">
<el-button type="primary" :disabled="disabled" @click="submit">申请平账</el-button>
</div>
</div>
<script type="text/javascript">
var reconciliation = new Vue({
el: '#reconciliation',
data: function () {
return {
status: 6,
data: {},
clearing_form: "",
bank_number: "",
account_holder: "",
opening_bank: "",
name: "",
image: '__PUBLIC__/paper/images/wx_add.png',
disabled: true,
}
},
methods: {
//获取商户收款账号信息
getData() {
$.ajax({
url: "{:U('applyFlat')}",
type: 'post',
data: {},
dataType: 'json',
success: res => {
console.log(res)
if (res.status == 1) {
this.clearing_form = res.data.clearing_form;
this.bank_number = res.data.account_number;
this.opening_bank = res.data.opening_bank;
this.name = res.data.name;
this.disabled = false;
} else {
this.disabled = true;
this.$message({
type: 'error',
message: res.msg,
duration: 3000,
});
}
},
error: res => {
this.requestError(res);
}
})
},
//错误提示
requestError(res) {
console.log(res);
this.$confirm("请求发生错误", "错误提示", {
confirmButtonText: '确定',
showCancelButton: false,
type: 'error'
}).then(() => {
}).catch(() => {
})
},
//提交平账申请
submit() {
// 申请平账图片条件判断
if (!$("input[name='image']").val()) {
this.$message({
type: 'warning',
message: '请上传打款凭证',
duration: 1000
});
return false;
}
// 图片接口
var fd = new FormData(document.getElementById('form'));
$.ajax({
url: "{:U('flatFile')}",
type: 'post',
data: fd,
processData: false, // jQuery不要去处理发送的数据
contentType: false, // jQuery不要去设置Content-Type请求头
success: (res) => {
if (res.status == 1) {
this.$message({
type: 'success',
message: res.msg,
duration: 1000,
onClose: function () {
MenuApp.backPreview();
},
});
} else {
this.$message({
type: 'error',
message: res.msg,
duration: 3000,
});
}
},
error: res => {
this.requestError(res);
}
})
},
//选择图片
chooseImg: function () {
if (window.event.target.files.length) {
var imgObj = window.event.target.files[0];
console.log(imgObj);
if (1024 * 1024 * 3 < imgObj.size) {
this.$message({
type: 'error',
message: '图片不能大于3M',
duration: 3000,
});
$("input[name='image']").val('')
return;
}
var imgType = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'];
if (jQuery.inArray(imgObj.type, imgType) != -1) {
//是图片
var reader = new FileReader();
reader.readAsDataURL(imgObj);
var that = this;
reader.onload = function () {
that.image = this.result;
}
}
}
}
},
mounted() {
this.getData();
},
created: function () {
this.data = JSON.parse(sessionStorage.getItem("reconciliation"));
}
});
</script>