lm-safe-app/pages/apply/subPages/FO2/jobEventShow.vue

705 lines
21 KiB
Vue
Raw Permalink Normal View History

2024-06-03 09:37:52 +08:00
<template>
<view class="page">
<view class="page-wrap">
<view class="card">
<uni-card margin="0" :is-shadow="true">
<view>
<view class="table-record">
<view class="table-left">编号</view>
<view>{{dataModel.CODE}}</view>
</view>
<view class="table-record">
<view class="table-left">作业名称</view>
<view>{{dataModel.Nav_OperationStep.NAME}}</view>
</view>
<view class="table-record">
<view class="table-left">作业地点</view>
<view>{{dataModel.JOB_LOCATION}}</view>
</view>
<view class="table-record">
<view class="table-left">开始时间</view>
<view v-html="dataModel.JOB_START_DATE"></view>
</view>
<view class="table-record">
<view class="table-left">结束时间</view>
<view v-html="dataModel.JOB_END_DATE"></view>
</view>
<view class="table-record-noborder">
<view class="table-left">作业人员</view>
<view v-html="dataModel.UserNames"></view>
</view>
</view>
</uni-card>
</view>
<u-sticky offset-top="0">
<view class="tabs-title" id="tabs-title" :style="{margin:isTop==true?'0px':'16px'}">
<view style="margin-right: 10px;margin-left: 10px;">
<u-tabs ref="tabs" :activeStyle="{
fontWeight: 'bold',
transform: 'scale(1)',
fontSize:'14px',
color:'#005BEA'
}" :inactiveStyle="{
transform: 'scale(1)',
fontSize:'14px',
}" :list="list" lineColor="#005BEA" :is-scroll="true" :current="currentIndex" @change="change">
<view class="icon-tabs" slot="right" @tap="changeIndex">
<u-icon size="14" name="arrow-right" bold></u-icon>
</view>
</u-tabs>
</view>
</view>
</u-sticky>
<view v-if="currentIndex===0" class="uni-card-bottom">
<!-- <view v-for="(item, index) in dataModel.Nav_Details" class="uni-card">
<uni-card margin="0" :is-shadow="true" padding="0px">
<view class="uni-card-content">
<view class="table-record">
<view class="table-left">顺序</view>
<view>{{item.NUM}}</view>
</view>
<view class="table-record-column table-bottom">
<view class="table-left">名称</view>
<view class="table-right">{{item.SafeConfirmsStr}}</view>
</view>
<view class="table-record">
<view class="table-left">是否确认</view>
<view>{{item.IS_CONFIRM}}</view>
</view>
<view class="table-record-column">
<view class="table-left">附件</view>
<view class="link-content">
<view class="link-content-border" v-for="itemChild in item.confirmFiles">
<u-link fontSize="12" :href="itemChild.url" :text="itemChild.name"
color="#005BEA">
</u-link>
</view>
</view>
</view>
</view>
</uni-card>
</view> -->
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" errorType="border-bottom"
ref="sForm">
<u-collapse :border="false" accordion>
<uni-card style="margin: 0px 16px 16px 16px;padding: 10px 0px;" margin="0" spacing="0" :is-shadow="false" padding="0"
v-for="(item, index) in dataModel.Nav_Details">
<u-collapse-item title-border="none" :show-arrow="false" class="collapse-influ">
<view slot="title" class="collapse-title">
<!-- <view class="down">
<uni-icons type="bottom"></uni-icons>
</view> -->
<view class="text-num">{{item.NUM+ '. '}}</view>
<view class="text">{{item.SafeConfirmsStr}}</view>
</view>
<u-form-item label="是否确认" prop="IS_CONFIRM" borderBottom>
<u--input disabled disabledColor="#fff"
v-model="item.IS_CONFIRM"
border="none"
inputAlign="right"></u--input>
<!-- <u-icon style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon> -->
</u-form-item>
<u-form-item label="附件" prop="flowFiles" borderBottom>
<view class="link-content">
<view class="link-content-border" v-for="itemChild in item.confirmFiles">
<u-link :href="itemChild.url" :text="itemChild.name"
color="#005BEA">
</u-link>
</view>
</view>
<!-- <u-icon style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon> -->
</u-form-item>
<!-- <view class="table-record-column">
<view class="table-left">附件</view>
<view class="link-content">
<view class="link-content-border" v-for="itemChild in item.flowFiles">
<u-link fontSize="12" :href="itemChild.url" :text="itemChild.name"
color="#005BEA">
</u-link>
</view>
</view>
</view> -->
</u-collapse-item>
</uni-card>
</u-collapse>
</u--form>
</view>
<view v-if="currentIndex===1" class="uni-card-bottom">
<!-- <view v-for="(item, index) in dataModel.Nav_Flow" class="uni-card"> -->
<!-- <uni-card margin="0" :is-shadow="true"> -->
<!-- <view>
<view class="table-record">
<view class="table-left">顺序</view>
<view>{{item.NUM}}</view>
</view>
<view class="table-record-column table-bottom">
<view class="table-left">名称</view>
<view class="table-right">{{item.SafeMeasuresStr}}</view>
</view>
<view class="table-record">
<view class="table-left">是否确认</view>
<view>{{item.IS_CONFIRM}}</view>
</view>
<view class="table-record-column">
<view class="table-left">附件</view>
<view class="link-content">
<view class="link-content-border" v-for="itemChild in item.flowFiles">
<u-link fontSize="12" :href="itemChild.url" :text="itemChild.name"
color="#005BEA">
</u-link>
</view>
</view>
</view>
</view> -->
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" errorType="border-bottom"
ref="sForm">
<u-collapse :border="false" accordion>
<uni-card style="margin: 0px 16px 16px 16px;padding: 10px 0px;" margin="0" spacing="0" padding="0" :is-shadow="false"
v-for="(item, index) in dataModel.Nav_Flow">
<u-collapse-item title-border="none" :show-arrow="false" class="collapse-influ">
<view slot="title" class="collapse-title">
<!-- <view class="down">
<uni-icons type="bottom"></uni-icons>
</view> -->
<view class="text-num">{{item.NUM+ '. '}}</view>
<view class="text">{{item.SafeMeasuresStr}}</view>
<!-- <view class="text">{{item.NUM+ '. ' + item.SafeMeasuresStr}}</view> -->
</view>
<u-form-item label="是否确认" prop="IS_CONFIRM" borderBottom>
<u--input disabled disabledColor="#fff"
v-model="item.IS_CONFIRM"
border="none"
inputAlign="right"></u--input>
<!-- <u-icon style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon> -->
</u-form-item>
<u-form-item label="附件" prop="flowFiles" borderBottom>
<view class="link-content">
<view class="link-content-border" v-for="itemChild in item.flowFiles">
<u-link :href="itemChild.url" :text="itemChild.name"
color="#005BEA">
</u-link>
</view>
</view>
<!-- <u-icon style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon> -->
</u-form-item>
<!-- <view class="table-record-column">
<view class="table-left">附件</view>
<view class="link-content">
<view class="link-content-border" v-for="itemChild in item.flowFiles">
<u-link fontSize="12" :href="itemChild.url" :text="itemChild.name"
color="#005BEA">
</u-link>
</view>
</view>
</view> -->
</u-collapse-item>
</uni-card>
</u-collapse>
</u--form>
<!-- </uni-card> -->
<!-- </view> -->
</view>
<view v-if="currentIndex===2" class="uni-card-bottom">
<!-- <view v-for="(item, index) in dataModel.Nav_Measure" class="uni-card">
<uni-card margin="0" :is-shadow="true">
<view>
<view class="table-record">
<view class="table-left">顺序</view>
<view>{{item.NUM}}</view>
</view>
<view class="table-record-column table-bottom">
<view class="table-left">名称</view>
<view class="table-right">{{item.DealMeasuresStr}}</view>
</view>
<view class="table-record">
<view class="table-left">是否确认</view>
<view>{{item.IS_CONFIRM}}</view>
</view>
<view class="table-record-column">
<view class="table-left">附件</view>
<view class="link-content">
<view class="link-content-border" v-for="itemChild in item.dealFiles">
<u-link fontSize="12" :href="itemChild.url" :text="itemChild.name"
color="#005BEAs">
</u-link>
</view>
</view>
</view>
</view>
</uni-card>
</view> -->
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" errorType="border-bottom"
ref="sForm">
<u-collapse :border="false" accordion>
<uni-card style="margin: 0px 16px 16px 16px;padding: 10px 0px;" margin="0" spacing="0" padding="0" :is-shadow="false"
v-for="(item, index) in dataModel.Nav_Measure">
<u-collapse-item title-border="none" :show-arrow="false" class="collapse-influ">
<view slot="title" class="collapse-title">
<!-- <view class="down">
<uni-icons type="bottom"></uni-icons>
</view> -->
<view class="text-num">{{item.NUM+ '. '}}</view>
<view class="text">{{ item.DealMeasuresStr}}</view>
</view>
<u-form-item label="是否确认" prop="IS_CONFIRM" borderBottom>
<u--input disabled disabledColor="#fff"
v-model="item.IS_CONFIRM"
border="none"
inputAlign="right"></u--input>
<!-- <u-icon style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon> -->
</u-form-item>
<u-form-item label="附件" prop="flowFiles" borderBottom>
<view class="link-content">
<view class="link-content-border" v-for="itemChild in item.dealFiles">
<u-link :href="itemChild.url" :text="itemChild.name"
color="#005BEA">
</u-link>
</view>
</view>
<!-- <u-icon style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon> -->
</u-form-item>
<!-- <view class="table-record-column">
<view class="table-left">附件</view>
<view class="link-content">
<view class="link-content-border" v-for="itemChild in item.flowFiles">
<u-link fontSize="12" :href="itemChild.url" :text="itemChild.name"
color="#005BEA">
</u-link>
</view>
</view>
</view> -->
</u-collapse-item>
</uni-card>
</u-collapse>
</u--form>
</view>
<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="isLoadOK&&tableKey==='1'&&!isAudit"
@click="onTableBtnAgree">确认</button>
<!-- <button type="primary" class="bottom" v-if='isLoadOK&&tableKey==1' @click="onTableBtnAgree">签到</button> -->
</view>
</view>
</view>
</template>
<script>
import {
mapState,
mapMutations
} from 'vuex'
import {
extendFilterGroup,
extendGroupRule,
extendInclude,
extendOrder,
extendRule,
guid,
initFilter,
initFilterGroup,
extendIgnoreDataRule
} from '../../../../utils/common'
import {
getRequest,//getJobEventGet,
getUserLists,
getJobEventRecordSign,
} from '../../../../services/apply/FOServices/FOServices.js'
import config from '../../../../config/common'
export default {
data() {
return {
ID: '',
TaskID: '',
tableKey: 0,
isLoadOK: false,
userLists: [],
okApi: '',
refuseApi: '',
ApproveID: '',
isAudit: false,
dataModel: {
Nav_OperationStep: {NAME:''}
},
subDataModel: {},
options: [{
text: '删除',
style: {
backgroundColor: '#f56c6c'
}
}],
comPickerInfo: {
showSheet: false,
columns: [],
title: '',
dataIndex: undefined,
formIndex: undefined,
name: ''
},
list: [{
name: '作业前安全确认'
}, {
name: '作业流程及安全措施'
}, {
name: '作业后处理措施'
}],
currentIndex: 0,
isTop: false
}
},
onLoad(opt) {
this.handleGetJobEventGet(opt)
},
onPageScroll(e) {
let query = uni.createSelectorQuery().in(this);
query.select('#tabs-title').boundingClientRect(data => {
if (data.top == 0) {
this.isTop = true
} else {
this.isTop = false
}
// 这个
}).exec();
},
methods: {
change(index) {
this.currentIndex = index.index;
},
changeIndex() {
this.show = true
if (this.currentIndex + 1 < this.list.length) {
this.currentIndex = this.currentIndex + 1
}
},
handleGetJobEventGet(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)
// extendInclude(json, 'Nav_Meeting');
// extendInclude(json, 'Nav_CreateUser');
// extendInclude(json, 'Nav_OperationStep');
// extendInclude(json, 'Nav_JobEventPerson');
// extendInclude(json, 'Nav_JobEventPerson.Nav_User.Nav_Department');
// extendInclude(json, 'Nav_JobEventPerson.Nav_User.Nav_UserSignFiles.Nav_ImgFile.Nav_File');
// extendInclude(json, 'Nav_Details');
// extendInclude(json, 'Nav_Details.Nav_Files.Nav_ImgFile.Nav_File');
// extendInclude(json, 'Nav_Flow');
// extendInclude(json, 'Nav_Flow.Nav_Files.Nav_ImgFile.Nav_File');
// extendInclude(json, 'Nav_Measure');
// extendInclude(json, 'Nav_Measure.Nav_Files.Nav_ImgFile.Nav_File');
// TODO: id 未获取
getRequest(json,"/FO/FOJobEventRecord/GetEdit").then(res => {
this.dataModel = res
let arry= res.JOB_DATE.split("-")
if (arry.length>0) {//indexOf
// let jobDate = res.JOB_DATE
// res.JOB_DATE = jobDate
this.dataModel.JOB_START_DATE =arry[0]
this.dataModel.JOB_END_DATE =arry[1]
}
if(!res.OPERATION_STEP_ID)
{
res.Nav_OperationStep =[]
}
//数据组装
let strUserName = ''
if (res.Nav_JobEventPerson && res.Nav_JobEventPerson.length > 0) {
for (let i = 0; i < res.Nav_JobEventPerson.length; i++) {
if (res.Nav_JobEventPerson[i].DEAL_STATUS == 0) {
strUserName += (strUserName.length > 0 ? "&nbsp;&nbsp;" : "") +
"<text style='color:#E35D58;background-color:rgba(227,93,88,0.2);padding:5px;'>" +
res.Nav_JobEventPerson[i].Nav_User.NAME + "</text>";
} else {
let user = res.Nav_JobEventPerson[i].USER_ID != null ? res.Nav_JobEventPerson[i]
.Nav_User.NAME : '';
strUserName += (strUserName.length > 0 ? "&nbsp;&nbsp;" : "") + user;
}
}
}
//数据组装
if (res.Nav_Details && res.Nav_Details.length > 0) {
let strconfirmFiles = [{
url: '',
name: ''
}]
for (let i = 0; i < res.Nav_Details.length; i++) {
res.Nav_Details[i].NUM = i + 1;
if (res.Nav_Details[i].IS_CONFIRM == true) {
res.Nav_Details[i].IS_CONFIRM = "是"
} else {
res.Nav_Details[i].IS_CONFIRM = "否"
}
let details = res.Nav_Details[i];
if (details.Nav_Files && details.Nav_Files.length > 0) {
for (let j = 0; j < details.Nav_Files.length; j++) {
strconfirmFiles.push({
url: config.uni_app_web_local_api_url + details.Nav_Files[j]
.Nav_ImgFile.Nav_File.FILE_PATH,
name: details.Nav_Files[j].Nav_ImgFile.FILE_NAME
})
details.confirmFiles = strconfirmFiles
}
}
}
}
//数据组装
if (res.Nav_Flow && res.Nav_Flow.length > 0) {
let strconfirmFiles = [{
url: '',
name: ''
}]
for (let i = 0; i < res.Nav_Flow.length; i++) {
res.Nav_Flow[i].NUM = i + 1;
if (res.Nav_Flow[i].IS_CONFIRM == true) {
res.Nav_Flow[i].IS_CONFIRM = "是"
} else {
res.Nav_Flow[i].IS_CONFIRM = "否"
}
let details = res.Nav_Flow[i];
if (details.Nav_Files && details.Nav_Files.length > 0) {
for (let j = 0; j < details.Nav_Files.length; j++) {
strconfirmFiles.push({
url: config.uni_app_web_local_api_url + details.Nav_Files[j]
.Nav_ImgFile.Nav_File.FILE_PATH,
name: details.Nav_Files[j].Nav_ImgFile.FILE_NAME
})
details.flowFiles = strconfirmFiles
}
}
}
}
//数据组装
if (res.Nav_Measure && res.Nav_Measure.length > 0) {
let strconfirmFiles = [{
url: '',
name: ''
}]
for (let i = 0; i < res.Nav_Measure.length; i++) {
res.Nav_Measure[i].NUM = i + 1;
if (res.Nav_Measure[i].IS_CONFIRM == true) {
res.Nav_Measure[i].IS_CONFIRM = "是"
} else {
res.Nav_Measure[i].IS_CONFIRM = "否"
}
let details = res.Nav_Measure[i];
if (details.Nav_Files && details.Nav_Files.length > 0) {
for (let j = 0; j < details.Nav_Files.length; j++) {
strconfirmFiles.push({
url: config.uni_app_web_local_api_url + details.Nav_Files[j]
.Nav_ImgFile.Nav_File.FILE_PATH,
name: details.Nav_Files[j].Nav_ImgFile.FILE_NAME
})
details.dealFiles = strconfirmFiles
}
}
}
}
this.dataModel.UserNames = strUserName
this.isLoadOK = true
})
},
onTableBtnAgree() {
let json = {};
json.ID = this.ID;
json.TaskID = this.TaskID;
getJobEventRecordSign(json).then(res => {
uni.$showMsgFunc('操作成功!', () => {
uni.navigateBack()
}, 'success', 1000)
})
}
}
}
</script>
<style scoped>
.page {
// background-image: url('../../../../utils/waves.svg');
// background-repeat: no-repeat;
// background-size: 100%;
}
.page-wrap {
padding-bottom: 66px;
}
.uni-card {
// margin-bottom: 10px;
margin: 16px;
}
.uni-card-bottom {
margin-bottom: 116px;
}
.uni-card-content {
margin: 5px 10px;
}
.tabs-title {
//padding-top: 10px;
// margin-bottom: 10px;
// margin: 16px;
display: flex;
flex-direction: row;
align-items: center;
background-color: rgba(255, 255, 255, 1);
box-shadow: 0px 1px 0px 0px #eaedf4;
.icon-tabs {
padding-left: 5px;
display: flex;
align-items: center;
}
}
.card {
// margin-bottom: 18px;
margin: 16px;
}
.table-record {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
/* font-size: 12px; */
border-bottom: 1px #c8c7cc solid;
line-height: 40px;
color: #303133;
}
.table-record-noborder {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
/* font-size: 12px; */
line-height: 40px;
color: #303133;
}
.table-bottom {
border-bottom: 1px #c8c7cc solid;
}
.table-record-column {
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 12px;
color: #303133;
}
.table-left {
line-height: 40px;
display: flex;
align-items: center;
width: 70px;
}
.table-right {
display: flex;
color: #808080;
align-items: center;
justify-content: flex-end;
flex: 1;
line-height: 18px;
padding: 5px 0px 5px 0px;
}
.link-content {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
width: 100%;
align-items: center;
}
.link-content-border {
display: flex;
margin-left: 10px;
align-items: center;
}
.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;
}
/* .collapse-influ>>>.u-cell__body__content {
width: calc(100% - 20px);
display: block;
} */
.collapse-title {
display: flex;
flex-direction: row;
/* justify-content: space-between; */
/* align-items: center; */
width: 100%;
}
.text-num {
display: flex;
align-items: flex-start;
margin-right: 3px;
}
.collapse-title .down {
width: 20px;
flex: 0 0 auto;
}
/* .collapse-title .text {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
flex: 1;
width: calc(100% - 100px);
} */
</style>