pull/1/head
xiaozhiyong 2 years ago
parent 811bbb789d
commit 0f4299fce3
  1. 20
      src/api/financialCenter/enterpriseRecharge.js
  2. 4
      src/components/autocomplete/index.vue
  3. 575
      src/views/financialCenter/accountManagement/index.vue
  4. 142
      src/views/financialCenter/enterpriseRecharge/components/add.vue
  5. 257
      src/views/financialCenter/enterpriseRecharge/components/addTurn.vue
  6. 41
      src/views/financialCenter/enterpriseRecharge/index.vue

@ -10,10 +10,14 @@ const getByPage = (params) => {
const get = (query) => {
return request.get(`/oil-finance/oilCompanyAccountReverse/get/${query}`);
};
//详情
//公司详情
const getByCompanyId = (query) => {
return request.get(`/oil-finance/oilCompanyAccount/getByCompanyId/${query}`);
};
//公司财务详情
const getByCompanyIdSec = (query) => {
return request.get(`/oil-user/oilCompanyFinance/getByCompanyId/${query}`);
};
// 新增
const save = (params) => {
return request.postJson("/oil-finance/oilCompanyAccountReverse/save", params);
@ -25,6 +29,17 @@ const update = (params) => {
params
);
};
// 企业收款账户
const getCascaderList = () => {
return request.get("/oil-finance/internalCompany/getCascaderList");
};
//公司 远程搜索
const getLikeByNameSuccess = (params) => {
return request.postJson(
"/oil-user/oilCompanyInfo/getLikeByNameSuccess",
params
);
};
export default {
getByPage,
@ -32,4 +47,7 @@ export default {
getByCompanyId,
save,
update,
getByCompanyIdSec,
getCascaderList,
getLikeByNameSuccess,
};

@ -9,6 +9,7 @@
:remote-method="remoteMethod"
@clear="list = []"
:disabled="isDisabled"
@change="change"
>
<el-option
v-for="(item, index) in list"
@ -74,6 +75,9 @@ export default {
this.list = [];
}
},
change(val) {
this.$emit("change", val);
},
},
};
</script>

@ -2,11 +2,23 @@
<div class="bill-details">
<div class="frame">
<!-- 公司名称 -->
<autocomplete class="mr20" :params="parameter.params" :config="configAutocomplete"/>
<autocomplete
class="mr20"
:params="parameter.params"
:config="configAutocomplete"
/>
<!-- 总公司名称 -->
<autocomplete class="mr20" :params="parameter.params" :config="configAutocompleteSec"/>
<autocomplete
class="mr20"
:params="parameter.params"
:config="configAutocompleteSec"
/>
<el-select v-model="parameter.params.accountState" placeholder="账户状态" clearable>
<el-select
v-model="parameter.params.accountState"
placeholder="账户状态"
clearable
>
<el-option
v-for="(item, index) in accountStateEnum"
:key="index"
@ -15,7 +27,11 @@
/>
</el-select>
<el-select v-model="parameter.params.companyNature" placeholder="企业性质" clearable>
<el-select
v-model="parameter.params.companyNature"
placeholder="企业性质"
clearable
>
<el-option
v-for="(item, index) in companyNatureEnum"
:key="index"
@ -24,7 +40,10 @@
/>
</el-select>
<!-- 业务负责人 -->
<autocomplete :params="parameter.params" :config="configAutocompleteBusinessLeader"/>
<autocomplete
:params="parameter.params"
:config="configAutocompleteBusinessLeader"
/>
<div class="buttons">
<el-button icon="el-icon-search" @click="search">查询</el-button>
@ -45,51 +64,75 @@
style="width: 100%"
>
>
<el-table-column type="selection" width="55"/>
<el-table-column type="selection" width="55" />
<el-table-column prop="companyName" label="公司名称" minWidth="300">
<template slot-scope="{ row }">
<span style='padding-left:8px;'>{{row.companyName}}</span>
<br/>
<span style='padding-left:8px;'>业务负责人:{{row.businessLeader}}</span>
<span style="padding-left: 8px">{{ row.companyName }}</span>
<br />
<span style="padding-left: 8px"
>业务负责人:{{ row.businessLeader }}</span
>
</template>
</el-table-column>
<el-table-column label="企业性质" minWidth="120">
<template slot-scope="{ row }">
{{companyNatureEnum.find((item) => item.value === row.companyNature).label}}
{{
companyNatureEnum.find((item) => item.value === row.companyNature)
.label
}}
</template>
</el-table-column>
<el-table-column prop="totalBalance" label="公司企业总余额" minWidth="120"/>
<el-table-column
prop="totalBalance"
label="公司企业总余额"
minWidth="120"
/>
<el-table-column label="司机油卡余额" minWidth="130">
<template slot-scope="{ row }">
<span>:{{row.outCountBalance}}</span>
<br/>
<span>:{{row.inCountBalance}}</span>
<span>:{{ row.outCountBalance }}</span>
<br />
<span>:{{ row.inCountBalance }}</span>
</template>
</el-table-column>
<el-table-column prop="balance" label="账户总余额" minWidth="120"/>
<el-table-column prop="rechargeBalance" label="充值余额" minWidth="120"/>
<el-table-column prop="chargeRechargeBalance" label="赊销充值余额" minWidth="120"/>
<el-table-column prop="rechargeRebateBalance" label="充值返利余额" minWidth="120"/>
<el-table-column prop="consumeRebateBalance" label="消费返利余额" minWidth="120"/>
<el-table-column prop="totalChargeAmount" label="赊销待还" minWidth="120"/>
<el-table-column prop="createTime" label="创建时间" minWidth="200"/>
<el-table-column prop="balance" label="账户总余额" minWidth="120" />
<el-table-column
prop="rechargeBalance"
label="充值余额"
minWidth="120"
/>
<el-table-column
prop="chargeRechargeBalance"
label="赊销充值余额"
minWidth="120"
/>
<el-table-column
prop="rechargeRebateBalance"
label="充值返利余额"
minWidth="120"
/>
<el-table-column
prop="consumeRebateBalance"
label="消费返利余额"
minWidth="120"
/>
<el-table-column
prop="totalChargeAmount"
label="赊销待还"
minWidth="120"
/>
<el-table-column prop="createTime" label="创建时间" minWidth="200" />
<el-table-column fixed="right" label="操作" width="150px">
<template slot-scope="{ row }">
<span class="el-dropdown-link" @click="detail(row)">详情</span>
<el-dropdown>
<el-button type="text">
更多<i class="el-icon-arrow-down el-icon--right"/>
更多<i class="el-icon-arrow-down el-icon--right" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
@click.native="toRecharge(row.id)"
>
<el-button
:size="$store.getters.size"
type="text"
>
<svg-icon icon-class="iconicon-"/>
<el-dropdown-item @click.native="toRecharge(row.id)">
<el-button :size="$store.getters.size" type="text">
<svg-icon icon-class="iconicon-" />
充值
</el-button>
</el-dropdown-item>
@ -99,282 +142,280 @@
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination :parameter="parameter" @searchAgain="getByPage"/>
<pagination :parameter="parameter" @searchAgain="getByPage" />
</div>
<!-- 添加充值 -->
<recharge :controlWindows="controlWindows" @closeWindow="closeDialog" />
</div>
</template>
<script>
import serve from 'api/financialCenter/accountManagement.js'
import commonServe from 'api/common.js'
import serve from "api/financialCenter/accountManagement.js";
import commonServe from "api/common.js";
import recharge from "./components/recharge.vue";
import autocomplete from 'components/autocomplete/index.vue'
import pagination from 'components/pagination/index.vue'
import generalDetails from 'components/generalDetails/index.vue'
import recharge from "./components/recharge.vue";
import autocomplete from "components/autocomplete/index.vue";
import pagination from "components/pagination/index.vue";
import generalDetails from "components/generalDetails/index.vue";
export default {
components: {
recharge,
pagination,
autocomplete,
generalDetails
},
data() {
return {
oilCompanyAccount: {},
controlWindows: {
detail: false,
recharge:false //
export default {
components: {
recharge,
pagination,
autocomplete,
generalDetails,
},
data() {
return {
oilCompanyAccount: {},
controlWindows: {
detail: false,
recharge: false, //
},
tableDataSec: [],
tableHeight: 0,
tableData: [],
multipleSelection: [], //
configAutocomplete: {
serveTarget: commonServe.getRefineryCompanyList,
autocompleteKey: "name",
labelKey: "name",
valueKey: "id",
placeholder: "企业名称",
querykey: "companyId",
},
configAutocompleteSec: {
serveTarget: commonServe.getRefineryCompanyList,
autocompleteKey: "name",
labelKey: "name",
valueKey: "id",
placeholder: "总公司名称",
querykey: "name",
},
configAutocompleteBusinessLeader: {
serveTarget: commonServe.liekQuery,
autocompleteKey: "",
labelKey: "nickName",
valueKey: "id",
placeholder: "业务负责人",
querykey: "businessLeader",
},
parameter: {
currentPage: 1,
pageSize: 10,
total: 0,
params: {},
},
accountStateEnum: [
{
label: "禁用",
value: 0,
},
tableDataSec: [],
tableHeight: 0,
tableData: [],
multipleSelection: [],//
configAutocomplete: {
serveTarget: commonServe.getRefineryCompanyList,
autocompleteKey: 'name',
labelKey: 'name',
valueKey: 'id',
placeholder: '企业名称',
querykey: 'companyId'
{
label: "启用",
value: 1,
},
configAutocompleteSec: {
serveTarget: commonServe.getRefineryCompanyList,
autocompleteKey: 'name',
labelKey: 'name',
valueKey: 'id',
placeholder: '总公司名称',
querykey: 'name'
{
label: "冻结",
value: -1,
},
configAutocompleteBusinessLeader: {
serveTarget: commonServe.liekQuery,
autocompleteKey: '',
labelKey: 'nickName',
valueKey: 'id',
placeholder: '业务负责人',
querykey: 'businessLeader'
],
companyNatureEnum: [
{
label: "零售客户",
value: 0,
},
parameter: {
currentPage: 1,
pageSize: 10,
total: 0,
params: {}
{
label: "外请客户",
value: 1,
},
accountStateEnum: [
{
label: '禁用',
value: 0
},
{
label: '启用',
value: 1
},
{
label: '冻结',
value: -1
}
],
companyNatureEnum: [
{
label: '零售客户',
value: 0
},
{
label: '外请客户',
value: 1
},
{
label: '渠道客户',
value: 2
},
{
label: '存量客户',
value: 3
},
{
label: '批发客户',
value: 4
},
{
label: 'LNG客户',
value: 5
}
,
{
label: '推广业务',
value: 6
}
]
{
label: "渠道客户",
value: 2,
},
{
label: "存量客户",
value: 3,
},
{
label: "批发客户",
value: 4,
},
{
label: "LNG客户",
value: 5,
},
{
label: "推广业务",
value: 6,
},
],
};
},
created() {
this.getByPage();
},
updated() {
this.$nextTick(() => {
this.$refs.multipleTable && this.$refs.multipleTable.doLayout();
});
},
mounted() {
this.$nextTick(() => {
this.heightHandle();
});
window.addEventListener(
"resize",
this.$utils.debounce(this.heightHandle, 500)
);
},
methods: {
search() {
this.parameter.currentPage = 1;
this.getByPage();
},
//table list
getByPage() {
serve.getByPage(this.parameter).then((res) => {
this.tableData = res.data.list;
this.parameter.total = res.data.totalCount;
});
},
//
accountTypeHandler(type) {
//0: 1: -1:
if (!this.multipleSelection || this.multipleSelection.length < 1) {
this.$message.error("请选择需要操作的数据");
return;
}
this.multipleSelection.forEach((item) => {
item.accountState = type;
});
serve.updateAccountState(this.multipleSelection).then((res) => {
if (res.code === 20000) {
this.$message.success(res.msg);
}
this.getByPage();
});
},
created() {
this.getByPage()
detail(row) {
//TODO
},
updated() {
this.$nextTick(() => {
this.$refs.multipleTable && this.$refs.multipleTable.doLayout()
})
toRecharge(id) {
//
serve.get(id).then((res) => {
this.oilCompanyAccount = res.data;
this.controlWindows.recharge = true;
});
},
mounted() {
this.$nextTick(() => {
this.heightHandle()
})
window.addEventListener(
'resize',
this.$utils.debounce(this.heightHandle, 500)
)
//
reset() {
this.parameter = {
currentPage: 1,
pageSize: 10,
total: 0,
params: {},
};
},
methods: {
search() {
this.parameter.currentPage = 1
this.getByPage()
},
//table list
getByPage() {
serve.getByPage(this.parameter).then((res) => {
this.tableData = res.data.list
this.parameter.total = res.data.totalCount
})
},
//
accountTypeHandler(type) {
//0: 1: -1:
if (!this.multipleSelection || this.multipleSelection.length < 1) {
this.$message.error('请选择需要操作的数据')
return
}
this.multipleSelection.forEach(item => {
item.accountState = type
})
serve.updateAccountState(this.multipleSelection).then(res => {
if (res.code === 20000) {
this.$message.success(res.msg)
}
this.getByPage()
})
},
detail(row) {
//TODO
},
toRecharge(id) {
//
serve.get(id).then(res => {
this.oilCompanyAccount = res.data
this.controlWindows.recharge = true
})
},
//
reset() {
this.parameter = {
currentPage: 1,
pageSize: 10,
total: 0,
params: {}
}
},
closeDialog() {
this.controlWindows.recharge = false
},
// table height
heightHandle() {
let bodyHeight = document.body.clientHeight
let frameHeight = this.obtainElement('.frame').clientHeight
let operationHeight = this.obtainElement('.operation').clientHeight
let paginationHeight = this.obtainElement('.el-pagination').clientHeight
this.tableHeight =
bodyHeight - frameHeight - operationHeight - paginationHeight - 145
},
obtainElement(className) {
return document.documentElement.querySelector(className)
}
}
}
closeDialog() {
this.controlWindows.recharge = false;
},
// table height
heightHandle() {
let bodyHeight = document.body.clientHeight;
let frameHeight = this.obtainElement(".frame").clientHeight;
let operationHeight = this.obtainElement(".operation").clientHeight;
let paginationHeight = this.obtainElement(".el-pagination").clientHeight;
this.tableHeight =
bodyHeight - frameHeight - operationHeight - paginationHeight - 145;
},
obtainElement(className) {
return document.documentElement.querySelector(className);
},
},
};
</script>
<style lang="scss" scoped>
.bill-details {
.frame {
margin: 20px;
padding: 20px;
border-radius: 6px;
border: 1px solid #e3e3e5;
background: #fff;
.bill-details {
.frame {
margin: 20px;
padding: 20px;
border-radius: 6px;
border: 1px solid #e3e3e5;
background: #fff;
.el-input,
.el-select {
width: 183px;
height: 40px;
}
.el-autocomplete + .el-input,
.el-input + .el-autocomplete,
.el-autocomplete + .el-select,
.el-input + .el-input,
.el-input + .el-select,
.el-select + .el-select,
.el-select + .el-input {
margin-right: 20px;
margin-bottom: 15px;
}
.el-input,
.el-select {
width: 183px;
height: 40px;
}
.mr20 {
margin-right: 20px;
}
.el-autocomplete + .el-input,
.el-input + .el-autocomplete,
.el-autocomplete + .el-select,
.el-input + .el-input,
.el-input + .el-select,
.el-select + .el-select,
.el-select + .el-input {
margin-right: 20px;
margin-bottom: 15px;
}
.buttons {
text-align: right;
}
.mr20 {
margin-right: 20px;
}
.table {
overflow: hidden;
margin: 0 20px;
padding-bottom: 20px;
background: #fff;
border-radius: 6px;
border: 1px solid #e3e3e5;
.buttons {
text-align: right;
}
}
> .operation {
box-sizing: content-box;
padding: 15px;
}
.table {
overflow: hidden;
margin: 0 20px;
padding-bottom: 20px;
background: #fff;
border-radius: 6px;
border: 1px solid #e3e3e5;
.gray {
color: #999;
> .operation {
box-sizing: content-box;
padding: 15px;
}
span {
color: #333;
}
}
.gray {
color: #999;
.el-table {
margin-bottom: 20px;
border-radius: 10px 10px 0px 0px;
span {
color: #333;
}
}
.el-dropdown-link {
margin-right: 10px;
cursor: pointer;
color: #409eff;
.el-table {
margin-bottom: 20px;
border-radius: 10px 10px 0px 0px;
}
&.special {
margin-right: 0;
}
}
.el-dropdown-link {
margin-right: 10px;
cursor: pointer;
color: #409eff;
.el-icon-arrow-down {
font-size: 12px;
&.special {
margin-right: 0;
}
}
.ft14 {
font-size: 14px;
.el-icon-arrow-down {
font-size: 12px;
}
}
.ft14 {
font-size: 14px;
}
}
</style>

@ -8,9 +8,13 @@
:before-close="closeWindow"
>
<div class="add">
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-form-item label="公司" prop="companyId">
<autocomplete :params="form" :config="configAutocomplete" />
<autocomplete
:params="form"
:config="configAutocomplete"
@change="companyChange"
/>
</el-form-item>
<el-form-item label="交易类型" prop="transactionType">
<el-select
@ -19,10 +23,29 @@
placeholder="请选择交易类型"
@change="changeTransactionType"
>
<el-option label="赊销" value="CHARGE_SALES" />
<el-option label="消费返利" value="CONSUME_REBATE" />
<el-option label="充值" value="RECHARGE" />
<!-- <el-option label="赊销" value="CHARGE_SALES" />
<el-option label="消费返利" value="CONSUME_REBATE" /> -->
</el-select>
</el-form-item>
<template
v-if="
companyFinance.settlementModes === 1 ||
companyFinance.settlementModes === 3
"
>
<el-form-item label="充值返利比例">
<el-input
disabled
v-model="companyFinance.rechargeRebate"
></el-input>
</el-form-item>
<el-form-item label="预计充值返利金额">
<el-input disabled v-model="rechargeRebateAmount"></el-input>
</el-form-item>
</template>
<el-form-item label="交易金额" prop="transactionAmount">
<el-input
v-checkNum
@ -31,8 +54,53 @@
></el-input>
</el-form-item>
<template v-if="form.transactionType === 'RECHARGE'">
<el-form-item label="企业收款账户" prop="companyBankCardArr">
<el-cascader
:options="cascaderList"
v-model="form.companyBankCardArr"
filterable
clearable
></el-cascader>
</el-form-item>
<el-form-item label="线下汇款公司账户" prop="offlinePaymentCompany">
<el-input
v-model="form.offlinePaymentCompany"
placeholder="请输入线下汇款公司账户"
></el-input>
</el-form-item>
<el-form-item label="线下交易发起时间" prop="offlineStartTime">
<el-date-picker
v-model="form.offlineStartTime"
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
default-time="00:00:00"
placeholder="选择日期时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="线下交易完成时间" prop="offlineCompleteTime">
<el-date-picker
v-model="form.offlineCompleteTime"
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
default-time="23:59:59"
placeholder="选择日期时间"
>
</el-date-picker>
</el-form-item>
</template>
<el-form-item
v-if="form.transactionType === 'CONSUME_REBATE'"
v-if="
form.transactionType === 'CONSUME_REBATE' ||
form.transactionType === 'RECHARGE'
"
label="线下交易凭证"
prop="offlineTransactionProof"
>
@ -106,10 +174,12 @@ export default {
JSESSIONID: JSESSIONID,
token: utils.bcrypt(JSESSIONID),
},
cascaderList: [],
companyFinance: {},
form: {},
refineryList: [],
configAutocomplete: {
serveTarget: commonServe.getRefineryCompanyList,
serveTarget: serve.getLikeByNameSuccess,
autocompleteKey: "name",
labelKey: "name",
valueKey: "id",
@ -135,12 +205,56 @@ export default {
trigger: "change",
},
],
offlinePaymentCompany: [
{
required: true,
message: "请输入线下汇款公司账户",
trigger: "blur",
},
],
offlineStartTime: [
{
required: true,
message: "请选择线下交易发起时间",
trigger: "change",
},
],
offlineCompleteTime: [
{
required: true,
message: "请选择线下交易完成时间",
trigger: "change",
},
],
offlineCompleteTime: [
{
required: true,
message: "请选择企业收款账户",
trigger: "change",
},
],
reverseRemark: [
{ required: true, message: "请输入交易说明", trigger: "blur" },
],
},
};
},
computed: {
rechargeRebateAmount() {
if (
this.companyFinance.settlementModes === 1 ||
this.companyFinance.settlementModes === 3
) {
return (
(this.form.transactionAmount || 0) *
this.companyFinance.rechargeRebate
);
} else return this.companyFinance.rechargeRebateAmount;
},
},
created() {
this.getCascaderList();
},
methods: {
openDrawer() {
let { id } = this.controlWindows.addInfo;
@ -156,6 +270,14 @@ export default {
};
Object.assign(this.configAutocomplete, configUpdata);
},
// change
companyChange(id) {
if (id) {
serve.getByCompanyIdSec(id).then((res) => {
this.companyFinance = res.data;
});
}
},
// change
changeTransactionType(val) {
if (val === "CHARGE_SALES") {
@ -177,9 +299,16 @@ export default {
this.form.offlineTransactionProof = response.data.publicUrl;
}
},
//
getCascaderList() {
serve.getCascaderList().then((res) => {
this.cascaderList = res.data;
});
},
submit() {
this.$refs["form"].validate((valid) => {
if (valid) {
let params = { transactionType: "RECHARGE", ...this.form };
this.judgeInterface(this.form).then((res) => {
this.$message.success(res.msg);
this.closeWindow();
@ -210,6 +339,7 @@ export default {
padding: 20px;
.el-input,
.el-select,
.el-cascader,
.el-textarea,
.el-autocomplete {
width: 300px;

@ -0,0 +1,257 @@
<template>
<el-drawer
:title="controlWindows.addInfo.title"
direction="ltr"
size="50%"
:visible="controlWindows.addTurn"
@opened="openDrawer"
:before-close="closeWindow"
>
<div class="add">
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-form-item label="公司" prop="companyId">
<autocomplete
:params="form"
:config="configAutocomplete"
@change="companyChange"
/>
</el-form-item>
<el-form-item label="交易类型" prop="turnType">
<el-select
:disabled="!!form.id"
v-model="form.turnType"
placeholder="请选择交易类型"
>
<el-option
v-for="(item, index) in correspondTypeEnum"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item v-if="form.turnType && form.companyId">
<el-descriptions title="公司账户信息" :column="1" border>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-office-building"></i>
公司名称
</template>
{{ companyInfo.companyName }}</el-descriptions-item
>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-bank-card"></i>
{{
correspondTypeEnum.find(
(item) => item.value === form.turnType
).label
}}
</template>
{{
companyInfo[
correspondTypeEnum.find(
(item) => item.value === form.turnType
).valueKey
]
}}
</el-descriptions-item>
<!-- <el-descriptions-item label="赊销余额"></el-descriptions-item>
<el-descriptions-item label="充值返利余额"></el-descriptions-item>
<el-descriptions-item label="消费返利余额"></el-descriptions-item> -->
</el-descriptions>
</el-form-item>
<el-form-item label="圈回金额" prop="transactionAmount">
<el-input
v-checkNum
placeholder="圈回金额"
v-model="form.transactionAmount"
>
</el-input>
</el-form-item>
<el-form-item label="圈回原因" prop="reverseRemark">
<el-input
type="textarea"
:rows="2"
placeholder="请输入圈回原因"
v-model="form.reverseRemark"
>
</el-input>
</el-form-item>
</el-form>
</div>
<div class="buttons">
<el-button @click="closeWindow">取消 </el-button>
<el-button @click="submit">提交</el-button>
</div>
</el-drawer>
</template>
<script>
import serve from "api/financialCenter/enterpriseRecharge.js";
import autocomplete from "components/autocomplete/index.vue";
export default {
components: {
autocomplete,
},
props: {
controlWindows: Object,
},
data() {
let validatorcompanyId = (rule, value, callback) => {
if (this.form.companyId) callback();
else callback("请选择公司");
};
return {
companyFinance: {},
companyInfo: {},
form: {},
configAutocomplete: {
serveTarget: serve.getLikeByNameSuccess,
autocompleteKey: "name",
labelKey: "name",
valueKey: "id",
placeholder: "企业名称",
querykey: "companyId",
echoId: "",
echoName: "",
},
rules: {
companyId: [
{ required: true, validator: validatorcompanyId, trigger: "change" },
],
turnType: [
{ required: true, message: "请选择交易类型", trigger: "change" },
],
transactionAmount: [
{ required: true, message: "请输入圈回金额", trigger: "blur" },
],
reverseRemark: [
{ required: true, message: "请输入圈回说明", trigger: "blur" },
],
},
correspondTypeEnum: [
{
value: 1,
label: "充值余额",
valueKey: "rechargeBalance",
},
{
value: 2,
label: "赊销余额",
valueKey: "chargeRechargeBalance",
},
{
value: 3,
label: "充值返利余额",
valueKey: "rechargeRebateBalance",
},
{
value: 4,
label: "消费返利余额",
valueKey: "consumeRebateBalance",
},
],
};
},
computed: {
correspondingEnum() {},
},
methods: {
openDrawer() {
let { id } = this.controlWindows.addInfo;
//
if (id) {
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo));
this.form.transactionAmount = Math.abs(this.form.transactionAmount);
this.companyChange(this.form.companyId);
}
let configUpdata = id
? { echoId: id, echoName: this.form.refineryName, isDisabled: true }
: {
echoId: "",
echoName: "",
isDisabled: false,
};
Object.assign(this.configAutocomplete, configUpdata);
},
//
companyChange(id) {
if (id) {
serve.getByCompanyIdSec(id).then((res) => {
this.companyFinance = res.data;
this.getByCompanyId(res.data.companyId);
});
}
},
//
getByCompanyId(id) {
serve.getByCompanyId(id).then((res) => {
this.companyInfo = res.data;
});
},
submit() {
this.$refs["form"].validate((valid) => {
if (valid) {
let params = { transactionType: "TURN", ...this.form };
this.judgeInterface(params).then((res) => {
this.$message.success(res.msg);
this.closeWindow();
});
}
});
},
judgeInterface(form) {
let { id } = this.controlWindows.addInfo;
if (id) return serve.update(form);
else return serve.save(form);
},
closeWindow() {
this.$emit("closeWindow");
this.form = {};
this.controlWindows.addInfo = {};
this.$nextTick(() => {
this.$refs.form.clearValidate();
this.controlWindows.addTurn = false;
});
},
},
};
</script>
<style lang="scss" scoped>
.add {
padding: 20px;
.el-input,
.el-select,
.el-cascader,
.el-textarea,
.el-autocomplete,
.el-descriptions {
width: 300px;
}
}
.buttons {
position: absolute;
left: 0;
bottom: 0;
padding-right: 40px;
width: 100%;
height: 80px;
line-height: 80px;
text-align: right;
border-top: 1px solid #f2f3f5;
.el-button {
text-align: right;
font-size: 14px;
border-radius: 5px;
}
}
</style>

@ -83,6 +83,7 @@
<div class="table">
<div class="operation">
<el-button @click="addition">企业充值</el-button>
<el-button @click="additionTurn">圈回</el-button>
</div>
<el-table
v-if="tableHeight"
@ -235,20 +236,18 @@
更多<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<template v-if="row.transactionType == 'TURN'"> </template>
<template v-if="row.transactionType == 'TURN'">
<el-dropdown-item
command="updateTurn"
v-if="row.auditMark === 0"
>圈回编辑</el-dropdown-item
>
</template>
<template v-else>
<el-dropdown-item command="update" v-if="row.auditMark === 0"
>编辑</el-dropdown-item
>
</template>
<el-dropdown-item
command="destroy"
v-if="
row.transactionType == 'CHARGE_SALES' &&
row.chargeSalesAuditMark == -2
"
>销账</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</template>
@ -258,6 +257,7 @@
<pagination :parameter="parameter" @searchAgain="getByPage" />
</div>
<add :controlWindows="controlWindows" @closeWindow="search" />
<add-turn :controlWindows="controlWindows" @closeWindow="search" />
<!-- 详情 -->
<el-drawer
title="详情"
@ -290,6 +290,7 @@ import serve from "api/financialCenter/enterpriseRechargeDetails.js";
import commonServe from "api/common.js";
import add from "./components/add.vue";
import addTurn from "./components/addTurn.vue";
import autocomplete from "components/autocomplete/index.vue";
import pagination from "components/pagination/index.vue";
@ -304,7 +305,7 @@ import {
export default {
components: {
add,
addTurn,
pagination,
autocomplete,
generalDetails,
@ -313,6 +314,7 @@ export default {
return {
controlWindows: {
add: false,
addTurn: false,
addInfo: {},
detail: false,
},
@ -529,15 +531,25 @@ export default {
};
this.controlWindows.add = true;
},
//
additionTurn() {
this.controlWindows.addInfo = {
title: "资金圈回",
};
this.controlWindows.addTurn = true;
},
//
commandMore(val, row) {
this.controlWindows.addInfo = {
title: "编辑",
...row,
};
if (val === "update") {
this.controlWindows.addInfo = {
title: "编辑",
...row,
};
this.controlWindows.add = true;
}
if (val === "updateTurn") {
this.controlWindows.addTurn = true;
}
},
//
detail(row) {
@ -546,7 +558,6 @@ export default {
serve.getByCompanyId(row.companyId),
]).then(([firstRes, secondRes]) => {
this.oilCompanyMatch = { ...firstRes.data, ...secondRes.data };
this.controlWindows.detail = true;
});
},

Loading…
Cancel
Save