feat: 添加延时监火的静态页面

八项作业
mengfanliang 2024-08-30 17:28:12 +08:00
parent b993cc7299
commit 97f070fac6
9 changed files with 385 additions and 45 deletions

View File

@ -308,6 +308,18 @@
"navigationBarTitleText": "已办" "navigationBarTitleText": "已办"
} }
}, },
{
"path": "pages/eight_assignments/hot_work/delay_fire_monitoring/list",
"style": {
"navigationBarTitleText": "延时监火"
}
},
{
"path": "pages/eight_assignments/hot_work/delay_fire_monitoring/detail",
"style": {
"navigationBarTitleText": "动火审批表"
}
},
{ {
"path": "pages/eight_assignments/security_measures", "path": "pages/eight_assignments/security_measures",
"style": { "style": {

View File

@ -119,7 +119,9 @@ export default {
}) })
uni.$u.toast('保存成功') uni.$u.toast('保存成功')
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.switchTab({
url: '/pages/index/index'
})
}, 2000) }, 2000)
} catch { } catch {
} }

View File

@ -0,0 +1,97 @@
<template>
<view class="content">
<view class="card">
<u-cell-group>
<block v-for="(item, index) in form" :key="index">
<u-cell v-if="item.TYPE === 0" :key="index" :title="item.ITEM" :value="item.ITEM_VALUE"></u-cell>
</block>
</u-cell-group>
<u-divider text="安全措施" textPosition="left" textColor="#3c9cff" lineColor="#3c9cff" />
<u-cell-group>
<u-cell v-for="(item, index) in questionnaires" :key="index" :title="item.QUESTION">
<template #title>
<view style="display: flex;justify-content: space-between">
<view>{{ item.QUESTION }}</view>
<view>{{ item.TEXT_INFO || item.ANSWER }}</view>
</view>
</template>
<template #label>
<block v-for="(item1, index1) in item.answers" :key="index1">
<view>{{ item1.TEXT_INFO }}{{ item1.ANSWER }}</view>
</block>
</template>
</u-cell>
</u-cell-group>
<u-divider text="审批人员" textPosition="left" textColor="#3c9cff" lineColor="#3c9cff" />
<u-cell-group>
<block v-for="(item, index) in jobs" :key="index">
<u-cell :key="index" :title="item.TYPE_DESCRIBE">
<template #label>
<view class="mt-10">
<view>部门{{ item.DEPARTMENT_NAME }}</view>
<view>人员{{ item.USER_NAME }}</view>
<view v-if="item.SIGN_PICTURE">
<u-image width="400rpx" height="200rpx" :src="$filePath + '/' + item.SIGN_PICTURE" mode="widthFix" />
<view>审批意见{{ item.APPROVAL_OPINIONS }}</view>
<view>审批意见{{ item.APPROVAL_TIME }}</view>
</view>
</view>
</template>
</u-cell>
</block>
</u-cell-group>
</view>
</view>
</template>
<script>
import { getTaskInfo } from "@/api";
import { resolveNextOperation } from "@/utils/submitHomeworkProcess";
export default {
data() {
return {
taskId: '',
type: '',
jobId: '',
form: [],
jobs: [],
questionnaires: [],
}
},
onLoad(query) {
this.taskId = query.taskId
this.type = query.type
this.jobId = query.jobId
this.fnGetData(query.taskId)
uni.setNavigationBarTitle({
title: query.title + '查看'
})
},
methods: {
async fnGetData(taskId) {
let resData = await getTaskInfo({ EW_RU_TASK_ID: taskId })
this.form = resData.list.form
this.jobs = resData.list.jobs
this.questionnaires = resData.list.simpleQues[0]
},
async fnSubmit() {
let CORP_ID = ''
for (let i = 0; i < this.form.length; i++) {
if (this.form[i].FK_NAME === 'CORP_ID') {
CORP_ID = this.form[i].FK_VALUE
break
}
}
await resolveNextOperation({
EW_RU_TASK_ID: this.taskId,
TYPE: this.type,
CORP_ID,
EW_RU_JOB_ID: this.jobId,
})
},
},
}
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,116 @@
<!-- 延时监火页面 列表 -->
<template>
<view class="content">
<u-list @scrolltolower="scrolltolower" v-if="list.length > 0">
<u-list-item v-for="(item, index) in list" :key="index">
<view @click="goToDetail(item)">
<view class="flex-between main-title bold">
<text>作业证编号: {{ item.JOB_NUMBER }}</text>
<text>动火等级: {{ item.HOT_WORK_LEVEL_NAME }}</text>
</view>
<view class="flex-between main-title">
<text>申请办理人: {{ item.APPLY_USER_NAME }}</text>
<text>作业类型: {{ item.JOB_TYPE_NAME }}</text>
</view>
<view class="flex-between main-title">
<text>现场负责人{{ item.SITE_LEADER_NAME }}</text>
<text>动火单位负责人{{ item.HOT_WORK_UNIT_LEADER_NAME }}</text>
</view>
<view class="flex-between main-title">
<text>动火部位{{ item.HOT_WORK_POSITION }}</text>
<text>作业内容{{ item.JOB_CONTENT }}</text>
</view>
<view class="flex-between main-title">
<text>审核状态延时监火</text>
</view>
<view class="flex-between mt-10 subtitle">
<view></view>
<view class="flex-between">
<u-button type="primary" text="延时监火" size="mini" class="bth-mini ml-10" @click="$u.route({
url: '/pages/eight_assignments/view_info',
params: { taskId: item.taskId, jobId: item.jobId, type, title }
})" />
</view>
</view>
</view>
</u-list-item>
</u-list>
<empty v-else></empty>
</view>
</template>
<script>
export default {
data() {
return {
type: '',
title: '',
pageSize: 10,
currentPage: 1,
totalPage: 0,
list: []
}
},
onLoad(query) {
this.type = query.type
this.title = query.title
},
onShow() {
this.resetList()
},
methods: {
async getData() {
//
// let resData = await getToDoTaskList({
// showCount: this.pageSize,
// currentPage: this.currentPage,
// TYPE: this.type,
// vectors: '0'
// });
const mockData = [
{
HOTWORKAPPLICATION_ID: '0',
JOB_NUMBER: 'DFIO-FPI',
HOT_WORK_LEVEL_NAME: '一级',
APPLY_USER_NAME: '孙喊问',
JOB_TYPE_NAME: '内部作业',
SITE_LEADER_NAME: '王某某',
HOT_WORK_UNIT_LEADER_NAME: '王某某',
HOT_WORK_POSITION: '测试',
JOB_CONTENT: '测试',
taskId: 'f4eb31f4b61b408e8a88e849017558d4',
jobId: 'c4f007f2ef5c487d96c31e297f5ff29b'
}
]
this.list = mockData || [];
this.totalPage = 0;
},
resetList() {
this.pageSize = 10
this.currentPage = 1
this.list = []
this.getData()
},
goToDetail(item) {
uni.$u.route({
url: '/pages/eight_assignments/hot_work/delay_fire_monitoring/detail',
params: {
taskId: item.taskId,
jobId: item.jobId,
type: this.type,
title: this.title
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
.bold {
font-weight: bold;
}
}
</style>

View File

@ -0,0 +1,104 @@
<template>
<view class="content">
<view class="card">
<u-form labelPosition="left" :model="form" :rules="rules" ref="formRef" labelWidth="140px">
<u-form-item label="动火分析时间" prop="GAS_TIME" borderBottom required @click="fnDateTimePickerClick('GAS_TIME')">
<u-input v-model="form.GAS_TIME" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="分析点名称" prop="GAS_NAME" borderBottom required>
<u-input v-model="form.GAS_NAME" border="none" />
</u-form-item>
<u-form-item label="分析数据(%LEL)" prop="GAS_NUMBER" borderBottom required>
<u-input v-model="form.GAS_NUMBER" border="none" type="number" placeholder="0" />
<view class="title">(%LEL)</view>
</u-form-item>
<u-form-item label="分析人" prop="gasUserName" borderBottom required>
<u-input v-model="form.gasUserName" border="none" />
</u-form-item>
</u-form>
<view class="mt-10">
<u-button type="primary" text="保存" @click="$u.debounce(fnSubmit, 1000, true)" />
</view>
</view>
<u-datetime-picker :show="dateTimePicker.show" v-model="dateTimePicker.value" :mode="dateTimePicker.mode"
:maxDate="dateTimePicker.max" :key="dateTimePicker.type" @confirm="fnDateTimePickerConfirm"
@cancel="fnDateTimePickerCancel" />
</view>
</template>
<script>
import { getHotWorkGasInfoSave } from "@/api";
export default {
data() {
return {
form: {
/** 动火分析时间 */
GAS_TIME: '',
/** 分析点名称 */
GAS_NAME: '',
/** 分析数据(%LEL) */
GAS_NUMBER: '',
/** 分析人 */
gasUserName: this.$store.getters.getUserInfo.NAME
},
rules: {
GAS_TIME: [{ type: 'string', required: true, message: '请选择动火分析时间', trigger: ['blur', 'change'] }],
GAS_NAME: [{ type: 'string', required: true, message: '请输入分析点名称', trigger: ['blur', 'change'] }],
GAS_NUMBER: [{ type: 'string', required: true, message: '请输入分析数据', trigger: ['blur', 'change'] }],
gasUserName: [{ type: 'string', required: true, message: '请输入分析人', trigger: ['blur', 'change'] }],
},
dateTimePicker: {
show: false,
value: Number(new Date()),
max: new Date().getTime(),
mode: 'datetime',
type: 'datetime-picker'
},
}
},
methods: {
fnDateTimePickerClick(event) {
this.dateTimePicker.type = event
this.dateTimePicker.value = Number(new Date(this.form[event])) || Number(new Date())
this.dateTimePicker.show = true
},
fnDateTimePickerConfirm(event) {
this.form[this.dateTimePicker.type] = uni.$u.timeFormat(event.value, 'yyyy-mm-dd hh:MM')
this.fnDateTimePickerCancel()
},
fnDateTimePickerCancel() {
this.dateTimePicker.show = false
},
async fnSubmit() {
try {
await this.$refs.formRef.validate()
try {
// for (let i = 0; i < 4; i++) {
// if (this[`GAS_NAME${i + 1}`] && !this.form[`DATA${i + 1}`]) this.form[`DATA${i + 1}`] = 0
// }
await getHotWorkGasInfoSave({
data: { ...this.form },
// EW_RU_TASK_ID: this.EW_RU_TASK_ID,
// EW_RU_JOB_ID: this.EW_RU_JOB_ID,
postMethod: 'application/json',
})
uni.$u.toast('保存成功')
setTimeout(() => {
uni.switchTab({
url: '/pages/index/index'
})
}, 2000)
} catch {
}
} catch (e) {
uni.$u.toast('请补全必填项')
}
}
}
}
</script>
<style scoped lang="scss"></style>

View File

@ -3,34 +3,21 @@
<u-list v-if="list.length > 0"> <u-list v-if="list.length > 0">
<u-list-item v-for="(item, index) in list" :key="index"> <u-list-item v-for="(item, index) in list" :key="index">
<view class="flex-between main-title"> <view class="flex-between main-title">
<text>分析时间{{ item.ANALYZE_TIME }}</text> <text>动火分析时间: {{ item.GAS_TIME }}</text>
</view> </view>
<view class="flex-between main-title"> <view class="flex-between main-title">
<text>分析地点{{ item.ANALYZE_PLACE }}</text> <text>分析点名称: {{ item.GAS_NAME }}</text>
</view>
<view class="flex-between main-title" v-if="GAS_NAME1 && item.DATA1">
<text>{{ GAS_NAME1 }}{{ item.DATA1 }}</text>
</view>
<view class="flex-between main-title" v-if="GAS_NAME2 && item.DATA2">
<text>{{ GAS_NAME2 }}{{ item.DATA2 }}</text>
</view>
<view class="flex-between main-title" v-if="GAS_NAME3 && item.DATA3">
<text>{{ GAS_NAME3 }}{{ item.DATA3 }}</text>
</view>
<view class="flex-between main-title" v-if="GAS_NAME4 && item.DATA4">
<text>{{ GAS_NAME4 }}{{ item.DATA4 }}</text>
</view> </view>
<view class="flex-between main-title"> <view class="flex-between main-title">
<text>含氧量{{ item.OXYGEN_CONTENT }}</text> <text>分析数据(%LEL): {{ item.GAS_NUMBER }}</text>
</view> </view>
<view class="flex-between main-title"> <view class="flex-between main-title">
<text>分析人{{ item.ANALYZE_USER_NAME }}</text> <text>分析人{{ item.userName }}</text>
</view> </view>
<view class="flex-between mt-10 subtitle"> <view class="flex-between mt-10 subtitle">
<view></view> <view></view>
<view class="flex-between"> <view class="flex-between">
<u-button type="error" text="删除" size="mini" class="bth-mini" <u-button type="error" text="删除" size="mini" class="bth-mini" @click="fnDelete(item)" />
@click="fnDelete(item)"/>
</view> </view>
</view> </view>
</u-list-item> </u-list-item>
@ -45,34 +32,28 @@ import { getHotWorkGasInfo, getHotWorkGasDelete } from "@/api";
export default { export default {
data() { data() {
return { return {
GAS_NAME1: '',
GAS_NAME2: '',
GAS_NAME3: '',
GAS_NAME4: '',
EW_RU_TASK_ID: '',
EW_RU_JOB_ID: '',
list: [] list: []
} }
}, },
onLoad(query) { onLoad(query) {
this.GAS_NAME1 = query.GAS_NAME1; // this.GAS_NAME1 = query.GAS_NAME1;
this.GAS_NAME2 = query.GAS_NAME2; // this.GAS_NAME2 = query.GAS_NAME2;
this.GAS_NAME3 = query.GAS_NAME3; // this.GAS_NAME3 = query.GAS_NAME3;
this.GAS_NAME4 = query.GAS_NAME4; // this.GAS_NAME4 = query.GAS_NAME4;
this.EW_RU_TASK_ID = query.EW_RU_TASK_ID; // this.EW_RU_TASK_ID = query.EW_RU_TASK_ID;
this.EW_RU_JOB_ID = query.EW_RU_JOB_ID; // this.EW_RU_JOB_ID = query.EW_RU_JOB_ID;
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
uni.$u.route({ uni.$u.route({
url: '/pages/eight_assignments/hot_work/gas/add', url: '/pages/eight_assignments/hot_work/gas/add',
params: { params: {
GAS_NAME1: this.GAS_NAME1, // GAS_NAME1: this.GAS_NAME1,
GAS_NAME2: this.GAS_NAME2, // GAS_NAME2: this.GAS_NAME2,
GAS_NAME3: this.GAS_NAME3, // GAS_NAME3: this.GAS_NAME3,
GAS_NAME4: this.GAS_NAME4, // GAS_NAME4: this.GAS_NAME4,
EW_RU_TASK_ID: this.EW_RU_TASK_ID, // EW_RU_TASK_ID: this.EW_RU_TASK_ID,
EW_RU_JOB_ID: this.EW_RU_JOB_ID, // EW_RU_JOB_ID: this.EW_RU_JOB_ID,
} }
}) })
} }
@ -82,12 +63,19 @@ export default {
}, },
methods: { methods: {
async getData() { async getData() {
let resData = await getHotWorkGasInfo({ // let resData = await getHotWorkGasInfo({
EW_RU_JOB_ID: this.EW_RU_JOB_ID, // EW_RU_JOB_ID: this.EW_RU_JOB_ID,
EW_RU_TASK_ID: this.EW_RU_TASK_ID, // EW_RU_TASK_ID: this.EW_RU_TASK_ID,
postMethod: 'application/json', // postMethod: 'application/json',
}); // });
this.list = [...this.list, ...resData.data.main]; let mockData = [{
// Number(new Date())
GAS_TIME: '2024-08-30 15:23:43',
GAS_NAME: '234',
GAS_NUMBER: 'fasf',
userName: 'zhangxiao'
}]
this.list = [...this.list, ...mockData];
}, },
resetList() { resetList() {
this.list = [] this.list = []

View File

@ -0,0 +1,13 @@
<template>
<view>name的预留位置</view>
</template>
<script>
export default {
data() {
return {}
}
}
</script>
<style scoped lang="scss"></style>

View File

@ -2,7 +2,7 @@
<view class="content"> <view class="content">
<view class="card"> <view class="card">
<view class="items"> <view class="items">
<view class="item" v-for="(item,index) in baseList" :key="index" @click="fnNavigator(index)"> <view class="item" v-for="(item, index) in baseList" :key="index" @click="fnNavigator(index)">
<image :src="item.img" mode=""></image> <image :src="item.img" mode=""></image>
<view class="text"> <view class="text">
<text>{{ item.title }}</text> <text>{{ item.title }}</text>
@ -43,7 +43,15 @@ export default {
this.title = query.title; this.title = query.title;
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.title title: this.title
});
// type [],baseList []
if (query.type === "hotWork") {
this.baseList.push({
img: require('../../static/icon-apps/i12.png'),
title: '延时监火',
url: '/pages/eight_assignments/hot_work/delay_fire_monitoring/list'
}) })
}
}, },
methods: { methods: {
fnNavigator(e) { fnNavigator(e) {

BIN
static/icon-apps/i12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB