|
@@ -3,7 +3,7 @@
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
|
|
<el-form-item label="地区编码" prop="appOrg">
|
|
|
<el-input
|
|
|
- v-model="queryParams.unitCode"
|
|
|
+ v-model="queryParams.appOrg"
|
|
|
placeholder="请输入地区编码"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
@@ -11,7 +11,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="地区名称" prop="appName">
|
|
|
<el-input
|
|
|
- v-model="queryParams.unitName"
|
|
|
+ v-model="queryParams.appName"
|
|
|
placeholder="请输入地区名称"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
@@ -53,8 +53,8 @@
|
|
|
{{(scope.$index + 1) + ((queryParams.pageNum - 1) * queryParams.pageSize)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="地区编码" align="center" prop="unitCode" />
|
|
|
- <el-table-column label="地区名称" align="center" prop="unitName" />
|
|
|
+ <el-table-column label="地区编码" align="center" prop="appOrg" />
|
|
|
+ <el-table-column label="地区名称" align="center" prop="appName" />
|
|
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
@@ -86,21 +86,18 @@
|
|
|
<!-- 添加或修改地区编码对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="800px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="父地区" prop="parentUnitCode">
|
|
|
- <el-select v-model="form.parentUnitCode" placeholder="请选择父地区">
|
|
|
- <el-option
|
|
|
- v-for="item in unitList"
|
|
|
- :key="item.unitCode"
|
|
|
- :label="item.unitName"
|
|
|
- :value="item.unitCode">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="父地区">
|
|
|
+ <el-cascader :options="treeList" placeholder="请选择父地区" v-model="form.appParentOrg" :props="props" @change="handleChange" style="width: 400px">
|
|
|
+ <template slot-scope="{ node, data }">
|
|
|
+ <span>{{ data.appName }}</span>
|
|
|
+ </template>
|
|
|
+ </el-cascader>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="地区编码" prop="unitCode">
|
|
|
- <el-input v-model="form.unitCode" placeholder="请输入地区编码" />
|
|
|
+ <el-form-item label="地区编码" prop="appOrg">
|
|
|
+ <el-input v-model="form.appOrg" placeholder="请输入地区编码" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="地区名称" prop="unitName">
|
|
|
- <el-input v-model="form.unitName" placeholder="请输入地区名称" />
|
|
|
+ <el-form-item label="地区名称" prop="appName">
|
|
|
+ <el-input v-model="form.appName" placeholder="请输入地区名称" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -112,12 +109,26 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listPlatAppOrg, getPlatAppOrg, delPlatAppOrg, addPlatAppOrg, updatePlatAppOrg } from "@/api/zcustom/platAppOrg";
|
|
|
+import {
|
|
|
+ listPlatAppOrg,
|
|
|
+ getPlatAppOrg,
|
|
|
+ delPlatAppOrg,
|
|
|
+ addPlatAppOrg,
|
|
|
+ updatePlatAppOrg,
|
|
|
+ getListTree
|
|
|
+} from '@/api/zcustom/platAppOrg'
|
|
|
|
|
|
export default {
|
|
|
name: "PlatAppOrg",
|
|
|
data() {
|
|
|
return {
|
|
|
+ props:{
|
|
|
+ value: 'appOrg',
|
|
|
+ label: 'appName',
|
|
|
+ checkStrictly: true,
|
|
|
+ emitPath: false
|
|
|
+ },
|
|
|
+ treeList:[],
|
|
|
// 根路径
|
|
|
baseURL: process.env.VUE_APP_BASE_API,
|
|
|
// 遮罩层
|
|
@@ -144,9 +155,9 @@ export default {
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- parentUnitCode: null,
|
|
|
- unitCode: null,
|
|
|
- unitName: null
|
|
|
+ appParentOrg: null,
|
|
|
+ appOrg: null,
|
|
|
+ appName: null
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
@@ -158,10 +169,10 @@ export default {
|
|
|
delFlag: [
|
|
|
{ required: true, message: "删除标志不能为空", trigger: "blur" }
|
|
|
],
|
|
|
- unitCode: [
|
|
|
+ appOrg: [
|
|
|
{ required: true, message: "地区编码不能为空", trigger: "blur" }
|
|
|
],
|
|
|
- unitName: [
|
|
|
+ appName: [
|
|
|
{ required: true, message: "地区名称不能为空", trigger: "blur" }
|
|
|
]
|
|
|
}
|
|
@@ -170,8 +181,13 @@ export default {
|
|
|
created() {
|
|
|
this.getList();
|
|
|
this.getListEx();
|
|
|
+ this.getListTree();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleChange(value) {
|
|
|
+ console.log(value);
|
|
|
+ },
|
|
|
+
|
|
|
/** 查询地区编码列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -186,6 +202,11 @@ export default {
|
|
|
this.unitList = response.data.records;
|
|
|
});
|
|
|
},
|
|
|
+ getListTree(){
|
|
|
+ getListTree().then(res => {
|
|
|
+ this.treeList.push(res.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
@@ -196,9 +217,9 @@ export default {
|
|
|
this.form = {
|
|
|
id: null,
|
|
|
delFlag: null,
|
|
|
- unitCode: null,
|
|
|
- parentUnitCode: null,
|
|
|
- unitName: null
|
|
|
+ appOrg: null,
|
|
|
+ appParentOrg: null,
|
|
|
+ appName: null
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|