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

@ -28,6 +28,9 @@
</el-descriptions-item> </el-descriptions-item>
</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="transactionType"> <el-form-item label="交易类型" prop="transactionType">
<el-select v-model="form.transactionType" placeholder="请选择"> <el-select v-model="form.transactionType" placeholder="请选择">
<el-option label="充值" value="RECHARGE"> </el-option> <el-option label="充值" value="RECHARGE"> </el-option>
@ -49,6 +52,7 @@
<script> <script>
import refineryInfoServe from 'api/refineryInfo.js' import refineryInfoServe from 'api/refineryInfo.js'
import serve from '@/api/refineryAccount/rechargeManagement.js' import serve from '@/api/refineryAccount/rechargeManagement.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 {
@ -63,14 +67,19 @@ export default {
if (this.form.refineryId) callback() if (this.form.refineryId) callback()
else callback('请选择炼厂') else callback('请选择炼厂')
} }
let validatorRefineryCenterAccountId = (rule, value, callback) => {
if (this.form.refineryCenterAccountId) callback()
else callback('请选择炼厂中心账户')
}
let validatorTransactionAmount = (rule, value, callback) => { let validatorTransactionAmount = (rule, value, callback) => {
if (!value) return callback('请输入交易金额或交易金额不可为0') if (!value) return callback('请输入交易金额或交易金额不可为0')
if (this.form.transactionType === 'TURN' && +value > +this.refineryAccountInfo.balance) return callback('交易金额不可高于账户余额') if (this.form.transactionType === 'TURN' && +value > +this.refineryAccountInfo.balance) return callback('交易金额不可高于账户余额')
callback() callback()
} }
return { return {
form: { refineryAccountId: '', refineryCenterAccountId: '' },
refineryAccountList: [], refineryAccountList: [],
form: { refineryAccountId: '' },
refineryList: [], refineryList: [],
configAutocomplete: { configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity, serveTarget: refineryInfoServe.findByEntity,
@ -80,11 +89,20 @@ export default {
placeholder: '炼厂名称', placeholder: '炼厂名称',
querykey: 'refineryId' querykey: 'refineryId'
}, },
accountNameAutocomplete: {
serveTarget: commonServe.findByEntity,
autocompleteKey: 'accountName',
labelKey: 'accountName',
valueKey: 'id',
placeholder: '炼厂中心账户',
querykey: 'refineryCenterAccountId'
},
rules: { rules: {
refineryId: [{ required: true, validator: validatorRefineryId, trigger: 'change' }], refineryId: [{ required: true, validator: validatorRefineryId, trigger: 'change' }],
refineryAccountId: [{ required: true, message: '请选择炼厂账户', trigger: 'blur' }], refineryAccountId: [{ required: true, message: '请选择炼厂账户', trigger: 'blur' }],
transactionType: [{ required: true, message: '请选择交易类型', trigger: 'change' }], 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>
<div class="table"> <div class="table">
<div class="operation"> <div class="operation">
<el-button @click="rechargeTurn">充值圈回</el-button> <el-button @click="rechargeTurn">充值 / 圈回</el-button>
</div> </div>
<el-table v-if="tableHeight" ref="multipleTable" :height="tableHeight" :data="tableData" style="width: 100%"> <el-table v-if="tableHeight" ref="multipleTable" :height="tableHeight" :data="tableData" style="width: 100%">
<el-table-column label="炼厂账户名称" show-overflow-tooltip> <el-table-column label="炼厂账户名称" show-overflow-tooltip>

Loading…
Cancel
Save