1、按区域生成二维码

2、如果有信息 默认显示对应组织的信息
3、根据传参 隐藏部分按钮
This commit is contained in:
wyw 2025-05-23 13:37:31 +08:00
parent 71a77052e0
commit 6ab33a4585
3 changed files with 263 additions and 76 deletions

View File

@ -160,7 +160,7 @@
const json = initFilter(this.OrgId, null, "NAME", 0, 1);
json.IgnoreDataRule = true
json.Limit = 10000
extendRule(json, "STATUS", 1, 0)
extendRule(json, "IS_DELETED", 1, false)
json.Keyword = this.model.AREA_ID
var listResult = await AreaEntities(json).then(res => {
// this.selectorInfo.totalCount = res.TotalCount
@ -324,7 +324,7 @@
return res.Data
})
} else if (p.name == 'AREA_NAME') {
extendRule(json, "STATUS", 1, 0)
extendRule(json, "IS_DELETED", 1, false)
dataSelect = await AreaEntities(json).then(res => {
this.selectorInfo.totalCount = res.TotalCount
if (res != undefined && res.Data.length > 0) {

View File

@ -142,7 +142,7 @@
<script>
import {
PagedDep,
WorkerScheduling
WorkerScheduling
} from '../../services/apply'
import {
initFilter,
@ -153,7 +153,7 @@
return {
OrgId: '',
model: {
DEPARTMENT_NAME: '磨重一班',
DEPARTMENT_NAME: '',
DEPARTMENT_ID: '',
SchedulingType: '',
COUNT_WORKER: '',
@ -186,9 +186,20 @@
onLoad(option) {
this.model.DEPARTMENT_ID = option.DEPARTMENT_ID // 'B18F95F4-572A-E521-1412-FA8CE50DC98A'
this.OrgId = option.OrgId // 'B043B28B-BBC3-C452-6052-4FBA1457ABFA'
if (!this.model.DEPARTMENT_ID && this.model.DEPARTMENT_ID.length > 1)
if (this.model.DEPARTMENT_ID && this.model.DEPARTMENT_ID.length > 1){
//
const json = initFilter(this.OrgId, null, "NAME", 0, 1)
json.IgnoreDataRule = true
json.Limit = 2
extendRule(json, "ID", 1, this.model.DEPARTMENT_ID)
PagedDep(json).then(res => {
if (res != undefined && res.Data.length > 0) {
this.model.DEPARTMENT_NAME = res.Data[0].NAME
}
})
//
this.WorkerScheduling()
}
},
// onReady() {
// //setRules

View File

@ -2,7 +2,6 @@
<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"
@ -21,8 +20,6 @@
</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" />
@ -37,6 +34,11 @@
import request from '../../utils/request.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',
@ -97,20 +99,24 @@
} else {
var paraString = location.search; //.substring(1, location.search.length - 1);
if (paraString && paraString.length > 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]
}
})
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
@ -135,18 +141,7 @@
})
},
methods: {
// click(name) {
// this.baseList.map((item, index) => {
// if (index == name) {
// if (item.name == '') {
// uni.navigateTo({
// url: '/pages/apply/index'
// })
// }
// }
// })
// },
// 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)
@ -158,51 +153,29 @@
url: urlTo
})
},
// goCamera() {
// // uni.chooseImage({
// // count: 6, //9
// // sizeType: ['original', 'compressed'], //
// // sourceType: ['camera'],
// // success: (res) => {
// // const url = config.serviceHost('/PF/File/UploadFile')
// // request.upload(url, res.tempFilePaths).then((result) => {
// // if (result.IsSuccessful) {
// // // TODO:
// // store.commit('updateImageLists', [{
// // IMG_FILE_ID: result.Data.imgFileID,
// // IMG_FILE_PATH: result.Data.imgFilePath
// // }]);
// // uni.showActionSheet({
// // title: '',
// // itemList: ['', ''],
// // success: (e) => {
// // if (e.tapIndex === 0) {
// // uni.navigateTo({
// // url: '/pages/camera/index'
// // })
// // } else {
// // uni.navigateTo({
// // url: '/pages/apply/subPages/riskReport'
// // })
// // }
// // }
// // })
// // }
// // }).catch((error) => {
// // console.log(error)
// // });
// // },
// // complete: function(com) {
// // console.log('choose image complete', com)
// // }
// // })
// },
getCaidan() {
const json = {
OrgId: this.OrgId
}
getMenu(json).then((res) => {
this.baseList = res.data
//TYPE 20
//OrgID TYPE 20
// this.baseList = res.data
if (this.createType == '') {
this.baseList = res.data
} 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
}
}
}).catch((err) => {
uni.showToast({
title: '请求错误',
@ -222,6 +195,9 @@
//
handleSearch(val) {
// this.createType =10
// this.createType =20
this.selectorInfo.dataLists = this.dataLists
// const orgId = uni.getStorageSync('orgId')
// const json = initFilter(orgId, "", "", 0)
@ -247,7 +223,207 @@
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>