diff --git a/src/api/person.js b/src/api/person.js new file mode 100644 index 0000000..b27ca57 --- /dev/null +++ b/src/api/person.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getPersonData(params) { + return request({ + url: '/person/person-information2', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/src/views/job/show.vue b/src/views/job/show.vue index 63ad3a9..cba7ec4 100644 --- a/src/views/job/show.vue +++ b/src/views/job/show.vue @@ -209,6 +209,10 @@ export default { } ); + // admin + if (this.$store.state.user.is_admin) { + this.writePriority = true; + } // this.intervalId = setInterval(() => { // if (this.jm) { // // 绑定全局键盘输入事件 diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 7842aac..b0207e4 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -87,8 +87,8 @@ export default { }; return { loginForm: { - username: "admin", - password: "admin", + username: "422823198510203671", + password: "123456", }, loginRules: { username: [ diff --git a/src/views/person/components/PersonInformation.vue b/src/views/person/components/PersonInformation.vue index bf5cfdd..1209ed3 100644 --- a/src/views/person/components/PersonInformation.vue +++ b/src/views/person/components/PersonInformation.vue @@ -1,19 +1,196 @@ \ No newline at end of file diff --git a/src/views/person/components/PersonPicture.vue b/src/views/person/components/PersonPicture.vue index ff01e40..7e9bd3f 100644 --- a/src/views/person/components/PersonPicture.vue +++ b/src/views/person/components/PersonPicture.vue @@ -1,29 +1,28 @@ @@ -55,20 +105,42 @@ export default { .content-side { width: 200px; height: 1100px; - background: #ffcccc; + border: 1px #e4e7ed solid; float: right; } -.pp-half-block1 { - display: inline-block; +.pp-block1-left { + float: left; + margin-right: 1%; border: 1px #e4e7ed solid; - /* box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); */ - height: 200px; + height: 400px; + width: 49%; +} + +.pp-block1-right { + float: left; + border: 1px #e4e7ed solid; + height: 400px; width: 50%; } .pp-block2 { - margin-top: 10px; + margin-top: 0px; +} + +.pp-block2-left { + float: left; + margin-right: 1%; + /* border: 1px #e4e7ed solid; */ + height: 200px; + width: 49%; +} + +.pp-block2-right { + float: left; + /* border: 1px #e4e7ed solid; */ + height: 200px; + width: 50%; } .pp-half-block2 { @@ -86,7 +158,7 @@ export default { } .item-content-div { - /* width: 100%; */ + width: 100%; height: 80%; border: 1px #e4e7ed solid; } diff --git a/src/views/person/components/WorkInformation.vue b/src/views/person/components/WorkInformation.vue index 3868539..0fe90e4 100644 --- a/src/views/person/components/WorkInformation.vue +++ b/src/views/person/components/WorkInformation.vue @@ -1,14 +1,232 @@ \ No newline at end of file diff --git a/src/views/person/person.vue b/src/views/person/person.vue index df5dfaf..0344ade 100644 --- a/src/views/person/person.vue +++ b/src/views/person/person.vue @@ -10,19 +10,20 @@

- {{ personData.name }} + {{ personData["姓名"] }}

- {{ personData.sex }} - {{ personData.age }}岁 - {{ personData.education }} - {{ - personData.political_identity - }} + {{ personData["性别"] }} + {{ personAge }}岁 + {{ personEd }} + {{ personData["政治面貌"] }}

- 工号:{{ workData.person_id }} - 手机号:{{ personData.phone }} + {{ personData["部门名称"] }} + {{ personData["岗位名称"] }} + 手机号:{{ personData["联系电话"] }}

@@ -33,7 +34,7 @@ - + @@ -43,6 +44,8 @@ import ComWorkInformation from "./components/WorkInformation.vue"; import ComPersonInformation from "./components/PersonInformation.vue"; import ComChange from "./components/Change.vue"; +import * as personApi from "@/api/person"; + export default { name: "person", components: { @@ -55,33 +58,99 @@ export default { return { comName: "ComPersonPicture", personData: { - age: 49, - education: "大学", - id_card: "422827197309031821", - major: "人力资源管理", - name: "杨秀芬", - nation: "苗族", - phone: "13986854131", - political_identity: "中共党员", - sex: "女", - working_date: "1994-05-01", - working_years: 28.24, - }, - workData: { - person_id: "1242280311961615", - archives_unit: "恩施卷烟厂", - department: "厂办公室", - employer: "恩施卷烟厂", - employment_relationship: "在职", - job: "档案管理员", - team: "", - wage_relation_unit: "恩施卷烟厂", + 机构名称: "湖北中烟工业有限责任公司恩施卷烟厂", + 部门名称: "厂办公室", + 岗位名称: "档案管理员", + 现岗位起始时间: "2008-12-01", + 姓名: "杨秀芬", + 用工形式: "劳动关系", + 人员状态: "在职", + 个人职级: "正科级", + 岗位类别: "专业技术类", + 任职单位: "1", + 职务名称: "1", + 职务属性: "1", + 职务级别: "1", + 任现职务级别时间: "1", + 性别: "女", + 出生日期: "1973-09-03", + 证件类型: "身份证", + 证件号码: "422827197309031821", + 民族: "苗族", + 籍贯: "湖北来凤", + 出生地: "湖北来凤", + 参加工作时间: "1994-05-01", + 进入行业时间: "1998-06-01", + 到本单位时间: "1998-06-01", + 行业入职类别: "社会招聘", + 本单位入职类别: "社会招聘", + 联系电话: "13986854131", + 国籍: "中国", + 预计退休年龄: "55", + 是否本单位集中保管档案: "是", + 档案保管机构: "本级人事部门", + 政治面貌: "中共党员", + 入党时间: "2012-12-18", + 最高全日制学历: "初中", + 最高全日制学位: "无", + "全日制毕(肄)业学校(单位)名称": "1", + 全日制学校所在国家: "1", + "全日制毕(肄)业专业名称": "1", + 最高在职学历: "大学", + 最高在职学位: "无", + "在职毕(肄)业学校(单位)名称": "华中农业大学", + 在职学校所在国家: "中国", + "在职毕(肄)业专业名称": "人力资源管理", + 最高专业技术资格名称: "助理馆员", + 最高专业技术资格等级: "初级", + 最高职业技能等级名称: "1", + 最高职业技能等级级别: "1", + 备注说明: "1", }, }; }, + mounted() { + // 发送请求 + personApi.getPersonData({ + "id_card": this.$store.state.user.id_card + }).then( + (res)=> { + this.personData = res.data; + }, + (err) => { + console.log('err:', err); + } + ) + }, computed: { getPicUrl() { - return require("@/assets/images/" + this.personData.sex + ".png"); + return require("@/assets/images/" + this.personData["性别"] + ".png"); + }, + personAge() { + return this.getAge(this.personData["出生日期"]); + }, + personEd() { + let education = "-"; + if (this.personData["最高在职学历"]) { + education = this.personData["最高在职学历"]; + } else if (this.personData["最高全日制学历"]) { + education = this.personData["最高全日制学历"]; + } + return education; + }, + }, + methods: { + getAge(birthday) { + //出生时间 毫秒 + let birthDayTime = new Date(birthday).getTime(); + if (birthDayTime !== birthDayTime) { + // NaN + return "-"; + } + //当前时间 毫秒 + let nowTime = new Date().getTime(); + //一年毫秒数(365 * 86400000 = 31536000000) + return Math.ceil((nowTime - birthDayTime) / 31536000000); }, }, }; @@ -109,6 +178,4 @@ export default { .basic-msg-item { margin-right: 20px; } - - \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index b34a86a..ee11d71 100644 --- a/vue.config.js +++ b/vue.config.js @@ -38,8 +38,8 @@ module.exports = { }, proxy: { '/': { - target: 'http://127.0.0.1:4523/m1/1256020-0-default/', - // target: 'http://192.168.31.102:8000', + // target: 'http://127.0.0.1:4523/m1/1256020-0-default/', + target: 'http://192.168.31.102:8000', changeOrigin: true, pathRewrite: { }