pull/19/head^2
xiaozhiyong 1 year ago
parent 4acef527e7
commit da196203e8
  1. 60
      src/api/common.js
  2. 22
      src/views/refineryAccount/rechargeManagement/components/rechargeTurn.vue
  3. 2
      src/views/refineryAccount/rechargeManagement/index.vue

@ -1,39 +1,40 @@
import request from "utils/axios.js";
import request from 'utils/axios.js'
// 远程搜索公司
const getRefineryCompanyList = (params) => {
return request.postJson(
"/oil-user/oilCompanyInfo/getRefineryCompanyList",
params
);
};
const getRefineryCompanyList = params => {
return request.postJson('/oil-user/oilCompanyInfo/getRefineryCompanyList', params)
}
// 远程总公司
const getCompanyNames = (query) => {
return request.get(`oil-user/oilCompanyInfo/getCompanyNames/${query}`);
};
const getCompanyNames = query => {
return request.get(`oil-user/oilCompanyInfo/getCompanyNames/${query}`)
}
// 远程搜索用户
const liekQuery = (query) => {
return request.get(`oil-user/sysCustomerInfo/liekQuery/${query}`);
};
const liekQuery = query => {
return request.get(`oil-user/sysCustomerInfo/liekQuery/${query}`)
}
// 用户详情
const getInfo = (id) => {
return request.get(`/oil-user/oilCompanyInfo/get/${id}`);
};
const getInfo = id => {
return request.get(`/oil-user/oilCompanyInfo/get/${id}`)
}
//公司财务信息
const getByCompanyIdFinance = (query) => {
return request.get(`/oil-user/oilCompanyFinance/getByCompanyId/${query}`);
};
const getByCompanyIdFinance = query => {
return request.get(`/oil-user/oilCompanyFinance/getByCompanyId/${query}`)
}
// 公司认证信息
const getByCompanyIdAuth = (id) => {
return request.get(`/oil-user/oilCompanyAuth/getByCompanyId/${id}`);
};
const getByCompanyIdAuth = id => {
return request.get(`/oil-user/oilCompanyAuth/getByCompanyId/${id}`)
}
//公司账户信息
const getByCompanyIdAccount = (query) => {
return request.get(`/oil-finance/oilCompanyAccount/getByCompanyId/${query}`);
};
const getByCompanyIdAccount = query => {
return request.get(`/oil-finance/oilCompanyAccount/getByCompanyId/${query}`)
}
// 银行信息
const getByCompanyIdBankCard = (id) => {
return request.get(`/oil-finance/oilCompanyBankCard/getByCompanyId/${id}`);
};
const getByCompanyIdBankCard = id => {
return request.get(`/oil-finance/oilCompanyBankCard/getByCompanyId/${id}`)
}
// 炼厂中心账户
const findByEntity = params => {
return request.postJson('/oil-refinery/xoilRefineryCenterAccount/findByEntity', params)
}
export default {
getRefineryCompanyList,
getCompanyNames,
@ -43,4 +44,5 @@ export default {
getByCompanyIdAuth,
getByCompanyIdFinance,
getByCompanyIdBankCard,
};
findByEntity
}

@ -28,6 +28,9 @@
</el-descriptions-item>
</el-descriptions>
</el-form-item>
<el-form-item label="炼厂中心账户" prop="refineryCenterAccountId">
<autocomplete :params="form" :config="accountNameAutocomplete" />
</el-form-item>
<el-form-item label="交易类型" prop="transactionType">
<el-select v-model="form.transactionType" placeholder="请选择">
<el-option label="充值" value="RECHARGE"> </el-option>
@ -49,6 +52,7 @@
<script>
import refineryInfoServe from 'api/refineryInfo.js'
import serve from '@/api/refineryAccount/rechargeManagement.js'
import commonServe from '@/api/common.js'
import autocomplete from 'components/autocomplete/index.vue'
export default {
@ -63,14 +67,19 @@ export default {
if (this.form.refineryId) callback()
else callback('请选择炼厂')
}
let validatorRefineryCenterAccountId = (rule, value, callback) => {
if (this.form.refineryCenterAccountId) callback()
else callback('请选择炼厂中心账户')
}
let validatorTransactionAmount = (rule, value, callback) => {
if (!value) return callback('请输入交易金额或交易金额不可为0')
if (this.form.transactionType === 'TURN' && +value > +this.refineryAccountInfo.balance) return callback('交易金额不可高于账户余额')
callback()
}
return {
form: { refineryAccountId: '', refineryCenterAccountId: '' },
refineryAccountList: [],
form: { refineryAccountId: '' },
refineryList: [],
configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity,
@ -80,11 +89,20 @@ export default {
placeholder: '炼厂名称',
querykey: 'refineryId'
},
accountNameAutocomplete: {
serveTarget: commonServe.findByEntity,
autocompleteKey: 'accountName',
labelKey: 'accountName',
valueKey: 'id',
placeholder: '炼厂中心账户',
querykey: 'refineryCenterAccountId'
},
rules: {
refineryId: [{ required: true, validator: validatorRefineryId, trigger: 'change' }],
refineryAccountId: [{ required: true, message: '请选择炼厂账户', trigger: 'blur' }],
transactionType: [{ required: true, message: '请选择交易类型', trigger: 'change' }],
transactionAmount: [{ required: true, validator: validatorTransactionAmount, trigger: 'change' }]
transactionAmount: [{ required: true, validator: validatorTransactionAmount, trigger: 'change' }],
refineryCenterAccountId: [{ required: true, validator: validatorRefineryCenterAccountId, trigger: 'change' }]
}
}
},

@ -19,7 +19,7 @@
</div>
<div class="table">
<div class="operation">
<el-button @click="rechargeTurn">充值圈回</el-button>
<el-button @click="rechargeTurn">充值 / 圈回</el-button>
</div>
<el-table v-if="tableHeight" ref="multipleTable" :height="tableHeight" :data="tableData" style="width: 100%">
<el-table-column label="炼厂账户名称" show-overflow-tooltip>

Loading…
Cancel
Save