diff --git a/pages/hrm/empjoin_form.vue b/pages/hrm/empjoin_form.vue
new file mode 100644
index 0000000..2390f59
--- /dev/null
+++ b/pages/hrm/empjoin_form.vue
@@ -0,0 +1,223 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/hrm/empneed_form.vue b/pages/hrm/empneed_form.vue
index d6fbfba..39165de 100644
--- a/pages/hrm/empneed_form.vue
+++ b/pages/hrm/empneed_form.vue
@@ -16,53 +16,57 @@
{{form.post_name}}
-
- {{form.start_km}}
+
+ {{form.count_need}}
-
- {{form.start_km}}
+
+ {{form.salary}}
-
+
+ {{ getLabel(genderList, form.gender) }}
- {{form.vehreg_name}}
+ {{getLabel(educationList,form.education) }}
-
- {{form.end_date}}
+
+ {{form.arrival_date}}
-
- {{form.vehreg_name}}
+
+ {{getLabel(reasonList,form.reason)}}
-
-
+
+
{{form.duty}}
-
+
{{form.professional_requirement}}
@@ -79,38 +83,37 @@ import {actStateEnum} from "@/utils/enum.js"
mode:"show",
t_id: null,
form:{
- reason:"",
- employee:"",
- end_date:"",
- },
- ticket_data:{
- handle_date:""
+ count_need: 0, // 👈 默认 0
+ salary: 0,
},
+ ticket_data:{},
userInfo:{},
type:0,
- hobby: [
+ genderList: [
{text: '男',value: 1},
{text: '女',value: 2},
{text: '不限',value: 0},
],
+ educationList: [
+ { value: 0, text: '不限' },
+ { value: 1, text: '高中/中专' },
+ { value: 2, text: '大专' },
+ { value: 3, text: '本科' },
+ { value: 4, text: '硕士及以上' }
+ ],
reasonList:[
- {text: '省级平台',value: '省级平台'},
- {text: '市级平台',value: '市级平台'},
+ { value: 0, text: '新增人员' },
+ { value: 1, text: '高中该岗原人员离职或辞职或辞退需补充' },
+ { value: 2, text: '其他原因' },
],
header:"",
customRules: {
- filename: {
+ count_need: {
rules: [{
required: true,
- errorMessage: '姓名不能为空'
+ errorMessage: '不能为空'
}]
- },
- age: {
- rules: [{
- required: true,
- errorMessage: '年龄不能为空'
- }]
- },
+ }
},
}
},
@@ -119,7 +122,9 @@ import {actStateEnum} from "@/utils/enum.js"
that.mode = options.mode?options.mode:'show';
that.t_id = options.t_id?options.t_id:null;
if(that.t_id) {
- that.form = await that.$api.resignationItem(that.t_id);
+ const res = await that.$api.empneedItem(that.t_id);
+ this.form = res
+ await this.fillNames()
if(that.form.ticket_.state_.type == 1 && that.form.create_by == uni.getStorageSync("userInfo").id ) {
that.mode = "edit";
}else{
@@ -131,24 +136,45 @@ import {actStateEnum} from "@/utils/enum.js"
}
},
methods:{
+ async fillNames(){
+ const employee = await this.$api.employeeInfo()
+ this.form.employee_name = employee.name
+ this.form.belong_dept_name = employee.belong_dept_name
+ this.form.post_name = employee.post_name
+ },
async getEmployee(){
let res = await this.$api.employeeInfo();
this.form.employee_name = res.name;
+ this.form.dept_need = res.belong_dept;
+ this.form.post_need = res.post;
this.form.belong_dept_name = res.belong_dept_name;
this.form.post_name = res.post_name;
this.form.employee = res.id;
this.mode = "add";
},
- async submit_b_func(id){
+ async handleDel(){
let that = this;
- if (that.mode != 'show') {
- if(that.form.id) {
- await that.$api.resignationUpdate(that.form.id, that.form);
- }else{
- let res = await that.$api.resignationCreate(that.form);
- that.form.id = res.id;
- }
- }
+ await that.$api.empneedDelete(that.form.id)
+ uni.navigateBack()
+ },
+ async handleSave(){
+ let that = this;
+ that.$refs.customForm.validate().then(res => {
+
+ }).catch(err => {
+ console.log('err', err);
+ })
+ await that.$api.empneedCreate(that.form)
+ uni.navigateBack()
+ },
+ getLabel(list, value) {
+ if (!list || value === undefined || value === null) return ''
+ const item = list.find(i => String(i.value) === String(value))
+ return item ? item.text : ''
+ },
+ educationChange(val) {
+ const item = this.educationList.find(i => i.value === val)
+ this.form.education_name = item ? item.text : ''
},
}
}
diff --git a/pages/hrm/leave_form.vue b/pages/hrm/leave_form.vue
new file mode 100644
index 0000000..00e4feb
--- /dev/null
+++ b/pages/hrm/leave_form.vue
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
+ {{form.belong_dept_name}}
+
+
+ {{form.employee_name}}
+
+
+
+ {{form.post_name}}
+
+
+
+ {{form.hour}}小时
+
+
+
+ {{form.start_date}}
+
+
+
+ {{form.end_date}}
+
+
+
+ {{getLabel(leaveList,form.leave_type) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/utils/api.js b/utils/api.js
index fa630bc..006890f 100644
--- a/utils/api.js
+++ b/utils/api.js
@@ -83,6 +83,24 @@ export default {
resignationCreate:(data) => http(`/hrm/resignation/`, 'POST' , data),
resignationItem:(id,data) => http(`/hrm/resignation/${id}/`, 'GET', data),
resignationDelete:(id) => http(`/hrm/resignation/${id}/`, 'DELETE'),
+ //人员需求申请
+ empneedList:(data) => http(`/hrm/empneed/`, 'GET' , data),
+ empneedCreate:(data) => http(`/hrm/empneed/`, 'POST' , data),
+ empneedItem:(id,data) => http(`/hrm/empneed/${id}/`, 'GET', data),
+ empneedDelete:(id) => http(`/hrm/empneed/${id}/`, 'DELETE'),
+ empneedUpdate:(id,data) => http(`/hrm/empneed/${id}/`, 'PUT', data),
+ //人员请假申请
+ leaveList:(data) => http(`/hrm/leave/`, 'GET' , data),
+ leaveCreate:(data) => http(`/hrm/leave/`, 'POST' , data),
+ leaveItem:(id,data) => http(`/hrm/leave/${id}/`, 'GET', data),
+ leaveDelete:(id) => http(`/hrm/leave/${id}/`, 'DELETE'),
+ leaveUpdate:(id,data) => http(`/hrm/leave/${id}/`, 'PUT', data),
+ //人员交接申请
+ empjoinList:(data) => http(`/hrm/empjoin/`, 'GET' , data),
+ empjoinCreate:(data) => http(`/hrm/empjoin/`, 'POST' , data),
+ empjoinItem:(id,data) => http(`/hrm/empjoin/${id}/`, 'GET', data),
+ empjoinDelete:(id) => http(`/hrm/empjoin/${id}/`, 'DELETE'),
+ empjoinUpdate:(id,data) => http(`/hrm/empjoin/${id}/`, 'PUT', data),
//供应商审核
supplierauditCreate:(data) => http(`/pum/supplieraudit/`, 'POST' , data),
supplierauditItem:(id,data) => http(`/pum/supplieraudit/${id}/`, 'GET', data),
@@ -91,4 +109,9 @@ export default {
repairCreate:(data) => http(`/em/repair/`, 'POST' , data),
repairItem:(id,data) => http(`/em/repair/${id}/`, 'GET', data),
repairDelete:(id) => http(`/em/repair/${id}/`, 'DELETE'),
+ //部门列表
+ deptList:(data) => http(`/system/dept/`, 'GET' , data),
+ //岗位列表
+ postList:(data) => http(`/system/post/`, 'GET' , data),
+
}
\ No newline at end of file
diff --git a/utils/verificate.js b/utils/verificate.js
new file mode 100644
index 0000000..71f523b
--- /dev/null
+++ b/utils/verificate.js
@@ -0,0 +1,46 @@
+
+//验证手机号
+export function verifyPhone(rule, value, callback) {
+ let reg = /^[1][3, 4, 5, 6, 7, 8, 9][0-9]{9}$/
+ if(!reg.test(value)){
+ return callback(new Error('请输入正确的手机号码'))
+ }
+ callback()
+}
+
+//车牌号码
+export function verifyCars(rule, value, callback) {
+ let reg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/
+ if(!reg.test(value)){
+ return callback(new Error('请输入正确的车牌号码'))
+ }
+ callback()
+}
+export function genTree(data) {
+ const result = []
+ if (!Array.isArray(data)) {
+ return result
+ }
+ data.forEach(item => {
+ delete item.children
+ })
+ const map = {}
+ data.forEach(item => {
+ item.label = item.name
+ item.parentId = item.parent
+ if(item.fullname){
+ item.label = item.fullname
+ }
+ item.value = item.id
+ map[item.id] = item
+ })
+ data.forEach(item => {
+ const parent = map[item.parent]
+ if (parent) {
+ (parent.children || (parent.children = [])).push(item)
+ } else {
+ result.push(item)
+ }
+ })
+ return result
+ }