动火气体分析模块开发

八项作业
liujun 2024-08-31 17:28:32 +08:00
parent bb96cb2954
commit 8d7f6979fa
3 changed files with 51 additions and 60 deletions

View File

@ -2,19 +2,19 @@
<view class="content"> <view class="content">
<view class="card"> <view class="card">
<u-form labelPosition="left" :model="form" :rules="rules" ref="formRef" labelWidth="140px"> <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-form-item label="动火分析时间" prop="ANALYZE_TIME" borderBottom required @click="fnDateTimePickerClick('ANALYZE_TIME')">
<u-input v-model="form.GAS_TIME" border="none" readonly /> <u-input v-model="form.ANALYZE_TIME" border="none" readonly />
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="分析点名称" prop="GAS_NAME" borderBottom required> <u-form-item label="分析点名称" prop="ANALYZE_PLACE" borderBottom required>
<u-input v-model="form.GAS_NAME" border="none" /> <u-input v-model="form.ANALYZE_PLACE" border="none" />
</u-form-item> </u-form-item>
<u-form-item label="分析数据(%LEL)" prop="GAS_NUMBER" borderBottom required> <u-form-item label="分析数据(%LEL)" prop="ANALYZE_RESULT" borderBottom required>
<u-input v-model="form.GAS_NUMBER" border="none" type="number" placeholder="0" /> <u-input v-model="form.ANALYZE_RESULT" border="none" type="number" placeholder="0" />
<view class="title">(%LEL)</view> <view class="title">(%LEL)</view>
</u-form-item> </u-form-item>
<u-form-item label="分析人" prop="gasUserName" borderBottom required> <u-form-item label="分析人" prop="ANALYZE_USER_NAME" borderBottom required>
<u-input v-model="form.gasUserName" border="none" /> <u-input v-model="form.ANALYZE_USER_NAME" border="none" />
</u-form-item> </u-form-item>
</u-form> </u-form>
<view class="mt-10"> <view class="mt-10">
@ -36,19 +36,23 @@ export default {
return { return {
form: { form: {
/** 动火分析时间 */ /** 动火分析时间 */
GAS_TIME: '', ANALYZE_TIME: '',
/** 分析点名称 */ /** 分析点名称 */
GAS_NAME: '', ANALYZE_PLACE: '',
/** 分析数据(%LEL) */ /** 分析数据(%LEL) */
GAS_NUMBER: '', ANALYZE_RESULT: '',
/** 分析人 */ /** 分析人 */
gasUserName: this.$store.getters.getUserInfo.NAME ANALYZE_USER_NAME: this.$store.getters.getUserInfo.NAME,
ANALYZE_USER_ID: this.$store.getters.getUserInfo.USER_ID,
EW_RU_TASK_ID:'',
EW_RU_JOB_ID:'',
TYPE: ''
}, },
rules: { rules: {
GAS_TIME: [{ type: 'string', required: true, message: '请选择动火分析时间', trigger: ['blur', 'change'] }], ANALYZE_TIME: [{ type: 'string', required: true, message: '请选择动火分析时间', trigger: ['blur', 'change'] }],
GAS_NAME: [{ type: 'string', required: true, message: '请输入分析点名称', trigger: ['blur', 'change'] }], ANALYZE_PLACE: [{ type: 'string', required: true, message: '请输入分析点名称', trigger: ['blur', 'change'] }],
GAS_NUMBER: [{ type: 'string', required: true, message: '请输入分析数据', trigger: ['blur', 'change'] }], ANALYZE_RESULT: [{ type: 'string', required: true, message: '请输入分析数据', trigger: ['blur', 'change'] }],
gasUserName: [{ type: 'string', required: true, message: '请输入分析人', trigger: ['blur', 'change'] }], ANALYZE_USER_NAME: [{ type: 'string', required: true, message: '请输入分析人', trigger: ['blur', 'change'] }],
}, },
dateTimePicker: { dateTimePicker: {
show: false, show: false,
@ -59,6 +63,12 @@ export default {
}, },
} }
}, },
onLoad(query) {
this.form.EW_RU_TASK_ID = query.EW_RU_TASK_ID
this.TYPE = query.TYPE
this.form.EW_RU_JOB_ID = query.EW_RU_JOB_ID
this.getData()
},
methods: { methods: {
fnDateTimePickerClick(event) { fnDateTimePickerClick(event) {
this.dateTimePicker.type = event this.dateTimePicker.type = event
@ -76,14 +86,8 @@ export default {
try { try {
await this.$refs.formRef.validate() await this.$refs.formRef.validate()
try { 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({ await getHotWorkGasInfoSave({
data: { ...this.form }, ...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('保存成功') uni.$u.toast('保存成功')
setTimeout(() => { setTimeout(() => {

View File

@ -3,16 +3,16 @@
<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.GAS_TIME }}</text> <text>动火分析时间: {{ item.ANALYZE_TIME }}</text>
</view> </view>
<view class="flex-between main-title"> <view class="flex-between main-title">
<text>分析点名称: {{ item.GAS_NAME }}</text> <text>分析点名称: {{ item.ANALYZE_PLACE }}</text>
</view> </view>
<view class="flex-between main-title"> <view class="flex-between main-title">
<text>分析数据(%LEL): {{ item.GAS_NUMBER }}</text> <text>分析数据(%LEL): {{ item.ANALYZE_PLACE }}</text>
</view> </view>
<view class="flex-between main-title"> <view class="flex-between main-title">
<text>分析人{{ item.userName }}</text> <text>分析人{{ item.ANALYZE_USER_NAME }}</text>
</view> </view>
<view class="flex-between mt-10 subtitle"> <view class="flex-between mt-10 subtitle">
<view></view> <view></view>
@ -28,32 +28,30 @@
<script> <script>
import { getHotWorkGasInfo, getHotWorkGasDelete } from "@/api"; import { getHotWorkGasInfo, getHotWorkGasDelete } from "@/api";
import {getHotWorkGasAll} from "../../../../api";
export default { export default {
data() { data() {
return { return {
list: [] list: [],
EW_RU_TASK_ID: '',
EW_RU_JOB_ID: '',
TYPE: ''
} }
}, },
onLoad(query) { onLoad(query) {
// this.GAS_NAME1 = query.GAS_NAME1; this.EW_RU_TASK_ID = query.taskId
// this.GAS_NAME2 = query.GAS_NAME2; this.TYPE = query.type
// this.GAS_NAME3 = query.GAS_NAME3; this.EW_RU_JOB_ID = query.EW_RU_JOB_ID
// this.GAS_NAME4 = query.GAS_NAME4;
// this.EW_RU_TASK_ID = query.EW_RU_TASK_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, EW_RU_TASK_ID: this.EW_RU_TASK_ID,
// GAS_NAME2: this.GAS_NAME2, EW_RU_JOB_ID: this.EW_RU_JOB_ID,
// GAS_NAME3: this.GAS_NAME3, TYPE: this.TYPE
// GAS_NAME4: this.GAS_NAME4,
// EW_RU_TASK_ID: this.EW_RU_TASK_ID,
// EW_RU_JOB_ID: this.EW_RU_JOB_ID,
} }
}) })
} }
@ -63,19 +61,11 @@ export default {
}, },
methods: { methods: {
async getData() { async getData() {
// let resData = await getHotWorkGasInfo({ let resData = await getHotWorkGasAll({
// 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, EW_RU_JOB_ID: this.EW_RU_JOB_ID,
// postMethod: 'application/json', });
// }); this.list = [...this.list, ...resData.list];
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 = []
@ -88,10 +78,7 @@ export default {
success: async res => { success: async res => {
if (res.confirm) { if (res.confirm) {
await getHotWorkGasDelete({ await getHotWorkGasDelete({
data: item, EW_SP_EG_ID: item.EW_SP_EG_ID
EW_RU_JOB_ID: this.EW_RU_JOB_ID,
EW_RU_TASK_ID: this.EW_RU_TASK_ID,
postMethod: 'application/json',
}) })
uni.$u.toast('删除成功') uni.$u.toast('删除成功')
this.resetList() this.resetList()

View File

@ -210,7 +210,7 @@ export const resolveNextOperation = async (
}) })
return return
} }
// 有限空间作业气体分析 // 流程特殊权限校验
if (info.otherFlag !== null && info.otherFlag.redirectFlag === '1') { if (info.otherFlag !== null && info.otherFlag.redirectFlag === '1') {
uni.$u.route({ uni.$u.route({
url: info.otherFlag.url, url: info.otherFlag.url,