|
@@ -61,8 +61,9 @@
|
|
|
|
|
|
<!-- 查看弹层 -->
|
|
<!-- 查看弹层 -->
|
|
<el-dialog title="充值凭证" :visible.sync="seeDialogVisible" width="20%" class="seeDialog">
|
|
<el-dialog title="充值凭证" :visible.sync="seeDialogVisible" width="20%" class="seeDialog">
|
|
|
|
+ <!-- display: flex;align-items: center;margin: auto; -->
|
|
<el-image
|
|
<el-image
|
|
- style="width: 200px; height: 200px"
|
|
|
|
|
|
+ style="width: 200px;height:200px;"
|
|
:src="url"
|
|
:src="url"
|
|
:preview-src-list="srcList">
|
|
:preview-src-list="srcList">
|
|
</el-image>
|
|
</el-image>
|
|
@@ -236,11 +237,15 @@ export default {
|
|
},
|
|
},
|
|
// 获取充值列表
|
|
// 获取充值列表
|
|
async getVoucherList() {
|
|
async getVoucherList() {
|
|
- const res = await getVoucherList()
|
|
|
|
- console.log('充值', res);
|
|
|
|
- if (res && res.code == 200) {
|
|
|
|
- this.tableData = res.datas.data
|
|
|
|
- this.total = res.datas.total * this.pageSize
|
|
|
|
|
|
+ try {
|
|
|
|
+ const res = await getVoucherList()
|
|
|
|
+ console.log('充值', res);
|
|
|
|
+ if (res && res.code == 200) {
|
|
|
|
+ this.tableData = res.datas.data
|
|
|
|
+ this.total = res.datas.total * this.pageSize
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 分页
|
|
// 分页
|
|
@@ -248,11 +253,32 @@ export default {
|
|
if (page == this.pageNumber) {
|
|
if (page == this.pageNumber) {
|
|
return;
|
|
return;
|
|
} else {
|
|
} else {
|
|
- this.pageNumber = page;
|
|
|
|
|
|
+ try {
|
|
|
|
+ this.pageNumber = page;
|
|
|
|
+ this.startTime = this.dataRange[0]/1000 || ''
|
|
|
|
+ this.endTime = this.dataRange[1]/1000 || ''
|
|
|
|
+ let param = new URLSearchParams()
|
|
|
|
+ param.append('curpage', this.pageNumber)
|
|
|
|
+ param.append('start_time', this.startTime)
|
|
|
|
+ param.append('end_time', this.endTime)
|
|
|
|
+ // const res = await queryVoucherList(this.pageNumber,this.startTime, this.endTime)
|
|
|
|
+ const res = await queryVoucherList(param)
|
|
|
|
+ console.log('查询动账', res);
|
|
|
|
+ if (res && res.code == 200) {
|
|
|
|
+ this.tableData = res.datas.data
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 搜索
|
|
|
|
+ async onSearch() {
|
|
|
|
+ try {
|
|
this.startTime = this.dataRange[0]/1000 || ''
|
|
this.startTime = this.dataRange[0]/1000 || ''
|
|
this.endTime = this.dataRange[1]/1000 || ''
|
|
this.endTime = this.dataRange[1]/1000 || ''
|
|
let param = new URLSearchParams()
|
|
let param = new URLSearchParams()
|
|
- param.append('curpage', this.pageNumber)
|
|
|
|
|
|
+ param.append('curpage', 1)
|
|
param.append('start_time', this.startTime)
|
|
param.append('start_time', this.startTime)
|
|
param.append('end_time', this.endTime)
|
|
param.append('end_time', this.endTime)
|
|
// const res = await queryVoucherList(this.pageNumber,this.startTime, this.endTime)
|
|
// const res = await queryVoucherList(this.pageNumber,this.startTime, this.endTime)
|
|
@@ -260,23 +286,10 @@ export default {
|
|
console.log('查询动账', res);
|
|
console.log('查询动账', res);
|
|
if (res && res.code == 200) {
|
|
if (res && res.code == 200) {
|
|
this.tableData = res.datas.data
|
|
this.tableData = res.datas.data
|
|
|
|
+ this.total = res.datas.total * this.pageSize
|
|
}
|
|
}
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 搜索
|
|
|
|
- async onSearch() {
|
|
|
|
- this.startTime = this.dataRange[0]/1000 || ''
|
|
|
|
- this.endTime = this.dataRange[1]/1000 || ''
|
|
|
|
- let param = new URLSearchParams()
|
|
|
|
- param.append('curpage', 1)
|
|
|
|
- param.append('start_time', this.startTime)
|
|
|
|
- param.append('end_time', this.endTime)
|
|
|
|
- // const res = await queryVoucherList(this.pageNumber,this.startTime, this.endTime)
|
|
|
|
- const res = await queryVoucherList(param)
|
|
|
|
- console.log('查询动账', res);
|
|
|
|
- if (res && res.code == 200) {
|
|
|
|
- this.tableData = res.datas.data
|
|
|
|
- this.total = res.datas.total * this.pageSize
|
|
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
@@ -327,46 +340,40 @@ export default {
|
|
},
|
|
},
|
|
// 上传按钮
|
|
// 上传按钮
|
|
async onSubmit() {
|
|
async onSubmit() {
|
|
|
|
+ try {
|
|
|
|
+ let fd = new FormData(document.getElementById("uploadForm"));
|
|
|
|
+ fd.append('file', this.fileImg);
|
|
|
|
+ console.log('fd', fd);
|
|
|
|
+ const res = await updateVoucher(fd) // 调用接口实现文件上传
|
|
|
|
+ console.log('res', res);
|
|
|
|
+ if (res && res.code == 200) {
|
|
|
|
+ this.file_path = res.datas.file_path
|
|
|
|
+ }
|
|
|
|
|
|
- //关于formdata使用方式请自行搜索
|
|
|
|
- let uploadForm = document.getElementById("uploadForm");
|
|
|
|
- console.log('uploadForm',uploadForm);
|
|
|
|
- let fd = new FormData(document.getElementById("uploadForm"));
|
|
|
|
- fd.append('file', this.fileImg);
|
|
|
|
- console.log('fd', fd);
|
|
|
|
- const res = await updateVoucher(fd) // 调用接口实现文件上传
|
|
|
|
- console.log('res', res);
|
|
|
|
- if (res && res.code == 200) {
|
|
|
|
- this.file_path = res.datas.file_path
|
|
|
|
|
|
+ // 上传凭证列表
|
|
|
|
+ this.$nextTick(async () => {
|
|
|
|
+ let param = new URLSearchParams()
|
|
|
|
+ param.append('amount', this.formData.amount)
|
|
|
|
+ param.append('bank_username', this.formData.bank_username)
|
|
|
|
+ param.append('bank_name', this.formData.bank_name)
|
|
|
|
+ param.append('voucher', this.file_path)
|
|
|
|
+ // const result = await updateVoucherList({
|
|
|
|
+ // amount: this.formData.amount,
|
|
|
|
+ // bank_username: this.formData.bank_username,
|
|
|
|
+ // bank_name: this.formData.bank_name,
|
|
|
|
+ // voucher: this.file_path
|
|
|
|
+ // })
|
|
|
|
+ const result = await updateVoucherList(param)
|
|
|
|
+ console.log('result', result);
|
|
|
|
+ if (result && result.code == 200) {
|
|
|
|
+ this.$message.success('上传成功')
|
|
|
|
+ this.uploadDialogVisible = false
|
|
|
|
+ this.getVoucherList()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
}
|
|
}
|
|
-
|
|
|
|
- // const res = await this.$axios.post('http://192.168.1.195/upfile.php', {
|
|
|
|
- // name: fd
|
|
|
|
- // })
|
|
|
|
- // console.log('res', res);
|
|
|
|
-
|
|
|
|
- // 上传凭证列表
|
|
|
|
- this.$nextTick(async () => {
|
|
|
|
- let param = new URLSearchParams()
|
|
|
|
- param.append('amount', this.formData.amount)
|
|
|
|
- param.append('bank_username', this.formData.bank_username)
|
|
|
|
- param.append('bank_name', this.formData.bank_name)
|
|
|
|
- param.append('voucher', this.file_path)
|
|
|
|
- // const result = await updateVoucherList({
|
|
|
|
- // amount: this.formData.amount,
|
|
|
|
- // bank_username: this.formData.bank_username,
|
|
|
|
- // bank_name: this.formData.bank_name,
|
|
|
|
- // voucher: this.file_path
|
|
|
|
- // })
|
|
|
|
- const result = await updateVoucherList(param)
|
|
|
|
- console.log('result', result);
|
|
|
|
- if (result && result.code == 200) {
|
|
|
|
- this.$message.success('上传成功')
|
|
|
|
- this.uploadDialogVisible = false
|
|
|
|
- this.getVoucherList()
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -409,6 +416,15 @@ export default {
|
|
.updata /deep/ .el-dialog__footer {
|
|
.updata /deep/ .el-dialog__footer {
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
|
|
+/* 查看弹层 图片居中 */
|
|
|
|
+.seeDialog .el-image {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin: auto;
|
|
|
|
+}
|
|
|
|
+.seeDialog /deep/.el-image__inner {
|
|
|
|
+ height: auto;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
<style>
|
|
<style>
|
|
.el-main {
|
|
.el-main {
|