|
|
|
@ -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' }] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|