更新
This commit is contained in:
@@ -1,42 +1,33 @@
|
|||||||
import request from "utils/axios.js";
|
import request from 'utils/axios.js'
|
||||||
// table
|
// table
|
||||||
const getByPage = (params) => {
|
const getByPage = params => {
|
||||||
return request.postJson(
|
return request.postJson('/oil-finance/oilCompanyAccountReverse/getByPage', params)
|
||||||
"/oil-finance/oilCompanyAccountReverse/getByPage",
|
}
|
||||||
params
|
|
||||||
);
|
|
||||||
};
|
|
||||||
//详情
|
//详情
|
||||||
const get = (query) => {
|
const get = query => {
|
||||||
return request.get(`/oil-finance/oilCompanyAccountReverse/get/${query}`);
|
return request.get(`/oil-finance/oilCompanyAccountReverse/get/${query}`)
|
||||||
};
|
}
|
||||||
|
|
||||||
//公司财务详情
|
//公司财务详情
|
||||||
const getByCompanyId = (query) => {
|
const getByCompanyId = query => {
|
||||||
return request.get(`/oil-user/oilCompanyFinance/getByCompanyId/${query}`);
|
return request.get(`/oil-user/oilCompanyFinance/getByCompanyId/${query}`)
|
||||||
};
|
}
|
||||||
// 新增
|
// 新增
|
||||||
const save = (params) => {
|
const save = params => {
|
||||||
return request.postJson("/oil-finance/oilCompanyAccountReverse/save", params);
|
return request.postJson('/oil-finance/oilCompanyAccountReverse/refineryCustomerRecharge', params)
|
||||||
};
|
}
|
||||||
// 修改
|
// 修改
|
||||||
const update = (params) => {
|
const update = params => {
|
||||||
return request.postPut(
|
return request.postPut('/oil-finance/oilCompanyAccountReverse/update', params)
|
||||||
"/oil-finance/oilCompanyAccountReverse/update",
|
}
|
||||||
params
|
|
||||||
);
|
|
||||||
};
|
|
||||||
// 级联
|
// 级联
|
||||||
const getCascaderList = () => {
|
const getCascaderList = () => {
|
||||||
return request.get("/oil-finance/internalCompany/getCascaderList");
|
return request.get('/oil-finance/internalCompany/getCascaderList')
|
||||||
};
|
}
|
||||||
// 审核
|
// 审核
|
||||||
const audit = (params) => {
|
const audit = params => {
|
||||||
return request.postJson(
|
return request.postJson('/oil-finance/oilCompanyAccountReverse/refinery/audit', params)
|
||||||
"/oil-finance/oilCompanyAccountReverse/refinery/audit",
|
}
|
||||||
params
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
//公司 远程搜索
|
//公司 远程搜索
|
||||||
// const getLikeByNameSuccess = (params) => {
|
// const getLikeByNameSuccess = (params) => {
|
||||||
@@ -53,6 +44,6 @@ export default {
|
|||||||
save,
|
save,
|
||||||
update,
|
update,
|
||||||
getCascaderList,
|
getCascaderList,
|
||||||
audit,
|
audit
|
||||||
// getLikeByNameSuccess,
|
// getLikeByNameSuccess,
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -34,9 +34,10 @@ export default {
|
|||||||
// config: {
|
// config: {
|
||||||
// serveTarget: {}, // 远程搜索接口
|
// serveTarget: {}, // 远程搜索接口
|
||||||
// autocompleteKey: "", //远程搜索接口参数名
|
// autocompleteKey: "", //远程搜索接口参数名
|
||||||
// labelKey: "", //接口返回数据label名
|
// labelKey: [] || '', //接口返回数据label
|
||||||
// valueKey: "", //接口返回数据id
|
// valueKey: "", //接口返回数据id
|
||||||
// querykey: "", //查询接口参数名
|
// querykey: "", //查询接口参数名
|
||||||
|
// echoId:'', //
|
||||||
// },
|
// },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -50,6 +51,7 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'config.echoId': {
|
'config.echoId': {
|
||||||
handler(nval, oval) {
|
handler(nval, oval) {
|
||||||
|
console.log('nvalnvalnvalnvalnval', nval)
|
||||||
this.list = []
|
this.list = []
|
||||||
let type = this.$utils.typeJudgment(this.config.echoName)
|
let type = this.$utils.typeJudgment(this.config.echoName)
|
||||||
if (nval && ['String'].includes(type)) {
|
if (nval && ['String'].includes(type)) {
|
||||||
@@ -97,6 +99,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 远程搜索
|
// 远程搜索
|
||||||
remoteMethod(query) {
|
remoteMethod(query) {
|
||||||
|
console.log('query', query)
|
||||||
if (query !== '') {
|
if (query !== '') {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
let type = this.$utils.typeJudgment(this.config.autocompleteKey)
|
let type = this.$utils.typeJudgment(this.config.autocompleteKey)
|
||||||
|
|||||||
@@ -10,36 +10,19 @@
|
|||||||
<div class="add">
|
<div class="add">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
||||||
<el-form-item label="公司" prop="companyId">
|
<el-form-item label="公司" prop="companyId">
|
||||||
<autocomplete
|
<autocomplete :params="form" :config="configAutocomplete" @change="companyChange" />
|
||||||
:params="form"
|
|
||||||
:config="configAutocomplete"
|
|
||||||
@change="companyChange"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="交易类型" prop="transactionType">
|
<el-form-item label="交易类型" prop="transactionType">
|
||||||
<el-select
|
<el-select :disabled="!!form.id" v-model="form.transactionType" placeholder="请选择交易类型" @change="changeTransactionType">
|
||||||
:disabled="!!form.id"
|
|
||||||
v-model="form.transactionType"
|
|
||||||
placeholder="请选择交易类型"
|
|
||||||
@change="changeTransactionType"
|
|
||||||
>
|
|
||||||
<el-option label="充值" value="RECHARGE" />
|
<el-option label="充值" value="RECHARGE" />
|
||||||
<!-- <el-option label="赊销" value="CHARGE_SALES" />
|
<!-- <el-option label="赊销" value="CHARGE_SALES" />
|
||||||
<el-option label="消费返利" value="CONSUME_REBATE" /> -->
|
<el-option label="消费返利" value="CONSUME_REBATE" /> -->
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<template
|
<template v-if="companyFinance.settlementModes === 1 || companyFinance.settlementModes === 3">
|
||||||
v-if="
|
|
||||||
companyFinance.settlementModes === 1 ||
|
|
||||||
companyFinance.settlementModes === 3
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<el-form-item label="充值返利比例">
|
<el-form-item label="充值返利比例">
|
||||||
<el-input
|
<el-input disabled v-model="companyFinance.rechargeRebate"></el-input>
|
||||||
disabled
|
|
||||||
v-model="companyFinance.rechargeRebate"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预计充值返利金额">
|
<el-form-item label="预计充值返利金额">
|
||||||
<el-input disabled v-model="rechargeRebateAmount"></el-input>
|
<el-input disabled v-model="rechargeRebateAmount"></el-input>
|
||||||
@@ -47,28 +30,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-form-item label="交易金额" prop="transactionAmount">
|
<el-form-item label="交易金额" prop="transactionAmount">
|
||||||
<el-input
|
<el-input v-checkNum v-model="form.transactionAmount" placeholder="请输入交易金额"></el-input>
|
||||||
v-checkNum
|
|
||||||
v-model="form.transactionAmount"
|
|
||||||
placeholder="请输入交易金额"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<template v-if="form.transactionType === 'RECHARGE'">
|
<template v-if="form.transactionType === 'RECHARGE'">
|
||||||
<el-form-item label="企业收款账户">
|
<el-form-item label="企业收款账户">
|
||||||
<el-cascader
|
<el-cascader :options="cascaderList" v-model="form.companyBankCardArr" filterable clearable></el-cascader>
|
||||||
:options="cascaderList"
|
</el-form-item>
|
||||||
v-model="form.companyBankCardArr"
|
|
||||||
filterable
|
<el-form-item label="炼厂中心账户" prop="refineryCenterAccountId">
|
||||||
clearable
|
<autocomplete :params="form" :config="accountNameAutocomplete" />
|
||||||
></el-cascader>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="线下汇款公司账户" prop="offlinePaymentCompany">
|
<el-form-item label="线下汇款公司账户" prop="offlinePaymentCompany">
|
||||||
<el-input
|
<el-input v-model="form.offlinePaymentCompany" placeholder="请输入线下汇款公司账户"></el-input>
|
||||||
v-model="form.offlinePaymentCompany"
|
|
||||||
placeholder="请输入线下汇款公司账户"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="线下交易发起时间" prop="offlineStartTime">
|
<el-form-item label="线下交易发起时间" prop="offlineStartTime">
|
||||||
@@ -96,20 +71,14 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-form-item
|
<el-form-item v-if="form.transactionType === 'CONSUME_REBATE' || form.transactionType === 'RECHARGE'" label="线下交易凭证">
|
||||||
v-if="
|
|
||||||
form.transactionType === 'CONSUME_REBATE' ||
|
|
||||||
form.transactionType === 'RECHARGE'
|
|
||||||
"
|
|
||||||
label="线下交易凭证"
|
|
||||||
>
|
|
||||||
<el-upload
|
<el-upload
|
||||||
:action="uploadUrl"
|
:action="uploadUrl"
|
||||||
:data="{
|
:data="{
|
||||||
ossKey: 'xingyou',
|
ossKey: 'xingyou',
|
||||||
pathKey: 'other',
|
pathKey: 'other',
|
||||||
encrypt: 'PUBLIC',
|
encrypt: 'PUBLIC',
|
||||||
code: 'A003',
|
code: 'A003'
|
||||||
}"
|
}"
|
||||||
list-type="picture-card"
|
list-type="picture-card"
|
||||||
:on-preview="handlePictureCardPreview"
|
:on-preview="handlePictureCardPreview"
|
||||||
@@ -127,13 +96,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="交易说明">
|
<el-form-item label="交易说明">
|
||||||
<el-input
|
<el-input type="textarea" :rows="2" placeholder="请输入交易说明" v-model="form.reverseRemark"> </el-input>
|
||||||
type="textarea"
|
|
||||||
:rows="2"
|
|
||||||
placeholder="请输入交易说明"
|
|
||||||
v-model="form.reverseRemark"
|
|
||||||
>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -145,41 +108,42 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import serve from "api/financialCenter/enterpriseRecharge.js";
|
import serve from 'api/financialCenter/enterpriseRecharge.js'
|
||||||
import commonServe from "api/common.js";
|
import commonServe from 'api/common.js'
|
||||||
|
|
||||||
import autocomplete from "components/autocomplete/index.vue";
|
import autocomplete from 'components/autocomplete/index.vue'
|
||||||
|
|
||||||
import utils from "utils/encode";
|
import utils from 'utils/encode'
|
||||||
const JSESSIONID = utils.uuid();
|
const JSESSIONID = utils.uuid()
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
autocomplete,
|
autocomplete
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
controlWindows: Object,
|
controlWindows: Object
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
let validatorcompanyId = (rule, value, callback) => {
|
let validatorcompanyId = (rule, value, callback) => {
|
||||||
if (this.form.companyId) callback();
|
if (this.form.companyId) callback()
|
||||||
else callback("请选择公司");
|
else callback('请选择公司')
|
||||||
};
|
}
|
||||||
|
let validatorRefineryCenterAccountId = (rule, value, callback) => {
|
||||||
|
if (this.form.refineryCenterAccountId) callback()
|
||||||
|
else callback('请选择炼厂中心账户')
|
||||||
|
}
|
||||||
// let validatorofflineTransactionProof = (rule, value, callback) => {
|
// let validatorofflineTransactionProof = (rule, value, callback) => {
|
||||||
// if (this.form.offlineTransactionProof) callback();
|
// if (this.form.offlineTransactionProof) callback();
|
||||||
// else callback("请上传凭证");
|
// else callback("请上传凭证");
|
||||||
// };
|
// };
|
||||||
return {
|
return {
|
||||||
uploadUrl:
|
uploadUrl: process.env.VUE_APP_ENV === 'development' ? '/api/oil-oss/obejct/uploadFile' : '/adminapi/oil-oss/obejct/uploadFile',
|
||||||
process.env.VUE_APP_ENV === "development"
|
|
||||||
? "/api/oil-oss/obejct/uploadFile"
|
|
||||||
: "/adminapi/oil-oss/obejct/uploadFile",
|
|
||||||
imgDialog: false,
|
imgDialog: false,
|
||||||
headers: {
|
headers: {
|
||||||
dataSources: "WEB",
|
dataSources: 'WEB',
|
||||||
Authorization: localStorage.getItem("businessToken"),
|
Authorization: localStorage.getItem('businessToken'),
|
||||||
JSESSIONID: JSESSIONID,
|
JSESSIONID: JSESSIONID,
|
||||||
token: utils.bcrypt(JSESSIONID),
|
token: utils.bcrypt(JSESSIONID)
|
||||||
},
|
},
|
||||||
fileList: [],
|
fileList: [],
|
||||||
cascaderList: [],
|
cascaderList: [],
|
||||||
@@ -187,179 +151,183 @@ export default {
|
|||||||
form: {},
|
form: {},
|
||||||
configAutocomplete: {
|
configAutocomplete: {
|
||||||
serveTarget: commonServe.getRefineryCompanyList,
|
serveTarget: commonServe.getRefineryCompanyList,
|
||||||
autocompleteKey: "name",
|
autocompleteKey: 'name',
|
||||||
labelKey: "name",
|
labelKey: 'name',
|
||||||
valueKey: "id",
|
valueKey: 'id',
|
||||||
placeholder: "企业名称",
|
placeholder: '企业名称',
|
||||||
querykey: "companyId",
|
querykey: 'companyId',
|
||||||
echoId: "",
|
echoId: '',
|
||||||
echoName: "",
|
echoName: '',
|
||||||
isDisabled: false,
|
isDisabled: false
|
||||||
|
},
|
||||||
|
accountNameAutocomplete: {
|
||||||
|
serveTarget: commonServe.findByEntity,
|
||||||
|
autocompleteKey: 'accountName',
|
||||||
|
labelKey: 'accountName',
|
||||||
|
valueKey: 'id',
|
||||||
|
placeholder: '炼厂中心账户',
|
||||||
|
querykey: 'refineryCenterAccountId',
|
||||||
|
echoId: '',
|
||||||
|
echoName: '',
|
||||||
|
isDisabled: false
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
companyId: [
|
companyId: [{ required: true, validator: validatorcompanyId, trigger: 'change' }],
|
||||||
{ required: true, validator: validatorcompanyId, trigger: "change" },
|
transactionType: [{ required: true, message: '请选择交易类型', trigger: 'change' }],
|
||||||
],
|
transactionAmount: [{ required: true, message: '请输入交易金额', trigger: 'blur' }],
|
||||||
transactionType: [
|
|
||||||
{ required: true, message: "请选择交易类型", trigger: "change" },
|
|
||||||
],
|
|
||||||
transactionAmount: [
|
|
||||||
{ required: true, message: "请输入交易金额", trigger: "blur" },
|
|
||||||
],
|
|
||||||
offlinePaymentCompany: [
|
offlinePaymentCompany: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入线下汇款公司账户",
|
message: '请输入线下汇款公司账户',
|
||||||
trigger: "blur",
|
trigger: 'blur'
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
offlineStartTime: [
|
offlineStartTime: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请选择线下交易发起时间",
|
message: '请选择线下交易发起时间',
|
||||||
trigger: "change",
|
trigger: 'change'
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
offlineCompleteTime: [
|
offlineCompleteTime: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请选择线下交易完成时间",
|
message: '请选择线下交易完成时间',
|
||||||
trigger: "change",
|
trigger: 'change'
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
offlineCompleteTime: [
|
offlineCompleteTime: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请选择企业收款账户",
|
message: '请选择企业收款账户',
|
||||||
trigger: "change",
|
trigger: 'change'
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
},
|
refineryCenterAccountId: [{ required: true, validator: validatorRefineryCenterAccountId, trigger: 'change' }]
|
||||||
};
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rechargeRebateAmount() {
|
rechargeRebateAmount() {
|
||||||
if (
|
if (this.companyFinance.settlementModes === 1 || this.companyFinance.settlementModes === 3) {
|
||||||
this.companyFinance.settlementModes === 1 ||
|
return (this.form.transactionAmount || 0) * this.companyFinance.rechargeRebate
|
||||||
this.companyFinance.settlementModes === 3
|
} else return this.companyFinance.rechargeRebateAmount
|
||||||
) {
|
}
|
||||||
return (
|
|
||||||
(this.form.transactionAmount || 0) *
|
|
||||||
this.companyFinance.rechargeRebate
|
|
||||||
);
|
|
||||||
} else return this.companyFinance.rechargeRebateAmount;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getCascaderList();
|
this.getCascaderList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openDrawer() {
|
openDrawer() {
|
||||||
let { id } = this.controlWindows.addInfo;
|
let { id, companyName, refineryCenterAccountId, refineryCenterAccountName } = this.controlWindows.addInfo
|
||||||
//回显
|
//回显
|
||||||
if (id) {
|
if (id) {
|
||||||
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo));
|
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo))
|
||||||
this.form["companyBankCardArr"] = [
|
this.form['companyBankCardArr'] = [+this.form.internalCompanyId, this.form.companyBankCardId]
|
||||||
+this.form.internalCompanyId,
|
|
||||||
this.form.companyBankCardId,
|
|
||||||
];
|
|
||||||
if (this.form.offlineTransactionProof) {
|
if (this.form.offlineTransactionProof) {
|
||||||
this.fileList.push({
|
this.fileList.push({
|
||||||
url: this.form.offlineTransactionProof,
|
url: this.form.offlineTransactionProof
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
let configUpdata = {
|
|
||||||
echoId: id || "",
|
|
||||||
echoName: this.form.refineryName || "",
|
|
||||||
isDisabled: !!id,
|
|
||||||
};
|
|
||||||
|
|
||||||
Object.assign(this.configAutocomplete, configUpdata);
|
let configUpdata = {
|
||||||
|
echoId: id || '',
|
||||||
|
echoName: companyName || '',
|
||||||
|
isDisabled: !!id
|
||||||
|
}
|
||||||
|
let configUpdata2 = {
|
||||||
|
echoId: refineryCenterAccountId || '',
|
||||||
|
echoName: refineryCenterAccountName || '',
|
||||||
|
isDisabled: !!id
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this.configAutocomplete, configUpdata)
|
||||||
|
Object.assign(this.accountNameAutocomplete, configUpdata2)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 公司change
|
// 公司change
|
||||||
companyChange(id) {
|
companyChange(id) {
|
||||||
if (id) {
|
if (id) {
|
||||||
serve.getByCompanyId(id).then((res) => {
|
serve.getByCompanyId(id).then(res => {
|
||||||
this.companyFinance = res.data;
|
this.companyFinance = res.data
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 交易类型 change
|
// 交易类型 change
|
||||||
changeTransactionType(val) {
|
changeTransactionType(val) {
|
||||||
if (val === "CHARGE_SALES") {
|
if (val === 'CHARGE_SALES') {
|
||||||
this.handleRemove();
|
this.handleRemove()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeHandle(file) {
|
beforeHandle(file) {
|
||||||
if (file.type.indexOf("image/") === -1) {
|
if (file.type.indexOf('image/') === -1) {
|
||||||
this.$message.error("上传的文件不是图片格式!");
|
this.$message.error('上传的文件不是图片格式!')
|
||||||
return false;
|
return false
|
||||||
} else if (file.size / 1024 / 1024 > 5) {
|
} else if (file.size / 1024 / 1024 > 5) {
|
||||||
this.$message.error("上传图片大小不能超过 5MB!");
|
this.$message.error('上传图片大小不能超过 5MB!')
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
return true;
|
return true
|
||||||
},
|
},
|
||||||
|
|
||||||
//img大图
|
//img大图
|
||||||
handlePictureCardPreview(file) {
|
handlePictureCardPreview(file) {
|
||||||
this.form.offlineTransactionProof = file.url;
|
this.form.offlineTransactionProof = file.url
|
||||||
this.imgDialog = true;
|
this.imgDialog = true
|
||||||
},
|
},
|
||||||
// img remove
|
// img remove
|
||||||
handleRemove(file, fileList) {
|
handleRemove(file, fileList) {
|
||||||
this.form.offlineTransactionProof = "";
|
this.form.offlineTransactionProof = ''
|
||||||
},
|
},
|
||||||
// 上传成功
|
// 上传成功
|
||||||
handleSuccess(response, file, fileList) {
|
handleSuccess(response, file, fileList) {
|
||||||
if (response.code !== 20000) {
|
if (response.code !== 20000) {
|
||||||
this.$message.error(response.msg);
|
this.$message.error(response.msg)
|
||||||
this.fileList = [];
|
this.fileList = []
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
console.log("response", response);
|
console.log('response', response)
|
||||||
this.form.offlineTransactionProof = response.data.publicUrl;
|
this.form.offlineTransactionProof = response.data.publicUrl
|
||||||
},
|
},
|
||||||
//企业收款账户
|
//企业收款账户
|
||||||
getCascaderList() {
|
getCascaderList() {
|
||||||
serve.getCascaderList().then((res) => {
|
serve.getCascaderList().then(res => {
|
||||||
this.cascaderList = res.data;
|
this.cascaderList = res.data
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
this.$refs["form"].validate((valid) => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let params = { transactionType: "RECHARGE", ...this.form };
|
let params = { transactionType: 'RECHARGE', ...this.form }
|
||||||
if (this.form.companyBankCardArr.length) {
|
if (this.form.companyBankCardArr.length) {
|
||||||
let index = this.form.companyBankCardArr.length - 1;
|
let index = this.form.companyBankCardArr.length - 1
|
||||||
params["companyBankCardId"] = this.form.companyBankCardArr[index];
|
params['companyBankCardId'] = this.form.companyBankCardArr[index]
|
||||||
}
|
}
|
||||||
this.judgeInterface(params).then((res) => {
|
this.judgeInterface(params).then(res => {
|
||||||
this.$message.success(res.msg);
|
this.$message.success(res.msg)
|
||||||
this.closeWindow();
|
this.closeWindow()
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
judgeInterface(form) {
|
judgeInterface(form) {
|
||||||
let { id } = this.controlWindows.addInfo;
|
let { id } = this.controlWindows.addInfo
|
||||||
if (id) return serve.update(form);
|
if (id) return serve.update(form)
|
||||||
else return serve.save(form);
|
else return serve.save(form)
|
||||||
},
|
},
|
||||||
closeWindow() {
|
closeWindow() {
|
||||||
this.$emit("closeWindow");
|
this.$emit('closeWindow')
|
||||||
this.form = {};
|
this.form = {}
|
||||||
this.companyFinance = {};
|
this.companyFinance = {}
|
||||||
this.fileList = [];
|
this.fileList = []
|
||||||
this.controlWindows.addInfo = {};
|
this.controlWindows.addInfo = {}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.form.clearValidate();
|
this.$refs.form.clearValidate()
|
||||||
this.controlWindows.add = false;
|
this.controlWindows.add = false
|
||||||
});
|
})
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -10,24 +10,11 @@
|
|||||||
<div class="add">
|
<div class="add">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
||||||
<el-form-item label="公司" prop="companyId">
|
<el-form-item label="公司" prop="companyId">
|
||||||
<autocomplete
|
<autocomplete :params="form" :config="configAutocomplete" @change="companyChange" />
|
||||||
:params="form"
|
|
||||||
:config="configAutocomplete"
|
|
||||||
@change="companyChange"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="交易类型" prop="turnType">
|
<el-form-item label="交易类型" prop="turnType">
|
||||||
<el-select
|
<el-select :disabled="!!form.id" v-model="form.turnType" placeholder="请选择交易类型">
|
||||||
:disabled="!!form.id"
|
<el-option v-for="(item, index) in correspondTypeEnum" :key="index" :label="item.label" :value="item.value" />
|
||||||
v-model="form.turnType"
|
|
||||||
placeholder="请选择交易类型"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="(item, index) in correspondTypeEnum"
|
|
||||||
:key="index"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -43,17 +30,9 @@
|
|||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
<i class="el-icon-bank-card"></i>
|
<i class="el-icon-bank-card"></i>
|
||||||
{{
|
{{ correspondTypeEnum.find(item => item.value == form.turnType).label }}
|
||||||
correspondTypeEnum.find((item) => item.value == form.turnType)
|
|
||||||
.label
|
|
||||||
}}
|
|
||||||
</template>
|
</template>
|
||||||
{{
|
{{ companyInfo[correspondTypeEnum.find(item => item.value == form.turnType).valueKey] }}
|
||||||
companyInfo[
|
|
||||||
correspondTypeEnum.find((item) => item.value == form.turnType)
|
|
||||||
.valueKey
|
|
||||||
]
|
|
||||||
}}
|
|
||||||
</el-descriptions-item>
|
</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-item label="充值返利余额"></el-descriptions-item>
|
||||||
@@ -61,23 +40,16 @@
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="炼厂中心账户" prop="refineryCenterAccountId">
|
||||||
|
<autocomplete :params="form" :config="accountNameAutocomplete" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="圈回金额" prop="transactionAmount">
|
<el-form-item label="圈回金额" prop="transactionAmount">
|
||||||
<el-input
|
<el-input v-checkNum placeholder="圈回金额" v-model="form.transactionAmount"> </el-input>
|
||||||
v-checkNum
|
|
||||||
placeholder="圈回金额"
|
|
||||||
v-model="form.transactionAmount"
|
|
||||||
>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="圈回原因" prop="reverseRemark">
|
<el-form-item label="圈回原因" prop="reverseRemark">
|
||||||
<el-input
|
<el-input type="textarea" :rows="2" placeholder="请输入圈回原因" v-model="form.reverseRemark"> </el-input>
|
||||||
type="textarea"
|
|
||||||
:rows="2"
|
|
||||||
placeholder="请输入圈回原因"
|
|
||||||
v-model="form.reverseRemark"
|
|
||||||
>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -89,17 +61,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import serve from "api/financialCenter/enterpriseRecharge.js";
|
import serve from 'api/financialCenter/enterpriseRecharge.js'
|
||||||
import commonServe from "api/common.js";
|
import commonServe from 'api/common.js'
|
||||||
|
|
||||||
import autocomplete from "components/autocomplete/index.vue";
|
import autocomplete from 'components/autocomplete/index.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
autocomplete,
|
autocomplete
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
controlWindows: Object,
|
controlWindows: Object
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
// let validatorcompanyId = (rule, value, callback) => {
|
// let validatorcompanyId = (rule, value, callback) => {
|
||||||
@@ -107,55 +79,65 @@ export default {
|
|||||||
// else callback("请选择公司");
|
// else callback("请选择公司");
|
||||||
// };
|
// };
|
||||||
let validatortransactionAmount = (rule, value, callback) => {
|
let validatortransactionAmount = (rule, value, callback) => {
|
||||||
let typeTarget = this.correspondTypeEnum.find(
|
let typeTarget = this.correspondTypeEnum.find(item => item.value == this.form.turnType)
|
||||||
(item) => item.value == this.form.turnType
|
let superiorLimit = this.companyInfo[typeTarget.valueKey]
|
||||||
);
|
if (value == '') callback('请输入圈回金额')
|
||||||
let superiorLimit = this.companyInfo[typeTarget.valueKey];
|
|
||||||
if (value == "") callback("请输入圈回金额");
|
|
||||||
if (value > superiorLimit) {
|
if (value > superiorLimit) {
|
||||||
callback(`圈回金额不可超过${typeTarget.label}`);
|
callback(`圈回金额不可超过${typeTarget.label}`)
|
||||||
}
|
}
|
||||||
callback();
|
callback()
|
||||||
};
|
}
|
||||||
|
let validatorRefineryCenterAccountId = (rule, value, callback) => {
|
||||||
|
if (this.form.refineryCenterAccountId) callback()
|
||||||
|
else callback('请选择炼厂中心账户')
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
companyFinance: {},
|
companyFinance: {},
|
||||||
companyInfo: {},
|
companyInfo: {},
|
||||||
form: {},
|
form: {},
|
||||||
configAutocomplete: {
|
configAutocomplete: {
|
||||||
serveTarget: commonServe.getRefineryCompanyList,
|
serveTarget: commonServe.getRefineryCompanyList,
|
||||||
autocompleteKey: "name",
|
autocompleteKey: 'name',
|
||||||
labelKey: "name",
|
labelKey: 'name',
|
||||||
valueKey: "id",
|
valueKey: 'id',
|
||||||
placeholder: "企业名称",
|
placeholder: '企业名称',
|
||||||
querykey: "companyId",
|
querykey: 'companyId',
|
||||||
echoId: "",
|
echoId: '',
|
||||||
echoName: "",
|
echoName: '',
|
||||||
isDisabled: false,
|
isDisabled: false
|
||||||
|
},
|
||||||
|
accountNameAutocomplete: {
|
||||||
|
serveTarget: commonServe.findByEntity,
|
||||||
|
autocompleteKey: 'accountName',
|
||||||
|
labelKey: 'accountName',
|
||||||
|
valueKey: 'id',
|
||||||
|
placeholder: '炼厂中心账户',
|
||||||
|
querykey: 'refineryCenterAccountId',
|
||||||
|
echoId: '',
|
||||||
|
echoName: '',
|
||||||
|
isDisabled: false
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
// companyId: [
|
// companyId: [
|
||||||
// { required: true, validator: validatorcompanyId, trigger: "change" },
|
// { required: true, validator: validatorcompanyId, trigger: "change" },
|
||||||
// ],
|
// ],
|
||||||
turnType: [
|
turnType: [{ required: true, message: '请选择交易类型', trigger: 'change' }],
|
||||||
{ required: true, message: "请选择交易类型", trigger: "change" },
|
|
||||||
],
|
|
||||||
transactionAmount: [
|
transactionAmount: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
validator: validatortransactionAmount,
|
validator: validatortransactionAmount,
|
||||||
trigger: "change",
|
trigger: 'blur'
|
||||||
},
|
}
|
||||||
],
|
|
||||||
reverseRemark: [
|
|
||||||
{ required: true, message: "请输入圈回说明", trigger: "blur" },
|
|
||||||
],
|
],
|
||||||
|
reverseRemark: [{ required: true, message: '请输入圈回说明', trigger: 'blur' }],
|
||||||
|
refineryCenterAccountId: [{ required: true, validator: validatorRefineryCenterAccountId, trigger: 'change' }]
|
||||||
},
|
},
|
||||||
correspondTypeEnum: [
|
correspondTypeEnum: [
|
||||||
{
|
{
|
||||||
value: 1,
|
value: 1,
|
||||||
label: "充值余额",
|
label: '充值余额',
|
||||||
valueKey: "rechargeBalance",
|
valueKey: 'rechargeBalance'
|
||||||
},
|
}
|
||||||
// {
|
// {
|
||||||
// value: 2,
|
// value: 2,
|
||||||
// label: "赊销余额",
|
// label: "赊销余额",
|
||||||
@@ -171,77 +153,85 @@ export default {
|
|||||||
// label: "消费返利余额",
|
// label: "消费返利余额",
|
||||||
// valueKey: "consumeRebateBalance",
|
// valueKey: "consumeRebateBalance",
|
||||||
// },
|
// },
|
||||||
],
|
]
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
correspondingEnum() {},
|
correspondingEnum() {}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openDrawer() {
|
openDrawer() {
|
||||||
let { id } = this.controlWindows.addInfo;
|
let { id, companyName, refineryCenterAccountId, refineryCenterAccountName } = this.controlWindows.addInfo
|
||||||
//回显
|
//回显
|
||||||
if (id) {
|
if (id) {
|
||||||
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo));
|
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo))
|
||||||
this.form.transactionAmount = Math.abs(this.form.transactionAmount);
|
this.form.transactionAmount = Math.abs(this.form.transactionAmount)
|
||||||
this.companyChange(this.form.companyId);
|
this.companyChange(this.form.companyId)
|
||||||
|
|
||||||
|
let configUpdata = {
|
||||||
|
echoId: id || '',
|
||||||
|
echoName: companyName || '',
|
||||||
|
isDisabled: !!id
|
||||||
|
}
|
||||||
|
// ? { echoId: id || '', echoName: this.form.refineryName || '', isDisabled: !!id }
|
||||||
|
// : {
|
||||||
|
// echoId: "",
|
||||||
|
// echoName: "",
|
||||||
|
// isDisabled: false,
|
||||||
|
// };
|
||||||
|
let configUpdata2 = {
|
||||||
|
echoId: refineryCenterAccountId || '',
|
||||||
|
echoName: refineryCenterAccountName || '',
|
||||||
|
isDisabled: !!refineryCenterAccountId
|
||||||
|
}
|
||||||
|
Object.assign(this.configAutocomplete, configUpdata)
|
||||||
|
Object.assign(this.accountNameAutocomplete, configUpdata2)
|
||||||
|
console.log('this.accountNameAutocomplete', this.accountNameAutocomplete)
|
||||||
}
|
}
|
||||||
let configUpdata = {
|
|
||||||
echoId: id || "",
|
|
||||||
echoName: this.form.refineryName || "",
|
|
||||||
isDisabled: !!id,
|
|
||||||
};
|
|
||||||
// ? { echoId: id || '', echoName: this.form.refineryName || '', isDisabled: !!id }
|
|
||||||
// : {
|
|
||||||
// echoId: "",
|
|
||||||
// echoName: "",
|
|
||||||
// isDisabled: false,
|
|
||||||
// };
|
|
||||||
Object.assign(this.configAutocomplete, configUpdata);
|
|
||||||
},
|
},
|
||||||
// 公司财务信息
|
// 公司财务信息
|
||||||
companyChange(id) {
|
companyChange(id) {
|
||||||
if (id) {
|
if (id) {
|
||||||
serve.getByCompanyId(id).then((res) => {
|
serve.getByCompanyId(id).then(res => {
|
||||||
this.companyFinance = res.data;
|
this.companyFinance = res.data
|
||||||
this.getByCompanyId(res.data.companyId);
|
this.getByCompanyId(res.data.companyId)
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
getByCompanyId(id) {
|
getByCompanyId(id) {
|
||||||
commonServe.getByCompanyIdAccount(id).then((res) => {
|
commonServe.getByCompanyIdAccount(id).then(res => {
|
||||||
this.companyInfo = res.data;
|
this.companyInfo = res.data
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
submit() {
|
submit() {
|
||||||
this.$refs["form"].validate((valid) => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let params = { transactionType: "TURN", ...this.form };
|
let params = { transactionType: 'TURN', ...this.form }
|
||||||
this.judgeInterface(params).then((res) => {
|
this.judgeInterface(params).then(res => {
|
||||||
this.$message.success(res.msg);
|
this.$message.success(res.msg)
|
||||||
this.closeWindow();
|
this.closeWindow()
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
judgeInterface(form) {
|
judgeInterface(form) {
|
||||||
let { id } = this.controlWindows.addInfo;
|
let { id } = this.controlWindows.addInfo
|
||||||
if (id) return serve.update(form);
|
if (id) return serve.update(form)
|
||||||
else return serve.save(form);
|
else return serve.save(form)
|
||||||
},
|
},
|
||||||
closeWindow() {
|
closeWindow() {
|
||||||
this.$emit("closeWindow");
|
this.$emit('closeWindow')
|
||||||
this.form = {};
|
this.form = {}
|
||||||
this.controlWindows.addInfo = {};
|
this.controlWindows.addInfo = {}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.form.clearValidate();
|
this.$refs.form.clearValidate()
|
||||||
this.controlWindows.addTurn = false;
|
this.controlWindows.addTurn = false
|
||||||
});
|
})
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user