付款金额限制
This commit is contained in:
@@ -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 }">
|
||||
|
||||
@@ -135,17 +135,17 @@
|
||||
@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-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: '作废'
|
||||
}
|
||||
],
|
||||
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() {
|
||||
sumbit(formName) {
|
||||
this.$refs[formName].validate( async (valid) => {
|
||||
if (valid) {
|
||||
this.dialogTableVisible = false
|
||||
try {
|
||||
const res = await paidAmount({
|
||||
id: this.idinfo,
|
||||
paidAmount: this.montey,
|
||||
paidAmount: this.ruleForm.montey,
|
||||
payType: this.payType
|
||||
})
|
||||
|
||||
this.$message({ type: 'success', message: '付款成功!' });
|
||||
this.montey = ''
|
||||
this.payType = ''
|
||||
this.ruleForm.montey = ''
|
||||
this.ruleForm.payType = ''
|
||||
this.getTableData()
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
|
||||
Reference in New Issue
Block a user