安全意识调查表

This commit is contained in:
yunkexin 2026-01-23 15:04:14 +08:00
parent 3a6985d6fa
commit 9b8f7bfadf
3 changed files with 244 additions and 248 deletions

View File

@ -148,7 +148,6 @@
loadData() {
if (this.ID == undefined || this.ID == '') {
this.stepLoad = false
this.model.Nav_Details = []
if (this.ID == undefined || this.ID == '')
this.ID = guid()
this.model.ID = this.ID
@ -356,33 +355,18 @@
},
submit() {
this.modelEdit = JSON.parse(JSON.stringify(this.model))
delete this.modelEdit.Nav_ApplyDepartment
delete this.modelEdit.Nav_ApplyUser
delete this.modelEdit.Nav_Area
delete this.modelEdit.Nav_FireDepartment
delete this.modelEdit.Nav_FireUser
delete this.modelEdit.Nav_OperationStep
delete this.modelEdit.Nav_ProductionUnit
delete this.modelEdit.Nav_SafeUser
delete this.modelEdit.Nav_Type
if(this.model.Nav_JoinDepartment&&this.model.Nav_JoinDepartment.length>0){
this.model.Nav_JoinDepartment.map(item=>{
delete item.Nav_Department
})
}
if (this.modelEdit.Nav_Users && this.modelEdit.Nav_Users.length > 0) {
this.modelEdit.Nav_Users.map(item => {
item.PUBLISH = 'SaveAndNotify'
delete item.Nav_Train
delete item.Nav_User
delete item.Nav_UserType
if (item.Nav_UserFiles && item.Nav_UserFiles.length > 0) {
item.Nav_UserFiles.map(item1 => {
item1.FIRE_JOB_USER_ID = item.ID
})
}
})
}
// if(this.modelEdit.Nav_JoinDepartment&&this.modelEdit.Nav_JoinDepartment.length>0){
// this.modelEdit.Nav_JoinDepartment.map(item=>{
// delete item.Nav_Department
// })
// }
// if(this.modelEdit.Nav_Points&&this.modelEdit.Nav_Points.length>0){
// this.modelEdit.Nav_Points.map(item=>{
// delete item.Nav_Point
// })
// }
if (this.TaskID == null || this.TaskID == '') {
this.modelEdit.TaskID = '00000000-0000-0000-0000-000000000000'

View File

@ -24,24 +24,21 @@
<text class="value">{{item.Nav_LaunchUser?item.Nav_LaunchUser.NAME:''}}</text>
</view>
<view class="field">
<text class="label">培训类型</text>
<text class="value">{{item.Nav_TrainType?item.Nav_TrainType.NAME:''}}</text>
<text class="label">发起部门</text>
<text class="value">{{item.Nav_LaunchDepartment?item.Nav_LaunchDepartment.NAME:''}}</text>
</view>
<view class="field">
<text class="label">培训开始时间</text>
<text class="value">{{item.TRAIN_START_TIME}}</text>
<text class="label">发起时间</text>
<text class="value">{{item.LAUNCH_TIME}}</text>
</view>
<view class="field">
<text class="label">培训结束时间</text>
<text class="value">{{item.TRAIN_END_TIME}}</text>
</view>
<view class="field">
<text class="label">考核方式</text>
<text class="value">{{item.CHECKTYPE_NAME}}</text>
<text class="label">截止时间</text>
<text class="value">{{item.END_TIME}}</text>
</view>
<view class="field">
<text class="label">状态</text>
<text class="value">{{item.STATUS}}</text>
<text class="status">{{item.STATUS}}</text>
</view>
</view>
</common-card>
@ -90,7 +87,7 @@
}
},
onLoad() {
this.fetchEnums(['SETrainNotifyStatus','PlanCheckType']);
this.fetchEnums(['SESafeSurveyStatus']);
},
methods: {
async fetchEnums(enumNames) {
@ -144,25 +141,23 @@
const json = initFilter(orgId, "", "CREATE_TIME", 1, this.pageIndex)
extendInclude(json, "Nav_LaunchDepartment")
extendInclude(json, "Nav_LaunchUser")
extendInclude(json, "Nav_TrainType")
// extendInclude(json, "Nav_TrainCheckType")
if (this.keyword) {
extendRule(json, 'NAME', 9, this.keyword)
}
if (this.searchStartTime) {
extendRule(json, 'TRAIN_START_TIME', 6, this.searchStartTime)
extendRule(json, 'LAUNCH_TIME', 6, this.searchStartTime)
}
if (this.filterStatus !== null) {
extendRule(json, 'STATUS', 1, this.filterStatus)
}
getRequestOrderPage(json, "/SE/TrainNotify/OrderPaged").then(res => {
getRequestOrderPage(json, "/SE/SafeSurvey/OrderPaged").then(res => {
this.total = res.TotalCount;
let newRes = (res.Data || []).map(i => {
return {
...i,
title: i.NAME,
STATUS: i.STATUS !== undefined ? this.enumsData['SETrainNotifyStatus'].find(item => item.code === i.STATUS).name : '',
CHECKTYPE_NAME:i.CHECKTYPE !== undefined ? this.enumsData['PlanCheckType'].find(item => item.code === i.CHECKTYPE).name : '',
STATUS: i.STATUS !== undefined ? this.enumsData['SESafeSurveyStatus'].find(item => item.code === i.STATUS).name : '',
}
})
@ -175,7 +170,7 @@
},
showDetail(id) {
uni.navigateTo({
url: '/pages/apply/subPages/SE/1trainNotifyShow?ID=' + id
url: '/pages/apply/subPages/SE/11safeSurveyShow?ID=' + id
})
},
handleShowPicker(p) {
@ -184,7 +179,7 @@
column = ['全部', '当天', '最近三天', '最近一周', '最近一月']
}
if (p.name === 'status') {
column = this.enumsText['SETrainNotifyStatus']
column = this.enumsText['SESafeSurveyStatus']
}
this.comPickerInfo = {
showPicker: true,
@ -212,7 +207,7 @@
}
}
if (this.comPickerInfo.name === 'status') {
this.filterStatus = this.enumsData['SETrainNotifyStatus'][e.indexs[0]].code
this.filterStatus = this.enumsData['SESafeSurveyStatus'][e.indexs[0]].code
this.statusFilterTxt = e.value[0]
}
this.closePicker()

View File

@ -1,91 +1,67 @@
<template>
<view class="todo-page">
<view class="card" >
<view class="background"></view>
<view>
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" class="demo-ruleForm">
<u-form-item label="培训名称:" prop="NAME" borderBottom>
<u--input v-model="model.NAME" border="none" slot="right" inputAlign="right" disabled
disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="发起时间:" prop="LAUNCH_TIME" borderBottom>
<u--input v-model="model.LAUNCH_TIME" border="none" slot="right" inputAlign="right" disabled
disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="发起部门:" prop="Nav_LaunchDepartment.NAME" borderBottom>
<u--input v-if="model.Nav_LaunchDepartment" v-model="model.Nav_LaunchDepartment.NAME" border="none"
slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="发起人员:" prop="Nav_LaunchUser.NAME" borderBottom>
<u--input v-if="model.Nav_LaunchUser" v-model="model.Nav_LaunchUser.NAME" border="none" slot="right"
inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="培训类型:" prop="Nav_LaunchUser.NAME" borderBottom>
<u--input v-if="model.Nav_TrainType" v-model="model.Nav_TrainType.NAME" border="none" slot="right"
inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="培训级别:" prop="LEVEL" borderBottom>
<u--input v-model="model.LEVEL" border="none" slot="right" inputAlign="right" disabled
disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="开始时间:" prop="TRAIN_START_TIME" borderBottom>
<u--input v-model="model.TRAIN_START_TIME" border="none" inputAlign="right" disabled
disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="结束时间:" prop="TRAIN_END_TIME" borderBottom>
<u--input v-model="model.TRAIN_END_TIME" border="none" inputAlign="right" disabled
disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="培训地点:" prop="TRAIN_ADDR" borderBottom>
<u--input v-model="model.TRAIN_ADDR" border="none" slot="right" inputAlign="right" disabled
disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="培训学时:" prop="HOURS" borderBottom>
<u--input v-model="model.HOURS" border="none" slot="right" inputAlign="right" disabled
disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="培训老师:" prop="TRAIN_TEACHER" borderBottom>
<u--input v-model="model.TRAIN_TEACHER" border="none" slot="right" inputAlign="right" disabled
disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="培训形式:" prop="" borderBottom>
<u--input v-model="model.TRAIN_MODEL" border="none" inputAlign="right" disabled
disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="考核方式:" prop="Nav_TrainCheckType.NAME" borderBottom>
<u--input v-model="model.CHECKTYPE_NAME" border="none"
slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="培训内容:" prop="TRAINCONTENT" borderBottom>
</u-form-item>
<u-textarea autoHeight v-html="model.TRAINCONTENT" border="none" disabled></u-textarea>
<u-form-item label="培训安排及要求:" prop="TRAIN_PLAN" borderBottom>
</u-form-item>
<u--textarea v-model="model.TRAIN_PLAN" border="none" disabled></u--textarea>
<u-form-item label="培训人员:" prop="users" >
</u-form-item>
<rich-text v-html="model.users" border="none" disabled style="font-size: 14px;"></rich-text>
<view class="upload-title">附件</view>
<full-upload v-model="model.Nav_Files" :listProp='listPropUpload'
:listPropVal='listPropValUpload' :isShowBtn="false"></full-upload>
</u--form>
</view>
<view class="card">
<view class="background"></view>
<view>
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" class="demo-ruleForm">
<u-form-item required label="筛选" @click="handleShowSheet({title: '筛选', name: 'Nav_JoinDepartment'})" borderBottom>
<u--input disabledColor="#fff" v-model="type" disabled placeholder="请选择筛选条件" suffixIcon="arrow-down" suffixIconStyle="font-size:12px" fontSize="14px" border="none"
customStyle="margin:0px;display:flex;padding:3px 0px" inputAlign="right">
</u--input>
</u-form-item>
<u-form-item label="调查名称:" prop="NAME" borderBottom>
<u--input v-model="model.NAME" border="none" slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="发起时间:" prop="LAUNCH_TIME" borderBottom>
<u--input v-model="model.LAUNCH_TIME" border="none" slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="发起部门:" prop="Nav_LaunchDepartment.NAME" borderBottom>
<u--input v-if="model.Nav_LaunchDepartment" v-model="model.Nav_LaunchDepartment.NAME" border="none" slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="发起人员:" prop="Nav_LaunchUser.NAME" borderBottom>
<u--input v-if="model.Nav_LaunchUser" v-model="model.Nav_LaunchUser.NAME" border="none" slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="截止时间:" prop="END_TIME" borderBottom>
<u--input v-model="model.END_TIME" border="none" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="参与人员">
<!-- <u-icon name="arrow-down" size="12" slot="right"></u-icon> -->
</u-form-item>
<view class="tag-view" v-if="model.Nav_JoinDepartment">
<uni-tag class="tag" v-for="(i, k) in model.Nav_JoinDepartment.filter(i => !i.IS_DELETED)" :key="k" :inverted="true" :text="i.Nav_Department.NAME" type="primary" />
</view>
<u-form-item label="调查内容">
<!-- <u-icon name="arrow-down" size="12" slot="right"></u-icon> -->
</u-form-item>
<view class="tag-view" v-if="model.Nav_Points">
<uni-tag class="tag" v-for="(i, k) in model.Nav_Points.filter(i => !i.IS_DELETED)" :key="k" :inverted="true" :text="i.Nav_Point.NAME" type="primary" />
</view>
<view class="table-container" v-if="ROWS && ROWS.length > 0">
<table>
<tr>
<th colspan="100%" style="text-align: center; background-color: #f5f7fa; font-weight: bold; padding: 12px;">
答案正确率(百分比)
</th>
</tr>
<!-- 动态渲染表格行 -->
<tr v-for="(row, rowIndex) in ROWS" :key="rowIndex">
<uni-card class="btn-wrap" :is-shadow="true" v-if="isLoadOK&&tableKey==1">
<u--form>
<view class="btn-wrap">
<view>
<u--textarea height='3em' v-model="LEAVE_REASON" placeholder="请输入请假理由"></u--textarea>
<!-- 如果是第一行使用 u-th 作为表头 -->
<template v-if="rowIndex === 0">
<th v-for="(cell, cellIndex) in row" :key="cellIndex">{{ cell }}</th>
</template>
<!-- 其他行使用 u-td -->
<template v-else>
<td v-for="(cell, cellIndex) in row" :key="cellIndex">{{ cell }}<span v-if="cellIndex!==0">%</span></td>
</template>
</tr>
</table>
</view>
<view class="buttons">
<u-button type="primary" color="#3d4b70" class="btn first-btn" @click="onChargeUserAgree(1)"
text="参加"></u-button>
<u-button color="#3d4b70" :plain="true" type="warning" @click="onChargeUserAgree(2)" text="请假"></u-button>
</view>
</view>
</u--form>
</uni-card>
</view>
</u--form>
</view>
</view>
<u-picker :show="comPickerInfo.showSheet" :columns="comPickerInfo.columns" @confirm="onConfirmPicker" @close="closePicker" @cancel="closePicker" keyName="NAME"></u-picker>
</view>
</template>
@ -118,134 +94,78 @@
listPropUpload: ['NOTIFY_ID'],
listPropValUpload: [],
Lists: [],
type: '部门',
ROWS: [],
comPickerInfo: {
showSheet: false,
columns: [],
title: '',
dataIndex: undefined,
formIndex: undefined,
name: ''
},
}
},
onLoad(option) {
this.model.ID = option.ID;
this.model.ORG_ID_HV = option.ORG_ID_HV
this.TaskID = option.taskID;
this.tableKey = option.tableKey ? option.tableKey : '0'
this.getEnums()
this.loadData()
},
methods: {
getEnums(){
var dataParm = {
'name': "PlanCheckType"
}
getEnum(dataParm).then(res => {
this.Lists = res.map(i => {
return {
...i,
name: i.NAME,
}
})
this.loadData()
})
},
loadData() {
const json = initFilter(this.orgId, "", "CODE", 1)
extendRule(json, 'ID', 1, this.model.ID);
extendInclude(json, 'Nav_LaunchDepartment');
extendInclude(json, 'Nav_LaunchUser');
extendInclude(json, 'Nav_TrainType');
// extendInclude(json, 'Nav_TrainCheckType');
extendInclude(json, 'Nav_TrainContentList');
extendInclude(json, 'Nav_TrainContentList.Nav_Point');
extendInclude(json, 'Nav_TrainUserList');
extendInclude(json, 'Nav_TrainUserList.Nav_User');
extendInclude(json, 'Nav_Files.Nav_ImgFile');
getRequest(json, "/SE/TrainNotify/Get").then(res => {
this.model = res
let trainContent = '';
let users = '';
if (res.Nav_TrainContentList && res.Nav_TrainContentList.length > 0) {
for (let i = 0; i < res.Nav_TrainContentList.length; i++) {
trainContent += (i + 1) + "." + res.Nav_TrainContentList[i].Nav_Point.NAME + "<br/>"
}
}
if (res.Nav_TrainUserList && res.Nav_TrainUserList.length > 0) {
for (let i = 0; i < res.Nav_TrainUserList.length; i++) {
if (res.Nav_TrainUserList[i].IS_LEAVE == 0) {
users += (users.length > 0 ? " " : "") +
"<view style='color:#E35D58;background-color:rgba(227,93,88,0.2);padding:5px;line-height:30px;white-space:nowrap;'>" +
res.Nav_TrainUserList[i].Nav_User.NAME + "</view>";
} else if (res.Nav_TrainUserList[i].IS_LEAVE == 1) {
users += (users.length > 0 ? " " : "") +
"<text style='padding:5px;line-height:30px;white-space:nowrap;'>" +
res.Nav_TrainUserList[i].Nav_User.NAME + "</text>";
} else if (res.Nav_TrainUserList[i].IS_LEAVE == 2) {
users += (users.length > 0 ? " " : "") +
"<text style='padding:5px;line-height:30px;white-space:nowrap;'>" +
res.Nav_TrainUserList[i].Nav_User.NAME + "(请假)</text>";
}
}
}
this.model.CHECKTYPE_NAME = res.CHECKTYPE !== undefined ? this.Lists.find(item => item.ID === res.CHECKTYPE).name : '';
this.model.TRAIN_MODEL = this.returnModel(this.model.TRAIN_MODEL);
this.model.LEVEL = this.transLevel(this.model.LEVEL);
this.model.TRAINCONTENT = trainContent;
this.model.users = users;
json.Parameter22 = this.model.ORG_ID_HV;
json.OrgType = 2;
json.Parameter3 = this.type;
json.Parameter1 = this.model.ID;
getRequest(json, "/SE/SESafeSurvey/GetReport").then(res => {
this.model = res.SURVEY[0]
this.ROWS = res.ROWS
this.isLoadOK = true;
})
},
returnModel(level) {
let str = '';
if (level == undefined) {
return str;
}
if (level.indexOf('1') >= 0) {
str += '讲授法 ';
}
if (level.indexOf('2') >= 0) {
str += '视听法 ';
}
if (level.indexOf('3') >= 0) {
str += '研讨法 ';
}
if (level.indexOf('4') >= 0) {
str += '演示法 ';
}
return str;
},
transLevel(level) {
if (level == 0) {
return '部门 ';
}
if (level == 1) {
return '车间 ';
}
if (level == 2) {
return '班组 ';
}
if (level == 3) {
return '公司 ';
//
async handleShowSheet(p) {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "", 0)
let dataSelect = ['部门', '人员', '岗位']
if (dataSelect.length) {
this.comPickerInfo = {
showSheet: true,
title: p.title,
name: p.name,
dataIndex: p.dataIndex,
columns: [dataSelect]
}
} else {
//
}
},
onChargeUserAgree(type) {
if (type == 2) {
if (this.LEAVE_REASON == "" || this.LEAVE_REASON == null) {
uni.$showMsgFunc('请填写请假理由!', () => {
}, 'error', 1000);
return
}
}
let json = {
USER_ID: uni.getStorageSync('appInfo').User.ID,
ORG_ID: this.ORG_ID,
NOTIFY_ID: this.model.ID,
LEAVE_REASON: this.LEAVE_REASON,
IS_LEAVE: type,
TaskID: this.TaskID,
};
getRequest(json, "/SE/SETrainNotify/TrainPersonStatus").then(res => {
if (res) {
uni.$showMsgFunc('操作成功!', () => {
uni.navigateBack()
}, 'success', 1000)
}
})
// departmentName Nav_DepartmentDeal Nav_UserDeal userDetailer Nav_UserCheck userChecker
}
onConfirmPicker(e) {
const {
name,
dataIndex
} = this.comPickerInfo
this.type = e.value[0]
this.comPickerInfo.showSheet = false
this.loadData()
},
closePicker() {
this.comPickerInfo = {
showSheet: false,
columns: [],
title: '',
name: '',
formIndex: undefined
}
},
},
computed: {
@ -264,16 +184,19 @@
background: #edf1fd;
z-index: -1;
}
.todo-page {
/* padding-bottom: 10px; */
overflow: hidden;
}
.card {
margin: 20px 16px 180px 16px;
padding: 20px 30px 80px 30px;
background-color: #ffffff;
border-radius: 10px;
}
.upload-title {
font-size: 14px;
color: #8e8b9c;
@ -292,10 +215,11 @@
background: #fff;
box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05);
}
.btn-wrap>>>.u-textarea__field {
font-size: 14px;
}
.btn-wrap>>>.u-cell__title-text {
font-size: 14px;
}
@ -309,25 +233,118 @@
.buttons .first-btn {
margin-right: 20px;
}
.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-textarea {
font-size: 14px;
}
.demo-ruleForm>>>.u-cell__title-text {
font-size: 14px;
}
/* 表格样式 */
table {
width: 100%;
border-collapse: collapse;
margin: 16px 0;
font-size: 14px;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
/* 表头样式 */
th {
background-color: #f5f7fa;
color: #606266;
font-weight: 600;
text-align: center;
padding: 12px 8px;
border-bottom: 1px solid #e0e0e0;
white-space: nowrap;
}
/* 表体单元格样式 */
td {
padding: 12px 8px;
text-align: center;
border-bottom: 1px solid #f0f0f0;
color: #333;
background-color: #fff;
}
/* 隔行变色效果 */
tr:nth-child(even) td {
background-color: #fafafa;
}
/* 最后一行底部边框去除 */
tr:last-child td {
border-bottom: none;
}
/* 首列和尾列适当加宽 */
th:first-child,
td:first-child {
padding-left: 16px;
text-align: left;
}
th:last-child,
td:last-child {
padding-right: 16px;
text-align: right;
}
/* 表头与数据行之间的分割线 */
tr:first-child th {
border-bottom: 1px solid #d0d7e5;
}
/* 悬停效果(可选) */
tr:hover td {
background-color: #f0f8ff;
}
/* 移动端优化:允许横向滚动 */
.table-container {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
margin: 16px -8px;
padding: 0 8px;
}
/* 如果希望表格固定在卡片内,可以这样调整 */
.card table {
margin-left: -8px;
margin-right: -8px;
width: calc(100% + 16px);
}
/* 小屏幕优化 */
@media (max-width: 375px) {
table {
font-size: 13px;
}
th,
td {
padding: 10px 6px;
}
}
</style>