| | |
| | | </el-form> |
| | | <div slot="footer" align="center" class="dialog-footer"> |
| | | <my-button name="取消" site="form" @click="close" /> |
| | | <my-button name="保存" site="form" @click="handleSubmit" /> |
| | | <el-button name="保存" type="primary" size="medium" :loading="btnloading" @click="handleSubmit">保存</el-button> |
| | | </div> |
| | | </win-md> |
| | | </template> |
| | |
| | | }; |
| | | return { |
| | | loading: false, |
| | | btnloading: false, |
| | | warehouseOptions: [], // 出库仓库列表 |
| | | categoryOptions: [], // 物品分类列表 |
| | | modelList: [], //型号列表 |
| | |
| | | handleSubmit() { |
| | | this.$refs['ruleForm'].validate((valid) => { |
| | | if (valid) { |
| | | this.btnloading = true; |
| | | console.log('this.formData', this.formData); |
| | | outputAdd(this.formData) |
| | | .then((res) => { |
| | | this.$message.success('保存成功!'); |
| | | this.btnloading = false; |
| | | this.close(); |
| | | this.$emit('search'); |
| | | }) |
| | | .catch((err) => { |
| | | console.log('edit err', err); |
| | | this.btnloading = false; |
| | | this.$message.error('保存失败'); |
| | | }); |
| | | } else { |
| | | this.$message.error('校验未通过,请检查。'); |
| | | this.btnloading = false; |
| | | } |
| | | }); |
| | | }, |