安全意识调查

This commit is contained in:
yunkexin 2026-01-06 15:39:08 +08:00
parent ff0b6d21b7
commit 78bba8ecdc
4 changed files with 1199 additions and 0 deletions

View File

@ -1371,6 +1371,27 @@
"navigationBarTitleText": "三级安全教育答题页面",
"onReachBottomDistance": 100
}
},
{
"path": "11safeSurveyEdit",
"style": {
"navigationBarTitleText": "安全意识调查",
"onReachBottomDistance": 100
}
},
{
"path": "11safeSurveyShow",
"style": {
"navigationBarTitleText": "安全意识调查",
"onReachBottomDistance": 100
}
},
{
"path": "11safeSurveyList",
"style": {
"navigationBarTitleText": "安全意识调查",
"onReachBottomDistance": 100
}
}
]

View File

@ -0,0 +1,496 @@
<template>
<view class="todo-page">
<view class="background"></view>
<view class="allview">
<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 required label="调查名称" prop="LOCATION" borderBottom>
<u--input disabledColor="#ffffff" v-model="model.NAME" border="none" inputAlign="right" fontSize="14px" placeholder="请输入调查名称"></u--input>
</u-form-item>
<u-form-item required label="截止时间" prop="ENDTIME" borderBottom @click="showCheckDate(1)">
<u--input disabled disabledColor="#fff" v-model="model.END_TIME" placeholder="请选择时间" border="none" inputAlign="right" fontSize="14px"></u--input>
<u-icon style="margin-left: 4px;" name="arrow-down" size="12"></u-icon>
</u-form-item>
<u-form-item required label="参与部门" @click="handleShowSheet({title: '参与部门', name: 'Nav_JoinDepartment'})" borderBottom>
<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 required label="调查内容" @click="handleShowSheet({title: '调查内容', name: 'Nav_Points'})" borderBottom>
<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>
</u--form>
</view>
<view style="padding: 10px 16px;" class="bottom-button">
<u-button type="primary" @click="submit" color="#3d4b70" :loading="stepLoad">提交</u-button>
</view>
<query-selector :multiple="selectorInfo.isMultiple" :show="selectorInfo.showPopup" :title="selectorInfo.title" :lists="selectorInfo.dataLists" :defaultChecked="selectorInfo.defaultChecked"
@search="handleSearch" @select="handleSelected" @close="selectorInfo.showPopup=false" :total="selectorInfo.totalCount" />
<u-picker :show="comPickerInfo.showSheet" :columns="comPickerInfo.columns" @confirm="onConfirmPicker" @close="comPickerInfo.showSheet=false" @cancel="comPickerInfo.showSheet=false" keyName="NAME"></u-picker>
<u-modal :show="showDelModalIndex >= 0" @confirm="confirmDel" @cancel="cacelDel" :showCancelButton="true" title="确认删除?"></u-modal>
<people-selector :defaultChecked="peopleSelectOption.defaultChecked" :show="peopleSelectOption.showSelector" @select="handleSelectorPeople" @close="peopleSelectOption.showSelector = false">
</people-selector>
<u-datetime-picker :show="dateTimePickerInfo.showCheckDate" v-model='dateTimePickerInfo.defaultDateTime' @confirm="handleCheckDate" @close="dateTimePickerInfo.showCheckDate = false"
@cancel="dateTimePickerInfo.showCheckDate = false" :mode="dateTimePickerInfo.mode"></u-datetime-picker>
<query-selector :show="showPopupMonitor" :total="curTotalMonitor" :lists="monitorLists" :defaultValue="currentOperateMonitor.NAME" @close="handleClosePopupMonitor" @search="handleSearchMonitor"
@select="handleSelectedMonitor" />
</view>
</view>
</template>
<script>
import {
extendFilterGroup,
extendGroupRule,
extendInclude,
extendOrder,
extendRule,
extendIgnoreDataRule,
guid,
initFilter,
initFilterGroup
} from '../../../../utils/common'
import {
FMProductionUnit,
CheckPeriods,
CheckLevels,
MineTypeIndex,
MineTypeName
} from '../../../../utils/enums.js'
import {
getRequest,
getRequestOrderPage
} from '../../../../services/apply/FOServices/FOServices';
import stepTitle from '@/components/custom/step-title.vue'
import swipeActionItem from '../../../../uni_modules/uview-ui/libs/config/props/swipeActionItem';
import {
getEnum
} from '../../../../services/common';
export default {
components: {
stepTitle,
},
data() {
return {
showDelModalIndex: undefined,
showDelModalIndex1: undefined,
subsectionList: ['无隐患', '有隐患', '不涉及'],
isMultiple: false,
defaultChecked: [],
RiskLevel: ['一般', '重大'],
showPopupUnit: false,
UnitDefaultIndex: [0],
RiskLevelDefaultIndex: [0],
UnitLists: [],
showPopupRiskLevel: false,
TypeLists: [],
showPopupType: false,
TypeDefaultIndex: [0],
PeriodLists: [],
showPopupPeriod: false,
PeriodDefaultIndex: [0],
LevelLists: [],
showPopupStep: false,
showPopupLevel: false,
curTotalStep: 0,
stepLists: [],
LevelDefaultIndex: [0],
showPopupDate: false,
listPropUpload: ['NOTIFY_ID'],
listPropValUpload: [],
ORG_ID: uni.getStorageSync('orgId'),
checkListData: {},
monitorLists: [],
currentOperateMonitor: {},
showPopupMonitor: false,
curTotalMonitor: 0,
model: {
Nav_ApplyUser: {
NAME: ''
},
Nav_ApplyDepartment: {
NAME: ''
},
Nav_ProductionUnit: {
NAME: ''
},
Nav_OperationStep: {
NAME: ''
},
Nav_FireDepartment: {
NAME: ''
},
Nav_FireUser: {
NAME: ''
},
Nav_SafeUser: {
NAME: ''
},
Nav_Area: {
NAME: ''
},
Nav_Type: {
NAME: ''
},
IS_HOLIDAY: false,
IS_HOLIDAYName: '否',
EVALUATE_LEVEL: '',
EVALUATE_LEVELName: '',
JOB_LOCATION: '',
JOB_CONTENT: '',
JOB_DATE: '',
JOB_END_DATE: '',
Nav_Users: [],
Nav_Risks: [],
Nav_Details: [],
Nav_Files: []
},
peopleSelectOption: {
showSelector: false,
value: null,
index: 0,
defaultChecked: []
},
dateTimePickerInfo: {
showCheckDate: false,
dataIndex: undefined,
defaultDateTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'),
value: '',
name: '',
mode: ''
},
selectorInfo: {
name: 'user',
isMultiple: false,
showPopup: false,
totalCount: 0,
title: '考核结果选择',
itemData: {},
dataItem: {},
index: 0,
columns: [],
dataLists: [],
defaultText: '',
defaultChecked: []
},
comPickerInfo: {
showSheet: false,
dataItem: {},
columns: [],
title: '',
dataIndex: undefined,
formIndex: undefined,
name: ''
},
dateTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM'),
stepsText: ['发起', '归档'],
stepsPage: 0,
stepsPageList: 0,
Pu: '',
Check_Type_ID: '',
TypeListres: {},
TaskID: '',
poparr: '',
currentOperateStep: {},
chooseCheckContent: '',
chooseCheckArea: '',
currentOperateArea: {},
areaLists: [],
curTotalArea: 0,
showPopupArea: false,
nowIndex: {},
nowName: '',
newCheckList: false,
stepLoad: true,
enumsData: {}, //
enumsText: {} //
}
},
onLoad(option) {
this.TaskID = option.taskID ? option.taskID : '';
this.model.ID = option.ID ? option.ID : '';
this.ID = option.ID ? option.ID : '';
this.loadData();
},
methods: {
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
} else {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "")
extendRule(json, 'ID', 1, this.ID);
extendInclude(json, 'Nav_JoinDepartment.Nav_Department');
extendInclude(json, 'Nav_JoinDepartment');
extendInclude(json, 'Nav_Points');
extendInclude(json, 'Nav_Points.Nav_Point');
extendInclude(json, 'Nav_LaunchUser');
extendIgnoreDataRule(json)
// extendInclude(json, 'Nav_Details.Nav_DetailContents.Nav_Question');
getRequest(json, "/SE/SafeSurvey/Get").then(res => {
this.stepLoad = false
this.model = res;
this.model.ID = this.ID
})
}
},
stepAdd() {
const isBlank = (value) => {
return typeof value !== 'string' || value.trim() === '';
};
if (isBlank(this.model.Nav_OperationStep.NAME) ||
isBlank(this.model.Nav_FireDepartment.NAME) ||
isBlank(this.model.Nav_FireUser.NAME) ||
isBlank(this.model.Nav_SafeUser.NAME) ||
isBlank(this.model.JOB_DATE) ||
isBlank(this.model.JOB_END_DATE)) {
uni.$showErrorInfo('请检查必填项,必填项不能为空')
} else {
this.stepsPageList = this.stepsPageList + 1
}
},
async handleShowSheet(p) {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "", 0, p.pageIndex ?? 1)
// const json = initFilter(this.ORG_ID, "", "", 0, p.pageIndex ?? 1)
let dataSelect = []
var defaultChecked = []
this.selectorInfo.isMultiple = false
if (p.val) {
extendRule(json, 'NAME', 9, p.val);
}
json.Limit = 20
if (p.pageIndex) {
json.Start = (p.pageIndex - 1) * json.Limit;
}
json.Sort = 'NAME'
if (p.name == 'Nav_JoinDepartment') {
this.selectorInfo.isMultiple = true
extendRule(json, 'ENABLE_STATUS', 1, '0')
dataSelect = await getRequestOrderPage(json, "/FM/Department/OrderPaged").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
}
} else {
uni.showToast({
title: '暂无信息',
icon: 'none'
})
}
return res.Data
})
if (this.model.Nav_JoinDepartment && this.model.Nav_JoinDepartment.length > 0 && this.model.Nav_JoinDepartment[0]
.Nav_Department != null) {
// this.selectorInfo.defaultChecked = []
this.model.Nav_JoinDepartment.forEach(e => {
defaultChecked.push(e.Nav_Department)
})
} else {
defaultChecked = null
}
} else if (p.name == 'Nav_Points') {
this.selectorInfo.isMultiple = true
extendRule(json, 'TYPE', 1, '1')
dataSelect = await getRequestOrderPage(json, "/SE/TestEnumPoint/OrderPaged").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
}
} else {
uni.showToast({
title: '暂无信息',
icon: 'none'
})
}
return res.Data
})
if (this.model.Nav_Points && this.model.Nav_Points.length > 0 && this.model.Nav_Points[0]
.Nav_Point != null) {
// this.selectorInfo.defaultChecked = []
this.model.Nav_Points.forEach(e => {
defaultChecked.push(e.Nav_Point)
})
} else {
defaultChecked = null
}
}
if (defaultChecked == null)
defaultChecked = []
if (dataSelect.length) {
this.selectorInfo = {
itemData: p.itemData != undefined ? p.itemData : this.selectorInfo
.itemData, //itemData: p.itemData, p.itemData this.selectorInfo.itemData
isMultiple: this.selectorInfo.isMultiple,
totalCount: this.selectorInfo.totalCount,
showPopup: true,
title: p.title,
name: p.name,
dataLists: dataSelect,
defaultChecked: defaultChecked,
index: p.index
}
} else {
//
}
},
//
handleSearch(val, pageIndex) {
var p = {
name: this.selectorInfo.name,
title: this.selectorInfo.title,
val: val,
pageIndex: pageIndex,
itemData: this.selectorInfo.itemData
}
this.handleShowSheet(p)
},
handleSelected(e) {
this.selectorInfo.showPopup = false
if (this.selectorInfo.name == 'Nav_JoinDepartment') {
let listArea = []
if (e.length > 0) {
e.forEach((item, i) => {
if (item.name != null || item.NAME != null) {
listArea.push({
ID: guid(),
SAFE_ID: this.model.ID,
DEPARTMENT_ID: item.ID,
ORG_ID: item.ORG_ID,
Nav_Department: item
})
}
})
}
this.model.Nav_JoinDepartment = listArea
// this.model.RiskAreaNAME = areaShow
} else if (this.selectorInfo.name == 'Nav_Points') {
let listArea = []
if (e.length > 0) {
e.forEach((item, i) => {
if (item.name != null || item.NAME != null) {
listArea.push({
ID: guid(),
SAFE_ID: this.model.ID,
POINT_ID: item.ID,
ORG_ID: item.ORG_ID,
Nav_Point: item
})
}
})
}
this.model.Nav_Points = listArea
}
},
showCheckDate(dataIndex, item) {
this.dateTimePickerInfo = {
showCheckDate: true,
defaultDateTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'),
dataIndex: dataIndex,
item: item,
mode: 'datetime'
}
},
//
handleCheckDate(e) {
if (this.dateTimePickerInfo.dataIndex == 1) {
this.model.END_TIME = uni.$u.timeFormat(e.value,
'yyyy-mm-dd hh:MM:ss')
}
this.dateTimePickerInfo.showCheckDate = false
},
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_Risks&&this.model.Nav_Risks.length>0){
this.model.Nav_Risks.map(item=>{
delete item.Nav_Risk
})
}
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.TaskID == null || this.TaskID == '') {
this.modelEdit.TaskID = '00000000-0000-0000-0000-000000000000'
} else {
this.modelEdit.TaskID = this.TaskID
}
if (this.modelEdit.ORG_ID == null || this.modelEdit.ORG_ID == '')
this.modelEdit.ORG_ID = this.ORG_ID
this.modelEdit.PUBLISH = 'SaveAndNotify'
getRequest(this.modelEdit, "/SE/SESafeSurvey/FullUpdate").then(res => {
if (res) {
uni.$showMsgFunc('操作成功!', () => {
uni.navigateBack()
}, 'success', 1000)
}
})
}
}
}
</script>
<style scoped>
@import url("../../../../style/css/newTemplate.css");
</style>

View File

@ -0,0 +1,349 @@
<template>
<view class="risk-record-page">
<u-sticky>
<view class="filter-bar">
<view class="filter filter-date-range" @click="handleShowPicker({title: '时间区间', name: 'dateRange'})">
<text>{{dateFilterTxt}}</text>
<u-icon size="14" style="margin-left: 4px;" name="arrow-down"></u-icon>
</view>
<uni-search-bar class="search-bar" radius="100" v-model="keyword" @confirm="handleSearch" @cancel="handleCancelSearch" @clear="handleCancelSearch" placeholder="搜索" cancel-button="none">
<uni-icons slot="searchIcon" color="#999999" size="16" type="search" class="search-slot" />
</uni-search-bar>
<view class="filter filter-status" @click="handleShowPicker({title: '状态', name: 'status'})">
<text>{{statusFilterTxt}}</text>
<u-icon size="14" style="margin-left: 4px;" name="arrow-down"></u-icon>
</view>
</view>
</u-sticky>
<view class="main">
<view class="content-list">
<common-card :dataSource="item" v-for="item in lists" class="content" @click="showDetail(item.ID)">
<view>
<view class="field">
<text class="label">发起人</text>
<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>
</view>
<view class="field">
<text class="label">培训开始时间</text>
<text class="value">{{item.TRAIN_START_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>
</view>
<view class="field">
<text class="label">状态</text>
<text class="value">{{item.STATUS}}</text>
</view>
</view>
</common-card>
</view>
<view v-if="!lists.length" class="empty-wrap">
<u-empty text="暂无数据" icon="/static/empty@2x.png">
</u-empty>
</view>
</view>
<u-picker :show="comPickerInfo.showPicker" :columns="comPickerInfo.columns" @confirm="onConfirmPicker" :defaultIndex="[0]" @cancel="closePicker"></u-picker>
</view>
</template>
<script>
import {
getRequestOrderPage
} from '../../../../services/apply/FOServices/FOServices.js'
import {
extendInclude,
extendRule,
initFilter
} from '../../../../utils/common'
import {
getEnum
} from '../../../../services/common';
export default {
data() {
return {
pageIndex: 1,
total: 0,
lists: [],
keyword: '',
searchStartTime: '',
filterStatus: null,
dateFilterTxt: '时间区间',
statusFilterTxt: '状态筛选',
comPickerInfo: {
showPicker: false,
columns: [],
title: '',
name: ''
},
enumsData: {}, //
enumsText: {} //
}
},
onLoad() {
this.fetchEnums(['SETrainNotifyStatus','PlanCheckType']);
},
methods: {
async fetchEnums(enumNames) {
try {
// Promise
const enumPromises = enumNames.map(name => {
return getEnum({
name
}).then(res => {
// name/code便
return {
enumName: name,
data: res.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'
});
}
},
handleSearch(obj) {
this.keyword = obj.value
},
handleCancelSearch() {
this.keyword = ''
},
loadData() {
const orgId = uni.getStorageSync('orgId')
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)
}
if (this.filterStatus !== null) {
extendRule(json, 'STATUS', 1, this.filterStatus)
}
getRequestOrderPage(json, "/SE/TrainNotify/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 : '',
}
})
if (this.pageIndex !== 1) {
this.lists = this.lists.concat(newRes)
} else {
this.lists = newRes
}
})
},
showDetail(id) {
uni.navigateTo({
url: '/pages/apply/subPages/SE/1trainNotifyShow?ID=' + id
})
},
handleShowPicker(p) {
let column = []
if (p.name === 'dateRange') {
column = ['全部', '当天', '最近三天', '最近一周', '最近一月']
}
if (p.name === 'status') {
column = this.enumsText['SETrainNotifyStatus']
}
this.comPickerInfo = {
showPicker: true,
title: p.title,
name: p.name,
columns: [column]
}
},
onConfirmPicker(e) {
if (this.comPickerInfo.name === 'dateRange') {
let currentDate = new Date();
if (e.indexs[0] === 2) {
currentDate.setDate(currentDate.getDate() - 3);
} else if (e.indexs[0] === 3) {
currentDate.setDate(currentDate.getDate() - 7);
} else if (e.indexs[0] === 4) {
currentDate.setDate(currentDate.getMonth());
}
if (e.indexs[0] === 0) {
this.searchStartTime = ''
this.dateFilterTxt = '时间区间'
} else {
this.dateFilterTxt = e.value[0]
this.searchStartTime = uni.$u.timeFormat(currentDate, 'yyyy-mm-dd 00:00:00');
}
}
if (this.comPickerInfo.name === 'status') {
this.filterStatus = this.enumsData['SETrainNotifyStatus'][e.indexs[0]].code
this.statusFilterTxt = e.value[0]
}
this.closePicker()
},
closePicker() {
this.comPickerInfo = {
showPicker: false,
columns: [],
title: '',
name: ''
}
},
},
onReachBottom() {
// +1
if (this.total > 10 * this.pageIndex)
this.pageIndex++
},
watch: {
pageIndex(n, o) {
this.loadData()
},
keyword(n, o) {
this.pageIndex = 1
this.keyword = n
this.loadData()
},
searchStartTime(n, o) {
this.pageIndex = 1
this.searchStartTime = n
this.loadData()
},
filterStatus(n, o) {
this.pageIndex = 1
this.filterStatus = n
this.loadData()
}
}
}
</script>
<style>
.risk-record-page {
position: relative;
}
.risk-record-page .main {
padding: 0px 16px;
position: relative;
}
.risk-record-page>>>.uni-searchbar {
padding: 0px;
display: flex;
align-items: center;
font-size: 12px;
.uni-searchbar__box {
height: 30px;
}
.uni-searchbar__box-icon-clear {
display: flex;
align-items: center;
}
.uni-input-placeholder {}
.uni-searchbar__box-search-input {
font-size: 12px;
}
.uni-searchbar__text-placeholder {
font-size: 12px;
margin-left: 0px;
}
.uni-text {
font-size: 12px;
}
}
.filter-bar .search-bar {
margin-left: 20px;
margin-right: 20px;
width: 100%;
display: flex;
flex: 1;
align-items: center;
font-size: 12px;
}
.filter-bar {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #ffffff;
padding: 10px 16px 10px 16px;
box-shadow: 0px 0px 5px 0px #eaedf4;
}
.filter-bar .filter {
display: flex;
align-items: center;
font-size: 12px;
line-height: 18px;
color: #333;
}
.content-list {
padding: 10px 0;
}
.content .field {
font-size: 12px;
line-height: 18px;
margin-bottom: 4px;
}
.content .field .label {
color: #666;
}
.content .field .value {
color: #333333;
}
.status {
background-color: rgba(5, 109, 232, 0.1);
color: #056DE8;
padding: 0px 5px 0px 5px;
border-radius: 5px;
}
</style>

View File

@ -0,0 +1,333 @@
<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>
<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>
</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>
</view>
</template>
<script>
import {
initFilter,
extendRule,
extendInclude
} from '../../../../utils/common'
import {
getRequest,
} from '../../../../services/apply/FOServices/FOServices'
import '../../../../utils/showMsg.js'
import color from '../../../../uni_modules/uview-ui/libs/config/color'
import config from '../../../../config/common'
import {
getEnum
} from '../../../../services/common';
export default {
data() {
return {
model: {},
TaskID: "",
tableKey: '0',
isLoadOK: false,
paddingBottom: '170',
LEAVE_REASON: '',
users: '',
orgId: uni.getStorageSync('orgId'),
listPropUpload: ['NOTIFY_ID'],
listPropValUpload: [],
Lists: [],
}
},
onLoad(option) {
this.model.ID = option.ID;
this.TaskID = option.taskID;
this.tableKey = option.tableKey ? option.tableKey : '0'
this.getEnums()
},
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;
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 '公司 ';
}
},
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)
}
})
}
},
computed: {
}
}
</script>
<style>
/* @import url("@/style/css/editTemplate.css"); */
.background {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
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;
line-height: 22px;
padding: 8px 0px;
}
.btn-wrap {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
padding: 16px;
z-index: 1000;
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;
}
.buttons {
margin-top: 10px;
display: flex;
justify-content: space-between;
}
.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;
}
</style>