pull/1/head
xiaozhiyong 2 years ago
parent 549a529174
commit 77dde3628a
  1. 2
      src/api/financialCenter/enterpriseRecharge.js
  2. 7
      src/utils/axios.js
  3. 26
      src/views/financialCenter/enterpriseRecharge/components/add.vue

@ -21,7 +21,7 @@ const save = (params) => {
};
// 修改
const update = (params) => {
return request.postJson(
return request.postPut(
"/oil-finance/oilCompanyAccountReverse/update",
params
);

@ -24,6 +24,13 @@ export default {
data: data,
});
},
postPut(url, data) {
return axios({
url: url,
method: "put",
data: data,
});
},
postFromData(url, data) {
return axios({
url: url,

@ -105,10 +105,17 @@
>
<el-upload
:action="uploadUrl"
:data="{
ossKey: 'xingyou',
pathKey: 'other',
encrypt: 'PUBLIC',
code: 'A003',
}"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:on-success="handleSuccess"
:before-upload="beforeHandle"
:limit="1"
:file-list="fileList"
>
@ -281,6 +288,17 @@ export default {
this.handleRemove();
}
},
beforeHandle(file) {
if (file.type.indexOf("image/") === -1) {
this.$message.error("上传的文件不是图片格式!");
return false;
} else if (file.size / 1024 / 1024 > 5) {
this.$message.error("上传图片大小不能超过 5MB!");
return false;
}
return true;
},
//img
handlePictureCardPreview(file) {
this.form.offlineTransactionProof = file.url;
@ -292,9 +310,13 @@ export default {
},
//
handleSuccess(response, file, fileList) {
if (response.code === 20000) {
this.form.offlineTransactionProof = response.data.publicUrl;
if (response.code !== 20000) {
this.$message.error(response.msg);
this.fileList = [];
return;
}
console.log("response", response);
this.form.offlineTransactionProof = response.data.publicUrl;
},
//
getCascaderList() {

Loading…
Cancel
Save