Compare commits

...

2 Commits

Author SHA1 Message Date
b63792e74c Merge branch 'master' of http://121.41.2.71:3000/ykx/qrcode-app 2025-10-28 08:40:16 +08:00
521e8ba3e0 1 2025-10-28 08:40:05 +08:00
6 changed files with 789 additions and 0 deletions

View File

@ -79,6 +79,17 @@
"navigationBarTitleText": "视频播放"
}
},
{
"path": "pages/apply/jobList",
"style": {
"navigationBarTitleText": "岗位风险"
}
}, {
"path": "pages/apply/jobRiskShow",
"style": {
"navigationBarTitleText": "岗位风险"
}
},
{
"path": "pages/apply/complete",
"style": {

499
pages/apply/jobList.vue Normal file
View File

@ -0,0 +1,499 @@
<template>
<view class="todo-page">
<view class="background"></view>
<view class="card">
<u--form labelWidth="auto" :model="model" ref="wForm" class="demo-ruleForm">
<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="RISK_AREA_NAME" borderBottom ref="item1" @click="handleShowSheet({title: '辨识部门'})">
<u--input fontSize="14px" disabled disabledColor="#ffffff" v-model="(model.Nav_Department||{}).NAME" border="none" suffixIcon="arrow-right" customStyle="margin:0px;display:flex;padding:3px 9px"
suffixIconStyle="font-size:12px"></u--input>
</u-form-item>
<u-form-item label="辨识岗位" prop="RISK_AREA_NAME" borderBottom ref="item1" @click="handleShowSheet({title: '辨识岗位'})">
<u--input fontSize="14px" disabled disabledColor="#ffffff" v-model="(model.Nav_Post||{}).NAME" border="none" suffixIcon="arrow-right" customStyle="margin:0px;display:flex;padding:3px 9px"
suffixIconStyle="font-size:12px"></u--input>
</u-form-item>
<u-button type="primary" text="查询" @click="filterData"></u-button>
</u--form>
<u--form labelWidth="auto" :model="model" ref="wForm" class="demo-ruleForm" style="margin-top: 20px;">
<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-checkbox-group :value="checkedItems" placement="column" @change="handleCheckboxChange">
<u-checkbox :customStyle="{marginBottom: '8px'}" label="全选" name="all">
</u-checkbox>
<view v-for="(item, index) in filterDatas.Nav_Librarys" :key="index" style="margin-top: 10px;">
<u-checkbox :customStyle="{marginBottom: '8px'}" :key="index" :label="index+1+'.生产单元:'+item.MINE_NAME" :name="item.ID">
</u-checkbox>
<u-form-item label="辨识区域" prop="Nav_Contents.CHECKCONTENT" borderBottom>
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="item.AREA_NAME" border="none" inputAlign="right"></u--input>
</u-form-item>
<u-form-item label="风险名称" prop="HIDDEN_PLACE" borderBottom>
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="item.RISK_NAME" border="none" inputAlign="right"></u--input>
</u-form-item>
<u-form-item label="风险描述" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="item.RISK_DESCRIPTION" border="none" inputAlign="right" autoHeight></u--textarea>
<u-form-item label="风险类别" prop="HIDDEN_PLACE" borderBottom>
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="item.TYPE_NAME" border="none" inputAlign="right"></u--input>
</u-form-item>
<u-form-item label="风险等级" prop="HIDDEN_PLACE" borderBottom>
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="item.EVALUATE_LEVELName" border="none" inputAlign="right"></u--input>
</u-form-item>
</view>
</u-checkbox-group>
</u--form>
</view>
<view style="padding: 10px 16px;" class="bottom-button">
<u-button type="primary" @click="submit" color="#3d4b70">生产岗位告知卡</u-button>
</view>
<query-selector :show="selectorInfo.showPopup" :defaultChecked="selectorInfo.defaultChecked" :title="selectorInfo.title" :lists="selectorInfo.dataLists" @search="handleSearch" @select="handleSelected"
@close="selectorInfo.showPopup=false" :total="selectorInfo.totalCount" />
</view>
</template>
<script>
import {
GetPostRiskList,
PagedRisk
} from '../../services/apply'
import {
DepartOrderPaged,
PostOrderPaged,
getEnum
} from '../../services/common.js'
import config from '../../config/common'
import {
initFilter,
extendRule,
extendFilterGroupGroupRules
} from '../../utils/common'
export default {
data() {
return {
OrgId: '',
pageIndex: 0,
pageSize: 20,
total: 0,
baseUrl: config.uni_app_web_source_url,
allData: [],
// item
checkedItems: [],
//
selectedItems: [],
filterDatas: {
Nav_Librarys: []
},
model: {
RISK_AREA_NAME: '请选择区域',
RISK_AREA_ID: '',
ISDOWN: '否',
SchedulingType: '',
COUNT_WORKER: '',
COUNT_LEVEL: '',
START_TIME: '',
END_TIME: '',
SchedulingNEXTTIME: '',
LISTPERSON_SCHEDULING: [{
NAME: ''
}],
LISTUSER_LEAVE: [{
NAME: ''
}],
ListShow: []
},
radiolist: [{
value: false,
name: '否'
}, {
value: true,
name: '是'
}],
selectorInfo: {
showPopup: false,
totalCount: 0,
title: '班组名称',
// itemData: {},
index: 0,
dataLists: [],
defaultText: '',
defaultValue: '',
name: '',
defaultChecked: []
},
enumsData: {}, //
enumsText: {} //
}
},
onLoad(option) {
this.OrgId = option.OrgId // 'B043B28B-BBC3-C452-6052-4FBA1457ABFA'
// const orgId = uni.getStorageSync('orgId')
this.fetchEnums(['SKEvaluateLevelEnum']);
},
// onReady() {
// //setRules
// this.$refs.uForm.setRules(this.rules)
// },
methods: {
async fetchEnums(enumNames) {
try {
// Promise
const enumPromises = enumNames.map(name => {
return getEnum({
name
}).then(res => {
// name/code便
return {
enumName: name,
data: res.Data.map(item => ({
...item,
name: item.NAME, //
code: item.ID //
}))
};
});
});
//
const results = await Promise.all(enumPromises);
// data
results.forEach(({
enumName,
data
}) => {
this.enumsData[enumName] = data;
//
this.enumsText[enumName] = data.map(item => item.name);
});
// loadData
this.loadData();
} catch (error) {
console.error('枚举请求失败:', error);
uni.showToast({
title: '枚举数据加载失败',
icon: 'none'
});
}
},
loadData() {
const json = initFilter(this.OrgId, "", "")
json.IgnoreDataRule = true
GetPostRiskList(json).then(res => {
this.allData = res.Data
this.allData.map(item => {
if (item.Nav_Librarys && item.Nav_Librarys.length > 0) {
item.Nav_Librarys.map(item1 => {
item1.EVALUATE_LEVELName = item1.EVALUATE_LEVEL !== undefined ? this.enumsData['SKEvaluateLevelEnum'].find(item => item.code === item1.EVALUATE_LEVEL).name : '';
})
}
})
// this.total = res.TotalCount
})
},
handleCheckboxChange(e) {
//
const hasAll = e.includes('all');
// ID
const allIds = this.filterDatas.Nav_Librarys.map(item => item.ID);
//
const isAllSelected = this.checkedItems.includes('all');
if (this.checkedItems.length > e.length) {
//
if (hasAll) {
//
if (isAllSelected) {
//
let arr = []
const diff = this.checkedItems.filter(item => !e.includes(item));
arr.push('all')
arr.push(...diff)
let arrs = []
arrs = this.checkedItems.filter(item => !arr.includes(item));
this.checkedItems = arrs
} else {
//lenth
}
} else {
//
if (isAllSelected) {
//
// const remainingIds = allIds.filter(id => e.includes(id));
this.checkedItems = [];
} else {
const diff = this.checkedItems.filter(item => !e.includes(item));
const newArr = this.checkedItems.filter(item => item !== diff[0]);
this.checkedItems = newArr
}
}
} else {
//
if (hasAll) {
//
if (isAllSelected) {
// / lenth
} else {
//
//
this.checkedItems = ['all', ...allIds];
}
} else {
//
if (isAllSelected) {
// lenth
} else {
const diff = e.filter(item => !this.checkedItems.includes(item));
this.checkedItems.unshift(...diff);
if (e.length === allIds.length && allIds.length > 0) {
this.checkedItems.unshift('all');
}
// const diff = this.checkedItems.filter(item => !e.includes(item));
// //
// this.checkedItems = e.filter(item => item !== 'all');
// //
// if (this.checkedItems.length === allIds.length && allIds.length > 0) {
// this.checkedItems.unshift('all');
// }
}
}
}
},
filterData() {
this.allData.map(item => {
if (item.DEPARTMENT_ID == this.model.DEPARTMENT_ID && item.POST_NAME == this.model.Nav_Post.NAME) {
this.filterDatas = item
console.log(this.filterDatas, 'this.filterData')
}
})
},
checkChange(e) {
console.log(e, '888')
},
submit() {
console.log(this.checkedItems, '9999')
console.log(this.filterDatas, '9999')
let arr = []
this.filterDatas.Nav_Librarys.map(item => {
this.checkedItems.map(item1 => {
if (item.ID == item1) {
arr.push(item)
}
})
})
console.log(arr, 'arr')
//MEASURES_NAME
const groupedData = arr.reduce((acc, item) => {
const riskName = item.RISK_NAME;
//
const currentMeasures = [...new Set(
item.Nav_Details.map(detail => detail.MEASURES_NAME)
)];
if (!acc[riskName]) {
//
acc[riskName] = currentMeasures;
} else {
//
acc[riskName] = [...new Set([...acc[riskName], ...currentMeasures])];
}
return acc;
}, {});
//
// 1. RISK_NAME RISK_DESCRIPTION
let newarr = {
departName: this.filterDatas.Nav_Department ? this.filterDatas.Nav_Department.NAME : '',
userName: this.filterDatas.USER_NAME,
phone: this.filterDatas.PHONE,
postName: this.filterDatas.POST_NAME,
RISK_NAME: [...new Set(
arr.map(item => item.RISK_NAME.trim())
)].join(' '),
EVALUATE_LEVELName: [...new Set(
arr.map(item => item.EVALUATE_LEVELName.trim())
)].join(' '),
RISK_TYPE: [...new Set(
arr.map(item => item.Nav_Type.NAME.trim())
)].join(' '),
RISK_DESCRIPTION: [...new Set(
arr.map(item => item.RISK_DESCRIPTION.trim())
)].join(' '),
MEASURES_NAME: Object.entries(groupedData)
.map(([riskName, measures], index) => {
// 1.xxx 2.yyy
const measuresList = measures
.map((measure, mIndex) => `${mIndex + 1}.${measure}`)
.join('\n ');
//
return index === 0 ?
`${riskName}\n ${measuresList}` :
`\n${riskName}\n ${measuresList}`;
})
.join(''),
RISK_DESCRIPTION: this.handleData(arr,'RISK_DESCRIPTION'),
EMERGENCY: this.handleData(arr,'EMERGENCY')
}
console.log(newarr, 'nnnnnnnnnnnnn')
uni.setStorageSync('detailData', newarr);
uni.navigateTo({
url: '/pages/apply/jobRiskShow'
})
},
handleData(arr,namekey){
const oneData = {};
arr.forEach(item => {
const name = item.RISK_NAME;
const desc = item[namekey];
//
if (oneData[name]) {
oneData[name].add(desc);
} else {
oneData[name] = new Set([desc]);
}
});
const resultArr = [];
for (const [name, descList] of Object.entries(oneData)) {
// Set 12
const descStr = Array.from(descList).join('');
resultArr.push(`${name}${descStr}`);
}
// 3. \n
const finalResult = resultArr.join('\n');
return finalResult
},
closePicker() {
this.comPickerInfo = {
showSheet: false,
columns: [],
title: '',
name: '',
formIndex: undefined
}
},
//
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) {
uni.showLoading({
title: '加载中...'
})
this.pageIndex = 0
var defaultChecked = []
let dataSelect = []
const json = initFilter(this.OrgId, null, "NAME", 0, (p.pageIndex ?? 1));
json.IgnoreDataRule = true
json.Limit = 20
if (p.val) {
// extendFilterGroupGroupRules(json, 'NAME', 9, p.val)
extendRule(json, "NAME", 9, p.val)
}
if (p.title == '辨识部门') {
dataSelect = await DepartOrderPaged(json).then(res => {
uni.hideLoading()
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 (this.model.DEPARTMENT_ID && this.model.DEPARTMENT_ID !== null) {
// extendRule(json, "DEPARTMENT_ID", 1, this.model.DEPARTMENT_ID)
json.Keyword = this.model.DEPARTMENT_ID
}
dataSelect = await PostOrderPaged(json).then(res => {
uni.hideLoading()
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.title == '辨识部门') {
this.model.Nav_Department = e
this.model.DEPARTMENT_ID = e.ID
} else {
this.model.Nav_Post = e
this.model.POST_ID = e.ID
}
// this.WorkerScheduling()
}
},
}
</script>
<style>
@import url("../../style/css/newTemplate.css");
</style>

View File

@ -0,0 +1,89 @@
<template>
<view class="todo-page">
<view class="background"></view>
<view class="card">
<u--form labelWidth="auto" :model="detailData" ref="wForm" class="demo-ruleForm">
<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;">{{detailData.postName}}岗位安全风险告知卡</view>
<u-form-item label="风险名称" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="detailData.RISK_NAME" border="none" inputAlign="right" autoHeight></u--textarea>
<u-form-item label="风险等级" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="detailData.EVALUATE_LEVELName" border="none" inputAlign="right" autoHeight></u--textarea>
<u-form-item label="事故后果" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="detailData.RISK_TYPE" border="none" inputAlign="right" autoHeight></u--textarea>
<u-form-item label="风险描述" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="detailData.RISK_DESCRIPTION" border="none" inputAlign="right" autoHeight></u--textarea>
<u-form-item label="安全标志" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<!-- <u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="detailData.RISK_DESCRIPTION" border="none" inputAlign="right" autoHeight></u--textarea> -->
<u-form-item label="管控措施" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="detailData.MEASURES_NAME" border="none" inputAlign="right" autoHeight></u--textarea>
<u-form-item label="应急处置" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="detailData.EMERGENCY" border="none" inputAlign="right" autoHeight></u--textarea>
<u-form-item label="责任单位" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="detailData.departName" border="none" inputAlign="right" autoHeight></u--textarea>
<u-form-item label="责任人" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="detailData.userName" border="none" inputAlign="right" autoHeight></u--textarea>
<u-form-item label="联系方式" prop="HIDDEN_PLACE" borderBottom>
</u-form-item>
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="detailData.phone" border="none" inputAlign="right" autoHeight></u--textarea>
</u--form>
</view>
</view>
</template>
<script>
import {
GetPostRiskList,
PagedRisk
} from '../../services/apply'
import {
DepartOrderPaged,
PostOrderPaged,
getEnum
} from '../../services/common.js'
import config from '../../config/common'
import {
initFilter,
extendRule
} from '../../utils/common'
export default {
data() {
return {
detailData: {},
model: {}
}
},
onLoad(option) {
this.detailData = uni.getStorageSync('detailData');
console.log(this.detailData, 'this.detailData')
},
onUnload() {
//
uni.removeStorageSync('detailData');
},
// onReady() {
// //setRules
// this.$refs.uForm.setRules(this.rules)
// },
methods: {},
}
</script>
<style>
@import url("../../style/css/newTemplate.css");
</style>

View File

@ -87,4 +87,14 @@ export const PagedDangerJob = (params) => {
method: 'post',
data: params,
})
}
//危险作业查看
export const GetPostRiskList = (params) => {
params.isAll=true
return request.send({
url: '/BI/H5Controller/GetPostRiskList',
method: 'post',
data: params,
})
}

View File

@ -35,4 +35,32 @@ export const AreaEntities = (params) => {
method: 'post',
data: params,
})
}
//辨识部门
export const DepartOrderPaged = (params) => {
params.isAll=true
return request.send({
url: '/BI/H5Controller/DepartOrderPaged',
method: 'post',
data: params,
})
}
//辨识岗位
export const PostOrderPaged = (params) => {
params.isAll=true
return request.send({
url: '/BI/H5Controller/PostOrderPaged',
method: 'post',
data: params,
})
}
//辨识岗位
export const getEnum = (params) => {
// params.isAll=true
return request.send({
url: '/PF/Extend/GetEnum',
method: 'get',
data: params,
})
}

152
style/css/newTemplate.css Normal file
View File

@ -0,0 +1,152 @@
/* .todo-page>>>.u-steps-item__line {
width: 187.6px !important;
} */
/* 进度条步骤少于3 */
.page-wrap {
padding-bottom: 150px;
}
.allview {
padding: 0px 0px 180px 0px;
}
.video {
padding: 16px 16px 10px;
}
.background {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #edf1fd;
z-index: -1;
}
.richtext {
font-size: 14px;
}
.card {
margin: 20px 16px 140px 16px;
/* border: 1px solid #EBEEF5; */
padding: 20px 30px 80px 30px;
/* box-shadow: rgba(0, 0, 0, 0.08) 0px 0px 3px 1px; */
background-color: #ffffff;
border-radius: 10px;
}
.upload-title {
font-size: 14px;
color: #8e8b9c;
line-height: 22px;
padding: 8px 0px;
}
.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;
}
.check-p>>>.u-form-item__body__right__content__slot {
justify-content: flex-end;
}
.bottom-button {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
padding: 10px 16px;
box-sizing: border-box;
background: #edf1fd;
z-index: 999;
}
.sub-form>>>.u-form-item__body__left__content__label {
font-size: 14px;
/* justify-content: flex-start; */
}
.sub-form>>>.u-textarea__field {
font-size: 14px;
}
.sub-form>>>.u-cell__title-text {
font-size: 14px;
}
.uni-collapse-item {
box-sizing: border-box;
}
.sub-form>>>.uni-collapse-item__title {
display: flex;
width: 100%;
box-sizing: border-box;
flex-direction: row;
align-items: center;
transition: border-bottom-color .3s;
border-bottom: 1px solid #ebeef5;
}
.sub-form>>>.uni-collapse-item__title-wrap {
/* width: 100%; */
flex: 1;
}
.sub-form>>>.uni-collapse-item__title-box {
padding: 0px;
}
.uni-collapse-item__title-box {
padding: 0px;
display: flex;
width: 100%;
box-sizing: border-box;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 48px;
line-height: 48px;
background-color: #fff;
color: #303133;
font-size: 13px;
font-weight: 500;
cursor: pointer;
outline: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
}
.uni-collapse-item__title-text {
flex: 1;
font-size: 14px;
white-space: nowrap;
color: inherit;
overflow: hidden;
text-overflow: ellipsis;
}
.right-align {
display: flex;
flex-wrap: wrap;
justify-content: end;
flex: 1;
}