This commit is contained in:
yunkexin 2025-11-13 15:28:41 +08:00
parent a2b18a3659
commit 4f01f3b9ef
2 changed files with 295 additions and 431 deletions

View File

@ -3,18 +3,7 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "进入",
"type": "none",
"color": "#304ffe",
"background": "#000000",
"fontSize": "14px"
}]
}
}
"navigationBarTitleText": "首页"
}
},
{

View File

@ -1,430 +1,282 @@
<template>
<view class="content">
<u-form>
<view>
<u-form-item label="公司名称" @click="handleChange()" label-width='150px' style="margin: 0 20px 0 30px;" prop="OrgId" borderBottom>
<u--input disabledColor="#fff" v-model="NAME" placeholder="请选择公司名称" border="none" inputAlign="right"></u--input>
<u-icon v-if="!OrgId||OrgId.length<1" style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon>
</u-form-item>
<view class="container">
<view class="form-sub">
<u-form :model="model1" ref="uForm" label-width="90px" class="demo-ruleForm" size="mini">
<view style="position: relative;">
<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
</view>
<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">基本信息填写</view>
<u-form-item label="姓名" prop="userInfo.Name" borderBottom ref="item1">
<u--input v-model="model1.userInfo.Name" border="none" customStyle="margin:0px;display:flex;padding:3px 9px"></u--input>
</u-form-item>
<u-form-item label="性别" prop="userInfo.Sex" borderBottom @click="showSex = true;" ref="item1">
<u--input v-model="model1.userInfo.Sex" disabled disabledColor="#ffffff" placeholder="请选择性别" border="none" suffixIcon="arrow-right" fontSize="14px"
customStyle="margin:0px;display:flex;padding:3px 9px" suffixIconStyle="font-size:12px"></u--input>
<!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
</u-form-item>
<u-form-item label="手机号码" prop="userInfo.Phone" borderBottom ref="item1">
<u--input v-model="model1.userInfo.Phone" border="none" customStyle="margin:0px;display:flex;padding:3px 9px"></u--input>
</u-form-item>
<u-form-item label="身份证号码" prop="userInfo.ID_CARD" borderBottom ref="item1">
<u--input v-model="model1.userInfo.ID_CARD" border="none" customStyle="margin:0px;display:flex;padding:3px 9px"></u--input>
</u-form-item>
<u-form-item label="入职时间" prop="userInfo.InTime" borderBottom ref="item1" @click="showCheckDate()">
<u--input disabledColor="#fff" v-model="model1.userInfo.InTime" disabled placeholder="请选择入职时间" suffixIcon="arrow-right" suffixIconStyle="font-size:12px" fontSize="14px"
customStyle="margin:0px;display:flex;padding:3px 9px" border="none">
</u--input>
<!-- <u--input v-model="model1.userInfo.InTime" border="none"></u--input> -->
</u-form-item>
<u-form-item label="工龄" prop="userInfo.WORKINGYEAR" borderBottom ref="item1" @click="pickerShow = true">
<u--input disabledColor="#fff" disabled v-model="model1.userInfo.WORKINGYEAR" border="none" suffixIcon="arrow-right" suffixIconStyle="font-size:12px" fontSize="14px"
customStyle="margin:0px;display:flex;padding:3px 9px"></u--input>
</u-form-item>
</u-form>
<view style="display: flex;flex-direction: row;" class="bottom-button">
<u-button type="primary" @click="reset" color="#3d4b70" :plain="true" style="margin-right: 5px;">重置</u-button>
<u-button type="primary" @click="submit" color="#3d4b70" style="margin-left: 5px;" v-if="loading == false">提交</u-button>
<u-button type="primary" loading loadingText="加载中" color="#3d4b70" style="margin-left: 5px;" v-if="loading == true">提交</u-button>
</view>
<u-action-sheet :show="showSex" :actions="actions" title="请选择性别" @close="showSex = false" @select="sexSelect">
</u-action-sheet>
<u-datetime-picker :show="dateTimePickerInfo.showCheckDate" mode="date" v-model='dateTimePickerInfo.defaultDateTime' :formatter="formatter" @confirm="handleCheckDate"
@close="dateTimePickerInfo.showCheckDate = false;" @cancel="dateTimePickerInfo.showCheckDate = false;"></u-datetime-picker>
<u-picker :show="pickerShow" :columns="pickerColumns" @confirm="pickerConfirm" @cancel="pickerCancel"></u-picker>
</view>
<view class="list">
<u-grid :border="false" :col="2">
<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex" bgColor="#fff">
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.iconName" :size="42" @click="menuClick(baseListItem)" color="#304ffe"></u-icon>
<text class="grid-text">{{baseListItem.name}}</text>
</u-grid-item>
</u-grid>
</view>
</u-form>
<query-selector :show="selectorInfo.showPopup" :defaultChecked="selectorInfo.defaultChecked" :title="selectorInfo.title" :lists="selectorInfo.dataLists" @search="handleSearch" @select="handleSelected"
@close="selectorInfo.showPopup=false" />
</view>
</view>
</template>
<script>
import {
getMenu
} from '../../services/apply'
import config from '../../config/common'
import request from '../../utils/request.js'
RegisterUser
} from '../../services/apply.js'
import config from '../../config/common.js'
import {
isChinaMobilePhone,
easyCheckID,
getNowFormatDate
} from '../../utils/common.js'
export default {
data() {
//
// http://localhost:8080/?OrgId=b043b28b-bbc3-c452-6052-4fba1457abfa&createType=10&AREA_ID=b3f5af14-401d-45a5-beb8-5e9c845aae8f#/
//
// http://localhost:8080/?OrgId=b043b28b-bbc3-c452-6052-4fba1457abfa&createType=20&DEPARTMENT_ID=fa6fb6e3-dd43-fad3-6b8c-75ceeba3ca75&POST_ID=f3fb87a5-027c-0611-84a5-153a5e5a402a#/
return {
DEPARTMENT_ID: '', //'B18F95F4-572A-E521-1412-FA8CE50DC98A',
RISK_AREA_ID: '', //8EB0A653-E785-46D9-B65E-17F49E77121E',
POST_ID: '',
OrgId: '',
NAME: '',
createType: '',
uni_app_web_local_api_url: config.uni_app_web_local_api_url,
baseList: [],
company: '',
dataLists: [{
name: '且末县邦泰矿业',
id: '00500000-0000-0000-0000-000000000000',
tenantId: '005'
}, {
name: '新疆路源矿业',
id: '01000000-0000-0000-0000-000000000000',
tenantId: '010'
}, {
name: '新疆金能昆仑矿业',
id: '01500000-0000-0000-0000-000000000000',
tenantId: '015'
}, {
name: '新疆西拓矿业',
id: '02000000-0000-0000-0000-000000000000',
tenantId: '020'
}],
selectorInfo: {
showPopup: false,
title: '检查人员',
itemData: {},
index: 0,
dataLists: [],
defaultText: '',
defaultValue: '',
name: '',
defaultChecked: []
showSex: false,
appurl: config.uni_app_url,
formatter: null,
pickerShow: false,
loading: false,
pickerColumns: [Array(60).fill(null).map((_, i) => i)],
OrgId:'',
model1: {
userInfo: {
Name: '',
Sex: '',
Phone: '',
ID_CARD: '',
InTime: getNowFormatDate(),
WORKINGYEAR: '',
},
},
dateTimePickerInfo: {
showCheckDate: false,
defaultDateTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
value: '',
},
actions: [{
name: '男',
},
{
name: '女',
},
],
rules: {
'userInfo.Name': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
'userInfo.Sex': {
type: 'string',
max: 1,
required: true,
message: '请选择男或女',
trigger: ['blur', 'change']
},
'userInfo.Phone': {
type: 'string',
required: true,
message: '请填写手机号',
trigger: ['blur', 'change']
},
'userInfo.ID_CARD': {
type: 'string',
required: true,
message: '请填写身份证号',
trigger: ['blur', 'change']
},
'userInfo.InTime': {
type: 'string',
required: true,
message: '请选择入职时间',
trigger: ['blur', 'change']
},
},
radio: '',
switchVal: false
}
},
// onShow() {
// const pages = getCurrentPages()
// const currentPage = pages[pages.length - 1]
// const Options = currentPage.options
// uni.setStorageSync('Company', Options.Company ? Options.Company : 'XLK')
// },
onLoad(option) {
if (option.OrgId && option.OrgId.length > 0) {
this.OrgId = option.OrgId
this.createType = option.createType
this.RISK_AREA_ID = option.AREA_ID
this.DEPARTMENT_ID = option.DEPARTMENT_ID
this.POST_ID = option.POST_ID
} else {
var paraString = location.search; //.substring(1, location.search.length - 1);
if (paraString && paraString.length > 1) {
if (paraString.indexOf('&') > -1) {
var paras = paraString.split("&");
paras.forEach(e => {
if (e.indexOf("OrgId") > -1) {
this.OrgId = e.split('=')[1]
} else if (e.indexOf("createType") > -1) {
this.createType = e.split('=')[1]
} else if (e.indexOf("AREA_ID") > -1) {
this.RISK_AREA_ID = e.split('=')[1]
} else if (e.indexOf("DEPARTMENT_ID") > -1) {
this.DEPARTMENT_ID = e.split('=')[1]
} else if (e.indexOf("POST_ID") > -1) {
this.POST_ID = e.split('=')[1]
}
})
} else if (paraString.indexOf('OrgId') > -1) {
this.OrgId = paraString.split('=')[1]
}
}
}
// createType ''10 ''20
if (this.OrgId && this.OrgId.length > 1) {
this.dataLists.forEach(e => {
if (this.OrgId.toUpperCase() == e.id) {
this.NAME = e.name
//
uni.setStorageSync('tenantId', e.tenantId)
}
})
this.getCaidan()
uni.setStorageSync('OrgId', this.OrgId)
}
// this.model.ID = option.ID
// this.model.TaskID = option.taskID
// this.TaskID = option.taskID
// this.tableKey = option.tableKey
// this.ORG_ID = uni.getStorageSync('orgId')
// if (option.ID != null && option.ID != 'null') {
// this.loadData()
// } else {
// this.isLoadOK = true
// this.model.ID = guid()
// this.model.ORG_ID = this.ORG_ID
// this.isDIY = true
// this.listPropValUpload.push(this.model.ID)
// // this.model.Nav_ListSafeCheckDetail = null
// }
},
//APP
onNavigationBarButtonTap(e) {
let urlTo = this.uni_app_web_local_api_url + ':9100/'
//let urlTo ='http://localhost:8000/' //8000
uni.navigateTo({
url: '/pages/webview/webview?url=' + urlTo
})
onReady() {
//setRules
this.$refs.uForm.setRules(this.rules)
},
methods: {
// FM/DataSync/Sync
menuClick(menuInfo) {
var urlTo = menuInfo.url + '?OrgId=' + menuInfo.ORG_ID
if (this.RISK_AREA_ID && this.RISK_AREA_ID != undefined && this.RISK_AREA_ID.length > 1)
urlTo += '&RISK_AREA_ID=' + this.RISK_AREA_ID
if (this.DEPARTMENT_ID && this.DEPARTMENT_ID != undefined && this.DEPARTMENT_ID.length > 1)
urlTo += '&DEPARTMENT_ID=' + this.DEPARTMENT_ID
if (this.POST_ID && this.POST_ID != undefined && this.POST_ID.length > 1)
urlTo += '&POST_ID=' + this.POST_ID
uni.navigateTo({
url: urlTo
})
sexSelect(e) {
this.model1.userInfo.Sex = e.name
this.$refs.uForm.validateField('userInfo.Sex')
},
getCaidan() {
const json = {
OrgId: this.OrgId
showCheckDate() {
if (this.model1.userInfo.InTime == null) {
this.model1.userInfo.InTime = uni.$u.timeFormat(new Date(),
'yyyy-mm-dd')
}
getMenu(json).then((res) => {
//TYPE 20
//OrgID TYPE 20
this.dateTimePickerInfo = {
showCheckDate: true,
defaultDateTime: this.model1.userInfo.InTime,
}
},
handleCheckDate(e) {
// let v = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
this.model1.userInfo.InTime = uni.$u.timeFormat(e.value,
'yyyy-mm-dd')
this.dateTimePickerInfo.showCheckDate = false
},
pickerConfirm(e) {
this.model1.userInfo.WORKINGYEAR = e.value.toString()
this.pickerShow = false
},
pickerCancel(e) {
this.pickerShow = false
},
reset() {
this.model1.userInfo = {
Name: '',
Sex: '',
Phone: '',
ID_CARD: '',
InTime: '',
WORKINGYEAR: '',
}
},
submit() {
if (this.model1.userInfo.Name == '' ||
this.model1.userInfo.Sex == '' ||
this.model1.userInfo.Phone == '' ||
this.model1.userInfo.ID_CARD == '' ||
this.model1.userInfo.InTime == '') {
uni.showToast({
icon: 'error',
title: '信息不能为空'
})
return
}
if (isChinaMobilePhone(this.model1.userInfo.Phone) == false) {
uni.showToast({
icon: 'error',
title: '手机号码格式不正确'
})
return
}
if (easyCheckID(this.model1.userInfo.ID_CARD) == false) {
uni.showToast({
icon: 'error',
title: '身份证号码格式不正确'
})
return
}
this.loading = true
const json = {
Name: this.model1.userInfo.Name,
Sex: this.model1.userInfo.Sex == '男' ? '1' : '0',
Phone: this.model1.userInfo.Phone,
ID_CARD: this.model1.userInfo.ID_CARD,
InTime: this.model1.userInfo.InTime,
WORKINGYEAR: this.model1.userInfo.WORKINGYEAR,
}
RegisterUser(json).then((res) => {
this.loading = false
if (res.code == 200) {
uni.showToast({
title: '注册成功!',
icon: 'none'
})
setTimeout(() => {
uni.hideToast();
location.href = this.appurl
// uni.redirectTo({
// url: '/pages/webview/webview?url=' + this.appurl
// })
},1500)
// this.baseList = res.data
if (this.createType == '') {
this.baseList = res.data
// uni.navigateTo({
// url: '/pages/apply/complete?type=success'
// })
} else {
//createType 10 20
if (this.createType == 10 || this.createType == 20) {
this.baseList = res.data.filter(e => e.TYPE == this.createType)
if (this.baseList && this.baseList.length == 1) {
this.menuClick(this.baseList[0]) //
}
} else {
this.baseList = res.data
}
uni.showToast({
title: res.msg,
icon: 'none'
})
// uni.navigateTo({
// url: `/pages/apply/complete?type=failed&title=${res.msg}`
// })
}
}).catch((err) => {
uni.showToast({
title: '请求错误',
icon: 'none'
this.loading = false
uni.navigateTo({
url: `/pages/apply/complete?type=failed&title=${err.msg}`
})
})
},
//
handleChange() {
if (!this.OrgId || this.OrgId.length < 2) {
this.selectorInfo.showPopup = true
this.selectorInfo.title = '公司选择'
this.handleSearch()
}
},
//
handleSearch(val) {
// this.createType =10
// this.createType =20
this.selectorInfo.dataLists = this.dataLists
// const orgId = uni.getStorageSync('orgId')
// const json = initFilter(orgId, "", "", 0)
// if (val) {
// extendRule(json, 'NAME', 9, val);
// }
// OrderPagedUseful2(json).then(res => {
// this.selectorInfo.dataLists = res.Data.map(i => {
// return {
// ...i,
// name: i.NAME,
// code: i.CODE
// }
// })
// })
},
handleSelected(e) {
this.selectorInfo.showPopup = false
this.OrgId = e.id
this.NAME = e.name
//
uni.setStorageSync('tenantId', e.tenantId)
if (this.OrgId && this.OrgId.length > 1)
this.getCaidan()
// this.Sync()
},
Sync() {
var params = {}
var listPost = []
var listDepartment = []
var listUser = []
// listUser.push({
// CODE: 'XLK100194',
// DEPARTMENT_CODE: 'XLKXK0201',
// POST_CODE: 'QQJSY13',
// NAME: '',
// PHONE: '18950958648',
// SEX: '1',
// ID_CARD: '350822200005149876',
// NATIONALITY: '',
// BIRTHDAY: '2000-05-14',
// POLITICALSTATUE: '',
// JOBTITLE: '',
// CULTURALLEVEL: '',
// WORKDATE: '2000-05-14',
// ENTRYTIME: '2019-05-14',
// Nav_Works: [{
// CODE: 'XLK100194',
// STARTDATE: '2015-05-14',
// ENDDATE: '2018-05-14',
// WORKPLACE: '',
// POSTNAME: ''
// }, {
// CODE: 'XLK100194',
// STARTDATE: '2018-05-14',
// ENDDATE: '2019-05-14',
// WORKPLACE: '',
// POSTNAME: ''
// }, {
// CODE: 'XLK100194',
// STARTDATE: '2019-05-14',
// ENDDATE: '',
// WORKPLACE: '',
// POSTNAME: ''
// }],
// Nav_Skills: [],
// // Nav_UserPhotoFiles
// // Nav_IDCardFiles
// // Nav_EducationFiles
// // Nav_CertificateFiles
// ENABLE_STATUS: '0',
// MODIFY_TIME: '2025-05-14 10:23:23'
// })
// listUser.push({
// CODE: 'XLK100194',
// DEPARTMENT_CODE: 'XLKXK0201',
// POST_CODE: 'QQJSY13',
// NAME: '',
// PHONE: '18950958648',
// SEX: '1',
// ID_CARD: '350822200005149876',
// NATIONALITY: '',
// BIRTHDAY: '2000-05-13',
// POLITICALSTATUE: '',
// JOBTITLE: '',
// CULTURALLEVEL: '',
// WORKDATE: '2000-05-14',
// ENTRYTIME: '2019-05-14',
// Nav_Works: [{
// CODE: 'XLK100194',
// STARTDATE: '2015-05-14',
// ENDDATE: '2018-05-14',
// WORKPLACE: '',
// POSTNAME: ''
// }, {
// CODE: 'XLK100194',
// STARTDATE: '2018-05-14',
// ENDDATE: '2019-05-14',
// WORKPLACE: '',
// POSTNAME: ''
// }, {
// CODE: 'XLK100194',
// STARTDATE: '2019-05-14',
// ENDDATE: '',
// WORKPLACE: '',
// POSTNAME: ''
// }],
// Nav_Skills: [],
// // Nav_UserPhotoFiles
// // Nav_IDCardFiles
// // Nav_EducationFiles
// // Nav_CertificateFiles
// ENABLE_STATUS: '0',
// MODIFY_TIME: '2025-05-13 10:23:23'
// })
// listUser.push({
// CODE: 'XLK100888',
// DEPARTMENT_CODE: 'XLKKS',
// POST_CODE: 'ZZAQY',
// NAME: '',
// PHONE: '18750553001',
// SEX: '1',
// ID_CARD: '350822200005149876',
// NATIONALITY: '',
// BIRTHDAY: '1996-08-18',
// POLITICALSTATUE: '',
// JOBTITLE: '2',
// CULTURALLEVEL: '',
// WORKDATE: '2000-08-18',
// ENTRYTIME: '2019-08-18',
// Nav_Works: [],
// Nav_Skills: [{
// NAME: '',
// LEVEL: 'CET-4',
// }],
// // Nav_UserPhotoFiles
// // Nav_IDCardFiles
// // Nav_EducationFiles
// // Nav_CertificateFiles
// ENABLE_STATUS: '0',
// MODIFY_TIME: '2025-05-08 10:23:23'
// })
// listDepartment.push({
// CODE:'XLKXK0501',
// NAME:'',
// NUM:'10',
// PARENT_CODE:'XLKXK05',
// MODIFY_TIME:'2025-05-15 9:23:23',
// ENABLE_STATUS:0,
// DEPARTMENT_TYPE:2
// })
// listDepartment.push({
// CODE:'XL123KXK05033',
// NAME:'2',
// NUM:'12',
// PARENT_CODE:'XLKXK05',
// MODIFY_TIME:'2025-05-15 9:23:23',
// ENABLE_STATUS:0,
// DEPARTMENT_TYPE:2
// })
listPost.push({
CODE: '000',
NAME: 'HCM修改',
STATUS: '1',
MODIFY_TIME: '2025-05-08 10:23:23'
})
listPost.push({
CODE: '2155',
NAME: 'HCM同步新增',
STATUS: '0',
MODIFY_TIME: '2025-05-08 9:23:23'
})
params.ORG_ID = this.OrgId
params.listPost = listPost
params.listDepartment = listDepartment
params.listUser = listUser
return request.send({
url: '/FM/DataSync/Sync',
method: 'post',
data: params,
}).then(res => {
// debugger
// // this.selectorInfo.totalCount = res.TotalCount
// if (res != undefined && res.Data.length > 0) {
// return res.Data
// } else {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// }
});
// const url = config.serviceHost('/FM/DataSync/SyncUploadFile')
// params.ORG_ID = this.OrgId
// params.TYPE = "Nav_IDCardFiles"
// params.CODE = "XLK100335"
// uni.uploadFile({
// url: url,
// filePath: uni.getStorageSync('riskUpInfo')[0].filePath, //e.filePath,
// name: 'file',
// // data: params,
// formData: params,
// header: {
// Tenant: '0001',
// RequestType: '2'
// },
// success: (res) => {
// if (res.statusCode == 200) {
// }
// },
// fail: (err) => {
// console.log(err)
// }
// })
},
}
}
</script>
<style>
.content {
/* background-color: #f4f7ff; */
background-color: rgb(246, 250, 255);
background-color: #f4f7ff;
width: 100%;
/* #ifndef APP-PLUS */
height: calc(100vh - 44px - 50px); // APP
@ -434,46 +286,69 @@
/* #endif */
}
.list {
padding: 20px 40px;
.container {
padding: 20px 16px 10px 16px;
}
.list .u-grid {
justify-content: space-between !important;
}
.list .u-grid-item {
padding: 20px 0px;
/* margin: 0px 0px 20px 0px; */
margin: 10px 0px;
width: 47% !important;
.form-sub {
/* margin: 20px 16px 10px 16px; */
/* border: 1px solid #EBEEF5; */
padding: 20px 30px 10px 30px;
/* box-shadow: rgba(0, 0, 0, 0.08) 0px 0px 3px 1px; */
background-color: #ffffff;
border-radius: 10px;
box-shadow: 5px 5px 5px #ceccca;
}
.home-button {
.demo-ruleForm>>>.u-form-item__body__left__content__label {
font-size: 14px;
color: #8e8b9c;
/* justify-content: flex-start; */
}
.demo-ruleForm>>>.u-form-item__body__left__content__ {
left: -11px;
top: 0px
}
.demo-ruleForm>>>.u-textarea__field {
font-size: 14px;
}
.demo-ruleForm>>>.u-cell__title-text {
font-size: 14px;
}
.demo-ruleForm-thr>>>.u-textarea {
padding: 9px 9px 25px 9px;
}
.demo-ruleForm-thr>>>.u-form-item__body__left__content__label {
font-size: 14px;
color: #8e8b9c;
/* justify-content: flex-start; */
}
.demo-ruleForm-thr>>>.u-form-item__body__left__content__ {
left: -11px;
top: 0px
}
.demo-ruleForm-thr>>>.u-textarea__field {
font-size: 14px;
}
.demo-ruleForm-thr>>>.u-cell__title-text {
font-size: 14px;
}
.bottom-button {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
padding: 10px 36px;
padding: 10px 16px;
box-sizing: border-box;
/* background: #f4f7ff; */
background: rgb(246, 250, 255);
background: #f4f7ff;
z-index: 999;
}
.home-button .u-button {
height: 50px;
}
.grid-text {
font-size: 14px;
color: #000;
font-weight: bold;
padding: 10rpx 0 20rpx 0rpx;
/* #ifndef APP-PLUS */
box-sizing: border-box;
/* #endif */
}
</style>