feat: 动火作业申请表单开发

八项作业
mengfanliang 2024-08-29 16:19:09 +08:00
parent 8fbe0ae2c5
commit 986bc90dc3
9 changed files with 269 additions and 7 deletions

View File

@ -43,6 +43,7 @@ export const setConfinedSpaceGasInfoSave = (params) => post("/app/eightWork/init
export const setConfinedSpaceGasDelete = (params) => post("/app/eightWork/deleteGas", params) //保存受限空间气体检测删除
export const getOtherAssignmentsSelectList = (params) => post("/app/Task/getAllUnEndList", params) //关联的其他特殊作业及安全作业票编号选择列表
export const getRiskIdentificationResultsSelectList = (params) => post("/app/eightWork/getInfo", params) //风险辨识结果选择列表
export const getHotWorkMethodSelectList = (params) => post("/app/util/getDicList", params) // 动火方法选择列表
export const setTaskSave = (params) => post("/app/Task/init", params) //八项作业、隐患整改、安全环保检查任务保存更新接口
export const getCurrentNextOperation = (params) => post("/app/Task/getSupplementInfo", params) //获取当前任务的下一步操作
export const getDepartmentTree = (params) => post("/app/util/getDepartmentTree", params) //获取部门树

View File

@ -21,7 +21,9 @@
<script>
import {
getOtherAssignmentsSelectList,
getRiskIdentificationResultsSelectList
getRiskIdentificationResultsSelectList,
getHotWorkMethodSelectList,
getUserList
} from '@/api'
export default {
@ -66,6 +68,17 @@
vectors: JSON.stringify(['accidentType'])
})
this.list = resData.accidentType
} else if (this.type === 'hotWorkMethod') {
const resData = await getHotWorkMethodSelectList({
DICTIONARIES_ID: "63cf39931a89467594efc441bf67f6dd",
});
this.list = resData.list
} else if (this.type === 'userNameSelect') {
const resData = await getUserList({
DEPARTMENT_ID: this.$store.state.userInfo.DEPARTMENT_ID,
TYPE: 2
});
this.list = resData.list.list
}
},
close() {

View File

@ -220,6 +220,12 @@
"navigationBarTitleText": "动土作业申请"
}
},
{
"path": "pages/eight_assignments/hot_work/apply",
"style": {
"navigationBarTitleText": "动火作业申请"
}
},
{
"path": "pages/eight_assignments/high_work/apply",
"style": {

View File

@ -140,8 +140,8 @@ export default {
WORK_CONTENT: [{type: 'string', required: true, message: '请输入作业内容', trigger: ['blur', 'change']}],
WORK_START_DATE: [{type: 'string', required: true, message: '请选择作业开始时间', trigger: ['blur', 'change']}],
WORK_END_DATE: [{type: 'string', required: true, message: '请选择作业结束时间', trigger: ['blur', 'change']}],
WORK_LONGITUDE: [{type: 'string', required: true, message: '请选择经度', trigger: ['blur', 'change']}],
WORK_LATITUDE: [{type: 'string', required: true, message: '请选择纬度', trigger: ['blur', 'change']}],
WORK_LONGITUDE: [{type: 'string', required: true, message: '请选择经度', trigger: ['blur']}],
WORK_LATITUDE: [{type: 'string', required: true, message: '请选择纬度', trigger: ['blur']}],
WORK_USER: [{type: 'string', required: true, message: '请输入作业人', trigger: ['blur', 'change']}],
SPECIAL_WORK: [{
type: 'string',

View File

@ -0,0 +1,234 @@
<template>
<view class="content">
<view class="card">
<u-form labelPosition="left" :model="form" :rules="rules" ref="formRef" labelWidth="140px">
<u-form-item label="申请单位" prop="APPLY_DEPARTMENT_NAME" borderBottom required>
<u-input v-model="form.APPLY_DEPARTMENT_NAME" border="none" readonly />
</u-form-item>
<u-form-item label="申请办理人" prop="APPLY_USER_NAME" borderBottom required>
<u-input v-model="form.APPLY_USER_NAME" border="none" readonly />
</u-form-item>
<u-form-item label="作业编号" prop="JOB_NUMBER" borderBottom>
<u-input v-model="form.JOB_NUMBER" border="none" placeholder="请输入作业编号" />
</u-form-item>
<u-form-item label="申请日期" prop="APPLICATION_DATE" borderBottom required
@click="fnDateTimePickerClick('APPLICATION_DATE')">
<u-input v-model="form.APPLICATION_DATE" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="作业类型" prop="JOB_TYPE_NAME" borderBottom required
@click="fnSingleChoiceClick('JOB_TYPE_NAME')">
<u-input v-model="form.JOB_TYPE_NAME" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="动火部位" prop="HOT_WORK_POSITION" borderBottom required>
<u-input v-model="form.HOT_WORK_POSITION" border="none" placeholder="请输入动火部位" />
</u-form-item>
<u-form-item label="动火方法" prop="HOT_WORK_METHOD_ID" borderBottom labelPosition="top" labelWidth="auto">
<u-button type="primary" size="mini" text="选择其它动火方法"
:customStyle="{ position: 'absolute', top: '-46upx', right: '20upx', width: '180upx' }"
@click="otherWorkMethodShow = true" />
<u-textarea v-model="form.HOT_WORK_METHOD_ID" border="none" autoHeight maxlength="-1" />
</u-form-item>
<u-form-item label="动火等级" prop="HOT_WORK_LEVEL_INDEX" borderBottom required
@click="fnSingleChoiceClick('HOT_WORK_LEVEL_INDEX')">
<u-input v-model="form.HOT_WORK_LEVEL_INDEX" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="动火开始时间" prop="HOT_WORK_TIME_START" borderBottom required
@click="fnDateTimePickerClick('HOT_WORK_TIME_START')">
<u-input v-model="form.HOT_WORK_TIME_START" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="动火结束时间" prop="HOT_WORK_TIME_END" borderBottom required
@click="fnDateTimePickerClick('HOT_WORK_TIME_END')">
<u-input v-model="form.HOT_WORK_TIME_END" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="作业内容" prop="JOB_CONTENT" borderBottom required>
<u-input v-model="form.JOB_CONTENT" border="none" placeholder="请输入作业内容" />
</u-form-item>
<u-form-item label="动火操作人" prop="USER_NAME" borderBottom required labelPosition="top" labelWidth="auto">
<u-button type="primary" size="mini" text="添加"
:customStyle="{ position: 'absolute', top: '-46upx', right: '20upx', width: '90upx' }"
@click="otherUserNameSelectShow = true" />
<u-textarea v-model="form.USER_NAME" border="none" autoHeight maxlength="-1" />
</u-form-item>
<u-form-item label="动火监火人" prop="SUPERVISOR_OF_HOT_WORK_UNIT" borderBottom required>
<u-input v-model="form.SUPERVISOR_OF_HOT_WORK_UNIT" border="none" placeholder="请输入动火监火人" />
</u-form-item>
</u-form>
<view class="mt-10">
<u-button type="primary" text="下一步" @click="$u.debounce(fnSubmit, 1000, true)" />
</view>
</view>
<u-picker :show="picker.show" :columns="picker.columns" :keyName="picker.key" :key="picker.type"
@confirm="fnSingleChoiceConfirm" @cancel="fnSingleChoiceCancel" />
<u-datetime-picker :show="dateTimePicker.show" v-model="dateTimePicker.value" :mode="dateTimePicker.mode"
:minDate="dateTimePicker.min" :key="dateTimePicker.type" @confirm="fnDateTimePickerConfirm"
@cancel="fnDateTimePickerCancel" />
<other-select :visible.sync="otherWorkMethodShow" v-model="form.HOT_WORK_METHOD_ID" type="hotWorkMethod" />
<other-select :visible.sync="otherUserNameSelectShow" v-model="form.USER_NAME" type="userNameSelect" />
</view>
</template>
<script>
import { getTaskInfo } from "@/api";
import OtherSelect from '@/components/other-select/index.vue';
import { setSubmitForm } from "@/utils/submitHomeworkProcess";
export default {
components: { OtherSelect },
data() {
return {
type: '',
formItems: [
{ name: '申请单位', key_name: 'APPLY_DEPARTMENT_NAME', key_id: 'APPLY_DEPARTMENT_ID', type: 0 },
{ name: '申请办理人', key_name: 'APPLY_USER_NAME', key_id: 'APPLY_USER_ID', type: 0 },
{ name: '作业编号', key_name: 'JOB_NUMBER', key_id: 'JOB_NUMBER_ID', type: 0 },
{ name: '申请日期', key_name: 'APPLICATION_DATE', type: 0 },
{ name: '作业类型', key_name: 'JOB_TYPE_NAME', key_id: 'JOB_TYPE_ID', type: 0 },
{ name: '动火部位', key_name: 'WORK_PLACE', type: 0 },
{ name: '动火方法', key_name: 'HOT_WORK_METHOD_ID', type: 0 },
{ name: '动火等级', key_name: 'HOT_WORK_LEVEL_INDEX', key_id: 'HOT_WORK_LEVEL_ID', type: 0 },
{ name: '动火开始时间', key_name: 'HOT_WORK_TIME_START', type: 0 },
{ name: '动火结束时间', key_name: 'HOT_WORK_TIME_END', type: 0 },
{ name: '作业内容', key_name: 'JOB_CONTENT', type: 0 },
{ name: '动火操作人', key_name: 'USER_NAME', type: 0 },
{ name: '动火操作人', key_name: 'SUPERVISOR_OF_HOT_WORK_UNIT', type: 0 },
],
form: {
//
APPLY_DEPARTMENT_NAME: this.$store.getters.getUserInfo.DEPARTMENT_NAME,
//
APPLY_USER_NAME: this.$store.getters.getUserInfo.NAME,
//
JOB_NUMBER: '',
//
APPLICATION_DATE: '',
//
JOB_TYPE_ID: '',
JOB_TYPE_NAME: '',
//
HOT_WORK_POSITION: '',
//
HOT_WORK_METHOD_ID: '',
//
HOT_WORK_LEVEL_ID: '',
HOT_WORK_LEVEL_INDEX: '',
/** 动火开始时间 */
HOT_WORK_TIME_START: '',
/** 动火结束时间 */
HOT_WORK_TIME_END: '',
/** 作业内容 */
JOB_CONTENT: '',
/** 动火操作人 */
USER_NAME: '',
/** 动火监火人 */
SUPERVISOR_OF_HOT_WORK_UNIT: '',
},
rules: {
APPLY_DEPARTMENT_NAME: [{ type: 'string', required: true, message: '请选择申请单位', trigger: ['blur', 'change'] }],
APPLY_USER_NAME: [{ type: 'string', required: true, message: '请选择申请办理人', trigger: ['blur', 'change'] }],
JOB_NUMBER: [{ type: 'string', required: false, message: '请输入作业编号', trigger: ['blur', 'change'] }],
APPLICATION_DATE: [{ type: 'string', required: true, message: '请选择申请日期', trigger: ['blur', 'change'] }],
JOB_TYPE_NAME: [{ type: 'string', required: true, message: '请选择动火类型', trigger: ['blur', 'change'] }],
HOT_WORK_POSITION: [{ type: 'string', required: true, message: '请输入动火部位', trigger: ['blur', 'change'] }],
HOT_WORK_METHOD_ID: [{ type: 'string', required: false, message: '请选择动火方法', trigger: ['blur', 'change'] }],
HOT_WORK_TIME_START: [{ type: 'string', required: true, message: '请选择动火开始时间', trigger: ['blur', 'change'] }],
HOT_WORK_TIME_END: [{ type: 'string', required: true, message: '请选择动火结束时间', trigger: ['blur', 'change'] }],
JOB_CONTENT: [{ type: 'string', required: true, message: '请输入作业内容', trigger: ['blur', 'change'] }],
USER_NAME: [{ type: 'string', required: true, message: '请选择动火操作人', trigger: ['blur', 'change'] }],
SUPERVISOR_OF_HOT_WORK_UNIT: [{ type: 'string', required: true, message: '请输入动火监火人', trigger: ['blur', 'change'] }],
},
picker: {
show: false,
columns: [],
key: 'NAME',
type: 'picker'
},
dateTimePicker: {
show: false,
value: Number(new Date()),
min: new Date().getTime(),
mode: 'datetime',
type: 'datetime-picker'
},
/** 其他动火方法选择器是否显示 */
otherWorkMethodShow: false,
/** 其他动火操作人选择器是否展示 */
otherUserNameSelectShow: false,
}
},
onLoad(options) {
this.form.CORP_ID = options.CORPINFO_ID
this.form.CORP_NAME = options.CORP_NAME
this.type = options.type
this.fnGetData(options.taskId)
},
methods: {
async fnGetData(taskId) {
let resData = await getTaskInfo({EW_RU_TASK_ID: taskId})
console.log('resData :>> ', resData);
},
fnDateTimePickerClick(event) {
this.dateTimePicker.type = event
this.dateTimePicker.value = Number(new Date(this.form[event])) || Number(new Date())
this.dateTimePicker.show = true
},
fnSingleChoiceClick(event) {
this.picker.type = event;
if (event === 'JOB_TYPE_NAME') this.picker.columns = [[{ ID: '0', NAME: '内部作业' }, { ID: '1', NAME: '相关方作业' }]];
if (event === 'HOT_WORK_LEVEL_INDEX') this.picker.columns = [[{ ID: '0', NAME: '特级' }, { ID: '1', NAME: '一级' }, { ID: '2', NAME: '二级' }, { ID: '3', NAME: '三级' }]]
this.picker.show = true;
},
fnSingleChoiceConfirm(event) {
if (this.picker.type === 'JOB_TYPE_NAME') {
this.form.JOB_TYPE_ID = event.value[0].ID
this.form.JOB_TYPE_NAME = event.value[0].NAME
}
if (this.picker.type === 'HOT_WORK_LEVEL_INDEX') {
this.form.HOT_WORK_LEVEL_ID = event.value[0].ID
this.form.HOT_WORK_LEVEL_INDEX = event.value[0].NAME
}
this.fnSingleChoiceCancel()
},
fnSingleChoiceCancel() {
this.picker.show = false
},
fnDateTimePickerConfirm(event) {
this.form[this.dateTimePicker.type] = uni.$u.timeFormat(event.value, 'yyyy-mm-dd hh:MM')
this.fnDateTimePickerCancel()
},
fnDateTimePickerCancel() {
this.dateTimePicker.show = false
},
fnDateTimePickerClick(event) {
this.dateTimePicker.type = event
this.dateTimePicker.value = Number(new Date(this.form[event])) || Number(new Date())
this.dateTimePicker.show = true
},
/**
* 下一步所触发的按钮事件
*/
async fnSubmit() {
try {
await this.$refs.formRef.validate()
try {
await setSubmitForm({
form: this.form,
formItems: this.formItems,
TYPE: this.type,
CORP_ID: this.form.CORP_ID
})
} catch { }
} catch (err) {
uni.$u.toast('请补全必填项')
}
}
}
}
</script>
<style scoped lang="scss"></style>

View File

@ -70,6 +70,10 @@ export default {
'035958e685cf4850bc40151c5e0617a6': '',
'default': '/pages/eight_assignments/cut_road/apply'
},
'hotWork': {
'035958e685cf4850bc40151c5e0617a6': '',
'default': '/pages/eight_assignments/hot_work/apply'
},
}
const url = urlByTypeMap[this.type][this.select_corp] ?? urlByTypeMap[this.type].default
let params = {}

View File

@ -20,7 +20,11 @@
<view class="flex-between mt-10 subtitle">
<view></view>
<view class="flex-between">
<u-button type="primary" text="流程" size="mini" class="bth-mini"
<u-button type="primary" text="修改" size="mini" class="bth-mini" @click="$u.route({
url: '/pages/eight_assignments/hot_work/apply',
params: { taskId: item.taskId }
})" />
<u-button type="primary" text="流程" size="mini" class="bth-mini ml-10"
@click="$u.route({
url: '/pages/eight_assignments/technological_process',
params: {taskId:item.taskId,type,title}

View File

@ -2,7 +2,7 @@
<view class="content">
<view class="card">
<u-cell-group>
<block v-for="(item,index) in form">
<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>
@ -24,7 +24,7 @@
</u-cell-group>
<u-divider text="审批人员" textPosition="left" textColor="#3c9cff" lineColor="#3c9cff"/>
<u-cell-group>
<block v-for="(item,index) in jobs">
<block v-for="(item, index) in jobs" :key="index">
<u-cell :key="index" :title="item.TYPE_DESCRIBE">
<template #label>
<view class="mt-10">

View File

@ -1,4 +1,4 @@
let requestPath = 'http://192.168.0.18:8199/'; // 后台请求地址
let requestPath = 'http://192.168.0.112:8199/'; // 后台请求地址
// let requestPath = 'https://skqhdg.porthebei.com:9006/qa-prevention-xgf/'; // 后台请求地址
// let requestPath = 'https://qgxgf.qhdsafety.com/qa-prevention-xgf/'; // 外网地址
import store from '../store/index'