| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <template>
- <el-dialog
- title="添加"
- :visible.sync="dialogVisible"
- width="30%"
- append-to-body
- :modal="false"
- @close="cancelHundler"
- >
- <el-form :model="newDivisionForm" label-width="120px">
- <el-form-item label="行政区划名称">
- <el-input v-model="newDivisionForm.adName" style="width:70%;"></el-input>
- </el-form-item>
- <el-form-item label="操作">
- <el-button @click="cancelHundler">取 消</el-button>
- <el-button type="primary" @click="submitInsert">确 定</el-button>
- </el-form-item>
- </el-form>
- </el-dialog>
- </template>
- <script>
- import { submitInsertCun} from "@api/duChaTianBao.js";
- export default {
- props: ['rootCode'],
- data(){
- return{
- dialogVisible: true,
- newDivisionForm:{
- "adAbbrName": "",
- "adFcode": "",
- "adFullName": "",
- "adName": "",
- },
- }
- },
- mounted(){},
- methods:{
- submitInsert:function(){
- submitInsertCun(this.newDivisionForm.adName,this.rootCode).then(
- (res) => {
- console.log(res);
- this. newDivisionForm={
- "adAbbrName": "",
- "adFcode": "",
- "adFullName": "",
- "adName": "",
- };
- this.$emit('addSuccess')
- }
- );
- },
- cancelHundler(){
- this.$emit('cancelHundler')
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
|