54139f8e6160028c2ebcf0efcaed8f037b66b5e3.svn-base 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <el-dialog
  3. title="添加"
  4. :visible.sync="dialogVisible"
  5. width="30%"
  6. append-to-body
  7. :modal="false"
  8. @close="cancelHundler"
  9. >
  10. <el-form :model="newDivisionForm" label-width="120px">
  11. <el-form-item label="行政区划名称">
  12. <el-input v-model="newDivisionForm.adName" style="width:70%;"></el-input>
  13. </el-form-item>
  14. <el-form-item label="操作">
  15. <el-button @click="cancelHundler">取 消</el-button>
  16. <el-button type="primary" @click="submitInsert">确 定</el-button>
  17. </el-form-item>
  18. </el-form>
  19. </el-dialog>
  20. </template>
  21. <script>
  22. import { submitInsertCun} from "@api/duChaTianBao.js";
  23. export default {
  24. props: ['rootCode'],
  25. data(){
  26. return{
  27. dialogVisible: true,
  28. newDivisionForm:{
  29. "adAbbrName": "",
  30. "adFcode": "",
  31. "adFullName": "",
  32. "adName": "",
  33. },
  34. }
  35. },
  36. mounted(){},
  37. methods:{
  38. submitInsert:function(){
  39. submitInsertCun(this.newDivisionForm.adName,this.rootCode).then(
  40. (res) => {
  41. console.log(res);
  42. this. newDivisionForm={
  43. "adAbbrName": "",
  44. "adFcode": "",
  45. "adFullName": "",
  46. "adName": "",
  47. };
  48. this.$emit('addSuccess')
  49. }
  50. );
  51. },
  52. cancelHundler(){
  53. this.$emit('cancelHundler')
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. </style>