feat: 账户管理充值

pull/1/head
douqi 2 years ago
parent 822f000c1d
commit d53a293bf4
  1. 10
      src/api/financialCenter/accountManagement.js
  2. 72
      src/views/financialCenter/accountManagement/components/recharge.vue
  3. 8
      src/views/financialCenter/accountManagement/index.vue

@ -17,6 +17,13 @@ const updateAccountState = (params) => {
const get = (id) => {
return request.get(`/oil-finance/oilCompanyAccount/get/${id}`);
};
//保存
const save = (params) => {
return request.postJson(
"/oil-finance/oilCompanyAccountReverse/save",
params
);
};
// //详情
// const getCompanyAccountRecord = (params) => {
// return request.postJson(
@ -27,5 +34,6 @@ const get = (id) => {
export default {
getByPage,
updateAccountState,
get
get,
save
};

@ -2,20 +2,20 @@
<el-dialog
title="充值"
:visible.sync="controlWindows.recharge"
width="30%"
width="55%"
:before-close="closeWindow"
@opened="openDrawer"
>
<div class="recharge.vue">
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form ref="form" :rules="rules" :model="oilCompanyAccountReverse" label-width="120px">
<el-row :gutter="gridNum.row.gutter">
<el-col :span="12">
<el-form-item label="交易类型" prop="transactionType" @click="transactionTypeChange">
<el-select v-model="oilCompanyAccountReverse.transactionType" >
<el-option label="充值" value="RECHARGE" />
<el-option label="销账" value="REVOKE" />
<el-option label="赊销" value="CHARGE_SALES" />
<el-option label="消费返利" value="CONSUME_REBATE" />
<!-- <el-option label="销账" value="REVOKE" />-->
<!-- <el-option label="赊销" value="CHARGE_SALES" />-->
<!-- <el-option label="消费返利" value="CONSUME_REBATE" />-->
</el-select>
</el-form-item>
</el-col>
@ -67,7 +67,6 @@
list-type="picture-card"
:on-preview="offlineTransactionProofPreview"
:on-success="offlineTransactionProofSuccess"
:before-upload="imgCompress"
:on-remove="offlineTransactionProofRemove"
:headers="headers"
:data="{'code':'A003'}"
@ -97,14 +96,31 @@
<script>
import serve from "api/financialCenter/accountManagement.js";
import utils from "utils/encode";
const JSESSIONID = utils.uuid();
export default {
props: {
controlWindows: Object,
oilCompanyAccount: {
type: Object,
default() {
}
}
},
data() {
return {
form: {},
uploadUrl:
process.env.VUE_APP_ENV === "development"
? "/api/oil-oss/obejct/uploadFile"
: "/adminapi/oil-oss/obejct/uploadFile",
imgDialog: false,
headers: {
dataSources: "WEB",
Authorization: localStorage.getItem("token"),
JSESSIONID: JSESSIONID,
token: utils.bcrypt(JSESSIONID),
},
oilCompanyAccountReverse: {
offlineTransactionProof: undefined,
offlineTransactionProofImageShow: undefined,
@ -119,6 +135,7 @@ export default {
auditMark: 0,
createSource: 'WEBM'
},
imgeDialogVisible: false, // 线
gridNum: {
row: {
gutter: 2
@ -153,16 +170,40 @@ export default {
},
methods: {
openDrawer() {},
transactionTypeChange(type) { //
if (this.oilCompanyAccountReverse.transactionType === 'CHARGE_SALES' || this.oilCompanyAccountReverse.transactionType === 'REVOKE') {
this.oilCompanyAccountReverse.rechargeRebate = 0
this.oilCompanyAccountReverse.rechargeRebateAmount = 0
}
},
offlineTransactionProofRemove() { // 线
this.oilCompanyAccountReverse.offlineTransactionProofImageShow = undefined
this.oilCompanyAccountReverse.offlineTransactionProof = undefined
},
offlineTransactionProofSuccess(response, file) { // 线
console.log('response', response)
if (response.code === 20000) {
this.oilCompanyAccountReverse.offlineTransactionProof = response.data.path
}
},
offlineTransactionProofPreview(file) { //
this.oilCompanyAccountReverse.offlineTransactionProofImageShow = file.url
this.imgeDialogVisible = true
},
submit() {
this.$refs["form"].validate((valid) => {
this.$refs['form'].validate((valid) => {
if (valid) {
Object.assign(this.form, this.controlWindows.addInfo);
serve.modifyPrice(this.form).then((res) => {
this.$message.success(res.msg);
this.closeWindow();
});
this.save(this.oilCompanyAccountReverse)
}
});
})
},
save() {
//
serve.save(this.oilCompanyAccountReverse).then(res => {
this.$message.success(res.msg)
this.$emit('closeDialog')
this.$emit('getByPage')
})
},
closeWindow() {
this.form = {};
@ -176,4 +217,3 @@ export default {
};
</script>
</style>

@ -144,9 +144,8 @@
<!-- 分页 -->
<pagination :parameter="parameter" @searchAgain="getByPage" />
</div>
<!-- 添加充值 -->
<recharge :controlWindows="controlWindows" @closeWindow="closeDialog" />
<recharge :controlWindows="controlWindows" :oil-company-account="oilCompanyAccount" @getByPage="getByPage" @closeWindow="closeDialog" />
</div>
</template>
@ -205,7 +204,9 @@ export default {
currentPage: 1,
pageSize: 10,
total: 0,
params: {},
params: {
},
},
accountStateEnum: [
{
@ -277,6 +278,7 @@ export default {
},
//table list
getByPage() {
this.parameter.params["companyType"] = "4";
serve.getByPage(this.parameter).then((res) => {
this.tableData = res.data.list;
this.parameter.total = res.data.totalCount;

Loading…
Cancel
Save