付款金额限制

This commit is contained in:
duan
2024-06-28 15:43:21 +08:00
parent 9c815458a5
commit a6113908b4
2 changed files with 35 additions and 25 deletions

View File

@@ -29,6 +29,8 @@
<el-tag type="info">{{ scope.row.type }}</el-tag>
</template>
</el-table-column>
<el-table-column label="原有库存" prop="leftNumber">
</el-table-column>
<el-table-column label="变动数量" prop="stockNumber">
<template v-slot="scope">
<span class="num" :class="{ active: scope.row.stockNumber > 0 }">

View File

@@ -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