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