From 902d71e9c1a6444521908cd667d5376eec7f3a4e Mon Sep 17 00:00:00 2001
From: wyw <571921741@qq.com>
Date: Mon, 1 Dec 2025 21:01:04 +0800
Subject: [PATCH] =?UTF-8?q?=E5=91=98=E5=B7=A5=E6=B3=A8=E5=86=8C=20?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=83=A8=E9=97=A8=E5=B2=97=E4=BD=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/index/index.vue | 200 ++++++++++++++++++++++++++++++++++++------
1 file changed, 173 insertions(+), 27 deletions(-)
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 8e1badf..f2d1334 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -10,46 +10,79 @@
基本信息填写
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
-
-
-
+
- 重置
- 提交
- 提交
+ 重置
+ 提交
+ 提交
-
+
-
-
+
+
+
-
-
@@ -61,8 +94,14 @@
import {
isChinaMobilePhone,
easyCheckID,
- getNowFormatDate
+ getNowFormatDate,
+ initFilter,
+ extendRule
} from '../../utils/common.js'
+ import {
+ UserPostOrderPaged,
+ DepartmentOrderPaged
+ } from '../../services/common.js'
export default {
data() {
return {
@@ -72,7 +111,7 @@
pickerShow: false,
loading: false,
pickerColumns: [Array(60).fill(null).map((_, i) => i)],
- OrgId:'',
+ OrgId: '',
model1: {
userInfo: {
Name: '',
@@ -81,6 +120,10 @@
ID_CARD: '',
InTime: getNowFormatDate(),
WORKINGYEAR: '',
+ DEPARTMENT_NAME: '',
+ DEPARTMENT_ID: '',
+ POST_NAME: '',
+ POST_ID: ''
},
},
dateTimePickerInfo: {
@@ -95,6 +138,17 @@
name: '女',
},
],
+ selectorInfo: {
+ showPopup: false,
+ totalCount: 0,
+ title: '入职组织',
+ index: 0,
+ dataLists: [],
+ defaultText: '',
+ defaultValue: '',
+ name: '',
+ defaultChecked: []
+ },
rules: {
'userInfo.Name': {
type: 'string',
@@ -121,6 +175,12 @@
message: '请填写身份证号',
trigger: ['blur', 'change']
},
+ 'userInfo.DEPARTMENT_NAME': {
+ type: 'string',
+ required: true,
+ message: '请选择入职组织',
+ trigger: ['blur', 'change']
+ },
'userInfo.InTime': {
type: 'string',
required: true,
@@ -132,14 +192,14 @@
switchVal: false
}
},
-
+
onLoad(option) {
if (option.OrgId && option.OrgId.length > 0) {
this.OrgId = option.OrgId
- uni.setStorageSync('OrgId', this.OrgId)
+ uni.setStorageSync('OrgId', this.OrgId)
}
-
-
+
+
// this.model.ID = option.ID
// this.model.TaskID = option.taskID
// this.TaskID = option.taskID
@@ -156,7 +216,7 @@
// // this.model.Nav_ListSafeCheckDetail = null
// }
},
-
+
onReady() {
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
this.$refs.uForm.setRules(this.rules)
@@ -233,10 +293,12 @@
ID_CARD: this.model1.userInfo.ID_CARD,
InTime: this.model1.userInfo.InTime,
WORKINGYEAR: this.model1.userInfo.WORKINGYEAR,
- ORG_ID:this.OrgId
+ POST_ID: this.model1.userInfo.POST_ID,
+ DEPARTMENT_ID: this.model1.userInfo.DEPARTMENT_ID,
+ ORG_ID: this.OrgId
}
RegisterUser(json).then((res) => {
- this.loading = false
+ this.loading = false
if (res.code == 200) {
uni.showToast({
title: '注册成功!',
@@ -248,7 +310,7 @@
// uni.redirectTo({
// url: '/pages/webview/webview?url=' + this.appurl
// })
- },1500)
+ }, 1500)
// uni.navigateTo({
// url: '/pages/apply/complete?type=success'
@@ -271,6 +333,90 @@
})
},
+
+
+
+ //显示组件
+ handleChange() {
+ this.selectorInfo.showPopup = true
+ this.selectorInfo.title = '班组名称'
+ this.handleSearch()
+ },
+
+ //数据加载
+ handleSearch(val, pageIndex) {
+ var p = {
+ name: this.selectorInfo.name,
+ title: this.selectorInfo.title,
+ val: val,
+ pageIndex: pageIndex
+ }
+ this.handleShowSheet(p)
+ },
+ async handleShowSheet(p) {
+ this.pageIndex = 0
+ var defaultChecked = []
+ const json = initFilter(this.OrgId, null, "NAME", 0, (p.pageIndex ?? 1));
+ json.IgnoreDataRule = true
+ json.Limit = 20
+ if (p.val) {
+ extendRule(json, "NAME", 9, p.val)
+ }
+
+ let dataSelect = []
+ if (p.name == 'DEPARTMENT_NAME') {
+ dataSelect = await DepartmentOrderPaged(json).then(res => {
+ this.selectorInfo.totalCount = res.TotalCount
+ if (res != undefined && res.Data.length > 0) {
+ for (let i = 0; i < res.Data.length; i++) {
+ res.Data[i].name = res.Data[i].NAME
+ res.Data[i].code = res.Data[i].CODE
+ }
+ }
+ return res.Data
+ })
+ } else if (p.name == 'POST_NAME') {
+ dataSelect = await UserPostOrderPaged(json).then(res => {
+ this.selectorInfo.totalCount = res.TotalCount
+ if (res != undefined && res.Data.length > 0) {
+ for (let i = 0; i < res.Data.length; i++) {
+ res.Data[i].name = res.Data[i].NAME
+ res.Data[i].code = res.Data[i].CODE
+ }
+ }
+ return res.Data
+ })
+ }
+
+ if (defaultChecked == null)
+ defaultChecked = []
+ if (dataSelect.length) {
+ this.selectorInfo = {
+ totalCount: this.selectorInfo.totalCount,
+ showPopup: true,
+ title: p.title,
+ name: p.name,
+ dataLists: dataSelect,
+ defaultChecked: defaultChecked
+ }
+ } else {
+ // 暂无数据
+ }
+ },
+ handleSelected(e) {
+ this.selectorInfo.showPopup = false
+ if(this.selectorInfo.name=='POST_NAME'){
+ // this.userInfo.POST_NAME = e.NAME
+ // this.userInfo.POST_ID = e.ID
+ this.model1.userInfo.POST_NAME = e.NAME
+ this.model1.userInfo.POST_ID = e.ID
+ }else if(this.selectorInfo.name=='DEPARTMENT_NAME'){
+ // this.userInfo.DEPARTMENT_NAME = e.NAME
+ // this.userInfo.DEPARTMENT_ID = e.ID
+ this.model1.userInfo.DEPARTMENT_NAME = e.NAME
+ this.model1.userInfo.DEPARTMENT_ID = e.ID
+ }
+ }
}
}