付款金额限制

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> <el-tag type="info">{{ scope.row.type }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="原有库存" prop="leftNumber">
</el-table-column>
<el-table-column label="变动数量" prop="stockNumber"> <el-table-column label="变动数量" prop="stockNumber">
<template v-slot="scope"> <template v-slot="scope">
<span class="num" :class="{ active: scope.row.stockNumber > 0 }"> <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" <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> @current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<!-- 付款弹窗组件 --> <!-- 付款弹窗组件 -->
<el-dialog title="" :visible.sync="dialogTableVisible" width="350px"> <el-dialog title="" :visible.sync="dialogTableVisible" width="350px">
<el-form> <el-form :rules="rules" ref="ruleForm" :model="ruleForm">
<el-form-item label="付款金额" label-width="80px"> <el-form-item label="付款金额" label-width="80px" prop="montey">
<el-input v-model="montey" type="number" autocomplete="off"></el-input> <el-input v-model="ruleForm.montey" placeholder="请输入金额" type="number" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="付款方式" label-width="80px"> <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-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisible = false; montey = ''; payType = ''"> </el-button> <el-button @click="dialogTableVisible = false; ruleForm.montey = ''; ruleForm.payType = ''"> </el-button>
<el-button type="primary" @click="sumbit()"> </el-button> <el-button type="primary" @click="sumbit('ruleForm')"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@@ -209,8 +209,10 @@ export default {
label: '作废' label: '作废'
} }
], ],
montey: null, ruleForm:{
payType: null, montey: null,
payType: null,
},
selectCount: 0, selectCount: 0,
query: { query: {
type: '', type: '',
@@ -227,6 +229,11 @@ export default {
list: [] list: []
}, },
info: '', info: '',
rules: {
montey: [
{ required: true, message: '请输入金额', trigger: 'blur' },
],
}
} }
}, },
mounted() { mounted() {
@@ -237,23 +244,24 @@ export default {
this.dialogTableVisible = true this.dialogTableVisible = true
this.idinfo = id this.idinfo = id
}, },
async sumbit() { sumbit(formName) {
this.dialogTableVisible = false this.$refs[formName].validate( async (valid) => {
try { if (valid) {
const res = await paidAmount({ this.dialogTableVisible = false
id: this.idinfo, const res = await paidAmount({
paidAmount: this.montey, id: this.idinfo,
payType: this.payType paidAmount: this.ruleForm.montey,
}) payType: this.payType
})
this.$message({ type: 'success', message: '付款成功!' }); this.$message({ type: 'success', message: '付款成功!' });
this.montey = '' this.ruleForm.montey = ''
this.payType = '' this.ruleForm.payType = ''
this.getTableData() this.getTableData()
} else {
} catch (error) { return false;
console.log(error);
} }
});
}, },
async getTableData() { async getTableData() {
this.tableData.loading = true this.tableData.loading = true