322 lines
9.8 KiB
Vue
322 lines
9.8 KiB
Vue
|
|
<template>
|
||
|
|
<view class="page-wrap">
|
||
|
|
<view class="card">
|
||
|
|
<uni-card margin="0" :is-shadow="true">
|
||
|
|
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="dataModel"
|
||
|
|
ref="wForm" errorType="border-bottom">
|
||
|
|
|
||
|
|
<u-form-item label="监测时间" prop="SET_TIME" borderBottom>
|
||
|
|
<u--input v-model="dataModel.SET_TIME" disabled disabledColor="#ffffff" placeholder="请输入监测时间" border="none" inputAlign="right">
|
||
|
|
</u--input>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="监测部门" prop="DepartmentName" borderBottom>
|
||
|
|
<u--input v-model="dataModel.Nav_Department.NAME" disabled disabledColor="#ffffff" placeholder="请输入监测部门" border="none"
|
||
|
|
inputAlign="right"></u--input>
|
||
|
|
</u-form-item>
|
||
|
|
<!-- <u-form-item label="监测人员" prop="UserName" borderBottom>
|
||
|
|
<u--input v-model="dataModel.Nav_User.NAME" disabled disabledColor="#ffffff" placeholder="请输入监测人员" border="none"
|
||
|
|
inputAlign="right"></u--input>
|
||
|
|
</u-form-item> -->
|
||
|
|
<u-form-item label="年度" prop="YEAR" borderBottom>
|
||
|
|
<u--input v-model="dataModel.YEAR" disabled disabledColor="#ffffff" placeholder="请输入年度" border="none" inputAlign="right">
|
||
|
|
</u--input>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="部门层级" prop="DEPARTMENT_TYPE_SHOW" borderBottom>
|
||
|
|
<u--input v-model="dataModel.DEPARTMENT_TYPE_SHOW" disabled disabledColor="#ffffff" placeholder="请输入部门层级" border="none" inputAlign="right">
|
||
|
|
</u--input>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="监测周期" prop="ASSESSMENT_CYCLE_SHOW" borderBottom>
|
||
|
|
<u--input v-model="dataModel.ASSESSMENT_CYCLE_SHOW" disabled disabledColor="#ffffff" placeholder="请输入部门层级" border="none" inputAlign="right">
|
||
|
|
</u--input>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="监测人员" prop="Users" borderBottom>
|
||
|
|
</u-form-item>
|
||
|
|
<u--textarea autoHeight type="textarea" v-html="dataModel.Users" border="none"
|
||
|
|
inputAlign="left">
|
||
|
|
</u--textarea>
|
||
|
|
</u--form>
|
||
|
|
</uni-card>
|
||
|
|
</view>
|
||
|
|
|
||
|
|
<u-sticky offset-top="20">
|
||
|
|
<view class="sub-form">
|
||
|
|
<uni-collapse :border="false" accordion>
|
||
|
|
<uni-card margin="0" spacing="0" padding="0" :is-shadow="true">
|
||
|
|
<uni-collapse-item title="考核明细">
|
||
|
|
<view class="sub-form-wrap" style="height: 500px; overflow: auto">
|
||
|
|
<u--form labelPosition="left" labelWidth="auto" labelAlign="center"
|
||
|
|
:model="subDataModel" ref="sForm2" errorType="border-bottom">
|
||
|
|
<!-- <u-swipe-action> -->
|
||
|
|
<view style="margin-bottom: 16px;"
|
||
|
|
v-for="(item, index) in dataModel.Nav_Details">
|
||
|
|
<uni-card margin="0" spacing="0" :is-shadow="false"
|
||
|
|
style="margin-bottom: 10px;">
|
||
|
|
<u-form-item label="被考核组织" prop="ChildDepartName" borderBottom>
|
||
|
|
<u--input disabled disabledColor="#fff" v-model="item['Nav_Department'].NAME"
|
||
|
|
border="none" inputAlign="right"></u--input>
|
||
|
|
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="被考核人员" prop="ChildUserName" borderBottom>
|
||
|
|
<u--input disabled disabledColor="#fff" v-model="item['Nav_User'].NAME"
|
||
|
|
border="none" inputAlign="right"></u--input>
|
||
|
|
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="安全生产目标与指标" prop="UserNames" borderBottom>
|
||
|
|
</u-form-item>
|
||
|
|
<u--textarea autoHeight type="textarea" v-html="item.UserNames" border="none"
|
||
|
|
inputAlign="left">
|
||
|
|
</u--textarea>
|
||
|
|
</uni-card>
|
||
|
|
</view>
|
||
|
|
<!-- </u-swipe-action> -->
|
||
|
|
</u--form>
|
||
|
|
</view>
|
||
|
|
</uni-collapse-item>
|
||
|
|
</uni-card>
|
||
|
|
</uni-collapse>
|
||
|
|
</view>
|
||
|
|
</u-sticky>
|
||
|
|
<check-action v-if="isLoadOK && tableKey === '1'&&isAudit==='true' " :okApi="okApi" :refuseApi="refuseApi"
|
||
|
|
:dataSource="$store.state.auditModel"></check-action>
|
||
|
|
<view class="bottom-button">
|
||
|
|
<button type="primary" class="bottom" v-if="isConfirm" @click="onTableBtnAgree">确认</button>
|
||
|
|
<button type="primary" class="bottom" v-if="isConfirmTwo" @click="onTableBtnAgreeTwo">已阅</button>
|
||
|
|
</view>
|
||
|
|
<!-- <query-selector :show="showPopup" :lists="userLists" :defaultValue="currentOperateUser.NAME"
|
||
|
|
@close="handleClosePopup" @search="handleSearchUser" @select="handleSelectedUser" />
|
||
|
|
<u-picker :show="comPickerInfo.showSheet" :columns="comPickerInfo.columns" @confirm="onConfirmPicker"
|
||
|
|
@close="closePicker" @cancel="closePicker" keyName="NAME"></u-picker>
|
||
|
|
<view class="bottom-button">
|
||
|
|
<button type="primary" @click="submit">提交</button>
|
||
|
|
</view> -->
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import {
|
||
|
|
mapState,
|
||
|
|
mapMutations
|
||
|
|
} from 'vuex'
|
||
|
|
import {
|
||
|
|
extendFilterGroup,
|
||
|
|
extendGroupRule,
|
||
|
|
extendInclude,
|
||
|
|
extendOrder,
|
||
|
|
extendRule,
|
||
|
|
guid,
|
||
|
|
initFilter,
|
||
|
|
initFilterGroup,
|
||
|
|
extendIgnoreDataRule
|
||
|
|
} from '../../../../utils/common'
|
||
|
|
import {
|
||
|
|
getRequest,
|
||
|
|
getmonitorAssessmentSign,
|
||
|
|
getmonitorAssessmentSignTwo
|
||
|
|
} from '../../../../services/apply/subPages/SCPT/PTServices'
|
||
|
|
import config from '../../../../config/common'
|
||
|
|
|
||
|
|
export default {
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
ID:'',
|
||
|
|
TaskID: '',
|
||
|
|
tableKey:0,
|
||
|
|
isLoadOK :false,
|
||
|
|
isConfirm :false,
|
||
|
|
isConfirmTwo :false,
|
||
|
|
userLists: [],
|
||
|
|
okApi: '',
|
||
|
|
refuseApi: '',
|
||
|
|
ApproveID: '',
|
||
|
|
isAudit: false,
|
||
|
|
dataModel: {
|
||
|
|
Nav_Department:{NAME:''},
|
||
|
|
Nav_User:{NAME:''},
|
||
|
|
// Nav_Collects:{
|
||
|
|
// Nav_Collect:{
|
||
|
|
// NAME:''
|
||
|
|
// }
|
||
|
|
// },
|
||
|
|
},
|
||
|
|
subDataModel: {
|
||
|
|
},
|
||
|
|
options: [{
|
||
|
|
text: '删除',
|
||
|
|
style: {
|
||
|
|
backgroundColor: '#f56c6c'
|
||
|
|
}
|
||
|
|
}],
|
||
|
|
comPickerInfo: {
|
||
|
|
showSheet: false,
|
||
|
|
columns: [],
|
||
|
|
title: '',
|
||
|
|
dataIndex: undefined,
|
||
|
|
formIndex: undefined,
|
||
|
|
name: ''
|
||
|
|
},
|
||
|
|
currentOperateUser: {},
|
||
|
|
showPopup: false,
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onLoad(opt) {
|
||
|
|
this.handleGetTechGet(opt)
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
handleGetTechGet(opt) {
|
||
|
|
this.TaskID = opt.taskID ? opt.taskID : '';
|
||
|
|
this.ID = opt.ID ? opt.ID : '';
|
||
|
|
this.tableKey = opt.tableKey ? opt.tableKey : '0'
|
||
|
|
this.okApi = opt.okApi
|
||
|
|
this.refuseApi = opt.refuseApi
|
||
|
|
this.ApproveID = opt.ApproveID
|
||
|
|
this.isAudit = opt.isAudit
|
||
|
|
this.auditModel = {
|
||
|
|
...this.$store.state.auditModel,
|
||
|
|
TaskID: opt.taskID ? opt.taskID : ''
|
||
|
|
}
|
||
|
|
const orgId = uni.getStorageSync('orgId')
|
||
|
|
const json = initFilter(orgId, "", "")
|
||
|
|
extendRule(json, 'ID', 1, opt.ID)
|
||
|
|
// TODO: id 未获取
|
||
|
|
getRequest(json,"/PT/PTMonitorAssessment/GetEdit").then(res => {
|
||
|
|
this.dataModel = res
|
||
|
|
if(res.DEPARTMENT_TYPE == 0)
|
||
|
|
{
|
||
|
|
res.DEPARTMENT_TYPE_SHOW = '部门'
|
||
|
|
}else if(res.DEPARTMENT_TYPE == 1)
|
||
|
|
{
|
||
|
|
res.DEPARTMENT_TYPE_SHOW = '车间'
|
||
|
|
}else if(res.DEPARTMENT_TYPE == 2)
|
||
|
|
{
|
||
|
|
res.DEPARTMENT_TYPE_SHOW = '班组'
|
||
|
|
}else{
|
||
|
|
res.DEPARTMENT_TYPE_SHOW = '公司'
|
||
|
|
}
|
||
|
|
if(res.ASSESSMENT_CYCLE == 10)
|
||
|
|
{
|
||
|
|
res.ASSESSMENT_CYCLE_SHOW = '年度'
|
||
|
|
}else if(res.ASSESSMENT_CYCLE == 20)
|
||
|
|
{
|
||
|
|
res.ASSESSMENT_CYCLE_SHOW = '季度'
|
||
|
|
}else if(res.ASSESSMENT_CYCLE == 30)
|
||
|
|
{
|
||
|
|
res.ASSESSMENT_CYCLE_SHOW = '月度'
|
||
|
|
}else{
|
||
|
|
res.ASSESSMENT_CYCLE_SHOW = '请选择'
|
||
|
|
}
|
||
|
|
//数据组装
|
||
|
|
if(res.STATUS == 10)
|
||
|
|
{
|
||
|
|
this.isConfirm = true;
|
||
|
|
this.isConfirmTwo = false;
|
||
|
|
}
|
||
|
|
else if(res.STATUS == 30)
|
||
|
|
{
|
||
|
|
this.isConfirm = false;
|
||
|
|
this.isConfirmTwo = true;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
this.isConfirm = false;
|
||
|
|
this.isConfirmTwo = false;
|
||
|
|
}
|
||
|
|
if (res.Nav_Details && res.Nav_Details.length > 0) {
|
||
|
|
for (let i = 0; i < res.Nav_Details.length; i++) {
|
||
|
|
let strconfirmFiles = ''
|
||
|
|
let details=res.Nav_Details[i];
|
||
|
|
if (details.Nav_Contents && details.Nav_Contents.length > 0) {
|
||
|
|
for (let j = 0; j < details.Nav_Contents.length; j++) {
|
||
|
|
let depart=details.Nav_Contents[j].NAME;
|
||
|
|
strconfirmFiles += (strconfirmFiles.length > 0 ? "</br>" : "") + depart;
|
||
|
|
details.UserNames = strconfirmFiles
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if(details.USER_ID ==null)
|
||
|
|
{
|
||
|
|
details.Nav_User ={}
|
||
|
|
}
|
||
|
|
if(details.DEPARTMENT_ID ==null)
|
||
|
|
{
|
||
|
|
details.Nav_Department ={}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
let strUserName = ''
|
||
|
|
if (res.Nav_MonitorUser && res.Nav_MonitorUser.length > 0) {
|
||
|
|
for (let i = 0; i < res.Nav_MonitorUser.length; i++) {
|
||
|
|
if (res.Nav_MonitorUser[i].DEAL_STATUS == 0) {
|
||
|
|
strUserName += (strUserName.length > 0 ? " " : "") + "<text style='color:red'>" +
|
||
|
|
res.Nav_MonitorUser[i].Nav_User.NAME + "</text>";
|
||
|
|
} else {
|
||
|
|
strUserName += (strUserName.length > 0 ? " " : "") + res.Nav_MonitorUser[
|
||
|
|
i].Nav_User.NAME;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
this.dataModel.Users = strUserName
|
||
|
|
this.isLoadOK = true
|
||
|
|
})
|
||
|
|
},
|
||
|
|
onTableBtnAgree() {
|
||
|
|
this.dataModel.ID = this.ID;
|
||
|
|
this.dataModel.TaskID = this.TaskID;
|
||
|
|
this.dataModel.ORG_ID =uni.getStorageSync('orgId')
|
||
|
|
getmonitorAssessmentSign(this.dataModel).then(res => {
|
||
|
|
uni.$showMsgFunc('操作成功!', () => {
|
||
|
|
uni.navigateBack()
|
||
|
|
}, 'success', 1000)
|
||
|
|
})
|
||
|
|
|
||
|
|
},
|
||
|
|
onTableBtnAgreeTwo() {
|
||
|
|
this.dataModel.ID = this.ID;
|
||
|
|
this.dataModel.TaskID = this.TaskID;
|
||
|
|
this.dataModel.ORG_ID =uni.getStorageSync('orgId')
|
||
|
|
getmonitorAssessmentSignTwo(this.dataModel).then(res => {
|
||
|
|
uni.$showMsgFunc('操作成功!', () => {
|
||
|
|
uni.navigateBack()
|
||
|
|
}, 'success', 1000)
|
||
|
|
})
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style scoped>
|
||
|
|
.page-wrap {
|
||
|
|
padding: 16px 16px 166px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.card {
|
||
|
|
margin-bottom: 18px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.sub-form {
|
||
|
|
margin-bottom: 16px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.bottom-button {
|
||
|
|
position: fixed;
|
||
|
|
bottom: 0;
|
||
|
|
left: 0;
|
||
|
|
width: 100%;
|
||
|
|
padding: 10px 16px;
|
||
|
|
box-sizing: border-box;
|
||
|
|
background: #fff;
|
||
|
|
z-index: 999;
|
||
|
|
}
|
||
|
|
|
||
|
|
.upload-title {
|
||
|
|
color: #303133;
|
||
|
|
font-size: 15px;
|
||
|
|
line-height: 22px;
|
||
|
|
padding: 8px 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.page-wrap>>>.u-upload__button {
|
||
|
|
margin-bottom: 0;
|
||
|
|
}
|
||
|
|
</style>
|