1. 动火作业申请,添加是否安全总监审批字段
2. 动火作业申请,添加是否需要气体检测字段
八项作业
mengfanliang 2024-08-30 11:29:53 +08:00
parent bfe823ed2d
commit c57dda5157
2 changed files with 146 additions and 87 deletions

View File

@ -3,93 +3,93 @@
<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-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-input v-model="form.APPLY_USER_NAME" border="none" readonly />
</u-form-item>
<u-form-item label="作业分公司" prop="CORP_NAME" borderBottom required>
<u-input v-model="form.CORP_NAME" border="none" readonly/>
<u-input v-model="form.CORP_NAME" border="none" readonly />
</u-form-item>
<u-form-item label="吊装地点" prop="WORK_PLACE" borderBottom required>
<u-input v-model="form.WORK_PLACE" border="none"/>
<u-input v-model="form.WORK_PLACE" border="none" />
</u-form-item>
<u-form-item label="吊具名称" prop="TOOL_NAME" borderBottom required>
<u-input v-model="form.TOOL_NAME" border="none"/>
<u-input v-model="form.TOOL_NAME" border="none" />
</u-form-item>
<u-form-item label="吊装作业人" prop="WORK_USER" borderBottom required>
<u-input v-model="form.WORK_USER" border="none"/>
<u-input v-model="form.WORK_USER" border="none" />
</u-form-item>
<u-form-item label="司索人" prop="SISUO_USER" borderBottom required>
<u-input v-model="form.SISUO_USER" border="none"/>
<u-input v-model="form.SISUO_USER" border="none" />
</u-form-item>
<u-form-item label="指挥人员" prop="PROJECT_MANAGER" borderBottom required>
<u-input v-model="form.PROJECT_MANAGER" border="none"/>
<u-input v-model="form.PROJECT_MANAGER" border="none" />
</u-form-item>
<u-form-item label="吊物质量(吨)" prop="PART_WEIGHT" borderBottom required>
<u-input v-model="form.PART_WEIGHT" border="none" type="number"/>
<u-input v-model="form.PART_WEIGHT" border="none" type="number" />
</u-form-item>
<u-form-item label="作业级别" prop="WORK_LEVEL_NAME" borderBottom required
@click="fnSingleChoiceClick('WORK_LEVEL_NAME')">
<u-input v-model="form.WORK_LEVEL_NAME" border="none" readonly/>
@click="fnSingleChoiceClick('WORK_LEVEL_NAME')">
<u-input v-model="form.WORK_LEVEL_NAME" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="吊物内容" prop="WORK_CONTENT" borderBottom required labelPosition="top" labelWidth="auto">
<u-textarea v-model="form.WORK_CONTENT" border="none" autoHeight maxlength="-1"/>
<u-textarea v-model="form.WORK_CONTENT" border="none" autoHeight maxlength="-1" />
</u-form-item>
<u-form-item label="作业开始时间" prop="WORK_START_DATE" borderBottom required
@click="fnDateTimePickerClick('WORK_START_DATE')">
<u-input v-model="form.WORK_START_DATE" border="none" readonly/>
@click="fnDateTimePickerClick('WORK_START_DATE')">
<u-input v-model="form.WORK_START_DATE" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="作业结束时间" prop="WORK_END_DATE" borderBottom required
@click="fnDateTimePickerClick('WORK_END_DATE')">
<u-input v-model="form.WORK_END_DATE" border="none" readonly/>
@click="fnDateTimePickerClick('WORK_END_DATE')">
<u-input v-model="form.WORK_END_DATE" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="地点坐标" borderBottom required>
<u-button type="primary" size="small" text="定位" :customStyle="{width:'100upx',margin:0}"
@click="fnLocation"/>
<u-button type="primary" size="small" text="定位" :customStyle="{ width: '100upx', margin: 0 }"
@click="fnLocation" />
</u-form-item>
<u-form-item label="经度" prop="WORK_LONGITUDE" borderBottom required>
<u-input v-model="form.WORK_LONGITUDE" border="none" readonly/>
<u-input v-model="form.WORK_LONGITUDE" border="none" readonly />
</u-form-item>
<u-form-item label="纬度" prop="WORK_LATITUDE" borderBottom required>
<u-input v-model="form.WORK_LATITUDE" border="none" readonly/>
<u-input v-model="form.WORK_LATITUDE" border="none" readonly />
</u-form-item>
<u-form-item label="关联的其他特殊作业及安全作业票编号" prop="SPECIAL_WORK" borderBottom required
labelPosition="top" labelWidth="auto">
<u-form-item label="关联的其他特殊作业及安全作业票编号" prop="SPECIAL_WORK" borderBottom required labelPosition="top"
labelWidth="auto">
<u-button type="primary" size="mini" text="选择其它"
:customStyle="{position: 'absolute',top: '-46upx',right: '20upx',width: '150upx'}"
@click="otherAssignmentsShow = true"/>
<u-textarea v-model="form.SPECIAL_WORK" border="none" autoHeight maxlength="-1"/>
:customStyle="{ position: 'absolute', top: '-46upx', right: '20upx', width: '150upx' }"
@click="otherAssignmentsShow = true" />
<u-textarea v-model="form.SPECIAL_WORK" border="none" autoHeight maxlength="-1" />
</u-form-item>
<u-form-item label="风险辨识结果" prop="RISK_IDENTIFICATION" borderBottom required labelPosition="top"
labelWidth="auto">
labelWidth="auto">
<u-button type="primary" size="mini" text="选择其它"
:customStyle="{position: 'absolute',top: '-46upx',right: '20upx',width: '150upx'}"
@click="otherIdentificationShow = true"/>
<u-textarea v-model="form.RISK_IDENTIFICATION" border="none" autoHeight maxlength="-1"/>
:customStyle="{ position: 'absolute', top: '-46upx', right: '20upx', width: '150upx' }"
@click="otherIdentificationShow = true" />
<u-textarea v-model="form.RISK_IDENTIFICATION" border="none" autoHeight maxlength="-1" />
</u-form-item>
</u-form>
<view class="mt-10">
<u-button type="primary" text="下一步" @click="$u.debounce(fnSubmit, 1000,true)"/>
<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"/>
:defaultIndex="picker.defaultIndex" @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="otherAssignmentsShow" v-model="form.SPECIAL_WORK" type="assignments"/>
<other-select :visible.sync="otherIdentificationShow" v-model="form.RISK_IDENTIFICATION" type="identification"/>
:minDate="dateTimePicker.min" :key="dateTimePicker.type" @confirm="fnDateTimePickerConfirm"
@cancel="fnDateTimePickerCancel" />
<other-select :visible.sync="otherAssignmentsShow" v-model="form.SPECIAL_WORK" type="assignments" />
<other-select :visible.sync="otherIdentificationShow" v-model="form.RISK_IDENTIFICATION" type="identification" />
</view>
</template>
<script>
import OtherSelect from '@/components/other-select/index.vue';
import Sign from '@/components/sign/sign.vue'
import {setSubmitForm} from "@/utils/submitHomeworkProcess";
import { setSubmitForm } from "@/utils/submitHomeworkProcess";
import { getTaskInfo } from '@/api';
export default {
@ -101,23 +101,23 @@ export default {
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: 'CORP_NAME', key_id: 'CORP_ID', type: 0},
{name: '吊装地点', key_name: 'WORK_PLACE', type: 0},
{name: '吊具名称', key_name: 'TOOL_NAME', type: 0},
{name: '吊装作业人', key_name: 'WORK_USER', type: 0},
{name: '司索人', key_name: 'SISUO_USER', type: 0},
{name: '指挥人员', key_name: 'PROJECT_MANAGER', type: 0},
{name: '吊物质量(吨)', key_name: 'PART_WEIGHT', type: 0},
{name: '作业级别', key_name: 'WORK_LEVEL_NAME', key_id: 'WORK_LEVEL', type: 0},
{name: '吊物内容', key_name: 'WORK_CONTENT', type: 0},
{name: '作业开始时间', key_name: 'WORK_START_DATE', type: 0},
{name: '作业结束时间', key_name: 'WORK_END_DATE', type: 0},
{name: '经度', key_name: 'WORK_LONGITUDE', type: 0},
{name: '纬度', key_name: 'WORK_LATITUDE', type: 0},
{name: '关联的其他特殊作业及安全作业票编号', key_name: 'SPECIAL_WORK', type: 0},
{name: '风险辨识结果', key_name: 'RISK_IDENTIFICATION', type: 0},
{ 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: 'CORP_NAME', key_id: 'CORP_ID', type: 0 },
{ name: '吊装地点', key_name: 'WORK_PLACE', type: 0 },
{ name: '吊具名称', key_name: 'TOOL_NAME', type: 0 },
{ name: '吊装作业人', key_name: 'WORK_USER', type: 0 },
{ name: '司索人', key_name: 'SISUO_USER', type: 0 },
{ name: '指挥人员', key_name: 'PROJECT_MANAGER', type: 0 },
{ name: '吊物质量(吨)', key_name: 'PART_WEIGHT', type: 0 },
{ name: '作业级别', key_name: 'WORK_LEVEL_NAME', key_id: 'WORK_LEVEL_ID', type: 0 },
{ name: '吊物内容', key_name: 'WORK_CONTENT', type: 0 },
{ name: '作业开始时间', key_name: 'WORK_START_DATE', type: 0 },
{ name: '作业结束时间', key_name: 'WORK_END_DATE', type: 0 },
{ name: '经度', key_name: 'WORK_LONGITUDE', type: 0 },
{ name: '纬度', key_name: 'WORK_LATITUDE', type: 0 },
{ name: '关联的其他特殊作业及安全作业票编号', key_name: 'SPECIAL_WORK', type: 0 },
{ name: '风险辨识结果', key_name: 'RISK_IDENTIFICATION', type: 0 },
],
form: {
APPLY_DEPARTMENT_ID: this.$store.getters.getUserInfo.DEPARTMENT_ID,
@ -132,8 +132,8 @@ export default {
SISUO_USER: '',
PROJECT_MANAGER: '',
PART_WEIGHT: '',
WORK_LEVEL_ID: '',
WORK_LEVEL_NAME: '',
WORK_LEVEL: '',
WORK_CONTENT: '',
WORK_START_DATE: '',
WORK_END_DATE: '',
@ -143,21 +143,21 @@ export default {
RISK_IDENTIFICATION: '',
},
rules: {
APPLY_DEPARTMENT_ID: [{type: 'string', required: true, message: '请选择申请单位', trigger: ['blur', 'change']}],
APPLY_USER_NAME: [{type: 'string', required: true, message: '请选择申请人', trigger: ['blur', 'change']}],
CORP_NAME: [{type: 'string', required: true, message: '请选择作业分公司', trigger: ['blur', 'change']}],
WORK_PLACE: [{type: 'string', required: true, message: '请输入吊装地点', trigger: ['blur', 'change']}],
TOOL_NAME: [{type: 'string', required: true, message: '请输入吊具名称', trigger: ['blur', 'change']}],
WORK_USER: [{type: 'string', required: true, message: '请输入吊装作业人', trigger: ['blur', 'change']}],
SISUO_USER: [{type: 'string', required: true, message: '请输入司索人', trigger: ['blur', 'change']}],
PROJECT_MANAGER: [{type: 'string', required: true, message: '请输入指挥人员', trigger: ['blur', 'change']}],
PART_WEIGHT: [{type: 'string', required: true, message: '请输入吊物质量(吨)', trigger: ['blur', 'change']}],
WORK_LEVEL_NAME: [{type: 'string', required: true, message: '请选择作业级别', trigger: ['blur', 'change']}],
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']}],
APPLY_DEPARTMENT_ID: [{ type: 'string', required: true, message: '请选择申请单位', trigger: ['blur', 'change'] }],
APPLY_USER_NAME: [{ type: 'string', required: true, message: '请选择申请人', trigger: ['blur', 'change'] }],
CORP_NAME: [{ type: 'string', required: true, message: '请选择作业分公司', trigger: ['blur', 'change'] }],
WORK_PLACE: [{ type: 'string', required: true, message: '请输入吊装地点', trigger: ['blur', 'change'] }],
TOOL_NAME: [{ type: 'string', required: true, message: '请输入吊具名称', trigger: ['blur', 'change'] }],
WORK_USER: [{ type: 'string', required: true, message: '请输入吊装作业人', trigger: ['blur', 'change'] }],
SISUO_USER: [{ type: 'string', required: true, message: '请输入司索人', trigger: ['blur', 'change'] }],
PROJECT_MANAGER: [{ type: 'string', required: true, message: '请输入指挥人员', trigger: ['blur', 'change'] }],
PART_WEIGHT: [{ type: 'string', required: true, message: '请输入吊物质量(吨)', trigger: ['blur', 'change'] }],
WORK_LEVEL_NAME: [{ type: 'string', required: true, message: '请选择作业级别', trigger: ['blur', 'change'] }],
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'] }],
SPECIAL_WORK: [{
type: 'string',
required: true,
@ -175,7 +175,8 @@ export default {
show: false,
columns: [],
key: 'NAME',
type: 'picker'
type: 'picker',
defaultIndex: [] // ,,, picker ,, fnGetData ,
},
dateTimePicker: {
show: false,
@ -186,6 +187,8 @@ export default {
},
otherAssignmentsShow: false,
otherIdentificationShow: false,
/** 存储作业级别选中态 */
workLevelNameArr: [],
}
},
onLoad(options) {
@ -198,27 +201,41 @@ export default {
},
methods: {
async fnGetData(taskId) {
let resData = await getTaskInfo({EW_RU_TASK_ID: taskId});
let resData = await getTaskInfo({ EW_RU_TASK_ID: taskId });
if (resData.list.form && resData.list.form.length > 0) {
resData.list.form.forEach((sos, index) => {
this.form[sos.ITEM_NAME] = sos.ITEM_VALUE;
if (sos.FK_NAME) {
this.form[sos.FK_NAME] = sos.FK_VALUE;
// FK_NAME [], [] , u-picker defaultIndex,
// , ,
// u-picker defaultIndex 使:
// https://uviewui.com/components/picker.html#%E9%BB%98%E8%AE%A4%E5%80%BC
if (sos.FK_NAME === 'WORK_LEVEL_ID') {
this.workLevelNameArr = [Number(sos.FK_VALUE)];
}
}
})
}
},
fnSingleChoiceClick(event) {
this.picker.type = event
if (event === 'WORK_LEVEL_NAME') this.picker.columns = [[
{NAME: 'I级高处作业', ID: '1'},
{NAME: 'II级高处作业', ID: '2'},
{NAME: 'III级高处作业', ID: '3'},
{NAME: 'IV级高处作业', ID: '4'},
]]
if (event === 'WORK_LEVEL_NAME') {
this.picker.columns = [[
{ NAME: 'I级高处作业', ID: '0' },
{ NAME: 'II级高处作业', ID: '1' },
{ NAME: 'III级高处作业', ID: '2' },
{ NAME: 'IV级高处作业', ID: '3' },
]];
if (this.workLevelNameArr.length > 0) this.picker.defaultIndex = this.workLevelNameArr;
}
this.picker.show = true
},
fnSingleChoiceConfirm(event) {
if (this.picker.type === 'WORK_LEVEL_NAME') {
this.form.WORK_LEVEL = event.value[0].ID
this.form.WORK_LEVEL_ID = event.value[0].ID
this.form.WORK_LEVEL_NAME = event.value[0].NAME
this.picker.defaultIndex = event.indexs; // picker , this.picker.defaultIndex
}
this.fnSingleChoiceCancel()
},
@ -268,5 +285,4 @@ export default {
}
</script>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>

View File

@ -57,13 +57,25 @@
<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-item label="是否安全总监审批" prop="IS_SAFETY_DIRECTOR" borderBottom required>
<u-radio-group v-model="form.IS_SAFETY_DIRECTOR" :customStyle="{ 'justify-content': 'flex-end' }">
<u-radio label="是" name="1" />
<u-radio :customStyle="{ marginLeft: '8px' }" label="否" name="0" />
</u-radio-group>
</u-form-item>
<u-form-item label="是否需要气体检测" props="IS_GAS_TESTING" borderBottom required>
<u-radio-group v-model="form.IS_GAS_TESTING" :customStyle="{ 'justify-content': 'flex-end' }">
<u-radio label="是" name="1" />
<u-radio :customStyle="{ marginLeft: '8px' }" label="否" name="0" />
</u-radio-group>
</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" />
:defaultIndex="picker.defaultIndex" @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" />
@ -89,7 +101,7 @@ export default {
{ 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_POSITION', 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 },
@ -97,6 +109,8 @@ export default {
{ name: '作业内容', key_name: 'JOB_CONTENT', type: 0 },
{ name: '动火操作人', key_name: 'USER_NAME', type: 0 },
{ name: '动火操作人', key_name: 'SUPERVISOR_OF_HOT_WORK_UNIT', type: 0 },
{ name: '是否安全总监审批', key_name: 'IS_SAFETY_DIRECTOR', type: 0 },
{ name: '是否需要气体检测', key_name: 'IS_GAS_TESTING', type: 0 },
],
form: {
//
@ -127,26 +141,34 @@ export default {
USER_NAME: '',
/** 动火监火人 */
SUPERVISOR_OF_HOT_WORK_UNIT: '',
/** 是否安全总监审批 */
IS_SAFETY_DIRECTOR: '',
/** 是否需要气体检测 */
IS_GAS_TESTING: '',
},
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'] }],
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_LEVEL_INDEX: [{ type: 'string', required: true, message: '请选择动火等级', trigger: ['blue', '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'] }],
IS_SAFETY_DIRECTOR: [{ type: 'string', required: true, message: '请选择是否安全总监审批', trigger: ['blur', 'change'] }],
IS_GAS_TESTING: [{ type: 'string', required: true, message: '请选择是否需要气体检测', trigger: ['blur', 'change'] }],
},
picker: {
show: false,
columns: [],
key: 'NAME',
type: 'picker'
type: 'picker',
defaultIndex: []
},
dateTimePicker: {
show: false,
@ -159,6 +181,10 @@ export default {
otherWorkMethodShow: false,
/** 其他动火操作人选择器是否展示 */
otherUserNameSelectShow: false,
/** 存储作业类型选中态 */
jobTypeNameArr: [],
/** 存储动火等级选中态 */
hotWorkLevelNameArr: []
}
},
onLoad(options) {
@ -171,10 +197,19 @@ export default {
},
methods: {
async fnGetData(taskId) {
let resData = await getTaskInfo({EW_RU_TASK_ID: taskId})
let resData = await getTaskInfo({ EW_RU_TASK_ID: taskId })
if (resData.list.form && resData.list.form.length > 0) {
resData.list.form.forEach((sos, index) => {
this.form[sos.ITEM_NAME] = sos.ITEM_VALUE;
if (sos.FK_NAME) {
this.form[sos.FK_NAME] = sos.FK_VALUE;
if (sos.FK_NAME === "JOB_TYPE_ID") {
this.jobTypeNameArr = [Number(sos.FK_VALUE)];
}
if (sos.FK_NAME === "HOT_WORK_LEVEL_ID") {
this.hotWorkLevelNameArr = [Number(sos.FK_VALUE)];
}
}
})
}
},
@ -185,18 +220,26 @@ export default {
},
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: '三级' }]]
if (event === 'JOB_TYPE_NAME') {
this.picker.columns = [[{ ID: '0', NAME: '内部作业' }, { ID: '1', NAME: '相关方作业' }]]
if (this.jobTypeNameArr.length > 0) this.picker.defaultIndex = this.jobTypeNameArr;
};
if (event === 'HOT_WORK_LEVEL_INDEX') {
this.picker.columns = [[{ ID: '0', NAME: '特级' }, { ID: '1', NAME: '一级' }, { ID: '2', NAME: '二级' }, { ID: '3', NAME: '三级' }]]
if (this.hotWorkLevelNameArr.length > 0) this.picker.defaultIndex = this.hotWorkLevelNameArr;
}
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
this.picker.defaultIndex = event.indexs
}
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.picker.defaultIndex = event.indexs
}
this.fnSingleChoiceCancel()
},