147 lines
3.9 KiB
Vue
147 lines
3.9 KiB
Vue
<template>
|
|
<div >
|
|
<el-row :gutter="0">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-col :span="24">
|
|
<el-form-item label="区名称" prop="name">
|
|
<el-input v-model="form.name" placeholder="区名称" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="英文名称" prop="nameEn">
|
|
<el-input v-model="form.nameEn" placeholder="英文名称" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="排序" prop="orderNum">
|
|
<el-input v-model="form.orderNum" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<!-- <el-col :span="24">
|
|
<el-form-item label="区代码" prop="code">
|
|
<el-input v-model="form.code" placeholder="区代码" />
|
|
</el-form-item>
|
|
</el-col> -->
|
|
<!-- <el-col :span="24">
|
|
<el-form-item label="二字码" prop="twoCode">
|
|
<el-input v-model="form.twoCode" placeholder="请输入二字码" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="三字码" prop="threeCode">
|
|
<el-input v-model="form.threeCode" placeholder="请输入三字码" />
|
|
</el-form-item>
|
|
</el-col> -->
|
|
<el-col :span="24">
|
|
<el-form-item label="备注" prop="remark">
|
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-form>
|
|
</el-row>
|
|
<div style="text-align: center;margin-bottom: 10px;">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { listEmisContinent, getEmisContinent, delEmisContinent, addEmisContinent, updateEmisContinent } from "@/api/emis/emisContinent";
|
|
|
|
export default {
|
|
name: "emisContinentForm",
|
|
props:{
|
|
id:undefined
|
|
},
|
|
components: { },
|
|
dicts: [
|
|
],
|
|
data() {
|
|
return {
|
|
emisContinentOptions: [],
|
|
// 遮罩层
|
|
loading: true,
|
|
// 表单参数
|
|
form: {},
|
|
// 表单校验
|
|
rules: {
|
|
id: [
|
|
// { required: true, message: "洲序号不能为空", trigger: "blur" }
|
|
],
|
|
}
|
|
};
|
|
},
|
|
watch: {
|
|
"id": {
|
|
handler (newValue, oldValue) {
|
|
this.id = newValue;
|
|
this.initData();
|
|
},
|
|
deep: true
|
|
}
|
|
},
|
|
created() {
|
|
this.initData();
|
|
},
|
|
|
|
methods: {
|
|
initData() {
|
|
this.reset();
|
|
if(this.id !=undefined) {
|
|
this.loading = true;
|
|
getEmisContinent(this.id).then(response => {
|
|
this.form = response.data;
|
|
this.loading = false;
|
|
});
|
|
}
|
|
},
|
|
// 取消按钮
|
|
cancel() {
|
|
this.reset();
|
|
this.$emit("on-cancel");
|
|
},
|
|
// 表单重置
|
|
reset() {
|
|
this.form = {
|
|
id: null,
|
|
name: null,
|
|
nameEn: null,
|
|
code: null,
|
|
twoCode: null,
|
|
threeCode: null,
|
|
orderNum:null,
|
|
remark: null,
|
|
tenantId: null,
|
|
delFlag: null,
|
|
createBy: null,
|
|
createTime: null,
|
|
updateBy: null,
|
|
updateTime: null
|
|
};
|
|
this.resetForm("form");
|
|
},
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
updateEmisContinent(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$emit("on-changed");
|
|
});
|
|
} else {
|
|
addEmisContinent(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$emit("on-changed");
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
|
|
}
|
|
};
|
|
</script>
|