|
@@ -17,13 +17,13 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <cy-info-title>出入账信息</cy-info-title>
|
|
|
+ <cy-info-title style="margin-top: 10px">出入账信息</cy-info-title>
|
|
|
<el-form-item label="账户归属" prop="attributionOfAccountId">
|
|
|
<el-radio-group v-model="ruleForm.attributionOfAccountId" @change="attributionOfAccountChange(ruleForm.companyOwnershipId)">
|
|
|
<el-radio v-for="item in attributionOfAccountList" :key="item.id" :label="item.id">{{ item.name }}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="公司归属">
|
|
|
+ <el-form-item label="公司归属" prop="companyOwnershipId" class="form-required">
|
|
|
<el-select
|
|
|
v-if="!isCapital(ruleForm.attributionOfAccountId)"
|
|
|
v-model="ruleForm.companyOwnershipId"
|
|
@@ -53,7 +53,7 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="isCapital(ruleForm.attributionOfAccountId)" label="业务类型">
|
|
|
+ <el-form-item v-if="isCapital(ruleForm.attributionOfAccountId)" label="业务类型" class="form-required">
|
|
|
<el-select
|
|
|
v-model="ruleForm.businessTypeId"
|
|
|
filterable
|
|
@@ -68,7 +68,7 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="开户银行名称">
|
|
|
+ <el-form-item label="开户银行名称" prop="bankName">
|
|
|
<el-select
|
|
|
v-if="!isCapital(ruleForm.attributionOfAccountId)"
|
|
|
v-model="ruleForm.bankName"
|
|
@@ -98,7 +98,7 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="账号">
|
|
|
+ <el-form-item label="账号" prop="bankCardNo">
|
|
|
<el-input
|
|
|
v-model="ruleForm.bankCardNo"
|
|
|
placeholder="请输入账号"
|
|
@@ -121,6 +121,7 @@
|
|
|
v-if="ruleForm.type === 'entryType_cash'"
|
|
|
label="入账金额"
|
|
|
prop="incomeAmount"
|
|
|
+ class="form-required"
|
|
|
>
|
|
|
<cy-amount-input v-model="ruleForm.incomeAmount" class="one-form-item" />
|
|
|
</el-form-item>
|
|
@@ -223,6 +224,24 @@ export default {
|
|
|
rules: {
|
|
|
billType: [
|
|
|
{ required: true, message: '请选择出入账类型', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ companyId: [
|
|
|
+ { required: true, message: '请选择企业名称', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ attributionOfAccountId: [
|
|
|
+ { required: true, message: '请选择账户归属', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ bankName: [
|
|
|
+ { required: true, message: '请选择开户银行名称', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ bankCardNo: [
|
|
|
+ { required: true, message: '请选择开户行账号', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ type: [
|
|
|
+ { required: true, message: '请选择类型', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ incomeDate: [
|
|
|
+ { required: true, message: '请选择入账日期', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
corporateNameList: [],
|
|
@@ -418,6 +437,30 @@ export default {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
const { companyId, attributionOfAccountId, companyOwnershipId, refinancingManagementId, bankCardNoId, businessTypeId, businessNumberId, type, incomeDate, incomeAmount, invoiceAmount, realAmount, remark, bankName, bankCardNo, id } = this.ruleForm
|
|
|
|
|
|
+ // 账户归属选择为资方的时候校验公司归属和业务类型
|
|
|
+ if (this.isCapital(attributionOfAccountId)) {
|
|
|
+ if (!refinancingManagementId) {
|
|
|
+ this.$message.warning('请选择公司归属')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!businessTypeId) {
|
|
|
+ this.$message.warning('请选择业务类型')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!this.isCapital(attributionOfAccountId)) {
|
|
|
+ if (!companyOwnershipId) {
|
|
|
+ this.$message.warning('请选择公司归属')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 当类型为现金时校验入账金额
|
|
|
+ if (type === 'entryType_cash') {
|
|
|
+ if (!incomeAmount) {
|
|
|
+ this.$message.warning('请输入账金额据金额')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
// 当类型为票据贴现时校验票据金额和实际金额
|
|
|
if (type === 'entryType_bills_discounted') {
|
|
|
if (!invoiceAmount) {
|
|
@@ -451,7 +494,11 @@ export default {
|
|
|
param.invoiceAmount = invoiceAmount
|
|
|
param.realAmount = realAmount
|
|
|
}
|
|
|
- resolve(param)
|
|
|
+ this.$refs.ruleForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ resolve(param)
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
}
|