Commit 8421802e by e

111

parent e94d4945
Showing with 34 additions and 55 deletions
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
readonly readonly
clickable clickable
v-model="obj.infoRegisteredResidence" v-model="obj.infoRegisteredResidence"
label="户口性质" label="户口性质"
placeholder="请选择" placeholder="请选择"
@click="showCategory = true" @click="showCategory = true"
...@@ -52,7 +51,6 @@ ...@@ -52,7 +51,6 @@
readonly readonly
clickable clickable
v-model="obj.unitPreSocialStatus" v-model="obj.unitPreSocialStatus"
label="前期社保状态" label="前期社保状态"
placeholder="请选择" placeholder="请选择"
@click="showSocialStatus = true" @click="showSocialStatus = true"
...@@ -62,7 +60,6 @@ ...@@ -62,7 +60,6 @@
readonly readonly
clickable clickable
v-model="obj.unitPrePaymentType" v-model="obj.unitPrePaymentType"
label="前期缴费种类" label="前期缴费种类"
placeholder="请选择" placeholder="请选择"
@click="showPaymentType = true" @click="showPaymentType = true"
...@@ -72,7 +69,6 @@ ...@@ -72,7 +69,6 @@
readonly readonly
clickable clickable
v-model="obj.unitPreSocialCity" v-model="obj.unitPreSocialCity"
label="原社保缴纳省市" label="原社保缴纳省市"
placeholder="请选择" placeholder="请选择"
@click="showSocialCity = true" @click="showSocialCity = true"
...@@ -84,7 +80,6 @@ ...@@ -84,7 +80,6 @@
readonly readonly
clickable clickable
v-model="obj.unitRelationUnit" v-model="obj.unitRelationUnit"
label="与原单位关系" label="与原单位关系"
placeholder="请选择" placeholder="请选择"
@click="showRelationUnit = true" @click="showRelationUnit = true"
...@@ -94,7 +89,6 @@ ...@@ -94,7 +89,6 @@
readonly readonly
clickable clickable
v-model="obj.unitPreEmploymentStatus" v-model="obj.unitPreEmploymentStatus"
label="前期就业状态" label="前期就业状态"
placeholder="请选择" placeholder="请选择"
@click="showEmploymentStatus = true" @click="showEmploymentStatus = true"
...@@ -187,7 +181,8 @@ import { Component } from "vue-property-decorator"; ...@@ -187,7 +181,8 @@ import { Component } from "vue-property-decorator";
export default class socialInfo extends Vue { export default class socialInfo extends Vue {
private obj: any = {}; private obj: any = {};
private city: any = {}; private city: any = {};
private main_city: any = []; private parents: any = [];
private childrens: any = [];
private show: boolean = false; private show: boolean = false;
private showCategory: boolean = false; private showCategory: boolean = false;
private showSocialStatus: boolean = false; private showSocialStatus: boolean = false;
...@@ -257,61 +252,45 @@ export default class socialInfo extends Vue { ...@@ -257,61 +252,45 @@ export default class socialInfo extends Vue {
private getCityList(): void { private getCityList(): void {
this.$server.EmployeeService.getCityList({}) this.$server.EmployeeService.getCityList({})
.then(res => { .then(res => {
console.log("citylist", JSON.stringify(res)); console.log("citylist", res);
this.city = res; this.city = res;
for (let i = 0; i < this.city.length; i++) { for (let i = 0; i < this.city.length; i++) {
if (this.city[i].parentId == 0) { if (this.city[i].parentId == 0) {
this.main_city.push(this.city[i].name); this.parents.push(this.city[i]);
} }
if (this.city[i].parentId != 0) {
this.childrens.push(this.city[i]);
} }
console.log(this.main_city); }
// let attr = { //没有父节点的数据
// id: "id", console.log(this.parents);
// parentId: "parentId", //有父节点的数据
// name: "name", console.log(this.childrens);
// rootId: 1
// };
// function toTreeData(data, attr) {
// let tree = []; //遍历父节点数据
// let resData = data; // this.parents.forEach((parent: any) => {
// for (let i = 0; i < resData.length; i++) { // //遍历子节点数据
// if (resData[i].parentId === attr.rootId) { // this.childrens.forEach((current: any, index: any) => {
// let obj = { // //此时找到父节点对应的一个子节点
// id: resData[i][attr.id], // if (current.parentId === parent.id) {
// name: resData[i][attr.name], // //对子节点数据进行深复制,这里只支持部分类型的数据深复制,对深复制不了解的童靴可以先去了解下深复制
// children: [] // let temp = JSON.parse(JSON.stringify(children));
// }; // //让当前子节点从temp中移除,temp作为新的子节点数据,这里是为了让递归时,子节点的遍历次数更少,如果父子关系的层级越多,越有利
// tree.push(obj); // temp.splice(index, 1);
// resData.splice(i, 1); // //让当前子节点作为唯一的父节点,去递归查找其对应的子节点
// i--; // translator([current], temp);
// } // //把找到子节点放入父节点的children属性中
// } // typeof parent.children !== "0"
// var run = function(treeArrs) { // ? parent.children.push(current)
// if (resData.length > 0) { // : (parent.children = [current]);
// for (let i = 0; i < treeArrs.length; i++) {
// for (let j = 0; j < resData.length; j++) {
// if (treeArrs[i].id === resData[j][attr.parentId]) {
// let obj = {
// id: resData[j][attr.id],
// name: resData[j][attr.name],
// children: []
// };
// treeArrs[i].children.push(obj);
// resData.splice(j, 1);
// j--;
// }
// }
// run(treeArrs[i].children);
// }
// }
// };
// run(tree);
// return tree;
// } // }
// let arr = toTreeData(allDatas, attr); // });
// console.log(arr); // });
}) })
.catch(error => { .catch(error => {
console.log(error); console.log(error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment