付款金额限制
This commit is contained in:
@@ -134,18 +134,18 @@
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<!-- 付款弹窗组件 -->
|
||||
<el-dialog title="" :visible.sync="dialogTableVisible" width="350px">
|
||||
<el-form>
|
||||
<el-form-item label="付款金额" label-width="80px">
|
||||
<el-input v-model="montey" type="number" autocomplete="off"></el-input>
|
||||
<el-dialog title="" :visible.sync="dialogTableVisible" width="350px">
|
||||
<el-form :rules="rules" ref="ruleForm" :model="ruleForm">
|
||||
<el-form-item label="付款金额" label-width="80px" prop="montey">
|
||||
<el-input v-model="ruleForm.montey" placeholder="请输入金额" type="number" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款方式" label-width="80px">
|
||||
<el-input v-model="payType" type="text" autocomplete="off"></el-input>
|
||||
<el-input v-model="ruleForm.payType" placeholder="请输入付款方式" type="text" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogTableVisible = false; montey = ''; payType = ''">取 消</el-button>
|
||||
<el-button type="primary" @click="sumbit()">确 定</el-button>
|
||||
<el-button @click="dialogTableVisible = false; ruleForm.montey = ''; ruleForm.payType = ''">取 消</el-button>
|
||||
<el-button type="primary" @click="sumbit('ruleForm')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -209,8 +209,10 @@ export default {
|
||||
label: '作废'
|
||||
}
|
||||
],
|
||||
montey: null,
|
||||
payType: null,
|
||||
ruleForm:{
|
||||
montey: null,
|
||||
payType: null,
|
||||
},
|
||||
selectCount: 0,
|
||||
query: {
|
||||
type: '',
|
||||
@@ -227,6 +229,11 @@ export default {
|
||||
list: []
|
||||
},
|
||||
info: '',
|
||||
rules: {
|
||||
montey: [
|
||||
{ required: true, message: '请输入金额', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -237,23 +244,24 @@ export default {
|
||||
this.dialogTableVisible = true
|
||||
this.idinfo = id
|
||||
},
|
||||
async sumbit() {
|
||||
this.dialogTableVisible = false
|
||||
try {
|
||||
const res = await paidAmount({
|
||||
id: this.idinfo,
|
||||
paidAmount: this.montey,
|
||||
payType: this.payType
|
||||
})
|
||||
|
||||
this.$message({ type: 'success', message: '付款成功!' });
|
||||
this.montey = ''
|
||||
this.payType = ''
|
||||
this.getTableData()
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
sumbit(formName) {
|
||||
this.$refs[formName].validate( async (valid) => {
|
||||
if (valid) {
|
||||
this.dialogTableVisible = false
|
||||
const res = await paidAmount({
|
||||
id: this.idinfo,
|
||||
paidAmount: this.ruleForm.montey,
|
||||
payType: this.payType
|
||||
})
|
||||
this.$message({ type: 'success', message: '付款成功!' });
|
||||
this.ruleForm.montey = ''
|
||||
this.ruleForm.payType = ''
|
||||
this.getTableData()
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
|
||||
Reference in New Issue
Block a user