| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <template>
- <div>
- <el-button size="mini" type="primary" @click="dialogFormVisible = true">新 增</el-button>
- <el-dialog title="新 增" :visible.sync="dialogFormVisible" width="500px">
- <div slot="title" style="font-size: 15px">
- 新增账户类型
- </div>
- <el-row :gutter="20">
- <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="left" size="mini">
- <el-col :span="20">
- <el-form-item label="账户编号" prop="accountno">
- <el-input v-model="form.accountno" placeholder="账户编号"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="20">
- <el-form-item label="账户名称" prop="accountname">
- <el-input v-model="form.accountname" placeholder="账户名称"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="10">
- <el-form-item >
- <el-checkbox :true-label="1" :false-label="0" v-model="form.isorder" checked="checked">允许订货</el-checkbox>
- </el-form-item>
- </el-col>
- </el-form>
- </el-row>
- <div class="dialog-footer">
- <el-button size="small" @click="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
- <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width btn-warning">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- export default {
- name: "add",
- data(){
- return {
- dialogFormVisible:false,
- isordercheck:true,
- isusedcheck:false,
- form:{
- sa_accountclassid:0,
- accountno:'',
- accountname:'',
- isorder:'',
- isused:0
- },
- rules:{
- accountno:[
- { required: true, message: '输入账户编号', trigger: 'blur'},
- ],
- accountname:[
- { required: true, message: '输入账户名称', trigger: 'blur'}
- ]
- }
- }
- },
- methods:{
- onSubmit(){
- console.log(this.form)
- this.$refs['form'].validate(async (valid) => {
- if (!valid) return false
- const res = await this.$api.requested({
- "id": "20221008134703",
- "version":1,
- "content": this.form
- })
- this.tool.showMessage(res,()=>{
- this.$emit('onSuccess')
- this.$refs['form'].resetFields();
- this.dialogFormVisible = false
- })
- })
- }
- }
- }
- </script>
- <style scoped>
- </style>
|